coder-config 0.40.10 → 0.40.12
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/config-loader.js +14 -1
- package/lib/constants.js +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/{index-CTytYK0Q.js → index-BEuxBYDG.js} +116 -116
- package/ui/dist/index.html +1 -1
|
@@ -33,11 +33,11 @@ function OE(e,t){for(var r=0;r<t.length;r++){const s=t[r];if(typeof s!="string"&
|
|
|
33
33
|
*/var Lv;function WE(){if(Lv)return Vr;Lv=1;var e=op(),t=HE();function r(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,p=1;p<arguments.length;p++)a+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function u(i,a){d(i,a),d(i+"Capture",a)}function d(i,a){for(o[i]=a,i=0;i<a.length;i++)s.add(a[i])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,m={},h={};function x(i){return c.call(h,i)?!0:c.call(m,i)?!1:f.test(i)?h[i]=!0:(m[i]=!0,!1)}function w(i,a,p,S){if(p!==null&&p.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return S?!1:p!==null?!p.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,a,p,S){if(a===null||typeof a>"u"||w(i,a,p,S))return!0;if(S)return!1;if(p!==null)switch(p.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function _(i,a,p,S,A,D,V){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=S,this.attributeNamespace=A,this.mustUseProperty=p,this.propertyName=i,this.type=a,this.sanitizeURL=D,this.removeEmptyString=V}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){v[i]=new _(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var a=i[0];v[a]=new _(a,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){v[i]=new _(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){v[i]=new _(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){v[i]=new _(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){v[i]=new _(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){v[i]=new _(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){v[i]=new _(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){v[i]=new _(i,5,!1,i.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function g(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 a=i.replace(b,g);v[a]=new _(a,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var a=i.replace(b,g);v[a]=new _(a,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var a=i.replace(b,g);v[a]=new _(a,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){v[i]=new _(i,1,!1,i.toLowerCase(),null,!1,!1)}),v.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){v[i]=new _(i,1,!1,i.toLowerCase(),null,!0,!0)});function y(i,a,p,S){var A=v.hasOwnProperty(a)?v[a]:null;(A!==null?A.type!==0:S||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(k(a,p,A,S)&&(p=null),S||A===null?x(a)&&(p===null?i.removeAttribute(a):i.setAttribute(a,""+p)):A.mustUseProperty?i[A.propertyName]=p===null?A.type===3?!1:"":p:(a=A.attributeName,S=A.attributeNamespace,p===null?i.removeAttribute(a):(A=A.type,p=A===3||A===4&&p===!0?"":""+p,S?i.setAttributeNS(S,a,p):i.setAttribute(a,p))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),P=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),O=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),U=Symbol.iterator;function L(i){return i===null||typeof i!="object"?null:(i=U&&i[U]||i["@@iterator"],typeof i=="function"?i:null)}var M=Object.assign,B;function q(i){if(B===void 0)try{throw Error()}catch(p){var a=p.stack.trim().match(/\n( *(at )?)/);B=a&&a[1]||""}return`
|
|
34
34
|
`+B+i}var F=!1;function oe(i,a){if(!i||F)return"";F=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(he){var S=he}Reflect.construct(i,[],a)}else{try{a.call()}catch(he){S=he}i.call(a.prototype)}else{try{throw Error()}catch(he){S=he}i()}}catch(he){if(he&&S&&typeof he.stack=="string"){for(var A=he.stack.split(`
|
|
35
35
|
`),D=S.stack.split(`
|
|
36
|
-
`),V=A.length-1,Q=D.length-1;1<=V&&0<=Q&&A[V]!==D[Q];)Q--;for(;1<=V&&0<=Q;V--,Q--)if(A[V]!==D[Q]){if(V!==1||Q!==1)do if(V--,Q--,0>Q||A[V]!==D[Q]){var
|
|
37
|
-
`+A[V].replace(" at new "," at ");return i.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",i.displayName)),te}while(1<=V&&0<=Q);break}}}finally{F=!1,Error.prepareStackTrace=p}return(i=i?i.displayName||i.name:"")?q(i):""}function fe(i){switch(i.tag){case 5:return q(i.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return i=oe(i.type,!1),i;case 11:return i=oe(i.type.render,!1),i;case 1:return i=oe(i.type,!0),i;default:return""}}function me(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 T:return"Fragment";case P:return"Portal";case R:return"Profiler";case N:return"StrictMode";case W:return"Suspense";case Y:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case I:return(i._context.displayName||"Context")+".Provider";case $:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return a=i.displayName||null,a!==null?a:me(i.type)||"Memo";case K:a=i._payload,i=i._init;try{return me(i(a))}catch{}}return null}function X(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(a);case 8:return a===N?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function H(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ae(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ne(i){var a=ae(i)?"checked":"value",p=Object.getOwnPropertyDescriptor(i.constructor.prototype,a),S=""+i[a];if(!i.hasOwnProperty(a)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var A=p.get,D=p.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return A.call(this)},set:function(V){S=""+V,D.call(this,V)}}),Object.defineProperty(i,a,{enumerable:p.enumerable}),{getValue:function(){return S},setValue:function(V){S=""+V},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function J(i){i._valueTracker||(i._valueTracker=ne(i))}function ie(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var p=a.getValue(),S="";return i&&(S=ae(i)?i.checked?"true":"false":i.value),i=S,i!==p?(a.setValue(i),!0):!1}function ye(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 Oe(i,a){var p=a.checked;return M({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??i._wrapperState.initialChecked})}function Ve(i,a){var p=a.defaultValue==null?"":a.defaultValue,S=a.checked!=null?a.checked:a.defaultChecked;p=H(a.value!=null?a.value:p),i._wrapperState={initialChecked:S,initialValue:p,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function re(i,a){a=a.checked,a!=null&&y(i,"checked",a,!1)}function de(i,a){re(i,a);var p=H(a.value),S=a.type;if(p!=null)S==="number"?(p===0&&i.value===""||i.value!=p)&&(i.value=""+p):i.value!==""+p&&(i.value=""+p);else if(S==="submit"||S==="reset"){i.removeAttribute("value");return}a.hasOwnProperty("value")?Re(i,a.type,p):a.hasOwnProperty("defaultValue")&&Re(i,a.type,H(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(i.defaultChecked=!!a.defaultChecked)}function De(i,a,p){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var S=a.type;if(!(S!=="submit"&&S!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+i._wrapperState.initialValue,p||a===i.value||(i.value=a),i.defaultValue=a}p=i.name,p!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,p!==""&&(i.name=p)}function Re(i,a,p){(a!=="number"||ye(i.ownerDocument)!==i)&&(p==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+p&&(i.defaultValue=""+p))}var Ze=Array.isArray;function Se(i,a,p,S){if(i=i.options,a){a={};for(var A=0;A<p.length;A++)a["$"+p[A]]=!0;for(p=0;p<i.length;p++)A=a.hasOwnProperty("$"+i[p].value),i[p].selected!==A&&(i[p].selected=A),A&&S&&(i[p].defaultSelected=!0)}else{for(p=""+H(p),a=null,A=0;A<i.length;A++){if(i[A].value===p){i[A].selected=!0,S&&(i[A].defaultSelected=!0);return}a!==null||i[A].disabled||(a=i[A])}a!==null&&(a.selected=!0)}}function ge(i,a){if(a.dangerouslySetInnerHTML!=null)throw Error(r(91));return M({},a,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Me(i,a){var p=a.value;if(p==null){if(p=a.children,a=a.defaultValue,p!=null){if(a!=null)throw Error(r(92));if(Ze(p)){if(1<p.length)throw Error(r(93));p=p[0]}a=p}a==null&&(a=""),p=a}i._wrapperState={initialValue:H(p)}}function ht(i,a){var p=H(a.value),S=H(a.defaultValue);p!=null&&(p=""+p,p!==i.value&&(i.value=p),a.defaultValue==null&&i.defaultValue!==p&&(i.defaultValue=p)),S!=null&&(i.defaultValue=""+S)}function Rt(i){var a=i.textContent;a===i._wrapperState.initialValue&&a!==""&&a!==null&&(i.value=a)}function pe(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 be(i,a){return i==null||i==="http://www.w3.org/1999/xhtml"?pe(a):i==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Be,Ge=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,p,S,A){MSApp.execUnsafeLocalFunction(function(){return i(a,p,S,A)})}:i})(function(i,a){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=a;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Be.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;a.firstChild;)i.appendChild(a.firstChild)}});function Ke(i,a){if(a){var p=i.firstChild;if(p&&p===i.lastChild&&p.nodeType===3){p.nodeValue=a;return}}i.textContent=a}var bt={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},Z=["Webkit","ms","Moz","O"];Object.keys(bt).forEach(function(i){Z.forEach(function(a){a=a+i.charAt(0).toUpperCase()+i.substring(1),bt[a]=bt[i]})});function Pe(i,a,p){return a==null||typeof a=="boolean"||a===""?"":p||typeof a!="number"||a===0||bt.hasOwnProperty(i)&&bt[i]?(""+a).trim():a+"px"}function Le(i,a){i=i.style;for(var p in a)if(a.hasOwnProperty(p)){var S=p.indexOf("--")===0,A=Pe(p,a[p],S);p==="float"&&(p="cssFloat"),S?i.setProperty(p,A):i[p]=A}}var st=M({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 et(i,a){if(a){if(st[i]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(r(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(r(61))}if(a.style!=null&&typeof a.style!="object")throw Error(r(62))}}function jt(i,a){if(i.indexOf("-")===-1)return typeof a.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 ft=null;function wt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Vt=null,rr=null,jr=null;function hn(i){if(i=ya(i)){if(typeof Vt!="function")throw Error(r(280));var a=i.stateNode;a&&(a=sc(a),Vt(i.stateNode,i.type,a))}}function tt(i){rr?jr?jr.push(i):jr=[i]:rr=i}function qt(){if(rr){var i=rr,a=jr;if(jr=rr=null,hn(i),a)for(i=0;i<a.length;i++)hn(a[i])}}function nr(i,a){return i(a)}function Nr(){}var Ns=!1;function Qt(i,a,p){if(Ns)return i(a,p);Ns=!0;try{return nr(i,a,p)}finally{Ns=!1,(rr!==null||jr!==null)&&(Nr(),qt())}}function cr(i,a){var p=i.stateNode;if(p===null)return null;var S=sc(p);if(S===null)return null;p=S[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(S=!S.disabled)||(i=i.type,S=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!S;break e;default:i=!1}if(i)return null;if(p&&typeof p!="function")throw Error(r(231,a,typeof p));return p}var Es=!1;if(l)try{var xr={};Object.defineProperty(xr,"passive",{get:function(){Es=!0}}),window.addEventListener("test",xr,xr),window.removeEventListener("test",xr,xr)}catch{Es=!1}function Qr(i,a,p,S,A,D,V,Q,te){var he=Array.prototype.slice.call(arguments,3);try{a.apply(p,he)}catch(ve){this.onError(ve)}}var Ps=!1,fn=null,ea=!1,Md=null,V2={onError:function(i){Ps=!0,fn=i}};function U2(i,a,p,S,A,D,V,Q,te){Ps=!1,fn=null,Qr.apply(V2,arguments)}function G2(i,a,p,S,A,D,V,Q,te){if(U2.apply(this,arguments),Ps){if(Ps){var he=fn;Ps=!1,fn=null}else throw Error(r(198));ea||(ea=!0,Md=he)}}function pi(i){var a=i,p=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(p=a.return),i=a.return;while(i)}return a.tag===3?p:null}function Qg(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function Zg(i){if(pi(i)!==i)throw Error(r(188))}function K2(i){var a=i.alternate;if(!a){if(a=pi(i),a===null)throw Error(r(188));return a!==i?null:i}for(var p=i,S=a;;){var A=p.return;if(A===null)break;var D=A.alternate;if(D===null){if(S=A.return,S!==null){p=S;continue}break}if(A.child===D.child){for(D=A.child;D;){if(D===p)return Zg(A),i;if(D===S)return Zg(A),a;D=D.sibling}throw Error(r(188))}if(p.return!==S.return)p=A,S=D;else{for(var V=!1,Q=A.child;Q;){if(Q===p){V=!0,p=A,S=D;break}if(Q===S){V=!0,S=A,p=D;break}Q=Q.sibling}if(!V){for(Q=D.child;Q;){if(Q===p){V=!0,p=D,S=A;break}if(Q===S){V=!0,S=D,p=A;break}Q=Q.sibling}if(!V)throw Error(r(189))}}if(p.alternate!==S)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?i:a}function ex(i){return i=K2(i),i!==null?tx(i):null}function tx(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=tx(i);if(a!==null)return a;i=i.sibling}return null}var rx=t.unstable_scheduleCallback,nx=t.unstable_cancelCallback,q2=t.unstable_shouldYield,Y2=t.unstable_requestPaint,Yt=t.unstable_now,X2=t.unstable_getCurrentPriorityLevel,Dd=t.unstable_ImmediatePriority,sx=t.unstable_UserBlockingPriority,Bl=t.unstable_NormalPriority,J2=t.unstable_LowPriority,ix=t.unstable_IdlePriority,Fl=null,Wn=null;function Q2(i){if(Wn&&typeof Wn.onCommitFiberRoot=="function")try{Wn.onCommitFiberRoot(Fl,i,void 0,(i.current.flags&128)===128)}catch{}}var Pn=Math.clz32?Math.clz32:tN,Z2=Math.log,eN=Math.LN2;function tN(i){return i>>>=0,i===0?32:31-(Z2(i)/eN|0)|0}var $l=64,zl=4194304;function ta(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 Hl(i,a){var p=i.pendingLanes;if(p===0)return 0;var S=0,A=i.suspendedLanes,D=i.pingedLanes,V=p&268435455;if(V!==0){var Q=V&~A;Q!==0?S=ta(Q):(D&=V,D!==0&&(S=ta(D)))}else V=p&~A,V!==0?S=ta(V):D!==0&&(S=ta(D));if(S===0)return 0;if(a!==0&&a!==S&&(a&A)===0&&(A=S&-S,D=a&-a,A>=D||A===16&&(D&4194240)!==0))return a;if((S&4)!==0&&(S|=p&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=S;0<a;)p=31-Pn(a),A=1<<p,S|=i[p],a&=~A;return S}function rN(i,a){switch(i){case 1:case 2:case 4:return a+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 a+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 nN(i,a){for(var p=i.suspendedLanes,S=i.pingedLanes,A=i.expirationTimes,D=i.pendingLanes;0<D;){var V=31-Pn(D),Q=1<<V,te=A[V];te===-1?((Q&p)===0||(Q&S)!==0)&&(A[V]=rN(Q,a)):te<=a&&(i.expiredLanes|=Q),D&=~Q}}function Ld(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function ox(){var i=$l;return $l<<=1,($l&4194240)===0&&($l=64),i}function Id(i){for(var a=[],p=0;31>p;p++)a.push(i);return a}function ra(i,a,p){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-Pn(a),i[a]=p}function sN(i,a){var p=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var S=i.eventTimes;for(i=i.expirationTimes;0<p;){var A=31-Pn(p),D=1<<A;a[A]=0,S[A]=-1,i[A]=-1,p&=~D}}function Od(i,a){var p=i.entangledLanes|=a;for(i=i.entanglements;p;){var S=31-Pn(p),A=1<<S;A&a|i[S]&a&&(i[S]|=a),p&=~A}}var _t=0;function ax(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var lx,Bd,cx,ux,dx,Fd=!1,Wl=[],As=null,Ts=null,Rs=null,na=new Map,sa=new Map,Ms=[],iN="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 hx(i,a){switch(i){case"focusin":case"focusout":As=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":na.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":sa.delete(a.pointerId)}}function ia(i,a,p,S,A,D){return i===null||i.nativeEvent!==D?(i={blockedOn:a,domEventName:p,eventSystemFlags:S,nativeEvent:D,targetContainers:[A]},a!==null&&(a=ya(a),a!==null&&Bd(a)),i):(i.eventSystemFlags|=S,a=i.targetContainers,A!==null&&a.indexOf(A)===-1&&a.push(A),i)}function oN(i,a,p,S,A){switch(a){case"focusin":return As=ia(As,i,a,p,S,A),!0;case"dragenter":return Ts=ia(Ts,i,a,p,S,A),!0;case"mouseover":return Rs=ia(Rs,i,a,p,S,A),!0;case"pointerover":var D=A.pointerId;return na.set(D,ia(na.get(D)||null,i,a,p,S,A)),!0;case"gotpointercapture":return D=A.pointerId,sa.set(D,ia(sa.get(D)||null,i,a,p,S,A)),!0}return!1}function fx(i){var a=gi(i.target);if(a!==null){var p=pi(a);if(p!==null){if(a=p.tag,a===13){if(a=Qg(p),a!==null){i.blockedOn=a,dx(i.priority,function(){cx(p)});return}}else if(a===3&&p.stateNode.current.memoizedState.isDehydrated){i.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Vl(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var p=zd(i.domEventName,i.eventSystemFlags,a[0],i.nativeEvent);if(p===null){p=i.nativeEvent;var S=new p.constructor(p.type,p);ft=S,p.target.dispatchEvent(S),ft=null}else return a=ya(p),a!==null&&Bd(a),i.blockedOn=p,!1;a.shift()}return!0}function mx(i,a,p){Vl(i)&&p.delete(a)}function aN(){Fd=!1,As!==null&&Vl(As)&&(As=null),Ts!==null&&Vl(Ts)&&(Ts=null),Rs!==null&&Vl(Rs)&&(Rs=null),na.forEach(mx),sa.forEach(mx)}function oa(i,a){i.blockedOn===a&&(i.blockedOn=null,Fd||(Fd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,aN)))}function aa(i){function a(A){return oa(A,i)}if(0<Wl.length){oa(Wl[0],i);for(var p=1;p<Wl.length;p++){var S=Wl[p];S.blockedOn===i&&(S.blockedOn=null)}}for(As!==null&&oa(As,i),Ts!==null&&oa(Ts,i),Rs!==null&&oa(Rs,i),na.forEach(a),sa.forEach(a),p=0;p<Ms.length;p++)S=Ms[p],S.blockedOn===i&&(S.blockedOn=null);for(;0<Ms.length&&(p=Ms[0],p.blockedOn===null);)fx(p),p.blockedOn===null&&Ms.shift()}var qi=j.ReactCurrentBatchConfig,Ul=!0;function lN(i,a,p,S){var A=_t,D=qi.transition;qi.transition=null;try{_t=1,$d(i,a,p,S)}finally{_t=A,qi.transition=D}}function cN(i,a,p,S){var A=_t,D=qi.transition;qi.transition=null;try{_t=4,$d(i,a,p,S)}finally{_t=A,qi.transition=D}}function $d(i,a,p,S){if(Ul){var A=zd(i,a,p,S);if(A===null)sh(i,a,S,Gl,p),hx(i,S);else if(oN(A,i,a,p,S))S.stopPropagation();else if(hx(i,S),a&4&&-1<iN.indexOf(i)){for(;A!==null;){var D=ya(A);if(D!==null&&lx(D),D=zd(i,a,p,S),D===null&&sh(i,a,S,Gl,p),D===A)break;A=D}A!==null&&S.stopPropagation()}else sh(i,a,S,null,p)}}var Gl=null;function zd(i,a,p,S){if(Gl=null,i=wt(S),i=gi(i),i!==null)if(a=pi(i),a===null)i=null;else if(p=a.tag,p===13){if(i=Qg(a),i!==null)return i;i=null}else if(p===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null);return Gl=i,null}function px(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(X2()){case Dd:return 1;case sx:return 4;case Bl:case J2:return 16;case ix:return 536870912;default:return 16}default:return 16}}var Ds=null,Hd=null,Kl=null;function gx(){if(Kl)return Kl;var i,a=Hd,p=a.length,S,A="value"in Ds?Ds.value:Ds.textContent,D=A.length;for(i=0;i<p&&a[i]===A[i];i++);var V=p-i;for(S=1;S<=V&&a[p-S]===A[D-S];S++);return Kl=A.slice(i,1<S?1-S:void 0)}function ql(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function Yl(){return!0}function xx(){return!1}function Zr(i){function a(p,S,A,D,V){this._reactName=p,this._targetInst=A,this.type=S,this.nativeEvent=D,this.target=V,this.currentTarget=null;for(var Q in i)i.hasOwnProperty(Q)&&(p=i[Q],this[Q]=p?p(D):D[Q]);return this.isDefaultPrevented=(D.defaultPrevented!=null?D.defaultPrevented:D.returnValue===!1)?Yl:xx,this.isPropagationStopped=xx,this}return M(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Yl)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Yl)},persist:function(){},isPersistent:Yl}),a}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=Zr(Yi),la=M({},Yi,{view:0,detail:0}),uN=Zr(la),Vd,Ud,ca,Xl=M({},la,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kd,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!==ca&&(ca&&i.type==="mousemove"?(Vd=i.screenX-ca.screenX,Ud=i.screenY-ca.screenY):Ud=Vd=0,ca=i),Vd)},movementY:function(i){return"movementY"in i?i.movementY:Ud}}),vx=Zr(Xl),dN=M({},Xl,{dataTransfer:0}),hN=Zr(dN),fN=M({},la,{relatedTarget:0}),Gd=Zr(fN),mN=M({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),pN=Zr(mN),gN=M({},Yi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),xN=Zr(gN),vN=M({},Yi,{data:0}),yx=Zr(vN),yN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bN={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"},wN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _N(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=wN[i])?!!a[i]:!1}function Kd(){return _N}var SN=M({},la,{key:function(i){if(i.key){var a=yN[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?bN[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kd,charCode:function(i){return i.type==="keypress"?ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),CN=Zr(SN),kN=M({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bx=Zr(kN),jN=M({},la,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kd}),NN=Zr(jN),EN=M({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),PN=Zr(EN),AN=M({},Xl,{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}),TN=Zr(AN),RN=[9,13,27,32],qd=l&&"CompositionEvent"in window,ua=null;l&&"documentMode"in document&&(ua=document.documentMode);var MN=l&&"TextEvent"in window&&!ua,wx=l&&(!qd||ua&&8<ua&&11>=ua),_x=" ",Sx=!1;function Cx(i,a){switch(i){case"keyup":return RN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kx(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Xi=!1;function DN(i,a){switch(i){case"compositionend":return kx(a);case"keypress":return a.which!==32?null:(Sx=!0,_x);case"textInput":return i=a.data,i===_x&&Sx?null:i;default:return null}}function LN(i,a){if(Xi)return i==="compositionend"||!qd&&Cx(i,a)?(i=gx(),Kl=Hd=Ds=null,Xi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return wx&&a.locale!=="ko"?null:a.data;default:return null}}var IN={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 jx(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!IN[i.type]:a==="textarea"}function Nx(i,a,p,S){tt(S),a=tc(a,"onChange"),0<a.length&&(p=new Wd("onChange","change",null,p,S),i.push({event:p,listeners:a}))}var da=null,ha=null;function ON(i){Ux(i,0)}function Jl(i){var a=to(i);if(ie(a))return i}function BN(i,a){if(i==="change")return a}var Ex=!1;if(l){var Yd;if(l){var Xd="oninput"in document;if(!Xd){var Px=document.createElement("div");Px.setAttribute("oninput","return;"),Xd=typeof Px.oninput=="function"}Yd=Xd}else Yd=!1;Ex=Yd&&(!document.documentMode||9<document.documentMode)}function Ax(){da&&(da.detachEvent("onpropertychange",Tx),ha=da=null)}function Tx(i){if(i.propertyName==="value"&&Jl(ha)){var a=[];Nx(a,ha,i,wt(i)),Qt(ON,a)}}function FN(i,a,p){i==="focusin"?(Ax(),da=a,ha=p,da.attachEvent("onpropertychange",Tx)):i==="focusout"&&Ax()}function $N(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Jl(ha)}function zN(i,a){if(i==="click")return Jl(a)}function HN(i,a){if(i==="input"||i==="change")return Jl(a)}function WN(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var An=typeof Object.is=="function"?Object.is:WN;function fa(i,a){if(An(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var p=Object.keys(i),S=Object.keys(a);if(p.length!==S.length)return!1;for(S=0;S<p.length;S++){var A=p[S];if(!c.call(a,A)||!An(i[A],a[A]))return!1}return!0}function Rx(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Mx(i,a){var p=Rx(i);i=0;for(var S;p;){if(p.nodeType===3){if(S=i+p.textContent.length,i<=a&&S>=a)return{node:p,offset:a-i};i=S}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Rx(p)}}function Dx(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?Dx(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function Lx(){for(var i=window,a=ye();a instanceof i.HTMLIFrameElement;){try{var p=typeof a.contentWindow.location.href=="string"}catch{p=!1}if(p)i=a.contentWindow;else break;a=ye(i.document)}return a}function Jd(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}function VN(i){var a=Lx(),p=i.focusedElem,S=i.selectionRange;if(a!==p&&p&&p.ownerDocument&&Dx(p.ownerDocument.documentElement,p)){if(S!==null&&Jd(p)){if(a=S.start,i=S.end,i===void 0&&(i=a),"selectionStart"in p)p.selectionStart=a,p.selectionEnd=Math.min(i,p.value.length);else if(i=(a=p.ownerDocument||document)&&a.defaultView||window,i.getSelection){i=i.getSelection();var A=p.textContent.length,D=Math.min(S.start,A);S=S.end===void 0?D:Math.min(S.end,A),!i.extend&&D>S&&(A=S,S=D,D=A),A=Mx(p,D);var V=Mx(p,S);A&&V&&(i.rangeCount!==1||i.anchorNode!==A.node||i.anchorOffset!==A.offset||i.focusNode!==V.node||i.focusOffset!==V.offset)&&(a=a.createRange(),a.setStart(A.node,A.offset),i.removeAllRanges(),D>S?(i.addRange(a),i.extend(V.node,V.offset)):(a.setEnd(V.node,V.offset),i.addRange(a)))}}for(a=[],i=p;i=i.parentNode;)i.nodeType===1&&a.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<a.length;p++)i=a[p],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var UN=l&&"documentMode"in document&&11>=document.documentMode,Ji=null,Qd=null,ma=null,Zd=!1;function Ix(i,a,p){var S=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Zd||Ji==null||Ji!==ye(S)||(S=Ji,"selectionStart"in S&&Jd(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),ma&&fa(ma,S)||(ma=S,S=tc(Qd,"onSelect"),0<S.length&&(a=new Wd("onSelect","select",null,a,p),i.push({event:a,listeners:S}),a.target=Ji)))}function Ql(i,a){var p={};return p[i.toLowerCase()]=a.toLowerCase(),p["Webkit"+i]="webkit"+a,p["Moz"+i]="moz"+a,p}var Qi={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionend:Ql("Transition","TransitionEnd")},eh={},Ox={};l&&(Ox=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function Zl(i){if(eh[i])return eh[i];if(!Qi[i])return i;var a=Qi[i],p;for(p in a)if(a.hasOwnProperty(p)&&p in Ox)return eh[i]=a[p];return i}var Bx=Zl("animationend"),Fx=Zl("animationiteration"),$x=Zl("animationstart"),zx=Zl("transitionend"),Hx=new Map,Wx="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 Ls(i,a){Hx.set(i,a),u(a,[i])}for(var th=0;th<Wx.length;th++){var rh=Wx[th],GN=rh.toLowerCase(),KN=rh[0].toUpperCase()+rh.slice(1);Ls(GN,"on"+KN)}Ls(Bx,"onAnimationEnd"),Ls(Fx,"onAnimationIteration"),Ls($x,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(zx,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pa="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(" "),qN=new Set("cancel close invalid load scroll toggle".split(" ").concat(pa));function Vx(i,a,p){var S=i.type||"unknown-event";i.currentTarget=p,G2(S,a,void 0,i),i.currentTarget=null}function Ux(i,a){a=(a&4)!==0;for(var p=0;p<i.length;p++){var S=i[p],A=S.event;S=S.listeners;e:{var D=void 0;if(a)for(var V=S.length-1;0<=V;V--){var Q=S[V],te=Q.instance,he=Q.currentTarget;if(Q=Q.listener,te!==D&&A.isPropagationStopped())break e;Vx(A,Q,he),D=te}else for(V=0;V<S.length;V++){if(Q=S[V],te=Q.instance,he=Q.currentTarget,Q=Q.listener,te!==D&&A.isPropagationStopped())break e;Vx(A,Q,he),D=te}}}if(ea)throw i=Md,ea=!1,Md=null,i}function Mt(i,a){var p=a[uh];p===void 0&&(p=a[uh]=new Set);var S=i+"__bubble";p.has(S)||(Gx(a,i,2,!1),p.add(S))}function nh(i,a,p){var S=0;a&&(S|=4),Gx(p,i,S,a)}var ec="_reactListening"+Math.random().toString(36).slice(2);function ga(i){if(!i[ec]){i[ec]=!0,s.forEach(function(p){p!=="selectionchange"&&(qN.has(p)||nh(p,!1,i),nh(p,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[ec]||(a[ec]=!0,nh("selectionchange",!1,a))}}function Gx(i,a,p,S){switch(px(a)){case 1:var A=lN;break;case 4:A=cN;break;default:A=$d}p=A.bind(null,a,p,i),A=void 0,!Es||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(A=!0),S?A!==void 0?i.addEventListener(a,p,{capture:!0,passive:A}):i.addEventListener(a,p,!0):A!==void 0?i.addEventListener(a,p,{passive:A}):i.addEventListener(a,p,!1)}function sh(i,a,p,S,A){var D=S;if((a&1)===0&&(a&2)===0&&S!==null)e:for(;;){if(S===null)return;var V=S.tag;if(V===3||V===4){var Q=S.stateNode.containerInfo;if(Q===A||Q.nodeType===8&&Q.parentNode===A)break;if(V===4)for(V=S.return;V!==null;){var te=V.tag;if((te===3||te===4)&&(te=V.stateNode.containerInfo,te===A||te.nodeType===8&&te.parentNode===A))return;V=V.return}for(;Q!==null;){if(V=gi(Q),V===null)return;if(te=V.tag,te===5||te===6){S=D=V;continue e}Q=Q.parentNode}}S=S.return}Qt(function(){var he=D,ve=wt(p),we=[];e:{var xe=Hx.get(i);if(xe!==void 0){var Ie=Wd,$e=i;switch(i){case"keypress":if(ql(p)===0)break e;case"keydown":case"keyup":Ie=CN;break;case"focusin":$e="focus",Ie=Gd;break;case"focusout":$e="blur",Ie=Gd;break;case"beforeblur":case"afterblur":Ie=Gd;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=hN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=NN;break;case Bx:case Fx:case $x:Ie=pN;break;case zx:Ie=PN;break;case"scroll":Ie=uN;break;case"wheel":Ie=TN;break;case"copy":case"cut":case"paste":Ie=xN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=bx}var We=(a&4)!==0,Xt=!We&&i==="scroll",ce=We?xe!==null?xe+"Capture":null:xe;We=[];for(var se=he,ue;se!==null;){ue=se;var Ne=ue.stateNode;if(ue.tag===5&&Ne!==null&&(ue=Ne,ce!==null&&(Ne=cr(se,ce),Ne!=null&&We.push(xa(se,Ne,ue)))),Xt)break;se=se.return}0<We.length&&(xe=new Ie(xe,$e,null,p,ve),we.push({event:xe,listeners:We}))}}if((a&7)===0){e:{if(xe=i==="mouseover"||i==="pointerover",Ie=i==="mouseout"||i==="pointerout",xe&&p!==ft&&($e=p.relatedTarget||p.fromElement)&&(gi($e)||$e[us]))break e;if((Ie||xe)&&(xe=ve.window===ve?ve:(xe=ve.ownerDocument)?xe.defaultView||xe.parentWindow:window,Ie?($e=p.relatedTarget||p.toElement,Ie=he,$e=$e?gi($e):null,$e!==null&&(Xt=pi($e),$e!==Xt||$e.tag!==5&&$e.tag!==6)&&($e=null)):(Ie=null,$e=he),Ie!==$e)){if(We=vx,Ne="onMouseLeave",ce="onMouseEnter",se="mouse",(i==="pointerout"||i==="pointerover")&&(We=bx,Ne="onPointerLeave",ce="onPointerEnter",se="pointer"),Xt=Ie==null?xe:to(Ie),ue=$e==null?xe:to($e),xe=new We(Ne,se+"leave",Ie,p,ve),xe.target=Xt,xe.relatedTarget=ue,Ne=null,gi(ve)===he&&(We=new We(ce,se+"enter",$e,p,ve),We.target=ue,We.relatedTarget=Xt,Ne=We),Xt=Ne,Ie&&$e)t:{for(We=Ie,ce=$e,se=0,ue=We;ue;ue=Zi(ue))se++;for(ue=0,Ne=ce;Ne;Ne=Zi(Ne))ue++;for(;0<se-ue;)We=Zi(We),se--;for(;0<ue-se;)ce=Zi(ce),ue--;for(;se--;){if(We===ce||ce!==null&&We===ce.alternate)break t;We=Zi(We),ce=Zi(ce)}We=null}else We=null;Ie!==null&&Kx(we,xe,Ie,We,!1),$e!==null&&Xt!==null&&Kx(we,Xt,$e,We,!0)}}e:{if(xe=he?to(he):window,Ie=xe.nodeName&&xe.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&xe.type==="file")var Ue=BN;else if(jx(xe))if(Ex)Ue=HN;else{Ue=$N;var qe=FN}else(Ie=xe.nodeName)&&Ie.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(Ue=zN);if(Ue&&(Ue=Ue(i,he))){Nx(we,Ue,p,ve);break e}qe&&qe(i,xe,he),i==="focusout"&&(qe=xe._wrapperState)&&qe.controlled&&xe.type==="number"&&Re(xe,"number",xe.value)}switch(qe=he?to(he):window,i){case"focusin":(jx(qe)||qe.contentEditable==="true")&&(Ji=qe,Qd=he,ma=null);break;case"focusout":ma=Qd=Ji=null;break;case"mousedown":Zd=!0;break;case"contextmenu":case"mouseup":case"dragend":Zd=!1,Ix(we,p,ve);break;case"selectionchange":if(UN)break;case"keydown":case"keyup":Ix(we,p,ve)}var Ye;if(qd)e:{switch(i){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Xi?Cx(i,p)&&(rt="onCompositionEnd"):i==="keydown"&&p.keyCode===229&&(rt="onCompositionStart");rt&&(wx&&p.locale!=="ko"&&(Xi||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Xi&&(Ye=gx()):(Ds=ve,Hd="value"in Ds?Ds.value:Ds.textContent,Xi=!0)),qe=tc(he,rt),0<qe.length&&(rt=new yx(rt,i,null,p,ve),we.push({event:rt,listeners:qe}),Ye?rt.data=Ye:(Ye=kx(p),Ye!==null&&(rt.data=Ye)))),(Ye=MN?DN(i,p):LN(i,p))&&(he=tc(he,"onBeforeInput"),0<he.length&&(ve=new yx("onBeforeInput","beforeinput",null,p,ve),we.push({event:ve,listeners:he}),ve.data=Ye))}Ux(we,a)})}function xa(i,a,p){return{instance:i,listener:a,currentTarget:p}}function tc(i,a){for(var p=a+"Capture",S=[];i!==null;){var A=i,D=A.stateNode;A.tag===5&&D!==null&&(A=D,D=cr(i,p),D!=null&&S.unshift(xa(i,D,A)),D=cr(i,a),D!=null&&S.push(xa(i,D,A))),i=i.return}return S}function Zi(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Kx(i,a,p,S,A){for(var D=a._reactName,V=[];p!==null&&p!==S;){var Q=p,te=Q.alternate,he=Q.stateNode;if(te!==null&&te===S)break;Q.tag===5&&he!==null&&(Q=he,A?(te=cr(p,D),te!=null&&V.unshift(xa(p,te,Q))):A||(te=cr(p,D),te!=null&&V.push(xa(p,te,Q)))),p=p.return}V.length!==0&&i.push({event:a,listeners:V})}var YN=/\r\n?/g,XN=/\u0000|\uFFFD/g;function qx(i){return(typeof i=="string"?i:""+i).replace(YN,`
|
|
38
|
-
`).replace(XN,"")}function rc(i,a,p){if(a=qx(a),qx(i)!==a&&p)throw Error(r(425))}function nc(){}var ih=null,oh=null;function ah(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var lh=typeof setTimeout=="function"?setTimeout:void 0,JN=typeof clearTimeout=="function"?clearTimeout:void 0,Yx=typeof Promise=="function"?Promise:void 0,QN=typeof queueMicrotask=="function"?queueMicrotask:typeof Yx<"u"?function(i){return Yx.resolve(null).then(i).catch(ZN)}:lh;function ZN(i){setTimeout(function(){throw i})}function ch(i,a){var p=a,S=0;do{var A=p.nextSibling;if(i.removeChild(p),A&&A.nodeType===8)if(p=A.data,p==="/$"){if(S===0){i.removeChild(A),aa(a);return}S--}else p!=="$"&&p!=="$?"&&p!=="$!"||S++;p=A}while(p);aa(a)}function Is(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return i}function Xx(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var p=i.data;if(p==="$"||p==="$!"||p==="$?"){if(a===0)return i;a--}else p==="/$"&&a++}i=i.previousSibling}return null}var eo=Math.random().toString(36).slice(2),Vn="__reactFiber$"+eo,va="__reactProps$"+eo,us="__reactContainer$"+eo,uh="__reactEvents$"+eo,eE="__reactListeners$"+eo,tE="__reactHandles$"+eo;function gi(i){var a=i[Vn];if(a)return a;for(var p=i.parentNode;p;){if(a=p[us]||p[Vn]){if(p=a.alternate,a.child!==null||p!==null&&p.child!==null)for(i=Xx(i);i!==null;){if(p=i[Vn])return p;i=Xx(i)}return a}i=p,p=i.parentNode}return null}function ya(i){return i=i[Vn]||i[us],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function to(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function sc(i){return i[va]||null}var dh=[],ro=-1;function Os(i){return{current:i}}function Dt(i){0>ro||(i.current=dh[ro],dh[ro]=null,ro--)}function Nt(i,a){ro++,dh[ro]=i.current,i.current=a}var Bs={},Er=Os(Bs),Fr=Os(!1),xi=Bs;function no(i,a){var p=i.type.contextTypes;if(!p)return Bs;var S=i.stateNode;if(S&&S.__reactInternalMemoizedUnmaskedChildContext===a)return S.__reactInternalMemoizedMaskedChildContext;var A={},D;for(D in p)A[D]=a[D];return S&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=A),A}function $r(i){return i=i.childContextTypes,i!=null}function ic(){Dt(Fr),Dt(Er)}function Jx(i,a,p){if(Er.current!==Bs)throw Error(r(168));Nt(Er,a),Nt(Fr,p)}function Qx(i,a,p){var S=i.stateNode;if(a=a.childContextTypes,typeof S.getChildContext!="function")return p;S=S.getChildContext();for(var A in S)if(!(A in a))throw Error(r(108,X(i)||"Unknown",A));return M({},p,S)}function oc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Bs,xi=Er.current,Nt(Er,i),Nt(Fr,Fr.current),!0}function Zx(i,a,p){var S=i.stateNode;if(!S)throw Error(r(169));p?(i=Qx(i,a,xi),S.__reactInternalMemoizedMergedChildContext=i,Dt(Fr),Dt(Er),Nt(Er,i)):Dt(Fr),Nt(Fr,p)}var ds=null,ac=!1,hh=!1;function e0(i){ds===null?ds=[i]:ds.push(i)}function rE(i){ac=!0,e0(i)}function Fs(){if(!hh&&ds!==null){hh=!0;var i=0,a=_t;try{var p=ds;for(_t=1;i<p.length;i++){var S=p[i];do S=S(!0);while(S!==null)}ds=null,ac=!1}catch(A){throw ds!==null&&(ds=ds.slice(i+1)),rx(Dd,Fs),A}finally{_t=a,hh=!1}}return null}var so=[],io=0,lc=null,cc=0,mn=[],pn=0,vi=null,hs=1,fs="";function yi(i,a){so[io++]=cc,so[io++]=lc,lc=i,cc=a}function t0(i,a,p){mn[pn++]=hs,mn[pn++]=fs,mn[pn++]=vi,vi=i;var S=hs;i=fs;var A=32-Pn(S)-1;S&=~(1<<A),p+=1;var D=32-Pn(a)+A;if(30<D){var V=A-A%5;D=(S&(1<<V)-1).toString(32),S>>=V,A-=V,hs=1<<32-Pn(a)+A|p<<A|S,fs=D+i}else hs=1<<D|p<<A|S,fs=i}function fh(i){i.return!==null&&(yi(i,1),t0(i,1,0))}function mh(i){for(;i===lc;)lc=so[--io],so[io]=null,cc=so[--io],so[io]=null;for(;i===vi;)vi=mn[--pn],mn[pn]=null,fs=mn[--pn],mn[pn]=null,hs=mn[--pn],mn[pn]=null}var en=null,tn=null,Ot=!1,Tn=null;function r0(i,a){var p=yn(5,null,null,0);p.elementType="DELETED",p.stateNode=a,p.return=i,a=i.deletions,a===null?(i.deletions=[p],i.flags|=16):a.push(p)}function n0(i,a){switch(i.tag){case 5:var p=i.type;return a=a.nodeType!==1||p.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(i.stateNode=a,en=i,tn=Is(a.firstChild),!0):!1;case 6:return a=i.pendingProps===""||a.nodeType!==3?null:a,a!==null?(i.stateNode=a,en=i,tn=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(p=vi!==null?{id:hs,overflow:fs}:null,i.memoizedState={dehydrated:a,treeContext:p,retryLane:1073741824},p=yn(18,null,null,0),p.stateNode=a,p.return=i,i.child=p,en=i,tn=null,!0):!1;default:return!1}}function ph(i){return(i.mode&1)!==0&&(i.flags&128)===0}function gh(i){if(Ot){var a=tn;if(a){var p=a;if(!n0(i,a)){if(ph(i))throw Error(r(418));a=Is(p.nextSibling);var S=en;a&&n0(i,a)?r0(S,p):(i.flags=i.flags&-4097|2,Ot=!1,en=i)}}else{if(ph(i))throw Error(r(418));i.flags=i.flags&-4097|2,Ot=!1,en=i}}}function s0(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;en=i}function uc(i){if(i!==en)return!1;if(!Ot)return s0(i),Ot=!0,!1;var a;if((a=i.tag!==3)&&!(a=i.tag!==5)&&(a=i.type,a=a!=="head"&&a!=="body"&&!ah(i.type,i.memoizedProps)),a&&(a=tn)){if(ph(i))throw i0(),Error(r(418));for(;a;)r0(i,a),a=Is(a.nextSibling)}if(s0(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,a=0;i;){if(i.nodeType===8){var p=i.data;if(p==="/$"){if(a===0){tn=Is(i.nextSibling);break e}a--}else p!=="$"&&p!=="$!"&&p!=="$?"||a++}i=i.nextSibling}tn=null}}else tn=en?Is(i.stateNode.nextSibling):null;return!0}function i0(){for(var i=tn;i;)i=Is(i.nextSibling)}function oo(){tn=en=null,Ot=!1}function xh(i){Tn===null?Tn=[i]:Tn.push(i)}var nE=j.ReactCurrentBatchConfig;function ba(i,a,p){if(i=p.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(r(309));var S=p.stateNode}if(!S)throw Error(r(147,i));var A=S,D=""+i;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===D?a.ref:(a=function(V){var Q=A.refs;V===null?delete Q[D]:Q[D]=V},a._stringRef=D,a)}if(typeof i!="string")throw Error(r(284));if(!p._owner)throw Error(r(290,i))}return i}function dc(i,a){throw i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i))}function o0(i){var a=i._init;return a(i._payload)}function a0(i){function a(ce,se){if(i){var ue=ce.deletions;ue===null?(ce.deletions=[se],ce.flags|=16):ue.push(se)}}function p(ce,se){if(!i)return null;for(;se!==null;)a(ce,se),se=se.sibling;return null}function S(ce,se){for(ce=new Map;se!==null;)se.key!==null?ce.set(se.key,se):ce.set(se.index,se),se=se.sibling;return ce}function A(ce,se){return ce=Ks(ce,se),ce.index=0,ce.sibling=null,ce}function D(ce,se,ue){return ce.index=ue,i?(ue=ce.alternate,ue!==null?(ue=ue.index,ue<se?(ce.flags|=2,se):ue):(ce.flags|=2,se)):(ce.flags|=1048576,se)}function V(ce){return i&&ce.alternate===null&&(ce.flags|=2),ce}function Q(ce,se,ue,Ne){return se===null||se.tag!==6?(se=cf(ue,ce.mode,Ne),se.return=ce,se):(se=A(se,ue),se.return=ce,se)}function te(ce,se,ue,Ne){var Ue=ue.type;return Ue===T?ve(ce,se,ue.props.children,Ne,ue.key):se!==null&&(se.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===K&&o0(Ue)===se.type)?(Ne=A(se,ue.props),Ne.ref=ba(ce,se,ue),Ne.return=ce,Ne):(Ne=Lc(ue.type,ue.key,ue.props,null,ce.mode,Ne),Ne.ref=ba(ce,se,ue),Ne.return=ce,Ne)}function he(ce,se,ue,Ne){return se===null||se.tag!==4||se.stateNode.containerInfo!==ue.containerInfo||se.stateNode.implementation!==ue.implementation?(se=uf(ue,ce.mode,Ne),se.return=ce,se):(se=A(se,ue.children||[]),se.return=ce,se)}function ve(ce,se,ue,Ne,Ue){return se===null||se.tag!==7?(se=Ni(ue,ce.mode,Ne,Ue),se.return=ce,se):(se=A(se,ue),se.return=ce,se)}function we(ce,se,ue){if(typeof se=="string"&&se!==""||typeof se=="number")return se=cf(""+se,ce.mode,ue),se.return=ce,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return ue=Lc(se.type,se.key,se.props,null,ce.mode,ue),ue.ref=ba(ce,null,se),ue.return=ce,ue;case P:return se=uf(se,ce.mode,ue),se.return=ce,se;case K:var Ne=se._init;return we(ce,Ne(se._payload),ue)}if(Ze(se)||L(se))return se=Ni(se,ce.mode,ue,null),se.return=ce,se;dc(ce,se)}return null}function xe(ce,se,ue,Ne){var Ue=se!==null?se.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Ue!==null?null:Q(ce,se,""+ue,Ne);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return ue.key===Ue?te(ce,se,ue,Ne):null;case P:return ue.key===Ue?he(ce,se,ue,Ne):null;case K:return Ue=ue._init,xe(ce,se,Ue(ue._payload),Ne)}if(Ze(ue)||L(ue))return Ue!==null?null:ve(ce,se,ue,Ne,null);dc(ce,ue)}return null}function Ie(ce,se,ue,Ne,Ue){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number")return ce=ce.get(ue)||null,Q(se,ce,""+Ne,Ue);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case E:return ce=ce.get(Ne.key===null?ue:Ne.key)||null,te(se,ce,Ne,Ue);case P:return ce=ce.get(Ne.key===null?ue:Ne.key)||null,he(se,ce,Ne,Ue);case K:var qe=Ne._init;return Ie(ce,se,ue,qe(Ne._payload),Ue)}if(Ze(Ne)||L(Ne))return ce=ce.get(ue)||null,ve(se,ce,Ne,Ue,null);dc(se,Ne)}return null}function $e(ce,se,ue,Ne){for(var Ue=null,qe=null,Ye=se,rt=se=0,hr=null;Ye!==null&&rt<ue.length;rt++){Ye.index>rt?(hr=Ye,Ye=null):hr=Ye.sibling;var gt=xe(ce,Ye,ue[rt],Ne);if(gt===null){Ye===null&&(Ye=hr);break}i&&Ye&>.alternate===null&&a(ce,Ye),se=D(gt,se,rt),qe===null?Ue=gt:qe.sibling=gt,qe=gt,Ye=hr}if(rt===ue.length)return p(ce,Ye),Ot&&yi(ce,rt),Ue;if(Ye===null){for(;rt<ue.length;rt++)Ye=we(ce,ue[rt],Ne),Ye!==null&&(se=D(Ye,se,rt),qe===null?Ue=Ye:qe.sibling=Ye,qe=Ye);return Ot&&yi(ce,rt),Ue}for(Ye=S(ce,Ye);rt<ue.length;rt++)hr=Ie(Ye,ce,rt,ue[rt],Ne),hr!==null&&(i&&hr.alternate!==null&&Ye.delete(hr.key===null?rt:hr.key),se=D(hr,se,rt),qe===null?Ue=hr:qe.sibling=hr,qe=hr);return i&&Ye.forEach(function(qs){return a(ce,qs)}),Ot&&yi(ce,rt),Ue}function We(ce,se,ue,Ne){var Ue=L(ue);if(typeof Ue!="function")throw Error(r(150));if(ue=Ue.call(ue),ue==null)throw Error(r(151));for(var qe=Ue=null,Ye=se,rt=se=0,hr=null,gt=ue.next();Ye!==null&&!gt.done;rt++,gt=ue.next()){Ye.index>rt?(hr=Ye,Ye=null):hr=Ye.sibling;var qs=xe(ce,Ye,gt.value,Ne);if(qs===null){Ye===null&&(Ye=hr);break}i&&Ye&&qs.alternate===null&&a(ce,Ye),se=D(qs,se,rt),qe===null?Ue=qs:qe.sibling=qs,qe=qs,Ye=hr}if(gt.done)return p(ce,Ye),Ot&&yi(ce,rt),Ue;if(Ye===null){for(;!gt.done;rt++,gt=ue.next())gt=we(ce,gt.value,Ne),gt!==null&&(se=D(gt,se,rt),qe===null?Ue=gt:qe.sibling=gt,qe=gt);return Ot&&yi(ce,rt),Ue}for(Ye=S(ce,Ye);!gt.done;rt++,gt=ue.next())gt=Ie(Ye,ce,rt,gt.value,Ne),gt!==null&&(i&>.alternate!==null&&Ye.delete(gt.key===null?rt:gt.key),se=D(gt,se,rt),qe===null?Ue=gt:qe.sibling=gt,qe=gt);return i&&Ye.forEach(function(IE){return a(ce,IE)}),Ot&&yi(ce,rt),Ue}function Xt(ce,se,ue,Ne){if(typeof ue=="object"&&ue!==null&&ue.type===T&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:e:{for(var Ue=ue.key,qe=se;qe!==null;){if(qe.key===Ue){if(Ue=ue.type,Ue===T){if(qe.tag===7){p(ce,qe.sibling),se=A(qe,ue.props.children),se.return=ce,ce=se;break e}}else if(qe.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===K&&o0(Ue)===qe.type){p(ce,qe.sibling),se=A(qe,ue.props),se.ref=ba(ce,qe,ue),se.return=ce,ce=se;break e}p(ce,qe);break}else a(ce,qe);qe=qe.sibling}ue.type===T?(se=Ni(ue.props.children,ce.mode,Ne,ue.key),se.return=ce,ce=se):(Ne=Lc(ue.type,ue.key,ue.props,null,ce.mode,Ne),Ne.ref=ba(ce,se,ue),Ne.return=ce,ce=Ne)}return V(ce);case P:e:{for(qe=ue.key;se!==null;){if(se.key===qe)if(se.tag===4&&se.stateNode.containerInfo===ue.containerInfo&&se.stateNode.implementation===ue.implementation){p(ce,se.sibling),se=A(se,ue.children||[]),se.return=ce,ce=se;break e}else{p(ce,se);break}else a(ce,se);se=se.sibling}se=uf(ue,ce.mode,Ne),se.return=ce,ce=se}return V(ce);case K:return qe=ue._init,Xt(ce,se,qe(ue._payload),Ne)}if(Ze(ue))return $e(ce,se,ue,Ne);if(L(ue))return We(ce,se,ue,Ne);dc(ce,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"?(ue=""+ue,se!==null&&se.tag===6?(p(ce,se.sibling),se=A(se,ue),se.return=ce,ce=se):(p(ce,se),se=cf(ue,ce.mode,Ne),se.return=ce,ce=se),V(ce)):p(ce,se)}return Xt}var ao=a0(!0),l0=a0(!1),hc=Os(null),fc=null,lo=null,vh=null;function yh(){vh=lo=fc=null}function bh(i){var a=hc.current;Dt(hc),i._currentValue=a}function wh(i,a,p){for(;i!==null;){var S=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,S!==null&&(S.childLanes|=a)):S!==null&&(S.childLanes&a)!==a&&(S.childLanes|=a),i===p)break;i=i.return}}function co(i,a){fc=i,vh=lo=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&a)!==0&&(zr=!0),i.firstContext=null)}function gn(i){var a=i._currentValue;if(vh!==i)if(i={context:i,memoizedValue:a,next:null},lo===null){if(fc===null)throw Error(r(308));lo=i,fc.dependencies={lanes:0,firstContext:i}}else lo=lo.next=i;return a}var bi=null;function _h(i){bi===null?bi=[i]:bi.push(i)}function c0(i,a,p,S){var A=a.interleaved;return A===null?(p.next=p,_h(a)):(p.next=A.next,A.next=p),a.interleaved=p,ms(i,S)}function ms(i,a){i.lanes|=a;var p=i.alternate;for(p!==null&&(p.lanes|=a),p=i,i=i.return;i!==null;)i.childLanes|=a,p=i.alternate,p!==null&&(p.childLanes|=a),p=i,i=i.return;return p.tag===3?p.stateNode:null}var $s=!1;function Sh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u0(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function ps(i,a){return{eventTime:i,lane:a,tag:0,payload:null,callback:null,next:null}}function zs(i,a,p){var S=i.updateQueue;if(S===null)return null;if(S=S.shared,(mt&2)!==0){var A=S.pending;return A===null?a.next=a:(a.next=A.next,A.next=a),S.pending=a,ms(i,p)}return A=S.interleaved,A===null?(a.next=a,_h(S)):(a.next=A.next,A.next=a),S.interleaved=a,ms(i,p)}function mc(i,a,p){if(a=a.updateQueue,a!==null&&(a=a.shared,(p&4194240)!==0)){var S=a.lanes;S&=i.pendingLanes,p|=S,a.lanes=p,Od(i,p)}}function d0(i,a){var p=i.updateQueue,S=i.alternate;if(S!==null&&(S=S.updateQueue,p===S)){var A=null,D=null;if(p=p.firstBaseUpdate,p!==null){do{var V={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};D===null?A=D=V:D=D.next=V,p=p.next}while(p!==null);D===null?A=D=a:D=D.next=a}else A=D=a;p={baseState:S.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:S.shared,effects:S.effects},i.updateQueue=p;return}i=p.lastBaseUpdate,i===null?p.firstBaseUpdate=a:i.next=a,p.lastBaseUpdate=a}function pc(i,a,p,S){var A=i.updateQueue;$s=!1;var D=A.firstBaseUpdate,V=A.lastBaseUpdate,Q=A.shared.pending;if(Q!==null){A.shared.pending=null;var te=Q,he=te.next;te.next=null,V===null?D=he:V.next=he,V=te;var ve=i.alternate;ve!==null&&(ve=ve.updateQueue,Q=ve.lastBaseUpdate,Q!==V&&(Q===null?ve.firstBaseUpdate=he:Q.next=he,ve.lastBaseUpdate=te))}if(D!==null){var we=A.baseState;V=0,ve=he=te=null,Q=D;do{var xe=Q.lane,Ie=Q.eventTime;if((S&xe)===xe){ve!==null&&(ve=ve.next={eventTime:Ie,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var $e=i,We=Q;switch(xe=a,Ie=p,We.tag){case 1:if($e=We.payload,typeof $e=="function"){we=$e.call(Ie,we,xe);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=We.payload,xe=typeof $e=="function"?$e.call(Ie,we,xe):$e,xe==null)break e;we=M({},we,xe);break e;case 2:$s=!0}}Q.callback!==null&&Q.lane!==0&&(i.flags|=64,xe=A.effects,xe===null?A.effects=[Q]:xe.push(Q))}else Ie={eventTime:Ie,lane:xe,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},ve===null?(he=ve=Ie,te=we):ve=ve.next=Ie,V|=xe;if(Q=Q.next,Q===null){if(Q=A.shared.pending,Q===null)break;xe=Q,Q=xe.next,xe.next=null,A.lastBaseUpdate=xe,A.shared.pending=null}}while(!0);if(ve===null&&(te=we),A.baseState=te,A.firstBaseUpdate=he,A.lastBaseUpdate=ve,a=A.shared.interleaved,a!==null){A=a;do V|=A.lane,A=A.next;while(A!==a)}else D===null&&(A.shared.lanes=0);Si|=V,i.lanes=V,i.memoizedState=we}}function h0(i,a,p){if(i=a.effects,a.effects=null,i!==null)for(a=0;a<i.length;a++){var S=i[a],A=S.callback;if(A!==null){if(S.callback=null,S=p,typeof A!="function")throw Error(r(191,A));A.call(S)}}}var wa={},Un=Os(wa),_a=Os(wa),Sa=Os(wa);function wi(i){if(i===wa)throw Error(r(174));return i}function Ch(i,a){switch(Nt(Sa,a),Nt(_a,i),Nt(Un,wa),i=a.nodeType,i){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:be(null,"");break;default:i=i===8?a.parentNode:a,a=i.namespaceURI||null,i=i.tagName,a=be(a,i)}Dt(Un),Nt(Un,a)}function uo(){Dt(Un),Dt(_a),Dt(Sa)}function f0(i){wi(Sa.current);var a=wi(Un.current),p=be(a,i.type);a!==p&&(Nt(_a,i),Nt(Un,p))}function kh(i){_a.current===i&&(Dt(Un),Dt(_a))}var $t=Os(0);function gc(i){for(var a=i;a!==null;){if(a.tag===13){var p=a.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var jh=[];function Nh(){for(var i=0;i<jh.length;i++)jh[i]._workInProgressVersionPrimary=null;jh.length=0}var xc=j.ReactCurrentDispatcher,Eh=j.ReactCurrentBatchConfig,_i=0,zt=null,sr=null,ur=null,vc=!1,Ca=!1,ka=0,sE=0;function Pr(){throw Error(r(321))}function Ph(i,a){if(a===null)return!1;for(var p=0;p<a.length&&p<i.length;p++)if(!An(i[p],a[p]))return!1;return!0}function Ah(i,a,p,S,A,D){if(_i=D,zt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,xc.current=i===null||i.memoizedState===null?lE:cE,i=p(S,A),Ca){D=0;do{if(Ca=!1,ka=0,25<=D)throw Error(r(301));D+=1,ur=sr=null,a.updateQueue=null,xc.current=uE,i=p(S,A)}while(Ca)}if(xc.current=wc,a=sr!==null&&sr.next!==null,_i=0,ur=sr=zt=null,vc=!1,a)throw Error(r(300));return i}function Th(){var i=ka!==0;return ka=0,i}function Gn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?zt.memoizedState=ur=i:ur=ur.next=i,ur}function xn(){if(sr===null){var i=zt.alternate;i=i!==null?i.memoizedState:null}else i=sr.next;var a=ur===null?zt.memoizedState:ur.next;if(a!==null)ur=a,sr=i;else{if(i===null)throw Error(r(310));sr=i,i={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},ur===null?zt.memoizedState=ur=i:ur=ur.next=i}return ur}function ja(i,a){return typeof a=="function"?a(i):a}function Rh(i){var a=xn(),p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=i;var S=sr,A=S.baseQueue,D=p.pending;if(D!==null){if(A!==null){var V=A.next;A.next=D.next,D.next=V}S.baseQueue=A=D,p.pending=null}if(A!==null){D=A.next,S=S.baseState;var Q=V=null,te=null,he=D;do{var ve=he.lane;if((_i&ve)===ve)te!==null&&(te=te.next={lane:0,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),S=he.hasEagerState?he.eagerState:i(S,he.action);else{var we={lane:ve,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null};te===null?(Q=te=we,V=S):te=te.next=we,zt.lanes|=ve,Si|=ve}he=he.next}while(he!==null&&he!==D);te===null?V=S:te.next=Q,An(S,a.memoizedState)||(zr=!0),a.memoizedState=S,a.baseState=V,a.baseQueue=te,p.lastRenderedState=S}if(i=p.interleaved,i!==null){A=i;do D=A.lane,zt.lanes|=D,Si|=D,A=A.next;while(A!==i)}else A===null&&(p.lanes=0);return[a.memoizedState,p.dispatch]}function Mh(i){var a=xn(),p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=i;var S=p.dispatch,A=p.pending,D=a.memoizedState;if(A!==null){p.pending=null;var V=A=A.next;do D=i(D,V.action),V=V.next;while(V!==A);An(D,a.memoizedState)||(zr=!0),a.memoizedState=D,a.baseQueue===null&&(a.baseState=D),p.lastRenderedState=D}return[D,S]}function m0(){}function p0(i,a){var p=zt,S=xn(),A=a(),D=!An(S.memoizedState,A);if(D&&(S.memoizedState=A,zr=!0),S=S.queue,Dh(v0.bind(null,p,S,i),[i]),S.getSnapshot!==a||D||ur!==null&&ur.memoizedState.tag&1){if(p.flags|=2048,Na(9,x0.bind(null,p,S,A,a),void 0,null),dr===null)throw Error(r(349));(_i&30)!==0||g0(p,a,A)}return A}function g0(i,a,p){i.flags|=16384,i={getSnapshot:a,value:p},a=zt.updateQueue,a===null?(a={lastEffect:null,stores:null},zt.updateQueue=a,a.stores=[i]):(p=a.stores,p===null?a.stores=[i]:p.push(i))}function x0(i,a,p,S){a.value=p,a.getSnapshot=S,y0(a)&&b0(i)}function v0(i,a,p){return p(function(){y0(a)&&b0(i)})}function y0(i){var a=i.getSnapshot;i=i.value;try{var p=a();return!An(i,p)}catch{return!0}}function b0(i){var a=ms(i,1);a!==null&&Ln(a,i,1,-1)}function w0(i){var a=Gn();return typeof i=="function"&&(i=i()),a.memoizedState=a.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:i},a.queue=i,i=i.dispatch=aE.bind(null,zt,i),[a.memoizedState,i]}function Na(i,a,p,S){return i={tag:i,create:a,destroy:p,deps:S,next:null},a=zt.updateQueue,a===null?(a={lastEffect:null,stores:null},zt.updateQueue=a,a.lastEffect=i.next=i):(p=a.lastEffect,p===null?a.lastEffect=i.next=i:(S=p.next,p.next=i,i.next=S,a.lastEffect=i)),i}function _0(){return xn().memoizedState}function yc(i,a,p,S){var A=Gn();zt.flags|=i,A.memoizedState=Na(1|a,p,void 0,S===void 0?null:S)}function bc(i,a,p,S){var A=xn();S=S===void 0?null:S;var D=void 0;if(sr!==null){var V=sr.memoizedState;if(D=V.destroy,S!==null&&Ph(S,V.deps)){A.memoizedState=Na(a,p,D,S);return}}zt.flags|=i,A.memoizedState=Na(1|a,p,D,S)}function S0(i,a){return yc(8390656,8,i,a)}function Dh(i,a){return bc(2048,8,i,a)}function C0(i,a){return bc(4,2,i,a)}function k0(i,a){return bc(4,4,i,a)}function j0(i,a){if(typeof a=="function")return i=i(),a(i),function(){a(null)};if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function N0(i,a,p){return p=p!=null?p.concat([i]):null,bc(4,4,j0.bind(null,a,i),p)}function Lh(){}function E0(i,a){var p=xn();a=a===void 0?null:a;var S=p.memoizedState;return S!==null&&a!==null&&Ph(a,S[1])?S[0]:(p.memoizedState=[i,a],i)}function P0(i,a){var p=xn();a=a===void 0?null:a;var S=p.memoizedState;return S!==null&&a!==null&&Ph(a,S[1])?S[0]:(i=i(),p.memoizedState=[i,a],i)}function A0(i,a,p){return(_i&21)===0?(i.baseState&&(i.baseState=!1,zr=!0),i.memoizedState=p):(An(p,a)||(p=ox(),zt.lanes|=p,Si|=p,i.baseState=!0),a)}function iE(i,a){var p=_t;_t=p!==0&&4>p?p:4,i(!0);var S=Eh.transition;Eh.transition={};try{i(!1),a()}finally{_t=p,Eh.transition=S}}function T0(){return xn().memoizedState}function oE(i,a,p){var S=Us(i);if(p={lane:S,action:p,hasEagerState:!1,eagerState:null,next:null},R0(i))M0(a,p);else if(p=c0(i,a,p,S),p!==null){var A=Ir();Ln(p,i,S,A),D0(p,a,S)}}function aE(i,a,p){var S=Us(i),A={lane:S,action:p,hasEagerState:!1,eagerState:null,next:null};if(R0(i))M0(a,A);else{var D=i.alternate;if(i.lanes===0&&(D===null||D.lanes===0)&&(D=a.lastRenderedReducer,D!==null))try{var V=a.lastRenderedState,Q=D(V,p);if(A.hasEagerState=!0,A.eagerState=Q,An(Q,V)){var te=a.interleaved;te===null?(A.next=A,_h(a)):(A.next=te.next,te.next=A),a.interleaved=A;return}}catch{}finally{}p=c0(i,a,A,S),p!==null&&(A=Ir(),Ln(p,i,S,A),D0(p,a,S))}}function R0(i){var a=i.alternate;return i===zt||a!==null&&a===zt}function M0(i,a){Ca=vc=!0;var p=i.pending;p===null?a.next=a:(a.next=p.next,p.next=a),i.pending=a}function D0(i,a,p){if((p&4194240)!==0){var S=a.lanes;S&=i.pendingLanes,p|=S,a.lanes=p,Od(i,p)}}var wc={readContext:gn,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useInsertionEffect:Pr,useLayoutEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useMutableSource:Pr,useSyncExternalStore:Pr,useId:Pr,unstable_isNewReconciler:!1},lE={readContext:gn,useCallback:function(i,a){return Gn().memoizedState=[i,a===void 0?null:a],i},useContext:gn,useEffect:S0,useImperativeHandle:function(i,a,p){return p=p!=null?p.concat([i]):null,yc(4194308,4,j0.bind(null,a,i),p)},useLayoutEffect:function(i,a){return yc(4194308,4,i,a)},useInsertionEffect:function(i,a){return yc(4,2,i,a)},useMemo:function(i,a){var p=Gn();return a=a===void 0?null:a,i=i(),p.memoizedState=[i,a],i},useReducer:function(i,a,p){var S=Gn();return a=p!==void 0?p(a):a,S.memoizedState=S.baseState=a,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:a},S.queue=i,i=i.dispatch=oE.bind(null,zt,i),[S.memoizedState,i]},useRef:function(i){var a=Gn();return i={current:i},a.memoizedState=i},useState:w0,useDebugValue:Lh,useDeferredValue:function(i){return Gn().memoizedState=i},useTransition:function(){var i=w0(!1),a=i[0];return i=iE.bind(null,i[1]),Gn().memoizedState=i,[a,i]},useMutableSource:function(){},useSyncExternalStore:function(i,a,p){var S=zt,A=Gn();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=a(),dr===null)throw Error(r(349));(_i&30)!==0||g0(S,a,p)}A.memoizedState=p;var D={value:p,getSnapshot:a};return A.queue=D,S0(v0.bind(null,S,D,i),[i]),S.flags|=2048,Na(9,x0.bind(null,S,D,p,a),void 0,null),p},useId:function(){var i=Gn(),a=dr.identifierPrefix;if(Ot){var p=fs,S=hs;p=(S&~(1<<32-Pn(S)-1)).toString(32)+p,a=":"+a+"R"+p,p=ka++,0<p&&(a+="H"+p.toString(32)),a+=":"}else p=sE++,a=":"+a+"r"+p.toString(32)+":";return i.memoizedState=a},unstable_isNewReconciler:!1},cE={readContext:gn,useCallback:E0,useContext:gn,useEffect:Dh,useImperativeHandle:N0,useInsertionEffect:C0,useLayoutEffect:k0,useMemo:P0,useReducer:Rh,useRef:_0,useState:function(){return Rh(ja)},useDebugValue:Lh,useDeferredValue:function(i){var a=xn();return A0(a,sr.memoizedState,i)},useTransition:function(){var i=Rh(ja)[0],a=xn().memoizedState;return[i,a]},useMutableSource:m0,useSyncExternalStore:p0,useId:T0,unstable_isNewReconciler:!1},uE={readContext:gn,useCallback:E0,useContext:gn,useEffect:Dh,useImperativeHandle:N0,useInsertionEffect:C0,useLayoutEffect:k0,useMemo:P0,useReducer:Mh,useRef:_0,useState:function(){return Mh(ja)},useDebugValue:Lh,useDeferredValue:function(i){var a=xn();return sr===null?a.memoizedState=i:A0(a,sr.memoizedState,i)},useTransition:function(){var i=Mh(ja)[0],a=xn().memoizedState;return[i,a]},useMutableSource:m0,useSyncExternalStore:p0,useId:T0,unstable_isNewReconciler:!1};function Rn(i,a){if(i&&i.defaultProps){a=M({},a),i=i.defaultProps;for(var p in i)a[p]===void 0&&(a[p]=i[p]);return a}return a}function Ih(i,a,p,S){a=i.memoizedState,p=p(S,a),p=p==null?a:M({},a,p),i.memoizedState=p,i.lanes===0&&(i.updateQueue.baseState=p)}var _c={isMounted:function(i){return(i=i._reactInternals)?pi(i)===i:!1},enqueueSetState:function(i,a,p){i=i._reactInternals;var S=Ir(),A=Us(i),D=ps(S,A);D.payload=a,p!=null&&(D.callback=p),a=zs(i,D,A),a!==null&&(Ln(a,i,A,S),mc(a,i,A))},enqueueReplaceState:function(i,a,p){i=i._reactInternals;var S=Ir(),A=Us(i),D=ps(S,A);D.tag=1,D.payload=a,p!=null&&(D.callback=p),a=zs(i,D,A),a!==null&&(Ln(a,i,A,S),mc(a,i,A))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var p=Ir(),S=Us(i),A=ps(p,S);A.tag=2,a!=null&&(A.callback=a),a=zs(i,A,S),a!==null&&(Ln(a,i,S,p),mc(a,i,S))}};function L0(i,a,p,S,A,D,V){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(S,D,V):a.prototype&&a.prototype.isPureReactComponent?!fa(p,S)||!fa(A,D):!0}function I0(i,a,p){var S=!1,A=Bs,D=a.contextType;return typeof D=="object"&&D!==null?D=gn(D):(A=$r(a)?xi:Er.current,S=a.contextTypes,D=(S=S!=null)?no(i,A):Bs),a=new a(p,D),i.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,i.stateNode=a,a._reactInternals=i,S&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=A,i.__reactInternalMemoizedMaskedChildContext=D),a}function O0(i,a,p,S){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(p,S),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(p,S),a.state!==i&&_c.enqueueReplaceState(a,a.state,null)}function Oh(i,a,p,S){var A=i.stateNode;A.props=p,A.state=i.memoizedState,A.refs={},Sh(i);var D=a.contextType;typeof D=="object"&&D!==null?A.context=gn(D):(D=$r(a)?xi:Er.current,A.context=no(i,D)),A.state=i.memoizedState,D=a.getDerivedStateFromProps,typeof D=="function"&&(Ih(i,a,D,p),A.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(a=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),a!==A.state&&_c.enqueueReplaceState(A,A.state,null),pc(i,p,A,S),A.state=i.memoizedState),typeof A.componentDidMount=="function"&&(i.flags|=4194308)}function ho(i,a){try{var p="",S=a;do p+=fe(S),S=S.return;while(S);var A=p}catch(D){A=`
|
|
36
|
+
`),V=A.length-1,Q=D.length-1;1<=V&&0<=Q&&A[V]!==D[Q];)Q--;for(;1<=V&&0<=Q;V--,Q--)if(A[V]!==D[Q]){if(V!==1||Q!==1)do if(V--,Q--,0>Q||A[V]!==D[Q]){var re=`
|
|
37
|
+
`+A[V].replace(" at new "," at ");return i.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",i.displayName)),re}while(1<=V&&0<=Q);break}}}finally{F=!1,Error.prepareStackTrace=p}return(i=i?i.displayName||i.name:"")?q(i):""}function fe(i){switch(i.tag){case 5:return q(i.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return i=oe(i.type,!1),i;case 11:return i=oe(i.type.render,!1),i;case 1:return i=oe(i.type,!0),i;default:return""}}function me(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 T:return"Fragment";case P:return"Portal";case R:return"Profiler";case N:return"StrictMode";case W:return"Suspense";case Y:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case I:return(i._context.displayName||"Context")+".Provider";case $:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return a=i.displayName||null,a!==null?a:me(i.type)||"Memo";case K:a=i._payload,i=i._init;try{return me(i(a))}catch{}}return null}function X(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(a);case 8:return a===N?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function H(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ae(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ne(i){var a=ae(i)?"checked":"value",p=Object.getOwnPropertyDescriptor(i.constructor.prototype,a),S=""+i[a];if(!i.hasOwnProperty(a)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var A=p.get,D=p.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return A.call(this)},set:function(V){S=""+V,D.call(this,V)}}),Object.defineProperty(i,a,{enumerable:p.enumerable}),{getValue:function(){return S},setValue:function(V){S=""+V},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function J(i){i._valueTracker||(i._valueTracker=ne(i))}function ie(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var p=a.getValue(),S="";return i&&(S=ae(i)?i.checked?"true":"false":i.value),i=S,i!==p?(a.setValue(i),!0):!1}function ye(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 Oe(i,a){var p=a.checked;return M({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??i._wrapperState.initialChecked})}function Ve(i,a){var p=a.defaultValue==null?"":a.defaultValue,S=a.checked!=null?a.checked:a.defaultChecked;p=H(a.value!=null?a.value:p),i._wrapperState={initialChecked:S,initialValue:p,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function te(i,a){a=a.checked,a!=null&&y(i,"checked",a,!1)}function de(i,a){te(i,a);var p=H(a.value),S=a.type;if(p!=null)S==="number"?(p===0&&i.value===""||i.value!=p)&&(i.value=""+p):i.value!==""+p&&(i.value=""+p);else if(S==="submit"||S==="reset"){i.removeAttribute("value");return}a.hasOwnProperty("value")?Re(i,a.type,p):a.hasOwnProperty("defaultValue")&&Re(i,a.type,H(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(i.defaultChecked=!!a.defaultChecked)}function De(i,a,p){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var S=a.type;if(!(S!=="submit"&&S!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+i._wrapperState.initialValue,p||a===i.value||(i.value=a),i.defaultValue=a}p=i.name,p!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,p!==""&&(i.name=p)}function Re(i,a,p){(a!=="number"||ye(i.ownerDocument)!==i)&&(p==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+p&&(i.defaultValue=""+p))}var Ze=Array.isArray;function Se(i,a,p,S){if(i=i.options,a){a={};for(var A=0;A<p.length;A++)a["$"+p[A]]=!0;for(p=0;p<i.length;p++)A=a.hasOwnProperty("$"+i[p].value),i[p].selected!==A&&(i[p].selected=A),A&&S&&(i[p].defaultSelected=!0)}else{for(p=""+H(p),a=null,A=0;A<i.length;A++){if(i[A].value===p){i[A].selected=!0,S&&(i[A].defaultSelected=!0);return}a!==null||i[A].disabled||(a=i[A])}a!==null&&(a.selected=!0)}}function ge(i,a){if(a.dangerouslySetInnerHTML!=null)throw Error(r(91));return M({},a,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Me(i,a){var p=a.value;if(p==null){if(p=a.children,a=a.defaultValue,p!=null){if(a!=null)throw Error(r(92));if(Ze(p)){if(1<p.length)throw Error(r(93));p=p[0]}a=p}a==null&&(a=""),p=a}i._wrapperState={initialValue:H(p)}}function ht(i,a){var p=H(a.value),S=H(a.defaultValue);p!=null&&(p=""+p,p!==i.value&&(i.value=p),a.defaultValue==null&&i.defaultValue!==p&&(i.defaultValue=p)),S!=null&&(i.defaultValue=""+S)}function Rt(i){var a=i.textContent;a===i._wrapperState.initialValue&&a!==""&&a!==null&&(i.value=a)}function pe(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 be(i,a){return i==null||i==="http://www.w3.org/1999/xhtml"?pe(a):i==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Be,Ge=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,p,S,A){MSApp.execUnsafeLocalFunction(function(){return i(a,p,S,A)})}:i})(function(i,a){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=a;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Be.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;a.firstChild;)i.appendChild(a.firstChild)}});function Ke(i,a){if(a){var p=i.firstChild;if(p&&p===i.lastChild&&p.nodeType===3){p.nodeValue=a;return}}i.textContent=a}var bt={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},Z=["Webkit","ms","Moz","O"];Object.keys(bt).forEach(function(i){Z.forEach(function(a){a=a+i.charAt(0).toUpperCase()+i.substring(1),bt[a]=bt[i]})});function Pe(i,a,p){return a==null||typeof a=="boolean"||a===""?"":p||typeof a!="number"||a===0||bt.hasOwnProperty(i)&&bt[i]?(""+a).trim():a+"px"}function Le(i,a){i=i.style;for(var p in a)if(a.hasOwnProperty(p)){var S=p.indexOf("--")===0,A=Pe(p,a[p],S);p==="float"&&(p="cssFloat"),S?i.setProperty(p,A):i[p]=A}}var st=M({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 et(i,a){if(a){if(st[i]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(r(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(r(61))}if(a.style!=null&&typeof a.style!="object")throw Error(r(62))}}function jt(i,a){if(i.indexOf("-")===-1)return typeof a.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 ft=null;function wt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Vt=null,rr=null,jr=null;function hn(i){if(i=ya(i)){if(typeof Vt!="function")throw Error(r(280));var a=i.stateNode;a&&(a=sc(a),Vt(i.stateNode,i.type,a))}}function tt(i){rr?jr?jr.push(i):jr=[i]:rr=i}function qt(){if(rr){var i=rr,a=jr;if(jr=rr=null,hn(i),a)for(i=0;i<a.length;i++)hn(a[i])}}function nr(i,a){return i(a)}function Nr(){}var Ns=!1;function Qt(i,a,p){if(Ns)return i(a,p);Ns=!0;try{return nr(i,a,p)}finally{Ns=!1,(rr!==null||jr!==null)&&(Nr(),qt())}}function cr(i,a){var p=i.stateNode;if(p===null)return null;var S=sc(p);if(S===null)return null;p=S[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(S=!S.disabled)||(i=i.type,S=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!S;break e;default:i=!1}if(i)return null;if(p&&typeof p!="function")throw Error(r(231,a,typeof p));return p}var Es=!1;if(l)try{var xr={};Object.defineProperty(xr,"passive",{get:function(){Es=!0}}),window.addEventListener("test",xr,xr),window.removeEventListener("test",xr,xr)}catch{Es=!1}function Qr(i,a,p,S,A,D,V,Q,re){var he=Array.prototype.slice.call(arguments,3);try{a.apply(p,he)}catch(ve){this.onError(ve)}}var Ps=!1,fn=null,ea=!1,Md=null,V2={onError:function(i){Ps=!0,fn=i}};function U2(i,a,p,S,A,D,V,Q,re){Ps=!1,fn=null,Qr.apply(V2,arguments)}function G2(i,a,p,S,A,D,V,Q,re){if(U2.apply(this,arguments),Ps){if(Ps){var he=fn;Ps=!1,fn=null}else throw Error(r(198));ea||(ea=!0,Md=he)}}function pi(i){var a=i,p=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(p=a.return),i=a.return;while(i)}return a.tag===3?p:null}function Qg(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function Zg(i){if(pi(i)!==i)throw Error(r(188))}function K2(i){var a=i.alternate;if(!a){if(a=pi(i),a===null)throw Error(r(188));return a!==i?null:i}for(var p=i,S=a;;){var A=p.return;if(A===null)break;var D=A.alternate;if(D===null){if(S=A.return,S!==null){p=S;continue}break}if(A.child===D.child){for(D=A.child;D;){if(D===p)return Zg(A),i;if(D===S)return Zg(A),a;D=D.sibling}throw Error(r(188))}if(p.return!==S.return)p=A,S=D;else{for(var V=!1,Q=A.child;Q;){if(Q===p){V=!0,p=A,S=D;break}if(Q===S){V=!0,S=A,p=D;break}Q=Q.sibling}if(!V){for(Q=D.child;Q;){if(Q===p){V=!0,p=D,S=A;break}if(Q===S){V=!0,S=D,p=A;break}Q=Q.sibling}if(!V)throw Error(r(189))}}if(p.alternate!==S)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?i:a}function ex(i){return i=K2(i),i!==null?tx(i):null}function tx(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=tx(i);if(a!==null)return a;i=i.sibling}return null}var rx=t.unstable_scheduleCallback,nx=t.unstable_cancelCallback,q2=t.unstable_shouldYield,Y2=t.unstable_requestPaint,Yt=t.unstable_now,X2=t.unstable_getCurrentPriorityLevel,Dd=t.unstable_ImmediatePriority,sx=t.unstable_UserBlockingPriority,Bl=t.unstable_NormalPriority,J2=t.unstable_LowPriority,ix=t.unstable_IdlePriority,Fl=null,Wn=null;function Q2(i){if(Wn&&typeof Wn.onCommitFiberRoot=="function")try{Wn.onCommitFiberRoot(Fl,i,void 0,(i.current.flags&128)===128)}catch{}}var Pn=Math.clz32?Math.clz32:tN,Z2=Math.log,eN=Math.LN2;function tN(i){return i>>>=0,i===0?32:31-(Z2(i)/eN|0)|0}var $l=64,zl=4194304;function ta(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 Hl(i,a){var p=i.pendingLanes;if(p===0)return 0;var S=0,A=i.suspendedLanes,D=i.pingedLanes,V=p&268435455;if(V!==0){var Q=V&~A;Q!==0?S=ta(Q):(D&=V,D!==0&&(S=ta(D)))}else V=p&~A,V!==0?S=ta(V):D!==0&&(S=ta(D));if(S===0)return 0;if(a!==0&&a!==S&&(a&A)===0&&(A=S&-S,D=a&-a,A>=D||A===16&&(D&4194240)!==0))return a;if((S&4)!==0&&(S|=p&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=S;0<a;)p=31-Pn(a),A=1<<p,S|=i[p],a&=~A;return S}function rN(i,a){switch(i){case 1:case 2:case 4:return a+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 a+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 nN(i,a){for(var p=i.suspendedLanes,S=i.pingedLanes,A=i.expirationTimes,D=i.pendingLanes;0<D;){var V=31-Pn(D),Q=1<<V,re=A[V];re===-1?((Q&p)===0||(Q&S)!==0)&&(A[V]=rN(Q,a)):re<=a&&(i.expiredLanes|=Q),D&=~Q}}function Ld(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function ox(){var i=$l;return $l<<=1,($l&4194240)===0&&($l=64),i}function Id(i){for(var a=[],p=0;31>p;p++)a.push(i);return a}function ra(i,a,p){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-Pn(a),i[a]=p}function sN(i,a){var p=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var S=i.eventTimes;for(i=i.expirationTimes;0<p;){var A=31-Pn(p),D=1<<A;a[A]=0,S[A]=-1,i[A]=-1,p&=~D}}function Od(i,a){var p=i.entangledLanes|=a;for(i=i.entanglements;p;){var S=31-Pn(p),A=1<<S;A&a|i[S]&a&&(i[S]|=a),p&=~A}}var _t=0;function ax(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var lx,Bd,cx,ux,dx,Fd=!1,Wl=[],As=null,Ts=null,Rs=null,na=new Map,sa=new Map,Ms=[],iN="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 hx(i,a){switch(i){case"focusin":case"focusout":As=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":na.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":sa.delete(a.pointerId)}}function ia(i,a,p,S,A,D){return i===null||i.nativeEvent!==D?(i={blockedOn:a,domEventName:p,eventSystemFlags:S,nativeEvent:D,targetContainers:[A]},a!==null&&(a=ya(a),a!==null&&Bd(a)),i):(i.eventSystemFlags|=S,a=i.targetContainers,A!==null&&a.indexOf(A)===-1&&a.push(A),i)}function oN(i,a,p,S,A){switch(a){case"focusin":return As=ia(As,i,a,p,S,A),!0;case"dragenter":return Ts=ia(Ts,i,a,p,S,A),!0;case"mouseover":return Rs=ia(Rs,i,a,p,S,A),!0;case"pointerover":var D=A.pointerId;return na.set(D,ia(na.get(D)||null,i,a,p,S,A)),!0;case"gotpointercapture":return D=A.pointerId,sa.set(D,ia(sa.get(D)||null,i,a,p,S,A)),!0}return!1}function fx(i){var a=gi(i.target);if(a!==null){var p=pi(a);if(p!==null){if(a=p.tag,a===13){if(a=Qg(p),a!==null){i.blockedOn=a,dx(i.priority,function(){cx(p)});return}}else if(a===3&&p.stateNode.current.memoizedState.isDehydrated){i.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Vl(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var p=zd(i.domEventName,i.eventSystemFlags,a[0],i.nativeEvent);if(p===null){p=i.nativeEvent;var S=new p.constructor(p.type,p);ft=S,p.target.dispatchEvent(S),ft=null}else return a=ya(p),a!==null&&Bd(a),i.blockedOn=p,!1;a.shift()}return!0}function mx(i,a,p){Vl(i)&&p.delete(a)}function aN(){Fd=!1,As!==null&&Vl(As)&&(As=null),Ts!==null&&Vl(Ts)&&(Ts=null),Rs!==null&&Vl(Rs)&&(Rs=null),na.forEach(mx),sa.forEach(mx)}function oa(i,a){i.blockedOn===a&&(i.blockedOn=null,Fd||(Fd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,aN)))}function aa(i){function a(A){return oa(A,i)}if(0<Wl.length){oa(Wl[0],i);for(var p=1;p<Wl.length;p++){var S=Wl[p];S.blockedOn===i&&(S.blockedOn=null)}}for(As!==null&&oa(As,i),Ts!==null&&oa(Ts,i),Rs!==null&&oa(Rs,i),na.forEach(a),sa.forEach(a),p=0;p<Ms.length;p++)S=Ms[p],S.blockedOn===i&&(S.blockedOn=null);for(;0<Ms.length&&(p=Ms[0],p.blockedOn===null);)fx(p),p.blockedOn===null&&Ms.shift()}var qi=j.ReactCurrentBatchConfig,Ul=!0;function lN(i,a,p,S){var A=_t,D=qi.transition;qi.transition=null;try{_t=1,$d(i,a,p,S)}finally{_t=A,qi.transition=D}}function cN(i,a,p,S){var A=_t,D=qi.transition;qi.transition=null;try{_t=4,$d(i,a,p,S)}finally{_t=A,qi.transition=D}}function $d(i,a,p,S){if(Ul){var A=zd(i,a,p,S);if(A===null)sh(i,a,S,Gl,p),hx(i,S);else if(oN(A,i,a,p,S))S.stopPropagation();else if(hx(i,S),a&4&&-1<iN.indexOf(i)){for(;A!==null;){var D=ya(A);if(D!==null&&lx(D),D=zd(i,a,p,S),D===null&&sh(i,a,S,Gl,p),D===A)break;A=D}A!==null&&S.stopPropagation()}else sh(i,a,S,null,p)}}var Gl=null;function zd(i,a,p,S){if(Gl=null,i=wt(S),i=gi(i),i!==null)if(a=pi(i),a===null)i=null;else if(p=a.tag,p===13){if(i=Qg(a),i!==null)return i;i=null}else if(p===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null);return Gl=i,null}function px(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(X2()){case Dd:return 1;case sx:return 4;case Bl:case J2:return 16;case ix:return 536870912;default:return 16}default:return 16}}var Ds=null,Hd=null,Kl=null;function gx(){if(Kl)return Kl;var i,a=Hd,p=a.length,S,A="value"in Ds?Ds.value:Ds.textContent,D=A.length;for(i=0;i<p&&a[i]===A[i];i++);var V=p-i;for(S=1;S<=V&&a[p-S]===A[D-S];S++);return Kl=A.slice(i,1<S?1-S:void 0)}function ql(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function Yl(){return!0}function xx(){return!1}function Zr(i){function a(p,S,A,D,V){this._reactName=p,this._targetInst=A,this.type=S,this.nativeEvent=D,this.target=V,this.currentTarget=null;for(var Q in i)i.hasOwnProperty(Q)&&(p=i[Q],this[Q]=p?p(D):D[Q]);return this.isDefaultPrevented=(D.defaultPrevented!=null?D.defaultPrevented:D.returnValue===!1)?Yl:xx,this.isPropagationStopped=xx,this}return M(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Yl)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Yl)},persist:function(){},isPersistent:Yl}),a}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=Zr(Yi),la=M({},Yi,{view:0,detail:0}),uN=Zr(la),Vd,Ud,ca,Xl=M({},la,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kd,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!==ca&&(ca&&i.type==="mousemove"?(Vd=i.screenX-ca.screenX,Ud=i.screenY-ca.screenY):Ud=Vd=0,ca=i),Vd)},movementY:function(i){return"movementY"in i?i.movementY:Ud}}),vx=Zr(Xl),dN=M({},Xl,{dataTransfer:0}),hN=Zr(dN),fN=M({},la,{relatedTarget:0}),Gd=Zr(fN),mN=M({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),pN=Zr(mN),gN=M({},Yi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),xN=Zr(gN),vN=M({},Yi,{data:0}),yx=Zr(vN),yN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bN={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"},wN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _N(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=wN[i])?!!a[i]:!1}function Kd(){return _N}var SN=M({},la,{key:function(i){if(i.key){var a=yN[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?bN[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kd,charCode:function(i){return i.type==="keypress"?ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),CN=Zr(SN),kN=M({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bx=Zr(kN),jN=M({},la,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kd}),NN=Zr(jN),EN=M({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),PN=Zr(EN),AN=M({},Xl,{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}),TN=Zr(AN),RN=[9,13,27,32],qd=l&&"CompositionEvent"in window,ua=null;l&&"documentMode"in document&&(ua=document.documentMode);var MN=l&&"TextEvent"in window&&!ua,wx=l&&(!qd||ua&&8<ua&&11>=ua),_x=" ",Sx=!1;function Cx(i,a){switch(i){case"keyup":return RN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kx(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Xi=!1;function DN(i,a){switch(i){case"compositionend":return kx(a);case"keypress":return a.which!==32?null:(Sx=!0,_x);case"textInput":return i=a.data,i===_x&&Sx?null:i;default:return null}}function LN(i,a){if(Xi)return i==="compositionend"||!qd&&Cx(i,a)?(i=gx(),Kl=Hd=Ds=null,Xi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return wx&&a.locale!=="ko"?null:a.data;default:return null}}var IN={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 jx(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!IN[i.type]:a==="textarea"}function Nx(i,a,p,S){tt(S),a=tc(a,"onChange"),0<a.length&&(p=new Wd("onChange","change",null,p,S),i.push({event:p,listeners:a}))}var da=null,ha=null;function ON(i){Ux(i,0)}function Jl(i){var a=to(i);if(ie(a))return i}function BN(i,a){if(i==="change")return a}var Ex=!1;if(l){var Yd;if(l){var Xd="oninput"in document;if(!Xd){var Px=document.createElement("div");Px.setAttribute("oninput","return;"),Xd=typeof Px.oninput=="function"}Yd=Xd}else Yd=!1;Ex=Yd&&(!document.documentMode||9<document.documentMode)}function Ax(){da&&(da.detachEvent("onpropertychange",Tx),ha=da=null)}function Tx(i){if(i.propertyName==="value"&&Jl(ha)){var a=[];Nx(a,ha,i,wt(i)),Qt(ON,a)}}function FN(i,a,p){i==="focusin"?(Ax(),da=a,ha=p,da.attachEvent("onpropertychange",Tx)):i==="focusout"&&Ax()}function $N(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Jl(ha)}function zN(i,a){if(i==="click")return Jl(a)}function HN(i,a){if(i==="input"||i==="change")return Jl(a)}function WN(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var An=typeof Object.is=="function"?Object.is:WN;function fa(i,a){if(An(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var p=Object.keys(i),S=Object.keys(a);if(p.length!==S.length)return!1;for(S=0;S<p.length;S++){var A=p[S];if(!c.call(a,A)||!An(i[A],a[A]))return!1}return!0}function Rx(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Mx(i,a){var p=Rx(i);i=0;for(var S;p;){if(p.nodeType===3){if(S=i+p.textContent.length,i<=a&&S>=a)return{node:p,offset:a-i};i=S}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Rx(p)}}function Dx(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?Dx(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function Lx(){for(var i=window,a=ye();a instanceof i.HTMLIFrameElement;){try{var p=typeof a.contentWindow.location.href=="string"}catch{p=!1}if(p)i=a.contentWindow;else break;a=ye(i.document)}return a}function Jd(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}function VN(i){var a=Lx(),p=i.focusedElem,S=i.selectionRange;if(a!==p&&p&&p.ownerDocument&&Dx(p.ownerDocument.documentElement,p)){if(S!==null&&Jd(p)){if(a=S.start,i=S.end,i===void 0&&(i=a),"selectionStart"in p)p.selectionStart=a,p.selectionEnd=Math.min(i,p.value.length);else if(i=(a=p.ownerDocument||document)&&a.defaultView||window,i.getSelection){i=i.getSelection();var A=p.textContent.length,D=Math.min(S.start,A);S=S.end===void 0?D:Math.min(S.end,A),!i.extend&&D>S&&(A=S,S=D,D=A),A=Mx(p,D);var V=Mx(p,S);A&&V&&(i.rangeCount!==1||i.anchorNode!==A.node||i.anchorOffset!==A.offset||i.focusNode!==V.node||i.focusOffset!==V.offset)&&(a=a.createRange(),a.setStart(A.node,A.offset),i.removeAllRanges(),D>S?(i.addRange(a),i.extend(V.node,V.offset)):(a.setEnd(V.node,V.offset),i.addRange(a)))}}for(a=[],i=p;i=i.parentNode;)i.nodeType===1&&a.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<a.length;p++)i=a[p],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var UN=l&&"documentMode"in document&&11>=document.documentMode,Ji=null,Qd=null,ma=null,Zd=!1;function Ix(i,a,p){var S=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Zd||Ji==null||Ji!==ye(S)||(S=Ji,"selectionStart"in S&&Jd(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),ma&&fa(ma,S)||(ma=S,S=tc(Qd,"onSelect"),0<S.length&&(a=new Wd("onSelect","select",null,a,p),i.push({event:a,listeners:S}),a.target=Ji)))}function Ql(i,a){var p={};return p[i.toLowerCase()]=a.toLowerCase(),p["Webkit"+i]="webkit"+a,p["Moz"+i]="moz"+a,p}var Qi={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionend:Ql("Transition","TransitionEnd")},eh={},Ox={};l&&(Ox=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function Zl(i){if(eh[i])return eh[i];if(!Qi[i])return i;var a=Qi[i],p;for(p in a)if(a.hasOwnProperty(p)&&p in Ox)return eh[i]=a[p];return i}var Bx=Zl("animationend"),Fx=Zl("animationiteration"),$x=Zl("animationstart"),zx=Zl("transitionend"),Hx=new Map,Wx="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 Ls(i,a){Hx.set(i,a),u(a,[i])}for(var th=0;th<Wx.length;th++){var rh=Wx[th],GN=rh.toLowerCase(),KN=rh[0].toUpperCase()+rh.slice(1);Ls(GN,"on"+KN)}Ls(Bx,"onAnimationEnd"),Ls(Fx,"onAnimationIteration"),Ls($x,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(zx,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pa="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(" "),qN=new Set("cancel close invalid load scroll toggle".split(" ").concat(pa));function Vx(i,a,p){var S=i.type||"unknown-event";i.currentTarget=p,G2(S,a,void 0,i),i.currentTarget=null}function Ux(i,a){a=(a&4)!==0;for(var p=0;p<i.length;p++){var S=i[p],A=S.event;S=S.listeners;e:{var D=void 0;if(a)for(var V=S.length-1;0<=V;V--){var Q=S[V],re=Q.instance,he=Q.currentTarget;if(Q=Q.listener,re!==D&&A.isPropagationStopped())break e;Vx(A,Q,he),D=re}else for(V=0;V<S.length;V++){if(Q=S[V],re=Q.instance,he=Q.currentTarget,Q=Q.listener,re!==D&&A.isPropagationStopped())break e;Vx(A,Q,he),D=re}}}if(ea)throw i=Md,ea=!1,Md=null,i}function Mt(i,a){var p=a[uh];p===void 0&&(p=a[uh]=new Set);var S=i+"__bubble";p.has(S)||(Gx(a,i,2,!1),p.add(S))}function nh(i,a,p){var S=0;a&&(S|=4),Gx(p,i,S,a)}var ec="_reactListening"+Math.random().toString(36).slice(2);function ga(i){if(!i[ec]){i[ec]=!0,s.forEach(function(p){p!=="selectionchange"&&(qN.has(p)||nh(p,!1,i),nh(p,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[ec]||(a[ec]=!0,nh("selectionchange",!1,a))}}function Gx(i,a,p,S){switch(px(a)){case 1:var A=lN;break;case 4:A=cN;break;default:A=$d}p=A.bind(null,a,p,i),A=void 0,!Es||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(A=!0),S?A!==void 0?i.addEventListener(a,p,{capture:!0,passive:A}):i.addEventListener(a,p,!0):A!==void 0?i.addEventListener(a,p,{passive:A}):i.addEventListener(a,p,!1)}function sh(i,a,p,S,A){var D=S;if((a&1)===0&&(a&2)===0&&S!==null)e:for(;;){if(S===null)return;var V=S.tag;if(V===3||V===4){var Q=S.stateNode.containerInfo;if(Q===A||Q.nodeType===8&&Q.parentNode===A)break;if(V===4)for(V=S.return;V!==null;){var re=V.tag;if((re===3||re===4)&&(re=V.stateNode.containerInfo,re===A||re.nodeType===8&&re.parentNode===A))return;V=V.return}for(;Q!==null;){if(V=gi(Q),V===null)return;if(re=V.tag,re===5||re===6){S=D=V;continue e}Q=Q.parentNode}}S=S.return}Qt(function(){var he=D,ve=wt(p),we=[];e:{var xe=Hx.get(i);if(xe!==void 0){var Ie=Wd,$e=i;switch(i){case"keypress":if(ql(p)===0)break e;case"keydown":case"keyup":Ie=CN;break;case"focusin":$e="focus",Ie=Gd;break;case"focusout":$e="blur",Ie=Gd;break;case"beforeblur":case"afterblur":Ie=Gd;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=hN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=NN;break;case Bx:case Fx:case $x:Ie=pN;break;case zx:Ie=PN;break;case"scroll":Ie=uN;break;case"wheel":Ie=TN;break;case"copy":case"cut":case"paste":Ie=xN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=bx}var We=(a&4)!==0,Xt=!We&&i==="scroll",ce=We?xe!==null?xe+"Capture":null:xe;We=[];for(var se=he,ue;se!==null;){ue=se;var Ne=ue.stateNode;if(ue.tag===5&&Ne!==null&&(ue=Ne,ce!==null&&(Ne=cr(se,ce),Ne!=null&&We.push(xa(se,Ne,ue)))),Xt)break;se=se.return}0<We.length&&(xe=new Ie(xe,$e,null,p,ve),we.push({event:xe,listeners:We}))}}if((a&7)===0){e:{if(xe=i==="mouseover"||i==="pointerover",Ie=i==="mouseout"||i==="pointerout",xe&&p!==ft&&($e=p.relatedTarget||p.fromElement)&&(gi($e)||$e[us]))break e;if((Ie||xe)&&(xe=ve.window===ve?ve:(xe=ve.ownerDocument)?xe.defaultView||xe.parentWindow:window,Ie?($e=p.relatedTarget||p.toElement,Ie=he,$e=$e?gi($e):null,$e!==null&&(Xt=pi($e),$e!==Xt||$e.tag!==5&&$e.tag!==6)&&($e=null)):(Ie=null,$e=he),Ie!==$e)){if(We=vx,Ne="onMouseLeave",ce="onMouseEnter",se="mouse",(i==="pointerout"||i==="pointerover")&&(We=bx,Ne="onPointerLeave",ce="onPointerEnter",se="pointer"),Xt=Ie==null?xe:to(Ie),ue=$e==null?xe:to($e),xe=new We(Ne,se+"leave",Ie,p,ve),xe.target=Xt,xe.relatedTarget=ue,Ne=null,gi(ve)===he&&(We=new We(ce,se+"enter",$e,p,ve),We.target=ue,We.relatedTarget=Xt,Ne=We),Xt=Ne,Ie&&$e)t:{for(We=Ie,ce=$e,se=0,ue=We;ue;ue=Zi(ue))se++;for(ue=0,Ne=ce;Ne;Ne=Zi(Ne))ue++;for(;0<se-ue;)We=Zi(We),se--;for(;0<ue-se;)ce=Zi(ce),ue--;for(;se--;){if(We===ce||ce!==null&&We===ce.alternate)break t;We=Zi(We),ce=Zi(ce)}We=null}else We=null;Ie!==null&&Kx(we,xe,Ie,We,!1),$e!==null&&Xt!==null&&Kx(we,Xt,$e,We,!0)}}e:{if(xe=he?to(he):window,Ie=xe.nodeName&&xe.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&xe.type==="file")var Ue=BN;else if(jx(xe))if(Ex)Ue=HN;else{Ue=$N;var qe=FN}else(Ie=xe.nodeName)&&Ie.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(Ue=zN);if(Ue&&(Ue=Ue(i,he))){Nx(we,Ue,p,ve);break e}qe&&qe(i,xe,he),i==="focusout"&&(qe=xe._wrapperState)&&qe.controlled&&xe.type==="number"&&Re(xe,"number",xe.value)}switch(qe=he?to(he):window,i){case"focusin":(jx(qe)||qe.contentEditable==="true")&&(Ji=qe,Qd=he,ma=null);break;case"focusout":ma=Qd=Ji=null;break;case"mousedown":Zd=!0;break;case"contextmenu":case"mouseup":case"dragend":Zd=!1,Ix(we,p,ve);break;case"selectionchange":if(UN)break;case"keydown":case"keyup":Ix(we,p,ve)}var Ye;if(qd)e:{switch(i){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Xi?Cx(i,p)&&(rt="onCompositionEnd"):i==="keydown"&&p.keyCode===229&&(rt="onCompositionStart");rt&&(wx&&p.locale!=="ko"&&(Xi||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Xi&&(Ye=gx()):(Ds=ve,Hd="value"in Ds?Ds.value:Ds.textContent,Xi=!0)),qe=tc(he,rt),0<qe.length&&(rt=new yx(rt,i,null,p,ve),we.push({event:rt,listeners:qe}),Ye?rt.data=Ye:(Ye=kx(p),Ye!==null&&(rt.data=Ye)))),(Ye=MN?DN(i,p):LN(i,p))&&(he=tc(he,"onBeforeInput"),0<he.length&&(ve=new yx("onBeforeInput","beforeinput",null,p,ve),we.push({event:ve,listeners:he}),ve.data=Ye))}Ux(we,a)})}function xa(i,a,p){return{instance:i,listener:a,currentTarget:p}}function tc(i,a){for(var p=a+"Capture",S=[];i!==null;){var A=i,D=A.stateNode;A.tag===5&&D!==null&&(A=D,D=cr(i,p),D!=null&&S.unshift(xa(i,D,A)),D=cr(i,a),D!=null&&S.push(xa(i,D,A))),i=i.return}return S}function Zi(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Kx(i,a,p,S,A){for(var D=a._reactName,V=[];p!==null&&p!==S;){var Q=p,re=Q.alternate,he=Q.stateNode;if(re!==null&&re===S)break;Q.tag===5&&he!==null&&(Q=he,A?(re=cr(p,D),re!=null&&V.unshift(xa(p,re,Q))):A||(re=cr(p,D),re!=null&&V.push(xa(p,re,Q)))),p=p.return}V.length!==0&&i.push({event:a,listeners:V})}var YN=/\r\n?/g,XN=/\u0000|\uFFFD/g;function qx(i){return(typeof i=="string"?i:""+i).replace(YN,`
|
|
38
|
+
`).replace(XN,"")}function rc(i,a,p){if(a=qx(a),qx(i)!==a&&p)throw Error(r(425))}function nc(){}var ih=null,oh=null;function ah(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var lh=typeof setTimeout=="function"?setTimeout:void 0,JN=typeof clearTimeout=="function"?clearTimeout:void 0,Yx=typeof Promise=="function"?Promise:void 0,QN=typeof queueMicrotask=="function"?queueMicrotask:typeof Yx<"u"?function(i){return Yx.resolve(null).then(i).catch(ZN)}:lh;function ZN(i){setTimeout(function(){throw i})}function ch(i,a){var p=a,S=0;do{var A=p.nextSibling;if(i.removeChild(p),A&&A.nodeType===8)if(p=A.data,p==="/$"){if(S===0){i.removeChild(A),aa(a);return}S--}else p!=="$"&&p!=="$?"&&p!=="$!"||S++;p=A}while(p);aa(a)}function Is(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return i}function Xx(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var p=i.data;if(p==="$"||p==="$!"||p==="$?"){if(a===0)return i;a--}else p==="/$"&&a++}i=i.previousSibling}return null}var eo=Math.random().toString(36).slice(2),Vn="__reactFiber$"+eo,va="__reactProps$"+eo,us="__reactContainer$"+eo,uh="__reactEvents$"+eo,eE="__reactListeners$"+eo,tE="__reactHandles$"+eo;function gi(i){var a=i[Vn];if(a)return a;for(var p=i.parentNode;p;){if(a=p[us]||p[Vn]){if(p=a.alternate,a.child!==null||p!==null&&p.child!==null)for(i=Xx(i);i!==null;){if(p=i[Vn])return p;i=Xx(i)}return a}i=p,p=i.parentNode}return null}function ya(i){return i=i[Vn]||i[us],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function to(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function sc(i){return i[va]||null}var dh=[],ro=-1;function Os(i){return{current:i}}function Dt(i){0>ro||(i.current=dh[ro],dh[ro]=null,ro--)}function Nt(i,a){ro++,dh[ro]=i.current,i.current=a}var Bs={},Er=Os(Bs),Fr=Os(!1),xi=Bs;function no(i,a){var p=i.type.contextTypes;if(!p)return Bs;var S=i.stateNode;if(S&&S.__reactInternalMemoizedUnmaskedChildContext===a)return S.__reactInternalMemoizedMaskedChildContext;var A={},D;for(D in p)A[D]=a[D];return S&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=A),A}function $r(i){return i=i.childContextTypes,i!=null}function ic(){Dt(Fr),Dt(Er)}function Jx(i,a,p){if(Er.current!==Bs)throw Error(r(168));Nt(Er,a),Nt(Fr,p)}function Qx(i,a,p){var S=i.stateNode;if(a=a.childContextTypes,typeof S.getChildContext!="function")return p;S=S.getChildContext();for(var A in S)if(!(A in a))throw Error(r(108,X(i)||"Unknown",A));return M({},p,S)}function oc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Bs,xi=Er.current,Nt(Er,i),Nt(Fr,Fr.current),!0}function Zx(i,a,p){var S=i.stateNode;if(!S)throw Error(r(169));p?(i=Qx(i,a,xi),S.__reactInternalMemoizedMergedChildContext=i,Dt(Fr),Dt(Er),Nt(Er,i)):Dt(Fr),Nt(Fr,p)}var ds=null,ac=!1,hh=!1;function e0(i){ds===null?ds=[i]:ds.push(i)}function rE(i){ac=!0,e0(i)}function Fs(){if(!hh&&ds!==null){hh=!0;var i=0,a=_t;try{var p=ds;for(_t=1;i<p.length;i++){var S=p[i];do S=S(!0);while(S!==null)}ds=null,ac=!1}catch(A){throw ds!==null&&(ds=ds.slice(i+1)),rx(Dd,Fs),A}finally{_t=a,hh=!1}}return null}var so=[],io=0,lc=null,cc=0,mn=[],pn=0,vi=null,hs=1,fs="";function yi(i,a){so[io++]=cc,so[io++]=lc,lc=i,cc=a}function t0(i,a,p){mn[pn++]=hs,mn[pn++]=fs,mn[pn++]=vi,vi=i;var S=hs;i=fs;var A=32-Pn(S)-1;S&=~(1<<A),p+=1;var D=32-Pn(a)+A;if(30<D){var V=A-A%5;D=(S&(1<<V)-1).toString(32),S>>=V,A-=V,hs=1<<32-Pn(a)+A|p<<A|S,fs=D+i}else hs=1<<D|p<<A|S,fs=i}function fh(i){i.return!==null&&(yi(i,1),t0(i,1,0))}function mh(i){for(;i===lc;)lc=so[--io],so[io]=null,cc=so[--io],so[io]=null;for(;i===vi;)vi=mn[--pn],mn[pn]=null,fs=mn[--pn],mn[pn]=null,hs=mn[--pn],mn[pn]=null}var en=null,tn=null,Ot=!1,Tn=null;function r0(i,a){var p=yn(5,null,null,0);p.elementType="DELETED",p.stateNode=a,p.return=i,a=i.deletions,a===null?(i.deletions=[p],i.flags|=16):a.push(p)}function n0(i,a){switch(i.tag){case 5:var p=i.type;return a=a.nodeType!==1||p.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(i.stateNode=a,en=i,tn=Is(a.firstChild),!0):!1;case 6:return a=i.pendingProps===""||a.nodeType!==3?null:a,a!==null?(i.stateNode=a,en=i,tn=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(p=vi!==null?{id:hs,overflow:fs}:null,i.memoizedState={dehydrated:a,treeContext:p,retryLane:1073741824},p=yn(18,null,null,0),p.stateNode=a,p.return=i,i.child=p,en=i,tn=null,!0):!1;default:return!1}}function ph(i){return(i.mode&1)!==0&&(i.flags&128)===0}function gh(i){if(Ot){var a=tn;if(a){var p=a;if(!n0(i,a)){if(ph(i))throw Error(r(418));a=Is(p.nextSibling);var S=en;a&&n0(i,a)?r0(S,p):(i.flags=i.flags&-4097|2,Ot=!1,en=i)}}else{if(ph(i))throw Error(r(418));i.flags=i.flags&-4097|2,Ot=!1,en=i}}}function s0(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;en=i}function uc(i){if(i!==en)return!1;if(!Ot)return s0(i),Ot=!0,!1;var a;if((a=i.tag!==3)&&!(a=i.tag!==5)&&(a=i.type,a=a!=="head"&&a!=="body"&&!ah(i.type,i.memoizedProps)),a&&(a=tn)){if(ph(i))throw i0(),Error(r(418));for(;a;)r0(i,a),a=Is(a.nextSibling)}if(s0(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,a=0;i;){if(i.nodeType===8){var p=i.data;if(p==="/$"){if(a===0){tn=Is(i.nextSibling);break e}a--}else p!=="$"&&p!=="$!"&&p!=="$?"||a++}i=i.nextSibling}tn=null}}else tn=en?Is(i.stateNode.nextSibling):null;return!0}function i0(){for(var i=tn;i;)i=Is(i.nextSibling)}function oo(){tn=en=null,Ot=!1}function xh(i){Tn===null?Tn=[i]:Tn.push(i)}var nE=j.ReactCurrentBatchConfig;function ba(i,a,p){if(i=p.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(r(309));var S=p.stateNode}if(!S)throw Error(r(147,i));var A=S,D=""+i;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===D?a.ref:(a=function(V){var Q=A.refs;V===null?delete Q[D]:Q[D]=V},a._stringRef=D,a)}if(typeof i!="string")throw Error(r(284));if(!p._owner)throw Error(r(290,i))}return i}function dc(i,a){throw i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i))}function o0(i){var a=i._init;return a(i._payload)}function a0(i){function a(ce,se){if(i){var ue=ce.deletions;ue===null?(ce.deletions=[se],ce.flags|=16):ue.push(se)}}function p(ce,se){if(!i)return null;for(;se!==null;)a(ce,se),se=se.sibling;return null}function S(ce,se){for(ce=new Map;se!==null;)se.key!==null?ce.set(se.key,se):ce.set(se.index,se),se=se.sibling;return ce}function A(ce,se){return ce=Ks(ce,se),ce.index=0,ce.sibling=null,ce}function D(ce,se,ue){return ce.index=ue,i?(ue=ce.alternate,ue!==null?(ue=ue.index,ue<se?(ce.flags|=2,se):ue):(ce.flags|=2,se)):(ce.flags|=1048576,se)}function V(ce){return i&&ce.alternate===null&&(ce.flags|=2),ce}function Q(ce,se,ue,Ne){return se===null||se.tag!==6?(se=cf(ue,ce.mode,Ne),se.return=ce,se):(se=A(se,ue),se.return=ce,se)}function re(ce,se,ue,Ne){var Ue=ue.type;return Ue===T?ve(ce,se,ue.props.children,Ne,ue.key):se!==null&&(se.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===K&&o0(Ue)===se.type)?(Ne=A(se,ue.props),Ne.ref=ba(ce,se,ue),Ne.return=ce,Ne):(Ne=Lc(ue.type,ue.key,ue.props,null,ce.mode,Ne),Ne.ref=ba(ce,se,ue),Ne.return=ce,Ne)}function he(ce,se,ue,Ne){return se===null||se.tag!==4||se.stateNode.containerInfo!==ue.containerInfo||se.stateNode.implementation!==ue.implementation?(se=uf(ue,ce.mode,Ne),se.return=ce,se):(se=A(se,ue.children||[]),se.return=ce,se)}function ve(ce,se,ue,Ne,Ue){return se===null||se.tag!==7?(se=Ni(ue,ce.mode,Ne,Ue),se.return=ce,se):(se=A(se,ue),se.return=ce,se)}function we(ce,se,ue){if(typeof se=="string"&&se!==""||typeof se=="number")return se=cf(""+se,ce.mode,ue),se.return=ce,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return ue=Lc(se.type,se.key,se.props,null,ce.mode,ue),ue.ref=ba(ce,null,se),ue.return=ce,ue;case P:return se=uf(se,ce.mode,ue),se.return=ce,se;case K:var Ne=se._init;return we(ce,Ne(se._payload),ue)}if(Ze(se)||L(se))return se=Ni(se,ce.mode,ue,null),se.return=ce,se;dc(ce,se)}return null}function xe(ce,se,ue,Ne){var Ue=se!==null?se.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Ue!==null?null:Q(ce,se,""+ue,Ne);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return ue.key===Ue?re(ce,se,ue,Ne):null;case P:return ue.key===Ue?he(ce,se,ue,Ne):null;case K:return Ue=ue._init,xe(ce,se,Ue(ue._payload),Ne)}if(Ze(ue)||L(ue))return Ue!==null?null:ve(ce,se,ue,Ne,null);dc(ce,ue)}return null}function Ie(ce,se,ue,Ne,Ue){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number")return ce=ce.get(ue)||null,Q(se,ce,""+Ne,Ue);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case E:return ce=ce.get(Ne.key===null?ue:Ne.key)||null,re(se,ce,Ne,Ue);case P:return ce=ce.get(Ne.key===null?ue:Ne.key)||null,he(se,ce,Ne,Ue);case K:var qe=Ne._init;return Ie(ce,se,ue,qe(Ne._payload),Ue)}if(Ze(Ne)||L(Ne))return ce=ce.get(ue)||null,ve(se,ce,Ne,Ue,null);dc(se,Ne)}return null}function $e(ce,se,ue,Ne){for(var Ue=null,qe=null,Ye=se,rt=se=0,hr=null;Ye!==null&&rt<ue.length;rt++){Ye.index>rt?(hr=Ye,Ye=null):hr=Ye.sibling;var gt=xe(ce,Ye,ue[rt],Ne);if(gt===null){Ye===null&&(Ye=hr);break}i&&Ye&>.alternate===null&&a(ce,Ye),se=D(gt,se,rt),qe===null?Ue=gt:qe.sibling=gt,qe=gt,Ye=hr}if(rt===ue.length)return p(ce,Ye),Ot&&yi(ce,rt),Ue;if(Ye===null){for(;rt<ue.length;rt++)Ye=we(ce,ue[rt],Ne),Ye!==null&&(se=D(Ye,se,rt),qe===null?Ue=Ye:qe.sibling=Ye,qe=Ye);return Ot&&yi(ce,rt),Ue}for(Ye=S(ce,Ye);rt<ue.length;rt++)hr=Ie(Ye,ce,rt,ue[rt],Ne),hr!==null&&(i&&hr.alternate!==null&&Ye.delete(hr.key===null?rt:hr.key),se=D(hr,se,rt),qe===null?Ue=hr:qe.sibling=hr,qe=hr);return i&&Ye.forEach(function(qs){return a(ce,qs)}),Ot&&yi(ce,rt),Ue}function We(ce,se,ue,Ne){var Ue=L(ue);if(typeof Ue!="function")throw Error(r(150));if(ue=Ue.call(ue),ue==null)throw Error(r(151));for(var qe=Ue=null,Ye=se,rt=se=0,hr=null,gt=ue.next();Ye!==null&&!gt.done;rt++,gt=ue.next()){Ye.index>rt?(hr=Ye,Ye=null):hr=Ye.sibling;var qs=xe(ce,Ye,gt.value,Ne);if(qs===null){Ye===null&&(Ye=hr);break}i&&Ye&&qs.alternate===null&&a(ce,Ye),se=D(qs,se,rt),qe===null?Ue=qs:qe.sibling=qs,qe=qs,Ye=hr}if(gt.done)return p(ce,Ye),Ot&&yi(ce,rt),Ue;if(Ye===null){for(;!gt.done;rt++,gt=ue.next())gt=we(ce,gt.value,Ne),gt!==null&&(se=D(gt,se,rt),qe===null?Ue=gt:qe.sibling=gt,qe=gt);return Ot&&yi(ce,rt),Ue}for(Ye=S(ce,Ye);!gt.done;rt++,gt=ue.next())gt=Ie(Ye,ce,rt,gt.value,Ne),gt!==null&&(i&>.alternate!==null&&Ye.delete(gt.key===null?rt:gt.key),se=D(gt,se,rt),qe===null?Ue=gt:qe.sibling=gt,qe=gt);return i&&Ye.forEach(function(IE){return a(ce,IE)}),Ot&&yi(ce,rt),Ue}function Xt(ce,se,ue,Ne){if(typeof ue=="object"&&ue!==null&&ue.type===T&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:e:{for(var Ue=ue.key,qe=se;qe!==null;){if(qe.key===Ue){if(Ue=ue.type,Ue===T){if(qe.tag===7){p(ce,qe.sibling),se=A(qe,ue.props.children),se.return=ce,ce=se;break e}}else if(qe.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===K&&o0(Ue)===qe.type){p(ce,qe.sibling),se=A(qe,ue.props),se.ref=ba(ce,qe,ue),se.return=ce,ce=se;break e}p(ce,qe);break}else a(ce,qe);qe=qe.sibling}ue.type===T?(se=Ni(ue.props.children,ce.mode,Ne,ue.key),se.return=ce,ce=se):(Ne=Lc(ue.type,ue.key,ue.props,null,ce.mode,Ne),Ne.ref=ba(ce,se,ue),Ne.return=ce,ce=Ne)}return V(ce);case P:e:{for(qe=ue.key;se!==null;){if(se.key===qe)if(se.tag===4&&se.stateNode.containerInfo===ue.containerInfo&&se.stateNode.implementation===ue.implementation){p(ce,se.sibling),se=A(se,ue.children||[]),se.return=ce,ce=se;break e}else{p(ce,se);break}else a(ce,se);se=se.sibling}se=uf(ue,ce.mode,Ne),se.return=ce,ce=se}return V(ce);case K:return qe=ue._init,Xt(ce,se,qe(ue._payload),Ne)}if(Ze(ue))return $e(ce,se,ue,Ne);if(L(ue))return We(ce,se,ue,Ne);dc(ce,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"?(ue=""+ue,se!==null&&se.tag===6?(p(ce,se.sibling),se=A(se,ue),se.return=ce,ce=se):(p(ce,se),se=cf(ue,ce.mode,Ne),se.return=ce,ce=se),V(ce)):p(ce,se)}return Xt}var ao=a0(!0),l0=a0(!1),hc=Os(null),fc=null,lo=null,vh=null;function yh(){vh=lo=fc=null}function bh(i){var a=hc.current;Dt(hc),i._currentValue=a}function wh(i,a,p){for(;i!==null;){var S=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,S!==null&&(S.childLanes|=a)):S!==null&&(S.childLanes&a)!==a&&(S.childLanes|=a),i===p)break;i=i.return}}function co(i,a){fc=i,vh=lo=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&a)!==0&&(zr=!0),i.firstContext=null)}function gn(i){var a=i._currentValue;if(vh!==i)if(i={context:i,memoizedValue:a,next:null},lo===null){if(fc===null)throw Error(r(308));lo=i,fc.dependencies={lanes:0,firstContext:i}}else lo=lo.next=i;return a}var bi=null;function _h(i){bi===null?bi=[i]:bi.push(i)}function c0(i,a,p,S){var A=a.interleaved;return A===null?(p.next=p,_h(a)):(p.next=A.next,A.next=p),a.interleaved=p,ms(i,S)}function ms(i,a){i.lanes|=a;var p=i.alternate;for(p!==null&&(p.lanes|=a),p=i,i=i.return;i!==null;)i.childLanes|=a,p=i.alternate,p!==null&&(p.childLanes|=a),p=i,i=i.return;return p.tag===3?p.stateNode:null}var $s=!1;function Sh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u0(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function ps(i,a){return{eventTime:i,lane:a,tag:0,payload:null,callback:null,next:null}}function zs(i,a,p){var S=i.updateQueue;if(S===null)return null;if(S=S.shared,(mt&2)!==0){var A=S.pending;return A===null?a.next=a:(a.next=A.next,A.next=a),S.pending=a,ms(i,p)}return A=S.interleaved,A===null?(a.next=a,_h(S)):(a.next=A.next,A.next=a),S.interleaved=a,ms(i,p)}function mc(i,a,p){if(a=a.updateQueue,a!==null&&(a=a.shared,(p&4194240)!==0)){var S=a.lanes;S&=i.pendingLanes,p|=S,a.lanes=p,Od(i,p)}}function d0(i,a){var p=i.updateQueue,S=i.alternate;if(S!==null&&(S=S.updateQueue,p===S)){var A=null,D=null;if(p=p.firstBaseUpdate,p!==null){do{var V={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};D===null?A=D=V:D=D.next=V,p=p.next}while(p!==null);D===null?A=D=a:D=D.next=a}else A=D=a;p={baseState:S.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:S.shared,effects:S.effects},i.updateQueue=p;return}i=p.lastBaseUpdate,i===null?p.firstBaseUpdate=a:i.next=a,p.lastBaseUpdate=a}function pc(i,a,p,S){var A=i.updateQueue;$s=!1;var D=A.firstBaseUpdate,V=A.lastBaseUpdate,Q=A.shared.pending;if(Q!==null){A.shared.pending=null;var re=Q,he=re.next;re.next=null,V===null?D=he:V.next=he,V=re;var ve=i.alternate;ve!==null&&(ve=ve.updateQueue,Q=ve.lastBaseUpdate,Q!==V&&(Q===null?ve.firstBaseUpdate=he:Q.next=he,ve.lastBaseUpdate=re))}if(D!==null){var we=A.baseState;V=0,ve=he=re=null,Q=D;do{var xe=Q.lane,Ie=Q.eventTime;if((S&xe)===xe){ve!==null&&(ve=ve.next={eventTime:Ie,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var $e=i,We=Q;switch(xe=a,Ie=p,We.tag){case 1:if($e=We.payload,typeof $e=="function"){we=$e.call(Ie,we,xe);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=We.payload,xe=typeof $e=="function"?$e.call(Ie,we,xe):$e,xe==null)break e;we=M({},we,xe);break e;case 2:$s=!0}}Q.callback!==null&&Q.lane!==0&&(i.flags|=64,xe=A.effects,xe===null?A.effects=[Q]:xe.push(Q))}else Ie={eventTime:Ie,lane:xe,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},ve===null?(he=ve=Ie,re=we):ve=ve.next=Ie,V|=xe;if(Q=Q.next,Q===null){if(Q=A.shared.pending,Q===null)break;xe=Q,Q=xe.next,xe.next=null,A.lastBaseUpdate=xe,A.shared.pending=null}}while(!0);if(ve===null&&(re=we),A.baseState=re,A.firstBaseUpdate=he,A.lastBaseUpdate=ve,a=A.shared.interleaved,a!==null){A=a;do V|=A.lane,A=A.next;while(A!==a)}else D===null&&(A.shared.lanes=0);Si|=V,i.lanes=V,i.memoizedState=we}}function h0(i,a,p){if(i=a.effects,a.effects=null,i!==null)for(a=0;a<i.length;a++){var S=i[a],A=S.callback;if(A!==null){if(S.callback=null,S=p,typeof A!="function")throw Error(r(191,A));A.call(S)}}}var wa={},Un=Os(wa),_a=Os(wa),Sa=Os(wa);function wi(i){if(i===wa)throw Error(r(174));return i}function Ch(i,a){switch(Nt(Sa,a),Nt(_a,i),Nt(Un,wa),i=a.nodeType,i){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:be(null,"");break;default:i=i===8?a.parentNode:a,a=i.namespaceURI||null,i=i.tagName,a=be(a,i)}Dt(Un),Nt(Un,a)}function uo(){Dt(Un),Dt(_a),Dt(Sa)}function f0(i){wi(Sa.current);var a=wi(Un.current),p=be(a,i.type);a!==p&&(Nt(_a,i),Nt(Un,p))}function kh(i){_a.current===i&&(Dt(Un),Dt(_a))}var $t=Os(0);function gc(i){for(var a=i;a!==null;){if(a.tag===13){var p=a.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var jh=[];function Nh(){for(var i=0;i<jh.length;i++)jh[i]._workInProgressVersionPrimary=null;jh.length=0}var xc=j.ReactCurrentDispatcher,Eh=j.ReactCurrentBatchConfig,_i=0,zt=null,sr=null,ur=null,vc=!1,Ca=!1,ka=0,sE=0;function Pr(){throw Error(r(321))}function Ph(i,a){if(a===null)return!1;for(var p=0;p<a.length&&p<i.length;p++)if(!An(i[p],a[p]))return!1;return!0}function Ah(i,a,p,S,A,D){if(_i=D,zt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,xc.current=i===null||i.memoizedState===null?lE:cE,i=p(S,A),Ca){D=0;do{if(Ca=!1,ka=0,25<=D)throw Error(r(301));D+=1,ur=sr=null,a.updateQueue=null,xc.current=uE,i=p(S,A)}while(Ca)}if(xc.current=wc,a=sr!==null&&sr.next!==null,_i=0,ur=sr=zt=null,vc=!1,a)throw Error(r(300));return i}function Th(){var i=ka!==0;return ka=0,i}function Gn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?zt.memoizedState=ur=i:ur=ur.next=i,ur}function xn(){if(sr===null){var i=zt.alternate;i=i!==null?i.memoizedState:null}else i=sr.next;var a=ur===null?zt.memoizedState:ur.next;if(a!==null)ur=a,sr=i;else{if(i===null)throw Error(r(310));sr=i,i={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},ur===null?zt.memoizedState=ur=i:ur=ur.next=i}return ur}function ja(i,a){return typeof a=="function"?a(i):a}function Rh(i){var a=xn(),p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=i;var S=sr,A=S.baseQueue,D=p.pending;if(D!==null){if(A!==null){var V=A.next;A.next=D.next,D.next=V}S.baseQueue=A=D,p.pending=null}if(A!==null){D=A.next,S=S.baseState;var Q=V=null,re=null,he=D;do{var ve=he.lane;if((_i&ve)===ve)re!==null&&(re=re.next={lane:0,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),S=he.hasEagerState?he.eagerState:i(S,he.action);else{var we={lane:ve,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null};re===null?(Q=re=we,V=S):re=re.next=we,zt.lanes|=ve,Si|=ve}he=he.next}while(he!==null&&he!==D);re===null?V=S:re.next=Q,An(S,a.memoizedState)||(zr=!0),a.memoizedState=S,a.baseState=V,a.baseQueue=re,p.lastRenderedState=S}if(i=p.interleaved,i!==null){A=i;do D=A.lane,zt.lanes|=D,Si|=D,A=A.next;while(A!==i)}else A===null&&(p.lanes=0);return[a.memoizedState,p.dispatch]}function Mh(i){var a=xn(),p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=i;var S=p.dispatch,A=p.pending,D=a.memoizedState;if(A!==null){p.pending=null;var V=A=A.next;do D=i(D,V.action),V=V.next;while(V!==A);An(D,a.memoizedState)||(zr=!0),a.memoizedState=D,a.baseQueue===null&&(a.baseState=D),p.lastRenderedState=D}return[D,S]}function m0(){}function p0(i,a){var p=zt,S=xn(),A=a(),D=!An(S.memoizedState,A);if(D&&(S.memoizedState=A,zr=!0),S=S.queue,Dh(v0.bind(null,p,S,i),[i]),S.getSnapshot!==a||D||ur!==null&&ur.memoizedState.tag&1){if(p.flags|=2048,Na(9,x0.bind(null,p,S,A,a),void 0,null),dr===null)throw Error(r(349));(_i&30)!==0||g0(p,a,A)}return A}function g0(i,a,p){i.flags|=16384,i={getSnapshot:a,value:p},a=zt.updateQueue,a===null?(a={lastEffect:null,stores:null},zt.updateQueue=a,a.stores=[i]):(p=a.stores,p===null?a.stores=[i]:p.push(i))}function x0(i,a,p,S){a.value=p,a.getSnapshot=S,y0(a)&&b0(i)}function v0(i,a,p){return p(function(){y0(a)&&b0(i)})}function y0(i){var a=i.getSnapshot;i=i.value;try{var p=a();return!An(i,p)}catch{return!0}}function b0(i){var a=ms(i,1);a!==null&&Ln(a,i,1,-1)}function w0(i){var a=Gn();return typeof i=="function"&&(i=i()),a.memoizedState=a.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:i},a.queue=i,i=i.dispatch=aE.bind(null,zt,i),[a.memoizedState,i]}function Na(i,a,p,S){return i={tag:i,create:a,destroy:p,deps:S,next:null},a=zt.updateQueue,a===null?(a={lastEffect:null,stores:null},zt.updateQueue=a,a.lastEffect=i.next=i):(p=a.lastEffect,p===null?a.lastEffect=i.next=i:(S=p.next,p.next=i,i.next=S,a.lastEffect=i)),i}function _0(){return xn().memoizedState}function yc(i,a,p,S){var A=Gn();zt.flags|=i,A.memoizedState=Na(1|a,p,void 0,S===void 0?null:S)}function bc(i,a,p,S){var A=xn();S=S===void 0?null:S;var D=void 0;if(sr!==null){var V=sr.memoizedState;if(D=V.destroy,S!==null&&Ph(S,V.deps)){A.memoizedState=Na(a,p,D,S);return}}zt.flags|=i,A.memoizedState=Na(1|a,p,D,S)}function S0(i,a){return yc(8390656,8,i,a)}function Dh(i,a){return bc(2048,8,i,a)}function C0(i,a){return bc(4,2,i,a)}function k0(i,a){return bc(4,4,i,a)}function j0(i,a){if(typeof a=="function")return i=i(),a(i),function(){a(null)};if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function N0(i,a,p){return p=p!=null?p.concat([i]):null,bc(4,4,j0.bind(null,a,i),p)}function Lh(){}function E0(i,a){var p=xn();a=a===void 0?null:a;var S=p.memoizedState;return S!==null&&a!==null&&Ph(a,S[1])?S[0]:(p.memoizedState=[i,a],i)}function P0(i,a){var p=xn();a=a===void 0?null:a;var S=p.memoizedState;return S!==null&&a!==null&&Ph(a,S[1])?S[0]:(i=i(),p.memoizedState=[i,a],i)}function A0(i,a,p){return(_i&21)===0?(i.baseState&&(i.baseState=!1,zr=!0),i.memoizedState=p):(An(p,a)||(p=ox(),zt.lanes|=p,Si|=p,i.baseState=!0),a)}function iE(i,a){var p=_t;_t=p!==0&&4>p?p:4,i(!0);var S=Eh.transition;Eh.transition={};try{i(!1),a()}finally{_t=p,Eh.transition=S}}function T0(){return xn().memoizedState}function oE(i,a,p){var S=Us(i);if(p={lane:S,action:p,hasEagerState:!1,eagerState:null,next:null},R0(i))M0(a,p);else if(p=c0(i,a,p,S),p!==null){var A=Ir();Ln(p,i,S,A),D0(p,a,S)}}function aE(i,a,p){var S=Us(i),A={lane:S,action:p,hasEagerState:!1,eagerState:null,next:null};if(R0(i))M0(a,A);else{var D=i.alternate;if(i.lanes===0&&(D===null||D.lanes===0)&&(D=a.lastRenderedReducer,D!==null))try{var V=a.lastRenderedState,Q=D(V,p);if(A.hasEagerState=!0,A.eagerState=Q,An(Q,V)){var re=a.interleaved;re===null?(A.next=A,_h(a)):(A.next=re.next,re.next=A),a.interleaved=A;return}}catch{}finally{}p=c0(i,a,A,S),p!==null&&(A=Ir(),Ln(p,i,S,A),D0(p,a,S))}}function R0(i){var a=i.alternate;return i===zt||a!==null&&a===zt}function M0(i,a){Ca=vc=!0;var p=i.pending;p===null?a.next=a:(a.next=p.next,p.next=a),i.pending=a}function D0(i,a,p){if((p&4194240)!==0){var S=a.lanes;S&=i.pendingLanes,p|=S,a.lanes=p,Od(i,p)}}var wc={readContext:gn,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useInsertionEffect:Pr,useLayoutEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useMutableSource:Pr,useSyncExternalStore:Pr,useId:Pr,unstable_isNewReconciler:!1},lE={readContext:gn,useCallback:function(i,a){return Gn().memoizedState=[i,a===void 0?null:a],i},useContext:gn,useEffect:S0,useImperativeHandle:function(i,a,p){return p=p!=null?p.concat([i]):null,yc(4194308,4,j0.bind(null,a,i),p)},useLayoutEffect:function(i,a){return yc(4194308,4,i,a)},useInsertionEffect:function(i,a){return yc(4,2,i,a)},useMemo:function(i,a){var p=Gn();return a=a===void 0?null:a,i=i(),p.memoizedState=[i,a],i},useReducer:function(i,a,p){var S=Gn();return a=p!==void 0?p(a):a,S.memoizedState=S.baseState=a,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:a},S.queue=i,i=i.dispatch=oE.bind(null,zt,i),[S.memoizedState,i]},useRef:function(i){var a=Gn();return i={current:i},a.memoizedState=i},useState:w0,useDebugValue:Lh,useDeferredValue:function(i){return Gn().memoizedState=i},useTransition:function(){var i=w0(!1),a=i[0];return i=iE.bind(null,i[1]),Gn().memoizedState=i,[a,i]},useMutableSource:function(){},useSyncExternalStore:function(i,a,p){var S=zt,A=Gn();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=a(),dr===null)throw Error(r(349));(_i&30)!==0||g0(S,a,p)}A.memoizedState=p;var D={value:p,getSnapshot:a};return A.queue=D,S0(v0.bind(null,S,D,i),[i]),S.flags|=2048,Na(9,x0.bind(null,S,D,p,a),void 0,null),p},useId:function(){var i=Gn(),a=dr.identifierPrefix;if(Ot){var p=fs,S=hs;p=(S&~(1<<32-Pn(S)-1)).toString(32)+p,a=":"+a+"R"+p,p=ka++,0<p&&(a+="H"+p.toString(32)),a+=":"}else p=sE++,a=":"+a+"r"+p.toString(32)+":";return i.memoizedState=a},unstable_isNewReconciler:!1},cE={readContext:gn,useCallback:E0,useContext:gn,useEffect:Dh,useImperativeHandle:N0,useInsertionEffect:C0,useLayoutEffect:k0,useMemo:P0,useReducer:Rh,useRef:_0,useState:function(){return Rh(ja)},useDebugValue:Lh,useDeferredValue:function(i){var a=xn();return A0(a,sr.memoizedState,i)},useTransition:function(){var i=Rh(ja)[0],a=xn().memoizedState;return[i,a]},useMutableSource:m0,useSyncExternalStore:p0,useId:T0,unstable_isNewReconciler:!1},uE={readContext:gn,useCallback:E0,useContext:gn,useEffect:Dh,useImperativeHandle:N0,useInsertionEffect:C0,useLayoutEffect:k0,useMemo:P0,useReducer:Mh,useRef:_0,useState:function(){return Mh(ja)},useDebugValue:Lh,useDeferredValue:function(i){var a=xn();return sr===null?a.memoizedState=i:A0(a,sr.memoizedState,i)},useTransition:function(){var i=Mh(ja)[0],a=xn().memoizedState;return[i,a]},useMutableSource:m0,useSyncExternalStore:p0,useId:T0,unstable_isNewReconciler:!1};function Rn(i,a){if(i&&i.defaultProps){a=M({},a),i=i.defaultProps;for(var p in i)a[p]===void 0&&(a[p]=i[p]);return a}return a}function Ih(i,a,p,S){a=i.memoizedState,p=p(S,a),p=p==null?a:M({},a,p),i.memoizedState=p,i.lanes===0&&(i.updateQueue.baseState=p)}var _c={isMounted:function(i){return(i=i._reactInternals)?pi(i)===i:!1},enqueueSetState:function(i,a,p){i=i._reactInternals;var S=Ir(),A=Us(i),D=ps(S,A);D.payload=a,p!=null&&(D.callback=p),a=zs(i,D,A),a!==null&&(Ln(a,i,A,S),mc(a,i,A))},enqueueReplaceState:function(i,a,p){i=i._reactInternals;var S=Ir(),A=Us(i),D=ps(S,A);D.tag=1,D.payload=a,p!=null&&(D.callback=p),a=zs(i,D,A),a!==null&&(Ln(a,i,A,S),mc(a,i,A))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var p=Ir(),S=Us(i),A=ps(p,S);A.tag=2,a!=null&&(A.callback=a),a=zs(i,A,S),a!==null&&(Ln(a,i,S,p),mc(a,i,S))}};function L0(i,a,p,S,A,D,V){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(S,D,V):a.prototype&&a.prototype.isPureReactComponent?!fa(p,S)||!fa(A,D):!0}function I0(i,a,p){var S=!1,A=Bs,D=a.contextType;return typeof D=="object"&&D!==null?D=gn(D):(A=$r(a)?xi:Er.current,S=a.contextTypes,D=(S=S!=null)?no(i,A):Bs),a=new a(p,D),i.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,i.stateNode=a,a._reactInternals=i,S&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=A,i.__reactInternalMemoizedMaskedChildContext=D),a}function O0(i,a,p,S){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(p,S),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(p,S),a.state!==i&&_c.enqueueReplaceState(a,a.state,null)}function Oh(i,a,p,S){var A=i.stateNode;A.props=p,A.state=i.memoizedState,A.refs={},Sh(i);var D=a.contextType;typeof D=="object"&&D!==null?A.context=gn(D):(D=$r(a)?xi:Er.current,A.context=no(i,D)),A.state=i.memoizedState,D=a.getDerivedStateFromProps,typeof D=="function"&&(Ih(i,a,D,p),A.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(a=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),a!==A.state&&_c.enqueueReplaceState(A,A.state,null),pc(i,p,A,S),A.state=i.memoizedState),typeof A.componentDidMount=="function"&&(i.flags|=4194308)}function ho(i,a){try{var p="",S=a;do p+=fe(S),S=S.return;while(S);var A=p}catch(D){A=`
|
|
39
39
|
Error generating stack: `+D.message+`
|
|
40
|
-
`+D.stack}return{value:i,source:a,stack:A,digest:null}}function Bh(i,a,p){return{value:i,source:null,stack:p??null,digest:a??null}}function Fh(i,a){try{console.error(a.value)}catch(p){setTimeout(function(){throw p})}}var dE=typeof WeakMap=="function"?WeakMap:Map;function B0(i,a,p){p=ps(-1,p),p.tag=3,p.payload={element:null};var S=a.value;return p.callback=function(){Pc||(Pc=!0,ef=S),Fh(i,a)},p}function F0(i,a,p){p=ps(-1,p),p.tag=3;var S=i.type.getDerivedStateFromError;if(typeof S=="function"){var A=a.value;p.payload=function(){return S(A)},p.callback=function(){Fh(i,a)}}var D=i.stateNode;return D!==null&&typeof D.componentDidCatch=="function"&&(p.callback=function(){Fh(i,a),typeof S!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var V=a.stack;this.componentDidCatch(a.value,{componentStack:V!==null?V:""})}),p}function $0(i,a,p){var S=i.pingCache;if(S===null){S=i.pingCache=new dE;var A=new Set;S.set(a,A)}else A=S.get(a),A===void 0&&(A=new Set,S.set(a,A));A.has(p)||(A.add(p),i=kE.bind(null,i,a,p),a.then(i,i))}function z0(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function H0(i,a,p,S,A){return(i.mode&1)===0?(i===a?i.flags|=65536:(i.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(a=ps(-1,1),a.tag=2,zs(p,a,1))),p.lanes|=1),i):(i.flags|=65536,i.lanes=A,i)}var hE=j.ReactCurrentOwner,zr=!1;function Lr(i,a,p,S){a.child=i===null?l0(a,null,p,S):ao(a,i.child,p,S)}function W0(i,a,p,S,A){p=p.render;var D=a.ref;return co(a,A),S=Ah(i,a,p,S,D,A),p=Th(),i!==null&&!zr?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~A,gs(i,a,A)):(Ot&&p&&fh(a),a.flags|=1,Lr(i,a,S,A),a.child)}function V0(i,a,p,S,A){if(i===null){var D=p.type;return typeof D=="function"&&!lf(D)&&D.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(a.tag=15,a.type=D,U0(i,a,D,S,A)):(i=Lc(p.type,null,S,a,a.mode,A),i.ref=a.ref,i.return=a,a.child=i)}if(D=i.child,(i.lanes&A)===0){var V=D.memoizedProps;if(p=p.compare,p=p!==null?p:fa,p(V,S)&&i.ref===a.ref)return gs(i,a,A)}return a.flags|=1,i=Ks(D,S),i.ref=a.ref,i.return=a,a.child=i}function U0(i,a,p,S,A){if(i!==null){var D=i.memoizedProps;if(fa(D,S)&&i.ref===a.ref)if(zr=!1,a.pendingProps=S=D,(i.lanes&A)!==0)(i.flags&131072)!==0&&(zr=!0);else return a.lanes=i.lanes,gs(i,a,A)}return $h(i,a,p,S,A)}function G0(i,a,p){var S=a.pendingProps,A=S.children,D=i!==null?i.memoizedState:null;if(S.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(mo,rn),rn|=p;else{if((p&1073741824)===0)return i=D!==null?D.baseLanes|p:p,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,Nt(mo,rn),rn|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},S=D!==null?D.baseLanes:p,Nt(mo,rn),rn|=S}else D!==null?(S=D.baseLanes|p,a.memoizedState=null):S=p,Nt(mo,rn),rn|=S;return Lr(i,a,A,p),a.child}function K0(i,a){var p=a.ref;(i===null&&p!==null||i!==null&&i.ref!==p)&&(a.flags|=512,a.flags|=2097152)}function $h(i,a,p,S,A){var D=$r(p)?xi:Er.current;return D=no(a,D),co(a,A),p=Ah(i,a,p,S,D,A),S=Th(),i!==null&&!zr?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~A,gs(i,a,A)):(Ot&&S&&fh(a),a.flags|=1,Lr(i,a,p,A),a.child)}function q0(i,a,p,S,A){if($r(p)){var D=!0;oc(a)}else D=!1;if(co(a,A),a.stateNode===null)Cc(i,a),I0(a,p,S),Oh(a,p,S,A),S=!0;else if(i===null){var V=a.stateNode,Q=a.memoizedProps;V.props=Q;var te=V.context,he=p.contextType;typeof he=="object"&&he!==null?he=gn(he):(he=$r(p)?xi:Er.current,he=no(a,he));var ve=p.getDerivedStateFromProps,we=typeof ve=="function"||typeof V.getSnapshotBeforeUpdate=="function";we||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==S||te!==he)&&O0(a,V,S,he),$s=!1;var xe=a.memoizedState;V.state=xe,pc(a,S,V,A),te=a.memoizedState,Q!==S||xe!==te||Fr.current||$s?(typeof ve=="function"&&(Ih(a,p,ve,S),te=a.memoizedState),(Q=$s||L0(a,p,Q,S,xe,te,he))?(we||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(a.flags|=4194308)):(typeof V.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=S,a.memoizedState=te),V.props=S,V.state=te,V.context=he,S=Q):(typeof V.componentDidMount=="function"&&(a.flags|=4194308),S=!1)}else{V=a.stateNode,u0(i,a),Q=a.memoizedProps,he=a.type===a.elementType?Q:Rn(a.type,Q),V.props=he,we=a.pendingProps,xe=V.context,te=p.contextType,typeof te=="object"&&te!==null?te=gn(te):(te=$r(p)?xi:Er.current,te=no(a,te));var Ie=p.getDerivedStateFromProps;(ve=typeof Ie=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==we||xe!==te)&&O0(a,V,S,te),$s=!1,xe=a.memoizedState,V.state=xe,pc(a,S,V,A);var $e=a.memoizedState;Q!==we||xe!==$e||Fr.current||$s?(typeof Ie=="function"&&(Ih(a,p,Ie,S),$e=a.memoizedState),(he=$s||L0(a,p,he,S,xe,$e,te)||!1)?(ve||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(S,$e,te),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(S,$e,te)),typeof V.componentDidUpdate=="function"&&(a.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof V.componentDidUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=1024),a.memoizedProps=S,a.memoizedState=$e),V.props=S,V.state=$e,V.context=te,S=he):(typeof V.componentDidUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=1024),S=!1)}return zh(i,a,p,S,D,A)}function zh(i,a,p,S,A,D){K0(i,a);var V=(a.flags&128)!==0;if(!S&&!V)return A&&Zx(a,p,!1),gs(i,a,D);S=a.stateNode,hE.current=a;var Q=V&&typeof p.getDerivedStateFromError!="function"?null:S.render();return a.flags|=1,i!==null&&V?(a.child=ao(a,i.child,null,D),a.child=ao(a,null,Q,D)):Lr(i,a,Q,D),a.memoizedState=S.state,A&&Zx(a,p,!0),a.child}function Y0(i){var a=i.stateNode;a.pendingContext?Jx(i,a.pendingContext,a.pendingContext!==a.context):a.context&&Jx(i,a.context,!1),Ch(i,a.containerInfo)}function X0(i,a,p,S,A){return oo(),xh(A),a.flags|=256,Lr(i,a,p,S),a.child}var Hh={dehydrated:null,treeContext:null,retryLane:0};function Wh(i){return{baseLanes:i,cachePool:null,transitions:null}}function J0(i,a,p){var S=a.pendingProps,A=$t.current,D=!1,V=(a.flags&128)!==0,Q;if((Q=V)||(Q=i!==null&&i.memoizedState===null?!1:(A&2)!==0),Q?(D=!0,a.flags&=-129):(i===null||i.memoizedState!==null)&&(A|=1),Nt($t,A&1),i===null)return gh(a),i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((a.mode&1)===0?a.lanes=1:i.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(V=S.children,i=S.fallback,D?(S=a.mode,D=a.child,V={mode:"hidden",children:V},(S&1)===0&&D!==null?(D.childLanes=0,D.pendingProps=V):D=Ic(V,S,0,null),i=Ni(i,S,p,null),D.return=a,i.return=a,D.sibling=i,a.child=D,a.child.memoizedState=Wh(p),a.memoizedState=Hh,i):Vh(a,V));if(A=i.memoizedState,A!==null&&(Q=A.dehydrated,Q!==null))return fE(i,a,V,S,Q,A,p);if(D){D=S.fallback,V=a.mode,A=i.child,Q=A.sibling;var te={mode:"hidden",children:S.children};return(V&1)===0&&a.child!==A?(S=a.child,S.childLanes=0,S.pendingProps=te,a.deletions=null):(S=Ks(A,te),S.subtreeFlags=A.subtreeFlags&14680064),Q!==null?D=Ks(Q,D):(D=Ni(D,V,p,null),D.flags|=2),D.return=a,S.return=a,S.sibling=D,a.child=S,S=D,D=a.child,V=i.child.memoizedState,V=V===null?Wh(p):{baseLanes:V.baseLanes|p,cachePool:null,transitions:V.transitions},D.memoizedState=V,D.childLanes=i.childLanes&~p,a.memoizedState=Hh,S}return D=i.child,i=D.sibling,S=Ks(D,{mode:"visible",children:S.children}),(a.mode&1)===0&&(S.lanes=p),S.return=a,S.sibling=null,i!==null&&(p=a.deletions,p===null?(a.deletions=[i],a.flags|=16):p.push(i)),a.child=S,a.memoizedState=null,S}function Vh(i,a){return a=Ic({mode:"visible",children:a},i.mode,0,null),a.return=i,i.child=a}function Sc(i,a,p,S){return S!==null&&xh(S),ao(a,i.child,null,p),i=Vh(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function fE(i,a,p,S,A,D,V){if(p)return a.flags&256?(a.flags&=-257,S=Bh(Error(r(422))),Sc(i,a,V,S)):a.memoizedState!==null?(a.child=i.child,a.flags|=128,null):(D=S.fallback,A=a.mode,S=Ic({mode:"visible",children:S.children},A,0,null),D=Ni(D,A,V,null),D.flags|=2,S.return=a,D.return=a,S.sibling=D,a.child=S,(a.mode&1)!==0&&ao(a,i.child,null,V),a.child.memoizedState=Wh(V),a.memoizedState=Hh,D);if((a.mode&1)===0)return Sc(i,a,V,null);if(A.data==="$!"){if(S=A.nextSibling&&A.nextSibling.dataset,S)var Q=S.dgst;return S=Q,D=Error(r(419)),S=Bh(D,S,void 0),Sc(i,a,V,S)}if(Q=(V&i.childLanes)!==0,zr||Q){if(S=dr,S!==null){switch(V&-V){case 4:A=2;break;case 16:A=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:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(S.suspendedLanes|V))!==0?0:A,A!==0&&A!==D.retryLane&&(D.retryLane=A,ms(i,A),Ln(S,i,A,-1))}return af(),S=Bh(Error(r(421))),Sc(i,a,V,S)}return A.data==="$?"?(a.flags|=128,a.child=i.child,a=jE.bind(null,i),A._reactRetry=a,null):(i=D.treeContext,tn=Is(A.nextSibling),en=a,Ot=!0,Tn=null,i!==null&&(mn[pn++]=hs,mn[pn++]=fs,mn[pn++]=vi,hs=i.id,fs=i.overflow,vi=a),a=Vh(a,S.children),a.flags|=4096,a)}function Q0(i,a,p){i.lanes|=a;var S=i.alternate;S!==null&&(S.lanes|=a),wh(i.return,a,p)}function Uh(i,a,p,S,A){var D=i.memoizedState;D===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:S,tail:p,tailMode:A}:(D.isBackwards=a,D.rendering=null,D.renderingStartTime=0,D.last=S,D.tail=p,D.tailMode=A)}function Z0(i,a,p){var S=a.pendingProps,A=S.revealOrder,D=S.tail;if(Lr(i,a,S.children,p),S=$t.current,(S&2)!==0)S=S&1|2,a.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Q0(i,p,a);else if(i.tag===19)Q0(i,p,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}S&=1}if(Nt($t,S),(a.mode&1)===0)a.memoizedState=null;else switch(A){case"forwards":for(p=a.child,A=null;p!==null;)i=p.alternate,i!==null&&gc(i)===null&&(A=p),p=p.sibling;p=A,p===null?(A=a.child,a.child=null):(A=p.sibling,p.sibling=null),Uh(a,!1,A,p,D);break;case"backwards":for(p=null,A=a.child,a.child=null;A!==null;){if(i=A.alternate,i!==null&&gc(i)===null){a.child=A;break}i=A.sibling,A.sibling=p,p=A,A=i}Uh(a,!0,p,null,D);break;case"together":Uh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Cc(i,a){(a.mode&1)===0&&i!==null&&(i.alternate=null,a.alternate=null,a.flags|=2)}function gs(i,a,p){if(i!==null&&(a.dependencies=i.dependencies),Si|=a.lanes,(p&a.childLanes)===0)return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,p=Ks(i,i.pendingProps),a.child=p,p.return=a;i.sibling!==null;)i=i.sibling,p=p.sibling=Ks(i,i.pendingProps),p.return=a;p.sibling=null}return a.child}function mE(i,a,p){switch(a.tag){case 3:Y0(a),oo();break;case 5:f0(a);break;case 1:$r(a.type)&&oc(a);break;case 4:Ch(a,a.stateNode.containerInfo);break;case 10:var S=a.type._context,A=a.memoizedProps.value;Nt(hc,S._currentValue),S._currentValue=A;break;case 13:if(S=a.memoizedState,S!==null)return S.dehydrated!==null?(Nt($t,$t.current&1),a.flags|=128,null):(p&a.child.childLanes)!==0?J0(i,a,p):(Nt($t,$t.current&1),i=gs(i,a,p),i!==null?i.sibling:null);Nt($t,$t.current&1);break;case 19:if(S=(p&a.childLanes)!==0,(i.flags&128)!==0){if(S)return Z0(i,a,p);a.flags|=128}if(A=a.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Nt($t,$t.current),S)break;return null;case 22:case 23:return a.lanes=0,G0(i,a,p)}return gs(i,a,p)}var ev,Gh,tv,rv;ev=function(i,a){for(var p=a.child;p!==null;){if(p.tag===5||p.tag===6)i.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===a)break;for(;p.sibling===null;){if(p.return===null||p.return===a)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},Gh=function(){},tv=function(i,a,p,S){var A=i.memoizedProps;if(A!==S){i=a.stateNode,wi(Un.current);var D=null;switch(p){case"input":A=Oe(i,A),S=Oe(i,S),D=[];break;case"select":A=M({},A,{value:void 0}),S=M({},S,{value:void 0}),D=[];break;case"textarea":A=ge(i,A),S=ge(i,S),D=[];break;default:typeof A.onClick!="function"&&typeof S.onClick=="function"&&(i.onclick=nc)}et(p,S);var V;p=null;for(he in A)if(!S.hasOwnProperty(he)&&A.hasOwnProperty(he)&&A[he]!=null)if(he==="style"){var Q=A[he];for(V in Q)Q.hasOwnProperty(V)&&(p||(p={}),p[V]="")}else he!=="dangerouslySetInnerHTML"&&he!=="children"&&he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&he!=="autoFocus"&&(o.hasOwnProperty(he)?D||(D=[]):(D=D||[]).push(he,null));for(he in S){var te=S[he];if(Q=A!=null?A[he]:void 0,S.hasOwnProperty(he)&&te!==Q&&(te!=null||Q!=null))if(he==="style")if(Q){for(V in Q)!Q.hasOwnProperty(V)||te&&te.hasOwnProperty(V)||(p||(p={}),p[V]="");for(V in te)te.hasOwnProperty(V)&&Q[V]!==te[V]&&(p||(p={}),p[V]=te[V])}else p||(D||(D=[]),D.push(he,p)),p=te;else he==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Q=Q?Q.__html:void 0,te!=null&&Q!==te&&(D=D||[]).push(he,te)):he==="children"?typeof te!="string"&&typeof te!="number"||(D=D||[]).push(he,""+te):he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&(o.hasOwnProperty(he)?(te!=null&&he==="onScroll"&&Mt("scroll",i),D||Q===te||(D=[])):(D=D||[]).push(he,te))}p&&(D=D||[]).push("style",p);var he=D;(a.updateQueue=he)&&(a.flags|=4)}},rv=function(i,a,p,S){p!==S&&(a.flags|=4)};function Ea(i,a){if(!Ot)switch(i.tailMode){case"hidden":a=i.tail;for(var p=null;a!==null;)a.alternate!==null&&(p=a),a=a.sibling;p===null?i.tail=null:p.sibling=null;break;case"collapsed":p=i.tail;for(var S=null;p!==null;)p.alternate!==null&&(S=p),p=p.sibling;S===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:S.sibling=null}}function Ar(i){var a=i.alternate!==null&&i.alternate.child===i.child,p=0,S=0;if(a)for(var A=i.child;A!==null;)p|=A.lanes|A.childLanes,S|=A.subtreeFlags&14680064,S|=A.flags&14680064,A.return=i,A=A.sibling;else for(A=i.child;A!==null;)p|=A.lanes|A.childLanes,S|=A.subtreeFlags,S|=A.flags,A.return=i,A=A.sibling;return i.subtreeFlags|=S,i.childLanes=p,a}function pE(i,a,p){var S=a.pendingProps;switch(mh(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ar(a),null;case 1:return $r(a.type)&&ic(),Ar(a),null;case 3:return S=a.stateNode,uo(),Dt(Fr),Dt(Er),Nh(),S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),(i===null||i.child===null)&&(uc(a)?a.flags|=4:i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Tn!==null&&(nf(Tn),Tn=null))),Gh(i,a),Ar(a),null;case 5:kh(a);var A=wi(Sa.current);if(p=a.type,i!==null&&a.stateNode!=null)tv(i,a,p,S,A),i.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!S){if(a.stateNode===null)throw Error(r(166));return Ar(a),null}if(i=wi(Un.current),uc(a)){S=a.stateNode,p=a.type;var D=a.memoizedProps;switch(S[Vn]=a,S[va]=D,i=(a.mode&1)!==0,p){case"dialog":Mt("cancel",S),Mt("close",S);break;case"iframe":case"object":case"embed":Mt("load",S);break;case"video":case"audio":for(A=0;A<pa.length;A++)Mt(pa[A],S);break;case"source":Mt("error",S);break;case"img":case"image":case"link":Mt("error",S),Mt("load",S);break;case"details":Mt("toggle",S);break;case"input":Ve(S,D),Mt("invalid",S);break;case"select":S._wrapperState={wasMultiple:!!D.multiple},Mt("invalid",S);break;case"textarea":Me(S,D),Mt("invalid",S)}et(p,D),A=null;for(var V in D)if(D.hasOwnProperty(V)){var Q=D[V];V==="children"?typeof Q=="string"?S.textContent!==Q&&(D.suppressHydrationWarning!==!0&&rc(S.textContent,Q,i),A=["children",Q]):typeof Q=="number"&&S.textContent!==""+Q&&(D.suppressHydrationWarning!==!0&&rc(S.textContent,Q,i),A=["children",""+Q]):o.hasOwnProperty(V)&&Q!=null&&V==="onScroll"&&Mt("scroll",S)}switch(p){case"input":J(S),De(S,D,!0);break;case"textarea":J(S),Rt(S);break;case"select":case"option":break;default:typeof D.onClick=="function"&&(S.onclick=nc)}S=A,a.updateQueue=S,S!==null&&(a.flags|=4)}else{V=A.nodeType===9?A:A.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=pe(p)),i==="http://www.w3.org/1999/xhtml"?p==="script"?(i=V.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof S.is=="string"?i=V.createElement(p,{is:S.is}):(i=V.createElement(p),p==="select"&&(V=i,S.multiple?V.multiple=!0:S.size&&(V.size=S.size))):i=V.createElementNS(i,p),i[Vn]=a,i[va]=S,ev(i,a,!1,!1),a.stateNode=i;e:{switch(V=jt(p,S),p){case"dialog":Mt("cancel",i),Mt("close",i),A=S;break;case"iframe":case"object":case"embed":Mt("load",i),A=S;break;case"video":case"audio":for(A=0;A<pa.length;A++)Mt(pa[A],i);A=S;break;case"source":Mt("error",i),A=S;break;case"img":case"image":case"link":Mt("error",i),Mt("load",i),A=S;break;case"details":Mt("toggle",i),A=S;break;case"input":Ve(i,S),A=Oe(i,S),Mt("invalid",i);break;case"option":A=S;break;case"select":i._wrapperState={wasMultiple:!!S.multiple},A=M({},S,{value:void 0}),Mt("invalid",i);break;case"textarea":Me(i,S),A=ge(i,S),Mt("invalid",i);break;default:A=S}et(p,A),Q=A;for(D in Q)if(Q.hasOwnProperty(D)){var te=Q[D];D==="style"?Le(i,te):D==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Ge(i,te)):D==="children"?typeof te=="string"?(p!=="textarea"||te!=="")&&Ke(i,te):typeof te=="number"&&Ke(i,""+te):D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&D!=="autoFocus"&&(o.hasOwnProperty(D)?te!=null&&D==="onScroll"&&Mt("scroll",i):te!=null&&y(i,D,te,V))}switch(p){case"input":J(i),De(i,S,!1);break;case"textarea":J(i),Rt(i);break;case"option":S.value!=null&&i.setAttribute("value",""+H(S.value));break;case"select":i.multiple=!!S.multiple,D=S.value,D!=null?Se(i,!!S.multiple,D,!1):S.defaultValue!=null&&Se(i,!!S.multiple,S.defaultValue,!0);break;default:typeof A.onClick=="function"&&(i.onclick=nc)}switch(p){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}}S&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Ar(a),null;case 6:if(i&&a.stateNode!=null)rv(i,a,i.memoizedProps,S);else{if(typeof S!="string"&&a.stateNode===null)throw Error(r(166));if(p=wi(Sa.current),wi(Un.current),uc(a)){if(S=a.stateNode,p=a.memoizedProps,S[Vn]=a,(D=S.nodeValue!==p)&&(i=en,i!==null))switch(i.tag){case 3:rc(S.nodeValue,p,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&rc(S.nodeValue,p,(i.mode&1)!==0)}D&&(a.flags|=4)}else S=(p.nodeType===9?p:p.ownerDocument).createTextNode(S),S[Vn]=a,a.stateNode=S}return Ar(a),null;case 13:if(Dt($t),S=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Ot&&tn!==null&&(a.mode&1)!==0&&(a.flags&128)===0)i0(),oo(),a.flags|=98560,D=!1;else if(D=uc(a),S!==null&&S.dehydrated!==null){if(i===null){if(!D)throw Error(r(318));if(D=a.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(r(317));D[Vn]=a}else oo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ar(a),D=!1}else Tn!==null&&(nf(Tn),Tn=null),D=!0;if(!D)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=p,a):(S=S!==null,S!==(i!==null&&i.memoizedState!==null)&&S&&(a.child.flags|=8192,(a.mode&1)!==0&&(i===null||($t.current&1)!==0?ir===0&&(ir=3):af())),a.updateQueue!==null&&(a.flags|=4),Ar(a),null);case 4:return uo(),Gh(i,a),i===null&&ga(a.stateNode.containerInfo),Ar(a),null;case 10:return bh(a.type._context),Ar(a),null;case 17:return $r(a.type)&&ic(),Ar(a),null;case 19:if(Dt($t),D=a.memoizedState,D===null)return Ar(a),null;if(S=(a.flags&128)!==0,V=D.rendering,V===null)if(S)Ea(D,!1);else{if(ir!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(V=gc(i),V!==null){for(a.flags|=128,Ea(D,!1),S=V.updateQueue,S!==null&&(a.updateQueue=S,a.flags|=4),a.subtreeFlags=0,S=p,p=a.child;p!==null;)D=p,i=S,D.flags&=14680066,V=D.alternate,V===null?(D.childLanes=0,D.lanes=i,D.child=null,D.subtreeFlags=0,D.memoizedProps=null,D.memoizedState=null,D.updateQueue=null,D.dependencies=null,D.stateNode=null):(D.childLanes=V.childLanes,D.lanes=V.lanes,D.child=V.child,D.subtreeFlags=0,D.deletions=null,D.memoizedProps=V.memoizedProps,D.memoizedState=V.memoizedState,D.updateQueue=V.updateQueue,D.type=V.type,i=V.dependencies,D.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),p=p.sibling;return Nt($t,$t.current&1|2),a.child}i=i.sibling}D.tail!==null&&Yt()>po&&(a.flags|=128,S=!0,Ea(D,!1),a.lanes=4194304)}else{if(!S)if(i=gc(V),i!==null){if(a.flags|=128,S=!0,p=i.updateQueue,p!==null&&(a.updateQueue=p,a.flags|=4),Ea(D,!0),D.tail===null&&D.tailMode==="hidden"&&!V.alternate&&!Ot)return Ar(a),null}else 2*Yt()-D.renderingStartTime>po&&p!==1073741824&&(a.flags|=128,S=!0,Ea(D,!1),a.lanes=4194304);D.isBackwards?(V.sibling=a.child,a.child=V):(p=D.last,p!==null?p.sibling=V:a.child=V,D.last=V)}return D.tail!==null?(a=D.tail,D.rendering=a,D.tail=a.sibling,D.renderingStartTime=Yt(),a.sibling=null,p=$t.current,Nt($t,S?p&1|2:p&1),a):(Ar(a),null);case 22:case 23:return of(),S=a.memoizedState!==null,i!==null&&i.memoizedState!==null!==S&&(a.flags|=8192),S&&(a.mode&1)!==0?(rn&1073741824)!==0&&(Ar(a),a.subtreeFlags&6&&(a.flags|=8192)):Ar(a),null;case 24:return null;case 25:return null}throw Error(r(156,a.tag))}function gE(i,a){switch(mh(a),a.tag){case 1:return $r(a.type)&&ic(),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return uo(),Dt(Fr),Dt(Er),Nh(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 5:return kh(a),null;case 13:if(Dt($t),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));oo()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return Dt($t),null;case 4:return uo(),null;case 10:return bh(a.type._context),null;case 22:case 23:return of(),null;case 24:return null;default:return null}}var kc=!1,Tr=!1,xE=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function fo(i,a){var p=i.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(S){Ut(i,a,S)}else p.current=null}function Kh(i,a,p){try{p()}catch(S){Ut(i,a,S)}}var nv=!1;function vE(i,a){if(ih=Ul,i=Lx(),Jd(i)){if("selectionStart"in i)var p={start:i.selectionStart,end:i.selectionEnd};else e:{p=(p=i.ownerDocument)&&p.defaultView||window;var S=p.getSelection&&p.getSelection();if(S&&S.rangeCount!==0){p=S.anchorNode;var A=S.anchorOffset,D=S.focusNode;S=S.focusOffset;try{p.nodeType,D.nodeType}catch{p=null;break e}var V=0,Q=-1,te=-1,he=0,ve=0,we=i,xe=null;t:for(;;){for(var Ie;we!==p||A!==0&&we.nodeType!==3||(Q=V+A),we!==D||S!==0&&we.nodeType!==3||(te=V+S),we.nodeType===3&&(V+=we.nodeValue.length),(Ie=we.firstChild)!==null;)xe=we,we=Ie;for(;;){if(we===i)break t;if(xe===p&&++he===A&&(Q=V),xe===D&&++ve===S&&(te=V),(Ie=we.nextSibling)!==null)break;we=xe,xe=we.parentNode}we=Ie}p=Q===-1||te===-1?null:{start:Q,end:te}}else p=null}p=p||{start:0,end:0}}else p=null;for(oh={focusedElem:i,selectionRange:p},Ul=!1,Fe=a;Fe!==null;)if(a=Fe,i=a.child,(a.subtreeFlags&1028)!==0&&i!==null)i.return=a,Fe=i;else for(;Fe!==null;){a=Fe;try{var $e=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if($e!==null){var We=$e.memoizedProps,Xt=$e.memoizedState,ce=a.stateNode,se=ce.getSnapshotBeforeUpdate(a.elementType===a.type?We:Rn(a.type,We),Xt);ce.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var ue=a.stateNode.containerInfo;ue.nodeType===1?ue.textContent="":ue.nodeType===9&&ue.documentElement&&ue.removeChild(ue.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Ne){Ut(a,a.return,Ne)}if(i=a.sibling,i!==null){i.return=a.return,Fe=i;break}Fe=a.return}return $e=nv,nv=!1,$e}function Pa(i,a,p){var S=a.updateQueue;if(S=S!==null?S.lastEffect:null,S!==null){var A=S=S.next;do{if((A.tag&i)===i){var D=A.destroy;A.destroy=void 0,D!==void 0&&Kh(a,p,D)}A=A.next}while(A!==S)}}function jc(i,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var p=a=a.next;do{if((p.tag&i)===i){var S=p.create;p.destroy=S()}p=p.next}while(p!==a)}}function qh(i){var a=i.ref;if(a!==null){var p=i.stateNode;switch(i.tag){case 5:i=p;break;default:i=p}typeof a=="function"?a(i):a.current=i}}function sv(i){var a=i.alternate;a!==null&&(i.alternate=null,sv(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&(delete a[Vn],delete a[va],delete a[uh],delete a[eE],delete a[tE])),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 iv(i){return i.tag===5||i.tag===3||i.tag===4}function ov(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||iv(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 Yh(i,a,p){var S=i.tag;if(S===5||S===6)i=i.stateNode,a?p.nodeType===8?p.parentNode.insertBefore(i,a):p.insertBefore(i,a):(p.nodeType===8?(a=p.parentNode,a.insertBefore(i,p)):(a=p,a.appendChild(i)),p=p._reactRootContainer,p!=null||a.onclick!==null||(a.onclick=nc));else if(S!==4&&(i=i.child,i!==null))for(Yh(i,a,p),i=i.sibling;i!==null;)Yh(i,a,p),i=i.sibling}function Xh(i,a,p){var S=i.tag;if(S===5||S===6)i=i.stateNode,a?p.insertBefore(i,a):p.appendChild(i);else if(S!==4&&(i=i.child,i!==null))for(Xh(i,a,p),i=i.sibling;i!==null;)Xh(i,a,p),i=i.sibling}var vr=null,Mn=!1;function Hs(i,a,p){for(p=p.child;p!==null;)av(i,a,p),p=p.sibling}function av(i,a,p){if(Wn&&typeof Wn.onCommitFiberUnmount=="function")try{Wn.onCommitFiberUnmount(Fl,p)}catch{}switch(p.tag){case 5:Tr||fo(p,a);case 6:var S=vr,A=Mn;vr=null,Hs(i,a,p),vr=S,Mn=A,vr!==null&&(Mn?(i=vr,p=p.stateNode,i.nodeType===8?i.parentNode.removeChild(p):i.removeChild(p)):vr.removeChild(p.stateNode));break;case 18:vr!==null&&(Mn?(i=vr,p=p.stateNode,i.nodeType===8?ch(i.parentNode,p):i.nodeType===1&&ch(i,p),aa(i)):ch(vr,p.stateNode));break;case 4:S=vr,A=Mn,vr=p.stateNode.containerInfo,Mn=!0,Hs(i,a,p),vr=S,Mn=A;break;case 0:case 11:case 14:case 15:if(!Tr&&(S=p.updateQueue,S!==null&&(S=S.lastEffect,S!==null))){A=S=S.next;do{var D=A,V=D.destroy;D=D.tag,V!==void 0&&((D&2)!==0||(D&4)!==0)&&Kh(p,a,V),A=A.next}while(A!==S)}Hs(i,a,p);break;case 1:if(!Tr&&(fo(p,a),S=p.stateNode,typeof S.componentWillUnmount=="function"))try{S.props=p.memoizedProps,S.state=p.memoizedState,S.componentWillUnmount()}catch(Q){Ut(p,a,Q)}Hs(i,a,p);break;case 21:Hs(i,a,p);break;case 22:p.mode&1?(Tr=(S=Tr)||p.memoizedState!==null,Hs(i,a,p),Tr=S):Hs(i,a,p);break;default:Hs(i,a,p)}}function lv(i){var a=i.updateQueue;if(a!==null){i.updateQueue=null;var p=i.stateNode;p===null&&(p=i.stateNode=new xE),a.forEach(function(S){var A=NE.bind(null,i,S);p.has(S)||(p.add(S),S.then(A,A))})}}function Dn(i,a){var p=a.deletions;if(p!==null)for(var S=0;S<p.length;S++){var A=p[S];try{var D=i,V=a,Q=V;e:for(;Q!==null;){switch(Q.tag){case 5:vr=Q.stateNode,Mn=!1;break e;case 3:vr=Q.stateNode.containerInfo,Mn=!0;break e;case 4:vr=Q.stateNode.containerInfo,Mn=!0;break e}Q=Q.return}if(vr===null)throw Error(r(160));av(D,V,A),vr=null,Mn=!1;var te=A.alternate;te!==null&&(te.return=null),A.return=null}catch(he){Ut(A,a,he)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)cv(a,i),a=a.sibling}function cv(i,a){var p=i.alternate,S=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Dn(a,i),Kn(i),S&4){try{Pa(3,i,i.return),jc(3,i)}catch(We){Ut(i,i.return,We)}try{Pa(5,i,i.return)}catch(We){Ut(i,i.return,We)}}break;case 1:Dn(a,i),Kn(i),S&512&&p!==null&&fo(p,p.return);break;case 5:if(Dn(a,i),Kn(i),S&512&&p!==null&&fo(p,p.return),i.flags&32){var A=i.stateNode;try{Ke(A,"")}catch(We){Ut(i,i.return,We)}}if(S&4&&(A=i.stateNode,A!=null)){var D=i.memoizedProps,V=p!==null?p.memoizedProps:D,Q=i.type,te=i.updateQueue;if(i.updateQueue=null,te!==null)try{Q==="input"&&D.type==="radio"&&D.name!=null&&re(A,D),jt(Q,V);var he=jt(Q,D);for(V=0;V<te.length;V+=2){var ve=te[V],we=te[V+1];ve==="style"?Le(A,we):ve==="dangerouslySetInnerHTML"?Ge(A,we):ve==="children"?Ke(A,we):y(A,ve,we,he)}switch(Q){case"input":de(A,D);break;case"textarea":ht(A,D);break;case"select":var xe=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!D.multiple;var Ie=D.value;Ie!=null?Se(A,!!D.multiple,Ie,!1):xe!==!!D.multiple&&(D.defaultValue!=null?Se(A,!!D.multiple,D.defaultValue,!0):Se(A,!!D.multiple,D.multiple?[]:"",!1))}A[va]=D}catch(We){Ut(i,i.return,We)}}break;case 6:if(Dn(a,i),Kn(i),S&4){if(i.stateNode===null)throw Error(r(162));A=i.stateNode,D=i.memoizedProps;try{A.nodeValue=D}catch(We){Ut(i,i.return,We)}}break;case 3:if(Dn(a,i),Kn(i),S&4&&p!==null&&p.memoizedState.isDehydrated)try{aa(a.containerInfo)}catch(We){Ut(i,i.return,We)}break;case 4:Dn(a,i),Kn(i);break;case 13:Dn(a,i),Kn(i),A=i.child,A.flags&8192&&(D=A.memoizedState!==null,A.stateNode.isHidden=D,!D||A.alternate!==null&&A.alternate.memoizedState!==null||(Zh=Yt())),S&4&&lv(i);break;case 22:if(ve=p!==null&&p.memoizedState!==null,i.mode&1?(Tr=(he=Tr)||ve,Dn(a,i),Tr=he):Dn(a,i),Kn(i),S&8192){if(he=i.memoizedState!==null,(i.stateNode.isHidden=he)&&!ve&&(i.mode&1)!==0)for(Fe=i,ve=i.child;ve!==null;){for(we=Fe=ve;Fe!==null;){switch(xe=Fe,Ie=xe.child,xe.tag){case 0:case 11:case 14:case 15:Pa(4,xe,xe.return);break;case 1:fo(xe,xe.return);var $e=xe.stateNode;if(typeof $e.componentWillUnmount=="function"){S=xe,p=xe.return;try{a=S,$e.props=a.memoizedProps,$e.state=a.memoizedState,$e.componentWillUnmount()}catch(We){Ut(S,p,We)}}break;case 5:fo(xe,xe.return);break;case 22:if(xe.memoizedState!==null){hv(we);continue}}Ie!==null?(Ie.return=xe,Fe=Ie):hv(we)}ve=ve.sibling}e:for(ve=null,we=i;;){if(we.tag===5){if(ve===null){ve=we;try{A=we.stateNode,he?(D=A.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none"):(Q=we.stateNode,te=we.memoizedProps.style,V=te!=null&&te.hasOwnProperty("display")?te.display:null,Q.style.display=Pe("display",V))}catch(We){Ut(i,i.return,We)}}}else if(we.tag===6){if(ve===null)try{we.stateNode.nodeValue=he?"":we.memoizedProps}catch(We){Ut(i,i.return,We)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===i)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===i)break e;for(;we.sibling===null;){if(we.return===null||we.return===i)break e;ve===we&&(ve=null),we=we.return}ve===we&&(ve=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:Dn(a,i),Kn(i),S&4&&lv(i);break;case 21:break;default:Dn(a,i),Kn(i)}}function Kn(i){var a=i.flags;if(a&2){try{e:{for(var p=i.return;p!==null;){if(iv(p)){var S=p;break e}p=p.return}throw Error(r(160))}switch(S.tag){case 5:var A=S.stateNode;S.flags&32&&(Ke(A,""),S.flags&=-33);var D=ov(i);Xh(i,D,A);break;case 3:case 4:var V=S.stateNode.containerInfo,Q=ov(i);Yh(i,Q,V);break;default:throw Error(r(161))}}catch(te){Ut(i,i.return,te)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function yE(i,a,p){Fe=i,uv(i)}function uv(i,a,p){for(var S=(i.mode&1)!==0;Fe!==null;){var A=Fe,D=A.child;if(A.tag===22&&S){var V=A.memoizedState!==null||kc;if(!V){var Q=A.alternate,te=Q!==null&&Q.memoizedState!==null||Tr;Q=kc;var he=Tr;if(kc=V,(Tr=te)&&!he)for(Fe=A;Fe!==null;)V=Fe,te=V.child,V.tag===22&&V.memoizedState!==null?fv(A):te!==null?(te.return=V,Fe=te):fv(A);for(;D!==null;)Fe=D,uv(D),D=D.sibling;Fe=A,kc=Q,Tr=he}dv(i)}else(A.subtreeFlags&8772)!==0&&D!==null?(D.return=A,Fe=D):dv(i)}}function dv(i){for(;Fe!==null;){var a=Fe;if((a.flags&8772)!==0){var p=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Tr||jc(5,a);break;case 1:var S=a.stateNode;if(a.flags&4&&!Tr)if(p===null)S.componentDidMount();else{var A=a.elementType===a.type?p.memoizedProps:Rn(a.type,p.memoizedProps);S.componentDidUpdate(A,p.memoizedState,S.__reactInternalSnapshotBeforeUpdate)}var D=a.updateQueue;D!==null&&h0(a,D,S);break;case 3:var V=a.updateQueue;if(V!==null){if(p=null,a.child!==null)switch(a.child.tag){case 5:p=a.child.stateNode;break;case 1:p=a.child.stateNode}h0(a,V,p)}break;case 5:var Q=a.stateNode;if(p===null&&a.flags&4){p=Q;var te=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&p.focus();break;case"img":te.src&&(p.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var he=a.alternate;if(he!==null){var ve=he.memoizedState;if(ve!==null){var we=ve.dehydrated;we!==null&&aa(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Tr||a.flags&512&&qh(a)}catch(xe){Ut(a,a.return,xe)}}if(a===i){Fe=null;break}if(p=a.sibling,p!==null){p.return=a.return,Fe=p;break}Fe=a.return}}function hv(i){for(;Fe!==null;){var a=Fe;if(a===i){Fe=null;break}var p=a.sibling;if(p!==null){p.return=a.return,Fe=p;break}Fe=a.return}}function fv(i){for(;Fe!==null;){var a=Fe;try{switch(a.tag){case 0:case 11:case 15:var p=a.return;try{jc(4,a)}catch(te){Ut(a,p,te)}break;case 1:var S=a.stateNode;if(typeof S.componentDidMount=="function"){var A=a.return;try{S.componentDidMount()}catch(te){Ut(a,A,te)}}var D=a.return;try{qh(a)}catch(te){Ut(a,D,te)}break;case 5:var V=a.return;try{qh(a)}catch(te){Ut(a,V,te)}}}catch(te){Ut(a,a.return,te)}if(a===i){Fe=null;break}var Q=a.sibling;if(Q!==null){Q.return=a.return,Fe=Q;break}Fe=a.return}}var bE=Math.ceil,Nc=j.ReactCurrentDispatcher,Jh=j.ReactCurrentOwner,vn=j.ReactCurrentBatchConfig,mt=0,dr=null,Zt=null,yr=0,rn=0,mo=Os(0),ir=0,Aa=null,Si=0,Ec=0,Qh=0,Ta=null,Hr=null,Zh=0,po=1/0,xs=null,Pc=!1,ef=null,Ws=null,Ac=!1,Vs=null,Tc=0,Ra=0,tf=null,Rc=-1,Mc=0;function Ir(){return(mt&6)!==0?Yt():Rc!==-1?Rc:Rc=Yt()}function Us(i){return(i.mode&1)===0?1:(mt&2)!==0&&yr!==0?yr&-yr:nE.transition!==null?(Mc===0&&(Mc=ox()),Mc):(i=_t,i!==0||(i=window.event,i=i===void 0?16:px(i.type)),i)}function Ln(i,a,p,S){if(50<Ra)throw Ra=0,tf=null,Error(r(185));ra(i,p,S),((mt&2)===0||i!==dr)&&(i===dr&&((mt&2)===0&&(Ec|=p),ir===4&&Gs(i,yr)),Wr(i,S),p===1&&mt===0&&(a.mode&1)===0&&(po=Yt()+500,ac&&Fs()))}function Wr(i,a){var p=i.callbackNode;nN(i,a);var S=Hl(i,i===dr?yr:0);if(S===0)p!==null&&nx(p),i.callbackNode=null,i.callbackPriority=0;else if(a=S&-S,i.callbackPriority!==a){if(p!=null&&nx(p),a===1)i.tag===0?rE(pv.bind(null,i)):e0(pv.bind(null,i)),QN(function(){(mt&6)===0&&Fs()}),p=null;else{switch(ax(S)){case 1:p=Dd;break;case 4:p=sx;break;case 16:p=Bl;break;case 536870912:p=ix;break;default:p=Bl}p=Sv(p,mv.bind(null,i))}i.callbackPriority=a,i.callbackNode=p}}function mv(i,a){if(Rc=-1,Mc=0,(mt&6)!==0)throw Error(r(327));var p=i.callbackNode;if(go()&&i.callbackNode!==p)return null;var S=Hl(i,i===dr?yr:0);if(S===0)return null;if((S&30)!==0||(S&i.expiredLanes)!==0||a)a=Dc(i,S);else{a=S;var A=mt;mt|=2;var D=xv();(dr!==i||yr!==a)&&(xs=null,po=Yt()+500,ki(i,a));do try{SE();break}catch(Q){gv(i,Q)}while(!0);yh(),Nc.current=D,mt=A,Zt!==null?a=0:(dr=null,yr=0,a=ir)}if(a!==0){if(a===2&&(A=Ld(i),A!==0&&(S=A,a=rf(i,A))),a===1)throw p=Aa,ki(i,0),Gs(i,S),Wr(i,Yt()),p;if(a===6)Gs(i,S);else{if(A=i.current.alternate,(S&30)===0&&!wE(A)&&(a=Dc(i,S),a===2&&(D=Ld(i),D!==0&&(S=D,a=rf(i,D))),a===1))throw p=Aa,ki(i,0),Gs(i,S),Wr(i,Yt()),p;switch(i.finishedWork=A,i.finishedLanes=S,a){case 0:case 1:throw Error(r(345));case 2:ji(i,Hr,xs);break;case 3:if(Gs(i,S),(S&130023424)===S&&(a=Zh+500-Yt(),10<a)){if(Hl(i,0)!==0)break;if(A=i.suspendedLanes,(A&S)!==S){Ir(),i.pingedLanes|=i.suspendedLanes&A;break}i.timeoutHandle=lh(ji.bind(null,i,Hr,xs),a);break}ji(i,Hr,xs);break;case 4:if(Gs(i,S),(S&4194240)===S)break;for(a=i.eventTimes,A=-1;0<S;){var V=31-Pn(S);D=1<<V,V=a[V],V>A&&(A=V),S&=~D}if(S=A,S=Yt()-S,S=(120>S?120:480>S?480:1080>S?1080:1920>S?1920:3e3>S?3e3:4320>S?4320:1960*bE(S/1960))-S,10<S){i.timeoutHandle=lh(ji.bind(null,i,Hr,xs),S);break}ji(i,Hr,xs);break;case 5:ji(i,Hr,xs);break;default:throw Error(r(329))}}}return Wr(i,Yt()),i.callbackNode===p?mv.bind(null,i):null}function rf(i,a){var p=Ta;return i.current.memoizedState.isDehydrated&&(ki(i,a).flags|=256),i=Dc(i,a),i!==2&&(a=Hr,Hr=p,a!==null&&nf(a)),i}function nf(i){Hr===null?Hr=i:Hr.push.apply(Hr,i)}function wE(i){for(var a=i;;){if(a.flags&16384){var p=a.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var S=0;S<p.length;S++){var A=p[S],D=A.getSnapshot;A=A.value;try{if(!An(D(),A))return!1}catch{return!1}}}if(p=a.child,a.subtreeFlags&16384&&p!==null)p.return=a,a=p;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Gs(i,a){for(a&=~Qh,a&=~Ec,i.suspendedLanes|=a,i.pingedLanes&=~a,i=i.expirationTimes;0<a;){var p=31-Pn(a),S=1<<p;i[p]=-1,a&=~S}}function pv(i){if((mt&6)!==0)throw Error(r(327));go();var a=Hl(i,0);if((a&1)===0)return Wr(i,Yt()),null;var p=Dc(i,a);if(i.tag!==0&&p===2){var S=Ld(i);S!==0&&(a=S,p=rf(i,S))}if(p===1)throw p=Aa,ki(i,0),Gs(i,a),Wr(i,Yt()),p;if(p===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=a,ji(i,Hr,xs),Wr(i,Yt()),null}function sf(i,a){var p=mt;mt|=1;try{return i(a)}finally{mt=p,mt===0&&(po=Yt()+500,ac&&Fs())}}function Ci(i){Vs!==null&&Vs.tag===0&&(mt&6)===0&&go();var a=mt;mt|=1;var p=vn.transition,S=_t;try{if(vn.transition=null,_t=1,i)return i()}finally{_t=S,vn.transition=p,mt=a,(mt&6)===0&&Fs()}}function of(){rn=mo.current,Dt(mo)}function ki(i,a){i.finishedWork=null,i.finishedLanes=0;var p=i.timeoutHandle;if(p!==-1&&(i.timeoutHandle=-1,JN(p)),Zt!==null)for(p=Zt.return;p!==null;){var S=p;switch(mh(S),S.tag){case 1:S=S.type.childContextTypes,S!=null&&ic();break;case 3:uo(),Dt(Fr),Dt(Er),Nh();break;case 5:kh(S);break;case 4:uo();break;case 13:Dt($t);break;case 19:Dt($t);break;case 10:bh(S.type._context);break;case 22:case 23:of()}p=p.return}if(dr=i,Zt=i=Ks(i.current,null),yr=rn=a,ir=0,Aa=null,Qh=Ec=Si=0,Hr=Ta=null,bi!==null){for(a=0;a<bi.length;a++)if(p=bi[a],S=p.interleaved,S!==null){p.interleaved=null;var A=S.next,D=p.pending;if(D!==null){var V=D.next;D.next=A,S.next=V}p.pending=S}bi=null}return i}function gv(i,a){do{var p=Zt;try{if(yh(),xc.current=wc,vc){for(var S=zt.memoizedState;S!==null;){var A=S.queue;A!==null&&(A.pending=null),S=S.next}vc=!1}if(_i=0,ur=sr=zt=null,Ca=!1,ka=0,Jh.current=null,p===null||p.return===null){ir=1,Aa=a,Zt=null;break}e:{var D=i,V=p.return,Q=p,te=a;if(a=yr,Q.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var he=te,ve=Q,we=ve.tag;if((ve.mode&1)===0&&(we===0||we===11||we===15)){var xe=ve.alternate;xe?(ve.updateQueue=xe.updateQueue,ve.memoizedState=xe.memoizedState,ve.lanes=xe.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var Ie=z0(V);if(Ie!==null){Ie.flags&=-257,H0(Ie,V,Q,D,a),Ie.mode&1&&$0(D,he,a),a=Ie,te=he;var $e=a.updateQueue;if($e===null){var We=new Set;We.add(te),a.updateQueue=We}else $e.add(te);break e}else{if((a&1)===0){$0(D,he,a),af();break e}te=Error(r(426))}}else if(Ot&&Q.mode&1){var Xt=z0(V);if(Xt!==null){(Xt.flags&65536)===0&&(Xt.flags|=256),H0(Xt,V,Q,D,a),xh(ho(te,Q));break e}}D=te=ho(te,Q),ir!==4&&(ir=2),Ta===null?Ta=[D]:Ta.push(D),D=V;do{switch(D.tag){case 3:D.flags|=65536,a&=-a,D.lanes|=a;var ce=B0(D,te,a);d0(D,ce);break e;case 1:Q=te;var se=D.type,ue=D.stateNode;if((D.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||ue!==null&&typeof ue.componentDidCatch=="function"&&(Ws===null||!Ws.has(ue)))){D.flags|=65536,a&=-a,D.lanes|=a;var Ne=F0(D,Q,a);d0(D,Ne);break e}}D=D.return}while(D!==null)}yv(p)}catch(Ue){a=Ue,Zt===p&&p!==null&&(Zt=p=p.return);continue}break}while(!0)}function xv(){var i=Nc.current;return Nc.current=wc,i===null?wc:i}function af(){(ir===0||ir===3||ir===2)&&(ir=4),dr===null||(Si&268435455)===0&&(Ec&268435455)===0||Gs(dr,yr)}function Dc(i,a){var p=mt;mt|=2;var S=xv();(dr!==i||yr!==a)&&(xs=null,ki(i,a));do try{_E();break}catch(A){gv(i,A)}while(!0);if(yh(),mt=p,Nc.current=S,Zt!==null)throw Error(r(261));return dr=null,yr=0,ir}function _E(){for(;Zt!==null;)vv(Zt)}function SE(){for(;Zt!==null&&!q2();)vv(Zt)}function vv(i){var a=_v(i.alternate,i,rn);i.memoizedProps=i.pendingProps,a===null?yv(i):Zt=a,Jh.current=null}function yv(i){var a=i;do{var p=a.alternate;if(i=a.return,(a.flags&32768)===0){if(p=pE(p,a,rn),p!==null){Zt=p;return}}else{if(p=gE(p,a),p!==null){p.flags&=32767,Zt=p;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{ir=6,Zt=null;return}}if(a=a.sibling,a!==null){Zt=a;return}Zt=a=i}while(a!==null);ir===0&&(ir=5)}function ji(i,a,p){var S=_t,A=vn.transition;try{vn.transition=null,_t=1,CE(i,a,p,S)}finally{vn.transition=A,_t=S}return null}function CE(i,a,p,S){do go();while(Vs!==null);if((mt&6)!==0)throw Error(r(327));p=i.finishedWork;var A=i.finishedLanes;if(p===null)return null;if(i.finishedWork=null,i.finishedLanes=0,p===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var D=p.lanes|p.childLanes;if(sN(i,D),i===dr&&(Zt=dr=null,yr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||Ac||(Ac=!0,Sv(Bl,function(){return go(),null})),D=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||D){D=vn.transition,vn.transition=null;var V=_t;_t=1;var Q=mt;mt|=4,Jh.current=null,vE(i,p),cv(p,i),VN(oh),Ul=!!ih,oh=ih=null,i.current=p,yE(p),Y2(),mt=Q,_t=V,vn.transition=D}else i.current=p;if(Ac&&(Ac=!1,Vs=i,Tc=A),D=i.pendingLanes,D===0&&(Ws=null),Q2(p.stateNode),Wr(i,Yt()),a!==null)for(S=i.onRecoverableError,p=0;p<a.length;p++)A=a[p],S(A.value,{componentStack:A.stack,digest:A.digest});if(Pc)throw Pc=!1,i=ef,ef=null,i;return(Tc&1)!==0&&i.tag!==0&&go(),D=i.pendingLanes,(D&1)!==0?i===tf?Ra++:(Ra=0,tf=i):Ra=0,Fs(),null}function go(){if(Vs!==null){var i=ax(Tc),a=vn.transition,p=_t;try{if(vn.transition=null,_t=16>i?16:i,Vs===null)var S=!1;else{if(i=Vs,Vs=null,Tc=0,(mt&6)!==0)throw Error(r(331));var A=mt;for(mt|=4,Fe=i.current;Fe!==null;){var D=Fe,V=D.child;if((Fe.flags&16)!==0){var Q=D.deletions;if(Q!==null){for(var te=0;te<Q.length;te++){var he=Q[te];for(Fe=he;Fe!==null;){var ve=Fe;switch(ve.tag){case 0:case 11:case 15:Pa(8,ve,D)}var we=ve.child;if(we!==null)we.return=ve,Fe=we;else for(;Fe!==null;){ve=Fe;var xe=ve.sibling,Ie=ve.return;if(sv(ve),ve===he){Fe=null;break}if(xe!==null){xe.return=Ie,Fe=xe;break}Fe=Ie}}}var $e=D.alternate;if($e!==null){var We=$e.child;if(We!==null){$e.child=null;do{var Xt=We.sibling;We.sibling=null,We=Xt}while(We!==null)}}Fe=D}}if((D.subtreeFlags&2064)!==0&&V!==null)V.return=D,Fe=V;else e:for(;Fe!==null;){if(D=Fe,(D.flags&2048)!==0)switch(D.tag){case 0:case 11:case 15:Pa(9,D,D.return)}var ce=D.sibling;if(ce!==null){ce.return=D.return,Fe=ce;break e}Fe=D.return}}var se=i.current;for(Fe=se;Fe!==null;){V=Fe;var ue=V.child;if((V.subtreeFlags&2064)!==0&&ue!==null)ue.return=V,Fe=ue;else e:for(V=se;Fe!==null;){if(Q=Fe,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:jc(9,Q)}}catch(Ue){Ut(Q,Q.return,Ue)}if(Q===V){Fe=null;break e}var Ne=Q.sibling;if(Ne!==null){Ne.return=Q.return,Fe=Ne;break e}Fe=Q.return}}if(mt=A,Fs(),Wn&&typeof Wn.onPostCommitFiberRoot=="function")try{Wn.onPostCommitFiberRoot(Fl,i)}catch{}S=!0}return S}finally{_t=p,vn.transition=a}}return!1}function bv(i,a,p){a=ho(p,a),a=B0(i,a,1),i=zs(i,a,1),a=Ir(),i!==null&&(ra(i,1,a),Wr(i,a))}function Ut(i,a,p){if(i.tag===3)bv(i,i,p);else for(;a!==null;){if(a.tag===3){bv(a,i,p);break}else if(a.tag===1){var S=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Ws===null||!Ws.has(S))){i=ho(p,i),i=F0(a,i,1),a=zs(a,i,1),i=Ir(),a!==null&&(ra(a,1,i),Wr(a,i));break}}a=a.return}}function kE(i,a,p){var S=i.pingCache;S!==null&&S.delete(a),a=Ir(),i.pingedLanes|=i.suspendedLanes&p,dr===i&&(yr&p)===p&&(ir===4||ir===3&&(yr&130023424)===yr&&500>Yt()-Zh?ki(i,0):Qh|=p),Wr(i,a)}function wv(i,a){a===0&&((i.mode&1)===0?a=1:(a=zl,zl<<=1,(zl&130023424)===0&&(zl=4194304)));var p=Ir();i=ms(i,a),i!==null&&(ra(i,a,p),Wr(i,p))}function jE(i){var a=i.memoizedState,p=0;a!==null&&(p=a.retryLane),wv(i,p)}function NE(i,a){var p=0;switch(i.tag){case 13:var S=i.stateNode,A=i.memoizedState;A!==null&&(p=A.retryLane);break;case 19:S=i.stateNode;break;default:throw Error(r(314))}S!==null&&S.delete(a),wv(i,p)}var _v;_v=function(i,a,p){if(i!==null)if(i.memoizedProps!==a.pendingProps||Fr.current)zr=!0;else{if((i.lanes&p)===0&&(a.flags&128)===0)return zr=!1,mE(i,a,p);zr=(i.flags&131072)!==0}else zr=!1,Ot&&(a.flags&1048576)!==0&&t0(a,cc,a.index);switch(a.lanes=0,a.tag){case 2:var S=a.type;Cc(i,a),i=a.pendingProps;var A=no(a,Er.current);co(a,p),A=Ah(null,a,S,i,A,p);var D=Th();return a.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,$r(S)?(D=!0,oc(a)):D=!1,a.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,Sh(a),A.updater=_c,a.stateNode=A,A._reactInternals=a,Oh(a,S,i,p),a=zh(null,a,S,!0,D,p)):(a.tag=0,Ot&&D&&fh(a),Lr(null,a,A,p),a=a.child),a;case 16:S=a.elementType;e:{switch(Cc(i,a),i=a.pendingProps,A=S._init,S=A(S._payload),a.type=S,A=a.tag=PE(S),i=Rn(S,i),A){case 0:a=$h(null,a,S,i,p);break e;case 1:a=q0(null,a,S,i,p);break e;case 11:a=W0(null,a,S,i,p);break e;case 14:a=V0(null,a,S,Rn(S.type,i),p);break e}throw Error(r(306,S,""))}return a;case 0:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),$h(i,a,S,A,p);case 1:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),q0(i,a,S,A,p);case 3:e:{if(Y0(a),i===null)throw Error(r(387));S=a.pendingProps,D=a.memoizedState,A=D.element,u0(i,a),pc(a,S,null,p);var V=a.memoizedState;if(S=V.element,D.isDehydrated)if(D={element:S,isDehydrated:!1,cache:V.cache,pendingSuspenseBoundaries:V.pendingSuspenseBoundaries,transitions:V.transitions},a.updateQueue.baseState=D,a.memoizedState=D,a.flags&256){A=ho(Error(r(423)),a),a=X0(i,a,S,p,A);break e}else if(S!==A){A=ho(Error(r(424)),a),a=X0(i,a,S,p,A);break e}else for(tn=Is(a.stateNode.containerInfo.firstChild),en=a,Ot=!0,Tn=null,p=l0(a,null,S,p),a.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(oo(),S===A){a=gs(i,a,p);break e}Lr(i,a,S,p)}a=a.child}return a;case 5:return f0(a),i===null&&gh(a),S=a.type,A=a.pendingProps,D=i!==null?i.memoizedProps:null,V=A.children,ah(S,A)?V=null:D!==null&&ah(S,D)&&(a.flags|=32),K0(i,a),Lr(i,a,V,p),a.child;case 6:return i===null&&gh(a),null;case 13:return J0(i,a,p);case 4:return Ch(a,a.stateNode.containerInfo),S=a.pendingProps,i===null?a.child=ao(a,null,S,p):Lr(i,a,S,p),a.child;case 11:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),W0(i,a,S,A,p);case 7:return Lr(i,a,a.pendingProps,p),a.child;case 8:return Lr(i,a,a.pendingProps.children,p),a.child;case 12:return Lr(i,a,a.pendingProps.children,p),a.child;case 10:e:{if(S=a.type._context,A=a.pendingProps,D=a.memoizedProps,V=A.value,Nt(hc,S._currentValue),S._currentValue=V,D!==null)if(An(D.value,V)){if(D.children===A.children&&!Fr.current){a=gs(i,a,p);break e}}else for(D=a.child,D!==null&&(D.return=a);D!==null;){var Q=D.dependencies;if(Q!==null){V=D.child;for(var te=Q.firstContext;te!==null;){if(te.context===S){if(D.tag===1){te=ps(-1,p&-p),te.tag=2;var he=D.updateQueue;if(he!==null){he=he.shared;var ve=he.pending;ve===null?te.next=te:(te.next=ve.next,ve.next=te),he.pending=te}}D.lanes|=p,te=D.alternate,te!==null&&(te.lanes|=p),wh(D.return,p,a),Q.lanes|=p;break}te=te.next}}else if(D.tag===10)V=D.type===a.type?null:D.child;else if(D.tag===18){if(V=D.return,V===null)throw Error(r(341));V.lanes|=p,Q=V.alternate,Q!==null&&(Q.lanes|=p),wh(V,p,a),V=D.sibling}else V=D.child;if(V!==null)V.return=D;else for(V=D;V!==null;){if(V===a){V=null;break}if(D=V.sibling,D!==null){D.return=V.return,V=D;break}V=V.return}D=V}Lr(i,a,A.children,p),a=a.child}return a;case 9:return A=a.type,S=a.pendingProps.children,co(a,p),A=gn(A),S=S(A),a.flags|=1,Lr(i,a,S,p),a.child;case 14:return S=a.type,A=Rn(S,a.pendingProps),A=Rn(S.type,A),V0(i,a,S,A,p);case 15:return U0(i,a,a.type,a.pendingProps,p);case 17:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),Cc(i,a),a.tag=1,$r(S)?(i=!0,oc(a)):i=!1,co(a,p),I0(a,S,A),Oh(a,S,A,p),zh(null,a,S,!0,i,p);case 19:return Z0(i,a,p);case 22:return G0(i,a,p)}throw Error(r(156,a.tag))};function Sv(i,a){return rx(i,a)}function EE(i,a,p,S){this.tag=i,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(i,a,p,S){return new EE(i,a,p,S)}function lf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function PE(i){if(typeof i=="function")return lf(i)?1:0;if(i!=null){if(i=i.$$typeof,i===$)return 11;if(i===z)return 14}return 2}function Ks(i,a){var p=i.alternate;return p===null?(p=yn(i.tag,a,i.key,i.mode),p.elementType=i.elementType,p.type=i.type,p.stateNode=i.stateNode,p.alternate=i,i.alternate=p):(p.pendingProps=a,p.type=i.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=i.flags&14680064,p.childLanes=i.childLanes,p.lanes=i.lanes,p.child=i.child,p.memoizedProps=i.memoizedProps,p.memoizedState=i.memoizedState,p.updateQueue=i.updateQueue,a=i.dependencies,p.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},p.sibling=i.sibling,p.index=i.index,p.ref=i.ref,p}function Lc(i,a,p,S,A,D){var V=2;if(S=i,typeof i=="function")lf(i)&&(V=1);else if(typeof i=="string")V=5;else e:switch(i){case T:return Ni(p.children,A,D,a);case N:V=8,A|=8;break;case R:return i=yn(12,p,a,A|2),i.elementType=R,i.lanes=D,i;case W:return i=yn(13,p,a,A),i.elementType=W,i.lanes=D,i;case Y:return i=yn(19,p,a,A),i.elementType=Y,i.lanes=D,i;case G:return Ic(p,A,D,a);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case I:V=10;break e;case O:V=9;break e;case $:V=11;break e;case z:V=14;break e;case K:V=16,S=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return a=yn(V,p,a,A),a.elementType=i,a.type=S,a.lanes=D,a}function Ni(i,a,p,S){return i=yn(7,i,S,a),i.lanes=p,i}function Ic(i,a,p,S){return i=yn(22,i,S,a),i.elementType=G,i.lanes=p,i.stateNode={isHidden:!1},i}function cf(i,a,p){return i=yn(6,i,null,a),i.lanes=p,i}function uf(i,a,p){return a=yn(4,i.children!==null?i.children:[],i.key,a),a.lanes=p,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}function AE(i,a,p,S,A){this.tag=a,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=Id(0),this.expirationTimes=Id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Id(0),this.identifierPrefix=S,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function df(i,a,p,S,A,D,V,Q,te){return i=new AE(i,a,p,Q,te),a===1?(a=1,D===!0&&(a|=8)):a=0,D=yn(3,null,null,a),i.current=D,D.stateNode=i,D.memoizedState={element:S,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sh(D),i}function TE(i,a,p){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:S==null?null:""+S,children:i,containerInfo:a,implementation:p}}function Cv(i){if(!i)return Bs;i=i._reactInternals;e:{if(pi(i)!==i||i.tag!==1)throw Error(r(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if($r(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(r(171))}if(i.tag===1){var p=i.type;if($r(p))return Qx(i,p,a)}return a}function kv(i,a,p,S,A,D,V,Q,te){return i=df(p,S,!0,i,A,D,V,Q,te),i.context=Cv(null),p=i.current,S=Ir(),A=Us(p),D=ps(S,A),D.callback=a??null,zs(p,D,A),i.current.lanes=A,ra(i,A,S),Wr(i,S),i}function Oc(i,a,p,S){var A=a.current,D=Ir(),V=Us(A);return p=Cv(p),a.context===null?a.context=p:a.pendingContext=p,a=ps(D,V),a.payload={element:i},S=S===void 0?null:S,S!==null&&(a.callback=S),i=zs(A,a,V),i!==null&&(Ln(i,A,V,D),mc(i,A,V)),V}function Bc(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 jv(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var p=i.retryLane;i.retryLane=p!==0&&p<a?p:a}}function hf(i,a){jv(i,a),(i=i.alternate)&&jv(i,a)}function RE(){return null}var Nv=typeof reportError=="function"?reportError:function(i){console.error(i)};function ff(i){this._internalRoot=i}Fc.prototype.render=ff.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));Oc(i,a,null,null)},Fc.prototype.unmount=ff.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;Ci(function(){Oc(null,i,null,null)}),a[us]=null}};function Fc(i){this._internalRoot=i}Fc.prototype.unstable_scheduleHydration=function(i){if(i){var a=ux();i={blockedOn:null,target:i,priority:a};for(var p=0;p<Ms.length&&a!==0&&a<Ms[p].priority;p++);Ms.splice(p,0,i),p===0&&fx(i)}};function mf(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function $c(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Ev(){}function ME(i,a,p,S,A){if(A){if(typeof S=="function"){var D=S;S=function(){var he=Bc(V);D.call(he)}}var V=kv(a,S,i,0,null,!1,!1,"",Ev);return i._reactRootContainer=V,i[us]=V.current,ga(i.nodeType===8?i.parentNode:i),Ci(),V}for(;A=i.lastChild;)i.removeChild(A);if(typeof S=="function"){var Q=S;S=function(){var he=Bc(te);Q.call(he)}}var te=df(i,0,!1,null,null,!1,!1,"",Ev);return i._reactRootContainer=te,i[us]=te.current,ga(i.nodeType===8?i.parentNode:i),Ci(function(){Oc(a,te,p,S)}),te}function zc(i,a,p,S,A){var D=p._reactRootContainer;if(D){var V=D;if(typeof A=="function"){var Q=A;A=function(){var te=Bc(V);Q.call(te)}}Oc(a,V,i,A)}else V=ME(p,a,i,A,S);return Bc(V)}lx=function(i){switch(i.tag){case 3:var a=i.stateNode;if(a.current.memoizedState.isDehydrated){var p=ta(a.pendingLanes);p!==0&&(Od(a,p|1),Wr(a,Yt()),(mt&6)===0&&(po=Yt()+500,Fs()))}break;case 13:Ci(function(){var S=ms(i,1);if(S!==null){var A=Ir();Ln(S,i,1,A)}}),hf(i,1)}},Bd=function(i){if(i.tag===13){var a=ms(i,134217728);if(a!==null){var p=Ir();Ln(a,i,134217728,p)}hf(i,134217728)}},cx=function(i){if(i.tag===13){var a=Us(i),p=ms(i,a);if(p!==null){var S=Ir();Ln(p,i,a,S)}hf(i,a)}},ux=function(){return _t},dx=function(i,a){var p=_t;try{return _t=i,a()}finally{_t=p}},Vt=function(i,a,p){switch(a){case"input":if(de(i,p),a=p.name,p.type==="radio"&&a!=null){for(p=i;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<p.length;a++){var S=p[a];if(S!==i&&S.form===i.form){var A=sc(S);if(!A)throw Error(r(90));ie(S),de(S,A)}}}break;case"textarea":ht(i,p);break;case"select":a=p.value,a!=null&&Se(i,!!p.multiple,a,!1)}},nr=sf,Nr=Ci;var DE={usingClientEntryPoint:!1,Events:[ya,to,sc,tt,qt,sf]},Ma={findFiberByHostInstance:gi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},LE={bundleType:Ma.bundleType,version:Ma.version,rendererPackageName:Ma.rendererPackageName,rendererConfig:Ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ex(i),i===null?null:i.stateNode},findFiberByHostInstance:Ma.findFiberByHostInstance||RE,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 Hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hc.isDisabled&&Hc.supportsFiber)try{Fl=Hc.inject(LE),Wn=Hc}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DE,Vr.createPortal=function(i,a){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mf(a))throw Error(r(200));return TE(i,a,null,p)},Vr.createRoot=function(i,a){if(!mf(i))throw Error(r(299));var p=!1,S="",A=Nv;return a!=null&&(a.unstable_strictMode===!0&&(p=!0),a.identifierPrefix!==void 0&&(S=a.identifierPrefix),a.onRecoverableError!==void 0&&(A=a.onRecoverableError)),a=df(i,1,!1,null,null,p,!1,S,A),i[us]=a.current,ga(i.nodeType===8?i.parentNode:i),new ff(a)},Vr.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=ex(a),i=i===null?null:i.stateNode,i},Vr.flushSync=function(i){return Ci(i)},Vr.hydrate=function(i,a,p){if(!$c(a))throw Error(r(200));return zc(null,i,a,!0,p)},Vr.hydrateRoot=function(i,a,p){if(!mf(i))throw Error(r(405));var S=p!=null&&p.hydratedSources||null,A=!1,D="",V=Nv;if(p!=null&&(p.unstable_strictMode===!0&&(A=!0),p.identifierPrefix!==void 0&&(D=p.identifierPrefix),p.onRecoverableError!==void 0&&(V=p.onRecoverableError)),a=kv(a,null,i,1,p??null,A,!1,D,V),i[us]=a.current,ga(i),S)for(i=0;i<S.length;i++)p=S[i],A=p._getVersion,A=A(p._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[p,A]:a.mutableSourceEagerHydrationData.push(p,A);return new Fc(a)},Vr.render=function(i,a,p){if(!$c(a))throw Error(r(200));return zc(null,i,a,!1,p)},Vr.unmountComponentAtNode=function(i){if(!$c(i))throw Error(r(40));return i._reactRootContainer?(Ci(function(){zc(null,null,i,!1,function(){i._reactRootContainer=null,i[us]=null})}),!0):!1},Vr.unstable_batchedUpdates=sf,Vr.unstable_renderSubtreeIntoContainer=function(i,a,p,S){if(!$c(p))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return zc(i,a,p,!1,S)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}var Iv;function $w(){if(Iv)return xf.exports;Iv=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(),xf.exports=WE(),xf.exports}var Ov;function VE(){if(Ov)return Wc;Ov=1;var e=$w();return Wc.createRoot=e.createRoot,Wc.hydrateRoot=e.hydrateRoot,Wc}var UE=VE();const GE=ml(UE);var pl=$w();const zw=ml(pl);function KE(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const qE=e=>{switch(e){case"success":return JE;case"info":return ZE;case"warning":return QE;case"error":return eP;default:return null}},YE=Array(12).fill(0),XE=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},YE.map((r,s)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),JE=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),QE=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ZE=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),eP=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),tP=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rP=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let dm=1;class nP{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:s,...o}=t,u=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:dm++,d=this.toasts.find(c=>c.id===u),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(c=>c.id===u?(this.publish({...c,...t,id:u,title:s}),{...c,...t,id:u,dismissible:l,title:s}):c):this.addToast({title:s,...o,dismissible:l,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,d;const l=o.then(async f=>{if(d=["resolve",f],Ee.isValidElement(f))u=!1,this.create({id:s,type:"default",message:f});else if(iP(f)&&!f.ok){u=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,x=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,k=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:x,...k})}else if(f instanceof Error){u=!1;const h=typeof r.error=="function"?await r.error(f):r.error,x=typeof r.description=="function"?await r.description(f):r.description,k=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:x,...k})}else if(r.success!==void 0){u=!1;const h=typeof r.success=="function"?await r.success(f):r.success,x=typeof r.description=="function"?await r.description(f):r.description,k=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:s,type:"success",description:x,...k})}}).catch(async f=>{if(d=["reject",f],r.error!==void 0){u=!1;const m=typeof r.error=="function"?await r.error(f):r.error,h=typeof r.description=="function"?await r.description(f):r.description,w=typeof m=="object"&&!Ee.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:h,...w})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((f,m)=>l.then(()=>d[0]==="reject"?m(d[1]):f(d[1])).catch(m));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,r)=>{const s=(r==null?void 0:r.id)||dm++;return this.create({jsx:t(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Gr=new nP,sP=(e,t)=>{const r=(t==null?void 0:t.id)||dm++;return Gr.addToast({title:e,...t,id:r}),r},iP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oP=sP,aP=()=>Gr.toasts,lP=()=>Gr.getActiveToasts(),ee=Object.assign(oP,{success:Gr.success,info:Gr.info,warning:Gr.warning,error:Gr.error,custom:Gr.custom,message:Gr.message,promise:Gr.promise,dismiss:Gr.dismiss,loading:Gr.loading},{getHistory:aP,getToasts:lP});KE("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Vc(e){return e.label!==void 0}const cP=3,uP="24px",dP="16px",Bv=4e3,hP=356,fP=14,mP=45,pP=200;function qn(...e){return e.filter(Boolean).join(" ")}function gP(e){const[t,r]=e.split("-"),s=[];return t&&s.push(t),r&&s.push(r),s}const xP=e=>{var t,r,s,o,u,d,l,c,f;const{invert:m,toast:h,unstyled:x,interacting:w,setHeights:k,visibleToasts:_,heights:v,index:b,toasts:g,expanded:y,removeToast:j,defaultRichColors:E,closeButton:P,style:T,cancelButtonStyle:N,actionButtonStyle:R,className:I="",descriptionClassName:O="",duration:$,position:W,gap:Y,expandByDefault:z,classNames:K,icons:G,closeButtonAriaLabel:U="Close toast"}=e,[L,M]=Ee.useState(null),[B,q]=Ee.useState(null),[F,oe]=Ee.useState(!1),[fe,me]=Ee.useState(!1),[X,H]=Ee.useState(!1),[ae,ne]=Ee.useState(!1),[J,ie]=Ee.useState(!1),[ye,Oe]=Ee.useState(0),[Ve,re]=Ee.useState(0),de=Ee.useRef(h.duration||$||Bv),De=Ee.useRef(null),Re=Ee.useRef(null),Ze=b===0,Se=b+1<=_,ge=h.type,Me=h.dismissible!==!1,ht=h.className||"",Rt=h.descriptionClassName||"",pe=Ee.useMemo(()=>v.findIndex(tt=>tt.toastId===h.id)||0,[v,h.id]),be=Ee.useMemo(()=>{var tt;return(tt=h.closeButton)!=null?tt:P},[h.closeButton,P]),Be=Ee.useMemo(()=>h.duration||$||Bv,[h.duration,$]),Ge=Ee.useRef(0),Ke=Ee.useRef(0),bt=Ee.useRef(0),Z=Ee.useRef(null),[Pe,Le]=W.split("-"),st=Ee.useMemo(()=>v.reduce((tt,qt,nr)=>nr>=pe?tt:tt+qt.height,0),[v,pe]),et=rP(),jt=h.invert||m,ft=ge==="loading";Ke.current=Ee.useMemo(()=>pe*Y+st,[pe,st]),Ee.useEffect(()=>{de.current=Be},[Be]),Ee.useEffect(()=>{oe(!0)},[]),Ee.useEffect(()=>{const tt=Re.current;if(tt){const qt=tt.getBoundingClientRect().height;return re(qt),k(nr=>[{toastId:h.id,height:qt,position:h.position},...nr]),()=>k(nr=>nr.filter(Nr=>Nr.toastId!==h.id))}},[k,h.id]),Ee.useLayoutEffect(()=>{if(!F)return;const tt=Re.current,qt=tt.style.height;tt.style.height="auto";const nr=tt.getBoundingClientRect().height;tt.style.height=qt,re(nr),k(Nr=>Nr.find(Qt=>Qt.toastId===h.id)?Nr.map(Qt=>Qt.toastId===h.id?{...Qt,height:nr}:Qt):[{toastId:h.id,height:nr,position:h.position},...Nr])},[F,h.title,h.description,k,h.id,h.jsx,h.action,h.cancel]);const wt=Ee.useCallback(()=>{me(!0),Oe(Ke.current),k(tt=>tt.filter(qt=>qt.toastId!==h.id)),setTimeout(()=>{j(h)},pP)},[h,j,k,Ke]);Ee.useEffect(()=>{if(h.promise&&ge==="loading"||h.duration===1/0||h.type==="loading")return;let tt;return y||w||et?(()=>{if(bt.current<Ge.current){const Nr=new Date().getTime()-Ge.current;de.current=de.current-Nr}bt.current=new Date().getTime()})():(()=>{de.current!==1/0&&(Ge.current=new Date().getTime(),tt=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),wt()},de.current))})(),()=>clearTimeout(tt)},[y,w,h,ge,et,wt]),Ee.useEffect(()=>{h.delete&&(wt(),h.onDismiss==null||h.onDismiss.call(h,h))},[wt,h.delete]);function Vt(){var tt;if(G!=null&&G.loading){var qt;return Ee.createElement("div",{className:qn(K==null?void 0:K.loader,h==null||(qt=h.classNames)==null?void 0:qt.loader,"sonner-loader"),"data-visible":ge==="loading"},G.loading)}return Ee.createElement(XE,{className:qn(K==null?void 0:K.loader,h==null||(tt=h.classNames)==null?void 0:tt.loader),visible:ge==="loading"})}const rr=h.icon||(G==null?void 0:G[ge])||qE(ge);var jr,hn;return Ee.createElement("li",{tabIndex:0,ref:Re,className:qn(I,ht,K==null?void 0:K.toast,h==null||(t=h.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[ge],h==null||(r=h.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(jr=h.richColors)!=null?jr:E,"data-styled":!(h.jsx||h.unstyled||x),"data-mounted":F,"data-promise":!!h.promise,"data-swiped":J,"data-removed":fe,"data-visible":Se,"data-y-position":Pe,"data-x-position":Le,"data-index":b,"data-front":Ze,"data-swiping":X,"data-dismissible":Me,"data-type":ge,"data-invert":jt,"data-swipe-out":ae,"data-swipe-direction":B,"data-expanded":!!(y||z&&F),"data-testid":h.testId,style:{"--index":b,"--toasts-before":b,"--z-index":g.length-b,"--offset":`${fe?ye:Ke.current}px`,"--initial-height":z?"auto":`${Ve}px`,...T,...h.style},onDragEnd:()=>{H(!1),M(null),Z.current=null},onPointerDown:tt=>{tt.button!==2&&(ft||!Me||(De.current=new Date,Oe(Ke.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(H(!0),Z.current={x:tt.clientX,y:tt.clientY})))},onPointerUp:()=>{var tt,qt,nr;if(ae||!Me)return;Z.current=null;const Nr=Number(((tt=Re.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ns=Number(((qt=Re.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qt=new Date().getTime()-((nr=De.current)==null?void 0:nr.getTime()),cr=L==="x"?Nr:Ns,Es=Math.abs(cr)/Qt;if(Math.abs(cr)>=mP||Es>.11){Oe(Ke.current),h.onDismiss==null||h.onDismiss.call(h,h),q(L==="x"?Nr>0?"right":"left":Ns>0?"down":"up"),wt(),ne(!0);return}else{var xr,Qr;(xr=Re.current)==null||xr.style.setProperty("--swipe-amount-x","0px"),(Qr=Re.current)==null||Qr.style.setProperty("--swipe-amount-y","0px")}ie(!1),H(!1),M(null)},onPointerMove:tt=>{var qt,nr,Nr;if(!Z.current||!Me||((qt=window.getSelection())==null?void 0:qt.toString().length)>0)return;const Qt=tt.clientY-Z.current.y,cr=tt.clientX-Z.current.x;var Es;const xr=(Es=e.swipeDirections)!=null?Es:gP(W);!L&&(Math.abs(cr)>1||Math.abs(Qt)>1)&&M(Math.abs(cr)>Math.abs(Qt)?"x":"y");let Qr={x:0,y:0};const Ps=fn=>1/(1.5+Math.abs(fn)/20);if(L==="y"){if(xr.includes("top")||xr.includes("bottom"))if(xr.includes("top")&&Qt<0||xr.includes("bottom")&&Qt>0)Qr.y=Qt;else{const fn=Qt*Ps(Qt);Qr.y=Math.abs(fn)<Math.abs(Qt)?fn:Qt}}else if(L==="x"&&(xr.includes("left")||xr.includes("right")))if(xr.includes("left")&&cr<0||xr.includes("right")&&cr>0)Qr.x=cr;else{const fn=cr*Ps(cr);Qr.x=Math.abs(fn)<Math.abs(cr)?fn:cr}(Math.abs(Qr.x)>0||Math.abs(Qr.y)>0)&&ie(!0),(nr=Re.current)==null||nr.style.setProperty("--swipe-amount-x",`${Qr.x}px`),(Nr=Re.current)==null||Nr.style.setProperty("--swipe-amount-y",`${Qr.y}px`)}},be&&!h.jsx&&ge!=="loading"?Ee.createElement("button",{"aria-label":U,"data-disabled":ft,"data-close-button":!0,onClick:ft||!Me?()=>{}:()=>{wt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:qn(K==null?void 0:K.closeButton,h==null||(s=h.classNames)==null?void 0:s.closeButton)},(hn=G==null?void 0:G.close)!=null?hn:tP):null,(ge||h.icon||h.promise)&&h.icon!==null&&((G==null?void 0:G[ge])!==null||h.icon)?Ee.createElement("div",{"data-icon":"",className:qn(K==null?void 0:K.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Vt():null,h.type!=="loading"?rr:null):null,Ee.createElement("div",{"data-content":"",className:qn(K==null?void 0:K.content,h==null||(u=h.classNames)==null?void 0:u.content)},Ee.createElement("div",{"data-title":"",className:qn(K==null?void 0:K.title,h==null||(d=h.classNames)==null?void 0:d.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ee.createElement("div",{"data-description":"",className:qn(O,Rt,K==null?void 0:K.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ee.isValidElement(h.cancel)?h.cancel:h.cancel&&Vc(h.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||N,onClick:tt=>{Vc(h.cancel)&&Me&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,tt),wt())},className:qn(K==null?void 0:K.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,Ee.isValidElement(h.action)?h.action:h.action&&Vc(h.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||R,onClick:tt=>{Vc(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,tt),!tt.defaultPrevented&&wt())},className:qn(K==null?void 0:K.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function Fv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function vP(e,t){const r={};return[e,t].forEach((s,o)=>{const u=o===1,d=u?"--mobile-offset":"--offset",l=u?dP:uP;function c(f){["top","right","bottom","left"].forEach(m=>{r[`${d}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(f=>{s[f]===void 0?r[`${d}-${f}`]=l:r[`${d}-${f}`]=typeof s[f]=="number"?`${s[f]}px`:s[f]}):c(l)}),r}const yP=Ee.forwardRef(function(t,r){const{id:s,invert:o,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:l,closeButton:c,className:f,offset:m,mobileOffset:h,theme:x="light",richColors:w,duration:k,style:_,visibleToasts:v=cP,toastOptions:b,dir:g=Fv(),gap:y=fP,icons:j,containerAriaLabel:E="Notifications"}=t,[P,T]=Ee.useState([]),N=Ee.useMemo(()=>s?P.filter(F=>F.toasterId===s):P.filter(F=>!F.toasterId),[P,s]),R=Ee.useMemo(()=>Array.from(new Set([u].concat(N.filter(F=>F.position).map(F=>F.position)))),[N,u]),[I,O]=Ee.useState([]),[$,W]=Ee.useState(!1),[Y,z]=Ee.useState(!1),[K,G]=Ee.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Ee.useRef(null),L=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=Ee.useRef(null),B=Ee.useRef(!1),q=Ee.useCallback(F=>{T(oe=>{var fe;return(fe=oe.find(me=>me.id===F.id))!=null&&fe.delete||Gr.dismiss(F.id),oe.filter(({id:me})=>me!==F.id)})},[]);return Ee.useEffect(()=>Gr.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(fe=>fe.id===F.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{zw.flushSync(()=>{T(oe=>{const fe=oe.findIndex(me=>me.id===F.id);return fe!==-1?[...oe.slice(0,fe),{...oe[fe],...F},...oe.slice(fe+1)]:[F,...oe]})})})}),[P]),Ee.useEffect(()=>{if(x!=="system"){G(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:oe})=>{G(oe?"dark":"light")})}catch{F.addListener(({matches:fe})=>{try{G(fe?"dark":"light")}catch(me){console.error(me)}})}},[x]),Ee.useEffect(()=>{P.length<=1&&W(!1)},[P]),Ee.useEffect(()=>{const F=oe=>{var fe;if(d.every(H=>oe[H]||oe.code===H)){var X;W(!0),(X=U.current)==null||X.focus()}oe.code==="Escape"&&(document.activeElement===U.current||(fe=U.current)!=null&&fe.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[d]),Ee.useEffect(()=>{if(U.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,B.current=!1)}},[U.current]),Ee.createElement("section",{ref:r,"aria-label":`${E} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,oe)=>{var fe;const[me,X]=F.split("-");return N.length?Ee.createElement("ol",{key:F,dir:g==="auto"?Fv():g,tabIndex:-1,ref:U,className:f,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":me,"data-x-position":X,style:{"--front-toast-height":`${((fe=I[0])==null?void 0:fe.height)||0}px`,"--width":`${hP}px`,"--gap":`${y}px`,..._,...vP(m,h)},onBlur:H=>{B.current&&!H.currentTarget.contains(H.relatedTarget)&&(B.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||B.current||(B.current=!0,M.current=H.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Y||W(!1)},onDragEnd:()=>W(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},N.filter(H=>!H.position&&oe===0||H.position===F).map((H,ae)=>{var ne,J;return Ee.createElement(xP,{key:H.id,icons:j,index:ae,toast:H,defaultRichColors:w,duration:(ne=b==null?void 0:b.duration)!=null?ne:k,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:v,closeButton:(J=b==null?void 0:b.closeButton)!=null?J:c,interacting:Y,position:F,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:q,toasts:N.filter(ie=>ie.position==H.position),heights:I.filter(ie=>ie.position==H.position),setHeights:O,expandByDefault:l,gap:y,expanded:$,swipeDirections:t.swipeDirections})})):null}))}),lp=C.createContext({});function cp(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const zu=C.createContext(null),up=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class bP extends C.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=r.offsetHeight||0,s.width=r.offsetWidth||0,s.top=r.offsetTop,s.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function wP({children:e,isPresent:t}){const r=C.useId(),s=C.useRef(null),o=C.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=C.useContext(up);return C.useInsertionEffect(()=>{const{width:d,height:l,top:c,left:f}=o.current;if(t||!s.current||!d||!l)return;s.current.dataset.motionPopId=r;const m=document.createElement("style");return u&&(m.nonce=u),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
40
|
+
`+D.stack}return{value:i,source:a,stack:A,digest:null}}function Bh(i,a,p){return{value:i,source:null,stack:p??null,digest:a??null}}function Fh(i,a){try{console.error(a.value)}catch(p){setTimeout(function(){throw p})}}var dE=typeof WeakMap=="function"?WeakMap:Map;function B0(i,a,p){p=ps(-1,p),p.tag=3,p.payload={element:null};var S=a.value;return p.callback=function(){Pc||(Pc=!0,ef=S),Fh(i,a)},p}function F0(i,a,p){p=ps(-1,p),p.tag=3;var S=i.type.getDerivedStateFromError;if(typeof S=="function"){var A=a.value;p.payload=function(){return S(A)},p.callback=function(){Fh(i,a)}}var D=i.stateNode;return D!==null&&typeof D.componentDidCatch=="function"&&(p.callback=function(){Fh(i,a),typeof S!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var V=a.stack;this.componentDidCatch(a.value,{componentStack:V!==null?V:""})}),p}function $0(i,a,p){var S=i.pingCache;if(S===null){S=i.pingCache=new dE;var A=new Set;S.set(a,A)}else A=S.get(a),A===void 0&&(A=new Set,S.set(a,A));A.has(p)||(A.add(p),i=kE.bind(null,i,a,p),a.then(i,i))}function z0(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function H0(i,a,p,S,A){return(i.mode&1)===0?(i===a?i.flags|=65536:(i.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(a=ps(-1,1),a.tag=2,zs(p,a,1))),p.lanes|=1),i):(i.flags|=65536,i.lanes=A,i)}var hE=j.ReactCurrentOwner,zr=!1;function Lr(i,a,p,S){a.child=i===null?l0(a,null,p,S):ao(a,i.child,p,S)}function W0(i,a,p,S,A){p=p.render;var D=a.ref;return co(a,A),S=Ah(i,a,p,S,D,A),p=Th(),i!==null&&!zr?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~A,gs(i,a,A)):(Ot&&p&&fh(a),a.flags|=1,Lr(i,a,S,A),a.child)}function V0(i,a,p,S,A){if(i===null){var D=p.type;return typeof D=="function"&&!lf(D)&&D.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(a.tag=15,a.type=D,U0(i,a,D,S,A)):(i=Lc(p.type,null,S,a,a.mode,A),i.ref=a.ref,i.return=a,a.child=i)}if(D=i.child,(i.lanes&A)===0){var V=D.memoizedProps;if(p=p.compare,p=p!==null?p:fa,p(V,S)&&i.ref===a.ref)return gs(i,a,A)}return a.flags|=1,i=Ks(D,S),i.ref=a.ref,i.return=a,a.child=i}function U0(i,a,p,S,A){if(i!==null){var D=i.memoizedProps;if(fa(D,S)&&i.ref===a.ref)if(zr=!1,a.pendingProps=S=D,(i.lanes&A)!==0)(i.flags&131072)!==0&&(zr=!0);else return a.lanes=i.lanes,gs(i,a,A)}return $h(i,a,p,S,A)}function G0(i,a,p){var S=a.pendingProps,A=S.children,D=i!==null?i.memoizedState:null;if(S.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(mo,rn),rn|=p;else{if((p&1073741824)===0)return i=D!==null?D.baseLanes|p:p,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,Nt(mo,rn),rn|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},S=D!==null?D.baseLanes:p,Nt(mo,rn),rn|=S}else D!==null?(S=D.baseLanes|p,a.memoizedState=null):S=p,Nt(mo,rn),rn|=S;return Lr(i,a,A,p),a.child}function K0(i,a){var p=a.ref;(i===null&&p!==null||i!==null&&i.ref!==p)&&(a.flags|=512,a.flags|=2097152)}function $h(i,a,p,S,A){var D=$r(p)?xi:Er.current;return D=no(a,D),co(a,A),p=Ah(i,a,p,S,D,A),S=Th(),i!==null&&!zr?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~A,gs(i,a,A)):(Ot&&S&&fh(a),a.flags|=1,Lr(i,a,p,A),a.child)}function q0(i,a,p,S,A){if($r(p)){var D=!0;oc(a)}else D=!1;if(co(a,A),a.stateNode===null)Cc(i,a),I0(a,p,S),Oh(a,p,S,A),S=!0;else if(i===null){var V=a.stateNode,Q=a.memoizedProps;V.props=Q;var re=V.context,he=p.contextType;typeof he=="object"&&he!==null?he=gn(he):(he=$r(p)?xi:Er.current,he=no(a,he));var ve=p.getDerivedStateFromProps,we=typeof ve=="function"||typeof V.getSnapshotBeforeUpdate=="function";we||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==S||re!==he)&&O0(a,V,S,he),$s=!1;var xe=a.memoizedState;V.state=xe,pc(a,S,V,A),re=a.memoizedState,Q!==S||xe!==re||Fr.current||$s?(typeof ve=="function"&&(Ih(a,p,ve,S),re=a.memoizedState),(Q=$s||L0(a,p,Q,S,xe,re,he))?(we||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(a.flags|=4194308)):(typeof V.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=S,a.memoizedState=re),V.props=S,V.state=re,V.context=he,S=Q):(typeof V.componentDidMount=="function"&&(a.flags|=4194308),S=!1)}else{V=a.stateNode,u0(i,a),Q=a.memoizedProps,he=a.type===a.elementType?Q:Rn(a.type,Q),V.props=he,we=a.pendingProps,xe=V.context,re=p.contextType,typeof re=="object"&&re!==null?re=gn(re):(re=$r(p)?xi:Er.current,re=no(a,re));var Ie=p.getDerivedStateFromProps;(ve=typeof Ie=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==we||xe!==re)&&O0(a,V,S,re),$s=!1,xe=a.memoizedState,V.state=xe,pc(a,S,V,A);var $e=a.memoizedState;Q!==we||xe!==$e||Fr.current||$s?(typeof Ie=="function"&&(Ih(a,p,Ie,S),$e=a.memoizedState),(he=$s||L0(a,p,he,S,xe,$e,re)||!1)?(ve||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(S,$e,re),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(S,$e,re)),typeof V.componentDidUpdate=="function"&&(a.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof V.componentDidUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=1024),a.memoizedProps=S,a.memoizedState=$e),V.props=S,V.state=$e,V.context=re,S=he):(typeof V.componentDidUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===i.memoizedProps&&xe===i.memoizedState||(a.flags|=1024),S=!1)}return zh(i,a,p,S,D,A)}function zh(i,a,p,S,A,D){K0(i,a);var V=(a.flags&128)!==0;if(!S&&!V)return A&&Zx(a,p,!1),gs(i,a,D);S=a.stateNode,hE.current=a;var Q=V&&typeof p.getDerivedStateFromError!="function"?null:S.render();return a.flags|=1,i!==null&&V?(a.child=ao(a,i.child,null,D),a.child=ao(a,null,Q,D)):Lr(i,a,Q,D),a.memoizedState=S.state,A&&Zx(a,p,!0),a.child}function Y0(i){var a=i.stateNode;a.pendingContext?Jx(i,a.pendingContext,a.pendingContext!==a.context):a.context&&Jx(i,a.context,!1),Ch(i,a.containerInfo)}function X0(i,a,p,S,A){return oo(),xh(A),a.flags|=256,Lr(i,a,p,S),a.child}var Hh={dehydrated:null,treeContext:null,retryLane:0};function Wh(i){return{baseLanes:i,cachePool:null,transitions:null}}function J0(i,a,p){var S=a.pendingProps,A=$t.current,D=!1,V=(a.flags&128)!==0,Q;if((Q=V)||(Q=i!==null&&i.memoizedState===null?!1:(A&2)!==0),Q?(D=!0,a.flags&=-129):(i===null||i.memoizedState!==null)&&(A|=1),Nt($t,A&1),i===null)return gh(a),i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((a.mode&1)===0?a.lanes=1:i.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(V=S.children,i=S.fallback,D?(S=a.mode,D=a.child,V={mode:"hidden",children:V},(S&1)===0&&D!==null?(D.childLanes=0,D.pendingProps=V):D=Ic(V,S,0,null),i=Ni(i,S,p,null),D.return=a,i.return=a,D.sibling=i,a.child=D,a.child.memoizedState=Wh(p),a.memoizedState=Hh,i):Vh(a,V));if(A=i.memoizedState,A!==null&&(Q=A.dehydrated,Q!==null))return fE(i,a,V,S,Q,A,p);if(D){D=S.fallback,V=a.mode,A=i.child,Q=A.sibling;var re={mode:"hidden",children:S.children};return(V&1)===0&&a.child!==A?(S=a.child,S.childLanes=0,S.pendingProps=re,a.deletions=null):(S=Ks(A,re),S.subtreeFlags=A.subtreeFlags&14680064),Q!==null?D=Ks(Q,D):(D=Ni(D,V,p,null),D.flags|=2),D.return=a,S.return=a,S.sibling=D,a.child=S,S=D,D=a.child,V=i.child.memoizedState,V=V===null?Wh(p):{baseLanes:V.baseLanes|p,cachePool:null,transitions:V.transitions},D.memoizedState=V,D.childLanes=i.childLanes&~p,a.memoizedState=Hh,S}return D=i.child,i=D.sibling,S=Ks(D,{mode:"visible",children:S.children}),(a.mode&1)===0&&(S.lanes=p),S.return=a,S.sibling=null,i!==null&&(p=a.deletions,p===null?(a.deletions=[i],a.flags|=16):p.push(i)),a.child=S,a.memoizedState=null,S}function Vh(i,a){return a=Ic({mode:"visible",children:a},i.mode,0,null),a.return=i,i.child=a}function Sc(i,a,p,S){return S!==null&&xh(S),ao(a,i.child,null,p),i=Vh(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function fE(i,a,p,S,A,D,V){if(p)return a.flags&256?(a.flags&=-257,S=Bh(Error(r(422))),Sc(i,a,V,S)):a.memoizedState!==null?(a.child=i.child,a.flags|=128,null):(D=S.fallback,A=a.mode,S=Ic({mode:"visible",children:S.children},A,0,null),D=Ni(D,A,V,null),D.flags|=2,S.return=a,D.return=a,S.sibling=D,a.child=S,(a.mode&1)!==0&&ao(a,i.child,null,V),a.child.memoizedState=Wh(V),a.memoizedState=Hh,D);if((a.mode&1)===0)return Sc(i,a,V,null);if(A.data==="$!"){if(S=A.nextSibling&&A.nextSibling.dataset,S)var Q=S.dgst;return S=Q,D=Error(r(419)),S=Bh(D,S,void 0),Sc(i,a,V,S)}if(Q=(V&i.childLanes)!==0,zr||Q){if(S=dr,S!==null){switch(V&-V){case 4:A=2;break;case 16:A=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:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(S.suspendedLanes|V))!==0?0:A,A!==0&&A!==D.retryLane&&(D.retryLane=A,ms(i,A),Ln(S,i,A,-1))}return af(),S=Bh(Error(r(421))),Sc(i,a,V,S)}return A.data==="$?"?(a.flags|=128,a.child=i.child,a=jE.bind(null,i),A._reactRetry=a,null):(i=D.treeContext,tn=Is(A.nextSibling),en=a,Ot=!0,Tn=null,i!==null&&(mn[pn++]=hs,mn[pn++]=fs,mn[pn++]=vi,hs=i.id,fs=i.overflow,vi=a),a=Vh(a,S.children),a.flags|=4096,a)}function Q0(i,a,p){i.lanes|=a;var S=i.alternate;S!==null&&(S.lanes|=a),wh(i.return,a,p)}function Uh(i,a,p,S,A){var D=i.memoizedState;D===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:S,tail:p,tailMode:A}:(D.isBackwards=a,D.rendering=null,D.renderingStartTime=0,D.last=S,D.tail=p,D.tailMode=A)}function Z0(i,a,p){var S=a.pendingProps,A=S.revealOrder,D=S.tail;if(Lr(i,a,S.children,p),S=$t.current,(S&2)!==0)S=S&1|2,a.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Q0(i,p,a);else if(i.tag===19)Q0(i,p,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}S&=1}if(Nt($t,S),(a.mode&1)===0)a.memoizedState=null;else switch(A){case"forwards":for(p=a.child,A=null;p!==null;)i=p.alternate,i!==null&&gc(i)===null&&(A=p),p=p.sibling;p=A,p===null?(A=a.child,a.child=null):(A=p.sibling,p.sibling=null),Uh(a,!1,A,p,D);break;case"backwards":for(p=null,A=a.child,a.child=null;A!==null;){if(i=A.alternate,i!==null&&gc(i)===null){a.child=A;break}i=A.sibling,A.sibling=p,p=A,A=i}Uh(a,!0,p,null,D);break;case"together":Uh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Cc(i,a){(a.mode&1)===0&&i!==null&&(i.alternate=null,a.alternate=null,a.flags|=2)}function gs(i,a,p){if(i!==null&&(a.dependencies=i.dependencies),Si|=a.lanes,(p&a.childLanes)===0)return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,p=Ks(i,i.pendingProps),a.child=p,p.return=a;i.sibling!==null;)i=i.sibling,p=p.sibling=Ks(i,i.pendingProps),p.return=a;p.sibling=null}return a.child}function mE(i,a,p){switch(a.tag){case 3:Y0(a),oo();break;case 5:f0(a);break;case 1:$r(a.type)&&oc(a);break;case 4:Ch(a,a.stateNode.containerInfo);break;case 10:var S=a.type._context,A=a.memoizedProps.value;Nt(hc,S._currentValue),S._currentValue=A;break;case 13:if(S=a.memoizedState,S!==null)return S.dehydrated!==null?(Nt($t,$t.current&1),a.flags|=128,null):(p&a.child.childLanes)!==0?J0(i,a,p):(Nt($t,$t.current&1),i=gs(i,a,p),i!==null?i.sibling:null);Nt($t,$t.current&1);break;case 19:if(S=(p&a.childLanes)!==0,(i.flags&128)!==0){if(S)return Z0(i,a,p);a.flags|=128}if(A=a.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Nt($t,$t.current),S)break;return null;case 22:case 23:return a.lanes=0,G0(i,a,p)}return gs(i,a,p)}var ev,Gh,tv,rv;ev=function(i,a){for(var p=a.child;p!==null;){if(p.tag===5||p.tag===6)i.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===a)break;for(;p.sibling===null;){if(p.return===null||p.return===a)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},Gh=function(){},tv=function(i,a,p,S){var A=i.memoizedProps;if(A!==S){i=a.stateNode,wi(Un.current);var D=null;switch(p){case"input":A=Oe(i,A),S=Oe(i,S),D=[];break;case"select":A=M({},A,{value:void 0}),S=M({},S,{value:void 0}),D=[];break;case"textarea":A=ge(i,A),S=ge(i,S),D=[];break;default:typeof A.onClick!="function"&&typeof S.onClick=="function"&&(i.onclick=nc)}et(p,S);var V;p=null;for(he in A)if(!S.hasOwnProperty(he)&&A.hasOwnProperty(he)&&A[he]!=null)if(he==="style"){var Q=A[he];for(V in Q)Q.hasOwnProperty(V)&&(p||(p={}),p[V]="")}else he!=="dangerouslySetInnerHTML"&&he!=="children"&&he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&he!=="autoFocus"&&(o.hasOwnProperty(he)?D||(D=[]):(D=D||[]).push(he,null));for(he in S){var re=S[he];if(Q=A!=null?A[he]:void 0,S.hasOwnProperty(he)&&re!==Q&&(re!=null||Q!=null))if(he==="style")if(Q){for(V in Q)!Q.hasOwnProperty(V)||re&&re.hasOwnProperty(V)||(p||(p={}),p[V]="");for(V in re)re.hasOwnProperty(V)&&Q[V]!==re[V]&&(p||(p={}),p[V]=re[V])}else p||(D||(D=[]),D.push(he,p)),p=re;else he==="dangerouslySetInnerHTML"?(re=re?re.__html:void 0,Q=Q?Q.__html:void 0,re!=null&&Q!==re&&(D=D||[]).push(he,re)):he==="children"?typeof re!="string"&&typeof re!="number"||(D=D||[]).push(he,""+re):he!=="suppressContentEditableWarning"&&he!=="suppressHydrationWarning"&&(o.hasOwnProperty(he)?(re!=null&&he==="onScroll"&&Mt("scroll",i),D||Q===re||(D=[])):(D=D||[]).push(he,re))}p&&(D=D||[]).push("style",p);var he=D;(a.updateQueue=he)&&(a.flags|=4)}},rv=function(i,a,p,S){p!==S&&(a.flags|=4)};function Ea(i,a){if(!Ot)switch(i.tailMode){case"hidden":a=i.tail;for(var p=null;a!==null;)a.alternate!==null&&(p=a),a=a.sibling;p===null?i.tail=null:p.sibling=null;break;case"collapsed":p=i.tail;for(var S=null;p!==null;)p.alternate!==null&&(S=p),p=p.sibling;S===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:S.sibling=null}}function Ar(i){var a=i.alternate!==null&&i.alternate.child===i.child,p=0,S=0;if(a)for(var A=i.child;A!==null;)p|=A.lanes|A.childLanes,S|=A.subtreeFlags&14680064,S|=A.flags&14680064,A.return=i,A=A.sibling;else for(A=i.child;A!==null;)p|=A.lanes|A.childLanes,S|=A.subtreeFlags,S|=A.flags,A.return=i,A=A.sibling;return i.subtreeFlags|=S,i.childLanes=p,a}function pE(i,a,p){var S=a.pendingProps;switch(mh(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ar(a),null;case 1:return $r(a.type)&&ic(),Ar(a),null;case 3:return S=a.stateNode,uo(),Dt(Fr),Dt(Er),Nh(),S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),(i===null||i.child===null)&&(uc(a)?a.flags|=4:i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Tn!==null&&(nf(Tn),Tn=null))),Gh(i,a),Ar(a),null;case 5:kh(a);var A=wi(Sa.current);if(p=a.type,i!==null&&a.stateNode!=null)tv(i,a,p,S,A),i.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!S){if(a.stateNode===null)throw Error(r(166));return Ar(a),null}if(i=wi(Un.current),uc(a)){S=a.stateNode,p=a.type;var D=a.memoizedProps;switch(S[Vn]=a,S[va]=D,i=(a.mode&1)!==0,p){case"dialog":Mt("cancel",S),Mt("close",S);break;case"iframe":case"object":case"embed":Mt("load",S);break;case"video":case"audio":for(A=0;A<pa.length;A++)Mt(pa[A],S);break;case"source":Mt("error",S);break;case"img":case"image":case"link":Mt("error",S),Mt("load",S);break;case"details":Mt("toggle",S);break;case"input":Ve(S,D),Mt("invalid",S);break;case"select":S._wrapperState={wasMultiple:!!D.multiple},Mt("invalid",S);break;case"textarea":Me(S,D),Mt("invalid",S)}et(p,D),A=null;for(var V in D)if(D.hasOwnProperty(V)){var Q=D[V];V==="children"?typeof Q=="string"?S.textContent!==Q&&(D.suppressHydrationWarning!==!0&&rc(S.textContent,Q,i),A=["children",Q]):typeof Q=="number"&&S.textContent!==""+Q&&(D.suppressHydrationWarning!==!0&&rc(S.textContent,Q,i),A=["children",""+Q]):o.hasOwnProperty(V)&&Q!=null&&V==="onScroll"&&Mt("scroll",S)}switch(p){case"input":J(S),De(S,D,!0);break;case"textarea":J(S),Rt(S);break;case"select":case"option":break;default:typeof D.onClick=="function"&&(S.onclick=nc)}S=A,a.updateQueue=S,S!==null&&(a.flags|=4)}else{V=A.nodeType===9?A:A.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=pe(p)),i==="http://www.w3.org/1999/xhtml"?p==="script"?(i=V.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof S.is=="string"?i=V.createElement(p,{is:S.is}):(i=V.createElement(p),p==="select"&&(V=i,S.multiple?V.multiple=!0:S.size&&(V.size=S.size))):i=V.createElementNS(i,p),i[Vn]=a,i[va]=S,ev(i,a,!1,!1),a.stateNode=i;e:{switch(V=jt(p,S),p){case"dialog":Mt("cancel",i),Mt("close",i),A=S;break;case"iframe":case"object":case"embed":Mt("load",i),A=S;break;case"video":case"audio":for(A=0;A<pa.length;A++)Mt(pa[A],i);A=S;break;case"source":Mt("error",i),A=S;break;case"img":case"image":case"link":Mt("error",i),Mt("load",i),A=S;break;case"details":Mt("toggle",i),A=S;break;case"input":Ve(i,S),A=Oe(i,S),Mt("invalid",i);break;case"option":A=S;break;case"select":i._wrapperState={wasMultiple:!!S.multiple},A=M({},S,{value:void 0}),Mt("invalid",i);break;case"textarea":Me(i,S),A=ge(i,S),Mt("invalid",i);break;default:A=S}et(p,A),Q=A;for(D in Q)if(Q.hasOwnProperty(D)){var re=Q[D];D==="style"?Le(i,re):D==="dangerouslySetInnerHTML"?(re=re?re.__html:void 0,re!=null&&Ge(i,re)):D==="children"?typeof re=="string"?(p!=="textarea"||re!=="")&&Ke(i,re):typeof re=="number"&&Ke(i,""+re):D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&D!=="autoFocus"&&(o.hasOwnProperty(D)?re!=null&&D==="onScroll"&&Mt("scroll",i):re!=null&&y(i,D,re,V))}switch(p){case"input":J(i),De(i,S,!1);break;case"textarea":J(i),Rt(i);break;case"option":S.value!=null&&i.setAttribute("value",""+H(S.value));break;case"select":i.multiple=!!S.multiple,D=S.value,D!=null?Se(i,!!S.multiple,D,!1):S.defaultValue!=null&&Se(i,!!S.multiple,S.defaultValue,!0);break;default:typeof A.onClick=="function"&&(i.onclick=nc)}switch(p){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}}S&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Ar(a),null;case 6:if(i&&a.stateNode!=null)rv(i,a,i.memoizedProps,S);else{if(typeof S!="string"&&a.stateNode===null)throw Error(r(166));if(p=wi(Sa.current),wi(Un.current),uc(a)){if(S=a.stateNode,p=a.memoizedProps,S[Vn]=a,(D=S.nodeValue!==p)&&(i=en,i!==null))switch(i.tag){case 3:rc(S.nodeValue,p,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&rc(S.nodeValue,p,(i.mode&1)!==0)}D&&(a.flags|=4)}else S=(p.nodeType===9?p:p.ownerDocument).createTextNode(S),S[Vn]=a,a.stateNode=S}return Ar(a),null;case 13:if(Dt($t),S=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Ot&&tn!==null&&(a.mode&1)!==0&&(a.flags&128)===0)i0(),oo(),a.flags|=98560,D=!1;else if(D=uc(a),S!==null&&S.dehydrated!==null){if(i===null){if(!D)throw Error(r(318));if(D=a.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(r(317));D[Vn]=a}else oo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ar(a),D=!1}else Tn!==null&&(nf(Tn),Tn=null),D=!0;if(!D)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=p,a):(S=S!==null,S!==(i!==null&&i.memoizedState!==null)&&S&&(a.child.flags|=8192,(a.mode&1)!==0&&(i===null||($t.current&1)!==0?ir===0&&(ir=3):af())),a.updateQueue!==null&&(a.flags|=4),Ar(a),null);case 4:return uo(),Gh(i,a),i===null&&ga(a.stateNode.containerInfo),Ar(a),null;case 10:return bh(a.type._context),Ar(a),null;case 17:return $r(a.type)&&ic(),Ar(a),null;case 19:if(Dt($t),D=a.memoizedState,D===null)return Ar(a),null;if(S=(a.flags&128)!==0,V=D.rendering,V===null)if(S)Ea(D,!1);else{if(ir!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(V=gc(i),V!==null){for(a.flags|=128,Ea(D,!1),S=V.updateQueue,S!==null&&(a.updateQueue=S,a.flags|=4),a.subtreeFlags=0,S=p,p=a.child;p!==null;)D=p,i=S,D.flags&=14680066,V=D.alternate,V===null?(D.childLanes=0,D.lanes=i,D.child=null,D.subtreeFlags=0,D.memoizedProps=null,D.memoizedState=null,D.updateQueue=null,D.dependencies=null,D.stateNode=null):(D.childLanes=V.childLanes,D.lanes=V.lanes,D.child=V.child,D.subtreeFlags=0,D.deletions=null,D.memoizedProps=V.memoizedProps,D.memoizedState=V.memoizedState,D.updateQueue=V.updateQueue,D.type=V.type,i=V.dependencies,D.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),p=p.sibling;return Nt($t,$t.current&1|2),a.child}i=i.sibling}D.tail!==null&&Yt()>po&&(a.flags|=128,S=!0,Ea(D,!1),a.lanes=4194304)}else{if(!S)if(i=gc(V),i!==null){if(a.flags|=128,S=!0,p=i.updateQueue,p!==null&&(a.updateQueue=p,a.flags|=4),Ea(D,!0),D.tail===null&&D.tailMode==="hidden"&&!V.alternate&&!Ot)return Ar(a),null}else 2*Yt()-D.renderingStartTime>po&&p!==1073741824&&(a.flags|=128,S=!0,Ea(D,!1),a.lanes=4194304);D.isBackwards?(V.sibling=a.child,a.child=V):(p=D.last,p!==null?p.sibling=V:a.child=V,D.last=V)}return D.tail!==null?(a=D.tail,D.rendering=a,D.tail=a.sibling,D.renderingStartTime=Yt(),a.sibling=null,p=$t.current,Nt($t,S?p&1|2:p&1),a):(Ar(a),null);case 22:case 23:return of(),S=a.memoizedState!==null,i!==null&&i.memoizedState!==null!==S&&(a.flags|=8192),S&&(a.mode&1)!==0?(rn&1073741824)!==0&&(Ar(a),a.subtreeFlags&6&&(a.flags|=8192)):Ar(a),null;case 24:return null;case 25:return null}throw Error(r(156,a.tag))}function gE(i,a){switch(mh(a),a.tag){case 1:return $r(a.type)&&ic(),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return uo(),Dt(Fr),Dt(Er),Nh(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 5:return kh(a),null;case 13:if(Dt($t),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));oo()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return Dt($t),null;case 4:return uo(),null;case 10:return bh(a.type._context),null;case 22:case 23:return of(),null;case 24:return null;default:return null}}var kc=!1,Tr=!1,xE=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function fo(i,a){var p=i.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(S){Ut(i,a,S)}else p.current=null}function Kh(i,a,p){try{p()}catch(S){Ut(i,a,S)}}var nv=!1;function vE(i,a){if(ih=Ul,i=Lx(),Jd(i)){if("selectionStart"in i)var p={start:i.selectionStart,end:i.selectionEnd};else e:{p=(p=i.ownerDocument)&&p.defaultView||window;var S=p.getSelection&&p.getSelection();if(S&&S.rangeCount!==0){p=S.anchorNode;var A=S.anchorOffset,D=S.focusNode;S=S.focusOffset;try{p.nodeType,D.nodeType}catch{p=null;break e}var V=0,Q=-1,re=-1,he=0,ve=0,we=i,xe=null;t:for(;;){for(var Ie;we!==p||A!==0&&we.nodeType!==3||(Q=V+A),we!==D||S!==0&&we.nodeType!==3||(re=V+S),we.nodeType===3&&(V+=we.nodeValue.length),(Ie=we.firstChild)!==null;)xe=we,we=Ie;for(;;){if(we===i)break t;if(xe===p&&++he===A&&(Q=V),xe===D&&++ve===S&&(re=V),(Ie=we.nextSibling)!==null)break;we=xe,xe=we.parentNode}we=Ie}p=Q===-1||re===-1?null:{start:Q,end:re}}else p=null}p=p||{start:0,end:0}}else p=null;for(oh={focusedElem:i,selectionRange:p},Ul=!1,Fe=a;Fe!==null;)if(a=Fe,i=a.child,(a.subtreeFlags&1028)!==0&&i!==null)i.return=a,Fe=i;else for(;Fe!==null;){a=Fe;try{var $e=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if($e!==null){var We=$e.memoizedProps,Xt=$e.memoizedState,ce=a.stateNode,se=ce.getSnapshotBeforeUpdate(a.elementType===a.type?We:Rn(a.type,We),Xt);ce.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var ue=a.stateNode.containerInfo;ue.nodeType===1?ue.textContent="":ue.nodeType===9&&ue.documentElement&&ue.removeChild(ue.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Ne){Ut(a,a.return,Ne)}if(i=a.sibling,i!==null){i.return=a.return,Fe=i;break}Fe=a.return}return $e=nv,nv=!1,$e}function Pa(i,a,p){var S=a.updateQueue;if(S=S!==null?S.lastEffect:null,S!==null){var A=S=S.next;do{if((A.tag&i)===i){var D=A.destroy;A.destroy=void 0,D!==void 0&&Kh(a,p,D)}A=A.next}while(A!==S)}}function jc(i,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var p=a=a.next;do{if((p.tag&i)===i){var S=p.create;p.destroy=S()}p=p.next}while(p!==a)}}function qh(i){var a=i.ref;if(a!==null){var p=i.stateNode;switch(i.tag){case 5:i=p;break;default:i=p}typeof a=="function"?a(i):a.current=i}}function sv(i){var a=i.alternate;a!==null&&(i.alternate=null,sv(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&(delete a[Vn],delete a[va],delete a[uh],delete a[eE],delete a[tE])),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 iv(i){return i.tag===5||i.tag===3||i.tag===4}function ov(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||iv(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 Yh(i,a,p){var S=i.tag;if(S===5||S===6)i=i.stateNode,a?p.nodeType===8?p.parentNode.insertBefore(i,a):p.insertBefore(i,a):(p.nodeType===8?(a=p.parentNode,a.insertBefore(i,p)):(a=p,a.appendChild(i)),p=p._reactRootContainer,p!=null||a.onclick!==null||(a.onclick=nc));else if(S!==4&&(i=i.child,i!==null))for(Yh(i,a,p),i=i.sibling;i!==null;)Yh(i,a,p),i=i.sibling}function Xh(i,a,p){var S=i.tag;if(S===5||S===6)i=i.stateNode,a?p.insertBefore(i,a):p.appendChild(i);else if(S!==4&&(i=i.child,i!==null))for(Xh(i,a,p),i=i.sibling;i!==null;)Xh(i,a,p),i=i.sibling}var vr=null,Mn=!1;function Hs(i,a,p){for(p=p.child;p!==null;)av(i,a,p),p=p.sibling}function av(i,a,p){if(Wn&&typeof Wn.onCommitFiberUnmount=="function")try{Wn.onCommitFiberUnmount(Fl,p)}catch{}switch(p.tag){case 5:Tr||fo(p,a);case 6:var S=vr,A=Mn;vr=null,Hs(i,a,p),vr=S,Mn=A,vr!==null&&(Mn?(i=vr,p=p.stateNode,i.nodeType===8?i.parentNode.removeChild(p):i.removeChild(p)):vr.removeChild(p.stateNode));break;case 18:vr!==null&&(Mn?(i=vr,p=p.stateNode,i.nodeType===8?ch(i.parentNode,p):i.nodeType===1&&ch(i,p),aa(i)):ch(vr,p.stateNode));break;case 4:S=vr,A=Mn,vr=p.stateNode.containerInfo,Mn=!0,Hs(i,a,p),vr=S,Mn=A;break;case 0:case 11:case 14:case 15:if(!Tr&&(S=p.updateQueue,S!==null&&(S=S.lastEffect,S!==null))){A=S=S.next;do{var D=A,V=D.destroy;D=D.tag,V!==void 0&&((D&2)!==0||(D&4)!==0)&&Kh(p,a,V),A=A.next}while(A!==S)}Hs(i,a,p);break;case 1:if(!Tr&&(fo(p,a),S=p.stateNode,typeof S.componentWillUnmount=="function"))try{S.props=p.memoizedProps,S.state=p.memoizedState,S.componentWillUnmount()}catch(Q){Ut(p,a,Q)}Hs(i,a,p);break;case 21:Hs(i,a,p);break;case 22:p.mode&1?(Tr=(S=Tr)||p.memoizedState!==null,Hs(i,a,p),Tr=S):Hs(i,a,p);break;default:Hs(i,a,p)}}function lv(i){var a=i.updateQueue;if(a!==null){i.updateQueue=null;var p=i.stateNode;p===null&&(p=i.stateNode=new xE),a.forEach(function(S){var A=NE.bind(null,i,S);p.has(S)||(p.add(S),S.then(A,A))})}}function Dn(i,a){var p=a.deletions;if(p!==null)for(var S=0;S<p.length;S++){var A=p[S];try{var D=i,V=a,Q=V;e:for(;Q!==null;){switch(Q.tag){case 5:vr=Q.stateNode,Mn=!1;break e;case 3:vr=Q.stateNode.containerInfo,Mn=!0;break e;case 4:vr=Q.stateNode.containerInfo,Mn=!0;break e}Q=Q.return}if(vr===null)throw Error(r(160));av(D,V,A),vr=null,Mn=!1;var re=A.alternate;re!==null&&(re.return=null),A.return=null}catch(he){Ut(A,a,he)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)cv(a,i),a=a.sibling}function cv(i,a){var p=i.alternate,S=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Dn(a,i),Kn(i),S&4){try{Pa(3,i,i.return),jc(3,i)}catch(We){Ut(i,i.return,We)}try{Pa(5,i,i.return)}catch(We){Ut(i,i.return,We)}}break;case 1:Dn(a,i),Kn(i),S&512&&p!==null&&fo(p,p.return);break;case 5:if(Dn(a,i),Kn(i),S&512&&p!==null&&fo(p,p.return),i.flags&32){var A=i.stateNode;try{Ke(A,"")}catch(We){Ut(i,i.return,We)}}if(S&4&&(A=i.stateNode,A!=null)){var D=i.memoizedProps,V=p!==null?p.memoizedProps:D,Q=i.type,re=i.updateQueue;if(i.updateQueue=null,re!==null)try{Q==="input"&&D.type==="radio"&&D.name!=null&&te(A,D),jt(Q,V);var he=jt(Q,D);for(V=0;V<re.length;V+=2){var ve=re[V],we=re[V+1];ve==="style"?Le(A,we):ve==="dangerouslySetInnerHTML"?Ge(A,we):ve==="children"?Ke(A,we):y(A,ve,we,he)}switch(Q){case"input":de(A,D);break;case"textarea":ht(A,D);break;case"select":var xe=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!D.multiple;var Ie=D.value;Ie!=null?Se(A,!!D.multiple,Ie,!1):xe!==!!D.multiple&&(D.defaultValue!=null?Se(A,!!D.multiple,D.defaultValue,!0):Se(A,!!D.multiple,D.multiple?[]:"",!1))}A[va]=D}catch(We){Ut(i,i.return,We)}}break;case 6:if(Dn(a,i),Kn(i),S&4){if(i.stateNode===null)throw Error(r(162));A=i.stateNode,D=i.memoizedProps;try{A.nodeValue=D}catch(We){Ut(i,i.return,We)}}break;case 3:if(Dn(a,i),Kn(i),S&4&&p!==null&&p.memoizedState.isDehydrated)try{aa(a.containerInfo)}catch(We){Ut(i,i.return,We)}break;case 4:Dn(a,i),Kn(i);break;case 13:Dn(a,i),Kn(i),A=i.child,A.flags&8192&&(D=A.memoizedState!==null,A.stateNode.isHidden=D,!D||A.alternate!==null&&A.alternate.memoizedState!==null||(Zh=Yt())),S&4&&lv(i);break;case 22:if(ve=p!==null&&p.memoizedState!==null,i.mode&1?(Tr=(he=Tr)||ve,Dn(a,i),Tr=he):Dn(a,i),Kn(i),S&8192){if(he=i.memoizedState!==null,(i.stateNode.isHidden=he)&&!ve&&(i.mode&1)!==0)for(Fe=i,ve=i.child;ve!==null;){for(we=Fe=ve;Fe!==null;){switch(xe=Fe,Ie=xe.child,xe.tag){case 0:case 11:case 14:case 15:Pa(4,xe,xe.return);break;case 1:fo(xe,xe.return);var $e=xe.stateNode;if(typeof $e.componentWillUnmount=="function"){S=xe,p=xe.return;try{a=S,$e.props=a.memoizedProps,$e.state=a.memoizedState,$e.componentWillUnmount()}catch(We){Ut(S,p,We)}}break;case 5:fo(xe,xe.return);break;case 22:if(xe.memoizedState!==null){hv(we);continue}}Ie!==null?(Ie.return=xe,Fe=Ie):hv(we)}ve=ve.sibling}e:for(ve=null,we=i;;){if(we.tag===5){if(ve===null){ve=we;try{A=we.stateNode,he?(D=A.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none"):(Q=we.stateNode,re=we.memoizedProps.style,V=re!=null&&re.hasOwnProperty("display")?re.display:null,Q.style.display=Pe("display",V))}catch(We){Ut(i,i.return,We)}}}else if(we.tag===6){if(ve===null)try{we.stateNode.nodeValue=he?"":we.memoizedProps}catch(We){Ut(i,i.return,We)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===i)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===i)break e;for(;we.sibling===null;){if(we.return===null||we.return===i)break e;ve===we&&(ve=null),we=we.return}ve===we&&(ve=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:Dn(a,i),Kn(i),S&4&&lv(i);break;case 21:break;default:Dn(a,i),Kn(i)}}function Kn(i){var a=i.flags;if(a&2){try{e:{for(var p=i.return;p!==null;){if(iv(p)){var S=p;break e}p=p.return}throw Error(r(160))}switch(S.tag){case 5:var A=S.stateNode;S.flags&32&&(Ke(A,""),S.flags&=-33);var D=ov(i);Xh(i,D,A);break;case 3:case 4:var V=S.stateNode.containerInfo,Q=ov(i);Yh(i,Q,V);break;default:throw Error(r(161))}}catch(re){Ut(i,i.return,re)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function yE(i,a,p){Fe=i,uv(i)}function uv(i,a,p){for(var S=(i.mode&1)!==0;Fe!==null;){var A=Fe,D=A.child;if(A.tag===22&&S){var V=A.memoizedState!==null||kc;if(!V){var Q=A.alternate,re=Q!==null&&Q.memoizedState!==null||Tr;Q=kc;var he=Tr;if(kc=V,(Tr=re)&&!he)for(Fe=A;Fe!==null;)V=Fe,re=V.child,V.tag===22&&V.memoizedState!==null?fv(A):re!==null?(re.return=V,Fe=re):fv(A);for(;D!==null;)Fe=D,uv(D),D=D.sibling;Fe=A,kc=Q,Tr=he}dv(i)}else(A.subtreeFlags&8772)!==0&&D!==null?(D.return=A,Fe=D):dv(i)}}function dv(i){for(;Fe!==null;){var a=Fe;if((a.flags&8772)!==0){var p=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Tr||jc(5,a);break;case 1:var S=a.stateNode;if(a.flags&4&&!Tr)if(p===null)S.componentDidMount();else{var A=a.elementType===a.type?p.memoizedProps:Rn(a.type,p.memoizedProps);S.componentDidUpdate(A,p.memoizedState,S.__reactInternalSnapshotBeforeUpdate)}var D=a.updateQueue;D!==null&&h0(a,D,S);break;case 3:var V=a.updateQueue;if(V!==null){if(p=null,a.child!==null)switch(a.child.tag){case 5:p=a.child.stateNode;break;case 1:p=a.child.stateNode}h0(a,V,p)}break;case 5:var Q=a.stateNode;if(p===null&&a.flags&4){p=Q;var re=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":re.autoFocus&&p.focus();break;case"img":re.src&&(p.src=re.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var he=a.alternate;if(he!==null){var ve=he.memoizedState;if(ve!==null){var we=ve.dehydrated;we!==null&&aa(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Tr||a.flags&512&&qh(a)}catch(xe){Ut(a,a.return,xe)}}if(a===i){Fe=null;break}if(p=a.sibling,p!==null){p.return=a.return,Fe=p;break}Fe=a.return}}function hv(i){for(;Fe!==null;){var a=Fe;if(a===i){Fe=null;break}var p=a.sibling;if(p!==null){p.return=a.return,Fe=p;break}Fe=a.return}}function fv(i){for(;Fe!==null;){var a=Fe;try{switch(a.tag){case 0:case 11:case 15:var p=a.return;try{jc(4,a)}catch(re){Ut(a,p,re)}break;case 1:var S=a.stateNode;if(typeof S.componentDidMount=="function"){var A=a.return;try{S.componentDidMount()}catch(re){Ut(a,A,re)}}var D=a.return;try{qh(a)}catch(re){Ut(a,D,re)}break;case 5:var V=a.return;try{qh(a)}catch(re){Ut(a,V,re)}}}catch(re){Ut(a,a.return,re)}if(a===i){Fe=null;break}var Q=a.sibling;if(Q!==null){Q.return=a.return,Fe=Q;break}Fe=a.return}}var bE=Math.ceil,Nc=j.ReactCurrentDispatcher,Jh=j.ReactCurrentOwner,vn=j.ReactCurrentBatchConfig,mt=0,dr=null,Zt=null,yr=0,rn=0,mo=Os(0),ir=0,Aa=null,Si=0,Ec=0,Qh=0,Ta=null,Hr=null,Zh=0,po=1/0,xs=null,Pc=!1,ef=null,Ws=null,Ac=!1,Vs=null,Tc=0,Ra=0,tf=null,Rc=-1,Mc=0;function Ir(){return(mt&6)!==0?Yt():Rc!==-1?Rc:Rc=Yt()}function Us(i){return(i.mode&1)===0?1:(mt&2)!==0&&yr!==0?yr&-yr:nE.transition!==null?(Mc===0&&(Mc=ox()),Mc):(i=_t,i!==0||(i=window.event,i=i===void 0?16:px(i.type)),i)}function Ln(i,a,p,S){if(50<Ra)throw Ra=0,tf=null,Error(r(185));ra(i,p,S),((mt&2)===0||i!==dr)&&(i===dr&&((mt&2)===0&&(Ec|=p),ir===4&&Gs(i,yr)),Wr(i,S),p===1&&mt===0&&(a.mode&1)===0&&(po=Yt()+500,ac&&Fs()))}function Wr(i,a){var p=i.callbackNode;nN(i,a);var S=Hl(i,i===dr?yr:0);if(S===0)p!==null&&nx(p),i.callbackNode=null,i.callbackPriority=0;else if(a=S&-S,i.callbackPriority!==a){if(p!=null&&nx(p),a===1)i.tag===0?rE(pv.bind(null,i)):e0(pv.bind(null,i)),QN(function(){(mt&6)===0&&Fs()}),p=null;else{switch(ax(S)){case 1:p=Dd;break;case 4:p=sx;break;case 16:p=Bl;break;case 536870912:p=ix;break;default:p=Bl}p=Sv(p,mv.bind(null,i))}i.callbackPriority=a,i.callbackNode=p}}function mv(i,a){if(Rc=-1,Mc=0,(mt&6)!==0)throw Error(r(327));var p=i.callbackNode;if(go()&&i.callbackNode!==p)return null;var S=Hl(i,i===dr?yr:0);if(S===0)return null;if((S&30)!==0||(S&i.expiredLanes)!==0||a)a=Dc(i,S);else{a=S;var A=mt;mt|=2;var D=xv();(dr!==i||yr!==a)&&(xs=null,po=Yt()+500,ki(i,a));do try{SE();break}catch(Q){gv(i,Q)}while(!0);yh(),Nc.current=D,mt=A,Zt!==null?a=0:(dr=null,yr=0,a=ir)}if(a!==0){if(a===2&&(A=Ld(i),A!==0&&(S=A,a=rf(i,A))),a===1)throw p=Aa,ki(i,0),Gs(i,S),Wr(i,Yt()),p;if(a===6)Gs(i,S);else{if(A=i.current.alternate,(S&30)===0&&!wE(A)&&(a=Dc(i,S),a===2&&(D=Ld(i),D!==0&&(S=D,a=rf(i,D))),a===1))throw p=Aa,ki(i,0),Gs(i,S),Wr(i,Yt()),p;switch(i.finishedWork=A,i.finishedLanes=S,a){case 0:case 1:throw Error(r(345));case 2:ji(i,Hr,xs);break;case 3:if(Gs(i,S),(S&130023424)===S&&(a=Zh+500-Yt(),10<a)){if(Hl(i,0)!==0)break;if(A=i.suspendedLanes,(A&S)!==S){Ir(),i.pingedLanes|=i.suspendedLanes&A;break}i.timeoutHandle=lh(ji.bind(null,i,Hr,xs),a);break}ji(i,Hr,xs);break;case 4:if(Gs(i,S),(S&4194240)===S)break;for(a=i.eventTimes,A=-1;0<S;){var V=31-Pn(S);D=1<<V,V=a[V],V>A&&(A=V),S&=~D}if(S=A,S=Yt()-S,S=(120>S?120:480>S?480:1080>S?1080:1920>S?1920:3e3>S?3e3:4320>S?4320:1960*bE(S/1960))-S,10<S){i.timeoutHandle=lh(ji.bind(null,i,Hr,xs),S);break}ji(i,Hr,xs);break;case 5:ji(i,Hr,xs);break;default:throw Error(r(329))}}}return Wr(i,Yt()),i.callbackNode===p?mv.bind(null,i):null}function rf(i,a){var p=Ta;return i.current.memoizedState.isDehydrated&&(ki(i,a).flags|=256),i=Dc(i,a),i!==2&&(a=Hr,Hr=p,a!==null&&nf(a)),i}function nf(i){Hr===null?Hr=i:Hr.push.apply(Hr,i)}function wE(i){for(var a=i;;){if(a.flags&16384){var p=a.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var S=0;S<p.length;S++){var A=p[S],D=A.getSnapshot;A=A.value;try{if(!An(D(),A))return!1}catch{return!1}}}if(p=a.child,a.subtreeFlags&16384&&p!==null)p.return=a,a=p;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Gs(i,a){for(a&=~Qh,a&=~Ec,i.suspendedLanes|=a,i.pingedLanes&=~a,i=i.expirationTimes;0<a;){var p=31-Pn(a),S=1<<p;i[p]=-1,a&=~S}}function pv(i){if((mt&6)!==0)throw Error(r(327));go();var a=Hl(i,0);if((a&1)===0)return Wr(i,Yt()),null;var p=Dc(i,a);if(i.tag!==0&&p===2){var S=Ld(i);S!==0&&(a=S,p=rf(i,S))}if(p===1)throw p=Aa,ki(i,0),Gs(i,a),Wr(i,Yt()),p;if(p===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=a,ji(i,Hr,xs),Wr(i,Yt()),null}function sf(i,a){var p=mt;mt|=1;try{return i(a)}finally{mt=p,mt===0&&(po=Yt()+500,ac&&Fs())}}function Ci(i){Vs!==null&&Vs.tag===0&&(mt&6)===0&&go();var a=mt;mt|=1;var p=vn.transition,S=_t;try{if(vn.transition=null,_t=1,i)return i()}finally{_t=S,vn.transition=p,mt=a,(mt&6)===0&&Fs()}}function of(){rn=mo.current,Dt(mo)}function ki(i,a){i.finishedWork=null,i.finishedLanes=0;var p=i.timeoutHandle;if(p!==-1&&(i.timeoutHandle=-1,JN(p)),Zt!==null)for(p=Zt.return;p!==null;){var S=p;switch(mh(S),S.tag){case 1:S=S.type.childContextTypes,S!=null&&ic();break;case 3:uo(),Dt(Fr),Dt(Er),Nh();break;case 5:kh(S);break;case 4:uo();break;case 13:Dt($t);break;case 19:Dt($t);break;case 10:bh(S.type._context);break;case 22:case 23:of()}p=p.return}if(dr=i,Zt=i=Ks(i.current,null),yr=rn=a,ir=0,Aa=null,Qh=Ec=Si=0,Hr=Ta=null,bi!==null){for(a=0;a<bi.length;a++)if(p=bi[a],S=p.interleaved,S!==null){p.interleaved=null;var A=S.next,D=p.pending;if(D!==null){var V=D.next;D.next=A,S.next=V}p.pending=S}bi=null}return i}function gv(i,a){do{var p=Zt;try{if(yh(),xc.current=wc,vc){for(var S=zt.memoizedState;S!==null;){var A=S.queue;A!==null&&(A.pending=null),S=S.next}vc=!1}if(_i=0,ur=sr=zt=null,Ca=!1,ka=0,Jh.current=null,p===null||p.return===null){ir=1,Aa=a,Zt=null;break}e:{var D=i,V=p.return,Q=p,re=a;if(a=yr,Q.flags|=32768,re!==null&&typeof re=="object"&&typeof re.then=="function"){var he=re,ve=Q,we=ve.tag;if((ve.mode&1)===0&&(we===0||we===11||we===15)){var xe=ve.alternate;xe?(ve.updateQueue=xe.updateQueue,ve.memoizedState=xe.memoizedState,ve.lanes=xe.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var Ie=z0(V);if(Ie!==null){Ie.flags&=-257,H0(Ie,V,Q,D,a),Ie.mode&1&&$0(D,he,a),a=Ie,re=he;var $e=a.updateQueue;if($e===null){var We=new Set;We.add(re),a.updateQueue=We}else $e.add(re);break e}else{if((a&1)===0){$0(D,he,a),af();break e}re=Error(r(426))}}else if(Ot&&Q.mode&1){var Xt=z0(V);if(Xt!==null){(Xt.flags&65536)===0&&(Xt.flags|=256),H0(Xt,V,Q,D,a),xh(ho(re,Q));break e}}D=re=ho(re,Q),ir!==4&&(ir=2),Ta===null?Ta=[D]:Ta.push(D),D=V;do{switch(D.tag){case 3:D.flags|=65536,a&=-a,D.lanes|=a;var ce=B0(D,re,a);d0(D,ce);break e;case 1:Q=re;var se=D.type,ue=D.stateNode;if((D.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||ue!==null&&typeof ue.componentDidCatch=="function"&&(Ws===null||!Ws.has(ue)))){D.flags|=65536,a&=-a,D.lanes|=a;var Ne=F0(D,Q,a);d0(D,Ne);break e}}D=D.return}while(D!==null)}yv(p)}catch(Ue){a=Ue,Zt===p&&p!==null&&(Zt=p=p.return);continue}break}while(!0)}function xv(){var i=Nc.current;return Nc.current=wc,i===null?wc:i}function af(){(ir===0||ir===3||ir===2)&&(ir=4),dr===null||(Si&268435455)===0&&(Ec&268435455)===0||Gs(dr,yr)}function Dc(i,a){var p=mt;mt|=2;var S=xv();(dr!==i||yr!==a)&&(xs=null,ki(i,a));do try{_E();break}catch(A){gv(i,A)}while(!0);if(yh(),mt=p,Nc.current=S,Zt!==null)throw Error(r(261));return dr=null,yr=0,ir}function _E(){for(;Zt!==null;)vv(Zt)}function SE(){for(;Zt!==null&&!q2();)vv(Zt)}function vv(i){var a=_v(i.alternate,i,rn);i.memoizedProps=i.pendingProps,a===null?yv(i):Zt=a,Jh.current=null}function yv(i){var a=i;do{var p=a.alternate;if(i=a.return,(a.flags&32768)===0){if(p=pE(p,a,rn),p!==null){Zt=p;return}}else{if(p=gE(p,a),p!==null){p.flags&=32767,Zt=p;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{ir=6,Zt=null;return}}if(a=a.sibling,a!==null){Zt=a;return}Zt=a=i}while(a!==null);ir===0&&(ir=5)}function ji(i,a,p){var S=_t,A=vn.transition;try{vn.transition=null,_t=1,CE(i,a,p,S)}finally{vn.transition=A,_t=S}return null}function CE(i,a,p,S){do go();while(Vs!==null);if((mt&6)!==0)throw Error(r(327));p=i.finishedWork;var A=i.finishedLanes;if(p===null)return null;if(i.finishedWork=null,i.finishedLanes=0,p===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var D=p.lanes|p.childLanes;if(sN(i,D),i===dr&&(Zt=dr=null,yr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||Ac||(Ac=!0,Sv(Bl,function(){return go(),null})),D=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||D){D=vn.transition,vn.transition=null;var V=_t;_t=1;var Q=mt;mt|=4,Jh.current=null,vE(i,p),cv(p,i),VN(oh),Ul=!!ih,oh=ih=null,i.current=p,yE(p),Y2(),mt=Q,_t=V,vn.transition=D}else i.current=p;if(Ac&&(Ac=!1,Vs=i,Tc=A),D=i.pendingLanes,D===0&&(Ws=null),Q2(p.stateNode),Wr(i,Yt()),a!==null)for(S=i.onRecoverableError,p=0;p<a.length;p++)A=a[p],S(A.value,{componentStack:A.stack,digest:A.digest});if(Pc)throw Pc=!1,i=ef,ef=null,i;return(Tc&1)!==0&&i.tag!==0&&go(),D=i.pendingLanes,(D&1)!==0?i===tf?Ra++:(Ra=0,tf=i):Ra=0,Fs(),null}function go(){if(Vs!==null){var i=ax(Tc),a=vn.transition,p=_t;try{if(vn.transition=null,_t=16>i?16:i,Vs===null)var S=!1;else{if(i=Vs,Vs=null,Tc=0,(mt&6)!==0)throw Error(r(331));var A=mt;for(mt|=4,Fe=i.current;Fe!==null;){var D=Fe,V=D.child;if((Fe.flags&16)!==0){var Q=D.deletions;if(Q!==null){for(var re=0;re<Q.length;re++){var he=Q[re];for(Fe=he;Fe!==null;){var ve=Fe;switch(ve.tag){case 0:case 11:case 15:Pa(8,ve,D)}var we=ve.child;if(we!==null)we.return=ve,Fe=we;else for(;Fe!==null;){ve=Fe;var xe=ve.sibling,Ie=ve.return;if(sv(ve),ve===he){Fe=null;break}if(xe!==null){xe.return=Ie,Fe=xe;break}Fe=Ie}}}var $e=D.alternate;if($e!==null){var We=$e.child;if(We!==null){$e.child=null;do{var Xt=We.sibling;We.sibling=null,We=Xt}while(We!==null)}}Fe=D}}if((D.subtreeFlags&2064)!==0&&V!==null)V.return=D,Fe=V;else e:for(;Fe!==null;){if(D=Fe,(D.flags&2048)!==0)switch(D.tag){case 0:case 11:case 15:Pa(9,D,D.return)}var ce=D.sibling;if(ce!==null){ce.return=D.return,Fe=ce;break e}Fe=D.return}}var se=i.current;for(Fe=se;Fe!==null;){V=Fe;var ue=V.child;if((V.subtreeFlags&2064)!==0&&ue!==null)ue.return=V,Fe=ue;else e:for(V=se;Fe!==null;){if(Q=Fe,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:jc(9,Q)}}catch(Ue){Ut(Q,Q.return,Ue)}if(Q===V){Fe=null;break e}var Ne=Q.sibling;if(Ne!==null){Ne.return=Q.return,Fe=Ne;break e}Fe=Q.return}}if(mt=A,Fs(),Wn&&typeof Wn.onPostCommitFiberRoot=="function")try{Wn.onPostCommitFiberRoot(Fl,i)}catch{}S=!0}return S}finally{_t=p,vn.transition=a}}return!1}function bv(i,a,p){a=ho(p,a),a=B0(i,a,1),i=zs(i,a,1),a=Ir(),i!==null&&(ra(i,1,a),Wr(i,a))}function Ut(i,a,p){if(i.tag===3)bv(i,i,p);else for(;a!==null;){if(a.tag===3){bv(a,i,p);break}else if(a.tag===1){var S=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Ws===null||!Ws.has(S))){i=ho(p,i),i=F0(a,i,1),a=zs(a,i,1),i=Ir(),a!==null&&(ra(a,1,i),Wr(a,i));break}}a=a.return}}function kE(i,a,p){var S=i.pingCache;S!==null&&S.delete(a),a=Ir(),i.pingedLanes|=i.suspendedLanes&p,dr===i&&(yr&p)===p&&(ir===4||ir===3&&(yr&130023424)===yr&&500>Yt()-Zh?ki(i,0):Qh|=p),Wr(i,a)}function wv(i,a){a===0&&((i.mode&1)===0?a=1:(a=zl,zl<<=1,(zl&130023424)===0&&(zl=4194304)));var p=Ir();i=ms(i,a),i!==null&&(ra(i,a,p),Wr(i,p))}function jE(i){var a=i.memoizedState,p=0;a!==null&&(p=a.retryLane),wv(i,p)}function NE(i,a){var p=0;switch(i.tag){case 13:var S=i.stateNode,A=i.memoizedState;A!==null&&(p=A.retryLane);break;case 19:S=i.stateNode;break;default:throw Error(r(314))}S!==null&&S.delete(a),wv(i,p)}var _v;_v=function(i,a,p){if(i!==null)if(i.memoizedProps!==a.pendingProps||Fr.current)zr=!0;else{if((i.lanes&p)===0&&(a.flags&128)===0)return zr=!1,mE(i,a,p);zr=(i.flags&131072)!==0}else zr=!1,Ot&&(a.flags&1048576)!==0&&t0(a,cc,a.index);switch(a.lanes=0,a.tag){case 2:var S=a.type;Cc(i,a),i=a.pendingProps;var A=no(a,Er.current);co(a,p),A=Ah(null,a,S,i,A,p);var D=Th();return a.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,$r(S)?(D=!0,oc(a)):D=!1,a.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,Sh(a),A.updater=_c,a.stateNode=A,A._reactInternals=a,Oh(a,S,i,p),a=zh(null,a,S,!0,D,p)):(a.tag=0,Ot&&D&&fh(a),Lr(null,a,A,p),a=a.child),a;case 16:S=a.elementType;e:{switch(Cc(i,a),i=a.pendingProps,A=S._init,S=A(S._payload),a.type=S,A=a.tag=PE(S),i=Rn(S,i),A){case 0:a=$h(null,a,S,i,p);break e;case 1:a=q0(null,a,S,i,p);break e;case 11:a=W0(null,a,S,i,p);break e;case 14:a=V0(null,a,S,Rn(S.type,i),p);break e}throw Error(r(306,S,""))}return a;case 0:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),$h(i,a,S,A,p);case 1:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),q0(i,a,S,A,p);case 3:e:{if(Y0(a),i===null)throw Error(r(387));S=a.pendingProps,D=a.memoizedState,A=D.element,u0(i,a),pc(a,S,null,p);var V=a.memoizedState;if(S=V.element,D.isDehydrated)if(D={element:S,isDehydrated:!1,cache:V.cache,pendingSuspenseBoundaries:V.pendingSuspenseBoundaries,transitions:V.transitions},a.updateQueue.baseState=D,a.memoizedState=D,a.flags&256){A=ho(Error(r(423)),a),a=X0(i,a,S,p,A);break e}else if(S!==A){A=ho(Error(r(424)),a),a=X0(i,a,S,p,A);break e}else for(tn=Is(a.stateNode.containerInfo.firstChild),en=a,Ot=!0,Tn=null,p=l0(a,null,S,p),a.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(oo(),S===A){a=gs(i,a,p);break e}Lr(i,a,S,p)}a=a.child}return a;case 5:return f0(a),i===null&&gh(a),S=a.type,A=a.pendingProps,D=i!==null?i.memoizedProps:null,V=A.children,ah(S,A)?V=null:D!==null&&ah(S,D)&&(a.flags|=32),K0(i,a),Lr(i,a,V,p),a.child;case 6:return i===null&&gh(a),null;case 13:return J0(i,a,p);case 4:return Ch(a,a.stateNode.containerInfo),S=a.pendingProps,i===null?a.child=ao(a,null,S,p):Lr(i,a,S,p),a.child;case 11:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),W0(i,a,S,A,p);case 7:return Lr(i,a,a.pendingProps,p),a.child;case 8:return Lr(i,a,a.pendingProps.children,p),a.child;case 12:return Lr(i,a,a.pendingProps.children,p),a.child;case 10:e:{if(S=a.type._context,A=a.pendingProps,D=a.memoizedProps,V=A.value,Nt(hc,S._currentValue),S._currentValue=V,D!==null)if(An(D.value,V)){if(D.children===A.children&&!Fr.current){a=gs(i,a,p);break e}}else for(D=a.child,D!==null&&(D.return=a);D!==null;){var Q=D.dependencies;if(Q!==null){V=D.child;for(var re=Q.firstContext;re!==null;){if(re.context===S){if(D.tag===1){re=ps(-1,p&-p),re.tag=2;var he=D.updateQueue;if(he!==null){he=he.shared;var ve=he.pending;ve===null?re.next=re:(re.next=ve.next,ve.next=re),he.pending=re}}D.lanes|=p,re=D.alternate,re!==null&&(re.lanes|=p),wh(D.return,p,a),Q.lanes|=p;break}re=re.next}}else if(D.tag===10)V=D.type===a.type?null:D.child;else if(D.tag===18){if(V=D.return,V===null)throw Error(r(341));V.lanes|=p,Q=V.alternate,Q!==null&&(Q.lanes|=p),wh(V,p,a),V=D.sibling}else V=D.child;if(V!==null)V.return=D;else for(V=D;V!==null;){if(V===a){V=null;break}if(D=V.sibling,D!==null){D.return=V.return,V=D;break}V=V.return}D=V}Lr(i,a,A.children,p),a=a.child}return a;case 9:return A=a.type,S=a.pendingProps.children,co(a,p),A=gn(A),S=S(A),a.flags|=1,Lr(i,a,S,p),a.child;case 14:return S=a.type,A=Rn(S,a.pendingProps),A=Rn(S.type,A),V0(i,a,S,A,p);case 15:return U0(i,a,a.type,a.pendingProps,p);case 17:return S=a.type,A=a.pendingProps,A=a.elementType===S?A:Rn(S,A),Cc(i,a),a.tag=1,$r(S)?(i=!0,oc(a)):i=!1,co(a,p),I0(a,S,A),Oh(a,S,A,p),zh(null,a,S,!0,i,p);case 19:return Z0(i,a,p);case 22:return G0(i,a,p)}throw Error(r(156,a.tag))};function Sv(i,a){return rx(i,a)}function EE(i,a,p,S){this.tag=i,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(i,a,p,S){return new EE(i,a,p,S)}function lf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function PE(i){if(typeof i=="function")return lf(i)?1:0;if(i!=null){if(i=i.$$typeof,i===$)return 11;if(i===z)return 14}return 2}function Ks(i,a){var p=i.alternate;return p===null?(p=yn(i.tag,a,i.key,i.mode),p.elementType=i.elementType,p.type=i.type,p.stateNode=i.stateNode,p.alternate=i,i.alternate=p):(p.pendingProps=a,p.type=i.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=i.flags&14680064,p.childLanes=i.childLanes,p.lanes=i.lanes,p.child=i.child,p.memoizedProps=i.memoizedProps,p.memoizedState=i.memoizedState,p.updateQueue=i.updateQueue,a=i.dependencies,p.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},p.sibling=i.sibling,p.index=i.index,p.ref=i.ref,p}function Lc(i,a,p,S,A,D){var V=2;if(S=i,typeof i=="function")lf(i)&&(V=1);else if(typeof i=="string")V=5;else e:switch(i){case T:return Ni(p.children,A,D,a);case N:V=8,A|=8;break;case R:return i=yn(12,p,a,A|2),i.elementType=R,i.lanes=D,i;case W:return i=yn(13,p,a,A),i.elementType=W,i.lanes=D,i;case Y:return i=yn(19,p,a,A),i.elementType=Y,i.lanes=D,i;case G:return Ic(p,A,D,a);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case I:V=10;break e;case O:V=9;break e;case $:V=11;break e;case z:V=14;break e;case K:V=16,S=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return a=yn(V,p,a,A),a.elementType=i,a.type=S,a.lanes=D,a}function Ni(i,a,p,S){return i=yn(7,i,S,a),i.lanes=p,i}function Ic(i,a,p,S){return i=yn(22,i,S,a),i.elementType=G,i.lanes=p,i.stateNode={isHidden:!1},i}function cf(i,a,p){return i=yn(6,i,null,a),i.lanes=p,i}function uf(i,a,p){return a=yn(4,i.children!==null?i.children:[],i.key,a),a.lanes=p,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}function AE(i,a,p,S,A){this.tag=a,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=Id(0),this.expirationTimes=Id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Id(0),this.identifierPrefix=S,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function df(i,a,p,S,A,D,V,Q,re){return i=new AE(i,a,p,Q,re),a===1?(a=1,D===!0&&(a|=8)):a=0,D=yn(3,null,null,a),i.current=D,D.stateNode=i,D.memoizedState={element:S,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sh(D),i}function TE(i,a,p){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:S==null?null:""+S,children:i,containerInfo:a,implementation:p}}function Cv(i){if(!i)return Bs;i=i._reactInternals;e:{if(pi(i)!==i||i.tag!==1)throw Error(r(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if($r(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(r(171))}if(i.tag===1){var p=i.type;if($r(p))return Qx(i,p,a)}return a}function kv(i,a,p,S,A,D,V,Q,re){return i=df(p,S,!0,i,A,D,V,Q,re),i.context=Cv(null),p=i.current,S=Ir(),A=Us(p),D=ps(S,A),D.callback=a??null,zs(p,D,A),i.current.lanes=A,ra(i,A,S),Wr(i,S),i}function Oc(i,a,p,S){var A=a.current,D=Ir(),V=Us(A);return p=Cv(p),a.context===null?a.context=p:a.pendingContext=p,a=ps(D,V),a.payload={element:i},S=S===void 0?null:S,S!==null&&(a.callback=S),i=zs(A,a,V),i!==null&&(Ln(i,A,V,D),mc(i,A,V)),V}function Bc(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 jv(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var p=i.retryLane;i.retryLane=p!==0&&p<a?p:a}}function hf(i,a){jv(i,a),(i=i.alternate)&&jv(i,a)}function RE(){return null}var Nv=typeof reportError=="function"?reportError:function(i){console.error(i)};function ff(i){this._internalRoot=i}Fc.prototype.render=ff.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));Oc(i,a,null,null)},Fc.prototype.unmount=ff.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;Ci(function(){Oc(null,i,null,null)}),a[us]=null}};function Fc(i){this._internalRoot=i}Fc.prototype.unstable_scheduleHydration=function(i){if(i){var a=ux();i={blockedOn:null,target:i,priority:a};for(var p=0;p<Ms.length&&a!==0&&a<Ms[p].priority;p++);Ms.splice(p,0,i),p===0&&fx(i)}};function mf(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function $c(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Ev(){}function ME(i,a,p,S,A){if(A){if(typeof S=="function"){var D=S;S=function(){var he=Bc(V);D.call(he)}}var V=kv(a,S,i,0,null,!1,!1,"",Ev);return i._reactRootContainer=V,i[us]=V.current,ga(i.nodeType===8?i.parentNode:i),Ci(),V}for(;A=i.lastChild;)i.removeChild(A);if(typeof S=="function"){var Q=S;S=function(){var he=Bc(re);Q.call(he)}}var re=df(i,0,!1,null,null,!1,!1,"",Ev);return i._reactRootContainer=re,i[us]=re.current,ga(i.nodeType===8?i.parentNode:i),Ci(function(){Oc(a,re,p,S)}),re}function zc(i,a,p,S,A){var D=p._reactRootContainer;if(D){var V=D;if(typeof A=="function"){var Q=A;A=function(){var re=Bc(V);Q.call(re)}}Oc(a,V,i,A)}else V=ME(p,a,i,A,S);return Bc(V)}lx=function(i){switch(i.tag){case 3:var a=i.stateNode;if(a.current.memoizedState.isDehydrated){var p=ta(a.pendingLanes);p!==0&&(Od(a,p|1),Wr(a,Yt()),(mt&6)===0&&(po=Yt()+500,Fs()))}break;case 13:Ci(function(){var S=ms(i,1);if(S!==null){var A=Ir();Ln(S,i,1,A)}}),hf(i,1)}},Bd=function(i){if(i.tag===13){var a=ms(i,134217728);if(a!==null){var p=Ir();Ln(a,i,134217728,p)}hf(i,134217728)}},cx=function(i){if(i.tag===13){var a=Us(i),p=ms(i,a);if(p!==null){var S=Ir();Ln(p,i,a,S)}hf(i,a)}},ux=function(){return _t},dx=function(i,a){var p=_t;try{return _t=i,a()}finally{_t=p}},Vt=function(i,a,p){switch(a){case"input":if(de(i,p),a=p.name,p.type==="radio"&&a!=null){for(p=i;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<p.length;a++){var S=p[a];if(S!==i&&S.form===i.form){var A=sc(S);if(!A)throw Error(r(90));ie(S),de(S,A)}}}break;case"textarea":ht(i,p);break;case"select":a=p.value,a!=null&&Se(i,!!p.multiple,a,!1)}},nr=sf,Nr=Ci;var DE={usingClientEntryPoint:!1,Events:[ya,to,sc,tt,qt,sf]},Ma={findFiberByHostInstance:gi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},LE={bundleType:Ma.bundleType,version:Ma.version,rendererPackageName:Ma.rendererPackageName,rendererConfig:Ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ex(i),i===null?null:i.stateNode},findFiberByHostInstance:Ma.findFiberByHostInstance||RE,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 Hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hc.isDisabled&&Hc.supportsFiber)try{Fl=Hc.inject(LE),Wn=Hc}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DE,Vr.createPortal=function(i,a){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mf(a))throw Error(r(200));return TE(i,a,null,p)},Vr.createRoot=function(i,a){if(!mf(i))throw Error(r(299));var p=!1,S="",A=Nv;return a!=null&&(a.unstable_strictMode===!0&&(p=!0),a.identifierPrefix!==void 0&&(S=a.identifierPrefix),a.onRecoverableError!==void 0&&(A=a.onRecoverableError)),a=df(i,1,!1,null,null,p,!1,S,A),i[us]=a.current,ga(i.nodeType===8?i.parentNode:i),new ff(a)},Vr.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=ex(a),i=i===null?null:i.stateNode,i},Vr.flushSync=function(i){return Ci(i)},Vr.hydrate=function(i,a,p){if(!$c(a))throw Error(r(200));return zc(null,i,a,!0,p)},Vr.hydrateRoot=function(i,a,p){if(!mf(i))throw Error(r(405));var S=p!=null&&p.hydratedSources||null,A=!1,D="",V=Nv;if(p!=null&&(p.unstable_strictMode===!0&&(A=!0),p.identifierPrefix!==void 0&&(D=p.identifierPrefix),p.onRecoverableError!==void 0&&(V=p.onRecoverableError)),a=kv(a,null,i,1,p??null,A,!1,D,V),i[us]=a.current,ga(i),S)for(i=0;i<S.length;i++)p=S[i],A=p._getVersion,A=A(p._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[p,A]:a.mutableSourceEagerHydrationData.push(p,A);return new Fc(a)},Vr.render=function(i,a,p){if(!$c(a))throw Error(r(200));return zc(null,i,a,!1,p)},Vr.unmountComponentAtNode=function(i){if(!$c(i))throw Error(r(40));return i._reactRootContainer?(Ci(function(){zc(null,null,i,!1,function(){i._reactRootContainer=null,i[us]=null})}),!0):!1},Vr.unstable_batchedUpdates=sf,Vr.unstable_renderSubtreeIntoContainer=function(i,a,p,S){if(!$c(p))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return zc(i,a,p,!1,S)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}var Iv;function $w(){if(Iv)return xf.exports;Iv=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(),xf.exports=WE(),xf.exports}var Ov;function VE(){if(Ov)return Wc;Ov=1;var e=$w();return Wc.createRoot=e.createRoot,Wc.hydrateRoot=e.hydrateRoot,Wc}var UE=VE();const GE=ml(UE);var pl=$w();const zw=ml(pl);function KE(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const qE=e=>{switch(e){case"success":return JE;case"info":return ZE;case"warning":return QE;case"error":return eP;default:return null}},YE=Array(12).fill(0),XE=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},YE.map((r,s)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),JE=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),QE=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ZE=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),eP=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),tP=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rP=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let dm=1;class nP{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:s,...o}=t,u=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:dm++,d=this.toasts.find(c=>c.id===u),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(c=>c.id===u?(this.publish({...c,...t,id:u,title:s}),{...c,...t,id:u,dismissible:l,title:s}):c):this.addToast({title:s,...o,dismissible:l,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,d;const l=o.then(async f=>{if(d=["resolve",f],Ee.isValidElement(f))u=!1,this.create({id:s,type:"default",message:f});else if(iP(f)&&!f.ok){u=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,x=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,k=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:x,...k})}else if(f instanceof Error){u=!1;const h=typeof r.error=="function"?await r.error(f):r.error,x=typeof r.description=="function"?await r.description(f):r.description,k=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:x,...k})}else if(r.success!==void 0){u=!1;const h=typeof r.success=="function"?await r.success(f):r.success,x=typeof r.description=="function"?await r.description(f):r.description,k=typeof h=="object"&&!Ee.isValidElement(h)?h:{message:h};this.create({id:s,type:"success",description:x,...k})}}).catch(async f=>{if(d=["reject",f],r.error!==void 0){u=!1;const m=typeof r.error=="function"?await r.error(f):r.error,h=typeof r.description=="function"?await r.description(f):r.description,w=typeof m=="object"&&!Ee.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:h,...w})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((f,m)=>l.then(()=>d[0]==="reject"?m(d[1]):f(d[1])).catch(m));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,r)=>{const s=(r==null?void 0:r.id)||dm++;return this.create({jsx:t(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Gr=new nP,sP=(e,t)=>{const r=(t==null?void 0:t.id)||dm++;return Gr.addToast({title:e,...t,id:r}),r},iP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oP=sP,aP=()=>Gr.toasts,lP=()=>Gr.getActiveToasts(),ee=Object.assign(oP,{success:Gr.success,info:Gr.info,warning:Gr.warning,error:Gr.error,custom:Gr.custom,message:Gr.message,promise:Gr.promise,dismiss:Gr.dismiss,loading:Gr.loading},{getHistory:aP,getToasts:lP});KE("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Vc(e){return e.label!==void 0}const cP=3,uP="24px",dP="16px",Bv=4e3,hP=356,fP=14,mP=45,pP=200;function qn(...e){return e.filter(Boolean).join(" ")}function gP(e){const[t,r]=e.split("-"),s=[];return t&&s.push(t),r&&s.push(r),s}const xP=e=>{var t,r,s,o,u,d,l,c,f;const{invert:m,toast:h,unstyled:x,interacting:w,setHeights:k,visibleToasts:_,heights:v,index:b,toasts:g,expanded:y,removeToast:j,defaultRichColors:E,closeButton:P,style:T,cancelButtonStyle:N,actionButtonStyle:R,className:I="",descriptionClassName:O="",duration:$,position:W,gap:Y,expandByDefault:z,classNames:K,icons:G,closeButtonAriaLabel:U="Close toast"}=e,[L,M]=Ee.useState(null),[B,q]=Ee.useState(null),[F,oe]=Ee.useState(!1),[fe,me]=Ee.useState(!1),[X,H]=Ee.useState(!1),[ae,ne]=Ee.useState(!1),[J,ie]=Ee.useState(!1),[ye,Oe]=Ee.useState(0),[Ve,te]=Ee.useState(0),de=Ee.useRef(h.duration||$||Bv),De=Ee.useRef(null),Re=Ee.useRef(null),Ze=b===0,Se=b+1<=_,ge=h.type,Me=h.dismissible!==!1,ht=h.className||"",Rt=h.descriptionClassName||"",pe=Ee.useMemo(()=>v.findIndex(tt=>tt.toastId===h.id)||0,[v,h.id]),be=Ee.useMemo(()=>{var tt;return(tt=h.closeButton)!=null?tt:P},[h.closeButton,P]),Be=Ee.useMemo(()=>h.duration||$||Bv,[h.duration,$]),Ge=Ee.useRef(0),Ke=Ee.useRef(0),bt=Ee.useRef(0),Z=Ee.useRef(null),[Pe,Le]=W.split("-"),st=Ee.useMemo(()=>v.reduce((tt,qt,nr)=>nr>=pe?tt:tt+qt.height,0),[v,pe]),et=rP(),jt=h.invert||m,ft=ge==="loading";Ke.current=Ee.useMemo(()=>pe*Y+st,[pe,st]),Ee.useEffect(()=>{de.current=Be},[Be]),Ee.useEffect(()=>{oe(!0)},[]),Ee.useEffect(()=>{const tt=Re.current;if(tt){const qt=tt.getBoundingClientRect().height;return te(qt),k(nr=>[{toastId:h.id,height:qt,position:h.position},...nr]),()=>k(nr=>nr.filter(Nr=>Nr.toastId!==h.id))}},[k,h.id]),Ee.useLayoutEffect(()=>{if(!F)return;const tt=Re.current,qt=tt.style.height;tt.style.height="auto";const nr=tt.getBoundingClientRect().height;tt.style.height=qt,te(nr),k(Nr=>Nr.find(Qt=>Qt.toastId===h.id)?Nr.map(Qt=>Qt.toastId===h.id?{...Qt,height:nr}:Qt):[{toastId:h.id,height:nr,position:h.position},...Nr])},[F,h.title,h.description,k,h.id,h.jsx,h.action,h.cancel]);const wt=Ee.useCallback(()=>{me(!0),Oe(Ke.current),k(tt=>tt.filter(qt=>qt.toastId!==h.id)),setTimeout(()=>{j(h)},pP)},[h,j,k,Ke]);Ee.useEffect(()=>{if(h.promise&&ge==="loading"||h.duration===1/0||h.type==="loading")return;let tt;return y||w||et?(()=>{if(bt.current<Ge.current){const Nr=new Date().getTime()-Ge.current;de.current=de.current-Nr}bt.current=new Date().getTime()})():(()=>{de.current!==1/0&&(Ge.current=new Date().getTime(),tt=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),wt()},de.current))})(),()=>clearTimeout(tt)},[y,w,h,ge,et,wt]),Ee.useEffect(()=>{h.delete&&(wt(),h.onDismiss==null||h.onDismiss.call(h,h))},[wt,h.delete]);function Vt(){var tt;if(G!=null&&G.loading){var qt;return Ee.createElement("div",{className:qn(K==null?void 0:K.loader,h==null||(qt=h.classNames)==null?void 0:qt.loader,"sonner-loader"),"data-visible":ge==="loading"},G.loading)}return Ee.createElement(XE,{className:qn(K==null?void 0:K.loader,h==null||(tt=h.classNames)==null?void 0:tt.loader),visible:ge==="loading"})}const rr=h.icon||(G==null?void 0:G[ge])||qE(ge);var jr,hn;return Ee.createElement("li",{tabIndex:0,ref:Re,className:qn(I,ht,K==null?void 0:K.toast,h==null||(t=h.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[ge],h==null||(r=h.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(jr=h.richColors)!=null?jr:E,"data-styled":!(h.jsx||h.unstyled||x),"data-mounted":F,"data-promise":!!h.promise,"data-swiped":J,"data-removed":fe,"data-visible":Se,"data-y-position":Pe,"data-x-position":Le,"data-index":b,"data-front":Ze,"data-swiping":X,"data-dismissible":Me,"data-type":ge,"data-invert":jt,"data-swipe-out":ae,"data-swipe-direction":B,"data-expanded":!!(y||z&&F),"data-testid":h.testId,style:{"--index":b,"--toasts-before":b,"--z-index":g.length-b,"--offset":`${fe?ye:Ke.current}px`,"--initial-height":z?"auto":`${Ve}px`,...T,...h.style},onDragEnd:()=>{H(!1),M(null),Z.current=null},onPointerDown:tt=>{tt.button!==2&&(ft||!Me||(De.current=new Date,Oe(Ke.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(H(!0),Z.current={x:tt.clientX,y:tt.clientY})))},onPointerUp:()=>{var tt,qt,nr;if(ae||!Me)return;Z.current=null;const Nr=Number(((tt=Re.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ns=Number(((qt=Re.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qt=new Date().getTime()-((nr=De.current)==null?void 0:nr.getTime()),cr=L==="x"?Nr:Ns,Es=Math.abs(cr)/Qt;if(Math.abs(cr)>=mP||Es>.11){Oe(Ke.current),h.onDismiss==null||h.onDismiss.call(h,h),q(L==="x"?Nr>0?"right":"left":Ns>0?"down":"up"),wt(),ne(!0);return}else{var xr,Qr;(xr=Re.current)==null||xr.style.setProperty("--swipe-amount-x","0px"),(Qr=Re.current)==null||Qr.style.setProperty("--swipe-amount-y","0px")}ie(!1),H(!1),M(null)},onPointerMove:tt=>{var qt,nr,Nr;if(!Z.current||!Me||((qt=window.getSelection())==null?void 0:qt.toString().length)>0)return;const Qt=tt.clientY-Z.current.y,cr=tt.clientX-Z.current.x;var Es;const xr=(Es=e.swipeDirections)!=null?Es:gP(W);!L&&(Math.abs(cr)>1||Math.abs(Qt)>1)&&M(Math.abs(cr)>Math.abs(Qt)?"x":"y");let Qr={x:0,y:0};const Ps=fn=>1/(1.5+Math.abs(fn)/20);if(L==="y"){if(xr.includes("top")||xr.includes("bottom"))if(xr.includes("top")&&Qt<0||xr.includes("bottom")&&Qt>0)Qr.y=Qt;else{const fn=Qt*Ps(Qt);Qr.y=Math.abs(fn)<Math.abs(Qt)?fn:Qt}}else if(L==="x"&&(xr.includes("left")||xr.includes("right")))if(xr.includes("left")&&cr<0||xr.includes("right")&&cr>0)Qr.x=cr;else{const fn=cr*Ps(cr);Qr.x=Math.abs(fn)<Math.abs(cr)?fn:cr}(Math.abs(Qr.x)>0||Math.abs(Qr.y)>0)&&ie(!0),(nr=Re.current)==null||nr.style.setProperty("--swipe-amount-x",`${Qr.x}px`),(Nr=Re.current)==null||Nr.style.setProperty("--swipe-amount-y",`${Qr.y}px`)}},be&&!h.jsx&&ge!=="loading"?Ee.createElement("button",{"aria-label":U,"data-disabled":ft,"data-close-button":!0,onClick:ft||!Me?()=>{}:()=>{wt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:qn(K==null?void 0:K.closeButton,h==null||(s=h.classNames)==null?void 0:s.closeButton)},(hn=G==null?void 0:G.close)!=null?hn:tP):null,(ge||h.icon||h.promise)&&h.icon!==null&&((G==null?void 0:G[ge])!==null||h.icon)?Ee.createElement("div",{"data-icon":"",className:qn(K==null?void 0:K.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Vt():null,h.type!=="loading"?rr:null):null,Ee.createElement("div",{"data-content":"",className:qn(K==null?void 0:K.content,h==null||(u=h.classNames)==null?void 0:u.content)},Ee.createElement("div",{"data-title":"",className:qn(K==null?void 0:K.title,h==null||(d=h.classNames)==null?void 0:d.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ee.createElement("div",{"data-description":"",className:qn(O,Rt,K==null?void 0:K.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ee.isValidElement(h.cancel)?h.cancel:h.cancel&&Vc(h.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||N,onClick:tt=>{Vc(h.cancel)&&Me&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,tt),wt())},className:qn(K==null?void 0:K.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,Ee.isValidElement(h.action)?h.action:h.action&&Vc(h.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||R,onClick:tt=>{Vc(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,tt),!tt.defaultPrevented&&wt())},className:qn(K==null?void 0:K.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function Fv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function vP(e,t){const r={};return[e,t].forEach((s,o)=>{const u=o===1,d=u?"--mobile-offset":"--offset",l=u?dP:uP;function c(f){["top","right","bottom","left"].forEach(m=>{r[`${d}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(f=>{s[f]===void 0?r[`${d}-${f}`]=l:r[`${d}-${f}`]=typeof s[f]=="number"?`${s[f]}px`:s[f]}):c(l)}),r}const yP=Ee.forwardRef(function(t,r){const{id:s,invert:o,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:l,closeButton:c,className:f,offset:m,mobileOffset:h,theme:x="light",richColors:w,duration:k,style:_,visibleToasts:v=cP,toastOptions:b,dir:g=Fv(),gap:y=fP,icons:j,containerAriaLabel:E="Notifications"}=t,[P,T]=Ee.useState([]),N=Ee.useMemo(()=>s?P.filter(F=>F.toasterId===s):P.filter(F=>!F.toasterId),[P,s]),R=Ee.useMemo(()=>Array.from(new Set([u].concat(N.filter(F=>F.position).map(F=>F.position)))),[N,u]),[I,O]=Ee.useState([]),[$,W]=Ee.useState(!1),[Y,z]=Ee.useState(!1),[K,G]=Ee.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Ee.useRef(null),L=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=Ee.useRef(null),B=Ee.useRef(!1),q=Ee.useCallback(F=>{T(oe=>{var fe;return(fe=oe.find(me=>me.id===F.id))!=null&&fe.delete||Gr.dismiss(F.id),oe.filter(({id:me})=>me!==F.id)})},[]);return Ee.useEffect(()=>Gr.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(fe=>fe.id===F.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{zw.flushSync(()=>{T(oe=>{const fe=oe.findIndex(me=>me.id===F.id);return fe!==-1?[...oe.slice(0,fe),{...oe[fe],...F},...oe.slice(fe+1)]:[F,...oe]})})})}),[P]),Ee.useEffect(()=>{if(x!=="system"){G(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:oe})=>{G(oe?"dark":"light")})}catch{F.addListener(({matches:fe})=>{try{G(fe?"dark":"light")}catch(me){console.error(me)}})}},[x]),Ee.useEffect(()=>{P.length<=1&&W(!1)},[P]),Ee.useEffect(()=>{const F=oe=>{var fe;if(d.every(H=>oe[H]||oe.code===H)){var X;W(!0),(X=U.current)==null||X.focus()}oe.code==="Escape"&&(document.activeElement===U.current||(fe=U.current)!=null&&fe.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[d]),Ee.useEffect(()=>{if(U.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,B.current=!1)}},[U.current]),Ee.createElement("section",{ref:r,"aria-label":`${E} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,oe)=>{var fe;const[me,X]=F.split("-");return N.length?Ee.createElement("ol",{key:F,dir:g==="auto"?Fv():g,tabIndex:-1,ref:U,className:f,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":me,"data-x-position":X,style:{"--front-toast-height":`${((fe=I[0])==null?void 0:fe.height)||0}px`,"--width":`${hP}px`,"--gap":`${y}px`,..._,...vP(m,h)},onBlur:H=>{B.current&&!H.currentTarget.contains(H.relatedTarget)&&(B.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||B.current||(B.current=!0,M.current=H.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Y||W(!1)},onDragEnd:()=>W(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},N.filter(H=>!H.position&&oe===0||H.position===F).map((H,ae)=>{var ne,J;return Ee.createElement(xP,{key:H.id,icons:j,index:ae,toast:H,defaultRichColors:w,duration:(ne=b==null?void 0:b.duration)!=null?ne:k,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:v,closeButton:(J=b==null?void 0:b.closeButton)!=null?J:c,interacting:Y,position:F,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:q,toasts:N.filter(ie=>ie.position==H.position),heights:I.filter(ie=>ie.position==H.position),setHeights:O,expandByDefault:l,gap:y,expanded:$,swipeDirections:t.swipeDirections})})):null}))}),lp=C.createContext({});function cp(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const zu=C.createContext(null),up=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class bP extends C.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=r.offsetHeight||0,s.width=r.offsetWidth||0,s.top=r.offsetTop,s.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function wP({children:e,isPresent:t}){const r=C.useId(),s=C.useRef(null),o=C.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=C.useContext(up);return C.useInsertionEffect(()=>{const{width:d,height:l,top:c,left:f}=o.current;if(t||!s.current||!d||!l)return;s.current.dataset.motionPopId=r;const m=document.createElement("style");return u&&(m.nonce=u),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
41
41
|
[data-motion-pop-id="${r}"] {
|
|
42
42
|
position: absolute !important;
|
|
43
43
|
width: ${d}px !important;
|
|
@@ -529,16 +529,16 @@ Error generating stack: `+D.message+`
|
|
|
529
529
|
|
|
530
530
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
531
531
|
|
|
532
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},DL="DialogDescriptionWarning",LL=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DS(DL).contentName}}.`;return C.useEffect(()=>{var u;const o=(u=e.current)==null?void 0:u.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},LS=bS,IL=_S,rg=CS,od=kS,ad=jS,ld=ES,cd=AS,ng=RS;const Tt=LS,OL=rg,IS=C.forwardRef(({className:e,...t},r)=>n.jsx(od,{ref:r,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));IS.displayName=od.displayName;const St=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(OL,{children:[n.jsx(IS,{}),n.jsxs(ad,{ref:s,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,n.jsxs(ng,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsx(ei,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));St.displayName=ad.displayName;const Ct=({className:e,...t})=>n.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ct.displayName="DialogHeader";const It=({className:e,...t})=>n.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});It.displayName="DialogFooter";const kt=C.forwardRef(({className:e,...t},r)=>n.jsx(ld,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));kt.displayName=ld.displayName;const tr=C.forwardRef(({className:e,...t},r)=>n.jsx(cd,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));tr.displayName=cd.displayName;function sg(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ig(e){const[t,r]=C.useState(void 0);return gr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,l;if("borderBoxSize"in u){const c=u.borderBoxSize,f=Array.isArray(c)?c[0]:c;d=f.inlineSize,l=f.blockSize}else d=e.offsetWidth,l=e.offsetHeight;r({width:d,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),t}var ud="Checkbox",[BL]=Xr(ud),[FL,og]=BL(ud);function $L(e){const{__scopeCheckbox:t,checked:r,children:s,defaultChecked:o,disabled:u,form:d,name:l,onCheckedChange:c,required:f,value:m="on",internal_do_not_use_render:h}=e,[x,w]=ss({prop:r,defaultProp:o??!1,onChange:c,caller:ud}),[k,_]=C.useState(null),[v,b]=C.useState(null),g=C.useRef(!1),y=k?!!d||!!k.closest("form"):!0,j={checked:x,disabled:u,setChecked:w,control:k,setControl:_,name:l,form:d,value:m,hasConsumerStoppedPropagationRef:g,required:f,defaultChecked:ti(o)?!1:o,isFormControl:y,bubbleInput:v,setBubbleInput:b};return n.jsx(FL,{scope:t,...j,children:zL(h)?h(j):s})}var OS="CheckboxTrigger",BS=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...s},o)=>{const{control:u,value:d,disabled:l,checked:c,required:f,setControl:m,setChecked:h,hasConsumerStoppedPropagationRef:x,isFormControl:w,bubbleInput:k}=og(OS,e),_=it(o,m),v=C.useRef(c);return C.useEffect(()=>{const b=u==null?void 0:u.form;if(b){const g=()=>h(v.current);return b.addEventListener("reset",g),()=>b.removeEventListener("reset",g)}},[u,h]),n.jsx(Xe.button,{type:"button",role:"checkbox","aria-checked":ti(c)?"mixed":c,"aria-required":f,"data-state":WS(c),"data-disabled":l?"":void 0,disabled:l,value:d,...s,ref:_,onKeyDown:Te(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Te(r,b=>{h(g=>ti(g)?!0:!g),k&&w&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})});BS.displayName=OS;var ag=C.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:s,checked:o,defaultChecked:u,required:d,disabled:l,value:c,onCheckedChange:f,form:m,...h}=e;return n.jsx($L,{__scopeCheckbox:r,checked:o,defaultChecked:u,disabled:l,required:d,onCheckedChange:f,name:s,form:m,value:c,internal_do_not_use_render:({isFormControl:x})=>n.jsxs(n.Fragment,{children:[n.jsx(BS,{...h,ref:t,__scopeCheckbox:r}),x&&n.jsx(HS,{__scopeCheckbox:r})]})})});ag.displayName=ud;var FS="CheckboxIndicator",$S=C.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:s,...o}=e,u=og(FS,r);return n.jsx(kr,{present:s||ti(u.checked)||u.checked===!0,children:n.jsx(Xe.span,{"data-state":WS(u.checked),"data-disabled":u.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});$S.displayName=FS;var zS="CheckboxBubbleInput",HS=C.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:u,defaultChecked:d,required:l,disabled:c,name:f,value:m,form:h,bubbleInput:x,setBubbleInput:w}=og(zS,e),k=it(r,w),_=sg(u),v=ig(s);C.useEffect(()=>{const g=x;if(!g)return;const y=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(y,"checked").set,P=!o.current;if(_!==u&&E){const T=new Event("click",{bubbles:P});g.indeterminate=ti(u),E.call(g,ti(u)?!1:u),g.dispatchEvent(T)}},[x,_,u,o]);const b=C.useRef(ti(u)?!1:u);return n.jsx(Xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??b.current,required:l,disabled:c,name:f,value:m,form:h,...t,tabIndex:-1,ref:k,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});HS.displayName=zS;function zL(e){return typeof e=="function"}function ti(e){return e==="indeterminate"}function WS(e){return ti(e)?"indeterminate":e?"checked":"unchecked"}const jl=C.forwardRef(({className:e,...t},r)=>n.jsx(ag,{ref:r,className:je("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:n.jsx($S,{className:je("flex items-center justify-center text-current"),children:n.jsx(Kt,{className:"h-4 w-4"})})}));jl.displayName=ag.displayName;function Nb(e){const t=HL(e),r=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(VL);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return n.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function HL(e){const t=C.forwardRef((r,s)=>{const{children:o,...u}=r;if(C.isValidElement(o)){const d=GL(o),l=UL(u,o.props);return o.type!==C.Fragment&&(l.ref=s?js(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WL=Symbol("radix.slottable");function VL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WL}function UL(e,t){const r={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function GL(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function lg(e){const t=e+"CollectionProvider",[r,s]=Xr(t),[o,u]=r(t,{collectionRef:{current:null},itemMap:new Map}),d=_=>{const{scope:v,children:b}=_,g=Ee.useRef(null),y=Ee.useRef(new Map).current;return n.jsx(o,{scope:v,itemMap:y,collectionRef:g,children:b})};d.displayName=t;const l=e+"CollectionSlot",c=Nb(l),f=Ee.forwardRef((_,v)=>{const{scope:b,children:g}=_,y=u(l,b),j=it(v,y.collectionRef);return n.jsx(c,{ref:j,children:g})});f.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",x=Nb(m),w=Ee.forwardRef((_,v)=>{const{scope:b,children:g,...y}=_,j=Ee.useRef(null),E=it(v,j),P=u(m,b);return Ee.useEffect(()=>(P.itemMap.set(j,{ref:j,...y}),()=>void P.itemMap.delete(j))),n.jsx(x,{[h]:"",ref:E,children:g})});w.displayName=m;function k(_){const v=u(e+"CollectionConsumer",_);return Ee.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((P,T)=>y.indexOf(P.ref.current)-y.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:d,Slot:f,ItemSlot:w},k,s]}const KL=["top","right","bottom","left"],ii=Math.min,sn=Math.max,Tu=Math.round,nu=Math.floor,rs=e=>({x:e,y:e}),qL={left:"right",right:"left",bottom:"top",top:"bottom"},YL={start:"end",end:"start"};function Om(e,t,r){return sn(e,ii(t,r))}function Ss(e,t){return typeof e=="function"?e(t):e}function Cs(e){return e.split("-")[0]}function qo(e){return e.split("-")[1]}function cg(e){return e==="x"?"y":"x"}function ug(e){return e==="y"?"height":"width"}const XL=new Set(["top","bottom"]);function Zn(e){return XL.has(Cs(e))?"y":"x"}function dg(e){return cg(Zn(e))}function JL(e,t,r){r===void 0&&(r=!1);const s=qo(e),o=dg(e),u=ug(o);let d=o==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(d=Ru(d)),[d,Ru(d)]}function QL(e){const t=Ru(e);return[Bm(e),t,Bm(t)]}function Bm(e){return e.replace(/start|end/g,t=>YL[t])}const Eb=["left","right"],Pb=["right","left"],ZL=["top","bottom"],eI=["bottom","top"];function tI(e,t,r){switch(e){case"top":case"bottom":return r?t?Pb:Eb:t?Eb:Pb;case"left":case"right":return t?ZL:eI;default:return[]}}function rI(e,t,r,s){const o=qo(e);let u=tI(Cs(e),r==="start",s);return o&&(u=u.map(d=>d+"-"+o),t&&(u=u.concat(u.map(Bm)))),u}function Ru(e){return e.replace(/left|right|bottom|top/g,t=>qL[t])}function nI(e){return{top:0,right:0,bottom:0,left:0,...e}}function VS(e){return typeof e!="number"?nI(e):{top:e,right:e,bottom:e,left:e}}function Mu(e){const{x:t,y:r,width:s,height:o}=e;return{width:s,height:o,top:r,left:t,right:t+s,bottom:r+o,x:t,y:r}}function Ab(e,t,r){let{reference:s,floating:o}=e;const u=Zn(t),d=dg(t),l=ug(d),c=Cs(t),f=u==="y",m=s.x+s.width/2-o.width/2,h=s.y+s.height/2-o.height/2,x=s[l]/2-o[l]/2;let w;switch(c){case"top":w={x:m,y:s.y-o.height};break;case"bottom":w={x:m,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y:h};break;case"left":w={x:s.x-o.width,y:h};break;default:w={x:s.x,y:s.y}}switch(qo(t)){case"start":w[d]-=x*(r&&f?-1:1);break;case"end":w[d]+=x*(r&&f?-1:1);break}return w}const sI=async(e,t,r)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:d}=r,l=u.filter(Boolean),c=await(d.isRTL==null?void 0:d.isRTL(t));let f=await d.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=Ab(f,s,c),x=s,w={},k=0;for(let _=0;_<l.length;_++){const{name:v,fn:b}=l[_],{x:g,y,data:j,reset:E}=await b({x:m,y:h,initialPlacement:s,placement:x,strategy:o,middlewareData:w,rects:f,platform:d,elements:{reference:e,floating:t}});m=g??m,h=y??h,w={...w,[v]:{...w[v],...j}},E&&k<=50&&(k++,typeof E=="object"&&(E.placement&&(x=E.placement),E.rects&&(f=E.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:m,y:h}=Ab(f,x,c)),_=-1)}return{x:m,y:h,placement:x,strategy:o,middlewareData:w}};async function il(e,t){var r;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:d,elements:l,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:x=!1,padding:w=0}=Ss(t,e),k=VS(w),v=l[x?h==="floating"?"reference":"floating":h],b=Mu(await u.getClippingRect({element:(r=await(u.isElement==null?void 0:u.isElement(v)))==null||r?v:v.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:c})),g=h==="floating"?{x:s,y:o,width:d.floating.width,height:d.floating.height}:d.reference,y=await(u.getOffsetParent==null?void 0:u.getOffsetParent(l.floating)),j=await(u.isElement==null?void 0:u.isElement(y))?await(u.getScale==null?void 0:u.getScale(y))||{x:1,y:1}:{x:1,y:1},E=Mu(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(b.top-E.top+k.top)/j.y,bottom:(E.bottom-b.bottom+k.bottom)/j.y,left:(b.left-E.left+k.left)/j.x,right:(E.right-b.right+k.right)/j.x}}const iI=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:s,placement:o,rects:u,platform:d,elements:l,middlewareData:c}=t,{element:f,padding:m=0}=Ss(e,t)||{};if(f==null)return{};const h=VS(m),x={x:r,y:s},w=dg(o),k=ug(w),_=await d.getDimensions(f),v=w==="y",b=v?"top":"left",g=v?"bottom":"right",y=v?"clientHeight":"clientWidth",j=u.reference[k]+u.reference[w]-x[w]-u.floating[k],E=x[w]-u.reference[w],P=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f));let T=P?P[y]:0;(!T||!await(d.isElement==null?void 0:d.isElement(P)))&&(T=l.floating[y]||u.floating[k]);const N=j/2-E/2,R=T/2-_[k]/2-1,I=ii(h[b],R),O=ii(h[g],R),$=I,W=T-_[k]-O,Y=T/2-_[k]/2+N,z=Om($,Y,W),K=!c.arrow&&qo(o)!=null&&Y!==z&&u.reference[k]/2-(Y<$?I:O)-_[k]/2<0,G=K?Y<$?Y-$:Y-W:0;return{[w]:x[w]+G,data:{[w]:z,centerOffset:Y-z-G,...K&&{alignmentOffset:G}},reset:K}}}),oI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,s;const{placement:o,middlewareData:u,rects:d,initialPlacement:l,platform:c,elements:f}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:_=!0,...v}=Ss(e,t);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const b=Cs(o),g=Zn(l),y=Cs(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(f.floating)),E=x||(y||!_?[Ru(l)]:QL(l)),P=k!=="none";!x&&P&&E.push(...rI(l,_,k,j));const T=[l,...E],N=await il(t,v),R=[];let I=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&R.push(N[b]),h){const Y=JL(o,d,j);R.push(N[Y[0]],N[Y[1]])}if(I=[...I,{placement:o,overflows:R}],!R.every(Y=>Y<=0)){var O,$;const Y=(((O=u.flip)==null?void 0:O.index)||0)+1,z=T[Y];if(z&&(!(h==="alignment"?g!==Zn(z):!1)||I.every(U=>Zn(U.placement)===g?U.overflows[0]>0:!0)))return{data:{index:Y,overflows:I},reset:{placement:z}};let K=($=I.filter(G=>G.overflows[0]<=0).sort((G,U)=>G.overflows[1]-U.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(w){case"bestFit":{var W;const G=(W=I.filter(U=>{if(P){const L=Zn(U.placement);return L===g||L==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(L=>L>0).reduce((L,M)=>L+M,0)]).sort((U,L)=>U[1]-L[1])[0])==null?void 0:W[0];G&&(K=G);break}case"initialPlacement":K=l;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function Tb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rb(e){return KL.some(t=>e[t]>=0)}const aI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:s="referenceHidden",...o}=Ss(e,t);switch(s){case"referenceHidden":{const u=await il(t,{...o,elementContext:"reference"}),d=Tb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Rb(d)}}}case"escaped":{const u=await il(t,{...o,altBoundary:!0}),d=Tb(u,r.floating);return{data:{escapedOffsets:d,escaped:Rb(d)}}}default:return{}}}}},US=new Set(["left","top"]);async function lI(e,t){const{placement:r,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),d=Cs(r),l=qo(r),c=Zn(r)==="y",f=US.has(d)?-1:1,m=u&&c?-1:1,h=Ss(t,e);let{mainAxis:x,crossAxis:w,alignmentAxis:k}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof k=="number"&&(w=l==="end"?k*-1:k),c?{x:w*m,y:x*f}:{x:x*f,y:w*m}}const cI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,s;const{x:o,y:u,placement:d,middlewareData:l}=t,c=await lI(t,e);return d===((r=l.offset)==null?void 0:r.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:d}}}}},uI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:l={fn:v=>{let{x:b,y:g}=v;return{x:b,y:g}}},...c}=Ss(e,t),f={x:r,y:s},m=await il(t,c),h=Zn(Cs(o)),x=cg(h);let w=f[x],k=f[h];if(u){const v=x==="y"?"top":"left",b=x==="y"?"bottom":"right",g=w+m[v],y=w-m[b];w=Om(g,w,y)}if(d){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",g=k+m[v],y=k-m[b];k=Om(g,k,y)}const _=l.fn({...t,[x]:w,[h]:k});return{..._,data:{x:_.x-r,y:_.y-s,enabled:{[x]:u,[h]:d}}}}}},dI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:s,placement:o,rects:u,middlewareData:d}=t,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=Ss(e,t),m={x:r,y:s},h=Zn(o),x=cg(h);let w=m[x],k=m[h];const _=Ss(l,t),v=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(c){const y=x==="y"?"height":"width",j=u.reference[x]-u.floating[y]+v.mainAxis,E=u.reference[x]+u.reference[y]-v.mainAxis;w<j?w=j:w>E&&(w=E)}if(f){var b,g;const y=x==="y"?"width":"height",j=US.has(Cs(o)),E=u.reference[h]-u.floating[y]+(j&&((b=d.offset)==null?void 0:b[h])||0)+(j?0:v.crossAxis),P=u.reference[h]+u.reference[y]+(j?0:((g=d.offset)==null?void 0:g[h])||0)-(j?v.crossAxis:0);k<E?k=E:k>P&&(k=P)}return{[x]:w,[h]:k}}}},hI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,s;const{placement:o,rects:u,platform:d,elements:l}=t,{apply:c=()=>{},...f}=Ss(e,t),m=await il(t,f),h=Cs(o),x=qo(o),w=Zn(o)==="y",{width:k,height:_}=u.floating;let v,b;h==="top"||h==="bottom"?(v=h,b=x===(await(d.isRTL==null?void 0:d.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,v=x==="end"?"top":"bottom");const g=_-m.top-m.bottom,y=k-m.left-m.right,j=ii(_-m[v],g),E=ii(k-m[b],y),P=!t.middlewareData.shift;let T=j,N=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=y),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(T=g),P&&!x){const I=sn(m.left,0),O=sn(m.right,0),$=sn(m.top,0),W=sn(m.bottom,0);w?N=k-2*(I!==0||O!==0?I+O:sn(m.left,m.right)):T=_-2*($!==0||W!==0?$+W:sn(m.top,m.bottom))}await c({...t,availableWidth:N,availableHeight:T});const R=await d.getDimensions(l.floating);return k!==R.width||_!==R.height?{reset:{rects:!0}}:{}}}};function dd(){return typeof window<"u"}function Yo(e){return GS(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cs(e){var t;return(t=(GS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GS(e){return dd()?e instanceof Node||e instanceof un(e).Node:!1}function $n(e){return dd()?e instanceof Element||e instanceof un(e).Element:!1}function is(e){return dd()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function Mb(e){return!dd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const fI=new Set(["inline","contents"]);function Nl(e){const{overflow:t,overflowX:r,overflowY:s,display:o}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+r)&&!fI.has(o)}const mI=new Set(["table","td","th"]);function pI(e){return mI.has(Yo(e))}const gI=[":popover-open",":modal"];function hd(e){return gI.some(t=>{try{return e.matches(t)}catch{return!1}})}const xI=["transform","translate","scale","rotate","perspective"],vI=["transform","translate","scale","rotate","perspective","filter"],yI=["paint","layout","strict","content"];function hg(e){const t=fg(),r=$n(e)?zn(e):e;return xI.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||vI.some(s=>(r.willChange||"").includes(s))||yI.some(s=>(r.contain||"").includes(s))}function bI(e){let t=oi(e);for(;is(t)&&!Fo(t);){if(hg(t))return t;if(hd(t))return null;t=oi(t)}return null}function fg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wI=new Set(["html","body","#document"]);function Fo(e){return wI.has(Yo(e))}function zn(e){return un(e).getComputedStyle(e)}function fd(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oi(e){if(Yo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mb(e)&&e.host||cs(e);return Mb(t)?t.host:t}function KS(e){const t=oi(e);return Fo(t)?e.ownerDocument?e.ownerDocument.body:e.body:is(t)&&Nl(t)?t:KS(t)}function ol(e,t,r){var s;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=KS(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),d=un(o);if(u){const l=Fm(d);return t.concat(d,d.visualViewport||[],Nl(o)?o:[],l&&r?ol(l):[])}return t.concat(o,ol(o,[],r))}function Fm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qS(e){const t=zn(e);let r=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=is(e),u=o?e.offsetWidth:r,d=o?e.offsetHeight:s,l=Tu(r)!==u||Tu(s)!==d;return l&&(r=u,s=d),{width:r,height:s,$:l}}function mg(e){return $n(e)?e:e.contextElement}function Ao(e){const t=mg(e);if(!is(t))return rs(1);const r=t.getBoundingClientRect(),{width:s,height:o,$:u}=qS(t);let d=(u?Tu(r.width):r.width)/s,l=(u?Tu(r.height):r.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!l||!Number.isFinite(l))&&(l=1),{x:d,y:l}}const _I=rs(0);function YS(e){const t=un(e);return!fg()||!t.visualViewport?_I:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SI(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==un(e)?!1:t}function zi(e,t,r,s){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),u=mg(e);let d=rs(1);t&&(s?$n(s)&&(d=Ao(s)):d=Ao(e));const l=SI(u,r,s)?YS(u):rs(0);let c=(o.left+l.x)/d.x,f=(o.top+l.y)/d.y,m=o.width/d.x,h=o.height/d.y;if(u){const x=un(u),w=s&&$n(s)?un(s):s;let k=x,_=Fm(k);for(;_&&s&&w!==k;){const v=Ao(_),b=_.getBoundingClientRect(),g=zn(_),y=b.left+(_.clientLeft+parseFloat(g.paddingLeft))*v.x,j=b.top+(_.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,f*=v.y,m*=v.x,h*=v.y,c+=y,f+=j,k=un(_),_=Fm(k)}}return Mu({width:m,height:h,x:c,y:f})}function md(e,t){const r=fd(e).scrollLeft;return t?t.left+r:zi(cs(e)).left+r}function XS(e,t){const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-md(e,r),o=r.top+t.scrollTop;return{x:s,y:o}}function CI(e){let{elements:t,rect:r,offsetParent:s,strategy:o}=e;const u=o==="fixed",d=cs(s),l=t?hd(t.floating):!1;if(s===d||l&&u)return r;let c={scrollLeft:0,scrollTop:0},f=rs(1);const m=rs(0),h=is(s);if((h||!h&&!u)&&((Yo(s)!=="body"||Nl(d))&&(c=fd(s)),is(s))){const w=zi(s);f=Ao(s),m.x=w.x+s.clientLeft,m.y=w.y+s.clientTop}const x=d&&!h&&!u?XS(d,c):rs(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-c.scrollLeft*f.x+m.x+x.x,y:r.y*f.y-c.scrollTop*f.y+m.y+x.y}}function kI(e){return Array.from(e.getClientRects())}function jI(e){const t=cs(e),r=fd(e),s=e.ownerDocument.body,o=sn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=sn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let d=-r.scrollLeft+md(e);const l=-r.scrollTop;return zn(s).direction==="rtl"&&(d+=sn(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:d,y:l}}const Db=25;function NI(e,t){const r=un(e),s=cs(e),o=r.visualViewport;let u=s.clientWidth,d=s.clientHeight,l=0,c=0;if(o){u=o.width,d=o.height;const m=fg();(!m||m&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const f=md(s);if(f<=0){const m=s.ownerDocument,h=m.body,x=getComputedStyle(h),w=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,k=Math.abs(s.clientWidth-h.clientWidth-w);k<=Db&&(u-=k)}else f<=Db&&(u+=f);return{width:u,height:d,x:l,y:c}}const EI=new Set(["absolute","fixed"]);function PI(e,t){const r=zi(e,!0,t==="fixed"),s=r.top+e.clientTop,o=r.left+e.clientLeft,u=is(e)?Ao(e):rs(1),d=e.clientWidth*u.x,l=e.clientHeight*u.y,c=o*u.x,f=s*u.y;return{width:d,height:l,x:c,y:f}}function Lb(e,t,r){let s;if(t==="viewport")s=NI(e,r);else if(t==="document")s=jI(cs(e));else if($n(t))s=PI(t,r);else{const o=YS(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Mu(s)}function JS(e,t){const r=oi(e);return r===t||!$n(r)||Fo(r)?!1:zn(r).position==="fixed"||JS(r,t)}function AI(e,t){const r=t.get(e);if(r)return r;let s=ol(e,[],!1).filter(l=>$n(l)&&Yo(l)!=="body"),o=null;const u=zn(e).position==="fixed";let d=u?oi(e):e;for(;$n(d)&&!Fo(d);){const l=zn(d),c=hg(d);!c&&l.position==="fixed"&&(o=null),(u?!c&&!o:!c&&l.position==="static"&&!!o&&EI.has(o.position)||Nl(d)&&!c&&JS(e,d))?s=s.filter(m=>m!==d):o=l,d=oi(d)}return t.set(e,s),s}function TI(e){let{element:t,boundary:r,rootBoundary:s,strategy:o}=e;const d=[...r==="clippingAncestors"?hd(t)?[]:AI(t,this._c):[].concat(r),s],l=d[0],c=d.reduce((f,m)=>{const h=Lb(t,m,o);return f.top=sn(h.top,f.top),f.right=ii(h.right,f.right),f.bottom=ii(h.bottom,f.bottom),f.left=sn(h.left,f.left),f},Lb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function RI(e){const{width:t,height:r}=qS(e);return{width:t,height:r}}function MI(e,t,r){const s=is(t),o=cs(t),u=r==="fixed",d=zi(e,!0,u,t);let l={scrollLeft:0,scrollTop:0};const c=rs(0);function f(){c.x=md(o)}if(s||!s&&!u)if((Yo(t)!=="body"||Nl(o))&&(l=fd(t)),s){const w=zi(t,!0,u,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else o&&f();u&&!s&&o&&f();const m=o&&!s&&!u?XS(o,l):rs(0),h=d.left+l.scrollLeft-c.x-m.x,x=d.top+l.scrollTop-c.y-m.y;return{x:h,y:x,width:d.width,height:d.height}}function Wf(e){return zn(e).position==="static"}function Ib(e,t){if(!is(e)||zn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return cs(e)===r&&(r=r.ownerDocument.body),r}function QS(e,t){const r=un(e);if(hd(e))return r;if(!is(e)){let o=oi(e);for(;o&&!Fo(o);){if($n(o)&&!Wf(o))return o;o=oi(o)}return r}let s=Ib(e,t);for(;s&&pI(s)&&Wf(s);)s=Ib(s,t);return s&&Fo(s)&&Wf(s)&&!hg(s)?r:s||bI(e)||r}const DI=async function(e){const t=this.getOffsetParent||QS,r=this.getDimensions,s=await r(e.floating);return{reference:MI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function LI(e){return zn(e).direction==="rtl"}const II={convertOffsetParentRelativeRectToViewportRelativeRect:CI,getDocumentElement:cs,getClippingRect:TI,getOffsetParent:QS,getElementRects:DI,getClientRects:kI,getDimensions:RI,getScale:Ao,isElement:$n,isRTL:LI};function ZS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function OI(e,t){let r=null,s;const o=cs(e);function u(){var l;clearTimeout(s),(l=r)==null||l.disconnect(),r=null}function d(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),u();const f=e.getBoundingClientRect(),{left:m,top:h,width:x,height:w}=f;if(l||t(),!x||!w)return;const k=nu(h),_=nu(o.clientWidth-(m+x)),v=nu(o.clientHeight-(h+w)),b=nu(m),y={rootMargin:-k+"px "+-_+"px "+-v+"px "+-b+"px",threshold:sn(0,ii(1,c))||1};let j=!0;function E(P){const T=P[0].intersectionRatio;if(T!==c){if(!j)return d();T?d(!1,T):s=setTimeout(()=>{d(!1,1e-7)},1e3)}T===1&&!ZS(f,e.getBoundingClientRect())&&d(),j=!1}try{r=new IntersectionObserver(E,{...y,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,y)}r.observe(e)}return d(!0),u}function BI(e,t,r,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,f=mg(e),m=o||u?[...f?ol(f):[],...ol(t)]:[];m.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),u&&b.addEventListener("resize",r)});const h=f&&l?OI(f,r):null;let x=-1,w=null;d&&(w=new ResizeObserver(b=>{let[g]=b;g&&g.target===f&&w&&(w.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var y;(y=w)==null||y.observe(t)})),r()}),f&&!c&&w.observe(f),w.observe(t));let k,_=c?zi(e):null;c&&v();function v(){const b=zi(e);_&&!ZS(_,b)&&r(),_=b,k=requestAnimationFrame(v)}return r(),()=>{var b;m.forEach(g=>{o&&g.removeEventListener("scroll",r),u&&g.removeEventListener("resize",r)}),h==null||h(),(b=w)==null||b.disconnect(),w=null,c&&cancelAnimationFrame(k)}}const FI=cI,$I=uI,zI=oI,HI=hI,WI=aI,Ob=iI,VI=dI,UI=(e,t,r)=>{const s=new Map,o={platform:II,...r},u={...o.platform,_c:s};return sI(e,t,{...o,platform:u})};var GI=typeof document<"u",KI=function(){},mu=GI?C.useLayoutEffect:KI;function Du(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(s=r;s--!==0;)if(!Du(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Du(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function eC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bb(e,t){const r=eC(e);return Math.round(t*r)/r}function Vf(e){const t=C.useRef(e);return mu(()=>{t.current=e}),t}function qI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:d}={},transform:l=!0,whileElementsMounted:c,open:f}=e,[m,h]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,w]=C.useState(s);Du(x,s)||w(s);const[k,_]=C.useState(null),[v,b]=C.useState(null),g=C.useCallback(U=>{U!==P.current&&(P.current=U,_(U))},[]),y=C.useCallback(U=>{U!==T.current&&(T.current=U,b(U))},[]),j=u||k,E=d||v,P=C.useRef(null),T=C.useRef(null),N=C.useRef(m),R=c!=null,I=Vf(c),O=Vf(o),$=Vf(f),W=C.useCallback(()=>{if(!P.current||!T.current)return;const U={placement:t,strategy:r,middleware:x};O.current&&(U.platform=O.current),UI(P.current,T.current,U).then(L=>{const M={...L,isPositioned:$.current!==!1};Y.current&&!Du(N.current,M)&&(N.current=M,pl.flushSync(()=>{h(M)}))})},[x,t,r,O,$]);mu(()=>{f===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const Y=C.useRef(!1);mu(()=>(Y.current=!0,()=>{Y.current=!1}),[]),mu(()=>{if(j&&(P.current=j),E&&(T.current=E),j&&E){if(I.current)return I.current(j,E,W);W()}},[j,E,W,I,R]);const z=C.useMemo(()=>({reference:P,floating:T,setReference:g,setFloating:y}),[g,y]),K=C.useMemo(()=>({reference:j,floating:E}),[j,E]),G=C.useMemo(()=>{const U={position:r,left:0,top:0};if(!K.floating)return U;const L=Bb(K.floating,m.x),M=Bb(K.floating,m.y);return l?{...U,transform:"translate("+L+"px, "+M+"px)",...eC(K.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:L,top:M}},[r,l,K.floating,m.x,m.y]);return C.useMemo(()=>({...m,update:W,refs:z,elements:K,floatingStyles:G}),[m,W,z,K,G])}const YI=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:o}=typeof e=="function"?e(r):e;return s&&t(s)?s.current!=null?Ob({element:s.current,padding:o}).fn(r):{}:s?Ob({element:s,padding:o}).fn(r):{}}}},XI=(e,t)=>({...FI(e),options:[e,t]}),JI=(e,t)=>({...$I(e),options:[e,t]}),QI=(e,t)=>({...VI(e),options:[e,t]}),ZI=(e,t)=>({...zI(e),options:[e,t]}),eO=(e,t)=>({...HI(e),options:[e,t]}),tO=(e,t)=>({...WI(e),options:[e,t]}),rO=(e,t)=>({...YI(e),options:[e,t]});var nO="Arrow",tC=C.forwardRef((e,t)=>{const{children:r,width:s=10,height:o=5,...u}=e;return n.jsx(Xe.svg,{...u,ref:t,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});tC.displayName=nO;var sO=tC,pg="Popper",[rC,Xo]=Xr(pg),[iO,nC]=rC(pg),sC=e=>{const{__scopePopper:t,children:r}=e,[s,o]=C.useState(null);return n.jsx(iO,{scope:t,anchor:s,onAnchorChange:o,children:r})};sC.displayName=pg;var iC="PopperAnchor",oC=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:s,...o}=e,u=nC(iC,r),d=C.useRef(null),l=it(t,d),c=C.useRef(null);return C.useEffect(()=>{const f=c.current;c.current=(s==null?void 0:s.current)||d.current,f!==c.current&&u.onAnchorChange(c.current)}),s?null:n.jsx(Xe.div,{...o,ref:l})});oC.displayName=iC;var gg="PopperContent",[oO,aO]=rC(gg),aC=C.forwardRef((e,t)=>{var X,H,ae,ne,J,ie;const{__scopePopper:r,side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:x=!1,updatePositionStrategy:w="optimized",onPlaced:k,..._}=e,v=nC(gg,r),[b,g]=C.useState(null),y=it(t,ye=>g(ye)),[j,E]=C.useState(null),P=ig(j),T=(P==null?void 0:P.width)??0,N=(P==null?void 0:P.height)??0,R=s+(u!=="center"?"-"+u:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},O=Array.isArray(f)?f:[f],$=O.length>0,W={padding:I,boundary:O.filter(cO),altBoundary:$},{refs:Y,floatingStyles:z,placement:K,isPositioned:G,middlewareData:U}=qI({strategy:"fixed",placement:R,whileElementsMounted:(...ye)=>BI(...ye,{animationFrame:w==="always"}),elements:{reference:v.anchor},middleware:[XI({mainAxis:o+N,alignmentAxis:d}),c&&JI({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?QI():void 0,...W}),c&&ZI({...W}),eO({...W,apply:({elements:ye,rects:Oe,availableWidth:Ve,availableHeight:re})=>{const{width:de,height:De}=Oe.reference,Re=ye.floating.style;Re.setProperty("--radix-popper-available-width",`${Ve}px`),Re.setProperty("--radix-popper-available-height",`${re}px`),Re.setProperty("--radix-popper-anchor-width",`${de}px`),Re.setProperty("--radix-popper-anchor-height",`${De}px`)}}),j&&rO({element:j,padding:l}),uO({arrowWidth:T,arrowHeight:N}),x&&tO({strategy:"referenceHidden",...W})]}),[L,M]=uC(K),B=_r(k);gr(()=>{G&&(B==null||B())},[G,B]);const q=(X=U.arrow)==null?void 0:X.x,F=(H=U.arrow)==null?void 0:H.y,oe=((ae=U.arrow)==null?void 0:ae.centerOffset)!==0,[fe,me]=C.useState();return gr(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),n.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:G?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ne=U.transformOrigin)==null?void 0:ne.x,(J=U.transformOrigin)==null?void 0:J.y].join(" "),...((ie=U.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(oO,{scope:r,placedSide:L,onArrowChange:E,arrowX:q,arrowY:F,shouldHideArrow:oe,children:n.jsx(Xe.div,{"data-side":L,"data-align":M,..._,ref:y,style:{..._.style,animation:G?void 0:"none"}})})})});aC.displayName=gg;var lC="PopperArrow",lO={top:"bottom",right:"left",bottom:"top",left:"right"},cC=C.forwardRef(function(t,r){const{__scopePopper:s,...o}=t,u=aO(lC,s),d=lO[u.placedSide];return n.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:n.jsx(sO,{...o,ref:r,style:{...o.style,display:"block"}})})});cC.displayName=lC;function cO(e){return e!==null}var uO=e=>({name:"transformOrigin",options:e,fn(t){var v,b,g;const{placement:r,rects:s,middlewareData:o}=t,d=((v=o.arrow)==null?void 0:v.centerOffset)!==0,l=d?0:e.arrowWidth,c=d?0:e.arrowHeight,[f,m]=uC(r),h={start:"0%",center:"50%",end:"100%"}[m],x=(((b=o.arrow)==null?void 0:b.x)??0)+l/2,w=(((g=o.arrow)==null?void 0:g.y)??0)+c/2;let k="",_="";return f==="bottom"?(k=d?h:`${x}px`,_=`${-c}px`):f==="top"?(k=d?h:`${x}px`,_=`${s.floating.height+c}px`):f==="right"?(k=`${-c}px`,_=d?h:`${w}px`):f==="left"&&(k=`${s.floating.width+c}px`,_=d?h:`${w}px`),{data:{x:k,y:_}}}});function uC(e){const[t,r="center"]=e.split("-");return[t,r]}var xg=sC,vg=oC,yg=aC,bg=cC;function dO(e){const t=hO(e),r=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(mO);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return n.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function hO(e){const t=C.forwardRef((r,s)=>{const{children:o,...u}=r;if(C.isValidElement(o)){const d=gO(o),l=pO(u,o.props);return o.type!==C.Fragment&&(l.ref=s?js(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fO=Symbol("radix.slottable");function mO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fO}function pO(e,t){const r={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function gO(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xO="VisuallyHidden",hC=C.forwardRef((e,t)=>n.jsx(Xe.span,{...e,ref:t,style:{...dC,...e.style}}));hC.displayName=xO;var vO=hC,yO=[" ","Enter","ArrowUp","ArrowDown"],bO=[" ","Enter"],Hi="Select",[pd,gd,wO]=lg(Hi),[Jo]=Xr(Hi,[wO,Xo]),xd=Xo(),[_O,di]=Jo(Hi),[SO,CO]=Jo(Hi),fC=e=>{const{__scopeSelect:t,children:r,open:s,defaultOpen:o,onOpenChange:u,value:d,defaultValue:l,onValueChange:c,dir:f,name:m,autoComplete:h,disabled:x,required:w,form:k}=e,_=xd(t),[v,b]=C.useState(null),[g,y]=C.useState(null),[j,E]=C.useState(!1),P=Sl(f),[T,N]=ss({prop:s,defaultProp:o??!1,onChange:u,caller:Hi}),[R,I]=ss({prop:d,defaultProp:l,onChange:c,caller:Hi}),O=C.useRef(null),$=v?k||!!v.closest("form"):!0,[W,Y]=C.useState(new Set),z=Array.from(W).map(K=>K.props.value).join(";");return n.jsx(xg,{..._,children:n.jsxs(_O,{required:w,scope:t,trigger:v,onTriggerChange:b,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:E,contentId:Sn(),value:R,onValueChange:I,open:T,onOpenChange:N,dir:P,triggerPointerDownPosRef:O,disabled:x,children:[n.jsx(pd.Provider,{scope:t,children:n.jsx(SO,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(K=>{Y(G=>new Set(G).add(K))},[]),onNativeOptionRemove:C.useCallback(K=>{Y(G=>{const U=new Set(G);return U.delete(K),U})},[]),children:r})}),$?n.jsxs(OC,{"aria-hidden":!0,required:w,tabIndex:-1,name:m,autoComplete:h,value:R,onChange:K=>I(K.target.value),disabled:x,form:k,children:[R===void 0?n.jsx("option",{value:""}):null,Array.from(W)]},z):null]})})};fC.displayName=Hi;var mC="SelectTrigger",pC=C.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:s=!1,...o}=e,u=xd(r),d=di(mC,r),l=d.disabled||s,c=it(t,d.onTriggerChange),f=gd(r),m=C.useRef("touch"),[h,x,w]=FC(_=>{const v=f().filter(y=>!y.disabled),b=v.find(y=>y.value===d.value),g=$C(v,_,b);g!==void 0&&d.onValueChange(g.value)}),k=_=>{l||(d.onOpenChange(!0),w()),_&&(d.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return n.jsx(vg,{asChild:!0,...u,children:n.jsx(Xe.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":BC(d.value)?"":void 0,...o,ref:c,onClick:Te(o.onClick,_=>{_.currentTarget.focus(),m.current!=="mouse"&&k(_)}),onPointerDown:Te(o.onPointerDown,_=>{m.current=_.pointerType;const v=_.target;v.hasPointerCapture(_.pointerId)&&v.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(k(_),_.preventDefault())}),onKeyDown:Te(o.onKeyDown,_=>{const v=h.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&x(_.key),!(v&&_.key===" ")&&yO.includes(_.key)&&(k(),_.preventDefault())})})})});pC.displayName=mC;var gC="SelectValue",xC=C.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:o,children:u,placeholder:d="",...l}=e,c=di(gC,r),{onValueNodeHasChildrenChange:f}=c,m=u!==void 0,h=it(t,c.onValueNodeChange);return gr(()=>{f(m)},[f,m]),n.jsx(Xe.span,{...l,ref:h,style:{pointerEvents:"none"},children:BC(c.value)?n.jsx(n.Fragment,{children:d}):u})});xC.displayName=gC;var kO="SelectIcon",vC=C.forwardRef((e,t)=>{const{__scopeSelect:r,children:s,...o}=e;return n.jsx(Xe.span,{"aria-hidden":!0,...o,ref:t,children:s||"▼"})});vC.displayName=kO;var jO="SelectPortal",yC=e=>n.jsx(kl,{asChild:!0,...e});yC.displayName=jO;var Wi="SelectContent",bC=C.forwardRef((e,t)=>{const r=di(Wi,e.__scopeSelect),[s,o]=C.useState();if(gr(()=>{o(new DocumentFragment)},[]),!r.open){const u=s;return u?pl.createPortal(n.jsx(wC,{scope:e.__scopeSelect,children:n.jsx(pd.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),u):null}return n.jsx(_C,{...e,ref:t})});bC.displayName=Wi;var On=10,[wC,hi]=Jo(Wi),NO="SelectContentImpl",EO=dO("SelectContent.RemoveScroll"),_C=C.forwardRef((e,t)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:u,onPointerDownOutside:d,side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:w,sticky:k,hideWhenDetached:_,avoidCollisions:v,...b}=e,g=di(Wi,r),[y,j]=C.useState(null),[E,P]=C.useState(null),T=it(t,X=>j(X)),[N,R]=C.useState(null),[I,O]=C.useState(null),$=gd(r),[W,Y]=C.useState(!1),z=C.useRef(!1);C.useEffect(()=>{if(y)return Qp(y)},[y]),Jp();const K=C.useCallback(X=>{const[H,...ae]=$().map(ie=>ie.ref.current),[ne]=ae.slice(-1),J=document.activeElement;for(const ie of X)if(ie===J||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===H&&E&&(E.scrollTop=0),ie===ne&&E&&(E.scrollTop=E.scrollHeight),ie==null||ie.focus(),document.activeElement!==J))return},[$,E]),G=C.useCallback(()=>K([N,y]),[K,N,y]);C.useEffect(()=>{W&&G()},[W,G]);const{onOpenChange:U,triggerPointerDownPosRef:L}=g;C.useEffect(()=>{if(y){let X={x:0,y:0};const H=ne=>{var J,ie;X={x:Math.abs(Math.round(ne.pageX)-(((J=L.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((ie=L.current)==null?void 0:ie.y)??0))}},ae=ne=>{X.x<=10&&X.y<=10?ne.preventDefault():y.contains(ne.target)||U(!1),document.removeEventListener("pointermove",H),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",ae,{capture:!0})}}},[y,U,L]),C.useEffect(()=>{const X=()=>U(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[U]);const[M,B]=FC(X=>{const H=$().filter(J=>!J.disabled),ae=H.find(J=>J.ref.current===document.activeElement),ne=$C(H,X,ae);ne&&setTimeout(()=>ne.ref.current.focus())}),q=C.useCallback((X,H,ae)=>{const ne=!z.current&&!ae;(g.value!==void 0&&g.value===H||ne)&&(R(X),ne&&(z.current=!0))},[g.value]),F=C.useCallback(()=>y==null?void 0:y.focus(),[y]),oe=C.useCallback((X,H,ae)=>{const ne=!z.current&&!ae;(g.value!==void 0&&g.value===H||ne)&&O(X)},[g.value]),fe=s==="popper"?$m:SC,me=fe===$m?{side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:w,sticky:k,hideWhenDetached:_,avoidCollisions:v}:{};return n.jsx(wC,{scope:r,content:y,viewport:E,onViewportChange:P,itemRefCallback:q,selectedItem:N,onItemLeave:F,itemTextRefCallback:oe,focusSelectedItem:G,selectedItemText:I,position:s,isPositioned:W,searchRef:M,children:n.jsx(sd,{as:EO,allowPinchZoom:!0,children:n.jsx(rd,{asChild:!0,trapped:g.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Te(o,X=>{var H;(H=g.trigger)==null||H.focus({preventScroll:!0}),X.preventDefault()}),children:n.jsx(Cl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:n.jsx(fe,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:X=>X.preventDefault(),...b,...me,onPlaced:()=>Y(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,X=>{const H=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!H&&X.key.length===1&&B(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let ne=$().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(X.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const J=X.target,ie=ne.indexOf(J);ne=ne.slice(ie+1)}setTimeout(()=>K(ne)),X.preventDefault()}})})})})})})});_C.displayName=NO;var PO="SelectItemAlignedPosition",SC=C.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:s,...o}=e,u=di(Wi,r),d=hi(Wi,r),[l,c]=C.useState(null),[f,m]=C.useState(null),h=it(t,T=>m(T)),x=gd(r),w=C.useRef(!1),k=C.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:g}=d,y=C.useCallback(()=>{if(u.trigger&&u.valueNode&&l&&f&&_&&v&&b){const T=u.trigger.getBoundingClientRect(),N=f.getBoundingClientRect(),R=u.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(u.dir!=="rtl"){const J=I.left-N.left,ie=R.left-J,ye=T.left-ie,Oe=T.width+ye,Ve=Math.max(Oe,N.width),re=window.innerWidth-On,de=Dm(ie,[On,Math.max(On,re-Ve)]);l.style.minWidth=Oe+"px",l.style.left=de+"px"}else{const J=N.right-I.right,ie=window.innerWidth-R.right-J,ye=window.innerWidth-T.right-ie,Oe=T.width+ye,Ve=Math.max(Oe,N.width),re=window.innerWidth-On,de=Dm(ie,[On,Math.max(On,re-Ve)]);l.style.minWidth=Oe+"px",l.style.right=de+"px"}const O=x(),$=window.innerHeight-On*2,W=_.scrollHeight,Y=window.getComputedStyle(f),z=parseInt(Y.borderTopWidth,10),K=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),U=parseInt(Y.paddingBottom,10),L=z+K+W+U+G,M=Math.min(v.offsetHeight*5,L),B=window.getComputedStyle(_),q=parseInt(B.paddingTop,10),F=parseInt(B.paddingBottom,10),oe=T.top+T.height/2-On,fe=$-oe,me=v.offsetHeight/2,X=v.offsetTop+me,H=z+K+X,ae=L-H;if(H<=oe){const J=O.length>0&&v===O[O.length-1].ref.current;l.style.bottom="0px";const ie=f.clientHeight-_.offsetTop-_.offsetHeight,ye=Math.max(fe,me+(J?F:0)+ie+G),Oe=H+ye;l.style.height=Oe+"px"}else{const J=O.length>0&&v===O[0].ref.current;l.style.top="0px";const ye=Math.max(oe,z+_.offsetTop+(J?q:0)+me)+ae;l.style.height=ye+"px",_.scrollTop=H-oe+_.offsetTop}l.style.margin=`${On}px 0`,l.style.minHeight=M+"px",l.style.maxHeight=$+"px",s==null||s(),requestAnimationFrame(()=>w.current=!0)}},[x,u.trigger,u.valueNode,l,f,_,v,b,u.dir,s]);gr(()=>y(),[y]);const[j,E]=C.useState();gr(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const P=C.useCallback(T=>{T&&k.current===!0&&(y(),g==null||g(),k.current=!1)},[y,g]);return n.jsx(TO,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:P,children:n.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:n.jsx(Xe.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});SC.displayName=PO;var AO="SelectPopperPosition",$m=C.forwardRef((e,t)=>{const{__scopeSelect:r,align:s="start",collisionPadding:o=On,...u}=e,d=xd(r);return n.jsx(yg,{...d,...u,ref:t,align:s,collisionPadding:o,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$m.displayName=AO;var[TO,wg]=Jo(Wi,{}),zm="SelectViewport",CC=C.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:s,...o}=e,u=hi(zm,r),d=wg(zm,r),l=it(t,u.onViewportChange),c=C.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),n.jsx(pd.Slot,{scope:r,children:n.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,f=>{const m=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:x}=d;if(x!=null&&x.current&&h){const w=Math.abs(c.current-m.scrollTop);if(w>0){const k=window.innerHeight-On*2,_=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),b=Math.max(_,v);if(b<k){const g=b+w,y=Math.min(k,g),j=g-y;h.style.height=y+"px",h.style.bottom==="0px"&&(m.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});CC.displayName=zm;var kC="SelectGroup",[RO,MO]=Jo(kC),DO=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,o=Sn();return n.jsx(RO,{scope:r,id:o,children:n.jsx(Xe.div,{role:"group","aria-labelledby":o,...s,ref:t})})});DO.displayName=kC;var jC="SelectLabel",NC=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,o=MO(jC,r);return n.jsx(Xe.div,{id:o.id,...s,ref:t})});NC.displayName=jC;var Lu="SelectItem",[LO,EC]=Jo(Lu),PC=C.forwardRef((e,t)=>{const{__scopeSelect:r,value:s,disabled:o=!1,textValue:u,...d}=e,l=di(Lu,r),c=hi(Lu,r),f=l.value===s,[m,h]=C.useState(u??""),[x,w]=C.useState(!1),k=it(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,s,o)}),_=Sn(),v=C.useRef("touch"),b=()=>{o||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(LO,{scope:r,value:s,disabled:o,textId:_,isSelected:f,onItemTextChange:C.useCallback(g=>{h(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:n.jsx(pd.ItemSlot,{scope:r,value:s,disabled:o,textValue:m,children:n.jsx(Xe.div,{role:"option","aria-labelledby":_,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:k,onFocus:Te(d.onFocus,()=>w(!0)),onBlur:Te(d.onBlur,()=>w(!1)),onClick:Te(d.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Te(d.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Te(d.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:Te(d.onPointerMove,g=>{var y;v.current=g.pointerType,o?(y=c.onItemLeave)==null||y.call(c):v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(d.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Te(d.onKeyDown,g=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&g.key===" "||(bO.includes(g.key)&&b(),g.key===" "&&g.preventDefault())})})})})});PC.displayName=Lu;var Ua="SelectItemText",AC=C.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:o,...u}=e,d=di(Ua,r),l=hi(Ua,r),c=EC(Ua,r),f=CO(Ua,r),[m,h]=C.useState(null),x=it(t,b=>h(b),c.onItemTextChange,b=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,b,c.value,c.disabled)}),w=m==null?void 0:m.textContent,k=C.useMemo(()=>n.jsx("option",{value:c.value,disabled:c.disabled,children:w},c.value),[c.disabled,c.value,w]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=f;return gr(()=>(_(k),()=>v(k)),[_,v,k]),n.jsxs(n.Fragment,{children:[n.jsx(Xe.span,{id:c.textId,...u,ref:x}),c.isSelected&&d.valueNode&&!d.valueNodeHasChildren?pl.createPortal(u.children,d.valueNode):null]})});AC.displayName=Ua;var TC="SelectItemIndicator",RC=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return EC(TC,r).isSelected?n.jsx(Xe.span,{"aria-hidden":!0,...s,ref:t}):null});RC.displayName=TC;var Hm="SelectScrollUpButton",MC=C.forwardRef((e,t)=>{const r=hi(Hm,e.__scopeSelect),s=wg(Hm,e.__scopeSelect),[o,u]=C.useState(!1),d=it(t,s.onScrollButtonChange);return gr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=c.scrollTop>0;u(f)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?n.jsx(LC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});MC.displayName=Hm;var Wm="SelectScrollDownButton",DC=C.forwardRef((e,t)=>{const r=hi(Wm,e.__scopeSelect),s=wg(Wm,e.__scopeSelect),[o,u]=C.useState(!1),d=it(t,s.onScrollButtonChange);return gr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<f;u(m)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?n.jsx(LC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});DC.displayName=Wm;var LC=C.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:s,...o}=e,u=hi("SelectScrollButton",r),d=C.useRef(null),l=gd(r),c=C.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),gr(()=>{var m;const f=l().find(h=>h.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),n.jsx(Xe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:Te(o.onPointerMove,()=>{var f;(f=u.onItemLeave)==null||f.call(u),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{c()})})}),IO="SelectSeparator",IC=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return n.jsx(Xe.div,{"aria-hidden":!0,...s,ref:t})});IC.displayName=IO;var Vm="SelectArrow",OO=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,o=xd(r),u=di(Vm,r),d=hi(Vm,r);return u.open&&d.position==="popper"?n.jsx(bg,{...o,...s,ref:t}):null});OO.displayName=Vm;var BO="SelectBubbleInput",OC=C.forwardRef(({__scopeSelect:e,value:t,...r},s)=>{const o=C.useRef(null),u=it(s,o),d=sg(t);return C.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(d!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[d,t]),n.jsx(Xe.select,{...r,style:{...dC,...r.style},ref:u,defaultValue:t})});OC.displayName=BO;function BC(e){return e===""||e===void 0}function FC(e){const t=_r(e),r=C.useRef(""),s=C.useRef(0),o=C.useCallback(d=>{const l=r.current+d;t(l),(function c(f){r.current=f,window.clearTimeout(s.current),f!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),u=C.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,o,u]}function $C(e,t,r){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,u=r?e.indexOf(r):-1;let d=FO(e,Math.max(u,0));o.length===1&&(d=d.filter(f=>f!==r));const c=d.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function FO(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var $O=fC,zC=pC,zO=xC,HO=vC,WO=yC,HC=bC,VO=CC,WC=NC,VC=PC,UO=AC,GO=RC,UC=MC,GC=DC,KC=IC;const fr=$O,mr=zO,ar=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(zC,{ref:s,className:je("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,n.jsx(HO,{asChild:!0,children:n.jsx(Sr,{className:"h-4 w-4 opacity-50"})})]}));ar.displayName=zC.displayName;const qC=C.forwardRef(({className:e,...t},r)=>n.jsx(UC,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(hM,{className:"h-4 w-4"})}));qC.displayName=UC.displayName;const YC=C.forwardRef(({className:e,...t},r)=>n.jsx(GC,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(Sr,{className:"h-4 w-4"})}));YC.displayName=GC.displayName;const lr=C.forwardRef(({className:e,children:t,position:r="popper",...s},o)=>n.jsx(WO,{children:n.jsxs(HC,{ref:o,className:je("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...s,children:[n.jsx(qC,{}),n.jsx(VO,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),n.jsx(YC,{})]})}));lr.displayName=HC.displayName;const KO=C.forwardRef(({className:e,...t},r)=>n.jsx(WC,{ref:r,className:je("px-2 py-1.5 text-sm font-semibold",e),...t}));KO.displayName=WC.displayName;const xt=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(VC,{ref:s,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(GO,{children:n.jsx(Kt,{className:"h-4 w-4"})})}),n.jsx(UO,{children:t})]}));xt.displayName=VC.displayName;const qO=C.forwardRef(({className:e,...t},r)=>n.jsx(KC,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));qO.displayName=KC.displayName;const Uf={claude:{name:"Claude Code",folder:".claude",color:"text-orange-600",bg:"bg-orange-50",darkBg:"dark:bg-orange-950/30"},gemini:{name:"Gemini CLI",folder:".gemini",color:"text-blue-600",bg:"bg-blue-50",darkBg:"dark:bg-blue-950/30"},antigravity:{name:"Antigravity",folder:".agent",color:"text-purple-600",bg:"bg-purple-50",darkBg:"dark:bg-purple-950/30"}};function YO({open:e,onOpenChange:t,projectDir:r,onSynced:s}){var N,R,I;const[o,u]=C.useState("claude"),[d,l]=C.useState("antigravity"),[c,f]=C.useState(null),[m,h]=C.useState(!1),[x,w]=C.useState(!1),[k,_]=C.useState(new Set);C.useEffect(()=>{e&&r&&v()},[e,o,d,r]),C.useEffect(()=>{e&&_(new Set)},[e]);const v=async()=>{var O;h(!0);try{const $=await ke.getSyncPreview(r,o,d);f($);const W=new Set(((O=$.files)==null?void 0:O.filter(Y=>Y.status==="new"||Y.status==="different").map(Y=>Y.name))||[]);_(W)}catch($){ee.error("Failed to load sync preview: "+$.message),f(null)}finally{h(!1)}},b=()=>{u(d),l(o)},g=O=>{const $=new Set(k);$.has(O)?$.delete(O):$.add(O),_($)},y=()=>{var O,$;k.size===((O=c==null?void 0:c.files)==null?void 0:O.length)?_(new Set):_(new Set((($=c==null?void 0:c.files)==null?void 0:$.map(W=>W.name))||[]))},j=async()=>{if(k.size===0){ee.error("Please select at least one file to sync");return}w(!0);try{const O=await ke.syncRules(r,o,d,Array.from(k));O.success?(ee.success(`Synced ${O.synced.length} file(s) to ${Uf[d].name}`),s==null||s(),t(!1)):ee.error(O.error||"Sync failed")}catch(O){ee.error("Sync failed: "+O.message)}finally{w(!1)}},E=O=>{switch(O){case"new":return n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700",children:"New"});case"different":return n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-yellow-100 text-yellow-700",children:"Modified"});case"identical":return n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 dark:bg-slate-700 text-gray-500 dark:text-slate-400",children:"Same"});default:return null}},P=Uf[o],T=Uf[d];return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(pr,{className:"w-5 h-5 text-indigo-500"}),"Sync Rules Between Tools"]}),n.jsx(tr,{children:"Copy rules from one AI tool's configuration to another."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"From"}),n.jsxs(fr,{value:o,onValueChange:u,children:[n.jsx(ar,{className:"w-full",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"claude",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),n.jsx(xt,{value:"gemini",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),n.jsx(xt,{value:"antigravity",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]}),n.jsx(le,{variant:"ghost",size:"icon",onClick:b,className:"mt-5",title:"Swap direction",children:n.jsx(Hp,{className:"w-4 h-4"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"To"}),n.jsxs(fr,{value:d,onValueChange:l,children:[n.jsx(ar,{className:"w-full",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"claude",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),n.jsx(xt,{value:"gemini",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),n.jsx(xt,{value:"antigravity",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[n.jsxs("div",{children:["Source: ",n.jsxs("code",{className:"bg-muted px-1 rounded",children:[P.folder,"/rules/"]})]}),n.jsxs("div",{children:["Target: ",n.jsxs("code",{className:"bg-muted px-1 rounded",children:[T.folder,"/rules/"]})]})]}),n.jsxs("div",{className:"border rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[n.jsx("span",{className:"text-sm font-medium",children:"Rules to Sync"}),((N=c==null?void 0:c.files)==null?void 0:N.length)>0&&n.jsx(le,{variant:"ghost",size:"sm",onClick:y,className:"h-6 text-xs",children:k.size===c.files.length?"Deselect All":"Select All"})]}),n.jsx("div",{className:"max-h-64 overflow-auto",children:m?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(ut,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):c!=null&&c.error?n.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-amber-600",children:[n.jsx(Oi,{className:"w-4 h-4"}),c.error]}):((R=c==null?void 0:c.files)==null?void 0:R.length)===0?n.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No rules found in source folder"}):n.jsx("div",{className:"divide-y",children:(I=c==null?void 0:c.files)==null?void 0:I.map(O=>n.jsxs("label",{className:je("flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-muted/30",k.has(O.name)&&"bg-primary/5"),children:[n.jsx(jl,{checked:k.has(O.name),onCheckedChange:()=>g(O.name)}),n.jsx(Cr,{className:"w-4 h-4 text-purple-500"}),n.jsx("span",{className:"flex-1 text-sm",children:O.name}),E(O.status)]},O.name))})})]}),(c==null?void 0:c.files)&&k.size>0&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.size," file(s) selected for sync"]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:j,disabled:x||m||k.size===0,children:x?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Syncing..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Kt,{className:"w-4 h-4 mr-2"}),"Sync ",k.size," File(s)"]})})]})]})})}const ct=C.forwardRef(({className:e,type:t,...r},s)=>n.jsx("input",{type:t,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...r}));ct.displayName="Input";function _g({open:e,onOpenChange:t,onSelect:r,type:s="directory",initialPath:o="~",title:u="Select Path"}){const[d,l]=C.useState(""),[c,f]=C.useState([]),[m,h]=C.useState(!1),[x,w]=C.useState(null),[k,_]=C.useState(""),[v,b]=C.useState("");C.useEffect(()=>{e&&g(o)},[e,o]);const g=async T=>{h(!0),w(null);try{const N=await ke.browse(T,s);N.error?(w(N.error),N.path&&(l(N.path),b(N.path))):(l(N.path),b(N.path),f(N.items||[]),N.home&&_(N.home))}catch(N){w(N.message)}finally{h(!1)}},y=T=>{T.type==="directory"?g(T.path):s==="file"&&(r(T.path),t(!1))},j=()=>{r(d),t(!1)},E=()=>{v&&g(v)},P=T=>{T.key==="Enter"&&E()};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-lg",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[s==="directory"?n.jsx(wr,{className:"w-5 h-5"}):n.jsx(Pm,{className:"w-5 h-5"}),u]})}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{value:v,onChange:T=>b(T.target.value),onKeyDown:P,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>g(k||"~"),title:"Go to home",children:n.jsx(Vp,{className:"w-4 h-4"})}),n.jsx(le,{onClick:E,disabled:m,children:"Go"})]}),n.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:d}),x&&n.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:x}),n.jsx(Nn,{className:"h-64 border rounded-lg",children:m?n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx(ut,{className:"w-6 h-6 animate-spin text-gray-400"})}):n.jsx("div",{className:"p-1",children:c.length===0?n.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:s==="directory"?"No subdirectories":"No files found"}):c.map((T,N)=>n.jsxs("button",{onClick:()=>y(T),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[T.type==="directory"?n.jsx(wr,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):n.jsx(Pm,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),n.jsx("span",{className:`flex-1 truncate ${T.isParent?"text-gray-500":""}`,children:T.name}),T.type==="directory"&&!T.isParent&&n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})]},N))})})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:j,disabled:!d,children:s==="directory"?"Select Folder":"Select"})]})]})})}var vd="Switch",[XO]=Xr(vd),[JO,QO]=XO(vd),XC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:s,checked:o,defaultChecked:u,required:d,disabled:l,value:c="on",onCheckedChange:f,form:m,...h}=e,[x,w]=C.useState(null),k=it(t,y=>w(y)),_=C.useRef(!1),v=x?m||!!x.closest("form"):!0,[b,g]=ss({prop:o,defaultProp:u??!1,onChange:f,caller:vd});return n.jsxs(JO,{scope:r,checked:b,disabled:l,children:[n.jsx(Xe.button,{type:"button",role:"switch","aria-checked":b,"aria-required":d,"data-state":ek(b),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:k,onClick:Te(e.onClick,y=>{g(j=>!j),v&&(_.current=y.isPropagationStopped(),_.current||y.stopPropagation())})}),v&&n.jsx(ZC,{control:x,bubbles:!_.current,name:s,value:c,checked:b,required:d,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});XC.displayName=vd;var JC="SwitchThumb",QC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...s}=e,o=QO(JC,r);return n.jsx(Xe.span,{"data-state":ek(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})});QC.displayName=JC;var ZO="SwitchBubbleInput",ZC=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:s=!0,...o},u)=>{const d=C.useRef(null),l=it(d,u),c=sg(r),f=ig(t);return C.useEffect(()=>{const m=d.current;if(!m)return;const h=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&w){const k=new Event("click",{bubbles:s});w.call(m,r),m.dispatchEvent(k)}},[c,r,s]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ZC.displayName=ZO;function ek(e){return e?"checked":"unchecked"}var tk=XC,e6=QC;const dt=C.forwardRef(({className:e,...t},r)=>n.jsx(tk,{className:je("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:n.jsx(e6,{className:je("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));dt.displayName=tk.displayName;var Gf="rovingFocusGroup.onEntryFocus",t6={bubbles:!1,cancelable:!0},El="RovingFocusGroup",[Um,rk,r6]=lg(El),[n6,yd]=Xr(El,[r6]),[s6,i6]=n6(El),nk=C.forwardRef((e,t)=>n.jsx(Um.Provider,{scope:e.__scopeRovingFocusGroup,children:n.jsx(Um.Slot,{scope:e.__scopeRovingFocusGroup,children:n.jsx(o6,{...e,ref:t})})}));nk.displayName=El;var o6=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:o=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,x=C.useRef(null),w=it(t,x),k=Sl(u),[_,v]=ss({prop:d,defaultProp:l??null,onChange:c,caller:El}),[b,g]=C.useState(!1),y=_r(f),j=rk(r),E=C.useRef(!1),[P,T]=C.useState(0);return C.useEffect(()=>{const N=x.current;if(N)return N.addEventListener(Gf,y),()=>N.removeEventListener(Gf,y)},[y]),n.jsx(s6,{scope:r,orientation:s,dir:k,loop:o,currentTabStopId:_,onItemFocus:C.useCallback(N=>v(N),[v]),onItemShiftTab:C.useCallback(()=>g(!0),[]),onFocusableItemAdd:C.useCallback(()=>T(N=>N+1),[]),onFocusableItemRemove:C.useCallback(()=>T(N=>N-1),[]),children:n.jsx(Xe.div,{tabIndex:b||P===0?-1:0,"data-orientation":s,...h,ref:w,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{E.current=!0}),onFocus:Te(e.onFocus,N=>{const R=!E.current;if(N.target===N.currentTarget&&R&&!b){const I=new CustomEvent(Gf,t6);if(N.currentTarget.dispatchEvent(I),!I.defaultPrevented){const O=j().filter(K=>K.focusable),$=O.find(K=>K.active),W=O.find(K=>K.id===_),z=[$,W,...O].filter(Boolean).map(K=>K.ref.current);ok(z,m)}}E.current=!1}),onBlur:Te(e.onBlur,()=>g(!1))})})}),sk="RovingFocusGroupItem",ik=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:o=!1,tabStopId:u,children:d,...l}=e,c=Sn(),f=u||c,m=i6(sk,r),h=m.currentTabStopId===f,x=rk(r),{onFocusableItemAdd:w,onFocusableItemRemove:k,currentTabStopId:_}=m;return C.useEffect(()=>{if(s)return w(),()=>k()},[s,w,k]),n.jsx(Um.ItemSlot,{scope:r,id:f,focusable:s,active:o,children:n.jsx(Xe.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Te(e.onMouseDown,v=>{s?m.onItemFocus(f):v.preventDefault()}),onFocus:Te(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Te(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){m.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=c6(v,m.orientation,m.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=x().filter(j=>j.focusable).map(j=>j.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const j=y.indexOf(v.currentTarget);y=m.loop?u6(y,j+1):y.slice(j+1)}setTimeout(()=>ok(y))}}),children:typeof d=="function"?d({isCurrentTabStop:h,hasTabStop:_!=null}):d})})});ik.displayName=sk;var a6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l6(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function c6(e,t,r){const s=l6(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return a6[s]}function ok(e,t=!1){const r=document.activeElement;for(const s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}function u6(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var ak=nk,lk=ik;function d6(e){const t=h6(e),r=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(m6);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return n.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function h6(e){const t=C.forwardRef((r,s)=>{const{children:o,...u}=r;if(C.isValidElement(o)){const d=g6(o),l=p6(u,o.props);return o.type!==C.Fragment&&(l.ref=s?js(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var f6=Symbol("radix.slottable");function m6(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f6}function p6(e,t){const r={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function g6(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gm=["Enter"," "],x6=["ArrowDown","PageUp","Home"],ck=["ArrowUp","PageDown","End"],v6=[...x6,...ck],y6={ltr:[...Gm,"ArrowRight"],rtl:[...Gm,"ArrowLeft"]},b6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pl="Menu",[al,w6,_6]=lg(Pl),[Ui,uk]=Xr(Pl,[_6,Xo,yd]),bd=Xo(),dk=yd(),[S6,Gi]=Ui(Pl),[C6,Al]=Ui(Pl),hk=e=>{const{__scopeMenu:t,open:r=!1,children:s,dir:o,onOpenChange:u,modal:d=!0}=e,l=bd(t),[c,f]=C.useState(null),m=C.useRef(!1),h=_r(u),x=Sl(o);return C.useEffect(()=>{const w=()=>{m.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>m.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),n.jsx(xg,{...l,children:n.jsx(S6,{scope:t,open:r,onOpenChange:h,content:c,onContentChange:f,children:n.jsx(C6,{scope:t,onClose:C.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:x,modal:d,children:s})})})};hk.displayName=Pl;var k6="MenuAnchor",Sg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,o=bd(r);return n.jsx(vg,{...o,...s,ref:t})});Sg.displayName=k6;var Cg="MenuPortal",[j6,fk]=Ui(Cg,{forceMount:void 0}),mk=e=>{const{__scopeMenu:t,forceMount:r,children:s,container:o}=e,u=Gi(Cg,t);return n.jsx(j6,{scope:t,forceMount:r,children:n.jsx(kr,{present:r||u.open,children:n.jsx(kl,{asChild:!0,container:o,children:s})})})};mk.displayName=Cg;var Cn="MenuContent",[N6,kg]=Ui(Cn),pk=C.forwardRef((e,t)=>{const r=fk(Cn,e.__scopeMenu),{forceMount:s=r.forceMount,...o}=e,u=Gi(Cn,e.__scopeMenu),d=Al(Cn,e.__scopeMenu);return n.jsx(al.Provider,{scope:e.__scopeMenu,children:n.jsx(kr,{present:s||u.open,children:n.jsx(al.Slot,{scope:e.__scopeMenu,children:d.modal?n.jsx(E6,{...o,ref:t}):n.jsx(P6,{...o,ref:t})})})})}),E6=C.forwardRef((e,t)=>{const r=Gi(Cn,e.__scopeMenu),s=C.useRef(null),o=it(t,s);return C.useEffect(()=>{const u=s.current;if(u)return Qp(u)},[]),n.jsx(jg,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),P6=C.forwardRef((e,t)=>{const r=Gi(Cn,e.__scopeMenu);return n.jsx(jg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),A6=d6("MenuContent.ScrollLock"),jg=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:s=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:w,disableOutsideScroll:k,..._}=e,v=Gi(Cn,r),b=Al(Cn,r),g=bd(r),y=dk(r),j=w6(r),[E,P]=C.useState(null),T=C.useRef(null),N=it(t,T,v.onContentChange),R=C.useRef(0),I=C.useRef(""),O=C.useRef(0),$=C.useRef(null),W=C.useRef("right"),Y=C.useRef(0),z=k?sd:C.Fragment,K=k?{as:A6,allowPinchZoom:!0}:void 0,G=L=>{var X,H;const M=I.current+L,B=j().filter(ae=>!ae.disabled),q=document.activeElement,F=(X=B.find(ae=>ae.ref.current===q))==null?void 0:X.textValue,oe=B.map(ae=>ae.textValue),fe=H6(oe,M,F),me=(H=B.find(ae=>ae.textValue===fe))==null?void 0:H.ref.current;(function ae(ne){I.current=ne,window.clearTimeout(R.current),ne!==""&&(R.current=window.setTimeout(()=>ae(""),1e3))})(M),me&&setTimeout(()=>me.focus())};C.useEffect(()=>()=>window.clearTimeout(R.current),[]),Jp();const U=C.useCallback(L=>{var B,q;return W.current===((B=$.current)==null?void 0:B.side)&&V6(L,(q=$.current)==null?void 0:q.area)},[]);return n.jsx(N6,{scope:r,searchRef:I,onItemEnter:C.useCallback(L=>{U(L)&&L.preventDefault()},[U]),onItemLeave:C.useCallback(L=>{var M;U(L)||((M=T.current)==null||M.focus(),P(null))},[U]),onTriggerLeave:C.useCallback(L=>{U(L)&&L.preventDefault()},[U]),pointerGraceTimerRef:O,onPointerGraceIntentChange:C.useCallback(L=>{$.current=L},[]),children:n.jsx(z,{...K,children:n.jsx(rd,{asChild:!0,trapped:o,onMountAutoFocus:Te(u,L=>{var M;L.preventDefault(),(M=T.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:n.jsx(Cl,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:w,children:n.jsx(ak,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:Te(c,L=>{b.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(yg,{role:"menu","aria-orientation":"vertical","data-state":Tk(v.open),"data-radix-menu-content":"",dir:b.dir,...g,..._,ref:N,style:{outline:"none",..._.style},onKeyDown:Te(_.onKeyDown,L=>{const B=L.target.closest("[data-radix-menu-content]")===L.currentTarget,q=L.ctrlKey||L.altKey||L.metaKey,F=L.key.length===1;B&&(L.key==="Tab"&&L.preventDefault(),!q&&F&&G(L.key));const oe=T.current;if(L.target!==oe||!v6.includes(L.key))return;L.preventDefault();const me=j().filter(X=>!X.disabled).map(X=>X.ref.current);ck.includes(L.key)&&me.reverse(),$6(me)}),onBlur:Te(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(R.current),I.current="")}),onPointerMove:Te(e.onPointerMove,ll(L=>{const M=L.target,B=Y.current!==L.clientX;if(L.currentTarget.contains(M)&&B){const q=L.clientX>Y.current?"right":"left";W.current=q,Y.current=L.clientX}}))})})})})})})});pk.displayName=Cn;var T6="MenuGroup",Ng=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(Xe.div,{role:"group",...s,ref:t})});Ng.displayName=T6;var R6="MenuLabel",gk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(Xe.div,{...s,ref:t})});gk.displayName=R6;var Iu="MenuItem",Fb="menu.itemSelect",wd=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:s,...o}=e,u=C.useRef(null),d=Al(Iu,e.__scopeMenu),l=kg(Iu,e.__scopeMenu),c=it(t,u),f=C.useRef(!1),m=()=>{const h=u.current;if(!r&&h){const x=new CustomEvent(Fb,{bubbles:!0,cancelable:!0});h.addEventListener(Fb,w=>s==null?void 0:s(w),{once:!0}),G1(h,x),x.defaultPrevented?f.current=!1:d.onClose()}};return n.jsx(xk,{...o,ref:c,disabled:r,onClick:Te(e.onClick,m),onPointerDown:h=>{var x;(x=e.onPointerDown)==null||x.call(e,h),f.current=!0},onPointerUp:Te(e.onPointerUp,h=>{var x;f.current||(x=h.currentTarget)==null||x.click()}),onKeyDown:Te(e.onKeyDown,h=>{const x=l.searchRef.current!=="";r||x&&h.key===" "||Gm.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});wd.displayName=Iu;var xk=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:s=!1,textValue:o,...u}=e,d=kg(Iu,r),l=dk(r),c=C.useRef(null),f=it(t,c),[m,h]=C.useState(!1),[x,w]=C.useState("");return C.useEffect(()=>{const k=c.current;k&&w((k.textContent??"").trim())},[u.children]),n.jsx(al.ItemSlot,{scope:r,disabled:s,textValue:o??x,children:n.jsx(lk,{asChild:!0,...l,focusable:!s,children:n.jsx(Xe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...u,ref:f,onPointerMove:Te(e.onPointerMove,ll(k=>{s?d.onItemLeave(k):(d.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,ll(k=>d.onItemLeave(k))),onFocus:Te(e.onFocus,()=>h(!0)),onBlur:Te(e.onBlur,()=>h(!1))})})})}),M6="MenuCheckboxItem",vk=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:s,...o}=e;return n.jsx(Sk,{scope:e.__scopeMenu,checked:r,children:n.jsx(wd,{role:"menuitemcheckbox","aria-checked":Ou(r)?"mixed":r,...o,ref:t,"data-state":Pg(r),onSelect:Te(o.onSelect,()=>s==null?void 0:s(Ou(r)?!0:!r),{checkForDefaultPrevented:!1})})})});vk.displayName=M6;var yk="MenuRadioGroup",[D6,L6]=Ui(yk,{value:void 0,onValueChange:()=>{}}),bk=C.forwardRef((e,t)=>{const{value:r,onValueChange:s,...o}=e,u=_r(s);return n.jsx(D6,{scope:e.__scopeMenu,value:r,onValueChange:u,children:n.jsx(Ng,{...o,ref:t})})});bk.displayName=yk;var wk="MenuRadioItem",_k=C.forwardRef((e,t)=>{const{value:r,...s}=e,o=L6(wk,e.__scopeMenu),u=r===o.value;return n.jsx(Sk,{scope:e.__scopeMenu,checked:u,children:n.jsx(wd,{role:"menuitemradio","aria-checked":u,...s,ref:t,"data-state":Pg(u),onSelect:Te(s.onSelect,()=>{var d;return(d=o.onValueChange)==null?void 0:d.call(o,r)},{checkForDefaultPrevented:!1})})})});_k.displayName=wk;var Eg="MenuItemIndicator",[Sk,I6]=Ui(Eg,{checked:!1}),Ck=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:s,...o}=e,u=I6(Eg,r);return n.jsx(kr,{present:s||Ou(u.checked)||u.checked===!0,children:n.jsx(Xe.span,{...o,ref:t,"data-state":Pg(u.checked)})})});Ck.displayName=Eg;var O6="MenuSeparator",kk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});kk.displayName=O6;var B6="MenuArrow",jk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,o=bd(r);return n.jsx(bg,{...o,...s,ref:t})});jk.displayName=B6;var F6="MenuSub",[sW,Nk]=Ui(F6),Ga="MenuSubTrigger",Ek=C.forwardRef((e,t)=>{const r=Gi(Ga,e.__scopeMenu),s=Al(Ga,e.__scopeMenu),o=Nk(Ga,e.__scopeMenu),u=kg(Ga,e.__scopeMenu),d=C.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=u,f={__scopeMenu:e.__scopeMenu},m=C.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return C.useEffect(()=>m,[m]),C.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),n.jsx(Sg,{asChild:!0,...f,children:n.jsx(xk,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":Tk(r.open),...e,ref:js(t,o.onTriggerChange),onClick:h=>{var x;(x=e.onClick)==null||x.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,ll(h=>{u.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!r.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:Te(e.onPointerLeave,ll(h=>{var w,k;m();const x=(w=r.content)==null?void 0:w.getBoundingClientRect();if(x){const _=(k=r.content)==null?void 0:k.dataset.side,v=_==="right",b=v?-5:5,g=x[v?"left":"right"],y=x[v?"right":"left"];u.onPointerGraceIntentChange({area:[{x:h.clientX+b,y:h.clientY},{x:g,y:x.top},{x:y,y:x.top},{x:y,y:x.bottom},{x:g,y:x.bottom}],side:_}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(h),h.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,h=>{var w;const x=u.searchRef.current!=="";e.disabled||x&&h.key===" "||y6[s.dir].includes(h.key)&&(r.onOpenChange(!0),(w=r.content)==null||w.focus(),h.preventDefault())})})})});Ek.displayName=Ga;var Pk="MenuSubContent",Ak=C.forwardRef((e,t)=>{const r=fk(Cn,e.__scopeMenu),{forceMount:s=r.forceMount,...o}=e,u=Gi(Cn,e.__scopeMenu),d=Al(Cn,e.__scopeMenu),l=Nk(Pk,e.__scopeMenu),c=C.useRef(null),f=it(t,c);return n.jsx(al.Provider,{scope:e.__scopeMenu,children:n.jsx(kr,{present:s||u.open,children:n.jsx(al.Slot,{scope:e.__scopeMenu,children:n.jsx(jg,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:f,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var h;d.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Te(e.onFocusOutside,m=>{m.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,m=>{d.onClose(),m.preventDefault()}),onKeyDown:Te(e.onKeyDown,m=>{var w;const h=m.currentTarget.contains(m.target),x=b6[d.dir].includes(m.key);h&&x&&(u.onOpenChange(!1),(w=l.trigger)==null||w.focus(),m.preventDefault())})})})})})});Ak.displayName=Pk;function Tk(e){return e?"open":"closed"}function Ou(e){return e==="indeterminate"}function Pg(e){return Ou(e)?"indeterminate":e?"checked":"unchecked"}function $6(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function z6(e,t){return e.map((r,s)=>e[(t+s)%e.length])}function H6(e,t,r){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,u=r?e.indexOf(r):-1;let d=z6(e,Math.max(u,0));o.length===1&&(d=d.filter(f=>f!==r));const c=d.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function W6(e,t){const{x:r,y:s}=e;let o=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const l=t[u],c=t[d],f=l.x,m=l.y,h=c.x,x=c.y;m>s!=x>s&&r<(h-f)*(s-m)/(x-m)+f&&(o=!o)}return o}function V6(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return W6(r,t)}function ll(e){return t=>t.pointerType==="mouse"?e(t):void 0}var U6=hk,G6=Sg,K6=mk,q6=pk,Y6=Ng,X6=gk,J6=wd,Q6=vk,Z6=bk,eB=_k,tB=Ck,rB=kk,nB=jk,sB=Ek,iB=Ak,_d="DropdownMenu",[oB]=Xr(_d,[uk]),Br=uk(),[aB,Rk]=oB(_d),Mk=e=>{const{__scopeDropdownMenu:t,children:r,dir:s,open:o,defaultOpen:u,onOpenChange:d,modal:l=!0}=e,c=Br(t),f=C.useRef(null),[m,h]=ss({prop:o,defaultProp:u??!1,onChange:d,caller:_d});return n.jsx(aB,{scope:t,triggerId:Sn(),triggerRef:f,contentId:Sn(),open:m,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(x=>!x),[h]),modal:l,children:n.jsx(U6,{...c,open:m,onOpenChange:h,dir:s,modal:l,children:r})})};Mk.displayName=_d;var Dk="DropdownMenuTrigger",Lk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:s=!1,...o}=e,u=Rk(Dk,r),d=Br(r);return n.jsx(G6,{asChild:!0,...d,children:n.jsx(Xe.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:js(t,u.triggerRef),onPointerDown:Te(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(u.onOpenToggle(),u.open||l.preventDefault())}),onKeyDown:Te(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&u.onOpenToggle(),l.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Lk.displayName=Dk;var lB="DropdownMenuPortal",Ik=e=>{const{__scopeDropdownMenu:t,...r}=e,s=Br(t);return n.jsx(K6,{...s,...r})};Ik.displayName=lB;var Ok="DropdownMenuContent",Bk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Rk(Ok,r),u=Br(r),d=C.useRef(!1);return n.jsx(q6,{id:o.contentId,"aria-labelledby":o.triggerId,...u,...s,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{var c;d.current||(c=o.triggerRef.current)==null||c.focus(),d.current=!1,l.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,m=c.button===2||f;(!o.modal||m)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Bk.displayName=Ok;var cB="DropdownMenuGroup",uB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(Y6,{...o,...s,ref:t})});uB.displayName=cB;var dB="DropdownMenuLabel",Fk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(X6,{...o,...s,ref:t})});Fk.displayName=dB;var hB="DropdownMenuItem",$k=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(J6,{...o,...s,ref:t})});$k.displayName=hB;var fB="DropdownMenuCheckboxItem",zk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(Q6,{...o,...s,ref:t})});zk.displayName=fB;var mB="DropdownMenuRadioGroup",pB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(Z6,{...o,...s,ref:t})});pB.displayName=mB;var gB="DropdownMenuRadioItem",Hk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(eB,{...o,...s,ref:t})});Hk.displayName=gB;var xB="DropdownMenuItemIndicator",Wk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(tB,{...o,...s,ref:t})});Wk.displayName=xB;var vB="DropdownMenuSeparator",Vk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(rB,{...o,...s,ref:t})});Vk.displayName=vB;var yB="DropdownMenuArrow",bB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(nB,{...o,...s,ref:t})});bB.displayName=yB;var wB="DropdownMenuSubTrigger",Uk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(sB,{...o,...s,ref:t})});Uk.displayName=wB;var _B="DropdownMenuSubContent",Gk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(iB,{...o,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gk.displayName=_B;var SB=Mk,CB=Lk,kB=Ik,Kk=Bk,qk=Fk,Yk=$k,Xk=zk,Jk=Hk,Qk=Wk,Zk=Vk,ej=Uk,tj=Gk;const ai=SB,li=CB,jB=C.forwardRef(({className:e,inset:t,children:r,...s},o)=>n.jsxs(ej,{ref:o,className:je("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...s,children:[r,n.jsx(Kr,{className:"ml-auto"})]}));jB.displayName=ej.displayName;const NB=C.forwardRef(({className:e,...t},r)=>n.jsx(tj,{ref:r,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));NB.displayName=tj.displayName;const ks=C.forwardRef(({className:e,sideOffset:t=4,...r},s)=>n.jsx(kB,{children:n.jsx(Kk,{ref:s,sideOffset:t,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ks.displayName=Kk.displayName;const Pt=C.forwardRef(({className:e,inset:t,...r},s)=>n.jsx(Yk,{ref:s,className:je("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));Pt.displayName=Yk.displayName;const cl=C.forwardRef(({className:e,children:t,checked:r,...s},o)=>n.jsxs(Xk,{ref:o,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...s,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Qk,{children:n.jsx(Kt,{className:"h-4 w-4"})})}),t]}));cl.displayName=Xk.displayName;const EB=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(Jk,{ref:s,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Qk,{children:n.jsx(xM,{className:"h-2 w-2 fill-current"})})}),t]}));EB.displayName=Jk.displayName;const ul=C.forwardRef(({className:e,inset:t,...r},s)=>n.jsx(qk,{ref:s,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ul.displayName=qk.displayName;const Or=C.forwardRef(({className:e,...t},r)=>n.jsx(Zk,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));Or.displayName=Zk.displayName;const $b={development:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",productivity:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",integration:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",external:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",lsp:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"};function PB({plugin:e,onToggle:t,isToggling:r,projectDir:s}){const o=$b[e.category]||$b.default;return e.mcpServers||e.lspServers||e.commands,n.jsxs(Eo.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`
|
|
532
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},DL="DialogDescriptionWarning",LL=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DS(DL).contentName}}.`;return C.useEffect(()=>{var u;const o=(u=e.current)==null?void 0:u.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},LS=bS,IL=_S,rg=CS,od=kS,ad=jS,ld=ES,cd=AS,ng=RS;const Tt=LS,OL=rg,IS=C.forwardRef(({className:e,...t},r)=>n.jsx(od,{ref:r,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));IS.displayName=od.displayName;const St=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(OL,{children:[n.jsx(IS,{}),n.jsxs(ad,{ref:s,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,n.jsxs(ng,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsx(ei,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));St.displayName=ad.displayName;const Ct=({className:e,...t})=>n.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ct.displayName="DialogHeader";const It=({className:e,...t})=>n.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});It.displayName="DialogFooter";const kt=C.forwardRef(({className:e,...t},r)=>n.jsx(ld,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));kt.displayName=ld.displayName;const tr=C.forwardRef(({className:e,...t},r)=>n.jsx(cd,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));tr.displayName=cd.displayName;function sg(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ig(e){const[t,r]=C.useState(void 0);return gr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,l;if("borderBoxSize"in u){const c=u.borderBoxSize,f=Array.isArray(c)?c[0]:c;d=f.inlineSize,l=f.blockSize}else d=e.offsetWidth,l=e.offsetHeight;r({width:d,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),t}var ud="Checkbox",[BL]=Xr(ud),[FL,og]=BL(ud);function $L(e){const{__scopeCheckbox:t,checked:r,children:s,defaultChecked:o,disabled:u,form:d,name:l,onCheckedChange:c,required:f,value:m="on",internal_do_not_use_render:h}=e,[x,w]=ss({prop:r,defaultProp:o??!1,onChange:c,caller:ud}),[k,_]=C.useState(null),[v,b]=C.useState(null),g=C.useRef(!1),y=k?!!d||!!k.closest("form"):!0,j={checked:x,disabled:u,setChecked:w,control:k,setControl:_,name:l,form:d,value:m,hasConsumerStoppedPropagationRef:g,required:f,defaultChecked:ti(o)?!1:o,isFormControl:y,bubbleInput:v,setBubbleInput:b};return n.jsx(FL,{scope:t,...j,children:zL(h)?h(j):s})}var OS="CheckboxTrigger",BS=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...s},o)=>{const{control:u,value:d,disabled:l,checked:c,required:f,setControl:m,setChecked:h,hasConsumerStoppedPropagationRef:x,isFormControl:w,bubbleInput:k}=og(OS,e),_=it(o,m),v=C.useRef(c);return C.useEffect(()=>{const b=u==null?void 0:u.form;if(b){const g=()=>h(v.current);return b.addEventListener("reset",g),()=>b.removeEventListener("reset",g)}},[u,h]),n.jsx(Xe.button,{type:"button",role:"checkbox","aria-checked":ti(c)?"mixed":c,"aria-required":f,"data-state":WS(c),"data-disabled":l?"":void 0,disabled:l,value:d,...s,ref:_,onKeyDown:Te(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Te(r,b=>{h(g=>ti(g)?!0:!g),k&&w&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})});BS.displayName=OS;var ag=C.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:s,checked:o,defaultChecked:u,required:d,disabled:l,value:c,onCheckedChange:f,form:m,...h}=e;return n.jsx($L,{__scopeCheckbox:r,checked:o,defaultChecked:u,disabled:l,required:d,onCheckedChange:f,name:s,form:m,value:c,internal_do_not_use_render:({isFormControl:x})=>n.jsxs(n.Fragment,{children:[n.jsx(BS,{...h,ref:t,__scopeCheckbox:r}),x&&n.jsx(HS,{__scopeCheckbox:r})]})})});ag.displayName=ud;var FS="CheckboxIndicator",$S=C.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:s,...o}=e,u=og(FS,r);return n.jsx(kr,{present:s||ti(u.checked)||u.checked===!0,children:n.jsx(Xe.span,{"data-state":WS(u.checked),"data-disabled":u.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});$S.displayName=FS;var zS="CheckboxBubbleInput",HS=C.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:u,defaultChecked:d,required:l,disabled:c,name:f,value:m,form:h,bubbleInput:x,setBubbleInput:w}=og(zS,e),k=it(r,w),_=sg(u),v=ig(s);C.useEffect(()=>{const g=x;if(!g)return;const y=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(y,"checked").set,P=!o.current;if(_!==u&&E){const T=new Event("click",{bubbles:P});g.indeterminate=ti(u),E.call(g,ti(u)?!1:u),g.dispatchEvent(T)}},[x,_,u,o]);const b=C.useRef(ti(u)?!1:u);return n.jsx(Xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??b.current,required:l,disabled:c,name:f,value:m,form:h,...t,tabIndex:-1,ref:k,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});HS.displayName=zS;function zL(e){return typeof e=="function"}function ti(e){return e==="indeterminate"}function WS(e){return ti(e)?"indeterminate":e?"checked":"unchecked"}const jl=C.forwardRef(({className:e,...t},r)=>n.jsx(ag,{ref:r,className:je("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:n.jsx($S,{className:je("flex items-center justify-center text-current"),children:n.jsx(Kt,{className:"h-4 w-4"})})}));jl.displayName=ag.displayName;function Nb(e){const t=HL(e),r=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(VL);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return n.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function HL(e){const t=C.forwardRef((r,s)=>{const{children:o,...u}=r;if(C.isValidElement(o)){const d=GL(o),l=UL(u,o.props);return o.type!==C.Fragment&&(l.ref=s?js(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WL=Symbol("radix.slottable");function VL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WL}function UL(e,t){const r={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function GL(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function lg(e){const t=e+"CollectionProvider",[r,s]=Xr(t),[o,u]=r(t,{collectionRef:{current:null},itemMap:new Map}),d=_=>{const{scope:v,children:b}=_,g=Ee.useRef(null),y=Ee.useRef(new Map).current;return n.jsx(o,{scope:v,itemMap:y,collectionRef:g,children:b})};d.displayName=t;const l=e+"CollectionSlot",c=Nb(l),f=Ee.forwardRef((_,v)=>{const{scope:b,children:g}=_,y=u(l,b),j=it(v,y.collectionRef);return n.jsx(c,{ref:j,children:g})});f.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",x=Nb(m),w=Ee.forwardRef((_,v)=>{const{scope:b,children:g,...y}=_,j=Ee.useRef(null),E=it(v,j),P=u(m,b);return Ee.useEffect(()=>(P.itemMap.set(j,{ref:j,...y}),()=>void P.itemMap.delete(j))),n.jsx(x,{[h]:"",ref:E,children:g})});w.displayName=m;function k(_){const v=u(e+"CollectionConsumer",_);return Ee.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((P,T)=>y.indexOf(P.ref.current)-y.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:d,Slot:f,ItemSlot:w},k,s]}const KL=["top","right","bottom","left"],ii=Math.min,sn=Math.max,Tu=Math.round,nu=Math.floor,rs=e=>({x:e,y:e}),qL={left:"right",right:"left",bottom:"top",top:"bottom"},YL={start:"end",end:"start"};function Om(e,t,r){return sn(e,ii(t,r))}function Ss(e,t){return typeof e=="function"?e(t):e}function Cs(e){return e.split("-")[0]}function qo(e){return e.split("-")[1]}function cg(e){return e==="x"?"y":"x"}function ug(e){return e==="y"?"height":"width"}const XL=new Set(["top","bottom"]);function Zn(e){return XL.has(Cs(e))?"y":"x"}function dg(e){return cg(Zn(e))}function JL(e,t,r){r===void 0&&(r=!1);const s=qo(e),o=dg(e),u=ug(o);let d=o==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(d=Ru(d)),[d,Ru(d)]}function QL(e){const t=Ru(e);return[Bm(e),t,Bm(t)]}function Bm(e){return e.replace(/start|end/g,t=>YL[t])}const Eb=["left","right"],Pb=["right","left"],ZL=["top","bottom"],eI=["bottom","top"];function tI(e,t,r){switch(e){case"top":case"bottom":return r?t?Pb:Eb:t?Eb:Pb;case"left":case"right":return t?ZL:eI;default:return[]}}function rI(e,t,r,s){const o=qo(e);let u=tI(Cs(e),r==="start",s);return o&&(u=u.map(d=>d+"-"+o),t&&(u=u.concat(u.map(Bm)))),u}function Ru(e){return e.replace(/left|right|bottom|top/g,t=>qL[t])}function nI(e){return{top:0,right:0,bottom:0,left:0,...e}}function VS(e){return typeof e!="number"?nI(e):{top:e,right:e,bottom:e,left:e}}function Mu(e){const{x:t,y:r,width:s,height:o}=e;return{width:s,height:o,top:r,left:t,right:t+s,bottom:r+o,x:t,y:r}}function Ab(e,t,r){let{reference:s,floating:o}=e;const u=Zn(t),d=dg(t),l=ug(d),c=Cs(t),f=u==="y",m=s.x+s.width/2-o.width/2,h=s.y+s.height/2-o.height/2,x=s[l]/2-o[l]/2;let w;switch(c){case"top":w={x:m,y:s.y-o.height};break;case"bottom":w={x:m,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y:h};break;case"left":w={x:s.x-o.width,y:h};break;default:w={x:s.x,y:s.y}}switch(qo(t)){case"start":w[d]-=x*(r&&f?-1:1);break;case"end":w[d]+=x*(r&&f?-1:1);break}return w}const sI=async(e,t,r)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:d}=r,l=u.filter(Boolean),c=await(d.isRTL==null?void 0:d.isRTL(t));let f=await d.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=Ab(f,s,c),x=s,w={},k=0;for(let _=0;_<l.length;_++){const{name:v,fn:b}=l[_],{x:g,y,data:j,reset:E}=await b({x:m,y:h,initialPlacement:s,placement:x,strategy:o,middlewareData:w,rects:f,platform:d,elements:{reference:e,floating:t}});m=g??m,h=y??h,w={...w,[v]:{...w[v],...j}},E&&k<=50&&(k++,typeof E=="object"&&(E.placement&&(x=E.placement),E.rects&&(f=E.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:m,y:h}=Ab(f,x,c)),_=-1)}return{x:m,y:h,placement:x,strategy:o,middlewareData:w}};async function il(e,t){var r;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:d,elements:l,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:x=!1,padding:w=0}=Ss(t,e),k=VS(w),v=l[x?h==="floating"?"reference":"floating":h],b=Mu(await u.getClippingRect({element:(r=await(u.isElement==null?void 0:u.isElement(v)))==null||r?v:v.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:c})),g=h==="floating"?{x:s,y:o,width:d.floating.width,height:d.floating.height}:d.reference,y=await(u.getOffsetParent==null?void 0:u.getOffsetParent(l.floating)),j=await(u.isElement==null?void 0:u.isElement(y))?await(u.getScale==null?void 0:u.getScale(y))||{x:1,y:1}:{x:1,y:1},E=Mu(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(b.top-E.top+k.top)/j.y,bottom:(E.bottom-b.bottom+k.bottom)/j.y,left:(b.left-E.left+k.left)/j.x,right:(E.right-b.right+k.right)/j.x}}const iI=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:s,placement:o,rects:u,platform:d,elements:l,middlewareData:c}=t,{element:f,padding:m=0}=Ss(e,t)||{};if(f==null)return{};const h=VS(m),x={x:r,y:s},w=dg(o),k=ug(w),_=await d.getDimensions(f),v=w==="y",b=v?"top":"left",g=v?"bottom":"right",y=v?"clientHeight":"clientWidth",j=u.reference[k]+u.reference[w]-x[w]-u.floating[k],E=x[w]-u.reference[w],P=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f));let T=P?P[y]:0;(!T||!await(d.isElement==null?void 0:d.isElement(P)))&&(T=l.floating[y]||u.floating[k]);const N=j/2-E/2,R=T/2-_[k]/2-1,I=ii(h[b],R),O=ii(h[g],R),$=I,W=T-_[k]-O,Y=T/2-_[k]/2+N,z=Om($,Y,W),K=!c.arrow&&qo(o)!=null&&Y!==z&&u.reference[k]/2-(Y<$?I:O)-_[k]/2<0,G=K?Y<$?Y-$:Y-W:0;return{[w]:x[w]+G,data:{[w]:z,centerOffset:Y-z-G,...K&&{alignmentOffset:G}},reset:K}}}),oI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,s;const{placement:o,middlewareData:u,rects:d,initialPlacement:l,platform:c,elements:f}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:_=!0,...v}=Ss(e,t);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const b=Cs(o),g=Zn(l),y=Cs(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(f.floating)),E=x||(y||!_?[Ru(l)]:QL(l)),P=k!=="none";!x&&P&&E.push(...rI(l,_,k,j));const T=[l,...E],N=await il(t,v),R=[];let I=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&R.push(N[b]),h){const Y=JL(o,d,j);R.push(N[Y[0]],N[Y[1]])}if(I=[...I,{placement:o,overflows:R}],!R.every(Y=>Y<=0)){var O,$;const Y=(((O=u.flip)==null?void 0:O.index)||0)+1,z=T[Y];if(z&&(!(h==="alignment"?g!==Zn(z):!1)||I.every(U=>Zn(U.placement)===g?U.overflows[0]>0:!0)))return{data:{index:Y,overflows:I},reset:{placement:z}};let K=($=I.filter(G=>G.overflows[0]<=0).sort((G,U)=>G.overflows[1]-U.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(w){case"bestFit":{var W;const G=(W=I.filter(U=>{if(P){const L=Zn(U.placement);return L===g||L==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(L=>L>0).reduce((L,M)=>L+M,0)]).sort((U,L)=>U[1]-L[1])[0])==null?void 0:W[0];G&&(K=G);break}case"initialPlacement":K=l;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function Tb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rb(e){return KL.some(t=>e[t]>=0)}const aI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:s="referenceHidden",...o}=Ss(e,t);switch(s){case"referenceHidden":{const u=await il(t,{...o,elementContext:"reference"}),d=Tb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Rb(d)}}}case"escaped":{const u=await il(t,{...o,altBoundary:!0}),d=Tb(u,r.floating);return{data:{escapedOffsets:d,escaped:Rb(d)}}}default:return{}}}}},US=new Set(["left","top"]);async function lI(e,t){const{placement:r,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),d=Cs(r),l=qo(r),c=Zn(r)==="y",f=US.has(d)?-1:1,m=u&&c?-1:1,h=Ss(t,e);let{mainAxis:x,crossAxis:w,alignmentAxis:k}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof k=="number"&&(w=l==="end"?k*-1:k),c?{x:w*m,y:x*f}:{x:x*f,y:w*m}}const cI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,s;const{x:o,y:u,placement:d,middlewareData:l}=t,c=await lI(t,e);return d===((r=l.offset)==null?void 0:r.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:d}}}}},uI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:l={fn:v=>{let{x:b,y:g}=v;return{x:b,y:g}}},...c}=Ss(e,t),f={x:r,y:s},m=await il(t,c),h=Zn(Cs(o)),x=cg(h);let w=f[x],k=f[h];if(u){const v=x==="y"?"top":"left",b=x==="y"?"bottom":"right",g=w+m[v],y=w-m[b];w=Om(g,w,y)}if(d){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",g=k+m[v],y=k-m[b];k=Om(g,k,y)}const _=l.fn({...t,[x]:w,[h]:k});return{..._,data:{x:_.x-r,y:_.y-s,enabled:{[x]:u,[h]:d}}}}}},dI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:s,placement:o,rects:u,middlewareData:d}=t,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=Ss(e,t),m={x:r,y:s},h=Zn(o),x=cg(h);let w=m[x],k=m[h];const _=Ss(l,t),v=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(c){const y=x==="y"?"height":"width",j=u.reference[x]-u.floating[y]+v.mainAxis,E=u.reference[x]+u.reference[y]-v.mainAxis;w<j?w=j:w>E&&(w=E)}if(f){var b,g;const y=x==="y"?"width":"height",j=US.has(Cs(o)),E=u.reference[h]-u.floating[y]+(j&&((b=d.offset)==null?void 0:b[h])||0)+(j?0:v.crossAxis),P=u.reference[h]+u.reference[y]+(j?0:((g=d.offset)==null?void 0:g[h])||0)-(j?v.crossAxis:0);k<E?k=E:k>P&&(k=P)}return{[x]:w,[h]:k}}}},hI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,s;const{placement:o,rects:u,platform:d,elements:l}=t,{apply:c=()=>{},...f}=Ss(e,t),m=await il(t,f),h=Cs(o),x=qo(o),w=Zn(o)==="y",{width:k,height:_}=u.floating;let v,b;h==="top"||h==="bottom"?(v=h,b=x===(await(d.isRTL==null?void 0:d.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,v=x==="end"?"top":"bottom");const g=_-m.top-m.bottom,y=k-m.left-m.right,j=ii(_-m[v],g),E=ii(k-m[b],y),P=!t.middlewareData.shift;let T=j,N=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=y),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(T=g),P&&!x){const I=sn(m.left,0),O=sn(m.right,0),$=sn(m.top,0),W=sn(m.bottom,0);w?N=k-2*(I!==0||O!==0?I+O:sn(m.left,m.right)):T=_-2*($!==0||W!==0?$+W:sn(m.top,m.bottom))}await c({...t,availableWidth:N,availableHeight:T});const R=await d.getDimensions(l.floating);return k!==R.width||_!==R.height?{reset:{rects:!0}}:{}}}};function dd(){return typeof window<"u"}function Yo(e){return GS(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cs(e){var t;return(t=(GS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GS(e){return dd()?e instanceof Node||e instanceof un(e).Node:!1}function $n(e){return dd()?e instanceof Element||e instanceof un(e).Element:!1}function is(e){return dd()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function Mb(e){return!dd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}const fI=new Set(["inline","contents"]);function Nl(e){const{overflow:t,overflowX:r,overflowY:s,display:o}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+r)&&!fI.has(o)}const mI=new Set(["table","td","th"]);function pI(e){return mI.has(Yo(e))}const gI=[":popover-open",":modal"];function hd(e){return gI.some(t=>{try{return e.matches(t)}catch{return!1}})}const xI=["transform","translate","scale","rotate","perspective"],vI=["transform","translate","scale","rotate","perspective","filter"],yI=["paint","layout","strict","content"];function hg(e){const t=fg(),r=$n(e)?zn(e):e;return xI.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||vI.some(s=>(r.willChange||"").includes(s))||yI.some(s=>(r.contain||"").includes(s))}function bI(e){let t=oi(e);for(;is(t)&&!Fo(t);){if(hg(t))return t;if(hd(t))return null;t=oi(t)}return null}function fg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wI=new Set(["html","body","#document"]);function Fo(e){return wI.has(Yo(e))}function zn(e){return un(e).getComputedStyle(e)}function fd(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oi(e){if(Yo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mb(e)&&e.host||cs(e);return Mb(t)?t.host:t}function KS(e){const t=oi(e);return Fo(t)?e.ownerDocument?e.ownerDocument.body:e.body:is(t)&&Nl(t)?t:KS(t)}function ol(e,t,r){var s;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=KS(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),d=un(o);if(u){const l=Fm(d);return t.concat(d,d.visualViewport||[],Nl(o)?o:[],l&&r?ol(l):[])}return t.concat(o,ol(o,[],r))}function Fm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qS(e){const t=zn(e);let r=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=is(e),u=o?e.offsetWidth:r,d=o?e.offsetHeight:s,l=Tu(r)!==u||Tu(s)!==d;return l&&(r=u,s=d),{width:r,height:s,$:l}}function mg(e){return $n(e)?e:e.contextElement}function Ao(e){const t=mg(e);if(!is(t))return rs(1);const r=t.getBoundingClientRect(),{width:s,height:o,$:u}=qS(t);let d=(u?Tu(r.width):r.width)/s,l=(u?Tu(r.height):r.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!l||!Number.isFinite(l))&&(l=1),{x:d,y:l}}const _I=rs(0);function YS(e){const t=un(e);return!fg()||!t.visualViewport?_I:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SI(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==un(e)?!1:t}function zi(e,t,r,s){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),u=mg(e);let d=rs(1);t&&(s?$n(s)&&(d=Ao(s)):d=Ao(e));const l=SI(u,r,s)?YS(u):rs(0);let c=(o.left+l.x)/d.x,f=(o.top+l.y)/d.y,m=o.width/d.x,h=o.height/d.y;if(u){const x=un(u),w=s&&$n(s)?un(s):s;let k=x,_=Fm(k);for(;_&&s&&w!==k;){const v=Ao(_),b=_.getBoundingClientRect(),g=zn(_),y=b.left+(_.clientLeft+parseFloat(g.paddingLeft))*v.x,j=b.top+(_.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,f*=v.y,m*=v.x,h*=v.y,c+=y,f+=j,k=un(_),_=Fm(k)}}return Mu({width:m,height:h,x:c,y:f})}function md(e,t){const r=fd(e).scrollLeft;return t?t.left+r:zi(cs(e)).left+r}function XS(e,t){const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-md(e,r),o=r.top+t.scrollTop;return{x:s,y:o}}function CI(e){let{elements:t,rect:r,offsetParent:s,strategy:o}=e;const u=o==="fixed",d=cs(s),l=t?hd(t.floating):!1;if(s===d||l&&u)return r;let c={scrollLeft:0,scrollTop:0},f=rs(1);const m=rs(0),h=is(s);if((h||!h&&!u)&&((Yo(s)!=="body"||Nl(d))&&(c=fd(s)),is(s))){const w=zi(s);f=Ao(s),m.x=w.x+s.clientLeft,m.y=w.y+s.clientTop}const x=d&&!h&&!u?XS(d,c):rs(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-c.scrollLeft*f.x+m.x+x.x,y:r.y*f.y-c.scrollTop*f.y+m.y+x.y}}function kI(e){return Array.from(e.getClientRects())}function jI(e){const t=cs(e),r=fd(e),s=e.ownerDocument.body,o=sn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=sn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let d=-r.scrollLeft+md(e);const l=-r.scrollTop;return zn(s).direction==="rtl"&&(d+=sn(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:d,y:l}}const Db=25;function NI(e,t){const r=un(e),s=cs(e),o=r.visualViewport;let u=s.clientWidth,d=s.clientHeight,l=0,c=0;if(o){u=o.width,d=o.height;const m=fg();(!m||m&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const f=md(s);if(f<=0){const m=s.ownerDocument,h=m.body,x=getComputedStyle(h),w=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,k=Math.abs(s.clientWidth-h.clientWidth-w);k<=Db&&(u-=k)}else f<=Db&&(u+=f);return{width:u,height:d,x:l,y:c}}const EI=new Set(["absolute","fixed"]);function PI(e,t){const r=zi(e,!0,t==="fixed"),s=r.top+e.clientTop,o=r.left+e.clientLeft,u=is(e)?Ao(e):rs(1),d=e.clientWidth*u.x,l=e.clientHeight*u.y,c=o*u.x,f=s*u.y;return{width:d,height:l,x:c,y:f}}function Lb(e,t,r){let s;if(t==="viewport")s=NI(e,r);else if(t==="document")s=jI(cs(e));else if($n(t))s=PI(t,r);else{const o=YS(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Mu(s)}function JS(e,t){const r=oi(e);return r===t||!$n(r)||Fo(r)?!1:zn(r).position==="fixed"||JS(r,t)}function AI(e,t){const r=t.get(e);if(r)return r;let s=ol(e,[],!1).filter(l=>$n(l)&&Yo(l)!=="body"),o=null;const u=zn(e).position==="fixed";let d=u?oi(e):e;for(;$n(d)&&!Fo(d);){const l=zn(d),c=hg(d);!c&&l.position==="fixed"&&(o=null),(u?!c&&!o:!c&&l.position==="static"&&!!o&&EI.has(o.position)||Nl(d)&&!c&&JS(e,d))?s=s.filter(m=>m!==d):o=l,d=oi(d)}return t.set(e,s),s}function TI(e){let{element:t,boundary:r,rootBoundary:s,strategy:o}=e;const d=[...r==="clippingAncestors"?hd(t)?[]:AI(t,this._c):[].concat(r),s],l=d[0],c=d.reduce((f,m)=>{const h=Lb(t,m,o);return f.top=sn(h.top,f.top),f.right=ii(h.right,f.right),f.bottom=ii(h.bottom,f.bottom),f.left=sn(h.left,f.left),f},Lb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function RI(e){const{width:t,height:r}=qS(e);return{width:t,height:r}}function MI(e,t,r){const s=is(t),o=cs(t),u=r==="fixed",d=zi(e,!0,u,t);let l={scrollLeft:0,scrollTop:0};const c=rs(0);function f(){c.x=md(o)}if(s||!s&&!u)if((Yo(t)!=="body"||Nl(o))&&(l=fd(t)),s){const w=zi(t,!0,u,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else o&&f();u&&!s&&o&&f();const m=o&&!s&&!u?XS(o,l):rs(0),h=d.left+l.scrollLeft-c.x-m.x,x=d.top+l.scrollTop-c.y-m.y;return{x:h,y:x,width:d.width,height:d.height}}function Wf(e){return zn(e).position==="static"}function Ib(e,t){if(!is(e)||zn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return cs(e)===r&&(r=r.ownerDocument.body),r}function QS(e,t){const r=un(e);if(hd(e))return r;if(!is(e)){let o=oi(e);for(;o&&!Fo(o);){if($n(o)&&!Wf(o))return o;o=oi(o)}return r}let s=Ib(e,t);for(;s&&pI(s)&&Wf(s);)s=Ib(s,t);return s&&Fo(s)&&Wf(s)&&!hg(s)?r:s||bI(e)||r}const DI=async function(e){const t=this.getOffsetParent||QS,r=this.getDimensions,s=await r(e.floating);return{reference:MI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function LI(e){return zn(e).direction==="rtl"}const II={convertOffsetParentRelativeRectToViewportRelativeRect:CI,getDocumentElement:cs,getClippingRect:TI,getOffsetParent:QS,getElementRects:DI,getClientRects:kI,getDimensions:RI,getScale:Ao,isElement:$n,isRTL:LI};function ZS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function OI(e,t){let r=null,s;const o=cs(e);function u(){var l;clearTimeout(s),(l=r)==null||l.disconnect(),r=null}function d(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),u();const f=e.getBoundingClientRect(),{left:m,top:h,width:x,height:w}=f;if(l||t(),!x||!w)return;const k=nu(h),_=nu(o.clientWidth-(m+x)),v=nu(o.clientHeight-(h+w)),b=nu(m),y={rootMargin:-k+"px "+-_+"px "+-v+"px "+-b+"px",threshold:sn(0,ii(1,c))||1};let j=!0;function E(P){const T=P[0].intersectionRatio;if(T!==c){if(!j)return d();T?d(!1,T):s=setTimeout(()=>{d(!1,1e-7)},1e3)}T===1&&!ZS(f,e.getBoundingClientRect())&&d(),j=!1}try{r=new IntersectionObserver(E,{...y,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,y)}r.observe(e)}return d(!0),u}function BI(e,t,r,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,f=mg(e),m=o||u?[...f?ol(f):[],...ol(t)]:[];m.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),u&&b.addEventListener("resize",r)});const h=f&&l?OI(f,r):null;let x=-1,w=null;d&&(w=new ResizeObserver(b=>{let[g]=b;g&&g.target===f&&w&&(w.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var y;(y=w)==null||y.observe(t)})),r()}),f&&!c&&w.observe(f),w.observe(t));let k,_=c?zi(e):null;c&&v();function v(){const b=zi(e);_&&!ZS(_,b)&&r(),_=b,k=requestAnimationFrame(v)}return r(),()=>{var b;m.forEach(g=>{o&&g.removeEventListener("scroll",r),u&&g.removeEventListener("resize",r)}),h==null||h(),(b=w)==null||b.disconnect(),w=null,c&&cancelAnimationFrame(k)}}const FI=cI,$I=uI,zI=oI,HI=hI,WI=aI,Ob=iI,VI=dI,UI=(e,t,r)=>{const s=new Map,o={platform:II,...r},u={...o.platform,_c:s};return sI(e,t,{...o,platform:u})};var GI=typeof document<"u",KI=function(){},mu=GI?C.useLayoutEffect:KI;function Du(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(s=r;s--!==0;)if(!Du(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Du(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function eC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bb(e,t){const r=eC(e);return Math.round(t*r)/r}function Vf(e){const t=C.useRef(e);return mu(()=>{t.current=e}),t}function qI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:d}={},transform:l=!0,whileElementsMounted:c,open:f}=e,[m,h]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,w]=C.useState(s);Du(x,s)||w(s);const[k,_]=C.useState(null),[v,b]=C.useState(null),g=C.useCallback(U=>{U!==P.current&&(P.current=U,_(U))},[]),y=C.useCallback(U=>{U!==T.current&&(T.current=U,b(U))},[]),j=u||k,E=d||v,P=C.useRef(null),T=C.useRef(null),N=C.useRef(m),R=c!=null,I=Vf(c),O=Vf(o),$=Vf(f),W=C.useCallback(()=>{if(!P.current||!T.current)return;const U={placement:t,strategy:r,middleware:x};O.current&&(U.platform=O.current),UI(P.current,T.current,U).then(L=>{const M={...L,isPositioned:$.current!==!1};Y.current&&!Du(N.current,M)&&(N.current=M,pl.flushSync(()=>{h(M)}))})},[x,t,r,O,$]);mu(()=>{f===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const Y=C.useRef(!1);mu(()=>(Y.current=!0,()=>{Y.current=!1}),[]),mu(()=>{if(j&&(P.current=j),E&&(T.current=E),j&&E){if(I.current)return I.current(j,E,W);W()}},[j,E,W,I,R]);const z=C.useMemo(()=>({reference:P,floating:T,setReference:g,setFloating:y}),[g,y]),K=C.useMemo(()=>({reference:j,floating:E}),[j,E]),G=C.useMemo(()=>{const U={position:r,left:0,top:0};if(!K.floating)return U;const L=Bb(K.floating,m.x),M=Bb(K.floating,m.y);return l?{...U,transform:"translate("+L+"px, "+M+"px)",...eC(K.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:L,top:M}},[r,l,K.floating,m.x,m.y]);return C.useMemo(()=>({...m,update:W,refs:z,elements:K,floatingStyles:G}),[m,W,z,K,G])}const YI=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:o}=typeof e=="function"?e(r):e;return s&&t(s)?s.current!=null?Ob({element:s.current,padding:o}).fn(r):{}:s?Ob({element:s,padding:o}).fn(r):{}}}},XI=(e,t)=>({...FI(e),options:[e,t]}),JI=(e,t)=>({...$I(e),options:[e,t]}),QI=(e,t)=>({...VI(e),options:[e,t]}),ZI=(e,t)=>({...zI(e),options:[e,t]}),eO=(e,t)=>({...HI(e),options:[e,t]}),tO=(e,t)=>({...WI(e),options:[e,t]}),rO=(e,t)=>({...YI(e),options:[e,t]});var nO="Arrow",tC=C.forwardRef((e,t)=>{const{children:r,width:s=10,height:o=5,...u}=e;return n.jsx(Xe.svg,{...u,ref:t,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});tC.displayName=nO;var sO=tC,pg="Popper",[rC,Xo]=Xr(pg),[iO,nC]=rC(pg),sC=e=>{const{__scopePopper:t,children:r}=e,[s,o]=C.useState(null);return n.jsx(iO,{scope:t,anchor:s,onAnchorChange:o,children:r})};sC.displayName=pg;var iC="PopperAnchor",oC=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:s,...o}=e,u=nC(iC,r),d=C.useRef(null),l=it(t,d),c=C.useRef(null);return C.useEffect(()=>{const f=c.current;c.current=(s==null?void 0:s.current)||d.current,f!==c.current&&u.onAnchorChange(c.current)}),s?null:n.jsx(Xe.div,{...o,ref:l})});oC.displayName=iC;var gg="PopperContent",[oO,aO]=rC(gg),aC=C.forwardRef((e,t)=>{var X,H,ae,ne,J,ie;const{__scopePopper:r,side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:x=!1,updatePositionStrategy:w="optimized",onPlaced:k,..._}=e,v=nC(gg,r),[b,g]=C.useState(null),y=it(t,ye=>g(ye)),[j,E]=C.useState(null),P=ig(j),T=(P==null?void 0:P.width)??0,N=(P==null?void 0:P.height)??0,R=s+(u!=="center"?"-"+u:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},O=Array.isArray(f)?f:[f],$=O.length>0,W={padding:I,boundary:O.filter(cO),altBoundary:$},{refs:Y,floatingStyles:z,placement:K,isPositioned:G,middlewareData:U}=qI({strategy:"fixed",placement:R,whileElementsMounted:(...ye)=>BI(...ye,{animationFrame:w==="always"}),elements:{reference:v.anchor},middleware:[XI({mainAxis:o+N,alignmentAxis:d}),c&&JI({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?QI():void 0,...W}),c&&ZI({...W}),eO({...W,apply:({elements:ye,rects:Oe,availableWidth:Ve,availableHeight:te})=>{const{width:de,height:De}=Oe.reference,Re=ye.floating.style;Re.setProperty("--radix-popper-available-width",`${Ve}px`),Re.setProperty("--radix-popper-available-height",`${te}px`),Re.setProperty("--radix-popper-anchor-width",`${de}px`),Re.setProperty("--radix-popper-anchor-height",`${De}px`)}}),j&&rO({element:j,padding:l}),uO({arrowWidth:T,arrowHeight:N}),x&&tO({strategy:"referenceHidden",...W})]}),[L,M]=uC(K),B=_r(k);gr(()=>{G&&(B==null||B())},[G,B]);const q=(X=U.arrow)==null?void 0:X.x,F=(H=U.arrow)==null?void 0:H.y,oe=((ae=U.arrow)==null?void 0:ae.centerOffset)!==0,[fe,me]=C.useState();return gr(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),n.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:G?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ne=U.transformOrigin)==null?void 0:ne.x,(J=U.transformOrigin)==null?void 0:J.y].join(" "),...((ie=U.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(oO,{scope:r,placedSide:L,onArrowChange:E,arrowX:q,arrowY:F,shouldHideArrow:oe,children:n.jsx(Xe.div,{"data-side":L,"data-align":M,..._,ref:y,style:{..._.style,animation:G?void 0:"none"}})})})});aC.displayName=gg;var lC="PopperArrow",lO={top:"bottom",right:"left",bottom:"top",left:"right"},cC=C.forwardRef(function(t,r){const{__scopePopper:s,...o}=t,u=aO(lC,s),d=lO[u.placedSide];return n.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:n.jsx(sO,{...o,ref:r,style:{...o.style,display:"block"}})})});cC.displayName=lC;function cO(e){return e!==null}var uO=e=>({name:"transformOrigin",options:e,fn(t){var v,b,g;const{placement:r,rects:s,middlewareData:o}=t,d=((v=o.arrow)==null?void 0:v.centerOffset)!==0,l=d?0:e.arrowWidth,c=d?0:e.arrowHeight,[f,m]=uC(r),h={start:"0%",center:"50%",end:"100%"}[m],x=(((b=o.arrow)==null?void 0:b.x)??0)+l/2,w=(((g=o.arrow)==null?void 0:g.y)??0)+c/2;let k="",_="";return f==="bottom"?(k=d?h:`${x}px`,_=`${-c}px`):f==="top"?(k=d?h:`${x}px`,_=`${s.floating.height+c}px`):f==="right"?(k=`${-c}px`,_=d?h:`${w}px`):f==="left"&&(k=`${s.floating.width+c}px`,_=d?h:`${w}px`),{data:{x:k,y:_}}}});function uC(e){const[t,r="center"]=e.split("-");return[t,r]}var xg=sC,vg=oC,yg=aC,bg=cC;function dO(e){const t=hO(e),r=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(mO);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return n.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function hO(e){const t=C.forwardRef((r,s)=>{const{children:o,...u}=r;if(C.isValidElement(o)){const d=gO(o),l=pO(u,o.props);return o.type!==C.Fragment&&(l.ref=s?js(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fO=Symbol("radix.slottable");function mO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fO}function pO(e,t){const r={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function gO(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xO="VisuallyHidden",hC=C.forwardRef((e,t)=>n.jsx(Xe.span,{...e,ref:t,style:{...dC,...e.style}}));hC.displayName=xO;var vO=hC,yO=[" ","Enter","ArrowUp","ArrowDown"],bO=[" ","Enter"],Hi="Select",[pd,gd,wO]=lg(Hi),[Jo]=Xr(Hi,[wO,Xo]),xd=Xo(),[_O,di]=Jo(Hi),[SO,CO]=Jo(Hi),fC=e=>{const{__scopeSelect:t,children:r,open:s,defaultOpen:o,onOpenChange:u,value:d,defaultValue:l,onValueChange:c,dir:f,name:m,autoComplete:h,disabled:x,required:w,form:k}=e,_=xd(t),[v,b]=C.useState(null),[g,y]=C.useState(null),[j,E]=C.useState(!1),P=Sl(f),[T,N]=ss({prop:s,defaultProp:o??!1,onChange:u,caller:Hi}),[R,I]=ss({prop:d,defaultProp:l,onChange:c,caller:Hi}),O=C.useRef(null),$=v?k||!!v.closest("form"):!0,[W,Y]=C.useState(new Set),z=Array.from(W).map(K=>K.props.value).join(";");return n.jsx(xg,{..._,children:n.jsxs(_O,{required:w,scope:t,trigger:v,onTriggerChange:b,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:E,contentId:Sn(),value:R,onValueChange:I,open:T,onOpenChange:N,dir:P,triggerPointerDownPosRef:O,disabled:x,children:[n.jsx(pd.Provider,{scope:t,children:n.jsx(SO,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(K=>{Y(G=>new Set(G).add(K))},[]),onNativeOptionRemove:C.useCallback(K=>{Y(G=>{const U=new Set(G);return U.delete(K),U})},[]),children:r})}),$?n.jsxs(OC,{"aria-hidden":!0,required:w,tabIndex:-1,name:m,autoComplete:h,value:R,onChange:K=>I(K.target.value),disabled:x,form:k,children:[R===void 0?n.jsx("option",{value:""}):null,Array.from(W)]},z):null]})})};fC.displayName=Hi;var mC="SelectTrigger",pC=C.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:s=!1,...o}=e,u=xd(r),d=di(mC,r),l=d.disabled||s,c=it(t,d.onTriggerChange),f=gd(r),m=C.useRef("touch"),[h,x,w]=FC(_=>{const v=f().filter(y=>!y.disabled),b=v.find(y=>y.value===d.value),g=$C(v,_,b);g!==void 0&&d.onValueChange(g.value)}),k=_=>{l||(d.onOpenChange(!0),w()),_&&(d.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return n.jsx(vg,{asChild:!0,...u,children:n.jsx(Xe.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":BC(d.value)?"":void 0,...o,ref:c,onClick:Te(o.onClick,_=>{_.currentTarget.focus(),m.current!=="mouse"&&k(_)}),onPointerDown:Te(o.onPointerDown,_=>{m.current=_.pointerType;const v=_.target;v.hasPointerCapture(_.pointerId)&&v.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(k(_),_.preventDefault())}),onKeyDown:Te(o.onKeyDown,_=>{const v=h.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&x(_.key),!(v&&_.key===" ")&&yO.includes(_.key)&&(k(),_.preventDefault())})})})});pC.displayName=mC;var gC="SelectValue",xC=C.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:o,children:u,placeholder:d="",...l}=e,c=di(gC,r),{onValueNodeHasChildrenChange:f}=c,m=u!==void 0,h=it(t,c.onValueNodeChange);return gr(()=>{f(m)},[f,m]),n.jsx(Xe.span,{...l,ref:h,style:{pointerEvents:"none"},children:BC(c.value)?n.jsx(n.Fragment,{children:d}):u})});xC.displayName=gC;var kO="SelectIcon",vC=C.forwardRef((e,t)=>{const{__scopeSelect:r,children:s,...o}=e;return n.jsx(Xe.span,{"aria-hidden":!0,...o,ref:t,children:s||"▼"})});vC.displayName=kO;var jO="SelectPortal",yC=e=>n.jsx(kl,{asChild:!0,...e});yC.displayName=jO;var Wi="SelectContent",bC=C.forwardRef((e,t)=>{const r=di(Wi,e.__scopeSelect),[s,o]=C.useState();if(gr(()=>{o(new DocumentFragment)},[]),!r.open){const u=s;return u?pl.createPortal(n.jsx(wC,{scope:e.__scopeSelect,children:n.jsx(pd.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),u):null}return n.jsx(_C,{...e,ref:t})});bC.displayName=Wi;var On=10,[wC,hi]=Jo(Wi),NO="SelectContentImpl",EO=dO("SelectContent.RemoveScroll"),_C=C.forwardRef((e,t)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:u,onPointerDownOutside:d,side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:w,sticky:k,hideWhenDetached:_,avoidCollisions:v,...b}=e,g=di(Wi,r),[y,j]=C.useState(null),[E,P]=C.useState(null),T=it(t,X=>j(X)),[N,R]=C.useState(null),[I,O]=C.useState(null),$=gd(r),[W,Y]=C.useState(!1),z=C.useRef(!1);C.useEffect(()=>{if(y)return Qp(y)},[y]),Jp();const K=C.useCallback(X=>{const[H,...ae]=$().map(ie=>ie.ref.current),[ne]=ae.slice(-1),J=document.activeElement;for(const ie of X)if(ie===J||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===H&&E&&(E.scrollTop=0),ie===ne&&E&&(E.scrollTop=E.scrollHeight),ie==null||ie.focus(),document.activeElement!==J))return},[$,E]),G=C.useCallback(()=>K([N,y]),[K,N,y]);C.useEffect(()=>{W&&G()},[W,G]);const{onOpenChange:U,triggerPointerDownPosRef:L}=g;C.useEffect(()=>{if(y){let X={x:0,y:0};const H=ne=>{var J,ie;X={x:Math.abs(Math.round(ne.pageX)-(((J=L.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((ie=L.current)==null?void 0:ie.y)??0))}},ae=ne=>{X.x<=10&&X.y<=10?ne.preventDefault():y.contains(ne.target)||U(!1),document.removeEventListener("pointermove",H),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",ae,{capture:!0})}}},[y,U,L]),C.useEffect(()=>{const X=()=>U(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[U]);const[M,B]=FC(X=>{const H=$().filter(J=>!J.disabled),ae=H.find(J=>J.ref.current===document.activeElement),ne=$C(H,X,ae);ne&&setTimeout(()=>ne.ref.current.focus())}),q=C.useCallback((X,H,ae)=>{const ne=!z.current&&!ae;(g.value!==void 0&&g.value===H||ne)&&(R(X),ne&&(z.current=!0))},[g.value]),F=C.useCallback(()=>y==null?void 0:y.focus(),[y]),oe=C.useCallback((X,H,ae)=>{const ne=!z.current&&!ae;(g.value!==void 0&&g.value===H||ne)&&O(X)},[g.value]),fe=s==="popper"?$m:SC,me=fe===$m?{side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:w,sticky:k,hideWhenDetached:_,avoidCollisions:v}:{};return n.jsx(wC,{scope:r,content:y,viewport:E,onViewportChange:P,itemRefCallback:q,selectedItem:N,onItemLeave:F,itemTextRefCallback:oe,focusSelectedItem:G,selectedItemText:I,position:s,isPositioned:W,searchRef:M,children:n.jsx(sd,{as:EO,allowPinchZoom:!0,children:n.jsx(rd,{asChild:!0,trapped:g.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Te(o,X=>{var H;(H=g.trigger)==null||H.focus({preventScroll:!0}),X.preventDefault()}),children:n.jsx(Cl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:n.jsx(fe,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:X=>X.preventDefault(),...b,...me,onPlaced:()=>Y(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,X=>{const H=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!H&&X.key.length===1&&B(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let ne=$().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(X.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const J=X.target,ie=ne.indexOf(J);ne=ne.slice(ie+1)}setTimeout(()=>K(ne)),X.preventDefault()}})})})})})})});_C.displayName=NO;var PO="SelectItemAlignedPosition",SC=C.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:s,...o}=e,u=di(Wi,r),d=hi(Wi,r),[l,c]=C.useState(null),[f,m]=C.useState(null),h=it(t,T=>m(T)),x=gd(r),w=C.useRef(!1),k=C.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:g}=d,y=C.useCallback(()=>{if(u.trigger&&u.valueNode&&l&&f&&_&&v&&b){const T=u.trigger.getBoundingClientRect(),N=f.getBoundingClientRect(),R=u.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(u.dir!=="rtl"){const J=I.left-N.left,ie=R.left-J,ye=T.left-ie,Oe=T.width+ye,Ve=Math.max(Oe,N.width),te=window.innerWidth-On,de=Dm(ie,[On,Math.max(On,te-Ve)]);l.style.minWidth=Oe+"px",l.style.left=de+"px"}else{const J=N.right-I.right,ie=window.innerWidth-R.right-J,ye=window.innerWidth-T.right-ie,Oe=T.width+ye,Ve=Math.max(Oe,N.width),te=window.innerWidth-On,de=Dm(ie,[On,Math.max(On,te-Ve)]);l.style.minWidth=Oe+"px",l.style.right=de+"px"}const O=x(),$=window.innerHeight-On*2,W=_.scrollHeight,Y=window.getComputedStyle(f),z=parseInt(Y.borderTopWidth,10),K=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),U=parseInt(Y.paddingBottom,10),L=z+K+W+U+G,M=Math.min(v.offsetHeight*5,L),B=window.getComputedStyle(_),q=parseInt(B.paddingTop,10),F=parseInt(B.paddingBottom,10),oe=T.top+T.height/2-On,fe=$-oe,me=v.offsetHeight/2,X=v.offsetTop+me,H=z+K+X,ae=L-H;if(H<=oe){const J=O.length>0&&v===O[O.length-1].ref.current;l.style.bottom="0px";const ie=f.clientHeight-_.offsetTop-_.offsetHeight,ye=Math.max(fe,me+(J?F:0)+ie+G),Oe=H+ye;l.style.height=Oe+"px"}else{const J=O.length>0&&v===O[0].ref.current;l.style.top="0px";const ye=Math.max(oe,z+_.offsetTop+(J?q:0)+me)+ae;l.style.height=ye+"px",_.scrollTop=H-oe+_.offsetTop}l.style.margin=`${On}px 0`,l.style.minHeight=M+"px",l.style.maxHeight=$+"px",s==null||s(),requestAnimationFrame(()=>w.current=!0)}},[x,u.trigger,u.valueNode,l,f,_,v,b,u.dir,s]);gr(()=>y(),[y]);const[j,E]=C.useState();gr(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const P=C.useCallback(T=>{T&&k.current===!0&&(y(),g==null||g(),k.current=!1)},[y,g]);return n.jsx(TO,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:P,children:n.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:n.jsx(Xe.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});SC.displayName=PO;var AO="SelectPopperPosition",$m=C.forwardRef((e,t)=>{const{__scopeSelect:r,align:s="start",collisionPadding:o=On,...u}=e,d=xd(r);return n.jsx(yg,{...d,...u,ref:t,align:s,collisionPadding:o,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$m.displayName=AO;var[TO,wg]=Jo(Wi,{}),zm="SelectViewport",CC=C.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:s,...o}=e,u=hi(zm,r),d=wg(zm,r),l=it(t,u.onViewportChange),c=C.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),n.jsx(pd.Slot,{scope:r,children:n.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,f=>{const m=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:x}=d;if(x!=null&&x.current&&h){const w=Math.abs(c.current-m.scrollTop);if(w>0){const k=window.innerHeight-On*2,_=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),b=Math.max(_,v);if(b<k){const g=b+w,y=Math.min(k,g),j=g-y;h.style.height=y+"px",h.style.bottom==="0px"&&(m.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});CC.displayName=zm;var kC="SelectGroup",[RO,MO]=Jo(kC),DO=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,o=Sn();return n.jsx(RO,{scope:r,id:o,children:n.jsx(Xe.div,{role:"group","aria-labelledby":o,...s,ref:t})})});DO.displayName=kC;var jC="SelectLabel",NC=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,o=MO(jC,r);return n.jsx(Xe.div,{id:o.id,...s,ref:t})});NC.displayName=jC;var Lu="SelectItem",[LO,EC]=Jo(Lu),PC=C.forwardRef((e,t)=>{const{__scopeSelect:r,value:s,disabled:o=!1,textValue:u,...d}=e,l=di(Lu,r),c=hi(Lu,r),f=l.value===s,[m,h]=C.useState(u??""),[x,w]=C.useState(!1),k=it(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,s,o)}),_=Sn(),v=C.useRef("touch"),b=()=>{o||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(LO,{scope:r,value:s,disabled:o,textId:_,isSelected:f,onItemTextChange:C.useCallback(g=>{h(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:n.jsx(pd.ItemSlot,{scope:r,value:s,disabled:o,textValue:m,children:n.jsx(Xe.div,{role:"option","aria-labelledby":_,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:k,onFocus:Te(d.onFocus,()=>w(!0)),onBlur:Te(d.onBlur,()=>w(!1)),onClick:Te(d.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Te(d.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Te(d.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:Te(d.onPointerMove,g=>{var y;v.current=g.pointerType,o?(y=c.onItemLeave)==null||y.call(c):v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(d.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Te(d.onKeyDown,g=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&g.key===" "||(bO.includes(g.key)&&b(),g.key===" "&&g.preventDefault())})})})})});PC.displayName=Lu;var Ua="SelectItemText",AC=C.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:o,...u}=e,d=di(Ua,r),l=hi(Ua,r),c=EC(Ua,r),f=CO(Ua,r),[m,h]=C.useState(null),x=it(t,b=>h(b),c.onItemTextChange,b=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,b,c.value,c.disabled)}),w=m==null?void 0:m.textContent,k=C.useMemo(()=>n.jsx("option",{value:c.value,disabled:c.disabled,children:w},c.value),[c.disabled,c.value,w]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=f;return gr(()=>(_(k),()=>v(k)),[_,v,k]),n.jsxs(n.Fragment,{children:[n.jsx(Xe.span,{id:c.textId,...u,ref:x}),c.isSelected&&d.valueNode&&!d.valueNodeHasChildren?pl.createPortal(u.children,d.valueNode):null]})});AC.displayName=Ua;var TC="SelectItemIndicator",RC=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return EC(TC,r).isSelected?n.jsx(Xe.span,{"aria-hidden":!0,...s,ref:t}):null});RC.displayName=TC;var Hm="SelectScrollUpButton",MC=C.forwardRef((e,t)=>{const r=hi(Hm,e.__scopeSelect),s=wg(Hm,e.__scopeSelect),[o,u]=C.useState(!1),d=it(t,s.onScrollButtonChange);return gr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=c.scrollTop>0;u(f)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?n.jsx(LC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});MC.displayName=Hm;var Wm="SelectScrollDownButton",DC=C.forwardRef((e,t)=>{const r=hi(Wm,e.__scopeSelect),s=wg(Wm,e.__scopeSelect),[o,u]=C.useState(!1),d=it(t,s.onScrollButtonChange);return gr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<f;u(m)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?n.jsx(LC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});DC.displayName=Wm;var LC=C.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:s,...o}=e,u=hi("SelectScrollButton",r),d=C.useRef(null),l=gd(r),c=C.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),gr(()=>{var m;const f=l().find(h=>h.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),n.jsx(Xe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:Te(o.onPointerMove,()=>{var f;(f=u.onItemLeave)==null||f.call(u),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{c()})})}),IO="SelectSeparator",IC=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return n.jsx(Xe.div,{"aria-hidden":!0,...s,ref:t})});IC.displayName=IO;var Vm="SelectArrow",OO=C.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,o=xd(r),u=di(Vm,r),d=hi(Vm,r);return u.open&&d.position==="popper"?n.jsx(bg,{...o,...s,ref:t}):null});OO.displayName=Vm;var BO="SelectBubbleInput",OC=C.forwardRef(({__scopeSelect:e,value:t,...r},s)=>{const o=C.useRef(null),u=it(s,o),d=sg(t);return C.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(d!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[d,t]),n.jsx(Xe.select,{...r,style:{...dC,...r.style},ref:u,defaultValue:t})});OC.displayName=BO;function BC(e){return e===""||e===void 0}function FC(e){const t=_r(e),r=C.useRef(""),s=C.useRef(0),o=C.useCallback(d=>{const l=r.current+d;t(l),(function c(f){r.current=f,window.clearTimeout(s.current),f!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),u=C.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,o,u]}function $C(e,t,r){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,u=r?e.indexOf(r):-1;let d=FO(e,Math.max(u,0));o.length===1&&(d=d.filter(f=>f!==r));const c=d.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function FO(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var $O=fC,zC=pC,zO=xC,HO=vC,WO=yC,HC=bC,VO=CC,WC=NC,VC=PC,UO=AC,GO=RC,UC=MC,GC=DC,KC=IC;const fr=$O,mr=zO,ar=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(zC,{ref:s,className:je("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,n.jsx(HO,{asChild:!0,children:n.jsx(Sr,{className:"h-4 w-4 opacity-50"})})]}));ar.displayName=zC.displayName;const qC=C.forwardRef(({className:e,...t},r)=>n.jsx(UC,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(hM,{className:"h-4 w-4"})}));qC.displayName=UC.displayName;const YC=C.forwardRef(({className:e,...t},r)=>n.jsx(GC,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(Sr,{className:"h-4 w-4"})}));YC.displayName=GC.displayName;const lr=C.forwardRef(({className:e,children:t,position:r="popper",...s},o)=>n.jsx(WO,{children:n.jsxs(HC,{ref:o,className:je("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...s,children:[n.jsx(qC,{}),n.jsx(VO,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),n.jsx(YC,{})]})}));lr.displayName=HC.displayName;const KO=C.forwardRef(({className:e,...t},r)=>n.jsx(WC,{ref:r,className:je("px-2 py-1.5 text-sm font-semibold",e),...t}));KO.displayName=WC.displayName;const xt=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(VC,{ref:s,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(GO,{children:n.jsx(Kt,{className:"h-4 w-4"})})}),n.jsx(UO,{children:t})]}));xt.displayName=VC.displayName;const qO=C.forwardRef(({className:e,...t},r)=>n.jsx(KC,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));qO.displayName=KC.displayName;const Uf={claude:{name:"Claude Code",folder:".claude",color:"text-orange-600",bg:"bg-orange-50",darkBg:"dark:bg-orange-950/30"},gemini:{name:"Gemini CLI",folder:".gemini",color:"text-blue-600",bg:"bg-blue-50",darkBg:"dark:bg-blue-950/30"},antigravity:{name:"Antigravity",folder:".agent",color:"text-purple-600",bg:"bg-purple-50",darkBg:"dark:bg-purple-950/30"}};function YO({open:e,onOpenChange:t,projectDir:r,onSynced:s}){var N,R,I;const[o,u]=C.useState("claude"),[d,l]=C.useState("antigravity"),[c,f]=C.useState(null),[m,h]=C.useState(!1),[x,w]=C.useState(!1),[k,_]=C.useState(new Set);C.useEffect(()=>{e&&r&&v()},[e,o,d,r]),C.useEffect(()=>{e&&_(new Set)},[e]);const v=async()=>{var O;h(!0);try{const $=await ke.getSyncPreview(r,o,d);f($);const W=new Set(((O=$.files)==null?void 0:O.filter(Y=>Y.status==="new"||Y.status==="different").map(Y=>Y.name))||[]);_(W)}catch($){ee.error("Failed to load sync preview: "+$.message),f(null)}finally{h(!1)}},b=()=>{u(d),l(o)},g=O=>{const $=new Set(k);$.has(O)?$.delete(O):$.add(O),_($)},y=()=>{var O,$;k.size===((O=c==null?void 0:c.files)==null?void 0:O.length)?_(new Set):_(new Set((($=c==null?void 0:c.files)==null?void 0:$.map(W=>W.name))||[]))},j=async()=>{if(k.size===0){ee.error("Please select at least one file to sync");return}w(!0);try{const O=await ke.syncRules(r,o,d,Array.from(k));O.success?(ee.success(`Synced ${O.synced.length} file(s) to ${Uf[d].name}`),s==null||s(),t(!1)):ee.error(O.error||"Sync failed")}catch(O){ee.error("Sync failed: "+O.message)}finally{w(!1)}},E=O=>{switch(O){case"new":return n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700",children:"New"});case"different":return n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-yellow-100 text-yellow-700",children:"Modified"});case"identical":return n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 dark:bg-slate-700 text-gray-500 dark:text-slate-400",children:"Same"});default:return null}},P=Uf[o],T=Uf[d];return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(pr,{className:"w-5 h-5 text-indigo-500"}),"Sync Rules Between Tools"]}),n.jsx(tr,{children:"Copy rules from one AI tool's configuration to another."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"From"}),n.jsxs(fr,{value:o,onValueChange:u,children:[n.jsx(ar,{className:"w-full",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"claude",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),n.jsx(xt,{value:"gemini",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),n.jsx(xt,{value:"antigravity",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]}),n.jsx(le,{variant:"ghost",size:"icon",onClick:b,className:"mt-5",title:"Swap direction",children:n.jsx(Hp,{className:"w-4 h-4"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"To"}),n.jsxs(fr,{value:d,onValueChange:l,children:[n.jsx(ar,{className:"w-full",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"claude",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),n.jsx(xt,{value:"gemini",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),n.jsx(xt,{value:"antigravity",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[n.jsxs("div",{children:["Source: ",n.jsxs("code",{className:"bg-muted px-1 rounded",children:[P.folder,"/rules/"]})]}),n.jsxs("div",{children:["Target: ",n.jsxs("code",{className:"bg-muted px-1 rounded",children:[T.folder,"/rules/"]})]})]}),n.jsxs("div",{className:"border rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[n.jsx("span",{className:"text-sm font-medium",children:"Rules to Sync"}),((N=c==null?void 0:c.files)==null?void 0:N.length)>0&&n.jsx(le,{variant:"ghost",size:"sm",onClick:y,className:"h-6 text-xs",children:k.size===c.files.length?"Deselect All":"Select All"})]}),n.jsx("div",{className:"max-h-64 overflow-auto",children:m?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(ut,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):c!=null&&c.error?n.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-amber-600",children:[n.jsx(Oi,{className:"w-4 h-4"}),c.error]}):((R=c==null?void 0:c.files)==null?void 0:R.length)===0?n.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No rules found in source folder"}):n.jsx("div",{className:"divide-y",children:(I=c==null?void 0:c.files)==null?void 0:I.map(O=>n.jsxs("label",{className:je("flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-muted/30",k.has(O.name)&&"bg-primary/5"),children:[n.jsx(jl,{checked:k.has(O.name),onCheckedChange:()=>g(O.name)}),n.jsx(Cr,{className:"w-4 h-4 text-purple-500"}),n.jsx("span",{className:"flex-1 text-sm",children:O.name}),E(O.status)]},O.name))})})]}),(c==null?void 0:c.files)&&k.size>0&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.size," file(s) selected for sync"]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:j,disabled:x||m||k.size===0,children:x?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Syncing..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Kt,{className:"w-4 h-4 mr-2"}),"Sync ",k.size," File(s)"]})})]})]})})}const ct=C.forwardRef(({className:e,type:t,...r},s)=>n.jsx("input",{type:t,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...r}));ct.displayName="Input";function _g({open:e,onOpenChange:t,onSelect:r,type:s="directory",initialPath:o="~",title:u="Select Path"}){const[d,l]=C.useState(""),[c,f]=C.useState([]),[m,h]=C.useState(!1),[x,w]=C.useState(null),[k,_]=C.useState(""),[v,b]=C.useState("");C.useEffect(()=>{e&&g(o)},[e,o]);const g=async T=>{h(!0),w(null);try{const N=await ke.browse(T,s);N.error?(w(N.error),N.path&&(l(N.path),b(N.path))):(l(N.path),b(N.path),f(N.items||[]),N.home&&_(N.home))}catch(N){w(N.message)}finally{h(!1)}},y=T=>{T.type==="directory"?g(T.path):s==="file"&&(r(T.path),t(!1))},j=()=>{r(d),t(!1)},E=()=>{v&&g(v)},P=T=>{T.key==="Enter"&&E()};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-lg",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[s==="directory"?n.jsx(wr,{className:"w-5 h-5"}):n.jsx(Pm,{className:"w-5 h-5"}),u]})}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{value:v,onChange:T=>b(T.target.value),onKeyDown:P,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>g(k||"~"),title:"Go to home",children:n.jsx(Vp,{className:"w-4 h-4"})}),n.jsx(le,{onClick:E,disabled:m,children:"Go"})]}),n.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:d}),x&&n.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:x}),n.jsx(Nn,{className:"h-64 border rounded-lg",children:m?n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx(ut,{className:"w-6 h-6 animate-spin text-gray-400"})}):n.jsx("div",{className:"p-1",children:c.length===0?n.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:s==="directory"?"No subdirectories":"No files found"}):c.map((T,N)=>n.jsxs("button",{onClick:()=>y(T),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[T.type==="directory"?n.jsx(wr,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):n.jsx(Pm,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),n.jsx("span",{className:`flex-1 truncate ${T.isParent?"text-gray-500":""}`,children:T.name}),T.type==="directory"&&!T.isParent&&n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})]},N))})})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:j,disabled:!d,children:s==="directory"?"Select Folder":"Select"})]})]})})}var vd="Switch",[XO]=Xr(vd),[JO,QO]=XO(vd),XC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:s,checked:o,defaultChecked:u,required:d,disabled:l,value:c="on",onCheckedChange:f,form:m,...h}=e,[x,w]=C.useState(null),k=it(t,y=>w(y)),_=C.useRef(!1),v=x?m||!!x.closest("form"):!0,[b,g]=ss({prop:o,defaultProp:u??!1,onChange:f,caller:vd});return n.jsxs(JO,{scope:r,checked:b,disabled:l,children:[n.jsx(Xe.button,{type:"button",role:"switch","aria-checked":b,"aria-required":d,"data-state":ek(b),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:k,onClick:Te(e.onClick,y=>{g(j=>!j),v&&(_.current=y.isPropagationStopped(),_.current||y.stopPropagation())})}),v&&n.jsx(ZC,{control:x,bubbles:!_.current,name:s,value:c,checked:b,required:d,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});XC.displayName=vd;var JC="SwitchThumb",QC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...s}=e,o=QO(JC,r);return n.jsx(Xe.span,{"data-state":ek(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})});QC.displayName=JC;var ZO="SwitchBubbleInput",ZC=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:s=!0,...o},u)=>{const d=C.useRef(null),l=it(d,u),c=sg(r),f=ig(t);return C.useEffect(()=>{const m=d.current;if(!m)return;const h=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&w){const k=new Event("click",{bubbles:s});w.call(m,r),m.dispatchEvent(k)}},[c,r,s]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ZC.displayName=ZO;function ek(e){return e?"checked":"unchecked"}var tk=XC,e6=QC;const dt=C.forwardRef(({className:e,...t},r)=>n.jsx(tk,{className:je("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:n.jsx(e6,{className:je("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));dt.displayName=tk.displayName;var Gf="rovingFocusGroup.onEntryFocus",t6={bubbles:!1,cancelable:!0},El="RovingFocusGroup",[Um,rk,r6]=lg(El),[n6,yd]=Xr(El,[r6]),[s6,i6]=n6(El),nk=C.forwardRef((e,t)=>n.jsx(Um.Provider,{scope:e.__scopeRovingFocusGroup,children:n.jsx(Um.Slot,{scope:e.__scopeRovingFocusGroup,children:n.jsx(o6,{...e,ref:t})})}));nk.displayName=El;var o6=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:o=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,x=C.useRef(null),w=it(t,x),k=Sl(u),[_,v]=ss({prop:d,defaultProp:l??null,onChange:c,caller:El}),[b,g]=C.useState(!1),y=_r(f),j=rk(r),E=C.useRef(!1),[P,T]=C.useState(0);return C.useEffect(()=>{const N=x.current;if(N)return N.addEventListener(Gf,y),()=>N.removeEventListener(Gf,y)},[y]),n.jsx(s6,{scope:r,orientation:s,dir:k,loop:o,currentTabStopId:_,onItemFocus:C.useCallback(N=>v(N),[v]),onItemShiftTab:C.useCallback(()=>g(!0),[]),onFocusableItemAdd:C.useCallback(()=>T(N=>N+1),[]),onFocusableItemRemove:C.useCallback(()=>T(N=>N-1),[]),children:n.jsx(Xe.div,{tabIndex:b||P===0?-1:0,"data-orientation":s,...h,ref:w,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{E.current=!0}),onFocus:Te(e.onFocus,N=>{const R=!E.current;if(N.target===N.currentTarget&&R&&!b){const I=new CustomEvent(Gf,t6);if(N.currentTarget.dispatchEvent(I),!I.defaultPrevented){const O=j().filter(K=>K.focusable),$=O.find(K=>K.active),W=O.find(K=>K.id===_),z=[$,W,...O].filter(Boolean).map(K=>K.ref.current);ok(z,m)}}E.current=!1}),onBlur:Te(e.onBlur,()=>g(!1))})})}),sk="RovingFocusGroupItem",ik=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:o=!1,tabStopId:u,children:d,...l}=e,c=Sn(),f=u||c,m=i6(sk,r),h=m.currentTabStopId===f,x=rk(r),{onFocusableItemAdd:w,onFocusableItemRemove:k,currentTabStopId:_}=m;return C.useEffect(()=>{if(s)return w(),()=>k()},[s,w,k]),n.jsx(Um.ItemSlot,{scope:r,id:f,focusable:s,active:o,children:n.jsx(Xe.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Te(e.onMouseDown,v=>{s?m.onItemFocus(f):v.preventDefault()}),onFocus:Te(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Te(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){m.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=c6(v,m.orientation,m.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=x().filter(j=>j.focusable).map(j=>j.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const j=y.indexOf(v.currentTarget);y=m.loop?u6(y,j+1):y.slice(j+1)}setTimeout(()=>ok(y))}}),children:typeof d=="function"?d({isCurrentTabStop:h,hasTabStop:_!=null}):d})})});ik.displayName=sk;var a6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l6(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function c6(e,t,r){const s=l6(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return a6[s]}function ok(e,t=!1){const r=document.activeElement;for(const s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}function u6(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var ak=nk,lk=ik;function d6(e){const t=h6(e),r=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(m6);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return n.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return n.jsx(t,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function h6(e){const t=C.forwardRef((r,s)=>{const{children:o,...u}=r;if(C.isValidElement(o)){const d=g6(o),l=p6(u,o.props);return o.type!==C.Fragment&&(l.ref=s?js(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var f6=Symbol("radix.slottable");function m6(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f6}function p6(e,t){const r={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?r[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(r[s]=o):s==="style"?r[s]={...o,...u}:s==="className"&&(r[s]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function g6(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gm=["Enter"," "],x6=["ArrowDown","PageUp","Home"],ck=["ArrowUp","PageDown","End"],v6=[...x6,...ck],y6={ltr:[...Gm,"ArrowRight"],rtl:[...Gm,"ArrowLeft"]},b6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pl="Menu",[al,w6,_6]=lg(Pl),[Ui,uk]=Xr(Pl,[_6,Xo,yd]),bd=Xo(),dk=yd(),[S6,Gi]=Ui(Pl),[C6,Al]=Ui(Pl),hk=e=>{const{__scopeMenu:t,open:r=!1,children:s,dir:o,onOpenChange:u,modal:d=!0}=e,l=bd(t),[c,f]=C.useState(null),m=C.useRef(!1),h=_r(u),x=Sl(o);return C.useEffect(()=>{const w=()=>{m.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>m.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),n.jsx(xg,{...l,children:n.jsx(S6,{scope:t,open:r,onOpenChange:h,content:c,onContentChange:f,children:n.jsx(C6,{scope:t,onClose:C.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:x,modal:d,children:s})})})};hk.displayName=Pl;var k6="MenuAnchor",Sg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,o=bd(r);return n.jsx(vg,{...o,...s,ref:t})});Sg.displayName=k6;var Cg="MenuPortal",[j6,fk]=Ui(Cg,{forceMount:void 0}),mk=e=>{const{__scopeMenu:t,forceMount:r,children:s,container:o}=e,u=Gi(Cg,t);return n.jsx(j6,{scope:t,forceMount:r,children:n.jsx(kr,{present:r||u.open,children:n.jsx(kl,{asChild:!0,container:o,children:s})})})};mk.displayName=Cg;var Cn="MenuContent",[N6,kg]=Ui(Cn),pk=C.forwardRef((e,t)=>{const r=fk(Cn,e.__scopeMenu),{forceMount:s=r.forceMount,...o}=e,u=Gi(Cn,e.__scopeMenu),d=Al(Cn,e.__scopeMenu);return n.jsx(al.Provider,{scope:e.__scopeMenu,children:n.jsx(kr,{present:s||u.open,children:n.jsx(al.Slot,{scope:e.__scopeMenu,children:d.modal?n.jsx(E6,{...o,ref:t}):n.jsx(P6,{...o,ref:t})})})})}),E6=C.forwardRef((e,t)=>{const r=Gi(Cn,e.__scopeMenu),s=C.useRef(null),o=it(t,s);return C.useEffect(()=>{const u=s.current;if(u)return Qp(u)},[]),n.jsx(jg,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),P6=C.forwardRef((e,t)=>{const r=Gi(Cn,e.__scopeMenu);return n.jsx(jg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),A6=d6("MenuContent.ScrollLock"),jg=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:s=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:w,disableOutsideScroll:k,..._}=e,v=Gi(Cn,r),b=Al(Cn,r),g=bd(r),y=dk(r),j=w6(r),[E,P]=C.useState(null),T=C.useRef(null),N=it(t,T,v.onContentChange),R=C.useRef(0),I=C.useRef(""),O=C.useRef(0),$=C.useRef(null),W=C.useRef("right"),Y=C.useRef(0),z=k?sd:C.Fragment,K=k?{as:A6,allowPinchZoom:!0}:void 0,G=L=>{var X,H;const M=I.current+L,B=j().filter(ae=>!ae.disabled),q=document.activeElement,F=(X=B.find(ae=>ae.ref.current===q))==null?void 0:X.textValue,oe=B.map(ae=>ae.textValue),fe=H6(oe,M,F),me=(H=B.find(ae=>ae.textValue===fe))==null?void 0:H.ref.current;(function ae(ne){I.current=ne,window.clearTimeout(R.current),ne!==""&&(R.current=window.setTimeout(()=>ae(""),1e3))})(M),me&&setTimeout(()=>me.focus())};C.useEffect(()=>()=>window.clearTimeout(R.current),[]),Jp();const U=C.useCallback(L=>{var B,q;return W.current===((B=$.current)==null?void 0:B.side)&&V6(L,(q=$.current)==null?void 0:q.area)},[]);return n.jsx(N6,{scope:r,searchRef:I,onItemEnter:C.useCallback(L=>{U(L)&&L.preventDefault()},[U]),onItemLeave:C.useCallback(L=>{var M;U(L)||((M=T.current)==null||M.focus(),P(null))},[U]),onTriggerLeave:C.useCallback(L=>{U(L)&&L.preventDefault()},[U]),pointerGraceTimerRef:O,onPointerGraceIntentChange:C.useCallback(L=>{$.current=L},[]),children:n.jsx(z,{...K,children:n.jsx(rd,{asChild:!0,trapped:o,onMountAutoFocus:Te(u,L=>{var M;L.preventDefault(),(M=T.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:n.jsx(Cl,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:w,children:n.jsx(ak,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:Te(c,L=>{b.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(yg,{role:"menu","aria-orientation":"vertical","data-state":Tk(v.open),"data-radix-menu-content":"",dir:b.dir,...g,..._,ref:N,style:{outline:"none",..._.style},onKeyDown:Te(_.onKeyDown,L=>{const B=L.target.closest("[data-radix-menu-content]")===L.currentTarget,q=L.ctrlKey||L.altKey||L.metaKey,F=L.key.length===1;B&&(L.key==="Tab"&&L.preventDefault(),!q&&F&&G(L.key));const oe=T.current;if(L.target!==oe||!v6.includes(L.key))return;L.preventDefault();const me=j().filter(X=>!X.disabled).map(X=>X.ref.current);ck.includes(L.key)&&me.reverse(),$6(me)}),onBlur:Te(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(R.current),I.current="")}),onPointerMove:Te(e.onPointerMove,ll(L=>{const M=L.target,B=Y.current!==L.clientX;if(L.currentTarget.contains(M)&&B){const q=L.clientX>Y.current?"right":"left";W.current=q,Y.current=L.clientX}}))})})})})})})});pk.displayName=Cn;var T6="MenuGroup",Ng=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(Xe.div,{role:"group",...s,ref:t})});Ng.displayName=T6;var R6="MenuLabel",gk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(Xe.div,{...s,ref:t})});gk.displayName=R6;var Iu="MenuItem",Fb="menu.itemSelect",wd=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:s,...o}=e,u=C.useRef(null),d=Al(Iu,e.__scopeMenu),l=kg(Iu,e.__scopeMenu),c=it(t,u),f=C.useRef(!1),m=()=>{const h=u.current;if(!r&&h){const x=new CustomEvent(Fb,{bubbles:!0,cancelable:!0});h.addEventListener(Fb,w=>s==null?void 0:s(w),{once:!0}),G1(h,x),x.defaultPrevented?f.current=!1:d.onClose()}};return n.jsx(xk,{...o,ref:c,disabled:r,onClick:Te(e.onClick,m),onPointerDown:h=>{var x;(x=e.onPointerDown)==null||x.call(e,h),f.current=!0},onPointerUp:Te(e.onPointerUp,h=>{var x;f.current||(x=h.currentTarget)==null||x.click()}),onKeyDown:Te(e.onKeyDown,h=>{const x=l.searchRef.current!=="";r||x&&h.key===" "||Gm.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});wd.displayName=Iu;var xk=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:s=!1,textValue:o,...u}=e,d=kg(Iu,r),l=dk(r),c=C.useRef(null),f=it(t,c),[m,h]=C.useState(!1),[x,w]=C.useState("");return C.useEffect(()=>{const k=c.current;k&&w((k.textContent??"").trim())},[u.children]),n.jsx(al.ItemSlot,{scope:r,disabled:s,textValue:o??x,children:n.jsx(lk,{asChild:!0,...l,focusable:!s,children:n.jsx(Xe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...u,ref:f,onPointerMove:Te(e.onPointerMove,ll(k=>{s?d.onItemLeave(k):(d.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,ll(k=>d.onItemLeave(k))),onFocus:Te(e.onFocus,()=>h(!0)),onBlur:Te(e.onBlur,()=>h(!1))})})})}),M6="MenuCheckboxItem",vk=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:s,...o}=e;return n.jsx(Sk,{scope:e.__scopeMenu,checked:r,children:n.jsx(wd,{role:"menuitemcheckbox","aria-checked":Ou(r)?"mixed":r,...o,ref:t,"data-state":Pg(r),onSelect:Te(o.onSelect,()=>s==null?void 0:s(Ou(r)?!0:!r),{checkForDefaultPrevented:!1})})})});vk.displayName=M6;var yk="MenuRadioGroup",[D6,L6]=Ui(yk,{value:void 0,onValueChange:()=>{}}),bk=C.forwardRef((e,t)=>{const{value:r,onValueChange:s,...o}=e,u=_r(s);return n.jsx(D6,{scope:e.__scopeMenu,value:r,onValueChange:u,children:n.jsx(Ng,{...o,ref:t})})});bk.displayName=yk;var wk="MenuRadioItem",_k=C.forwardRef((e,t)=>{const{value:r,...s}=e,o=L6(wk,e.__scopeMenu),u=r===o.value;return n.jsx(Sk,{scope:e.__scopeMenu,checked:u,children:n.jsx(wd,{role:"menuitemradio","aria-checked":u,...s,ref:t,"data-state":Pg(u),onSelect:Te(s.onSelect,()=>{var d;return(d=o.onValueChange)==null?void 0:d.call(o,r)},{checkForDefaultPrevented:!1})})})});_k.displayName=wk;var Eg="MenuItemIndicator",[Sk,I6]=Ui(Eg,{checked:!1}),Ck=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:s,...o}=e,u=I6(Eg,r);return n.jsx(kr,{present:s||Ou(u.checked)||u.checked===!0,children:n.jsx(Xe.span,{...o,ref:t,"data-state":Pg(u.checked)})})});Ck.displayName=Eg;var O6="MenuSeparator",kk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});kk.displayName=O6;var B6="MenuArrow",jk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,o=bd(r);return n.jsx(bg,{...o,...s,ref:t})});jk.displayName=B6;var F6="MenuSub",[sW,Nk]=Ui(F6),Ga="MenuSubTrigger",Ek=C.forwardRef((e,t)=>{const r=Gi(Ga,e.__scopeMenu),s=Al(Ga,e.__scopeMenu),o=Nk(Ga,e.__scopeMenu),u=kg(Ga,e.__scopeMenu),d=C.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=u,f={__scopeMenu:e.__scopeMenu},m=C.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return C.useEffect(()=>m,[m]),C.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),n.jsx(Sg,{asChild:!0,...f,children:n.jsx(xk,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":Tk(r.open),...e,ref:js(t,o.onTriggerChange),onClick:h=>{var x;(x=e.onClick)==null||x.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,ll(h=>{u.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!r.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:Te(e.onPointerLeave,ll(h=>{var w,k;m();const x=(w=r.content)==null?void 0:w.getBoundingClientRect();if(x){const _=(k=r.content)==null?void 0:k.dataset.side,v=_==="right",b=v?-5:5,g=x[v?"left":"right"],y=x[v?"right":"left"];u.onPointerGraceIntentChange({area:[{x:h.clientX+b,y:h.clientY},{x:g,y:x.top},{x:y,y:x.top},{x:y,y:x.bottom},{x:g,y:x.bottom}],side:_}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(h),h.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,h=>{var w;const x=u.searchRef.current!=="";e.disabled||x&&h.key===" "||y6[s.dir].includes(h.key)&&(r.onOpenChange(!0),(w=r.content)==null||w.focus(),h.preventDefault())})})})});Ek.displayName=Ga;var Pk="MenuSubContent",Ak=C.forwardRef((e,t)=>{const r=fk(Cn,e.__scopeMenu),{forceMount:s=r.forceMount,...o}=e,u=Gi(Cn,e.__scopeMenu),d=Al(Cn,e.__scopeMenu),l=Nk(Pk,e.__scopeMenu),c=C.useRef(null),f=it(t,c);return n.jsx(al.Provider,{scope:e.__scopeMenu,children:n.jsx(kr,{present:s||u.open,children:n.jsx(al.Slot,{scope:e.__scopeMenu,children:n.jsx(jg,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:f,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var h;d.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Te(e.onFocusOutside,m=>{m.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,m=>{d.onClose(),m.preventDefault()}),onKeyDown:Te(e.onKeyDown,m=>{var w;const h=m.currentTarget.contains(m.target),x=b6[d.dir].includes(m.key);h&&x&&(u.onOpenChange(!1),(w=l.trigger)==null||w.focus(),m.preventDefault())})})})})})});Ak.displayName=Pk;function Tk(e){return e?"open":"closed"}function Ou(e){return e==="indeterminate"}function Pg(e){return Ou(e)?"indeterminate":e?"checked":"unchecked"}function $6(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function z6(e,t){return e.map((r,s)=>e[(t+s)%e.length])}function H6(e,t,r){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,u=r?e.indexOf(r):-1;let d=z6(e,Math.max(u,0));o.length===1&&(d=d.filter(f=>f!==r));const c=d.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function W6(e,t){const{x:r,y:s}=e;let o=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const l=t[u],c=t[d],f=l.x,m=l.y,h=c.x,x=c.y;m>s!=x>s&&r<(h-f)*(s-m)/(x-m)+f&&(o=!o)}return o}function V6(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return W6(r,t)}function ll(e){return t=>t.pointerType==="mouse"?e(t):void 0}var U6=hk,G6=Sg,K6=mk,q6=pk,Y6=Ng,X6=gk,J6=wd,Q6=vk,Z6=bk,eB=_k,tB=Ck,rB=kk,nB=jk,sB=Ek,iB=Ak,_d="DropdownMenu",[oB]=Xr(_d,[uk]),Br=uk(),[aB,Rk]=oB(_d),Mk=e=>{const{__scopeDropdownMenu:t,children:r,dir:s,open:o,defaultOpen:u,onOpenChange:d,modal:l=!0}=e,c=Br(t),f=C.useRef(null),[m,h]=ss({prop:o,defaultProp:u??!1,onChange:d,caller:_d});return n.jsx(aB,{scope:t,triggerId:Sn(),triggerRef:f,contentId:Sn(),open:m,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(x=>!x),[h]),modal:l,children:n.jsx(U6,{...c,open:m,onOpenChange:h,dir:s,modal:l,children:r})})};Mk.displayName=_d;var Dk="DropdownMenuTrigger",Lk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:s=!1,...o}=e,u=Rk(Dk,r),d=Br(r);return n.jsx(G6,{asChild:!0,...d,children:n.jsx(Xe.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:js(t,u.triggerRef),onPointerDown:Te(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(u.onOpenToggle(),u.open||l.preventDefault())}),onKeyDown:Te(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&u.onOpenToggle(),l.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Lk.displayName=Dk;var lB="DropdownMenuPortal",Ik=e=>{const{__scopeDropdownMenu:t,...r}=e,s=Br(t);return n.jsx(K6,{...s,...r})};Ik.displayName=lB;var Ok="DropdownMenuContent",Bk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Rk(Ok,r),u=Br(r),d=C.useRef(!1);return n.jsx(q6,{id:o.contentId,"aria-labelledby":o.triggerId,...u,...s,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{var c;d.current||(c=o.triggerRef.current)==null||c.focus(),d.current=!1,l.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,m=c.button===2||f;(!o.modal||m)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Bk.displayName=Ok;var cB="DropdownMenuGroup",uB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(Y6,{...o,...s,ref:t})});uB.displayName=cB;var dB="DropdownMenuLabel",Fk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(X6,{...o,...s,ref:t})});Fk.displayName=dB;var hB="DropdownMenuItem",$k=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(J6,{...o,...s,ref:t})});$k.displayName=hB;var fB="DropdownMenuCheckboxItem",zk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(Q6,{...o,...s,ref:t})});zk.displayName=fB;var mB="DropdownMenuRadioGroup",pB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(Z6,{...o,...s,ref:t})});pB.displayName=mB;var gB="DropdownMenuRadioItem",Hk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(eB,{...o,...s,ref:t})});Hk.displayName=gB;var xB="DropdownMenuItemIndicator",Wk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(tB,{...o,...s,ref:t})});Wk.displayName=xB;var vB="DropdownMenuSeparator",Vk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(rB,{...o,...s,ref:t})});Vk.displayName=vB;var yB="DropdownMenuArrow",bB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(nB,{...o,...s,ref:t})});bB.displayName=yB;var wB="DropdownMenuSubTrigger",Uk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(sB,{...o,...s,ref:t})});Uk.displayName=wB;var _B="DropdownMenuSubContent",Gk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,o=Br(r);return n.jsx(iB,{...o,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gk.displayName=_B;var SB=Mk,CB=Lk,kB=Ik,Kk=Bk,qk=Fk,Yk=$k,Xk=zk,Jk=Hk,Qk=Wk,Zk=Vk,ej=Uk,tj=Gk;const ai=SB,li=CB,jB=C.forwardRef(({className:e,inset:t,children:r,...s},o)=>n.jsxs(ej,{ref:o,className:je("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...s,children:[r,n.jsx(Kr,{className:"ml-auto"})]}));jB.displayName=ej.displayName;const NB=C.forwardRef(({className:e,...t},r)=>n.jsx(tj,{ref:r,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));NB.displayName=tj.displayName;const ks=C.forwardRef(({className:e,sideOffset:t=4,...r},s)=>n.jsx(kB,{children:n.jsx(Kk,{ref:s,sideOffset:t,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ks.displayName=Kk.displayName;const Pt=C.forwardRef(({className:e,inset:t,...r},s)=>n.jsx(Yk,{ref:s,className:je("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));Pt.displayName=Yk.displayName;const cl=C.forwardRef(({className:e,children:t,checked:r,...s},o)=>n.jsxs(Xk,{ref:o,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...s,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Qk,{children:n.jsx(Kt,{className:"h-4 w-4"})})}),t]}));cl.displayName=Xk.displayName;const EB=C.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(Jk,{ref:s,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Qk,{children:n.jsx(xM,{className:"h-2 w-2 fill-current"})})}),t]}));EB.displayName=Jk.displayName;const ul=C.forwardRef(({className:e,inset:t,...r},s)=>n.jsx(qk,{ref:s,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ul.displayName=qk.displayName;const Or=C.forwardRef(({className:e,...t},r)=>n.jsx(Zk,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));Or.displayName=Zk.displayName;const $b={development:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",productivity:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",integration:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",external:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",lsp:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"};function PB({plugin:e,onToggle:t,isToggling:r,projectDir:s}){const o=$b[e.category]||$b.default;return e.mcpServers||e.lspServers||e.commands,n.jsxs(Eo.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`
|
|
533
533
|
relative p-3 rounded-lg border transition-all
|
|
534
534
|
${e.installed?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700 hover:border-indigo-300 dark:hover:border-indigo-700"}
|
|
535
535
|
`,children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white truncate",children:e.name}),e.sourceType==="external"&&n.jsx(Bi,{className:"w-3 h-3 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),n.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400 line-clamp-2 mb-2",children:e.description||"No description"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.category&&n.jsx(Qe,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${o}`,children:e.category}),e.lspServers&&n.jsxs(Qe,{variant:"outline",className:"text-[10px] px-1.5 py-0 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",children:[n.jsx(ns,{className:"w-2.5 h-2.5 mr-0.5"}),"LSP"]}),e.mcpServers&&n.jsxs(Qe,{variant:"outline",className:"text-[10px] px-1.5 py-0 bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[n.jsx(Fn,{className:"w-2.5 h-2.5 mr-0.5"}),"MCP"]}),e.version&&n.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",e.version]})]})]}),n.jsx("div",{className:"flex-shrink-0",children:n.jsx(dt,{checked:e.installed,onCheckedChange:()=>t(e),disabled:r===e.name,className:"data-[state=checked]:bg-green-600"})})]}),r===e.name&&n.jsx("div",{className:"absolute inset-0 bg-white/80 dark:bg-slate-900/80 rounded-lg flex items-center justify-center",children:n.jsx(ut,{className:"w-5 h-5 animate-spin text-indigo-600"})})]})}function AB({open:e,onOpenChange:t,projectDir:r,projectName:s}){const[o,u]=C.useState(!0),[d,l]=C.useState({allPlugins:[],categories:[]}),[c,f]=C.useState(""),[m,h]=C.useState("project"),[x,w]=C.useState([]),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState(null),j=async()=>{u(!0);try{const I=await ke.getPlugins();l(I)}catch(I){ee.error("Failed to load plugins: "+I.message)}finally{u(!1)}};C.useEffect(()=>{e&&(j(),f(""))},[e]);const E=C.useMemo(()=>{let I=d.allPlugins||[];if(c){const O=c.toLowerCase();I=I.filter($=>{var W,Y;return((W=$.name)==null?void 0:W.toLowerCase().includes(O))||((Y=$.description)==null?void 0:Y.toLowerCase().includes(O))})}return I=I.filter(O=>!(O.sourceType==="external"&&!k||O.sourceType==="internal"&&!v)),x.length>0&&(I=I.filter(O=>x.includes(O.category))),I.sort((O,$)=>O.installed&&!$.installed?-1:!O.installed&&$.installed?1:O.name.localeCompare($.name)),I},[d.allPlugins,c,k,v,x]),P=I=>{w(O=>O.includes(I)?O.filter($=>$!==I):[...O,I])},T=async I=>{y(I.name);try{if(I.installed){const O=await ke.uninstallPlugin(`${I.name}@${I.marketplace}`);O.success?ee.success(`Uninstalled ${I.name}`):ee.error(O.error||"Failed to uninstall")}else{const O=await ke.installPlugin(I.name,I.marketplace,m,r);O.success?ee.success(`Installed ${I.name} (${m})`):ee.error(O.error||"Failed to install")}await j()}catch(O){ee.error("Operation failed: "+O.message)}finally{y(null)}},N=E.filter(I=>I.installed).length,R=E.filter(I=>!I.installed).length;return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-2xl max-h-[85vh] flex flex-col p-0",children:[n.jsxs(Ct,{className:"px-6 pt-6 pb-4 border-b dark:border-slate-800",children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Fi,{className:"w-5 h-5 text-indigo-600"}),"Install Plugins",s&&n.jsx(Qe,{variant:"outline",className:"ml-2 font-normal",children:s})]}),n.jsx(tr,{children:"Enable plugins for enhanced Claude Code capabilities"})]}),n.jsxs("div",{className:"px-6 py-3 border-b dark:border-slate-800 space-y-3 bg-gray-50 dark:bg-slate-900/50",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:c,onChange:I=>f(I.target.value),placeholder:"Search plugins...",className:"pl-9 h-9 bg-white dark:bg-slate-800"})]}),n.jsxs(fr,{value:m,onValueChange:h,children:[n.jsx(ar,{className:"w-36 h-9 bg-white dark:bg-slate-800",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"project",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(y1,{className:"w-3.5 h-3.5"}),"Project"]})}),n.jsx(xt,{value:"user",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Bi,{className:"w-3.5 h-3.5"}),"Global"]})}),n.jsx(xt,{value:"local",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Ht,{className:"w-3.5 h-3.5"}),"Local"]})})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",children:[n.jsx(S1,{className:"w-3 h-3"}),"Category",x.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:x.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-48",children:[n.jsx(ul,{className:"text-xs",children:"Categories"}),n.jsx(Or,{}),(d.categories||[]).map(I=>n.jsx(cl,{checked:x.includes(I),onCheckedChange:()=>P(I),children:I},I)),x.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(cl,{checked:!1,onCheckedChange:()=>w([]),children:"Clear all"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 ml-auto text-xs",children:[n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),n.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Anthropic"})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),n.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Community"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 dark:text-slate-500",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Kt,{className:"w-3 h-3 text-green-600"}),N," installed"]}),n.jsxs("span",{children:[R," available"]}),n.jsxs("span",{className:"ml-auto",children:[E.length," shown"]})]})]}),n.jsx(Nn,{className:"flex-1 px-6 py-4",children:o?n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ut,{className:"w-6 h-6 animate-spin text-indigo-600"})}):E.length===0?n.jsxs("div",{className:"text-center py-12 text-gray-500 dark:text-slate-400",children:[n.jsx(Fi,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No plugins found"}),c&&n.jsx(le,{variant:"link",size:"sm",onClick:()=>f(""),className:"mt-2",children:"Clear search"})]}):n.jsx("div",{className:"grid grid-cols-1 gap-3",children:n.jsx(Vw,{mode:"popLayout",children:E.map(I=>n.jsx(PB,{plugin:I,onToggle:T,isToggling:g,projectDir:r},`${I.name}@${I.marketplace}`))})})}),n.jsxs("div",{className:"px-6 py-3 border-t dark:border-slate-800 flex items-center justify-between bg-gray-50 dark:bg-slate-900/50",children:[n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-500",children:"Plugins extend Claude Code with LSP servers, MCP tools, and commands"}),n.jsx(le,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Done"})]})]})})}var Kf={exports:{}},zb;function TB(){return zb||(zb=1,(function(e,t){(function(r,s){e.exports=s()})(globalThis,(()=>(()=>{var r={4567:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,T=arguments.length,N=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(T<3?P(N):T>3?P(y,j,N):P(y,j))||N);return T>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=c(9042),x=c(9924),w=c(844),k=c(4725),_=c(2585),v=c(3656);let b=l.AccessibilityManager=class extends w.Disposable{constructor(g,y,j,E){super(),this._terminal=g,this._coreBrowserService=j,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let P=0;P<this._terminal.rows;P++)this._rowElements[P]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[P]);if(this._topBoundaryFocusListener=P=>this._handleBoundaryFocus(P,0),this._bottomBoundaryFocusListener=P=>this._handleBoundaryFocus(P,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new x.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((P=>this._handleResize(P.rows)))),this.register(this._terminal.onRender((P=>this._refreshRows(P.start,P.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((P=>this._handleChar(P)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
536
536
|
`)))),this.register(this._terminal.onA11yTab((P=>this._handleTab(P)))),this.register(this._terminal.onKey((P=>this._handleKey(P.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let y=0;y<g;y++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
|
|
537
537
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,y){this._liveRegionDebouncer.refresh(g,y,this._terminal.rows)}_renderRows(g,y){const j=this._terminal.buffer,E=j.lines.length.toString();for(let P=g;P<=y;P++){const T=j.lines.get(j.ydisp+P),N=[],R=(T==null?void 0:T.translateToString(!0,void 0,void 0,N))||"",I=(j.ydisp+P+1).toString(),O=this._rowElements[P];O&&(R.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=R,this._rowColumns.set(O,N)),O.setAttribute("aria-posinset",I),O.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,y){const j=g.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(j.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==E)return;let P,T;if(y===0?(P=j,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(P=this._rowElements.shift(),T=j,this._rowContainer.removeChild(P)),P.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:g.anchorNode,offset:g.anchorOffset},j={node:g.focusNode,offset:g.focusOffset};if((y.node.compareDocumentPosition(j.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===j.node&&y.offset>j.offset)&&([y,j]=[j,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(j.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(j={node:E,offset:((R=E.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(j.node))return;const P=({node:I,offset:O})=>{const $=I instanceof Text?I.parentNode:I;let W=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const Y=this._rowColumns.get($);if(!Y)return console.warn("columns is null. Race condition?"),null;let z=O<Y.length?Y[O]:Y.slice(-1)[0]+1;return z>=this._terminal.cols&&(++W,z=0),{row:W,column:z}},T=P(y),N=P(j);if(T&&N){if(T.row>N.row||T.row===N.row&&T.column>=N.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(N.row-T.row)*this._terminal.cols-T.column+N.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=b=f([m(1,_.IInstantiationService),m(2,k.ICoreBrowserService),m(3,k.IRenderService)],b)},3614:(d,l)=>{function c(x){return x.replace(/\r?\n/g,"\r")}function f(x,w){return w?"\x1B[200~"+x+"\x1B[201~":x}function m(x,w,k,_){x=f(x=c(x),k.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(x,!0),w.value=""}function h(x,w,k){const _=k.getBoundingClientRect(),v=x.clientX-_.left-10,b=x.clientY-_.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${v}px`,w.style.top=`${b}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=f,l.copyHandler=function(x,w){x.clipboardData&&x.clipboardData.setData("text/plain",w.selectionText),x.preventDefault()},l.handlePasteEvent=function(x,w,k,_){x.stopPropagation(),x.clipboardData&&m(x.clipboardData.getData("text/plain"),w,k,_)},l.paste=m,l.moveTextAreaUnderMouseCursor=h,l.rightClickHandler=function(x,w,k,_,v){h(x,w,k),v&&_.rightClickSelect(x),w.value=_.selectionText,w.select()}},7239:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=c(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(m,h,x){this._css.set(m,h,x)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,x){this._color.set(m,h,x)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,f,m,h){c.addEventListener(f,m,h);let x=!1;return{dispose:()=>{x||(x=!0,c.removeEventListener(f,m,h))}}}},3551:function(d,l,c){var f=this&&this.__decorate||function(b,g,y,j){var E,P=arguments.length,T=P<3?g:j===null?j=Object.getOwnPropertyDescriptor(g,y):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,g,y,j);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(T=(P<3?E(T):P>3?E(g,y,T):E(g,y))||T);return P>3&&T&&Object.defineProperty(g,y,T),T},m=this&&this.__param||function(b,g){return function(y,j){g(y,j,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const h=c(3656),x=c(8460),w=c(844),k=c(2585),_=c(4725);let v=l.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(b,g,y,j,E){super(),this._element=b,this._mouseService=g,this._renderService=y,this._bufferService=j,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var P;this._lastMouseEvent=void 0,(P=this._activeProviderReplies)==null||P.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const g=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const y=b.composedPath();for(let j=0;j<y.length;j++){const E=y[j];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,g){var j,E;this._activeProviderReplies&&g||((j=this._activeProviderReplies)==null||j.forEach((P=>{P==null||P.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[P,T]of this._linkProviderService.linkProviders.entries())g?(E=this._activeProviderReplies)!=null&&E.get(P)&&(y=this._checkLinkProviderResult(P,b,y)):T.provideLinks(b.y,(N=>{var I,O;if(this._isMouseOut)return;const R=N==null?void 0:N.map(($=>({link:$})));(I=this._activeProviderReplies)==null||I.set(P,R),y=this._checkLinkProviderResult(P,b,y),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,g){const y=new Set;for(let j=0;j<g.size;j++){const E=g.get(j);if(E)for(let P=0;P<E.length;P++){const T=E[P],N=T.link.range.start.y<b?0:T.link.range.start.x,R=T.link.range.end.y>b?this._bufferService.cols:T.link.range.end.x;for(let I=N;I<=R;I++){if(y.has(I)){E.splice(P--,1);break}y.add(I)}}}}_checkLinkProviderResult(b,g,y){var P;if(!this._activeProviderReplies)return y;const j=this._activeProviderReplies.get(b);let E=!1;for(let T=0;T<b;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(E=!0);if(!E&&j){const T=j.find((N=>this._linkAtPosition(N.link,g)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;T<this._activeProviderReplies.size;T++){const N=(P=this._activeProviderReplies.get(T))==null?void 0:P.find((R=>this._linkAtPosition(R.link,g)));if(N){y=!0,this._handleNewLink(N);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const g=this._positionFromMouseEvent(b,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,g){this._currentLink&&this._lastMouseEvent&&(!b||!g||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(b.link,g)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,j;return(j=(y=this._currentLink)==null?void 0:y.state)==null?void 0:j.decorations.pointerCursor},set:y=>{var j;(j=this._currentLink)!=null&&j.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,j;return(j=(y=this._currentLink)==null?void 0:y.state)==null?void 0:j.decorations.underline},set:y=>{var j,E,P;(j=this._currentLink)!=null&&j.state&&((P=(E=this._currentLink)==null?void 0:E.state)==null?void 0:P.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const j=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=j&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(j,E),this._lastMouseEvent)){const P=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);P&&this._askForLink(P,!1)}}))))}_linkHover(b,g,y){var j;(j=this._currentLink)!=null&&j.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(y,g.text)}_fireUnderlineEvent(b,g){const y=b.range,j=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-j-1,y.end.x,y.end.y-j-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,g,y){var j;(j=this._currentLink)!=null&&j.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(y,g.text)}_linkAtPosition(b,g){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,j=b.range.end.y*this._bufferService.cols+b.range.end.x,E=g.y*this._bufferService.cols+g.x;return y<=E&&E<=j}_positionFromMouseEvent(b,g,y){const j=y.getCoords(b,g,this._bufferService.cols,this._bufferService.rows);if(j)return{x:j[0],y:j[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,g,y,j,E){return{x1:b,y1:g,x2:y,y2:j,cols:this._bufferService.cols,fg:E}}};l.Linkifier=v=f([m(1,_.IMouseService),m(2,_.IRenderService),m(3,k.IBufferService),m(4,_.ILinkProviderService)],v)},9042:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,l,c){var f=this&&this.__decorate||function(_,v,b,g){var y,j=arguments.length,E=j<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,v,b,g);else for(var P=_.length-1;P>=0;P--)(y=_[P])&&(E=(j<3?y(E):j>3?y(v,b,E):y(v,b))||E);return j>3&&E&&Object.defineProperty(v,b,E),E},m=this&&this.__param||function(_,v){return function(b,g){v(b,g,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const h=c(511),x=c(2585);let w=l.OscLinkProvider=class{constructor(_,v,b){this._bufferService=_,this._optionsService=v,this._oscLinkService=b}provideLinks(_,v){var R;const b=this._bufferService.buffer.lines.get(_-1);if(!b)return void v(void 0);const g=[],y=this._optionsService.rawOptions.linkHandler,j=new h.CellData,E=b.getTrimmedLength();let P=-1,T=-1,N=!1;for(let I=0;I<E;I++)if(T!==-1||b.hasContent(I)){if(b.loadCell(I,j),j.hasExtendedAttrs()&&j.extended.urlId){if(T===-1){T=I,P=j.extended.urlId;continue}N=j.extended.urlId!==P}else T!==-1&&(N=!0);if(N||T!==-1&&I===E-1){const O=(R=this._oscLinkService.getLinkData(P))==null?void 0:R.uri;if(O){const $={start:{x:T+1,y:_},end:{x:I+(N||I!==E-1?0:1),y:_}};let W=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const Y=new URL(O);["http:","https:"].includes(Y.protocol)||(W=!0)}catch{W=!0}W||g.push({text:O,range:$,activate:(Y,z)=>y?y.activate(Y,z,$):k(0,z),hover:(Y,z)=>{var K;return(K=y==null?void 0:y.hover)==null?void 0:K.call(y,Y,z,$)},leave:(Y,z)=>{var K;return(K=y==null?void 0:y.leave)==null?void 0:K.call(y,Y,z,$)}})}N=!1,j.hasExtendedAttrs()&&j.extended.urlId?(T=I,P=j.extended.urlId):(T=-1,P=-1)}}v(g)}};function k(_,v){if(confirm(`Do you want to navigate to ${v}?
|
|
538
538
|
|
|
539
|
-
WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=w=f([m(0,x.IBufferService),m(1,x.IOptionsService),m(2,x.IOscLinkService)],w)},6193:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,m){this._rowCount=m,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=c(3614),m=c(3656),h=c(3551),x=c(9042),w=c(3730),k=c(1680),_=c(3107),v=c(5744),b=c(2950),g=c(1296),y=c(428),j=c(4269),E=c(5114),P=c(8934),T=c(3230),N=c(9312),R=c(4725),I=c(6731),O=c(8055),$=c(8969),W=c(8460),Y=c(844),z=c(6114),K=c(8437),G=c(2584),U=c(7399),L=c(5941),M=c(9074),B=c(2585),q=c(5435),F=c(4567),oe=c(779);class fe extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new W.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new W.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new W.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new W.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new W.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new W.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new W.EventEmitter),this._onBlur=this.register(new W.EventEmitter),this._onA11yCharEmitter=this.register(new W.EventEmitter),this._onA11yTabEmitter=this.register(new W.EventEmitter),this._onWillOpen=this.register(new W.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(oe.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ae)=>this.refresh(H,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,W.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,W.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,Y.toDisposable)((()=>{var H,ae;this._customKeyEventHandler=void 0,(ae=(H=this.element)==null?void 0:H.parentNode)==null||ae.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const H of X){let ae,ne="";switch(H.index){case 256:ae="foreground",ne="10";break;case 257:ae="background",ne="11";break;case 258:ae="cursor",ne="12";break;default:ae="ansi",ne="4;"+H.index}switch(H.type){case 0:const J=O.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${ne};${(0,L.toRgbString)(J)}${G.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((ie=>ie.ansi[H.index]=O.channels.toColor(...H.color)));else{const ie=ae;this._themeService.modifyColors((ye=>ye[ie]=O.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(X);if(!H)return;const ae=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,J=H.getWidth(ae),ie=this._renderService.dimensions.css.cell.width*J,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Oe=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Oe+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=ie+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,f.copyHandler)(H,this._selectionService)})));const X=H=>(0,f.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,m.addDisposableDomListener)(this.element,"paste",X)),z.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),z.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,f.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var ae;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ae=this.element)==null?void 0:ae.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(j.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(P.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(N.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),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(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,H=this.element;function ae(ie){const ye=X._mouseService.getMouseReportCoords(ie,X.screenElement);if(!ye)return!1;let Oe,Ve;switch(ie.overrideType||ie.type){case"mousemove":Ve=32,ie.buttons===void 0?(Oe=3,ie.button!==void 0&&(Oe=ie.button<3?ie.button:3)):Oe=1&ie.buttons?0:4&ie.buttons?1:2&ie.buttons?2:3;break;case"mouseup":Ve=0,Oe=ie.button<3?ie.button:3;break;case"mousedown":Ve=1,Oe=ie.button<3?ie.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(ie)===!1||X.viewport.getLinesScrolled(ie)===0)return!1;Ve=ie.deltaY<0?0:1,Oe=4;break;default:return!1}return!(Ve===void 0||Oe===void 0||Oe>4)&&X.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:Oe,action:Ve,ctrl:ie.ctrlKey,alt:ie.altKey,shift:ie.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},J={mouseup:ie=>(ae(ie),ie.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(ie)),wheel:ie=>(ae(ie),this.cancel(ie,!0)),mousedrag:ie=>{ie.buttons&&ae(ie)},mousemove:ie=>{ie.buttons||ae(ie)}};this.register(this.coreMouseService.onProtocolChange((ie=>{ie?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ie)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ie?ne.mousemove||(H.addEventListener("mousemove",J.mousemove),ne.mousemove=J.mousemove):(H.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&ie?ne.wheel||(H.addEventListener("wheel",J.wheel,{passive:!1}),ne.wheel=J.wheel):(H.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&ie?ne.mouseup||(ne.mouseup=J.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&ie?ne.mousedrag||(ne.mousedrag=J.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(H,"mousedown",(ie=>{if(ie.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ie))return ae(ie),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(ie)}))),this.register((0,m.addDisposableDomListener)(H,"wheel",(ie=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ie)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(ie);if(ye===0)return;const Oe=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ie.deltaY<0?"A":"B");let Ve="";for(let re=0;re<Math.abs(ye);re++)Ve+=Oe;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(ie,!0)}return this.viewport.handleWheel(ie)?this.cancel(ie):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(H,"touchstart",(ie=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ie),this.cancel(ie)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(H,"touchmove",(ie=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ie)?void 0:this.cancel(ie)}),{passive:!1}))}refresh(X,H){var ae;(ae=this._renderService)==null||ae.refreshRows(X,H)}updateCursorStyle(X){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(X,H,ae=0){var ne;ae===1?(super.scrollLines(X,H,ae),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(X)}paste(X){(0,f.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,H,ae){this._selectionService.setSelection(X,H,ae)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,H){var ae;(ae=this._selectionService)==null||ae.selectLines(X,H)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!H&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,U.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ae.type===3||ae.type===2){const ne=this.rows-1;return this.scrollLines(ae.type===2?-ne:ne),this.cancel(X,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ae.cancel&&this.cancel(X,!0),!ae.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==G.C0.ETX&&ae.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,H){const ae=X.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||X.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||X.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ae:ae&&(!H.keyCode||H.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)H=X.charCode;else if(X.which===null||X.which===void 0)H=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;H=X.which}return!(!H||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=X.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(X),!0}return!1}resize(X,H){X!==this.cols||H!==this.rows?super.resize(X,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,H){var ae,ne;(ae=this._charSizeService)==null||ae.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var X;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(K.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var H,ae;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(ae=this.viewport)==null||ae.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${ae};${H}t`);break;case q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),J=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${J};${ne}t`)}}cancel(X,H){if(this.options.cancelEvents||H)return X.preventDefault(),X.stopPropagation(),!1}}l.Terminal=fe},9924:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,m){this._rowCount=m,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=h-this._lastRefreshMs,w=this._debounceThresholdMS-x;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(d,l,c){var f=this&&this.__decorate||function(b,g,y,j){var E,P=arguments.length,T=P<3?g:j===null?j=Object.getOwnPropertyDescriptor(g,y):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,g,y,j);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(T=(P<3?E(T):P>3?E(g,y,T):E(g,y))||T);return P>3&&T&&Object.defineProperty(g,y,T),T},m=this&&this.__param||function(b,g){return function(y,j){g(y,j,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const h=c(3656),x=c(4725),w=c(8460),k=c(844),_=c(2585);let v=l.Viewport=class extends k.Disposable{constructor(b,g,y,j,E,P,T,N){super(),this._viewportElement=b,this._scrollArea=g,this._bufferService=y,this._optionsService=j,this._charSizeService=E,this._renderService=P,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(N.colors),this.register(N.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,g){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&y<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const g=this._getPixelsScrolled(b);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(b,g))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let g=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(b,g){var N;let y,j="";const E=[],P=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let R=b;R<P;R++){const I=T.get(R);if(!I)continue;const O=(N=T.get(R+1))==null?void 0:N.isWrapped;if(j+=I.translateToString(!O),!O||R===T.length-1){const $=document.createElement("div");$.textContent=j,E.push($),j.length>0&&(y=$),j=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let g=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(b,g){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&g.altKey||y==="ctrl"&&g.ctrlKey||y==="shift"&&g.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const g=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(b,g))}};l.Viewport=v=f([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,x.ICharSizeService),m(5,x.IRenderService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],v)},3107:function(d,l,c){var f=this&&this.__decorate||function(_,v,b,g){var y,j=arguments.length,E=j<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,v,b,g);else for(var P=_.length-1;P>=0;P--)(y=_[P])&&(E=(j<3?y(E):j>3?y(v,b,E):y(v,b))||E);return j>3&&E&&Object.defineProperty(v,b,E),E},m=this&&this.__param||function(_,v){return function(b,g){v(b,g,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const h=c(4725),x=c(844),w=c(2585);let k=l.BufferDecorationRenderer=class extends x.Disposable{constructor(_,v,b,g,y){super(),this._screenElement=_,this._bufferService=v,this._coreBrowserService=b,this._decorationService=g,this._renderService=y,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((j=>this._removeDecoration(j)))),this.register((0,x.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var g;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((g=_==null?void 0:_.options)==null?void 0:g.layer)==="top"),v.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=_.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(_,v),v}_refreshStyle(_){const v=_.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let b=this._decorationElements.get(_);b||(b=this._createElement(_),_.element=b,this._decorationElements.set(_,b),this._container.appendChild(b),_.onDispose((()=>{this._decorationElements.delete(_),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(b)}}_refreshXPosition(_,v=_.element){if(!v)return;const b=_.options.x??0;(_.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var v;(v=this._decorationElements.get(_))==null||v.remove(),this._decorationElements.delete(_),_.dispose()}};l.BufferDecorationRenderer=k=f([m(1,w.IBufferService),m(2,h.ICoreBrowserService),m(3,w.IDecorationService),m(4,h.IRenderService)],k)},5871:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,m){return f>=c.startBufferLine-this._linePadding[m||"full"]&&f<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(d,l,c){var f=this&&this.__decorate||function(y,j,E,P){var T,N=arguments.length,R=N<3?j:P===null?P=Object.getOwnPropertyDescriptor(j,E):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,j,E,P);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(R=(N<3?T(R):N>3?T(j,E,R):T(j,E))||R);return N>3&&R&&Object.defineProperty(j,E,R),R},m=this&&this.__param||function(y,j){return function(E,P){j(E,P,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const h=c(5871),x=c(4725),w=c(844),k=c(2585),_={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let g=l.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,j,E,P,T,N,R){var O;super(),this._viewportElement=y,this._screenElement=j,this._bufferService=E,this._decorationService=P,this._renderService=T,this._optionsService=N,this._coreBrowserService=R,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),j=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=j,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,j=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);_.left=j,_.center=j,_.right=j}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const j of this._decorationService.decorations)this._colorZoneStore.addDecoration(j);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const j of y)j.position!=="full"&&this._renderColorZone(j);for(const j of y)j.position==="full"&&this._renderColorZone(j);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-_[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[y.position||"full"]))}_queueRefresh(y,j){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=j||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=g=f([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,x.IRenderService),m(5,k.IOptionsService),m(6,x.ICoreBrowserService)],g)},2950:function(d,l,c){var f=this&&this.__decorate||function(_,v,b,g){var y,j=arguments.length,E=j<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,v,b,g);else for(var P=_.length-1;P>=0;P--)(y=_[P])&&(E=(j<3?y(E):j>3?y(v,b,E):y(v,b))||E);return j>3&&E&&Object.defineProperty(v,b,E),E},m=this&&this.__param||function(_,v){return function(b,g){v(b,g,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const h=c(4725),x=c(2585),w=c(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,v,b,g,y,j){this._textarea=_,this._compositionView=v,this._bufferService=b,this._optionsService=g,this._coreService=y,this._renderService=j,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(_,"");this._dataAlreadySent=b,v.length>_.length?this._coreService.triggerDataEvent(b,!0):v.length<_.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):v.length===_.length&&v!==_&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const j=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(j.width,1)+"px",this._textarea.style.height=Math.max(j.height,1)+"px",this._textarea.style.lineHeight=j.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=f([m(2,x.IBufferService),m(3,x.IOptionsService),m(4,x.ICoreService),m(5,h.IRenderService)],k)},9806:(d,l)=>{function c(f,m,h){const x=h.getBoundingClientRect(),w=f.getComputedStyle(h),k=parseInt(w.getPropertyValue("padding-left")),_=parseInt(w.getPropertyValue("padding-top"));return[m.clientX-x.left-k,m.clientY-x.top-_]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(f,m,h,x,w,k,_,v,b){if(!k)return;const g=c(f,m,h);return g?(g[0]=Math.ceil((g[0]+(b?_/2:0))/_),g[1]=Math.ceil(g[1]/v),g[0]=Math.min(Math.max(g[0],1),x+(b?1:0)),g[1]=Math.min(Math.max(g[1],1),w),g):void 0}},9504:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=c(2584);function m(v,b,g,y){const j=v-h(v,g),E=b-h(b,g),P=Math.abs(j-E)-(function(T,N,R){let I=0;const O=T-h(T,R),$=N-h(N,R);for(let W=0;W<Math.abs(O-$);W++){const Y=x(T,N)==="A"?-1:1,z=R.buffer.lines.get(O+Y*W);z!=null&&z.isWrapped&&I++}return I})(v,b,g);return _(P,k(x(v,b),y))}function h(v,b){let g=0,y=b.buffer.lines.get(v),j=y==null?void 0:y.isWrapped;for(;j&&v>=0&&v<b.rows;)g++,y=b.buffer.lines.get(--v),j=y==null?void 0:y.isWrapped;return g}function x(v,b){return v>b?"A":"B"}function w(v,b,g,y,j,E){let P=v,T=b,N="";for(;P!==g||T!==y;)P+=j?1:-1,j&&P>E.cols-1?(N+=E.buffer.translateBufferLineToString(T,!1,v,P),P=0,v=0,T++):!j&&P<0&&(N+=E.buffer.translateBufferLineToString(T,!1,0,v+1),P=E.cols-1,v=P,T--);return N+E.buffer.translateBufferLineToString(T,!1,v,P)}function k(v,b){const g=b?"O":"[";return f.C0.ESC+g+v}function _(v,b){v=Math.floor(v);let g="";for(let y=0;y<v;y++)g+=b;return g}l.moveToCellSequence=function(v,b,g,y){const j=g.buffer.x,E=g.buffer.y;if(!g.buffer.hasScrollback)return(function(N,R,I,O,$,W){return m(R,O,$,W).length===0?"":_(w(N,R,N,R-h(R,$),!1,$).length,k("D",W))})(j,E,0,b,g,y)+m(E,b,g,y)+(function(N,R,I,O,$,W){let Y;Y=m(R,O,$,W).length>0?O-h(O,$):R;const z=O,K=(function(G,U,L,M,B,q){let F;return F=m(L,M,B,q).length>0?M-h(M,B):U,G<L&&F<=M||G>=L&&F<M?"C":"D"})(N,R,I,O,$,W);return _(w(N,Y,I,z,K==="C",$).length,k(K,W))})(j,E,v,b,g,y);let P;if(E===b)return P=j>v?"D":"C",_(Math.abs(j-v),k(P,y));P=E>b?"D":"C";const T=Math.abs(E-b);return _((function(N,R){return R.cols-N})(E>b?v:j,g)+(T-1)*g.cols+1+((E>b?j:v)-1),k(P,y))}},1296:function(d,l,c){var f=this&&this.__decorate||function(W,Y,z,K){var G,U=arguments.length,L=U<3?Y:K===null?K=Object.getOwnPropertyDescriptor(Y,z):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(W,Y,z,K);else for(var M=W.length-1;M>=0;M--)(G=W[M])&&(L=(U<3?G(L):U>3?G(Y,z,L):G(Y,z))||L);return U>3&&L&&Object.defineProperty(Y,z,L),L},m=this&&this.__param||function(W,Y){return function(z,K){Y(z,K,W)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const h=c(3787),x=c(2550),w=c(2223),k=c(6171),_=c(6052),v=c(4725),b=c(8055),g=c(8460),y=c(844),j=c(2585),E="xterm-dom-renderer-owner-",P="xterm-rows",T="xterm-fg-",N="xterm-bg-",R="xterm-focus",I="xterm-selection";let O=1,$=l.DomRenderer=class extends y.Disposable{constructor(W,Y,z,K,G,U,L,M,B,q,F,oe,fe){super(),this._terminal=W,this._document=Y,this._element=z,this._screenElement=K,this._viewportElement=G,this._helperContainer=U,this._linkifier2=L,this._charSizeService=B,this._optionsService=q,this._bufferService=F,this._coreBrowserService=oe,this._themeService=fe,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(P),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new x.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const W=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*W,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*W),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/W),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/W),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${P} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(W){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${P} { color: ${W.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${P} .xterm-dim { color: ${b.color.multiplyOpacity(W.foreground,.5).css};}`,Y+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const z=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${K} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${G} { 0% { background-color: ${W.cursor.css}; color: ${W.cursorAccent.css}; } 50% { background-color: inherit; color: ${W.cursor.css}; }}`,Y+=`${this._terminalSelector} .${P}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${P}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${P}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-block { background-color: ${W.cursor.css}; color: ${W.cursorAccent.css};}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${W.cursor.css} !important; color: ${W.cursorAccent.css} !important;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${W.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${W.cursor.css} inset;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${W.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${W.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${W.selectionInactiveBackgroundOpaque.css};}`;for(const[U,L]of W.ansi.entries())Y+=`${this._terminalSelector} .${T}${U} { color: ${L.css}; }${this._terminalSelector} .${T}${U}.xterm-dim { color: ${b.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${N}${U} { background-color: ${L.css}; }`;Y+=`${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(W.background).css}; }${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(W.background),.5).css}; }${this._terminalSelector} .${N}${w.INVERTED_DEFAULT_COLOR} { background-color: ${W.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const W=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${W}px`,this._rowFactory.defaultSpacing=W}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(W,Y){for(let z=this._rowElements.length;z<=Y;z++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(W,Y){this._refreshRowElements(W,Y),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(W,Y,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(W,Y,z),this.renderRows(0,this._bufferService.rows-1),!W||!Y)return;this._selectionRenderModel.update(this._terminal,W,Y,z);const K=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(z){const B=W[0]>Y[0];M.appendChild(this._createSelectionElement(U,B?Y[0]:W[0],B?W[0]:Y[0],L-U+1))}else{const B=K===U?W[0]:0,q=U===G?Y[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(U,B,q));const F=L-U-1;if(M.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,F)),U!==L){const oe=G===L?Y[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,oe))}}this._selectionContainer.appendChild(M)}_createSelectionElement(W,Y,z,K=1){const G=this._document.createElement("div"),U=Y*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(z-Y);return U+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-U),G.style.height=K*this.dimensions.css.cell.height+"px",G.style.top=W*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${L}px`,G}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const W of this._rowElements)W.replaceChildren()}renderRows(W,Y){const z=this._bufferService.buffer,K=z.ybase+z.y,G=Math.min(z.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=W;B<=Y;B++){const q=B+z.ydisp,F=this._rowElements[B],oe=z.lines.get(q);if(!F||!oe)break;F.replaceChildren(...this._rowFactory.createRow(oe,q,q===K,L,M,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(W){this._setCellUnderline(W.x1,W.x2,W.y1,W.y2,W.cols,!0)}_handleLinkLeave(W){this._setCellUnderline(W.x1,W.x2,W.y1,W.y2,W.cols,!1)}_setCellUnderline(W,Y,z,K,G,U){z<0&&(W=0),K<0&&(Y=0);const L=this._bufferService.rows-1;z=Math.max(Math.min(z,L),0),K=Math.max(Math.min(K,L),0),G=Math.min(G,this._bufferService.cols);const M=this._bufferService.buffer,B=M.ybase+M.y,q=Math.min(M.x,G-1),F=this._optionsService.rawOptions.cursorBlink,oe=this._optionsService.rawOptions.cursorStyle,fe=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=z;me<=K;++me){const X=me+M.ydisp,H=this._rowElements[me],ae=M.lines.get(X);if(!H||!ae)break;H.replaceChildren(...this._rowFactory.createRow(ae,X,X===B,oe,fe,q,F,this.dimensions.css.cell.width,this._widthCache,U?me===z?W:0:-1,U?(me===K?Y:G)-1:-1))}}};l.DomRenderer=$=f([m(7,j.IInstantiationService),m(8,v.ICharSizeService),m(9,j.IOptionsService),m(10,j.IBufferService),m(11,v.ICoreBrowserService),m(12,v.IThemeService)],$)},3787:function(d,l,c){var f=this&&this.__decorate||function(P,T,N,R){var I,O=arguments.length,$=O<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,N):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(P,T,N,R);else for(var W=P.length-1;W>=0;W--)(I=P[W])&&($=(O<3?I($):O>3?I(T,N,$):I(T,N))||$);return O>3&&$&&Object.defineProperty(T,N,$),$},m=this&&this.__param||function(P,T){return function(N,R){T(N,R,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const h=c(2223),x=c(643),w=c(511),k=c(2585),_=c(8055),v=c(4725),b=c(4269),g=c(6171),y=c(3734);let j=l.DomRendererRowFactory=class{constructor(P,T,N,R,I,O,$){this._document=P,this._characterJoinerService=T,this._optionsService=N,this._coreBrowserService=R,this._coreService=I,this._decorationService=O,this._themeService=$,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(P,T,N){this._selectionStart=P,this._selectionEnd=T,this._columnSelectMode=N}createRow(P,T,N,R,I,O,$,W,Y,z,K){const G=[],U=this._characterJoinerService.getJoinedCharacters(T),L=this._themeService.colors;let M,B=P.getNoBgTrimmedLength();N&&B<O+1&&(B=O+1);let q=0,F="",oe=0,fe=0,me=0,X=!1,H=0,ae=!1,ne=0;const J=[],ie=z!==-1&&K!==-1;for(let ye=0;ye<B;ye++){P.loadCell(ye,this._workCell);let Oe=this._workCell.getWidth();if(Oe===0)continue;let Ve=!1,re=ye,de=this._workCell;if(U.length>0&&ye===U[0][0]){Ve=!0;const Z=U.shift();de=new b.JoinedCellData(this._workCell,P.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),re=Z[1]-1,Oe=de.getWidth()}const De=this._isCellInSelection(ye,T),Re=N&&ye===O,Ze=ie&&ye>=z&&ye<=K;let Se=!1;this._decorationService.forEachDecorationAtCell(ye,T,void 0,(Z=>{Se=!0}));let ge=de.getChars()||x.WHITESPACE_CELL_CHAR;if(ge===" "&&(de.isUnderline()||de.isOverline())&&(ge=" "),ne=Oe*W-Y.get(ge,de.isBold(),de.isItalic()),M){if(q&&(De&&ae||!De&&!ae&&de.bg===oe)&&(De&&ae&&L.selectionForeground||de.fg===fe)&&de.extended.ext===me&&Ze===X&&ne===H&&!Re&&!Ve&&!Se){de.isInvisible()?F+=x.WHITESPACE_CELL_CHAR:F+=ge,q++;continue}q&&(M.textContent=F),M=this._document.createElement("span"),q=0,F=""}else M=this._document.createElement("span");if(oe=de.bg,fe=de.fg,me=de.extended.ext,X=Ze,H=ne,ae=De,Ve&&O>=ye&&O<=re&&(O=ye),!this._coreService.isCursorHidden&&Re&&this._coreService.isCursorInitialized){if(J.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&J.push("xterm-cursor-blink"),J.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":J.push("xterm-cursor-outline");break;case"block":J.push("xterm-cursor-block");break;case"bar":J.push("xterm-cursor-bar");break;case"underline":J.push("xterm-cursor-underline")}}if(de.isBold()&&J.push("xterm-bold"),de.isItalic()&&J.push("xterm-italic"),de.isDim()&&J.push("xterm-dim"),F=de.isInvisible()?x.WHITESPACE_CELL_CHAR:de.getChars()||x.WHITESPACE_CELL_CHAR,de.isUnderline()&&(J.push(`xterm-underline-${de.extended.underlineStyle}`),F===" "&&(F=" "),!de.isUnderlineColorDefault()))if(de.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(de.getUnderlineColor()).join(",")})`;else{let Z=de.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&de.isBold()&&Z<8&&(Z+=8),M.style.textDecorationColor=L.ansi[Z].css}de.isOverline()&&(J.push("xterm-overline"),F===" "&&(F=" ")),de.isStrikethrough()&&J.push("xterm-strikethrough"),Ze&&(M.style.textDecoration="underline");let Me=de.getFgColor(),ht=de.getFgColorMode(),Rt=de.getBgColor(),pe=de.getBgColorMode();const be=!!de.isInverse();if(be){const Z=Me;Me=Rt,Rt=Z;const Pe=ht;ht=pe,pe=Pe}let Be,Ge,Ke,bt=!1;switch(this._decorationService.forEachDecorationAtCell(ye,T,void 0,(Z=>{Z.options.layer!=="top"&&bt||(Z.backgroundColorRGB&&(pe=50331648,Rt=Z.backgroundColorRGB.rgba>>8&16777215,Be=Z.backgroundColorRGB),Z.foregroundColorRGB&&(ht=50331648,Me=Z.foregroundColorRGB.rgba>>8&16777215,Ge=Z.foregroundColorRGB),bt=Z.options.layer==="top")})),!bt&&De&&(Be=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,Rt=Be.rgba>>8&16777215,pe=50331648,bt=!0,L.selectionForeground&&(ht=50331648,Me=L.selectionForeground.rgba>>8&16777215,Ge=L.selectionForeground)),bt&&J.push("xterm-decoration-top"),pe){case 16777216:case 33554432:Ke=L.ansi[Rt],J.push(`xterm-bg-${Rt}`);break;case 50331648:Ke=_.channels.toColor(Rt>>16,Rt>>8&255,255&Rt),this._addStyle(M,`background-color:#${E((Rt>>>0).toString(16),"0",6)}`);break;default:be?(Ke=L.foreground,J.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ke=L.background}switch(Be||de.isDim()&&(Be=_.color.multiplyOpacity(Ke,.5)),ht){case 16777216:case 33554432:de.isBold()&&Me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Me+=8),this._applyMinimumContrast(M,Ke,L.ansi[Me],de,Be,void 0)||J.push(`xterm-fg-${Me}`);break;case 50331648:const Z=_.channels.toColor(Me>>16&255,Me>>8&255,255&Me);this._applyMinimumContrast(M,Ke,Z,de,Be,Ge)||this._addStyle(M,`color:#${E(Me.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,Ke,L.foreground,de,Be,Ge)||be&&J.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}J.length&&(M.className=J.join(" "),J.length=0),Re||Ve||Se?M.textContent=F:q++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),G.push(M),ye=re}return M&&q&&(M.textContent=F),G}_applyMinimumContrast(P,T,N,R,I,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const $=this._getContrastCache(R);let W;if(I||O||(W=$.getColor(T.rgba,N.rgba)),W===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);W=_.color.ensureContrastRatio(I||T,O||N,Y),$.setColor((I||T).rgba,(O||N).rgba,W??null)}return!!W&&(this._addStyle(P,`color:${W.css}`),!0)}_getContrastCache(P){return P.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(P,T){P.setAttribute("style",`${P.getAttribute("style")||""}${T};`)}_isCellInSelection(P,T){const N=this._selectionStart,R=this._selectionEnd;return!(!N||!R)&&(this._columnSelectMode?N[0]<=R[0]?P>=N[0]&&T>=N[1]&&P<R[0]&&T<=R[1]:P<N[0]&&T>=N[1]&&P>=R[0]&&T<=R[1]:T>N[1]&&T<R[1]||N[1]===R[1]&&T===N[1]&&P>=N[0]&&P<R[0]||N[1]<R[1]&&T===R[1]&&P<R[0]||N[1]<R[1]&&T===N[1]&&P>=N[0])}};function E(P,T,N){for(;P.length<N;)P=T+P;return P}l.DomRendererRowFactory=j=f([m(1,v.ICharacterJoinerService),m(2,k.IOptionsService),m(3,v.ICoreBrowserService),m(4,k.ICoreService),m(5,k.IDecorationService),m(6,v.IThemeService)],j)},2550:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const x=c.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[m,h,x,w],this._container.appendChild(m),this._container.appendChild(h),this._container.appendChild(x),this._container.appendChild(w),f.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(c,f,m,h){c===this._font&&f===this._fontSize&&m===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=f,this._weight=m,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,f,m){let h=0;if(!f&&!m&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const k=this._measure(c,0);return k>0&&(this._flat[h]=k),k}let x=c;f&&(x+="B"),m&&(x+="I");let w=this._holey.get(x);if(w===void 0){let k=0;f&&(k|=1),m&&(k|=2),w=this._measure(c,k),w>0&&this._holey.set(x,w)}return w}_measure(c,f){const m=this._measureElements[f];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(d,l)=>{function c(m){return 57508<=m&&m<=57558}function f(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=f,l.allowRescaling=function(m,h,x,w){return h===1&&x>Math.ceil(1.5*w)&&m!==void 0&&m>255&&!f(m)&&!c(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(h){return 9472<=h&&h<=9631})(m)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(m,h,x=0){return(m-(2*Math.round(h)-x))%(2*Math.round(h))}},6052:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class c{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(m,h,x,w=!1){if(this.selectionStart=h,this.selectionEnd=x,!h||!x||h[0]===x[0]&&h[1]===x[1])return void this.clear();const k=m.buffers.active.ydisp,_=h[1]-k,v=x[1]-k,b=Math.max(_,0),g=Math.min(v,m.rows-1);b>=m.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=_,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=g,this.startCol=h[0],this.endCol=x[0])}isCellSelected(m,h,x){return!!this.hasSelection&&(x-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&x>=this.viewportCappedStartRow&&h<this.endCol&&x<=this.viewportCappedEndRow:h<this.startCol&&x>=this.viewportCappedStartRow&&h>=this.endCol&&x<=this.viewportCappedEndRow:x>this.viewportStartRow&&x<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&x===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportStartRow&&h>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,T=arguments.length,N=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(T<3?P(N):T>3?P(y,j,N):P(y,j))||N);return T>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const h=c(2585),x=c(8460),w=c(844);let k=l.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,y,j){super(),this._optionsService=j,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(g,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};l.CharSizeService=k=f([m(2,h.IOptionsService)],k);class _ extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,j){y!==void 0&&y>0&&j!==void 0&&j>0&&(this._result.width=y,this._result.height=j)}}class v extends _{constructor(y,j,E){super(),this._document=y,this._parentElement=j,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends _{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const j=this._ctx.measureText("W");if(!("width"in j&&"fontBoundingBoxAscent"in j&&"fontBoundingBoxDescent"in j))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(d,l,c){var f=this&&this.__decorate||function(b,g,y,j){var E,P=arguments.length,T=P<3?g:j===null?j=Object.getOwnPropertyDescriptor(g,y):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,g,y,j);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(T=(P<3?E(T):P>3?E(g,y,T):E(g,y))||T);return P>3&&T&&Object.defineProperty(g,y,T),T},m=this&&this.__param||function(b,g){return function(y,j){g(y,j,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const h=c(3734),x=c(643),w=c(511),k=c(2585);class _ extends h.AttributeData{constructor(g,y,j){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=y,this._width=j}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=_;let v=l.CharacterJoinerService=class rj{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(g){const y={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(y),y.id}deregister(g){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===g)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(g);if(!y||y.length===0)return[];const j=[],E=y.translateToString(!0);let P=0,T=0,N=0,R=y.getFg(0),I=y.getBg(0);for(let O=0;O<y.getTrimmedLength();O++)if(y.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==I){if(O-P>1){const $=this._getJoinedRanges(E,N,T,y,P);for(let W=0;W<$.length;W++)j.push($[W])}P=O,N=T,R=this._workCell.fg,I=this._workCell.bg}T+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-P>1){const O=this._getJoinedRanges(E,N,T,y,P);for(let $=0;$<O.length;$++)j.push(O[$])}return j}_getJoinedRanges(g,y,j,E,P){const T=g.substring(y,j);let N=[];try{N=this._characterJoiners[0].handler(T)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const I=this._characterJoiners[R].handler(T);for(let O=0;O<I.length;O++)rj._mergeRanges(N,I[O])}catch(I){console.error(I)}return this._stringRangesToCellRanges(N,E,P),N}_stringRangesToCellRanges(g,y,j){let E=0,P=!1,T=0,N=g[E];if(N){for(let R=j;R<this._bufferService.cols;R++){const I=y.getWidth(R),O=y.getString(R).length||x.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!P&&N[0]<=T&&(N[0]=R,P=!0),N[1]<=T){if(N[1]=R,N=g[++E],!N)break;N[0]<=T?(N[0]=R,P=!0):P=!1}T+=O}}N&&(N[1]=this._bufferService.cols)}}static _mergeRanges(g,y){let j=!1;for(let E=0;E<g.length;E++){const P=g[E];if(j){if(y[1]<=P[0])return g[E-1][1]=y[1],g;if(y[1]<=P[1])return g[E-1][1]=Math.max(y[1],P[1]),g.splice(E,1),g;g.splice(E,1),E--}else{if(y[1]<=P[0])return g.splice(E,0,y),g;if(y[1]<=P[1])return P[0]=Math.min(y[0],P[0]),g;y[0]<P[1]&&(P[0]=Math.min(y[0],P[0]),j=!0)}}return j?g[g.length-1][1]=y[1]:g.push(y),g}};l.CharacterJoinerService=v=f([m(0,k.IBufferService)],v)},5114:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=c(844),m=c(8460),h=c(3656);class x extends f.Disposable{constructor(_,v,b){super(),this._textarea=_,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,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}}l.CoreBrowserService=x;class w extends f.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=c(844);class m extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(x){return this.linkProviders.push(x),{dispose:()=>{const w=this.linkProviders.indexOf(x);w!==-1&&this.linkProviders.splice(w,1)}}}}l.LinkProviderService=m},8934:function(d,l,c){var f=this&&this.__decorate||function(k,_,v,b){var g,y=arguments.length,j=y<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,_,v,b);else for(var E=k.length-1;E>=0;E--)(g=k[E])&&(j=(y<3?g(j):y>3?g(_,v,j):g(_,v))||j);return y>3&&j&&Object.defineProperty(_,v,j),j},m=this&&this.__param||function(k,_){return function(v,b){_(v,b,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const h=c(4725),x=c(9806);let w=l.MouseService=class{constructor(k,_){this._renderService=k,this._charSizeService=_}getCoords(k,_,v,b,g){return(0,x.getCoords)(window,k,_,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(k,_){const v=(0,x.getCoordsRelativeToElement)(window,k,_);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};l.MouseService=w=f([m(0,h.IRenderService),m(1,h.ICharSizeService)],w)},3230:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,T=arguments.length,N=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(T<3?P(N):T>3?P(y,j,N):P(y,j))||N);return T>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const h=c(6193),x=c(4725),w=c(8460),k=c(844),_=c(7226),v=c(2585);let b=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,y,j,E,P,T,N,R){super(),this._rowCount=g,this._charSizeService=E,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((I,O)=>this._renderRows(I,O)),N),this.register(this._renderDebouncer),this.register(N.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(j.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(P.onDecorationRegistered((()=>this._fullRefresh()))),this.register(P.onDecorationRemoved((()=>this._fullRefresh()))),this.register(j.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(j.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(N.window,y),this.register(N.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(g,y){if("IntersectionObserver"in g){const j=new g.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});j.observe(y),this._observerDisposable.value=(0,k.toDisposable)((()=>j.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,y,j=!1){this._isPaused?this._needsFullRefresh=!0:(j||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,y,this._rowCount))}_renderRows(g,y){this._renderer.value&&(g=Math.min(g,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(g,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:y}),this._onRender.fire({start:g,end:y}),this._isNextRenderRedrawOnly=!0)}resize(g,y){this._rowCount=y,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,y;this._renderer.value&&((y=(g=this._renderer.value).clearTextureAtlas)==null||y.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var j;return(j=this._renderer.value)==null?void 0:j.handleResize(g,y)})):this._renderer.value.handleResize(g,y),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,y,j){var E;this._selectionState.start=g,this._selectionState.end=y,this._selectionState.columnSelectMode=j,(E=this._renderer.value)==null||E.handleSelectionChanged(g,y,j)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};l.RenderService=b=f([m(2,v.IOptionsService),m(3,x.ICharSizeService),m(4,v.IDecorationService),m(5,v.IBufferService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],b)},9312:function(d,l,c){var f=this&&this.__decorate||function(N,R,I,O){var $,W=arguments.length,Y=W<3?R:O===null?O=Object.getOwnPropertyDescriptor(R,I):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(N,R,I,O);else for(var z=N.length-1;z>=0;z--)($=N[z])&&(Y=(W<3?$(Y):W>3?$(R,I,Y):$(R,I))||Y);return W>3&&Y&&Object.defineProperty(R,I,Y),Y},m=this&&this.__param||function(N,R){return function(I,O){R(I,O,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const h=c(9806),x=c(9504),w=c(456),k=c(4725),_=c(8460),v=c(844),b=c(6114),g=c(4841),y=c(511),j=c(2585),E=" ",P=new RegExp(E,"g");let T=l.SelectionService=class extends v.Disposable{constructor(N,R,I,O,$,W,Y,z,K){super(),this._element=N,this._screenElement=R,this._linkifier=I,this._bufferService=O,this._coreService=$,this._mouseService=W,this._optionsService=Y,this._renderService=z,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const N=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!N||!R||N[0]===R[0]&&N[1]===R[1])}get selectionText(){const N=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!N||!R)return"";const I=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(N[0]===R[0])return"";const $=N[0]<R[0]?N[0]:R[0],W=N[0]<R[0]?R[0]:N[0];for(let Y=N[1];Y<=R[1];Y++){const z=I.translateBufferLineToString(Y,!0,$,W);O.push(z)}}else{const $=N[1]===R[1]?R[0]:void 0;O.push(I.translateBufferLineToString(N[1],!0,N[0],$));for(let W=N[1]+1;W<=R[1]-1;W++){const Y=I.lines.get(W),z=I.translateBufferLineToString(W,!0);Y!=null&&Y.isWrapped?O[O.length-1]+=z:O.push(z)}if(N[1]!==R[1]){const W=I.lines.get(R[1]),Y=I.translateBufferLineToString(R[1],!0,0,R[0]);W&&W.isWrapped?O[O.length-1]+=Y:O.push(Y)}}return O.map(($=>$.replace(P," "))).join(b.isWindows?`\r
|
|
539
|
+
WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=w=f([m(0,x.IBufferService),m(1,x.IOptionsService),m(2,x.IOscLinkService)],w)},6193:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,m){this._rowCount=m,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=c(3614),m=c(3656),h=c(3551),x=c(9042),w=c(3730),k=c(1680),_=c(3107),v=c(5744),b=c(2950),g=c(1296),y=c(428),j=c(4269),E=c(5114),P=c(8934),T=c(3230),N=c(9312),R=c(4725),I=c(6731),O=c(8055),$=c(8969),W=c(8460),Y=c(844),z=c(6114),K=c(8437),G=c(2584),U=c(7399),L=c(5941),M=c(9074),B=c(2585),q=c(5435),F=c(4567),oe=c(779);class fe extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new W.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new W.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new W.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new W.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new W.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new W.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new W.EventEmitter),this._onBlur=this.register(new W.EventEmitter),this._onA11yCharEmitter=this.register(new W.EventEmitter),this._onA11yTabEmitter=this.register(new W.EventEmitter),this._onWillOpen=this.register(new W.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(oe.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ae)=>this.refresh(H,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,W.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,W.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,Y.toDisposable)((()=>{var H,ae;this._customKeyEventHandler=void 0,(ae=(H=this.element)==null?void 0:H.parentNode)==null||ae.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const H of X){let ae,ne="";switch(H.index){case 256:ae="foreground",ne="10";break;case 257:ae="background",ne="11";break;case 258:ae="cursor",ne="12";break;default:ae="ansi",ne="4;"+H.index}switch(H.type){case 0:const J=O.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${ne};${(0,L.toRgbString)(J)}${G.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((ie=>ie.ansi[H.index]=O.channels.toColor(...H.color)));else{const ie=ae;this._themeService.modifyColors((ye=>ye[ie]=O.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(X);if(!H)return;const ae=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,J=H.getWidth(ae),ie=this._renderService.dimensions.css.cell.width*J,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Oe=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Oe+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=ie+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,f.copyHandler)(H,this._selectionService)})));const X=H=>(0,f.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,m.addDisposableDomListener)(this.element,"paste",X)),z.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),z.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,f.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var ae;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ae=this.element)==null?void 0:ae.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(j.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(P.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(N.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),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(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,H=this.element;function ae(ie){const ye=X._mouseService.getMouseReportCoords(ie,X.screenElement);if(!ye)return!1;let Oe,Ve;switch(ie.overrideType||ie.type){case"mousemove":Ve=32,ie.buttons===void 0?(Oe=3,ie.button!==void 0&&(Oe=ie.button<3?ie.button:3)):Oe=1&ie.buttons?0:4&ie.buttons?1:2&ie.buttons?2:3;break;case"mouseup":Ve=0,Oe=ie.button<3?ie.button:3;break;case"mousedown":Ve=1,Oe=ie.button<3?ie.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(ie)===!1||X.viewport.getLinesScrolled(ie)===0)return!1;Ve=ie.deltaY<0?0:1,Oe=4;break;default:return!1}return!(Ve===void 0||Oe===void 0||Oe>4)&&X.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:Oe,action:Ve,ctrl:ie.ctrlKey,alt:ie.altKey,shift:ie.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},J={mouseup:ie=>(ae(ie),ie.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(ie)),wheel:ie=>(ae(ie),this.cancel(ie,!0)),mousedrag:ie=>{ie.buttons&&ae(ie)},mousemove:ie=>{ie.buttons||ae(ie)}};this.register(this.coreMouseService.onProtocolChange((ie=>{ie?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ie)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ie?ne.mousemove||(H.addEventListener("mousemove",J.mousemove),ne.mousemove=J.mousemove):(H.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&ie?ne.wheel||(H.addEventListener("wheel",J.wheel,{passive:!1}),ne.wheel=J.wheel):(H.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&ie?ne.mouseup||(ne.mouseup=J.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&ie?ne.mousedrag||(ne.mousedrag=J.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(H,"mousedown",(ie=>{if(ie.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ie))return ae(ie),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(ie)}))),this.register((0,m.addDisposableDomListener)(H,"wheel",(ie=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ie)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(ie);if(ye===0)return;const Oe=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ie.deltaY<0?"A":"B");let Ve="";for(let te=0;te<Math.abs(ye);te++)Ve+=Oe;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(ie,!0)}return this.viewport.handleWheel(ie)?this.cancel(ie):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(H,"touchstart",(ie=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ie),this.cancel(ie)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(H,"touchmove",(ie=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ie)?void 0:this.cancel(ie)}),{passive:!1}))}refresh(X,H){var ae;(ae=this._renderService)==null||ae.refreshRows(X,H)}updateCursorStyle(X){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(X,H,ae=0){var ne;ae===1?(super.scrollLines(X,H,ae),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(X)}paste(X){(0,f.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,H,ae){this._selectionService.setSelection(X,H,ae)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,H){var ae;(ae=this._selectionService)==null||ae.selectLines(X,H)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!H&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,U.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ae.type===3||ae.type===2){const ne=this.rows-1;return this.scrollLines(ae.type===2?-ne:ne),this.cancel(X,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ae.cancel&&this.cancel(X,!0),!ae.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==G.C0.ETX&&ae.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,H){const ae=X.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||X.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||X.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ae:ae&&(!H.keyCode||H.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)H=X.charCode;else if(X.which===null||X.which===void 0)H=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;H=X.which}return!(!H||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=X.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(X),!0}return!1}resize(X,H){X!==this.cols||H!==this.rows?super.resize(X,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,H){var ae,ne;(ae=this._charSizeService)==null||ae.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var X;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(K.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var H,ae;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(ae=this.viewport)==null||ae.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${ae};${H}t`);break;case q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),J=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${J};${ne}t`)}}cancel(X,H){if(this.options.cancelEvents||H)return X.preventDefault(),X.stopPropagation(),!1}}l.Terminal=fe},9924:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,m){this._rowCount=m,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=h-this._lastRefreshMs,w=this._debounceThresholdMS-x;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(d,l,c){var f=this&&this.__decorate||function(b,g,y,j){var E,P=arguments.length,T=P<3?g:j===null?j=Object.getOwnPropertyDescriptor(g,y):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,g,y,j);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(T=(P<3?E(T):P>3?E(g,y,T):E(g,y))||T);return P>3&&T&&Object.defineProperty(g,y,T),T},m=this&&this.__param||function(b,g){return function(y,j){g(y,j,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const h=c(3656),x=c(4725),w=c(8460),k=c(844),_=c(2585);let v=l.Viewport=class extends k.Disposable{constructor(b,g,y,j,E,P,T,N){super(),this._viewportElement=b,this._scrollArea=g,this._bufferService=y,this._optionsService=j,this._charSizeService=E,this._renderService=P,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(N.colors),this.register(N.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,g){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&y<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const g=this._getPixelsScrolled(b);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(b,g))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let g=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(b,g){var N;let y,j="";const E=[],P=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let R=b;R<P;R++){const I=T.get(R);if(!I)continue;const O=(N=T.get(R+1))==null?void 0:N.isWrapped;if(j+=I.translateToString(!O),!O||R===T.length-1){const $=document.createElement("div");$.textContent=j,E.push($),j.length>0&&(y=$),j=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let g=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(b,g){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&g.altKey||y==="ctrl"&&g.ctrlKey||y==="shift"&&g.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const g=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(b,g))}};l.Viewport=v=f([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,x.ICharSizeService),m(5,x.IRenderService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],v)},3107:function(d,l,c){var f=this&&this.__decorate||function(_,v,b,g){var y,j=arguments.length,E=j<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,v,b,g);else for(var P=_.length-1;P>=0;P--)(y=_[P])&&(E=(j<3?y(E):j>3?y(v,b,E):y(v,b))||E);return j>3&&E&&Object.defineProperty(v,b,E),E},m=this&&this.__param||function(_,v){return function(b,g){v(b,g,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const h=c(4725),x=c(844),w=c(2585);let k=l.BufferDecorationRenderer=class extends x.Disposable{constructor(_,v,b,g,y){super(),this._screenElement=_,this._bufferService=v,this._coreBrowserService=b,this._decorationService=g,this._renderService=y,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((j=>this._removeDecoration(j)))),this.register((0,x.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var g;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((g=_==null?void 0:_.options)==null?void 0:g.layer)==="top"),v.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=_.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(_,v),v}_refreshStyle(_){const v=_.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let b=this._decorationElements.get(_);b||(b=this._createElement(_),_.element=b,this._decorationElements.set(_,b),this._container.appendChild(b),_.onDispose((()=>{this._decorationElements.delete(_),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(b)}}_refreshXPosition(_,v=_.element){if(!v)return;const b=_.options.x??0;(_.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var v;(v=this._decorationElements.get(_))==null||v.remove(),this._decorationElements.delete(_),_.dispose()}};l.BufferDecorationRenderer=k=f([m(1,w.IBufferService),m(2,h.ICoreBrowserService),m(3,w.IDecorationService),m(4,h.IRenderService)],k)},5871:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,m){return f>=c.startBufferLine-this._linePadding[m||"full"]&&f<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(d,l,c){var f=this&&this.__decorate||function(y,j,E,P){var T,N=arguments.length,R=N<3?j:P===null?P=Object.getOwnPropertyDescriptor(j,E):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,j,E,P);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(R=(N<3?T(R):N>3?T(j,E,R):T(j,E))||R);return N>3&&R&&Object.defineProperty(j,E,R),R},m=this&&this.__param||function(y,j){return function(E,P){j(E,P,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const h=c(5871),x=c(4725),w=c(844),k=c(2585),_={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let g=l.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,j,E,P,T,N,R){var O;super(),this._viewportElement=y,this._screenElement=j,this._bufferService=E,this._decorationService=P,this._renderService=T,this._optionsService=N,this._coreBrowserService=R,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),j=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=j,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,j=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);_.left=j,_.center=j,_.right=j}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const j of this._decorationService.decorations)this._colorZoneStore.addDecoration(j);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const j of y)j.position!=="full"&&this._renderColorZone(j);for(const j of y)j.position==="full"&&this._renderColorZone(j);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-_[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[y.position||"full"]))}_queueRefresh(y,j){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=j||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=g=f([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,x.IRenderService),m(5,k.IOptionsService),m(6,x.ICoreBrowserService)],g)},2950:function(d,l,c){var f=this&&this.__decorate||function(_,v,b,g){var y,j=arguments.length,E=j<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,v,b,g);else for(var P=_.length-1;P>=0;P--)(y=_[P])&&(E=(j<3?y(E):j>3?y(v,b,E):y(v,b))||E);return j>3&&E&&Object.defineProperty(v,b,E),E},m=this&&this.__param||function(_,v){return function(b,g){v(b,g,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const h=c(4725),x=c(2585),w=c(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,v,b,g,y,j){this._textarea=_,this._compositionView=v,this._bufferService=b,this._optionsService=g,this._coreService=y,this._renderService=j,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(_,"");this._dataAlreadySent=b,v.length>_.length?this._coreService.triggerDataEvent(b,!0):v.length<_.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):v.length===_.length&&v!==_&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const j=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(j.width,1)+"px",this._textarea.style.height=Math.max(j.height,1)+"px",this._textarea.style.lineHeight=j.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=f([m(2,x.IBufferService),m(3,x.IOptionsService),m(4,x.ICoreService),m(5,h.IRenderService)],k)},9806:(d,l)=>{function c(f,m,h){const x=h.getBoundingClientRect(),w=f.getComputedStyle(h),k=parseInt(w.getPropertyValue("padding-left")),_=parseInt(w.getPropertyValue("padding-top"));return[m.clientX-x.left-k,m.clientY-x.top-_]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(f,m,h,x,w,k,_,v,b){if(!k)return;const g=c(f,m,h);return g?(g[0]=Math.ceil((g[0]+(b?_/2:0))/_),g[1]=Math.ceil(g[1]/v),g[0]=Math.min(Math.max(g[0],1),x+(b?1:0)),g[1]=Math.min(Math.max(g[1],1),w),g):void 0}},9504:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=c(2584);function m(v,b,g,y){const j=v-h(v,g),E=b-h(b,g),P=Math.abs(j-E)-(function(T,N,R){let I=0;const O=T-h(T,R),$=N-h(N,R);for(let W=0;W<Math.abs(O-$);W++){const Y=x(T,N)==="A"?-1:1,z=R.buffer.lines.get(O+Y*W);z!=null&&z.isWrapped&&I++}return I})(v,b,g);return _(P,k(x(v,b),y))}function h(v,b){let g=0,y=b.buffer.lines.get(v),j=y==null?void 0:y.isWrapped;for(;j&&v>=0&&v<b.rows;)g++,y=b.buffer.lines.get(--v),j=y==null?void 0:y.isWrapped;return g}function x(v,b){return v>b?"A":"B"}function w(v,b,g,y,j,E){let P=v,T=b,N="";for(;P!==g||T!==y;)P+=j?1:-1,j&&P>E.cols-1?(N+=E.buffer.translateBufferLineToString(T,!1,v,P),P=0,v=0,T++):!j&&P<0&&(N+=E.buffer.translateBufferLineToString(T,!1,0,v+1),P=E.cols-1,v=P,T--);return N+E.buffer.translateBufferLineToString(T,!1,v,P)}function k(v,b){const g=b?"O":"[";return f.C0.ESC+g+v}function _(v,b){v=Math.floor(v);let g="";for(let y=0;y<v;y++)g+=b;return g}l.moveToCellSequence=function(v,b,g,y){const j=g.buffer.x,E=g.buffer.y;if(!g.buffer.hasScrollback)return(function(N,R,I,O,$,W){return m(R,O,$,W).length===0?"":_(w(N,R,N,R-h(R,$),!1,$).length,k("D",W))})(j,E,0,b,g,y)+m(E,b,g,y)+(function(N,R,I,O,$,W){let Y;Y=m(R,O,$,W).length>0?O-h(O,$):R;const z=O,K=(function(G,U,L,M,B,q){let F;return F=m(L,M,B,q).length>0?M-h(M,B):U,G<L&&F<=M||G>=L&&F<M?"C":"D"})(N,R,I,O,$,W);return _(w(N,Y,I,z,K==="C",$).length,k(K,W))})(j,E,v,b,g,y);let P;if(E===b)return P=j>v?"D":"C",_(Math.abs(j-v),k(P,y));P=E>b?"D":"C";const T=Math.abs(E-b);return _((function(N,R){return R.cols-N})(E>b?v:j,g)+(T-1)*g.cols+1+((E>b?j:v)-1),k(P,y))}},1296:function(d,l,c){var f=this&&this.__decorate||function(W,Y,z,K){var G,U=arguments.length,L=U<3?Y:K===null?K=Object.getOwnPropertyDescriptor(Y,z):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(W,Y,z,K);else for(var M=W.length-1;M>=0;M--)(G=W[M])&&(L=(U<3?G(L):U>3?G(Y,z,L):G(Y,z))||L);return U>3&&L&&Object.defineProperty(Y,z,L),L},m=this&&this.__param||function(W,Y){return function(z,K){Y(z,K,W)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const h=c(3787),x=c(2550),w=c(2223),k=c(6171),_=c(6052),v=c(4725),b=c(8055),g=c(8460),y=c(844),j=c(2585),E="xterm-dom-renderer-owner-",P="xterm-rows",T="xterm-fg-",N="xterm-bg-",R="xterm-focus",I="xterm-selection";let O=1,$=l.DomRenderer=class extends y.Disposable{constructor(W,Y,z,K,G,U,L,M,B,q,F,oe,fe){super(),this._terminal=W,this._document=Y,this._element=z,this._screenElement=K,this._viewportElement=G,this._helperContainer=U,this._linkifier2=L,this._charSizeService=B,this._optionsService=q,this._bufferService=F,this._coreBrowserService=oe,this._themeService=fe,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(P),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new x.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const W=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*W,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*W),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/W),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/W),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${P} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(W){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${P} { color: ${W.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${P} .xterm-dim { color: ${b.color.multiplyOpacity(W.foreground,.5).css};}`,Y+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const z=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${K} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${G} { 0% { background-color: ${W.cursor.css}; color: ${W.cursorAccent.css}; } 50% { background-color: inherit; color: ${W.cursor.css}; }}`,Y+=`${this._terminalSelector} .${P}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${P}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${P}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-block { background-color: ${W.cursor.css}; color: ${W.cursorAccent.css};}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${W.cursor.css} !important; color: ${W.cursorAccent.css} !important;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${W.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${W.cursor.css} inset;}${this._terminalSelector} .${P} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${W.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${W.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${W.selectionInactiveBackgroundOpaque.css};}`;for(const[U,L]of W.ansi.entries())Y+=`${this._terminalSelector} .${T}${U} { color: ${L.css}; }${this._terminalSelector} .${T}${U}.xterm-dim { color: ${b.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${N}${U} { background-color: ${L.css}; }`;Y+=`${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(W.background).css}; }${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(W.background),.5).css}; }${this._terminalSelector} .${N}${w.INVERTED_DEFAULT_COLOR} { background-color: ${W.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const W=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${W}px`,this._rowFactory.defaultSpacing=W}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(W,Y){for(let z=this._rowElements.length;z<=Y;z++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(W,Y){this._refreshRowElements(W,Y),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(W,Y,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(W,Y,z),this.renderRows(0,this._bufferService.rows-1),!W||!Y)return;this._selectionRenderModel.update(this._terminal,W,Y,z);const K=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(z){const B=W[0]>Y[0];M.appendChild(this._createSelectionElement(U,B?Y[0]:W[0],B?W[0]:Y[0],L-U+1))}else{const B=K===U?W[0]:0,q=U===G?Y[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(U,B,q));const F=L-U-1;if(M.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,F)),U!==L){const oe=G===L?Y[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,oe))}}this._selectionContainer.appendChild(M)}_createSelectionElement(W,Y,z,K=1){const G=this._document.createElement("div"),U=Y*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(z-Y);return U+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-U),G.style.height=K*this.dimensions.css.cell.height+"px",G.style.top=W*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${L}px`,G}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const W of this._rowElements)W.replaceChildren()}renderRows(W,Y){const z=this._bufferService.buffer,K=z.ybase+z.y,G=Math.min(z.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=W;B<=Y;B++){const q=B+z.ydisp,F=this._rowElements[B],oe=z.lines.get(q);if(!F||!oe)break;F.replaceChildren(...this._rowFactory.createRow(oe,q,q===K,L,M,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(W){this._setCellUnderline(W.x1,W.x2,W.y1,W.y2,W.cols,!0)}_handleLinkLeave(W){this._setCellUnderline(W.x1,W.x2,W.y1,W.y2,W.cols,!1)}_setCellUnderline(W,Y,z,K,G,U){z<0&&(W=0),K<0&&(Y=0);const L=this._bufferService.rows-1;z=Math.max(Math.min(z,L),0),K=Math.max(Math.min(K,L),0),G=Math.min(G,this._bufferService.cols);const M=this._bufferService.buffer,B=M.ybase+M.y,q=Math.min(M.x,G-1),F=this._optionsService.rawOptions.cursorBlink,oe=this._optionsService.rawOptions.cursorStyle,fe=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=z;me<=K;++me){const X=me+M.ydisp,H=this._rowElements[me],ae=M.lines.get(X);if(!H||!ae)break;H.replaceChildren(...this._rowFactory.createRow(ae,X,X===B,oe,fe,q,F,this.dimensions.css.cell.width,this._widthCache,U?me===z?W:0:-1,U?(me===K?Y:G)-1:-1))}}};l.DomRenderer=$=f([m(7,j.IInstantiationService),m(8,v.ICharSizeService),m(9,j.IOptionsService),m(10,j.IBufferService),m(11,v.ICoreBrowserService),m(12,v.IThemeService)],$)},3787:function(d,l,c){var f=this&&this.__decorate||function(P,T,N,R){var I,O=arguments.length,$=O<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,N):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(P,T,N,R);else for(var W=P.length-1;W>=0;W--)(I=P[W])&&($=(O<3?I($):O>3?I(T,N,$):I(T,N))||$);return O>3&&$&&Object.defineProperty(T,N,$),$},m=this&&this.__param||function(P,T){return function(N,R){T(N,R,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const h=c(2223),x=c(643),w=c(511),k=c(2585),_=c(8055),v=c(4725),b=c(4269),g=c(6171),y=c(3734);let j=l.DomRendererRowFactory=class{constructor(P,T,N,R,I,O,$){this._document=P,this._characterJoinerService=T,this._optionsService=N,this._coreBrowserService=R,this._coreService=I,this._decorationService=O,this._themeService=$,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(P,T,N){this._selectionStart=P,this._selectionEnd=T,this._columnSelectMode=N}createRow(P,T,N,R,I,O,$,W,Y,z,K){const G=[],U=this._characterJoinerService.getJoinedCharacters(T),L=this._themeService.colors;let M,B=P.getNoBgTrimmedLength();N&&B<O+1&&(B=O+1);let q=0,F="",oe=0,fe=0,me=0,X=!1,H=0,ae=!1,ne=0;const J=[],ie=z!==-1&&K!==-1;for(let ye=0;ye<B;ye++){P.loadCell(ye,this._workCell);let Oe=this._workCell.getWidth();if(Oe===0)continue;let Ve=!1,te=ye,de=this._workCell;if(U.length>0&&ye===U[0][0]){Ve=!0;const Z=U.shift();de=new b.JoinedCellData(this._workCell,P.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),te=Z[1]-1,Oe=de.getWidth()}const De=this._isCellInSelection(ye,T),Re=N&&ye===O,Ze=ie&&ye>=z&&ye<=K;let Se=!1;this._decorationService.forEachDecorationAtCell(ye,T,void 0,(Z=>{Se=!0}));let ge=de.getChars()||x.WHITESPACE_CELL_CHAR;if(ge===" "&&(de.isUnderline()||de.isOverline())&&(ge=" "),ne=Oe*W-Y.get(ge,de.isBold(),de.isItalic()),M){if(q&&(De&&ae||!De&&!ae&&de.bg===oe)&&(De&&ae&&L.selectionForeground||de.fg===fe)&&de.extended.ext===me&&Ze===X&&ne===H&&!Re&&!Ve&&!Se){de.isInvisible()?F+=x.WHITESPACE_CELL_CHAR:F+=ge,q++;continue}q&&(M.textContent=F),M=this._document.createElement("span"),q=0,F=""}else M=this._document.createElement("span");if(oe=de.bg,fe=de.fg,me=de.extended.ext,X=Ze,H=ne,ae=De,Ve&&O>=ye&&O<=te&&(O=ye),!this._coreService.isCursorHidden&&Re&&this._coreService.isCursorInitialized){if(J.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&J.push("xterm-cursor-blink"),J.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":J.push("xterm-cursor-outline");break;case"block":J.push("xterm-cursor-block");break;case"bar":J.push("xterm-cursor-bar");break;case"underline":J.push("xterm-cursor-underline")}}if(de.isBold()&&J.push("xterm-bold"),de.isItalic()&&J.push("xterm-italic"),de.isDim()&&J.push("xterm-dim"),F=de.isInvisible()?x.WHITESPACE_CELL_CHAR:de.getChars()||x.WHITESPACE_CELL_CHAR,de.isUnderline()&&(J.push(`xterm-underline-${de.extended.underlineStyle}`),F===" "&&(F=" "),!de.isUnderlineColorDefault()))if(de.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(de.getUnderlineColor()).join(",")})`;else{let Z=de.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&de.isBold()&&Z<8&&(Z+=8),M.style.textDecorationColor=L.ansi[Z].css}de.isOverline()&&(J.push("xterm-overline"),F===" "&&(F=" ")),de.isStrikethrough()&&J.push("xterm-strikethrough"),Ze&&(M.style.textDecoration="underline");let Me=de.getFgColor(),ht=de.getFgColorMode(),Rt=de.getBgColor(),pe=de.getBgColorMode();const be=!!de.isInverse();if(be){const Z=Me;Me=Rt,Rt=Z;const Pe=ht;ht=pe,pe=Pe}let Be,Ge,Ke,bt=!1;switch(this._decorationService.forEachDecorationAtCell(ye,T,void 0,(Z=>{Z.options.layer!=="top"&&bt||(Z.backgroundColorRGB&&(pe=50331648,Rt=Z.backgroundColorRGB.rgba>>8&16777215,Be=Z.backgroundColorRGB),Z.foregroundColorRGB&&(ht=50331648,Me=Z.foregroundColorRGB.rgba>>8&16777215,Ge=Z.foregroundColorRGB),bt=Z.options.layer==="top")})),!bt&&De&&(Be=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,Rt=Be.rgba>>8&16777215,pe=50331648,bt=!0,L.selectionForeground&&(ht=50331648,Me=L.selectionForeground.rgba>>8&16777215,Ge=L.selectionForeground)),bt&&J.push("xterm-decoration-top"),pe){case 16777216:case 33554432:Ke=L.ansi[Rt],J.push(`xterm-bg-${Rt}`);break;case 50331648:Ke=_.channels.toColor(Rt>>16,Rt>>8&255,255&Rt),this._addStyle(M,`background-color:#${E((Rt>>>0).toString(16),"0",6)}`);break;default:be?(Ke=L.foreground,J.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ke=L.background}switch(Be||de.isDim()&&(Be=_.color.multiplyOpacity(Ke,.5)),ht){case 16777216:case 33554432:de.isBold()&&Me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Me+=8),this._applyMinimumContrast(M,Ke,L.ansi[Me],de,Be,void 0)||J.push(`xterm-fg-${Me}`);break;case 50331648:const Z=_.channels.toColor(Me>>16&255,Me>>8&255,255&Me);this._applyMinimumContrast(M,Ke,Z,de,Be,Ge)||this._addStyle(M,`color:#${E(Me.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,Ke,L.foreground,de,Be,Ge)||be&&J.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}J.length&&(M.className=J.join(" "),J.length=0),Re||Ve||Se?M.textContent=F:q++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),G.push(M),ye=te}return M&&q&&(M.textContent=F),G}_applyMinimumContrast(P,T,N,R,I,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const $=this._getContrastCache(R);let W;if(I||O||(W=$.getColor(T.rgba,N.rgba)),W===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);W=_.color.ensureContrastRatio(I||T,O||N,Y),$.setColor((I||T).rgba,(O||N).rgba,W??null)}return!!W&&(this._addStyle(P,`color:${W.css}`),!0)}_getContrastCache(P){return P.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(P,T){P.setAttribute("style",`${P.getAttribute("style")||""}${T};`)}_isCellInSelection(P,T){const N=this._selectionStart,R=this._selectionEnd;return!(!N||!R)&&(this._columnSelectMode?N[0]<=R[0]?P>=N[0]&&T>=N[1]&&P<R[0]&&T<=R[1]:P<N[0]&&T>=N[1]&&P>=R[0]&&T<=R[1]:T>N[1]&&T<R[1]||N[1]===R[1]&&T===N[1]&&P>=N[0]&&P<R[0]||N[1]<R[1]&&T===R[1]&&P<R[0]||N[1]<R[1]&&T===N[1]&&P>=N[0])}};function E(P,T,N){for(;P.length<N;)P=T+P;return P}l.DomRendererRowFactory=j=f([m(1,v.ICharacterJoinerService),m(2,k.IOptionsService),m(3,v.ICoreBrowserService),m(4,k.ICoreService),m(5,k.IDecorationService),m(6,v.IThemeService)],j)},2550:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const x=c.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[m,h,x,w],this._container.appendChild(m),this._container.appendChild(h),this._container.appendChild(x),this._container.appendChild(w),f.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(c,f,m,h){c===this._font&&f===this._fontSize&&m===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=f,this._weight=m,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,f,m){let h=0;if(!f&&!m&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const k=this._measure(c,0);return k>0&&(this._flat[h]=k),k}let x=c;f&&(x+="B"),m&&(x+="I");let w=this._holey.get(x);if(w===void 0){let k=0;f&&(k|=1),m&&(k|=2),w=this._measure(c,k),w>0&&this._holey.set(x,w)}return w}_measure(c,f){const m=this._measureElements[f];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(d,l)=>{function c(m){return 57508<=m&&m<=57558}function f(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=f,l.allowRescaling=function(m,h,x,w){return h===1&&x>Math.ceil(1.5*w)&&m!==void 0&&m>255&&!f(m)&&!c(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(h){return 9472<=h&&h<=9631})(m)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(m,h,x=0){return(m-(2*Math.round(h)-x))%(2*Math.round(h))}},6052:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class c{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(m,h,x,w=!1){if(this.selectionStart=h,this.selectionEnd=x,!h||!x||h[0]===x[0]&&h[1]===x[1])return void this.clear();const k=m.buffers.active.ydisp,_=h[1]-k,v=x[1]-k,b=Math.max(_,0),g=Math.min(v,m.rows-1);b>=m.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=_,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=g,this.startCol=h[0],this.endCol=x[0])}isCellSelected(m,h,x){return!!this.hasSelection&&(x-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&x>=this.viewportCappedStartRow&&h<this.endCol&&x<=this.viewportCappedEndRow:h<this.startCol&&x>=this.viewportCappedStartRow&&h>=this.endCol&&x<=this.viewportCappedEndRow:x>this.viewportStartRow&&x<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&x===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportStartRow&&h>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,T=arguments.length,N=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(T<3?P(N):T>3?P(y,j,N):P(y,j))||N);return T>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const h=c(2585),x=c(8460),w=c(844);let k=l.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,y,j){super(),this._optionsService=j,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(g,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};l.CharSizeService=k=f([m(2,h.IOptionsService)],k);class _ extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,j){y!==void 0&&y>0&&j!==void 0&&j>0&&(this._result.width=y,this._result.height=j)}}class v extends _{constructor(y,j,E){super(),this._document=y,this._parentElement=j,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends _{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const j=this._ctx.measureText("W");if(!("width"in j&&"fontBoundingBoxAscent"in j&&"fontBoundingBoxDescent"in j))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(d,l,c){var f=this&&this.__decorate||function(b,g,y,j){var E,P=arguments.length,T=P<3?g:j===null?j=Object.getOwnPropertyDescriptor(g,y):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,g,y,j);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(T=(P<3?E(T):P>3?E(g,y,T):E(g,y))||T);return P>3&&T&&Object.defineProperty(g,y,T),T},m=this&&this.__param||function(b,g){return function(y,j){g(y,j,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const h=c(3734),x=c(643),w=c(511),k=c(2585);class _ extends h.AttributeData{constructor(g,y,j){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=y,this._width=j}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=_;let v=l.CharacterJoinerService=class rj{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(g){const y={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(y),y.id}deregister(g){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===g)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(g);if(!y||y.length===0)return[];const j=[],E=y.translateToString(!0);let P=0,T=0,N=0,R=y.getFg(0),I=y.getBg(0);for(let O=0;O<y.getTrimmedLength();O++)if(y.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==I){if(O-P>1){const $=this._getJoinedRanges(E,N,T,y,P);for(let W=0;W<$.length;W++)j.push($[W])}P=O,N=T,R=this._workCell.fg,I=this._workCell.bg}T+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-P>1){const O=this._getJoinedRanges(E,N,T,y,P);for(let $=0;$<O.length;$++)j.push(O[$])}return j}_getJoinedRanges(g,y,j,E,P){const T=g.substring(y,j);let N=[];try{N=this._characterJoiners[0].handler(T)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const I=this._characterJoiners[R].handler(T);for(let O=0;O<I.length;O++)rj._mergeRanges(N,I[O])}catch(I){console.error(I)}return this._stringRangesToCellRanges(N,E,P),N}_stringRangesToCellRanges(g,y,j){let E=0,P=!1,T=0,N=g[E];if(N){for(let R=j;R<this._bufferService.cols;R++){const I=y.getWidth(R),O=y.getString(R).length||x.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!P&&N[0]<=T&&(N[0]=R,P=!0),N[1]<=T){if(N[1]=R,N=g[++E],!N)break;N[0]<=T?(N[0]=R,P=!0):P=!1}T+=O}}N&&(N[1]=this._bufferService.cols)}}static _mergeRanges(g,y){let j=!1;for(let E=0;E<g.length;E++){const P=g[E];if(j){if(y[1]<=P[0])return g[E-1][1]=y[1],g;if(y[1]<=P[1])return g[E-1][1]=Math.max(y[1],P[1]),g.splice(E,1),g;g.splice(E,1),E--}else{if(y[1]<=P[0])return g.splice(E,0,y),g;if(y[1]<=P[1])return P[0]=Math.min(y[0],P[0]),g;y[0]<P[1]&&(P[0]=Math.min(y[0],P[0]),j=!0)}}return j?g[g.length-1][1]=y[1]:g.push(y),g}};l.CharacterJoinerService=v=f([m(0,k.IBufferService)],v)},5114:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=c(844),m=c(8460),h=c(3656);class x extends f.Disposable{constructor(_,v,b){super(),this._textarea=_,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,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}}l.CoreBrowserService=x;class w extends f.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=c(844);class m extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(x){return this.linkProviders.push(x),{dispose:()=>{const w=this.linkProviders.indexOf(x);w!==-1&&this.linkProviders.splice(w,1)}}}}l.LinkProviderService=m},8934:function(d,l,c){var f=this&&this.__decorate||function(k,_,v,b){var g,y=arguments.length,j=y<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,_,v,b);else for(var E=k.length-1;E>=0;E--)(g=k[E])&&(j=(y<3?g(j):y>3?g(_,v,j):g(_,v))||j);return y>3&&j&&Object.defineProperty(_,v,j),j},m=this&&this.__param||function(k,_){return function(v,b){_(v,b,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const h=c(4725),x=c(9806);let w=l.MouseService=class{constructor(k,_){this._renderService=k,this._charSizeService=_}getCoords(k,_,v,b,g){return(0,x.getCoords)(window,k,_,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(k,_){const v=(0,x.getCoordsRelativeToElement)(window,k,_);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};l.MouseService=w=f([m(0,h.IRenderService),m(1,h.ICharSizeService)],w)},3230:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,T=arguments.length,N=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(T<3?P(N):T>3?P(y,j,N):P(y,j))||N);return T>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const h=c(6193),x=c(4725),w=c(8460),k=c(844),_=c(7226),v=c(2585);let b=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,y,j,E,P,T,N,R){super(),this._rowCount=g,this._charSizeService=E,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((I,O)=>this._renderRows(I,O)),N),this.register(this._renderDebouncer),this.register(N.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(j.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(P.onDecorationRegistered((()=>this._fullRefresh()))),this.register(P.onDecorationRemoved((()=>this._fullRefresh()))),this.register(j.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(j.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(N.window,y),this.register(N.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(g,y){if("IntersectionObserver"in g){const j=new g.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});j.observe(y),this._observerDisposable.value=(0,k.toDisposable)((()=>j.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,y,j=!1){this._isPaused?this._needsFullRefresh=!0:(j||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,y,this._rowCount))}_renderRows(g,y){this._renderer.value&&(g=Math.min(g,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(g,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:y}),this._onRender.fire({start:g,end:y}),this._isNextRenderRedrawOnly=!0)}resize(g,y){this._rowCount=y,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,y;this._renderer.value&&((y=(g=this._renderer.value).clearTextureAtlas)==null||y.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var j;return(j=this._renderer.value)==null?void 0:j.handleResize(g,y)})):this._renderer.value.handleResize(g,y),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,y,j){var E;this._selectionState.start=g,this._selectionState.end=y,this._selectionState.columnSelectMode=j,(E=this._renderer.value)==null||E.handleSelectionChanged(g,y,j)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};l.RenderService=b=f([m(2,v.IOptionsService),m(3,x.ICharSizeService),m(4,v.IDecorationService),m(5,v.IBufferService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],b)},9312:function(d,l,c){var f=this&&this.__decorate||function(N,R,I,O){var $,W=arguments.length,Y=W<3?R:O===null?O=Object.getOwnPropertyDescriptor(R,I):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(N,R,I,O);else for(var z=N.length-1;z>=0;z--)($=N[z])&&(Y=(W<3?$(Y):W>3?$(R,I,Y):$(R,I))||Y);return W>3&&Y&&Object.defineProperty(R,I,Y),Y},m=this&&this.__param||function(N,R){return function(I,O){R(I,O,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const h=c(9806),x=c(9504),w=c(456),k=c(4725),_=c(8460),v=c(844),b=c(6114),g=c(4841),y=c(511),j=c(2585),E=" ",P=new RegExp(E,"g");let T=l.SelectionService=class extends v.Disposable{constructor(N,R,I,O,$,W,Y,z,K){super(),this._element=N,this._screenElement=R,this._linkifier=I,this._bufferService=O,this._coreService=$,this._mouseService=W,this._optionsService=Y,this._renderService=z,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const N=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!N||!R||N[0]===R[0]&&N[1]===R[1])}get selectionText(){const N=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!N||!R)return"";const I=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(N[0]===R[0])return"";const $=N[0]<R[0]?N[0]:R[0],W=N[0]<R[0]?R[0]:N[0];for(let Y=N[1];Y<=R[1];Y++){const z=I.translateBufferLineToString(Y,!0,$,W);O.push(z)}}else{const $=N[1]===R[1]?R[0]:void 0;O.push(I.translateBufferLineToString(N[1],!0,N[0],$));for(let W=N[1]+1;W<=R[1]-1;W++){const Y=I.lines.get(W),z=I.translateBufferLineToString(W,!0);Y!=null&&Y.isWrapped?O[O.length-1]+=z:O.push(z)}if(N[1]!==R[1]){const W=I.lines.get(R[1]),Y=I.translateBufferLineToString(R[1],!0,0,R[0]);W&&W.isWrapped?O[O.length-1]+=Y:O.push(Y)}}return O.map(($=>$.replace(P," "))).join(b.isWindows?`\r
|
|
540
540
|
`:`
|
|
541
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&N&&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(N){const R=this._getMouseBufferCoords(N),I=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(I&&O&&R)&&this._areCoordsInSelection(R,I,O)}isCellInSelection(N,R){const I=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!I||!O)&&this._areCoordsInSelection([N,R],I,O)}_areCoordsInSelection(N,R,I){return N[1]>R[1]&&N[1]<I[1]||R[1]===I[1]&&N[1]===R[1]&&N[0]>=R[0]&&N[0]<I[0]||R[1]<I[1]&&N[1]===I[1]&&N[0]<I[0]||R[1]<I[1]&&N[1]===R[1]&&N[0]>=R[0]}_selectWordAtCursor(N,R){var $,W;const I=(W=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:W.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(N);return!!O&&(this._selectWordAt(O,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,R){this._model.clearSelection(),N=Math.max(N,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const R=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(N){let R=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=I?0:(R>I&&(R-=I),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(N){return b.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const R=this._getMouseBufferCoords(N);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(N){return N.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(N),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const O=I.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const N=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const R=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const O=(0,x.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,I=!(!N||!R||N[0]===R[0]&&N[1]===R[1]);I?N&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,R,I)):this._oldHasSelection&&this._fireOnSelectionChange(N,R,I)}_fireOnSelectionChange(N,R,I){this._oldSelectionStart=N,this._oldSelectionEnd=R,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(N,R){let I=R;for(let O=0;R>=O;O++){const $=N.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:$>1&&R!==O&&(I+=$-1)}return I}setSelection(N,R,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,R],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,R,I=!0,O=!0){if(N[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,W=$.lines.get(N[1]);if(!W)return;const Y=$.translateBufferLineToString(N[1],!1);let z=this._convertViewportColToCharacterIndex(W,N[0]),K=z;const G=N[0]-z;let U=0,L=0,M=0,B=0;if(Y.charAt(z)===" "){for(;z>0&&Y.charAt(z-1)===" ";)z--;for(;K<Y.length&&Y.charAt(K+1)===" ";)K++}else{let oe=N[0],fe=N[0];W.getWidth(oe)===0&&(U++,oe--),W.getWidth(fe)===2&&(L++,fe++);const me=W.getString(fe).length;for(me>1&&(B+=me-1,K+=me-1);oe>0&&z>0&&!this._isCharWordSeparator(W.loadCell(oe-1,this._workCell));){W.loadCell(oe-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,oe--):X>1&&(M+=X-1,z-=X-1),z--,oe--}for(;fe<W.length&&K+1<Y.length&&!this._isCharWordSeparator(W.loadCell(fe+1,this._workCell));){W.loadCell(fe+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,fe++):X>1&&(B+=X-1,K+=X-1),K++,fe++}}K++;let q=z+G-U+M,F=Math.min(this._bufferService.cols,K-z+U+L-M-B);if(R||Y.slice(z,K).trim()!==""){if(I&&q===0&&W.getCodePoint(0)!==32){const oe=$.lines.get(N[1]-1);if(oe&&W.isWrapped&&oe.getCodePoint(this._bufferService.cols-1)!==32){const fe=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(fe){const me=this._bufferService.cols-fe.start;q-=me,F+=me}}}if(O&&q+F===this._bufferService.cols&&W.getCodePoint(this._bufferService.cols-1)!==32){const oe=$.lines.get(N[1]+1);if(oe!=null&&oe.isWrapped&&oe.getCodePoint(0)!==32){const fe=this._getWordAt([0,N[1]+1],!1,!1,!0);fe&&(F+=fe.length)}}return{start:q,length:F}}}_selectWordAt(N,R){const I=this._getWordAt(N,R);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[I.start,N[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(N){const R=this._getWordAt(N,!0);if(R){let I=N[1];for(;R.start<0;)R.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,I]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const R=this._bufferService.buffer.getWrappedRangeForLine(N),I={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=T=f([m(3,j.IBufferService),m(4,j.ICoreService),m(5,k.IMouseService),m(6,j.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],T)},4725:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=c(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(d,l,c){var f=this&&this.__decorate||function(T,N,R,I){var O,$=arguments.length,W=$<3?N:I===null?I=Object.getOwnPropertyDescriptor(N,R):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(T,N,R,I);else for(var Y=T.length-1;Y>=0;Y--)(O=T[Y])&&(W=($<3?O(W):$>3?O(N,R,W):O(N,R))||W);return $>3&&W&&Object.defineProperty(N,R,W),W},m=this&&this.__param||function(T,N){return function(R,I){N(R,I,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),x=c(8055),w=c(8460),k=c(844),_=c(2585),v=x.css.toColor("#ffffff"),b=x.css.toColor("#000000"),g=x.css.toColor("#ffffff"),y=x.css.toColor("#000000"),j={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let R=0;R<216;R++){const I=N[R/36%6|0],O=N[R/6%6|0],$=N[R%6];T.push({css:x.channels.toCss(I,O,$),rgba:x.channels.toRgba(I,O,$)})}for(let R=0;R<24;R++){const I=8+10*R;T.push({css:x.channels.toCss(I,I,I),rgba:x.channels.toRgba(I,I,I)})}return T})());let E=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:g,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:j,selectionBackgroundOpaque:x.color.blend(b,j),selectionInactiveBackgroundTransparent:j,selectionInactiveBackgroundOpaque:x.color.blend(b,j),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const N=this._colors;if(N.foreground=P(T.foreground,v),N.background=P(T.background,b),N.cursor=P(T.cursor,g),N.cursorAccent=P(T.cursorAccent,y),N.selectionBackgroundTransparent=P(T.selectionBackground,j),N.selectionBackgroundOpaque=x.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=P(T.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=x.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=T.selectionForeground?P(T.selectionForeground,x.NULL_COLOR):void 0,N.selectionForeground===x.NULL_COLOR&&(N.selectionForeground=void 0),x.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=x.color.opacity(N.selectionBackgroundTransparent,.3)),x.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=x.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=l.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=P(T.black,l.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=P(T.red,l.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=P(T.green,l.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=P(T.yellow,l.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=P(T.blue,l.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=P(T.magenta,l.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=P(T.cyan,l.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=P(T.white,l.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=P(T.brightBlack,l.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=P(T.brightRed,l.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=P(T.brightGreen,l.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=P(T.brightYellow,l.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=P(T.brightBlue,l.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=P(T.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=P(T.brightCyan,l.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=P(T.brightWhite,l.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const R=Math.min(N.ansi.length-16,T.extendedAnsi.length);for(let I=0;I<R;I++)N.ansi[I+16]=P(T.extendedAnsi[I],l.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let N=0;N<this._restoreColors.ansi.length;++N)this._colors.ansi[N]=this._restoreColors.ansi[N]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function P(T,N){if(T!==void 0)try{return x.css.toColor(T)}catch{}return N}l.ThemeService=E=f([m(0,_.IOptionsService)],E)},6349:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=c(8460),m=c(844);class h extends m.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const k=new Array(w);for(let _=0;_<Math.min(w,this.length);_++)k[_]=this._array[this._getCyclicIndex(_)];this._array=k,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let k=this._length;k<w;k++)this._array[k]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,k){this._array[this._getCyclicIndex(w)]=k}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,k,..._){if(k){for(let v=w;v<this._length-k;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+k)];this._length-=k,this.onDeleteEmitter.fire({index:w,amount:k})}for(let v=this._length-1;v>=w;v--)this._array[this._getCyclicIndex(v+_.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<_.length;v++)this._array[this._getCyclicIndex(w+v)]=_[v];if(_.length&&this.onInsertEmitter.fire({index:w,amount:_.length}),this._length+_.length>this._maxLength){const v=this._length+_.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=_.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,k,_){if(!(k<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let b=k-1;b>=0;b--)this.set(w+b+_,this.get(w+b));const v=w+k+_-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<k;v++)this.set(w+v+_,this.get(w+v))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}l.CircularList=h},1439:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(f,m=5){if(typeof f!="object")return f;const h=Array.isArray(f)?[]:{};for(const x in f)h[x]=m<=1?f[x]:f[x]&&c(f[x],m-1);return h}},8055:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,f=0,m=0,h=0;var x,w,k,_,v;function b(y){const j=y.toString(16);return j.length<2?"0"+j:j}function g(y,j){return y<j?(j+.05)/(y+.05):(y+.05)/(j+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(j,E,P,T){return T!==void 0?`#${b(j)}${b(E)}${b(P)}${b(T)}`:`#${b(j)}${b(E)}${b(P)}`},y.toRgba=function(j,E,P,T=255){return(j<<24|E<<16|P<<8|T)>>>0},y.toColor=function(j,E,P,T){return{css:y.toCss(j,E,P,T),rgba:y.toRgba(j,E,P,T)}}})(x||(l.channels=x={})),(function(y){function j(E,P){return h=Math.round(255*P),[c,f,m]=v.toChannels(E.rgba),{css:x.toCss(c,f,m,h),rgba:x.toRgba(c,f,m,h)}}y.blend=function(E,P){if(h=(255&P.rgba)/255,h===1)return{css:P.css,rgba:P.rgba};const T=P.rgba>>24&255,N=P.rgba>>16&255,R=P.rgba>>8&255,I=E.rgba>>24&255,O=E.rgba>>16&255,$=E.rgba>>8&255;return c=I+Math.round((T-I)*h),f=O+Math.round((N-O)*h),m=$+Math.round((R-$)*h),{css:x.toCss(c,f,m),rgba:x.toRgba(c,f,m)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,P,T){const N=v.ensureContrastRatio(E.rgba,P.rgba,T);if(N)return x.toColor(N>>24&255,N>>16&255,N>>8&255)},y.opaque=function(E){const P=(255|E.rgba)>>>0;return[c,f,m]=v.toChannels(P),{css:x.toCss(c,f,m),rgba:P}},y.opacity=j,y.multiplyOpacity=function(E,P){return h=255&E.rgba,j(E,h*P/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(w||(l.color=w={})),(function(y){let j,E;try{const P=document.createElement("canvas");P.width=1,P.height=1;const T=P.getContext("2d",{willReadFrequently:!0});T&&(j=T,j.globalCompositeOperation="copy",E=j.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(P){if(P.match(/#[\da-f]{3,8}/i))switch(P.length){case 4:return c=parseInt(P.slice(1,2).repeat(2),16),f=parseInt(P.slice(2,3).repeat(2),16),m=parseInt(P.slice(3,4).repeat(2),16),x.toColor(c,f,m);case 5:return c=parseInt(P.slice(1,2).repeat(2),16),f=parseInt(P.slice(2,3).repeat(2),16),m=parseInt(P.slice(3,4).repeat(2),16),h=parseInt(P.slice(4,5).repeat(2),16),x.toColor(c,f,m,h);case 7:return{css:P,rgba:(parseInt(P.slice(1),16)<<8|255)>>>0};case 9:return{css:P,rgba:parseInt(P.slice(1),16)>>>0}}const T=P.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),f=parseInt(T[2]),m=parseInt(T[3]),h=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),x.toColor(c,f,m,h);if(!j||!E)throw new Error("css.toColor: Unsupported css format");if(j.fillStyle=E,j.fillStyle=P,typeof j.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(j.fillRect(0,0,1,1),[c,f,m,h]=j.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(c,f,m,h),css:P}}})(k||(l.css=k={})),(function(y){function j(E,P,T){const N=E/255,R=P/255,I=T/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(E){return j(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=j})(_||(l.rgb=_={})),(function(y){function j(P,T,N){const R=P>>24&255,I=P>>16&255,O=P>>8&255;let $=T>>24&255,W=T>>16&255,Y=T>>8&255,z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));for(;z<N&&($>0||W>0||Y>0);)$-=Math.max(0,Math.ceil(.1*$)),W-=Math.max(0,Math.ceil(.1*W)),Y-=Math.max(0,Math.ceil(.1*Y)),z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));return($<<24|W<<16|Y<<8|255)>>>0}function E(P,T,N){const R=P>>24&255,I=P>>16&255,O=P>>8&255;let $=T>>24&255,W=T>>16&255,Y=T>>8&255,z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));for(;z<N&&($<255||W<255||Y<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));return($<<24|W<<16|Y<<8|255)>>>0}y.blend=function(P,T){if(h=(255&T)/255,h===1)return T;const N=T>>24&255,R=T>>16&255,I=T>>8&255,O=P>>24&255,$=P>>16&255,W=P>>8&255;return c=O+Math.round((N-O)*h),f=$+Math.round((R-$)*h),m=W+Math.round((I-W)*h),x.toRgba(c,f,m)},y.ensureContrastRatio=function(P,T,N){const R=_.relativeLuminance(P>>8),I=_.relativeLuminance(T>>8);if(g(R,I)<N){if(I<R){const W=j(P,T,N),Y=g(R,_.relativeLuminance(W>>8));if(Y<N){const z=E(P,T,N);return Y>g(R,_.relativeLuminance(z>>8))?W:z}return W}const O=E(P,T,N),$=g(R,_.relativeLuminance(O>>8));if($<N){const W=j(P,T,N);return $>g(R,_.relativeLuminance(W>>8))?O:W}return O}},y.reduceLuminance=j,y.increaseLuminance=E,y.toChannels=function(P){return[P>>24&255,P>>16&255,P>>8&255,255&P]}})(v||(l.rgba=v={})),l.toPaddedHex=b,l.contrastRatio=g},8969:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=c(844),m=c(2585),h=c(4348),x=c(7866),w=c(744),k=c(7302),_=c(6975),v=c(8460),b=c(1753),g=c(1480),y=c(7994),j=c(9282),E=c(5435),P=c(5981),T=c(2660);let N=!1;class R extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((O=>{var $;($=this._onScrollApi)==null||$.fire(O.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(O){for(const $ in O)this.optionsService.options[$]=O[$]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new k.OptionsService(O)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(x.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new P.WriteBuffer((($,W)=>this._inputHandler.parse($,W)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,$){this._writeBuffer.write(O,$)}writeSync(O,$){this._logService.logLevel<=m.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync(O,$)}input(O,$=!0){this.coreService.triggerDataEvent(O,$)}resize(O,$){isNaN(O)||isNaN($)||(O=Math.max(O,w.MINIMUM_COLS),$=Math.max($,w.MINIMUM_ROWS),this._bufferService.resize(O,$))}scroll(O,$=!1){this._bufferService.scroll(O,$)}scrollLines(O,$,W){this._bufferService.scrollLines(O,$,W)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const $=O-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(O,$){return this._inputHandler.registerEscHandler(O,$)}registerDcsHandler(O,$){return this._inputHandler.registerDcsHandler(O,$)}registerCsiHandler(O,$){return this._inputHandler.registerCsiHandler(O,$)}registerOscHandler(O,$){return this._inputHandler.registerOscHandler(O,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?O=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(j.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},(()=>((0,j.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const $ of O)$.dispose()}))}}}l.CoreTerminal=R},8460:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,f){return c((m=>f.fire(m)))},l.runAndSubscribe=function(c,f){return f(void 0),c((m=>f(m)))}},5435:function(d,l,c){var f=this&&this.__decorate||function(U,L,M,B){var q,F=arguments.length,oe=F<3?L:B===null?B=Object.getOwnPropertyDescriptor(L,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")oe=Reflect.decorate(U,L,M,B);else for(var fe=U.length-1;fe>=0;fe--)(q=U[fe])&&(oe=(F<3?q(oe):F>3?q(L,M,oe):q(L,M))||oe);return F>3&&oe&&Object.defineProperty(L,M,oe),oe},m=this&&this.__param||function(U,L){return function(M,B){L(M,B,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=c(2584),x=c(7116),w=c(2015),k=c(844),_=c(482),v=c(8437),b=c(8460),g=c(643),y=c(511),j=c(3734),E=c(2585),P=c(1480),T=c(6242),N=c(6351),R=c(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function $(U,L){if(U>24)return L.setWinLines||!1;switch(U){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var W;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(W||(l.WindowsOptionsReportType=W={}));let Y=0;class z extends k.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,B,q,F,oe,fe,me,X=new w.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=B,this._logService=q,this._optionsService=F,this._oscLinkService=oe,this._coreMouseService=fe,this._unicodeService=me,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ae.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ae,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ae,data:ne})})),this._parser.setDcsHandlerFallback(((H,ae,ne)=>{ae==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ae,payload:ne})})),this._parser.setPrintHandler(((H,ae,ne)=>this.print(H,ae,ne))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new T.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new T.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new T.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new T.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new T.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new T.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new T.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new T.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new T.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new T.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((H,ae)=>this.requestStatusString(H,ae))))}_preserveStack(L,M,B,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=B,this._parseStack.position=q}_logSlowResolvingAsync(L){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let B,q=this._activeBuffer.x,F=this._activeBuffer.y,oe=0;const fe=this._parseStack.paused;if(fe){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(B),B;q=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>O&&(oe=this._parseStack.position+O)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(H=>String.fromCharCode(H))).join("")}"`),typeof L=="string"?L.split("").map((H=>H.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(L.length,O))),fe||this._dirtyRowTracker.clearRange(),L.length>O)for(let H=oe;H<L.length;H+=O){const ae=H+O<L.length?H+O:L.length,ne=typeof L=="string"?this._stringDecoder.decode(L.substring(H,ae),this._parseBuffer):this._utf8Decoder.decode(L.subarray(H,ae),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(q,F,ne,H),this._logSlowResolvingAsync(B),B}else if(!fe){const H=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,H))return this._preserveStack(q,F,H,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===q&&this._activeBuffer.y===F||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(L,M,B){let q,F;const oe=this._charsetService.charset,fe=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,ae=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-M>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let J=this._parser.precedingJoinState;for(let ie=M;ie<B;++ie){if(q=L[ie],q<127&&oe){const re=oe[String.fromCharCode(q)];re&&(q=re.charCodeAt(0))}const ye=this._unicodeService.charProperties(q,J);F=P.UnicodeService.extractWidth(ye);const Oe=P.UnicodeService.extractShouldJoin(ye),Ve=Oe?P.UnicodeService.extractWidth(J):0;if(J=ye,fe&&this._onA11yChar.fire((0,_.stringFromCodePoint)(q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-Ve>me){if(X){const re=ne;let de=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&ne instanceof v.BufferLine&&ne.copyCellsFrom(re,de,0,Ve,!1);de<me;)re.setCellFromCodepoint(de++,0,1,ae)}else if(this._activeBuffer.x=me-1,F===2)continue}if(Oe&&this._activeBuffer.x){const re=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-re,q,F);for(let de=F-Ve;--de>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(H&&(ne.insertCells(this._activeBuffer.x,F-Ve,this._activeBuffer.getNullCell(ae)),ne.getWidth(me-1)===2&&ne.setCellFromCodepoint(me-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ae)),ne.setCellFromCodepoint(this._activeBuffer.x++,q,F,ae),F>0)for(;--F;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=J,this._activeBuffer.x<me&&B-M>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(B=>!$(B.params[0],this._optionsService.rawOptions.windowOptions)||M(B)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new N.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new T.OscHandler(M))}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 L;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&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,B,q=!1,F=!1){const oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);oe.replaceCells(M,B,this._activeBuffer.getNullCell(this._eraseAttrData()),F),q&&(oe.isWrapped=!1)}_resetBufferLine(L,M=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),B.isWrapped=!1)}eraseInDisplay(L,M=!1){let B;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);B<this._bufferService.rows;B++)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-q+1;for(;M--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let q;for(q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-q;M--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let M=L.params[0]||1;for(;M--;)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(L){let M=L.params[0]||1;for(;M--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const M=this._parser.precedingJoinState;if(!M)return!0;const B=L.params[0]||1,q=P.UnicodeService.extractWidth(M),F=this._activeBuffer.x-q,oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),fe=new Uint32Array(oe.length*B);let me=0;for(let H=0;H<oe.length;){const ae=oe.codePointAt(H)||0;fe[me++]=ae,H+=ae>65535?2:1}let X=me;for(let H=1;H<B;++H)fe.copyWithin(X,0,me),X+=me;return this.print(fe,0,X),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,M){const B=this._coreService.decPrivateModes,{activeProtocol:q,activeEncoding:F}=this._coreMouseService,oe=this._coreService,{buffers:fe,cols:me}=this._bufferService,{active:X,alt:H}=fe,ae=this._optionsService.rawOptions,ne=Oe=>Oe?1:2,J=L.params[0];return ie=J,ye=M?J===2?4:J===4?ne(oe.modes.insertMode):J===12?3:J===20?ne(ae.convertEol):0:J===1?ne(B.applicationCursorKeys):J===3?ae.windowOptions.setWinLines?me===80?2:me===132?1:0:0:J===6?ne(B.origin):J===7?ne(B.wraparound):J===8?3:J===9?ne(q==="X10"):J===12?ne(ae.cursorBlink):J===25?ne(!oe.isCursorHidden):J===45?ne(B.reverseWraparound):J===66?ne(B.applicationKeypad):J===67?4:J===1e3?ne(q==="VT200"):J===1002?ne(q==="DRAG"):J===1003?ne(q==="ANY"):J===1004?ne(B.sendFocus):J===1005?4:J===1006?ne(F==="SGR"):J===1015?4:J===1016?ne(F==="SGR_PIXELS"):J===1048?1:J===47||J===1047||J===1049?ne(X===H):J===2004?ne(B.bracketedPasteMode):0,oe.triggerDataEvent(`${h.C0.ESC}[${M?"":"?"}${ie};${ye}$y`),!0;var ie,ye}_updateAttrColor(L,M,B,q,F){return M===2?(L|=50331648,L&=-16777216,L|=j.AttributeData.fromColorRGB([B,q,F])):M===5&&(L&=-50331904,L|=33554432|255&B),L}_extractColor(L,M,B){const q=[0,0,-1,0,0,0];let F=0,oe=0;do{if(q[oe+F]=L.params[M+oe],L.hasSubParams(M+oe)){const fe=L.getSubParams(M+oe);let me=0;do q[1]===5&&(F=1),q[oe+me+1+F]=fe[me];while(++me<fe.length&&me+oe+1+F<q.length);break}if(q[1]===5&&oe+F>=2||q[1]===2&&oe+F>=5)break;q[1]&&(F=1)}while(++oe+M<L.length&&oe+F<q.length);for(let fe=2;fe<q.length;++fe)q[fe]===-1&&(q[fe]=0);switch(q[0]){case 38:B.fg=this._updateAttrColor(B.fg,q[1],q[3],q[4],q[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,q[1],q[3],q[4],q[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,q[1],q[3],q[4],q[5])}return oe}_processUnderline(L,M){M.extended=M.extended.clone(),(!~L||L>5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=v.DEFAULT_ATTR_DATA.fg,L.bg=v.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let B;const q=this._curAttrData;for(let F=0;F<M;F++)B=L.params[F],B>=30&&B<=37?(q.fg&=-50331904,q.fg|=16777216|B-30):B>=40&&B<=47?(q.bg&=-50331904,q.bg|=16777216|B-40):B>=90&&B<=97?(q.fg&=-50331904,q.fg|=16777224|B-90):B>=100&&B<=107?(q.bg&=-50331904,q.bg|=16777224|B-100):B===0?this._processSGR0(q):B===1?q.fg|=134217728:B===3?q.bg|=67108864:B===4?(q.fg|=268435456,this._processUnderline(L.hasSubParams(F)?L.getSubParams(F)[0]:1,q)):B===5?q.fg|=536870912:B===7?q.fg|=67108864:B===8?q.fg|=1073741824:B===9?q.fg|=2147483648:B===2?q.bg|=134217728:B===21?this._processUnderline(2,q):B===22?(q.fg&=-134217729,q.bg&=-134217729):B===23?q.bg&=-67108865:B===24?(q.fg&=-268435457,this._processUnderline(0,q)):B===25?q.fg&=-536870913:B===27?q.fg&=-67108865:B===28?q.fg&=-1073741825:B===29?q.fg&=2147483647:B===39?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):B===49?(q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?F+=this._extractColor(L,F,q):B===53?q.bg|=1073741824:B===55?q.bg&=-1073741825:B===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):B===100?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${M};${B}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${M};${B}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=M%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(L){const M=L.params[0]||1;let B;return(L.length<2||(B=L.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(L){if(!$(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(W.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(W.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],B=L.split(";");for(;B.length>1;){const q=B.shift(),F=B.shift();if(/^\d+$/.exec(q)){const oe=parseInt(q);if(G(oe))if(F==="?")M.push({type:0,index:oe});else{const fe=(0,R.parseColor)(F);fe&&M.push({type:1,index:oe,color:fe})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const B=L.split(":");let q;const F=B.findIndex((oe=>oe.startsWith("id=")));return F!==-1&&(q=B[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const B=L.split(";");for(let q=0;q<B.length&&!(M>=this._specialColors.length);++q,++M)if(B[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const F=(0,R.parseColor)(B[q]);F&&this._onColor.fire([{type:1,index:this._specialColors[M],color:F}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],B=L.split(";");for(let q=0;q<B.length;++q)if(/^\d+$/.exec(B[q])){const F=parseInt(B[q]);G(F)&&M.push({type:2,index:F})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,x.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(I[L[0]],x.CHARSETS[L[1]]||x.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new y.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const B=this._activeBuffer.ybase+this._activeBuffer.y+M,q=this._activeBuffer.lines.get(B);q&&(q.fill(L),q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,M){const B=this._bufferService.buffer,q=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${F}${h.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}l.InputHandler=z;let K=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,L){U>L&&(Y=U,U=L,L=Y),U<this.start&&(this.start=U),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<256}K=f([m(0,E.IBufferService)],K)},844:(d,l)=>{function c(f){for(const m of f)m.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const m=this._disposables.indexOf(f);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var m;this._isDisposed||f===this._value||((m=this._value)==null||m.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=c,l.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,h,x){this._data[m]||(this._data[m]={}),this._data[m][h]=x}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(f,m,h,x,w){this._data.get(f,m)||this._data.set(f,m,new c),this._data.get(f,m).set(h,x,w)}get(f,m,h,x){var w;return(w=this._data.get(f,m))==null?void 0:w.get(h,x)}clear(){this._data.clear()}}},6114:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const m=this._getKey(f);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,m){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let m=0,h=this._array.length-1;for(;h>=m;){let x=m+h>>1;const w=this._getKey(this._array[x]);if(w>f)h=x-1;else{if(!(w<f)){for(;x>0&&this._getKey(this._array[x-1])===f;)x--;return x}m=x+1}}return m}}},7226:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let k=0,_=0,v=w.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),_=Math.max(k,_),b=w.timeRemaining(),1.5*_>b)return v-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-k))}ms`),void this._start();v=b}this.clear()}}class h extends m{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const k=Date.now()+w;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=c(643);l.updateWindowsModeWrappedState=function(m){const h=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),x=h==null?void 0:h.get(m.cols-1),w=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);w&&x&&(w.isWrapped=x[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&x[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,x=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=x}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=c(6349),m=c(7226),h=c(3734),x=c(8437),w=c(4634),k=c(511),_=c(643),v=c(4863),b=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(g,y,j){this._hasScrollback=g,this._optionsService=y,this._bufferService=j,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,y){return new x.BufferLine(this._bufferService.cols,this.getNullCell(g),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const y=g+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=x.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,y){const j=this.getNullCell(x.DEFAULT_ATTR_DATA);let E=0;const P=this._getCorrectBufferLength(y);if(P>this.lines.maxLength&&(this.lines.maxLength=P),this.lines.length>0){if(this._cols<g)for(let N=0;N<this.lines.length;N++)E+=+this.lines.get(N).resize(g,j);let T=0;if(this._rows<y)for(let N=this._rows;N<y;N++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new x.BufferLine(g,j)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(g,j)));else for(let N=this._rows;N>y;N--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(P<this.lines.maxLength){const N=this.lines.length-P;N>0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=P}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(g,y),this._cols>g))for(let T=0;T<this.lines.length;T++)E+=+this.lines.get(T).resize(g,j);this._cols=g,this._rows=y,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,y){this._cols!==g&&(g>this._cols?this._reflowLarger(g,y):this._reflowSmaller(g,y))}_reflowLarger(g,y){const j=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(j.length>0){const E=(0,w.reflowLargerCreateNewLayout)(this.lines,j);(0,w.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(g,y,E.countRemoved)}}_reflowLargerAdjustViewport(g,y,j){const E=this.getNullCell(x.DEFAULT_ATTR_DATA);let P=j;for(;P-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new x.BufferLine(g,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-j,0)}_reflowSmaller(g,y){const j=this.getNullCell(x.DEFAULT_ATTR_DATA),E=[];let P=0;for(let T=this.lines.length-1;T>=0;T--){let N=this.lines.get(T);if(!N||!N.isWrapped&&N.getTrimmedLength()<=g)continue;const R=[N];for(;N.isWrapped&&T>0;)N=this.lines.get(--T),R.unshift(N);const I=this.ybase+this.y;if(I>=T&&I<T+R.length)continue;const O=R[R.length-1].getTrimmedLength(),$=(0,w.reflowSmallerGetNewLineLengths)(R,this._cols,g),W=$.length-R.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+W):Math.max(0,this.lines.length-this.lines.maxLength+W);const z=[];for(let B=0;B<W;B++){const q=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);z.push(q)}z.length>0&&(E.push({start:T+R.length+P,newLines:z}),P+=z.length),R.push(...z);let K=$.length-1,G=$[K];G===0&&(K--,G=$[K]);let U=R.length-W-1,L=O;for(;U>=0;){const B=Math.min(L,G);if(R[K]===void 0)break;if(R[K].copyCellsFrom(R[U],L-B,G-B,B,!0),G-=B,G===0&&(K--,G=$[K]),L-=B,L===0){U--;const q=Math.max(U,0);L=(0,w.getWrappedLineTrimmedLength)(R,q,this._cols)}}for(let B=0;B<R.length;B++)$[B]<g&&R[B].setCell($[B],j);let M=W-Y;for(;M-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+P)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+W,this.ybase+y-1)}if(E.length>0){const T=[],N=[];for(let K=0;K<this.lines.length;K++)N.push(this.lines.get(K));const R=this.lines.length;let I=R-1,O=0,$=E[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+P);let W=0;for(let K=Math.min(this.lines.maxLength-1,R+P-1);K>=0;K--)if($&&$.start>I+W){for(let G=$.newLines.length-1;G>=0;G--)this.lines.set(K--,$.newLines[G]);K++,T.push({index:I+1,amount:$.newLines.length}),W+=$.newLines.length,$=E[++O]}else this.lines.set(K,N[I--]);let Y=0;for(let K=T.length-1;K>=0;K--)T[K].index+=Y,this.lines.onInsertEmitter.fire(T[K]),Y+=T[K].amount;const z=Math.max(0,R+P-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(g,y,j=0,E){const P=this.lines.get(g);return P?P.translateToString(y,j,E):""}getWrappedRangeForLine(g){let y=g,j=g;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;j+1<this.lines.length&&this.lines.get(j+1).isWrapped;)j++;return{first:y,last:j}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===g&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const y=new v.Marker(g);return this.markers.push(y),y.register(this.lines.onTrim((j=>{y.line-=j,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((j=>{y.line>=j.index&&(y.line+=j.amount)}))),y.register(this.lines.onDelete((j=>{y.line>=j.index&&y.line<j.index+j.amount&&y.dispose(),y.line>j.index&&(y.line-=j.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=c(3734),m=c(511),h=c(643),x=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let w=0;class k{constructor(v,b,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let j=0;j<v;++j)this.setCell(j,y);this.length=v}get(v){const b=this._data[3*v+0],g=2097151&b;return[this._data[3*v+1],2097152&b?this._combined[v]:g?(0,x.stringFromCodePoint)(g):"",b>>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):g]}set(v,b){this._data[3*v+1]=b[h.CHAR_DATA_ATTR_INDEX],b[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,x.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return w=3*v,b.content=this._data[w+0],b.fg=this._data[w+1],b.bg=this._data[w+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,g,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|g<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,g){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,x.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,x.stringFromCodePoint)(2097151&y)+(0,x.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,g&&(y&=-12582913,y|=g<<22),this._data[3*v+0]=y}insertCells(v,b,g){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),b<this.length-v){const y=new m.CellData;for(let j=this.length-v-b-1;j>=0;--j)this.setCell(v+b+j,this.loadCell(v+j,y));for(let j=0;j<b;++j)this.setCell(v+j,g)}else for(let y=v;y<this.length;++y)this.setCell(y,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(v,b,g){if(v%=this.length,b<this.length-v){const y=new m.CellData;for(let j=0;j<this.length-v-b;++j)this.setCell(v+j,this.loadCell(v+b+j,y));for(let j=this.length-b;j<this.length;++j)this.setCell(j,g)}else for(let y=v;y<this.length;++y)this.setCell(y,g);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,g)}replaceCells(v,b,g,y=!1){if(y)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,g),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,g);v<b&&v<this.length;)this.isProtected(v)||this.setCell(v,g),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,g);v<b&&v<this.length;)this.setCell(v++,g)}resize(v,b){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const y=new Uint32Array(g);y.set(this._data),this._data=y}for(let y=this.length;y<v;++y)this.setCell(y,b)}else{this._data=this._data.subarray(0,g);const y=Object.keys(this._combined);for(let E=0;E<y.length;E++){const P=parseInt(y[E],10);P>=v&&delete this._combined[P]}const j=Object.keys(this._extendedAttrs);for(let E=0;E<j.length;E++){const P=parseInt(j[E],10);P>=v&&delete this._extendedAttrs[P]}}return this.length=v,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,b=!1){if(b)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,v);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const b in v._combined)this._combined[b]=v._combined[b];this._extendedAttrs={};for(const b in v._extendedAttrs)this._extendedAttrs[b]=v._extendedAttrs[b];this.isWrapped=v.isWrapped}clone(){const v=new k(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const b in this._combined)v._combined[b]=this._combined[b];for(const b in this._extendedAttrs)v._extendedAttrs[b]=this._extendedAttrs[b];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,g,y,j){const E=v._data;if(j)for(let T=y-1;T>=0;T--){for(let N=0;N<3;N++)this._data[3*(g+T)+N]=E[3*(b+T)+N];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[g+T]=v._extendedAttrs[b+T])}else for(let T=0;T<y;T++){for(let N=0;N<3;N++)this._data[3*(g+T)+N]=E[3*(b+T)+N];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[g+T]=v._extendedAttrs[b+T])}const P=Object.keys(v._combined);for(let T=0;T<P.length;T++){const N=parseInt(P[T],10);N>=b&&(this._combined[N-b+g]=v._combined[N])}}translateToString(v,b,g,y){b=b??0,g=g??this.length,v&&(g=Math.min(g,this.getTrimmedLength())),y&&(y.length=0);let j="";for(;b<g;){const E=this._data[3*b+0],P=2097151&E,T=2097152&E?this._combined[b]:P?(0,x.stringFromCodePoint)(P):h.WHITESPACE_CELL_CHAR;if(j+=T,y)for(let N=0;N<T.length;++N)y.push(b);b+=E>>22||1}return y&&y.push(b),j}}l.BufferLine=k},4841:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(d,l)=>{function c(f,m,h){if(m===f.length-1)return f[m].getTrimmedLength();const x=!f[m].hasContent(h-1)&&f[m].getWidth(h-1)===1,w=f[m+1].getWidth(0)===2;return x&&w?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,m,h,x,w){const k=[];for(let _=0;_<f.length-1;_++){let v=_,b=f.get(++v);if(!b.isWrapped)continue;const g=[f.get(_)];for(;v<f.length&&b.isWrapped;)g.push(b),b=f.get(++v);if(x>=_&&x<v){_+=g.length-1;continue}let y=0,j=c(g,y,m),E=1,P=0;for(;E<g.length;){const N=c(g,E,m),R=N-P,I=h-j,O=Math.min(R,I);g[y].copyCellsFrom(g[E],P,j,O,!1),j+=O,j===h&&(y++,j=0),P+=O,P===N&&(E++,P=0),j===0&&y!==0&&g[y-1].getWidth(h-1)===2&&(g[y].copyCellsFrom(g[y-1],h-1,j++,1,!1),g[y-1].setCell(h-1,w))}g[y].replaceCells(j,h,w);let T=0;for(let N=g.length-1;N>0&&(N>y||g[N].getTrimmedLength()===0);N--)T++;T>0&&(k.push(_+g.length-T),k.push(T)),_+=g.length-1}return k},l.reflowLargerCreateNewLayout=function(f,m){const h=[];let x=0,w=m[x],k=0;for(let _=0;_<f.length;_++)if(w===_){const v=m[++x];f.onDeleteEmitter.fire({index:_-k,amount:v}),_+=v-1,k+=v,w=m[++x]}else h.push(_);return{layout:h,countRemoved:k}},l.reflowLargerApplyNewLayout=function(f,m){const h=[];for(let x=0;x<m.length;x++)h.push(f.get(m[x]));for(let x=0;x<h.length;x++)f.set(x,h[x]);f.length=m.length},l.reflowSmallerGetNewLineLengths=function(f,m,h){const x=[],w=f.map(((b,g)=>c(f,g,m))).reduce(((b,g)=>b+g));let k=0,_=0,v=0;for(;v<w;){if(w-v<h){x.push(w-v);break}k+=h;const b=c(f,_,m);k>b&&(k-=b,_++);const g=f[_].getWidth(k-1)===2;g&&k--;const y=g?h-1:h;x.push(y),v+=y}return x},l.getWrappedLineTrimmedLength=c},5295:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=c(8460),m=c(844),h=c(9092);class x extends m.Disposable{constructor(k,_){super(),this._optionsService=k,this._bufferService=_,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,_){this._normal.resize(k,_),this._alt.resize(k,_),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=x},511:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=c(482),m=c(643),h=c(3734);class x extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const _=new x;return _.setFromCharData(k),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const v=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=x},643:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=c(8460),m=c(844);class h{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}l.Marker=h,h._nextId=1},7116:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,l)=>{var c,f,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
541
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&N&&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(N){const R=this._getMouseBufferCoords(N),I=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(I&&O&&R)&&this._areCoordsInSelection(R,I,O)}isCellInSelection(N,R){const I=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!I||!O)&&this._areCoordsInSelection([N,R],I,O)}_areCoordsInSelection(N,R,I){return N[1]>R[1]&&N[1]<I[1]||R[1]===I[1]&&N[1]===R[1]&&N[0]>=R[0]&&N[0]<I[0]||R[1]<I[1]&&N[1]===I[1]&&N[0]<I[0]||R[1]<I[1]&&N[1]===R[1]&&N[0]>=R[0]}_selectWordAtCursor(N,R){var $,W;const I=(W=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:W.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(N);return!!O&&(this._selectWordAt(O,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,R){this._model.clearSelection(),N=Math.max(N,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const R=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(N){let R=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=I?0:(R>I&&(R-=I),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(N){return b.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const R=this._getMouseBufferCoords(N);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(N){return N.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(N),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const O=I.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const N=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const R=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const O=(0,x.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,I=!(!N||!R||N[0]===R[0]&&N[1]===R[1]);I?N&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,R,I)):this._oldHasSelection&&this._fireOnSelectionChange(N,R,I)}_fireOnSelectionChange(N,R,I){this._oldSelectionStart=N,this._oldSelectionEnd=R,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(N,R){let I=R;for(let O=0;R>=O;O++){const $=N.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:$>1&&R!==O&&(I+=$-1)}return I}setSelection(N,R,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,R],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,R,I=!0,O=!0){if(N[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,W=$.lines.get(N[1]);if(!W)return;const Y=$.translateBufferLineToString(N[1],!1);let z=this._convertViewportColToCharacterIndex(W,N[0]),K=z;const G=N[0]-z;let U=0,L=0,M=0,B=0;if(Y.charAt(z)===" "){for(;z>0&&Y.charAt(z-1)===" ";)z--;for(;K<Y.length&&Y.charAt(K+1)===" ";)K++}else{let oe=N[0],fe=N[0];W.getWidth(oe)===0&&(U++,oe--),W.getWidth(fe)===2&&(L++,fe++);const me=W.getString(fe).length;for(me>1&&(B+=me-1,K+=me-1);oe>0&&z>0&&!this._isCharWordSeparator(W.loadCell(oe-1,this._workCell));){W.loadCell(oe-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,oe--):X>1&&(M+=X-1,z-=X-1),z--,oe--}for(;fe<W.length&&K+1<Y.length&&!this._isCharWordSeparator(W.loadCell(fe+1,this._workCell));){W.loadCell(fe+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,fe++):X>1&&(B+=X-1,K+=X-1),K++,fe++}}K++;let q=z+G-U+M,F=Math.min(this._bufferService.cols,K-z+U+L-M-B);if(R||Y.slice(z,K).trim()!==""){if(I&&q===0&&W.getCodePoint(0)!==32){const oe=$.lines.get(N[1]-1);if(oe&&W.isWrapped&&oe.getCodePoint(this._bufferService.cols-1)!==32){const fe=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(fe){const me=this._bufferService.cols-fe.start;q-=me,F+=me}}}if(O&&q+F===this._bufferService.cols&&W.getCodePoint(this._bufferService.cols-1)!==32){const oe=$.lines.get(N[1]+1);if(oe!=null&&oe.isWrapped&&oe.getCodePoint(0)!==32){const fe=this._getWordAt([0,N[1]+1],!1,!1,!0);fe&&(F+=fe.length)}}return{start:q,length:F}}}_selectWordAt(N,R){const I=this._getWordAt(N,R);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[I.start,N[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(N){const R=this._getWordAt(N,!0);if(R){let I=N[1];for(;R.start<0;)R.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,I]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const R=this._bufferService.buffer.getWrappedRangeForLine(N),I={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=T=f([m(3,j.IBufferService),m(4,j.ICoreService),m(5,k.IMouseService),m(6,j.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],T)},4725:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=c(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(d,l,c){var f=this&&this.__decorate||function(T,N,R,I){var O,$=arguments.length,W=$<3?N:I===null?I=Object.getOwnPropertyDescriptor(N,R):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(T,N,R,I);else for(var Y=T.length-1;Y>=0;Y--)(O=T[Y])&&(W=($<3?O(W):$>3?O(N,R,W):O(N,R))||W);return $>3&&W&&Object.defineProperty(N,R,W),W},m=this&&this.__param||function(T,N){return function(R,I){N(R,I,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),x=c(8055),w=c(8460),k=c(844),_=c(2585),v=x.css.toColor("#ffffff"),b=x.css.toColor("#000000"),g=x.css.toColor("#ffffff"),y=x.css.toColor("#000000"),j={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let R=0;R<216;R++){const I=N[R/36%6|0],O=N[R/6%6|0],$=N[R%6];T.push({css:x.channels.toCss(I,O,$),rgba:x.channels.toRgba(I,O,$)})}for(let R=0;R<24;R++){const I=8+10*R;T.push({css:x.channels.toCss(I,I,I),rgba:x.channels.toRgba(I,I,I)})}return T})());let E=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:g,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:j,selectionBackgroundOpaque:x.color.blend(b,j),selectionInactiveBackgroundTransparent:j,selectionInactiveBackgroundOpaque:x.color.blend(b,j),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const N=this._colors;if(N.foreground=P(T.foreground,v),N.background=P(T.background,b),N.cursor=P(T.cursor,g),N.cursorAccent=P(T.cursorAccent,y),N.selectionBackgroundTransparent=P(T.selectionBackground,j),N.selectionBackgroundOpaque=x.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=P(T.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=x.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=T.selectionForeground?P(T.selectionForeground,x.NULL_COLOR):void 0,N.selectionForeground===x.NULL_COLOR&&(N.selectionForeground=void 0),x.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=x.color.opacity(N.selectionBackgroundTransparent,.3)),x.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=x.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=l.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=P(T.black,l.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=P(T.red,l.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=P(T.green,l.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=P(T.yellow,l.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=P(T.blue,l.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=P(T.magenta,l.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=P(T.cyan,l.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=P(T.white,l.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=P(T.brightBlack,l.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=P(T.brightRed,l.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=P(T.brightGreen,l.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=P(T.brightYellow,l.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=P(T.brightBlue,l.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=P(T.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=P(T.brightCyan,l.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=P(T.brightWhite,l.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const R=Math.min(N.ansi.length-16,T.extendedAnsi.length);for(let I=0;I<R;I++)N.ansi[I+16]=P(T.extendedAnsi[I],l.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let N=0;N<this._restoreColors.ansi.length;++N)this._colors.ansi[N]=this._restoreColors.ansi[N]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function P(T,N){if(T!==void 0)try{return x.css.toColor(T)}catch{}return N}l.ThemeService=E=f([m(0,_.IOptionsService)],E)},6349:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=c(8460),m=c(844);class h extends m.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const k=new Array(w);for(let _=0;_<Math.min(w,this.length);_++)k[_]=this._array[this._getCyclicIndex(_)];this._array=k,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let k=this._length;k<w;k++)this._array[k]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,k){this._array[this._getCyclicIndex(w)]=k}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,k,..._){if(k){for(let v=w;v<this._length-k;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+k)];this._length-=k,this.onDeleteEmitter.fire({index:w,amount:k})}for(let v=this._length-1;v>=w;v--)this._array[this._getCyclicIndex(v+_.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<_.length;v++)this._array[this._getCyclicIndex(w+v)]=_[v];if(_.length&&this.onInsertEmitter.fire({index:w,amount:_.length}),this._length+_.length>this._maxLength){const v=this._length+_.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=_.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,k,_){if(!(k<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let b=k-1;b>=0;b--)this.set(w+b+_,this.get(w+b));const v=w+k+_-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<k;v++)this.set(w+v+_,this.get(w+v))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}l.CircularList=h},1439:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(f,m=5){if(typeof f!="object")return f;const h=Array.isArray(f)?[]:{};for(const x in f)h[x]=m<=1?f[x]:f[x]&&c(f[x],m-1);return h}},8055:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,f=0,m=0,h=0;var x,w,k,_,v;function b(y){const j=y.toString(16);return j.length<2?"0"+j:j}function g(y,j){return y<j?(j+.05)/(y+.05):(y+.05)/(j+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(j,E,P,T){return T!==void 0?`#${b(j)}${b(E)}${b(P)}${b(T)}`:`#${b(j)}${b(E)}${b(P)}`},y.toRgba=function(j,E,P,T=255){return(j<<24|E<<16|P<<8|T)>>>0},y.toColor=function(j,E,P,T){return{css:y.toCss(j,E,P,T),rgba:y.toRgba(j,E,P,T)}}})(x||(l.channels=x={})),(function(y){function j(E,P){return h=Math.round(255*P),[c,f,m]=v.toChannels(E.rgba),{css:x.toCss(c,f,m,h),rgba:x.toRgba(c,f,m,h)}}y.blend=function(E,P){if(h=(255&P.rgba)/255,h===1)return{css:P.css,rgba:P.rgba};const T=P.rgba>>24&255,N=P.rgba>>16&255,R=P.rgba>>8&255,I=E.rgba>>24&255,O=E.rgba>>16&255,$=E.rgba>>8&255;return c=I+Math.round((T-I)*h),f=O+Math.round((N-O)*h),m=$+Math.round((R-$)*h),{css:x.toCss(c,f,m),rgba:x.toRgba(c,f,m)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,P,T){const N=v.ensureContrastRatio(E.rgba,P.rgba,T);if(N)return x.toColor(N>>24&255,N>>16&255,N>>8&255)},y.opaque=function(E){const P=(255|E.rgba)>>>0;return[c,f,m]=v.toChannels(P),{css:x.toCss(c,f,m),rgba:P}},y.opacity=j,y.multiplyOpacity=function(E,P){return h=255&E.rgba,j(E,h*P/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(w||(l.color=w={})),(function(y){let j,E;try{const P=document.createElement("canvas");P.width=1,P.height=1;const T=P.getContext("2d",{willReadFrequently:!0});T&&(j=T,j.globalCompositeOperation="copy",E=j.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(P){if(P.match(/#[\da-f]{3,8}/i))switch(P.length){case 4:return c=parseInt(P.slice(1,2).repeat(2),16),f=parseInt(P.slice(2,3).repeat(2),16),m=parseInt(P.slice(3,4).repeat(2),16),x.toColor(c,f,m);case 5:return c=parseInt(P.slice(1,2).repeat(2),16),f=parseInt(P.slice(2,3).repeat(2),16),m=parseInt(P.slice(3,4).repeat(2),16),h=parseInt(P.slice(4,5).repeat(2),16),x.toColor(c,f,m,h);case 7:return{css:P,rgba:(parseInt(P.slice(1),16)<<8|255)>>>0};case 9:return{css:P,rgba:parseInt(P.slice(1),16)>>>0}}const T=P.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),f=parseInt(T[2]),m=parseInt(T[3]),h=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),x.toColor(c,f,m,h);if(!j||!E)throw new Error("css.toColor: Unsupported css format");if(j.fillStyle=E,j.fillStyle=P,typeof j.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(j.fillRect(0,0,1,1),[c,f,m,h]=j.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(c,f,m,h),css:P}}})(k||(l.css=k={})),(function(y){function j(E,P,T){const N=E/255,R=P/255,I=T/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(E){return j(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=j})(_||(l.rgb=_={})),(function(y){function j(P,T,N){const R=P>>24&255,I=P>>16&255,O=P>>8&255;let $=T>>24&255,W=T>>16&255,Y=T>>8&255,z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));for(;z<N&&($>0||W>0||Y>0);)$-=Math.max(0,Math.ceil(.1*$)),W-=Math.max(0,Math.ceil(.1*W)),Y-=Math.max(0,Math.ceil(.1*Y)),z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));return($<<24|W<<16|Y<<8|255)>>>0}function E(P,T,N){const R=P>>24&255,I=P>>16&255,O=P>>8&255;let $=T>>24&255,W=T>>16&255,Y=T>>8&255,z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));for(;z<N&&($<255||W<255||Y<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),W=Math.min(255,W+Math.ceil(.1*(255-W))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),z=g(_.relativeLuminance2($,W,Y),_.relativeLuminance2(R,I,O));return($<<24|W<<16|Y<<8|255)>>>0}y.blend=function(P,T){if(h=(255&T)/255,h===1)return T;const N=T>>24&255,R=T>>16&255,I=T>>8&255,O=P>>24&255,$=P>>16&255,W=P>>8&255;return c=O+Math.round((N-O)*h),f=$+Math.round((R-$)*h),m=W+Math.round((I-W)*h),x.toRgba(c,f,m)},y.ensureContrastRatio=function(P,T,N){const R=_.relativeLuminance(P>>8),I=_.relativeLuminance(T>>8);if(g(R,I)<N){if(I<R){const W=j(P,T,N),Y=g(R,_.relativeLuminance(W>>8));if(Y<N){const z=E(P,T,N);return Y>g(R,_.relativeLuminance(z>>8))?W:z}return W}const O=E(P,T,N),$=g(R,_.relativeLuminance(O>>8));if($<N){const W=j(P,T,N);return $>g(R,_.relativeLuminance(W>>8))?O:W}return O}},y.reduceLuminance=j,y.increaseLuminance=E,y.toChannels=function(P){return[P>>24&255,P>>16&255,P>>8&255,255&P]}})(v||(l.rgba=v={})),l.toPaddedHex=b,l.contrastRatio=g},8969:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=c(844),m=c(2585),h=c(4348),x=c(7866),w=c(744),k=c(7302),_=c(6975),v=c(8460),b=c(1753),g=c(1480),y=c(7994),j=c(9282),E=c(5435),P=c(5981),T=c(2660);let N=!1;class R extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((O=>{var $;($=this._onScrollApi)==null||$.fire(O.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(O){for(const $ in O)this.optionsService.options[$]=O[$]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new k.OptionsService(O)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(x.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new P.WriteBuffer((($,W)=>this._inputHandler.parse($,W)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,$){this._writeBuffer.write(O,$)}writeSync(O,$){this._logService.logLevel<=m.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync(O,$)}input(O,$=!0){this.coreService.triggerDataEvent(O,$)}resize(O,$){isNaN(O)||isNaN($)||(O=Math.max(O,w.MINIMUM_COLS),$=Math.max($,w.MINIMUM_ROWS),this._bufferService.resize(O,$))}scroll(O,$=!1){this._bufferService.scroll(O,$)}scrollLines(O,$,W){this._bufferService.scrollLines(O,$,W)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const $=O-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(O,$){return this._inputHandler.registerEscHandler(O,$)}registerDcsHandler(O,$){return this._inputHandler.registerDcsHandler(O,$)}registerCsiHandler(O,$){return this._inputHandler.registerCsiHandler(O,$)}registerOscHandler(O,$){return this._inputHandler.registerOscHandler(O,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?O=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(j.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},(()=>((0,j.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const $ of O)$.dispose()}))}}}l.CoreTerminal=R},8460:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,f){return c((m=>f.fire(m)))},l.runAndSubscribe=function(c,f){return f(void 0),c((m=>f(m)))}},5435:function(d,l,c){var f=this&&this.__decorate||function(U,L,M,B){var q,F=arguments.length,oe=F<3?L:B===null?B=Object.getOwnPropertyDescriptor(L,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")oe=Reflect.decorate(U,L,M,B);else for(var fe=U.length-1;fe>=0;fe--)(q=U[fe])&&(oe=(F<3?q(oe):F>3?q(L,M,oe):q(L,M))||oe);return F>3&&oe&&Object.defineProperty(L,M,oe),oe},m=this&&this.__param||function(U,L){return function(M,B){L(M,B,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=c(2584),x=c(7116),w=c(2015),k=c(844),_=c(482),v=c(8437),b=c(8460),g=c(643),y=c(511),j=c(3734),E=c(2585),P=c(1480),T=c(6242),N=c(6351),R=c(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function $(U,L){if(U>24)return L.setWinLines||!1;switch(U){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var W;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(W||(l.WindowsOptionsReportType=W={}));let Y=0;class z extends k.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,B,q,F,oe,fe,me,X=new w.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=B,this._logService=q,this._optionsService=F,this._oscLinkService=oe,this._coreMouseService=fe,this._unicodeService=me,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ae.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ae,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ae,data:ne})})),this._parser.setDcsHandlerFallback(((H,ae,ne)=>{ae==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ae,payload:ne})})),this._parser.setPrintHandler(((H,ae,ne)=>this.print(H,ae,ne))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new T.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new T.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new T.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new T.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new T.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new T.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new T.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new T.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new T.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new T.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((H,ae)=>this.requestStatusString(H,ae))))}_preserveStack(L,M,B,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=B,this._parseStack.position=q}_logSlowResolvingAsync(L){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let B,q=this._activeBuffer.x,F=this._activeBuffer.y,oe=0;const fe=this._parseStack.paused;if(fe){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(B),B;q=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>O&&(oe=this._parseStack.position+O)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(H=>String.fromCharCode(H))).join("")}"`),typeof L=="string"?L.split("").map((H=>H.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(L.length,O))),fe||this._dirtyRowTracker.clearRange(),L.length>O)for(let H=oe;H<L.length;H+=O){const ae=H+O<L.length?H+O:L.length,ne=typeof L=="string"?this._stringDecoder.decode(L.substring(H,ae),this._parseBuffer):this._utf8Decoder.decode(L.subarray(H,ae),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(q,F,ne,H),this._logSlowResolvingAsync(B),B}else if(!fe){const H=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,H))return this._preserveStack(q,F,H,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===q&&this._activeBuffer.y===F||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(L,M,B){let q,F;const oe=this._charsetService.charset,fe=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,ae=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-M>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let J=this._parser.precedingJoinState;for(let ie=M;ie<B;++ie){if(q=L[ie],q<127&&oe){const te=oe[String.fromCharCode(q)];te&&(q=te.charCodeAt(0))}const ye=this._unicodeService.charProperties(q,J);F=P.UnicodeService.extractWidth(ye);const Oe=P.UnicodeService.extractShouldJoin(ye),Ve=Oe?P.UnicodeService.extractWidth(J):0;if(J=ye,fe&&this._onA11yChar.fire((0,_.stringFromCodePoint)(q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-Ve>me){if(X){const te=ne;let de=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&ne instanceof v.BufferLine&&ne.copyCellsFrom(te,de,0,Ve,!1);de<me;)te.setCellFromCodepoint(de++,0,1,ae)}else if(this._activeBuffer.x=me-1,F===2)continue}if(Oe&&this._activeBuffer.x){const te=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-te,q,F);for(let de=F-Ve;--de>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(H&&(ne.insertCells(this._activeBuffer.x,F-Ve,this._activeBuffer.getNullCell(ae)),ne.getWidth(me-1)===2&&ne.setCellFromCodepoint(me-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ae)),ne.setCellFromCodepoint(this._activeBuffer.x++,q,F,ae),F>0)for(;--F;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=J,this._activeBuffer.x<me&&B-M>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(B=>!$(B.params[0],this._optionsService.rawOptions.windowOptions)||M(B)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new N.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new T.OscHandler(M))}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 L;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&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,B,q=!1,F=!1){const oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);oe.replaceCells(M,B,this._activeBuffer.getNullCell(this._eraseAttrData()),F),q&&(oe.isWrapped=!1)}_resetBufferLine(L,M=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),B.isWrapped=!1)}eraseInDisplay(L,M=!1){let B;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);B<this._bufferService.rows;B++)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,M);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-q+1;for(;M--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let q;for(q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-q;M--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let M=L.params[0]||1;for(;M--;)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(L){let M=L.params[0]||1;for(;M--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);q.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const M=this._parser.precedingJoinState;if(!M)return!0;const B=L.params[0]||1,q=P.UnicodeService.extractWidth(M),F=this._activeBuffer.x-q,oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),fe=new Uint32Array(oe.length*B);let me=0;for(let H=0;H<oe.length;){const ae=oe.codePointAt(H)||0;fe[me++]=ae,H+=ae>65535?2:1}let X=me;for(let H=1;H<B;++H)fe.copyWithin(X,0,me),X+=me;return this.print(fe,0,X),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,M){const B=this._coreService.decPrivateModes,{activeProtocol:q,activeEncoding:F}=this._coreMouseService,oe=this._coreService,{buffers:fe,cols:me}=this._bufferService,{active:X,alt:H}=fe,ae=this._optionsService.rawOptions,ne=Oe=>Oe?1:2,J=L.params[0];return ie=J,ye=M?J===2?4:J===4?ne(oe.modes.insertMode):J===12?3:J===20?ne(ae.convertEol):0:J===1?ne(B.applicationCursorKeys):J===3?ae.windowOptions.setWinLines?me===80?2:me===132?1:0:0:J===6?ne(B.origin):J===7?ne(B.wraparound):J===8?3:J===9?ne(q==="X10"):J===12?ne(ae.cursorBlink):J===25?ne(!oe.isCursorHidden):J===45?ne(B.reverseWraparound):J===66?ne(B.applicationKeypad):J===67?4:J===1e3?ne(q==="VT200"):J===1002?ne(q==="DRAG"):J===1003?ne(q==="ANY"):J===1004?ne(B.sendFocus):J===1005?4:J===1006?ne(F==="SGR"):J===1015?4:J===1016?ne(F==="SGR_PIXELS"):J===1048?1:J===47||J===1047||J===1049?ne(X===H):J===2004?ne(B.bracketedPasteMode):0,oe.triggerDataEvent(`${h.C0.ESC}[${M?"":"?"}${ie};${ye}$y`),!0;var ie,ye}_updateAttrColor(L,M,B,q,F){return M===2?(L|=50331648,L&=-16777216,L|=j.AttributeData.fromColorRGB([B,q,F])):M===5&&(L&=-50331904,L|=33554432|255&B),L}_extractColor(L,M,B){const q=[0,0,-1,0,0,0];let F=0,oe=0;do{if(q[oe+F]=L.params[M+oe],L.hasSubParams(M+oe)){const fe=L.getSubParams(M+oe);let me=0;do q[1]===5&&(F=1),q[oe+me+1+F]=fe[me];while(++me<fe.length&&me+oe+1+F<q.length);break}if(q[1]===5&&oe+F>=2||q[1]===2&&oe+F>=5)break;q[1]&&(F=1)}while(++oe+M<L.length&&oe+F<q.length);for(let fe=2;fe<q.length;++fe)q[fe]===-1&&(q[fe]=0);switch(q[0]){case 38:B.fg=this._updateAttrColor(B.fg,q[1],q[3],q[4],q[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,q[1],q[3],q[4],q[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,q[1],q[3],q[4],q[5])}return oe}_processUnderline(L,M){M.extended=M.extended.clone(),(!~L||L>5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=v.DEFAULT_ATTR_DATA.fg,L.bg=v.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let B;const q=this._curAttrData;for(let F=0;F<M;F++)B=L.params[F],B>=30&&B<=37?(q.fg&=-50331904,q.fg|=16777216|B-30):B>=40&&B<=47?(q.bg&=-50331904,q.bg|=16777216|B-40):B>=90&&B<=97?(q.fg&=-50331904,q.fg|=16777224|B-90):B>=100&&B<=107?(q.bg&=-50331904,q.bg|=16777224|B-100):B===0?this._processSGR0(q):B===1?q.fg|=134217728:B===3?q.bg|=67108864:B===4?(q.fg|=268435456,this._processUnderline(L.hasSubParams(F)?L.getSubParams(F)[0]:1,q)):B===5?q.fg|=536870912:B===7?q.fg|=67108864:B===8?q.fg|=1073741824:B===9?q.fg|=2147483648:B===2?q.bg|=134217728:B===21?this._processUnderline(2,q):B===22?(q.fg&=-134217729,q.bg&=-134217729):B===23?q.bg&=-67108865:B===24?(q.fg&=-268435457,this._processUnderline(0,q)):B===25?q.fg&=-536870913:B===27?q.fg&=-67108865:B===28?q.fg&=-1073741825:B===29?q.fg&=2147483647:B===39?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):B===49?(q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?F+=this._extractColor(L,F,q):B===53?q.bg|=1073741824:B===55?q.bg&=-1073741825:B===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):B===100?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${M};${B}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${M};${B}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=M%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(L){const M=L.params[0]||1;let B;return(L.length<2||(B=L.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(L){if(!$(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(W.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(W.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],B=L.split(";");for(;B.length>1;){const q=B.shift(),F=B.shift();if(/^\d+$/.exec(q)){const oe=parseInt(q);if(G(oe))if(F==="?")M.push({type:0,index:oe});else{const fe=(0,R.parseColor)(F);fe&&M.push({type:1,index:oe,color:fe})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const B=L.split(":");let q;const F=B.findIndex((oe=>oe.startsWith("id=")));return F!==-1&&(q=B[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const B=L.split(";");for(let q=0;q<B.length&&!(M>=this._specialColors.length);++q,++M)if(B[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const F=(0,R.parseColor)(B[q]);F&&this._onColor.fire([{type:1,index:this._specialColors[M],color:F}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],B=L.split(";");for(let q=0;q<B.length;++q)if(/^\d+$/.exec(B[q])){const F=parseInt(B[q]);G(F)&&M.push({type:2,index:F})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,x.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(I[L[0]],x.CHARSETS[L[1]]||x.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new y.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const B=this._activeBuffer.ybase+this._activeBuffer.y+M,q=this._activeBuffer.lines.get(B);q&&(q.fill(L),q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,M){const B=this._bufferService.buffer,q=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${F}${h.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}l.InputHandler=z;let K=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,L){U>L&&(Y=U,U=L,L=Y),U<this.start&&(this.start=U),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<256}K=f([m(0,E.IBufferService)],K)},844:(d,l)=>{function c(f){for(const m of f)m.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const m=this._disposables.indexOf(f);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var m;this._isDisposed||f===this._value||((m=this._value)==null||m.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=c,l.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,h,x){this._data[m]||(this._data[m]={}),this._data[m][h]=x}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(f,m,h,x,w){this._data.get(f,m)||this._data.set(f,m,new c),this._data.get(f,m).set(h,x,w)}get(f,m,h,x){var w;return(w=this._data.get(f,m))==null?void 0:w.get(h,x)}clear(){this._data.clear()}}},6114:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const m=this._getKey(f);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,m){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let m=0,h=this._array.length-1;for(;h>=m;){let x=m+h>>1;const w=this._getKey(this._array[x]);if(w>f)h=x-1;else{if(!(w<f)){for(;x>0&&this._getKey(this._array[x-1])===f;)x--;return x}m=x+1}}return m}}},7226:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let k=0,_=0,v=w.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),_=Math.max(k,_),b=w.timeRemaining(),1.5*_>b)return v-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-k))}ms`),void this._start();v=b}this.clear()}}class h extends m{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const k=Date.now()+w;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=c(643);l.updateWindowsModeWrappedState=function(m){const h=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),x=h==null?void 0:h.get(m.cols-1),w=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);w&&x&&(w.isWrapped=x[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&x[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,x=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=x}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=c(6349),m=c(7226),h=c(3734),x=c(8437),w=c(4634),k=c(511),_=c(643),v=c(4863),b=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(g,y,j){this._hasScrollback=g,this._optionsService=y,this._bufferService=j,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,y){return new x.BufferLine(this._bufferService.cols,this.getNullCell(g),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const y=g+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=x.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,y){const j=this.getNullCell(x.DEFAULT_ATTR_DATA);let E=0;const P=this._getCorrectBufferLength(y);if(P>this.lines.maxLength&&(this.lines.maxLength=P),this.lines.length>0){if(this._cols<g)for(let N=0;N<this.lines.length;N++)E+=+this.lines.get(N).resize(g,j);let T=0;if(this._rows<y)for(let N=this._rows;N<y;N++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new x.BufferLine(g,j)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(g,j)));else for(let N=this._rows;N>y;N--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(P<this.lines.maxLength){const N=this.lines.length-P;N>0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=P}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(g,y),this._cols>g))for(let T=0;T<this.lines.length;T++)E+=+this.lines.get(T).resize(g,j);this._cols=g,this._rows=y,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,y){this._cols!==g&&(g>this._cols?this._reflowLarger(g,y):this._reflowSmaller(g,y))}_reflowLarger(g,y){const j=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(j.length>0){const E=(0,w.reflowLargerCreateNewLayout)(this.lines,j);(0,w.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(g,y,E.countRemoved)}}_reflowLargerAdjustViewport(g,y,j){const E=this.getNullCell(x.DEFAULT_ATTR_DATA);let P=j;for(;P-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new x.BufferLine(g,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-j,0)}_reflowSmaller(g,y){const j=this.getNullCell(x.DEFAULT_ATTR_DATA),E=[];let P=0;for(let T=this.lines.length-1;T>=0;T--){let N=this.lines.get(T);if(!N||!N.isWrapped&&N.getTrimmedLength()<=g)continue;const R=[N];for(;N.isWrapped&&T>0;)N=this.lines.get(--T),R.unshift(N);const I=this.ybase+this.y;if(I>=T&&I<T+R.length)continue;const O=R[R.length-1].getTrimmedLength(),$=(0,w.reflowSmallerGetNewLineLengths)(R,this._cols,g),W=$.length-R.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+W):Math.max(0,this.lines.length-this.lines.maxLength+W);const z=[];for(let B=0;B<W;B++){const q=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);z.push(q)}z.length>0&&(E.push({start:T+R.length+P,newLines:z}),P+=z.length),R.push(...z);let K=$.length-1,G=$[K];G===0&&(K--,G=$[K]);let U=R.length-W-1,L=O;for(;U>=0;){const B=Math.min(L,G);if(R[K]===void 0)break;if(R[K].copyCellsFrom(R[U],L-B,G-B,B,!0),G-=B,G===0&&(K--,G=$[K]),L-=B,L===0){U--;const q=Math.max(U,0);L=(0,w.getWrappedLineTrimmedLength)(R,q,this._cols)}}for(let B=0;B<R.length;B++)$[B]<g&&R[B].setCell($[B],j);let M=W-Y;for(;M-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+P)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+W,this.ybase+y-1)}if(E.length>0){const T=[],N=[];for(let K=0;K<this.lines.length;K++)N.push(this.lines.get(K));const R=this.lines.length;let I=R-1,O=0,$=E[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+P);let W=0;for(let K=Math.min(this.lines.maxLength-1,R+P-1);K>=0;K--)if($&&$.start>I+W){for(let G=$.newLines.length-1;G>=0;G--)this.lines.set(K--,$.newLines[G]);K++,T.push({index:I+1,amount:$.newLines.length}),W+=$.newLines.length,$=E[++O]}else this.lines.set(K,N[I--]);let Y=0;for(let K=T.length-1;K>=0;K--)T[K].index+=Y,this.lines.onInsertEmitter.fire(T[K]),Y+=T[K].amount;const z=Math.max(0,R+P-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(g,y,j=0,E){const P=this.lines.get(g);return P?P.translateToString(y,j,E):""}getWrappedRangeForLine(g){let y=g,j=g;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;j+1<this.lines.length&&this.lines.get(j+1).isWrapped;)j++;return{first:y,last:j}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===g&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const y=new v.Marker(g);return this.markers.push(y),y.register(this.lines.onTrim((j=>{y.line-=j,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((j=>{y.line>=j.index&&(y.line+=j.amount)}))),y.register(this.lines.onDelete((j=>{y.line>=j.index&&y.line<j.index+j.amount&&y.dispose(),y.line>j.index&&(y.line-=j.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=c(3734),m=c(511),h=c(643),x=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let w=0;class k{constructor(v,b,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let j=0;j<v;++j)this.setCell(j,y);this.length=v}get(v){const b=this._data[3*v+0],g=2097151&b;return[this._data[3*v+1],2097152&b?this._combined[v]:g?(0,x.stringFromCodePoint)(g):"",b>>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):g]}set(v,b){this._data[3*v+1]=b[h.CHAR_DATA_ATTR_INDEX],b[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,x.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return w=3*v,b.content=this._data[w+0],b.fg=this._data[w+1],b.bg=this._data[w+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,g,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|g<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,g){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,x.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,x.stringFromCodePoint)(2097151&y)+(0,x.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,g&&(y&=-12582913,y|=g<<22),this._data[3*v+0]=y}insertCells(v,b,g){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),b<this.length-v){const y=new m.CellData;for(let j=this.length-v-b-1;j>=0;--j)this.setCell(v+b+j,this.loadCell(v+j,y));for(let j=0;j<b;++j)this.setCell(v+j,g)}else for(let y=v;y<this.length;++y)this.setCell(y,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(v,b,g){if(v%=this.length,b<this.length-v){const y=new m.CellData;for(let j=0;j<this.length-v-b;++j)this.setCell(v+j,this.loadCell(v+b+j,y));for(let j=this.length-b;j<this.length;++j)this.setCell(j,g)}else for(let y=v;y<this.length;++y)this.setCell(y,g);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,g)}replaceCells(v,b,g,y=!1){if(y)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,g),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,g);v<b&&v<this.length;)this.isProtected(v)||this.setCell(v,g),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,g);v<b&&v<this.length;)this.setCell(v++,g)}resize(v,b){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const y=new Uint32Array(g);y.set(this._data),this._data=y}for(let y=this.length;y<v;++y)this.setCell(y,b)}else{this._data=this._data.subarray(0,g);const y=Object.keys(this._combined);for(let E=0;E<y.length;E++){const P=parseInt(y[E],10);P>=v&&delete this._combined[P]}const j=Object.keys(this._extendedAttrs);for(let E=0;E<j.length;E++){const P=parseInt(j[E],10);P>=v&&delete this._extendedAttrs[P]}}return this.length=v,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,b=!1){if(b)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,v);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const b in v._combined)this._combined[b]=v._combined[b];this._extendedAttrs={};for(const b in v._extendedAttrs)this._extendedAttrs[b]=v._extendedAttrs[b];this.isWrapped=v.isWrapped}clone(){const v=new k(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const b in this._combined)v._combined[b]=this._combined[b];for(const b in this._extendedAttrs)v._extendedAttrs[b]=this._extendedAttrs[b];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,g,y,j){const E=v._data;if(j)for(let T=y-1;T>=0;T--){for(let N=0;N<3;N++)this._data[3*(g+T)+N]=E[3*(b+T)+N];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[g+T]=v._extendedAttrs[b+T])}else for(let T=0;T<y;T++){for(let N=0;N<3;N++)this._data[3*(g+T)+N]=E[3*(b+T)+N];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[g+T]=v._extendedAttrs[b+T])}const P=Object.keys(v._combined);for(let T=0;T<P.length;T++){const N=parseInt(P[T],10);N>=b&&(this._combined[N-b+g]=v._combined[N])}}translateToString(v,b,g,y){b=b??0,g=g??this.length,v&&(g=Math.min(g,this.getTrimmedLength())),y&&(y.length=0);let j="";for(;b<g;){const E=this._data[3*b+0],P=2097151&E,T=2097152&E?this._combined[b]:P?(0,x.stringFromCodePoint)(P):h.WHITESPACE_CELL_CHAR;if(j+=T,y)for(let N=0;N<T.length;++N)y.push(b);b+=E>>22||1}return y&&y.push(b),j}}l.BufferLine=k},4841:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(d,l)=>{function c(f,m,h){if(m===f.length-1)return f[m].getTrimmedLength();const x=!f[m].hasContent(h-1)&&f[m].getWidth(h-1)===1,w=f[m+1].getWidth(0)===2;return x&&w?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,m,h,x,w){const k=[];for(let _=0;_<f.length-1;_++){let v=_,b=f.get(++v);if(!b.isWrapped)continue;const g=[f.get(_)];for(;v<f.length&&b.isWrapped;)g.push(b),b=f.get(++v);if(x>=_&&x<v){_+=g.length-1;continue}let y=0,j=c(g,y,m),E=1,P=0;for(;E<g.length;){const N=c(g,E,m),R=N-P,I=h-j,O=Math.min(R,I);g[y].copyCellsFrom(g[E],P,j,O,!1),j+=O,j===h&&(y++,j=0),P+=O,P===N&&(E++,P=0),j===0&&y!==0&&g[y-1].getWidth(h-1)===2&&(g[y].copyCellsFrom(g[y-1],h-1,j++,1,!1),g[y-1].setCell(h-1,w))}g[y].replaceCells(j,h,w);let T=0;for(let N=g.length-1;N>0&&(N>y||g[N].getTrimmedLength()===0);N--)T++;T>0&&(k.push(_+g.length-T),k.push(T)),_+=g.length-1}return k},l.reflowLargerCreateNewLayout=function(f,m){const h=[];let x=0,w=m[x],k=0;for(let _=0;_<f.length;_++)if(w===_){const v=m[++x];f.onDeleteEmitter.fire({index:_-k,amount:v}),_+=v-1,k+=v,w=m[++x]}else h.push(_);return{layout:h,countRemoved:k}},l.reflowLargerApplyNewLayout=function(f,m){const h=[];for(let x=0;x<m.length;x++)h.push(f.get(m[x]));for(let x=0;x<h.length;x++)f.set(x,h[x]);f.length=m.length},l.reflowSmallerGetNewLineLengths=function(f,m,h){const x=[],w=f.map(((b,g)=>c(f,g,m))).reduce(((b,g)=>b+g));let k=0,_=0,v=0;for(;v<w;){if(w-v<h){x.push(w-v);break}k+=h;const b=c(f,_,m);k>b&&(k-=b,_++);const g=f[_].getWidth(k-1)===2;g&&k--;const y=g?h-1:h;x.push(y),v+=y}return x},l.getWrappedLineTrimmedLength=c},5295:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=c(8460),m=c(844),h=c(9092);class x extends m.Disposable{constructor(k,_){super(),this._optionsService=k,this._bufferService=_,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,_){this._normal.resize(k,_),this._alt.resize(k,_),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=x},511:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=c(482),m=c(643),h=c(3734);class x extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const _=new x;return _.setFromCharData(k),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const v=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=x},643:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=c(8460),m=c(844);class h{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}l.Marker=h,h._nextId=1},7116:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,l)=>{var c,f,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
542
542
|
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(l.C0=c={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(f||(l.C1=f={})),(function(h){h.ST=`${c.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=c(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(h,x,w,k){const _={type:0,cancel:!1,key:void 0},v=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?_.key=x?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?_.key=x?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?_.key=x?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(_.key=x?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:_.key=h.ctrlKey?"\b":f.C0.DEL,h.altKey&&(_.key=f.C0.ESC+_.key);break;case 9:if(h.shiftKey){_.key=f.C0.ESC+"[Z";break}_.key=f.C0.HT,_.cancel=!0;break;case 13:_.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,_.cancel=!0;break;case 27:_.key=f.C0.ESC,h.altKey&&(_.key=f.C0.ESC+f.C0.ESC),_.cancel=!0;break;case 37:if(h.metaKey)break;v?(_.key=f.C0.ESC+"[1;"+(v+1)+"D",_.key===f.C0.ESC+"[1;3D"&&(_.key=f.C0.ESC+(w?"b":"[1;5D"))):_.key=x?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;v?(_.key=f.C0.ESC+"[1;"+(v+1)+"C",_.key===f.C0.ESC+"[1;3C"&&(_.key=f.C0.ESC+(w?"f":"[1;5C"))):_.key=x?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;v?(_.key=f.C0.ESC+"[1;"+(v+1)+"A",w||_.key!==f.C0.ESC+"[1;3A"||(_.key=f.C0.ESC+"[1;5A")):_.key=x?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;v?(_.key=f.C0.ESC+"[1;"+(v+1)+"B",w||_.key!==f.C0.ESC+"[1;3B"||(_.key=f.C0.ESC+"[1;5B")):_.key=x?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(_.key=f.C0.ESC+"[2~");break;case 46:_.key=v?f.C0.ESC+"[3;"+(v+1)+"~":f.C0.ESC+"[3~";break;case 36:_.key=v?f.C0.ESC+"[1;"+(v+1)+"H":x?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:_.key=v?f.C0.ESC+"[1;"+(v+1)+"F":x?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?_.type=2:h.ctrlKey?_.key=f.C0.ESC+"[5;"+(v+1)+"~":_.key=f.C0.ESC+"[5~";break;case 34:h.shiftKey?_.type=3:h.ctrlKey?_.key=f.C0.ESC+"[6;"+(v+1)+"~":_.key=f.C0.ESC+"[6~";break;case 112:_.key=v?f.C0.ESC+"[1;"+(v+1)+"P":f.C0.ESC+"OP";break;case 113:_.key=v?f.C0.ESC+"[1;"+(v+1)+"Q":f.C0.ESC+"OQ";break;case 114:_.key=v?f.C0.ESC+"[1;"+(v+1)+"R":f.C0.ESC+"OR";break;case 115:_.key=v?f.C0.ESC+"[1;"+(v+1)+"S":f.C0.ESC+"OS";break;case 116:_.key=v?f.C0.ESC+"[15;"+(v+1)+"~":f.C0.ESC+"[15~";break;case 117:_.key=v?f.C0.ESC+"[17;"+(v+1)+"~":f.C0.ESC+"[17~";break;case 118:_.key=v?f.C0.ESC+"[18;"+(v+1)+"~":f.C0.ESC+"[18~";break;case 119:_.key=v?f.C0.ESC+"[19;"+(v+1)+"~":f.C0.ESC+"[19~";break;case 120:_.key=v?f.C0.ESC+"[20;"+(v+1)+"~":f.C0.ESC+"[20~";break;case 121:_.key=v?f.C0.ESC+"[21;"+(v+1)+"~":f.C0.ESC+"[21~";break;case 122:_.key=v?f.C0.ESC+"[23;"+(v+1)+"~":f.C0.ESC+"[23~";break;case 123:_.key=v?f.C0.ESC+"[24;"+(v+1)+"~":f.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(w&&!k||!h.altKey||h.metaKey)!w||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?_.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(_.key=f.C0.US),h.key==="@"&&(_.key=f.C0.NUL)):h.keyCode===65&&(_.type=1);else{const b=m[h.keyCode],g=b==null?void 0:b[h.shiftKey?1:0];if(g)_.key=f.C0.ESC+g;else if(h.keyCode>=65&&h.keyCode<=90){const y=h.ctrlKey?h.keyCode-64:h.keyCode+32;let j=String.fromCharCode(y);h.shiftKey&&(j=j.toUpperCase()),_.key=f.C0.ESC+j}else if(h.keyCode===32)_.key=f.C0.ESC+(h.ctrlKey?f.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let y=h.code.slice(3,4);h.shiftKey||(y=y.toLowerCase()),_.key=f.C0.ESC+y,_.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?_.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?_.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?_.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?_.key=f.C0.DEL:h.keyCode===219?_.key=f.C0.ESC:h.keyCode===220?_.key=f.C0.FS:h.keyCode===221&&(_.key=f.C0.GS)}return _}},482:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,f=0,m=c.length){let h="";for(let x=f;x<m;++x){let w=c[x];w>65535?(w-=65536,h+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):h+=String.fromCharCode(w)}return h},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const m=c.length;if(!m)return 0;let h=0,x=0;if(this._interim){const w=c.charCodeAt(x++);56320<=w&&w<=57343?f[h++]=1024*(this._interim-55296)+w-56320+65536:(f[h++]=this._interim,f[h++]=w),this._interim=0}for(let w=x;w<m;++w){const k=c.charCodeAt(w);if(55296<=k&&k<=56319){if(++w>=m)return this._interim=k,h;const _=c.charCodeAt(w);56320<=_&&_<=57343?f[h++]=1024*(k-55296)+_-56320+65536:(f[h++]=k,f[h++]=_)}else k!==65279&&(f[h++]=k)}return h}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const m=c.length;if(!m)return 0;let h,x,w,k,_=0,v=0,b=0;if(this.interim[0]){let j=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let P,T=0;for(;(P=63&this.interim[++T])&&T<4;)E<<=6,E|=P;const N=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=N-T;for(;b<R;){if(b>=m)return 0;if(P=c[b++],(192&P)!=128){b--,j=!0;break}this.interim[T++]=P,E<<=6,E|=63&P}j||(N===2?E<128?b--:f[_++]=E:N===3?E<2048||E>=55296&&E<=57343||E===65279||(f[_++]=E):E<65536||E>1114111||(f[_++]=E)),this.interim.fill(0)}const g=m-4;let y=b;for(;y<m;){for(;!(!(y<g)||128&(h=c[y])||128&(x=c[y+1])||128&(w=c[y+2])||128&(k=c[y+3]));)f[_++]=h,f[_++]=x,f[_++]=w,f[_++]=k,y+=4;if(h=c[y++],h<128)f[_++]=h;else if((224&h)==192){if(y>=m)return this.interim[0]=h,_;if(x=c[y++],(192&x)!=128){y--;continue}if(v=(31&h)<<6|63&x,v<128){y--;continue}f[_++]=v}else if((240&h)==224){if(y>=m)return this.interim[0]=h,_;if(x=c[y++],(192&x)!=128){y--;continue}if(y>=m)return this.interim[0]=h,this.interim[1]=x,_;if(w=c[y++],(192&w)!=128){y--;continue}if(v=(15&h)<<12|(63&x)<<6|63&w,v<2048||v>=55296&&v<=57343||v===65279)continue;f[_++]=v}else if((248&h)==240){if(y>=m)return this.interim[0]=h,_;if(x=c[y++],(192&x)!=128){y--;continue}if(y>=m)return this.interim[0]=h,this.interim[1]=x,_;if(w=c[y++],(192&w)!=128){y--;continue}if(y>=m)return this.interim[0]=h,this.interim[1]=x,this.interim[2]=w,_;if(k=c[y++],(192&k)!=128){y--;continue}if(v=(7&h)<<18|(63&x)<<12|(63&w)<<6|63&k,v<65536||v>1114111)continue;f[_++]=v}}return _}}},225:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const f=c(1480),m=[[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]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let x;l.UnicodeV6=class{constructor(){if(this.version="6",!x){x=new Uint8Array(65536),x.fill(1),x[0]=0,x.fill(0,1,32),x.fill(0,127,160),x.fill(2,4352,4448),x[9001]=2,x[9002]=2,x.fill(2,11904,42192),x[12351]=1,x.fill(2,44032,55204),x.fill(2,63744,64256),x.fill(2,65040,65050),x.fill(2,65072,65136),x.fill(2,65280,65377),x.fill(2,65504,65511);for(let w=0;w<m.length;++w)x.fill(0,m[w][0],m[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?x[w]:(function(k,_){let v,b=0,g=_.length-1;if(k<_[0][0]||k>_[g][1])return!1;for(;g>=b;)if(v=b+g>>1,k>_[v][1])b=v+1;else{if(!(k<_[v][0]))return!0;g=v-1}return!1})(w,h)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,k){let _=this.wcwidth(w),v=_===0&&k!==0;if(v){const b=f.UnicodeService.extractWidth(k);b===0?v=!1:b>_&&(_=b)}return f.UnicodeService.createPropertyValue(0,_,v)}}},5981:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=c(8460),m=c(844);class h extends m.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k)}_innerWrite(w=0,k=!0){const _=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,k);if(b){const y=j=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,j))):this._innerWrite(_,j);return void b.catch((j=>(queueMicrotask((()=>{throw j})),Promise.resolve(!1)))).then(y)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=h},5941:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const c=/^([\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})$/,f=/^[\da-f]+$/;function m(h,x){const w=h.toString(16),k=w.length<2?"0"+w:w;switch(x){case 4:return w[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(h){if(!h)return;let x=h.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);const w=c.exec(x);if(w){const k=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/k*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/k*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/k*255)]}}else if(x.indexOf("#")===0&&(x=x.slice(1),f.exec(x)&&[3,6,9,12].includes(x.length))){const w=x.length/3,k=[0,0,0];for(let _=0;_<3;++_){const v=parseInt(x.slice(w*_,w*_+w),16);k[_]=w===1?v<<4:w===2?v:w===3?v>>4:v>>8}return k}},l.toRgbString=function(h,x=16){const[w,k,_]=h;return`rgb:${m(w,x)}/${m(k,x)}/${m(_,x)}`}},5770:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=c(482),m=c(8742),h=c(5770),x=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=x,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=x}registerHandler(k,_){this._handlers[k]===void 0&&(this._handlers[k]=[]);const v=this._handlers[k];return v.push(_),{dispose:()=>{const b=v.indexOf(_);b!==-1&&v.splice(b,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=x,this._ident=0}hook(k,_){if(this.reset(),this._ident=k,this._active=this._handlers[k]||x,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(k,_,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(k,_,v);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(k,_,v))}unhook(k,_=!0){if(this._active.length){let v=!1,b=this._active.length-1,g=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=_,g=this._stack.fallThrough,this._stack.paused=!1),!g&&v===!1){for(;b>=0&&(v=this._active[b].unhook(k),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",k);this._active=x,this._ident=0}};const w=new m.Params;w.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=w,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():w,this._data="",this._hitLimit=!1}put(k,_,v){this._hitLimit||(this._data+=(0,f.utf32ToString)(k,_,v),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let _=!1;if(this._hitLimit)_=!1;else if(k&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((v=>(this._params=w,this._data="",this._hitLimit=!1,v)));return this._params=w,this._data="",this._hitLimit=!1,_}}},2015:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=c(844),m=c(8742),h=c(6242),x=c(6351);class w{constructor(b){this.table=new Uint8Array(b)}setDefault(b,g){this.table.fill(b<<4|g)}add(b,g,y,j){this.table[g<<8|b]=y<<4|j}addMany(b,g,y,j){for(let E=0;E<b.length;E++)this.table[g<<8|b[E]]=y<<4|j}}l.TransitionTable=w;const k=160;l.VT500_TRANSITION_TABLE=(function(){const v=new w(4095),b=Array.apply(null,Array(256)).map(((T,N)=>N)),g=(T,N)=>b.slice(T,N),y=g(32,127),j=g(0,24);j.push(25),j.push.apply(j,g(28,32));const E=g(0,14);let P;for(P in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],P,3,0),v.addMany(g(128,144),P,3,0),v.addMany(g(144,152),P,3,0),v.add(156,P,0,0),v.add(27,P,11,1),v.add(157,P,4,8),v.addMany([152,158,159],P,0,7),v.add(155,P,11,3),v.add(144,P,11,9);return v.addMany(j,0,3,0),v.addMany(j,1,3,1),v.add(127,1,0,1),v.addMany(j,8,0,8),v.addMany(j,3,3,3),v.add(127,3,0,3),v.addMany(j,4,3,4),v.add(127,4,0,4),v.addMany(j,6,3,6),v.addMany(j,5,3,5),v.add(127,5,0,5),v.addMany(j,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(g(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(j,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(g(64,127),3,7,0),v.addMany(g(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(g(48,60),4,8,4),v.addMany(g(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(g(32,64),6,0,6),v.add(127,6,0,6),v.addMany(g(64,127),6,0,0),v.addMany(g(32,48),3,9,5),v.addMany(g(32,48),5,9,5),v.addMany(g(48,64),5,0,6),v.addMany(g(64,127),5,7,0),v.addMany(g(32,48),4,9,5),v.addMany(g(32,48),1,9,2),v.addMany(g(32,48),2,9,2),v.addMany(g(48,127),2,10,0),v.addMany(g(48,80),1,10,0),v.addMany(g(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(g(96,127),1,10,0),v.add(80,1,11,9),v.addMany(j,9,0,9),v.add(127,9,0,9),v.addMany(g(28,32),9,0,9),v.addMany(g(32,48),9,9,12),v.addMany(g(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(j,11,0,11),v.addMany(g(32,128),11,0,11),v.addMany(g(28,32),11,0,11),v.addMany(j,10,0,10),v.add(127,10,0,10),v.addMany(g(28,32),10,0,10),v.addMany(g(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(g(32,48),10,9,12),v.addMany(j,12,0,12),v.add(127,12,0,12),v.addMany(g(28,32),12,0,12),v.addMany(g(32,48),12,9,12),v.addMany(g(48,64),12,0,11),v.addMany(g(64,127),12,12,13),v.addMany(g(64,127),10,12,13),v.addMany(g(64,127),9,12,13),v.addMany(j,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(k,0,2,0),v.add(k,8,5,8),v.add(k,6,0,6),v.add(k,11,0,11),v.add(k,13,13,13),v})();class _ extends f.Disposable{constructor(b=l.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,y,j)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,y)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new x.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,g=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<b.intermediates.length;++E){const P=b.intermediates.charCodeAt(E);if(32>P||P>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=P}}if(b.final.length!==1)throw new Error("final must be a single byte");const j=b.final.charCodeAt(0);if(g[0]>j||j>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return y<<=8,y|=j,y}identToString(b){const g=[];for(;b;)g.push(String.fromCharCode(255&b)),b>>=8;return g.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,g){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const j=this._escHandlers[y];return j.push(g),{dispose:()=>{const E=j.indexOf(g);E!==-1&&j.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,g){this._executeHandlers[b.charCodeAt(0)]=g}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,g){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const j=this._csiHandlers[y];return j.push(g),{dispose:()=>{const E=j.indexOf(g);E!==-1&&j.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,g){return this._dcsParser.registerHandler(this._identifier(b),g)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,g){return this._oscParser.registerHandler(b,g)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,g,y,j,E){this._parseStack.state=b,this._parseStack.handlers=g,this._parseStack.handlerPos=y,this._parseStack.transition=j,this._parseStack.chunkPos=E}parse(b,g,y){let j,E=0,P=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const N=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&R>-1){for(;R>=0&&(j=N[R](this._params),j!==!0);R--)if(j instanceof Promise)return this._parseStack.handlerPos=R,j}this._parseStack.handlers=[];break;case 4:if(y===!1&&R>-1){for(;R>=0&&(j=N[R](),j!==!0);R--)if(j instanceof Promise)return this._parseStack.handlerPos=R,j}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],j=this._dcsParser.unhook(E!==24&&E!==26,y),j)return j;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],j=this._oscParser.end(E!==24&&E!==26,y),j)return j;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let N=T;N<g;++N){switch(E=b[N],P=this._transitions.table[this.currentState<<8|(E<160?E:k)],P>>4){case 2:for(let W=N+1;;++W){if(W>=g||(E=b[W])<32||E>126&&E<k){this._printHandler(b,N,W),N=W-1;break}if(++W>=g||(E=b[W])<32||E>126&&E<k){this._printHandler(b,N,W),N=W-1;break}if(++W>=g||(E=b[W])<32||E>126&&E<k){this._printHandler(b,N,W),N=W-1;break}if(++W>=g||(E=b[W])<32||E>126&&E<k){this._printHandler(b,N,W),N=W-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:N,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|E];let I=R?R.length-1:-1;for(;I>=0&&(j=R[I](this._params),j!==!0);I--)if(j instanceof Promise)return this._preserveStack(3,R,I,P,N),j;I<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++N<g&&(E=b[N])>47&&E<60);N--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const O=this._escHandlers[this._collect<<8|E];let $=O?O.length-1:-1;for(;$>=0&&(j=O[$](),j!==!0);$--)if(j instanceof Promise)return this._preserveStack(4,O,$,P,N),j;$<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let W=N+1;;++W)if(W>=g||(E=b[W])===24||E===26||E===27||E>127&&E<k){this._dcsParser.put(b,N,W),N=W-1;break}break;case 14:if(j=this._dcsParser.unhook(E!==24&&E!==26),j)return this._preserveStack(6,[],0,P,N),j;E===27&&(P|=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 W=N+1;;W++)if(W>=g||(E=b[W])<32||E>127&&E<k){this._oscParser.put(b,N,W),N=W-1;break}break;case 6:if(j=this._oscParser.end(E!==24&&E!==26),j)return this._preserveStack(5,[],0,P,N),j;E===27&&(P|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&P}}}l.EscapeSequenceParser=_},6242:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=c(5770),m=c(482),h=[];l.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(x,w){this._handlers[x]===void 0&&(this._handlers[x]=[]);const k=this._handlers[x];return k.push(w),{dispose:()=>{const _=k.indexOf(w);_!==-1&&k.splice(_,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].start();else this._handlerFb(this._id,"START")}_put(x,w,k){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(x,w,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(x,w,k))}start(){this.reset(),this._state=1}put(x,w,k){if(this._state!==3){if(this._state===1)for(;w<k;){const _=x[w++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&k-w>0&&this._put(x,w,k)}}end(x,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,_=this._active.length-1,v=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,k=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&k===!1){for(;_>=0&&(k=this._active[_].end(x),k!==!0);_--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,k;_--}for(;_>=0;_--)if(k=this._active[_].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",x);this._active=h,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(x){this._handler=x,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(x,w,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(x,w,k),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(x){let w=!1;if(this._hitLimit)w=!1;else if(x&&(w=this._handler(this._data),w instanceof Promise))return w.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,w}}},8742:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class f{static fromArray(h){const x=new f;if(!h.length)return x;for(let w=Array.isArray(h[0])?1:0;w<h.length;++w){const k=h[w];if(Array.isArray(k))for(let _=0;_<k.length;++_)x.addSubParam(k[_]);else x.addParam(k)}return x}constructor(h=32,x=32){if(this.maxLength=h,this.maxSubParamsLength=x,x>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(x),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new f(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let x=0;x<this.length;++x){h.push(this.params[x]);const w=this._subParamsIdx[x]>>8,k=255&this._subParamsIdx[x];k-w>0&&h.push(Array.prototype.slice.call(this._subParams,w,k))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const x=this._subParamsIdx[h]>>8,w=255&this._subParamsIdx[h];return w-x>0?this._subParams.subarray(x,w):null}getSubParamsAll(){const h={};for(let x=0;x<this.length;++x){const w=this._subParamsIdx[x]>>8,k=255&this._subParamsIdx[x];k-w>0&&(h[x]=this._subParams.slice(w,k))}return h}addDigit(h){let x;if(this._rejectDigits||!(x=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,k=w[x-1];w[x-1]=~k?Math.min(10*k+h,c):h}}l.Params=f},5741:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const m={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(m),f.dispose=()=>this._wrappedAddonDispose(m),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){f=m;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=c(3785),m=c(511);l.BufferApiView=class{constructor(h,x){this._buffer=h,this.type=x}init(h){return this._buffer=h,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(h){const x=this._buffer.lines.get(h);if(x)return new f.BufferLineApiView(x)}getNullCell(){return new m.CellData}}},3785:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=c(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,h){if(!(m<0||m>=this._line.length))return h?(this._line.loadCell(m,h),h):this._line.loadCell(m,new f.CellData)}translateToString(m,h,x){return this._line.translateToString(m,h,x)}}},8285:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=c(8771),m=c(8460),h=c(844);class x extends h.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=x},7975:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(m=>f(m.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((m,h)=>f(m,h.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(d,l,c){var f=this&&this.__decorate||function(v,b,g,y){var j,E=arguments.length,P=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(v,b,g,y);else for(var T=v.length-1;T>=0;T--)(j=v[T])&&(P=(E<3?j(P):E>3?j(b,g,P):j(b,g))||P);return E>3&&P&&Object.defineProperty(b,g,P),P},m=this&&this.__param||function(v,b){return function(g,y){b(g,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const h=c(8460),x=c(844),w=c(5295),k=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let _=l.BufferService=class extends x.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const g=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=g.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const j=g.ybase+g.scrollTop,E=g.ybase+g.scrollBottom;if(g.scrollTop===0){const P=g.lines.isFull;E===g.lines.length-1?P?g.lines.recycle().copyFrom(y):g.lines.push(y.clone()):g.lines.splice(E+1,0,y.clone()),P?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const P=E-j+1;g.lines.shiftElements(j+1,P-1,-1),g.lines.set(E,y.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(v,b,g){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const j=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),j!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};l.BufferService=_=f([m(0,k.IOptionsService)],_)},7994:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(d,l,c){var f=this&&this.__decorate||function(y,j,E,P){var T,N=arguments.length,R=N<3?j:P===null?P=Object.getOwnPropertyDescriptor(j,E):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,j,E,P);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(R=(N<3?T(R):N>3?T(j,E,R):T(j,E))||R);return N>3&&R&&Object.defineProperty(j,E,R),R},m=this&&this.__param||function(y,j){return function(E,P){j(E,P,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const h=c(2585),x=c(8460),w=c(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function _(y,j){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||j||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const j=[_(y,!1)+32,y.col+32,y.row+32];return j[0]>255||j[1]>255||j[2]>255?"":`\x1B[M${v(j[0])}${v(j[1])}${v(j[2])}`},SGR:y=>{const j=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${_(y,!0)};${y.col};${y.row}${j}`},SGR_PIXELS:y=>{const j=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${_(y,!0)};${y.x};${y.y}${j}`}};let g=l.CoreMouseService=class extends w.Disposable{constructor(y,j){super(),this._bufferService=y,this._coreService=j,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new x.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(k))this.addProtocol(E,k[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,j){this._protocols[y]=j}addEncoding(y,j){this._encodings[y]=j}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const j=this._encodings[this._activeEncoding](y);return j&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(j):this._coreService.triggerDataEvent(j,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,j,E){if(E){if(y.x!==j.x||y.y!==j.y)return!1}else if(y.col!==j.col||y.row!==j.row)return!1;return y.button===j.button&&y.action===j.action&&y.ctrl===j.ctrl&&y.alt===j.alt&&y.shift===j.shift}};l.CoreMouseService=g=f([m(0,h.IBufferService),m(1,h.ICoreService)],g)},6975:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,T=arguments.length,N=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(T<3?P(N):T>3?P(y,j,N):P(y,j))||N);return T>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const h=c(1439),x=c(8460),w=c(844),k=c(2585),_=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=l.CoreService=class extends w.Disposable{constructor(g,y,j){super(),this._bufferService=g,this._logService=y,this._optionsService=j,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new x.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new x.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(_),this.decPrivateModes=(0,h.clone)(v)}reset(){this.modes=(0,h.clone)(_),this.decPrivateModes=(0,h.clone)(v)}triggerDataEvent(g,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const j=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&j.ybase!==j.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(g))}};l.CoreService=b=f([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],b)},9074:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=c(8055),m=c(8460),h=c(844),x=c(6106);let w=0,k=0;class _ extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new x.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const y=new v(g);if(y){const j=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),j.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,y,j){let E=0,P=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,P=E+(T.options.width??1),g>=E&&g<P&&(!j||(T.options.layer??"bottom")===j)&&(yield T)}forEachDecorationAtCell(g,y,j,E){this._decorations.forEachByKey(y,(P=>{w=P.options.x??0,k=w+(P.options.width??1),g>=w&&g<k&&(!j||(P.options.layer??"bottom")===j)&&E(P)}))}}l.DecorationService=_;class v extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=c(2585),m=c(8343);class h{constructor(...w){this._entries=new Map;for(const[k,_]of w)this.set(k,_)}set(w,k){const _=this._entries.get(w);return this._entries.set(w,k),_}forEach(w){for(const[k,_]of this._entries.entries())w(k,_)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}l.ServiceCollection=h,l.InstantiationService=class{constructor(){this._services=new h,this._services.set(f.IInstantiationService,this)}setService(x,w){this._services.set(x,w)}getService(x){return this._services.get(x)}createInstance(x,...w){const k=(0,m.getServiceDependencies)(x).sort(((b,g)=>b.index-g.index)),_=[];for(const b of k){const g=this._services.get(b.id);if(!g)throw new Error(`[createInstance] ${x.name} depends on UNKNOWN service ${b.id}.`);_.push(g)}const v=k.length>0?k[0].index:w.length;if(w.length!==v)throw new Error(`[createInstance] First service dependency of ${x.name} at position ${v+1} conflicts with ${w.length} static arguments`);return new x(...w,..._)}}},7866:function(d,l,c){var f=this&&this.__decorate||function(v,b,g,y){var j,E=arguments.length,P=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(v,b,g,y);else for(var T=v.length-1;T>=0;T--)(j=v[T])&&(P=(E<3?j(P):E>3?j(b,g,P):j(b,g))||P);return E>3&&P&&Object.defineProperty(b,g,P),P},m=this&&this.__param||function(v,b){return function(g,y){b(g,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const h=c(844),x=c(2585),w={trace:x.LogLevelEnum.TRACE,debug:x.LogLevelEnum.DEBUG,info:x.LogLevelEnum.INFO,warn:x.LogLevelEnum.WARN,error:x.LogLevelEnum.ERROR,off:x.LogLevelEnum.OFF};let k,_=l.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=x.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;b<v.length;b++)typeof v[b]=="function"&&(v[b]=v[b]())}_log(v,b,g){this._evalLazyOptionalParams(g),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...g)}trace(v,...b){var g;this._logLevel<=x.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,v,b)}debug(v,...b){var g;this._logLevel<=x.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,v,b)}info(v,...b){var g;this._logLevel<=x.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,v,b)}warn(v,...b){var g;this._logLevel<=x.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,v,b)}error(v,...b){var g;this._logLevel<=x.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,v,b)}};l.LogService=_=f([m(0,x.IOptionsService)],_),l.setTraceLogger=function(v){k=v},l.traceCall=function(v,b,g){if(typeof g.value!="function")throw new Error("not supported");const y=g.value;g.value=function(...j){if(k.logLevel!==x.LogLevelEnum.TRACE)return y.apply(this,j);k.trace(`GlyphRenderer#${y.name}(${j.map((P=>JSON.stringify(P))).join(", ")})`);const E=y.apply(this,j);return k.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=c(8460),m=c(844),h=c(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const x=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends m.Disposable{constructor(_){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...l.DEFAULT_OPTIONS};for(const b in _)if(b in v)try{const g=_[b];v[b]=this._sanitizeAndValidateOption(b,g)}catch(g){console.error(g)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,v){return this.onOptionChange((b=>{b===_&&v(this.rawOptions[_])}))}onMultipleOptionChange(_,v){return this.onOptionChange((b=>{_.indexOf(b)!==-1&&v()}))}_setupOptions(){const _=b=>{if(!(b in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,g)=>{if(!(b in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);g=this._sanitizeAndValidateOption(b,g),this.rawOptions[b]!==g&&(this.rawOptions[b]=g,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const g={get:_.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,g)}}_sanitizeAndValidateOption(_,v){switch(_){case"cursorStyle":if(v||(v=l.DEFAULT_OPTIONS[_]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${_}`);break;case"wordSeparator":v||(v=l.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=x.includes(v)?v:l.DEFAULT_OPTIONS[_];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${_} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${_} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}l.OptionsService=w},2660:function(d,l,c){var f=this&&this.__decorate||function(w,k,_,v){var b,g=arguments.length,y=g<3?k:v===null?v=Object.getOwnPropertyDescriptor(k,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,k,_,v);else for(var j=w.length-1;j>=0;j--)(b=w[j])&&(y=(g<3?b(y):g>3?b(k,_,y):b(k,_))||y);return g>3&&y&&Object.defineProperty(k,_,y),y},m=this&&this.__param||function(w,k){return function(_,v){k(_,v,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const h=c(2585);let x=l.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const k=this._bufferService.buffer;if(w.id===void 0){const j=k.addMarker(k.ybase+k.y),E={data:w,id:this._nextId++,lines:[j]};return j.onDispose((()=>this._removeMarkerFromLink(E,j))),this._dataByLinkId.set(E.id,E),E.id}const _=w,v=this._getEntryIdKey(_),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,k.ybase+k.y),b.id;const g=k.addMarker(k.ybase+k.y),y={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(y,g))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(w,k){const _=this._dataByLinkId.get(w);if(_&&_.lines.every((v=>v.line!==k))){const v=this._bufferService.buffer.addMarker(k);_.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(_,v)))}}getLinkData(w){var k;return(k=this._dataByLinkId.get(w))==null?void 0:k.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,k){const _=w.lines.indexOf(k);_!==-1&&(w.lines.splice(_,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};l.OscLinkService=x=f([m(0,h.IBufferService)],x)},8343:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[f]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const h=function(x,w,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,v,b){v[c]===v?v[f].push({id:_,index:b}):(v[f]=[{id:_,index:b}],v[c]=v)})(h,x,k)};return h.toString=()=>m,l.serviceRegistry.set(m,h),h}},2585:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=c(8343);var m;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=c(8460),m=c(225);class h{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,k,_=!1){return(16777215&w)<<3|(3&k)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const w=new m.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let k=0,_=0;const v=w.length;for(let b=0;b<v;++b){let g=w.charCodeAt(b);if(55296<=g&&g<=56319){if(++b>=v)return k+this.wcwidth(g);const E=w.charCodeAt(b);56320<=E&&E<=57343?g=1024*(g-55296)+E-56320+65536:k+=this.wcwidth(E)}const y=this.charProperties(g,_);let j=h.extractWidth(y);h.extractShouldJoin(y)&&(j-=h.extractWidth(_)),k+=j,_=y}return k}charProperties(w,k){return this._activeProvider.charProperties(w,k)}}l.UnicodeService=h}},s={};function o(d){var l=s[d];if(l!==void 0)return l.exports;var c=s[d]={exports:{}};return r[d].call(c.exports,c,c.exports,o),c.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const l=o(9042),c=o(3236),f=o(844),m=o(5741),h=o(8285),x=o(7975),w=o(7090),k=["cols","rows"];class _ extends f.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const g=j=>this._core.options[j],y=(j,E)=>{this._checkReadonlyOptions(j),this._core.options[j]=E};for(const j in this._core.options){const E={get:g.bind(this,j),set:y.bind(this,j)};Object.defineProperty(this._publicOptions,j,E)}}_checkReadonlyOptions(b){if(k.includes(b))throw new Error(`Option "${b}" 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 x.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const g in b)this._publicOptions[g]=b[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,g=!0){this._core.input(b,g)}resize(b,g){this._verifyIntegers(b,g),this._core.resize(b,g)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,g,y){this._verifyIntegers(b,g,y),this._core.select(b,g,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,g){this._verifyIntegers(b,g),this._core.selectLines(b,g)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,g){this._core.write(b,g)}writeln(b,g){this._core.write(b),this._core.write(`\r
|
|
543
543
|
`,g)}paste(b){this._core.paste(b)}refresh(b,g){this._verifyIntegers(b,g),this._core.refresh(b,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return l}_verifyIntegers(...b){for(const g of b)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const g of b)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}d.Terminal=_})(),u})()))})(Kf)),Kf.exports}var RB=TB(),qf={exports:{}},Hb;function MB(){return Hb||(Hb=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const u=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(u._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,u=o._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),h=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),x=f-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(x/u.css.cell.width)),rows:Math.max(1,Math.floor(h/u.css.cell.height))}}}})(),r})()))})(qf)),qf.exports}var DB=MB(),Yf={exports:{}},Wb;function LB(){return Wb||(Wb=1,(function(e,t){(function(r,s){e.exports=s()})(self,(()=>(()=>{var r={6:(d,l)=>{function c(m){try{const h=new URL(m),x=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return m.toLocaleLowerCase().startsWith(x.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(m,h,x,w={}){this._terminal=m,this._regex=h,this._handler=x,this._options=w}provideLinks(m,h){const x=f.computeLink(m,this._regex,this._terminal,this._handler);h(this._addCallbacks(x))}_addCallbacks(m){return m.map((h=>(h.leave=this._options.leave,h.hover=(x,w)=>{if(this._options.hover){const{range:k}=h;this._options.hover(x,w,k)}},h)))}};class f{static computeLink(h,x,w,k){const _=new RegExp(x.source,(x.flags||"")+"g"),[v,b]=f._getWindowedLineStrings(h-1,w),g=v.join("");let y;const j=[];for(;y=_.exec(g);){const E=y[0];if(!c(E))continue;const[P,T]=f._mapStrIdx(w,b,0,y.index),[N,R]=f._mapStrIdx(w,P,T,E.length);if(P===-1||T===-1||N===-1||R===-1)continue;const I={start:{x:T+1,y:P+1},end:{x:R,y:N+1}};j.push({range:I,text:E,activate:k})}return j}static _getWindowedLineStrings(h,x){let w,k=h,_=h,v=0,b="";const g=[];if(w=x.buffer.active.getLine(h)){const y=w.translateToString(!0);if(w.isWrapped&&y[0]!==" "){for(v=0;(w=x.buffer.active.getLine(--k))&&v<2048&&(b=w.translateToString(!0),v+=b.length,g.push(b),w.isWrapped&&b.indexOf(" ")===-1););g.reverse()}for(g.push(y),v=0;(w=x.buffer.active.getLine(++_))&&w.isWrapped&&v<2048&&(b=w.translateToString(!0),v+=b.length,g.push(b),b.indexOf(" ")===-1););}return[g,k]}static _mapStrIdx(h,x,w,k){const _=h.buffer.active,v=_.getNullCell();let b=w;for(;k;){const g=_.getLine(x);if(!g)return[-1,-1];for(let y=b;y<g.length;++y){g.getCell(y,v);const j=v.getChars();if(v.getWidth()&&(k-=j.length||1,y===g.length-1&&j==="")){const E=_.getLine(x+1);E&&E.isWrapped&&(E.getCell(0,v),v.getWidth()===2&&(k+=1))}if(k<0)return[x,y]}x++,b=0}return[x,b]}}l.LinkComputer=f}},s={};function o(d){var l=s[d];if(l!==void 0)return l.exports;var c=s[d]={exports:{}};return r[d](c,c.exports,o),c.exports}var u={};return(()=>{var d=u;Object.defineProperty(d,"__esModule",{value:!0}),d.WebLinksAddon=void 0;const l=o(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(m,h){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}d.WebLinksAddon=class{constructor(m=f,h={}){this._handler=m,this._options=h}activate(m){this._terminal=m;const h=this._options,x=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,x,this._handler,h))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),u})()))})(Yf)),Yf.exports}var IB=LB();function Sd({cwd:e,initialCommand:t,onExit:r,onReady:s,className:o="",height:u="400px"}){const d=C.useRef(null),l=C.useRef(null),c=C.useRef(null),f=C.useRef(null),[m,h]=C.useState(!1),[x,w]=C.useState(null);C.useEffect(()=>{if(!d.current||l.current)return;const b=new RB.Terminal({cursorBlink:!0,cursorStyle:"block",fontSize:13,fontFamily:"'JetBrains Mono', 'Fira Code', 'Consolas', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",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:"#ffffff"},allowProposedApi:!0}),g=new DB.FitAddon;b.loadAddon(g),c.current=g;const y=new IB.WebLinksAddon;return b.loadAddon(y),b.open(d.current),l.current=b,setTimeout(()=>{g.fit(),b.focus()},0),k(b),()=>{f.current&&f.current.close(),b.dispose(),l.current=null}},[]);const k=C.useCallback(b=>{const g=window.location.protocol==="https:"?"wss:":"ws:",y=window.location.hostname,j=3333,E=new URLSearchParams;e&&E.set("cwd",e),t&&E.set("cmd",t);const P=`${g}//${y}:${j}/ws/terminal?${E.toString()}`;console.log("Connecting to terminal WebSocket:",P);const T=new WebSocket(P);f.current=T,T.onopen=()=>{console.log("Terminal WebSocket connected"),h(!0)},T.onmessage=N=>{try{const R=JSON.parse(N.data);switch(R.type){case"session":w(R.sessionId),s&&s(R.sessionId);break;case"output":b.write(R.data);break;case"exit":b.write(`\r
|
|
544
544
|
\x1B[33m[Process exited]\x1B[0m\r
|
|
@@ -566,10 +566,10 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
|
|
|
566
566
|
}`,className:"font-mono text-sm min-h-[100px]"})]})]})]})]})]})}const $F=[{id:"Default",name:"Default"},{id:"GitHub",name:"GitHub"},{id:"Monokai",name:"Monokai"},{id:"SolarizedDark",name:"Solarized Dark"},{id:"SolarizedLight",name:"Solarized Light"}],zF=[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Most capable"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",description:"Fast and efficient"},{id:"gemini-2.0-pro",name:"Gemini 2.0 Pro",description:"Previous generation"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",description:"Previous generation fast"}];function Rj({settings:e,onSave:t,loading:r,settingsPath:s}){var T,N,R,I;const[o,u]=C.useState(e||{}),[d,l]=C.useState(!1),[c,f]=C.useState("rich"),[m,h]=C.useState(JSON.stringify(e||{},null,2)),[x,w]=C.useState({open:!1,name:"",json:""}),[k,_]=C.useState({}),v=async()=>{l(!0);try{if(c==="json")try{const O=JSON.parse(m);await t(O),u(O)}catch{ee.error("Invalid JSON"),l(!1);return}else await t(o),h(JSON.stringify(o,null,2));ee.success("Settings saved")}finally{l(!1)}},b=(O,$,W)=>{u(Y=>({...Y,[O]:{...Y[O],[$]:W}}))},g=(O,$,W=!1)=>{var Y;return((Y=o==null?void 0:o[O])==null?void 0:Y[$])??W},y=o.mcpServers||{},j=()=>{const{name:O,json:$}=x;if(!O.trim()){ee.error("Please enter a name for the MCP");return}let W;try{W=JSON.parse($)}catch{ee.error("Invalid JSON configuration");return}if(!W.command){ee.error('MCP config must have a "command" field');return}u(Y=>({...Y,mcpServers:{...Y.mcpServers,[O.trim()]:W}})),w({open:!1,name:"",json:""}),ee.success(`Added MCP: ${O}`)},E=O=>{u($=>{const{[O]:W,...Y}=$.mcpServers||{};return{...$,mcpServers:Y}}),ee.success(`Removed MCP: ${O}`)},P=O=>{_($=>({...$,[O]:!$[O]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:n.jsx(Ft,{className:"w-5 h-5 text-blue-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Gemini CLI Settings",n.jsxs(Qe,{variant:"outline",className:"text-xs font-normal text-blue-600 border-blue-300 dark:border-blue-700",children:[n.jsx(Ht,{className:"w-3 h-3 mr-1"}),"Google"]})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:s})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),n.jsxs(le,{onClick:v,disabled:d||r,children:[d?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),c==="json"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(pt,{value:m,onChange:O=>h(O.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Fn,{className:"w-4 h-4 text-blue-500"}),"MCP Servers",n.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(y).length})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
567
567
|
"command": "npx",
|
|
568
568
|
"args": ["-y", "@example/mcp-server"]
|
|
569
|
-
}`}),children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([O,$])=>n.jsxs(Ml,{open:k[O],onOpenChange:()=>P(O),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Dl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[O]?n.jsx(Sr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(Kr,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Fn,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"font-medium text-sm",children:O}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.command})]}),n.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(O),children:n.jsx(jn,{className:"w-4 h-4"})})]}),n.jsx(Ll,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify($,null,2)})})})]},O))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ht,{className:"w-4 h-4 text-blue-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),n.jsxs(fr,{value:g("model","name",""),onValueChange:O=>b("model","name",O),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{placeholder:"Select model"})}),n.jsx(lr,{children:zF.map(O=>n.jsx(xt,{value:O.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:O.name})})},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),n.jsx(dt,{checked:g("general","previewFeatures",!1),onCheckedChange:O=>b("general","previewFeatures",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(u5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),n.jsxs(fr,{value:g("ui","theme","Default"),onValueChange:O=>b("ui","theme",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsx(lr,{children:$F.map(O=>n.jsx(xt,{value:O.id,children:O.name},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),n.jsxs(fr,{value:g("output","format","text"),onValueChange:O=>b("output","format",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"text",children:"Text"}),n.jsx(xt,{value:"json",children:"JSON"})]})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(k1,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),n.jsx(dt,{checked:g("ui","dynamicWindowTitle",!0),onCheckedChange:O=>b("ui","dynamicWindowTitle",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),n.jsx(dt,{checked:g("ui","showLineNumbers",!0),onCheckedChange:O=>b("ui","showLineNumbers",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),n.jsx(dt,{checked:g("ui","showCitations",!1),onCheckedChange:O=>b("ui","showCitations",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),n.jsx(dt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:O=>b("ui","hideContextSummary",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),n.jsx(dt,{checked:g("ui","hideFooter",!1),onCheckedChange:O=>b("ui","hideFooter",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),n.jsx(dt,{checked:((N=(T=o==null?void 0:o.ui)==null?void 0:T.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:O=>u($=>{var W;return{...$,ui:{...$.ui,accessibility:{...(W=$.ui)==null?void 0:W.accessibility,screenReader:O}}}})})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-blue-500"}),"General"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),n.jsx(dt,{checked:g("general","vimMode",!1),onCheckedChange:O=>b("general","vimMode",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),n.jsx(dt,{checked:g("general","enableAutoUpdate",!0),onCheckedChange:O=>b("general","enableAutoUpdate",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),n.jsx(dt,{checked:((I=(R=o==null?void 0:o.general)==null?void 0:R.checkpointing)==null?void 0:I.enabled)??!1,onCheckedChange:O=>u($=>{var W;return{...$,general:{...$.general,checkpointing:{...(W=$.general)==null?void 0:W.checkpointing,enabled:O}}}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),n.jsx(dt,{checked:g("general","respectGitignore",!0),onCheckedChange:O=>b("general","respectGitignore",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),n.jsx(dt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:O=>b("privacy","usageStatisticsEnabled",O)})]})})]})]}),n.jsx(Tt,{open:x.open,onOpenChange:O=>w({...x,open:O}),children:n.jsxs(St,{className:"bg-card",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP Server"}),n.jsx(tr,{children:"Add a new MCP server to Gemini CLI"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{value:x.name,onChange:O=>w({...x,name:O.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(pt,{value:x.json,onChange:O=>w({...x,json:O.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(le,{onClick:j,children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HF({content:e,parsed:t,onSave:r,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);r(c)},u=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),d=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return u&&!d?n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Rj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Tj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function WF({open:e,onClose:t,item:r,intermediatePaths:s,onMove:o}){const[u,d]=C.useState("copy"),[l,c]=C.useState(null),[f,m]=C.useState(""),[h,x]=C.useState(!1),w=()=>{const k=f.trim()||l;if(!k){ee.error("Please select or enter a target path");return}o(r.path,k,u,h)};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{children:[u==="copy"?"Copy":"Move"," ",r==null?void 0:r.name]}),n.jsx(tr,{children:"Select a destination for this file"})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:u==="copy"?"default":"outline",size:"sm",onClick:()=>d("copy"),children:[n.jsx(Cu,{className:"w-4 h-4 mr-1"})," Copy"]}),n.jsxs(le,{variant:u==="move"?"default":"outline",size:"sm",onClick:()=>d("move"),children:[n.jsx(j1,{className:"w-4 h-4 mr-1"})," Move"]})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>n.jsxs("div",{className:je("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?n.jsx(Vp,{className:"w-4 h-4"}):n.jsx(wr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?n.jsx(Qe,{variant:"secondary",className:"text-xs",children:"exists"}):n.jsx(Qe,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),n.jsx(ct,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(dt,{checked:h,onCheckedChange:x}),n.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:w,children:u==="copy"?"Copy":"Move"})]})]})})}function VF({open:e,onClose:t,item:r,onRename:s}){const[o,u]=C.useState("");C.useEffect(()=>{r!=null&&r.name&&u(r.name.replace(/\.md$/,""))},[r,e]);const d=()=>{if(!o.trim()){ee.error("Please enter a name");return}s(r,o.trim())};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Rename ",r==null?void 0:r.type]})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"New name"}),n.jsx(ct,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>l.key==="Enter"&&d()}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:d,children:"Rename"})]})]})})}function UF({open:e,onClose:t,dir:r,type:s,onCreate:o}){const[u,d]=C.useState("");C.useEffect(()=>{d("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!u.trim()){ee.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?u.endsWith(".md")?u:`${u}.md`:u;o(r,m,s)},c=dl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-sm",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Create ",c.label||s]})}),f&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:u,onChange:m=>d(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:l,children:"Create"})]})]})})}function GF({project:e,onRefresh:t}){var De,Re,Ze;const[r,s]=C.useState([]),[o,u]=C.useState([]),[d,l]=C.useState(null),[c,f]=C.useState(null),[m,h]=C.useState(null),[x,w]=C.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=C.useState({}),[v,b]=C.useState(!0),[g,y]=C.useState({open:!1,item:null}),[j,E]=C.useState({open:!1,dir:null,type:null}),[P,T]=C.useState({open:!1,item:null}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,projectDir:null}),[$,W]=C.useState({open:!1,dir:null,name:null}),[Y,z]=C.useState({open:!1,dir:null}),[K,G]=C.useState({x:0,y:0,item:null}),[U,L]=C.useState(["claude"]),M=C.useCallback(async()=>{var Se;try{b(!0);const[ge,Me,ht,Rt]=await Promise.all([ke.getClaudeFolders(),ke.getIntermediatePaths(),ke.getRegistry(),ke.getConfig()]);if(s(ge),u(Me),l(ht),L(((Se=Rt.config)==null?void 0:Se.enabledTools)||["claude"]),ge.length>0){const pe=localStorage.getItem("claude-config-expanded-folder");if(!pe||!ge.find(be=>be.dir===pe)){const be=ge.filter(Ke=>!Ke.isSubproject),Be=be.length>1?be[be.length-1]:be[0],Ge=(Be==null?void 0:Be.dir)||ge[0].dir;w(Ge);try{localStorage.setItem("claude-config-expanded-folder",Ge)}catch{}}}}catch(ge){ee.error("Failed to load data: "+ge.message)}finally{b(!1)}},[]);C.useEffect(()=>{M(),f(null),h(null)},[M,e==null?void 0:e.dir]);const B=Se=>{const ge=x===Se?null:Se;w(ge);try{ge?localStorage.setItem("claude-config-expanded-folder",ge):localStorage.removeItem("claude-config-expanded-folder")}catch{}},q=async Se=>{f(Se);try{const ge=await ke.getClaudeFile(Se.path);h(ge)}catch(ge){ee.error("Failed to load file: "+ge.message)}},F=async Se=>{if(c)try{await ke.saveClaudeFile(c.path,Se),ee.success("Saved");const ge=await ke.getClaudeFile(c.path);h(ge),M()}catch(ge){ee.error("Failed to save: "+ge.message)}},oe=Se=>{_(ge=>({...ge,[Se]:!ge[Se]}))},fe=(Se,ge)=>{Se.preventDefault(),G({x:Se.clientX,y:Se.clientY,item:ge})},me=async(Se,ge)=>{ge==="command"||ge==="rule"||ge==="workflow"||ge==="memory"?E({open:!0,dir:Se,type:ge}):ge==="claudemd"?z({open:!0,dir:Se}):X(Se,ge==="mcps"?"mcps.json":ge==="settings"?"settings.json":ge==="env"?".env":"CLAUDE.md",ge)},X=async(Se,ge,Me)=>{try{const ht=await ke.createClaudeFile(Se,ge,Me);if(ee.success("Created"),E({open:!1,dir:null,type:null}),await M(),ht.path){const Rt={path:ht.path,name:ge,type:Me==="command"?"command":Me==="rule"?"rule":Me==="workflow"?"workflow":"file"};f(Rt),h(ht.content||"")}}catch(ht){ee.error("Failed to create: "+ht.message)}},H=async(Se,ge)=>{try{const Me=await ke.renameClaudeFile(Se.path,ge);Me.success?(ee.success("Renamed"),T({open:!1,item:null}),await M(),f({...Se,path:Me.newPath,name:ge.endsWith(".md")?ge:`${ge}.md`})):ee.error(Me.error||"Failed to rename")}catch(Me){ee.error("Failed to rename: "+Me.message)}},ae=async Se=>{if(confirm(`Delete ${Se.name}?`))try{await ke.deleteClaudeFile(Se.path),ee.success("Deleted"),(c==null?void 0:c.path)===Se.path&&(f(null),h(null)),M()}catch(ge){ee.error("Failed to delete: "+ge.message)}},ne=async(Se,ge,Me,ht)=>{try{await ke.moveClaudeItem(Se,ge,Me,ht),ee.success(Me==="copy"?"Copied":"Moved"),y({open:!1,item:null}),M()}catch(Rt){ee.error("Failed: "+Rt.message)}},J=async Se=>{if(Se)try{const ge=await ke.addManualSubproject(I.projectDir,Se);ge.success?(ee.success(`Added sub-project: ${Se.split("/").pop()}`),O({open:!1,projectDir:null}),M()):ee.error(ge.error||"Failed to add sub-project")}catch(ge){ee.error("Failed to add sub-project: "+ge.message)}},ie=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.removeManualSubproject(ge.dir,Se);Me.success?(ee.success("Removed sub-project"),M()):ee.error(Me.error||"Failed to remove sub-project")}catch(Me){ee.error("Failed to remove sub-project: "+Me.message)}},ye=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.hideSubproject(ge.dir,Se);Me.success?(ee.success("Sub-project hidden"),M()):ee.error(Me.error||"Failed to hide sub-project")}catch(Me){ee.error("Failed to hide sub-project: "+Me.message)}},Oe=()=>{if(!c||!m)return n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Pm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return n.jsx(HB,{content:m.content,parsed:m.parsed,onSave:F,registry:d});case"settings":return n.jsx(HF,{content:m.content,parsed:m.parsed,onSave:F,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return n.jsx(Vb,{content:m.content,onSave:F,fileType:c.type});default:return n.jsx(Vb,{content:m.content,onSave:F,fileType:"claudemd"})}};if(v)return n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})});const Ve=r.some(Se=>Se.isSubproject),re=(Se,ge)=>ge===0,de=(Se,ge)=>{const Me=r.findIndex(ht=>ht.isSubproject);return!Se.isSubproject&&(Me>=0?ge===Me-1:ge===r.length-1)};return n.jsxs("div",{className:"h-full flex",children:[n.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[n.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),n.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&n.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),title:"Sync rules between tools",children:[n.jsx(Q4,{className:"w-4 h-4 mr-1"}),"Sync"]}),n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,children:n.jsx(pr,{className:"w-4 h-4"})})]})]}),n.jsx(Nn,{className:"flex-1",children:r.map((Se,ge)=>n.jsx(BB,{folder:Se,isExpanded:x===Se.dir,isHome:re(Se,ge),isProject:de(Se,ge),isSubproject:Se.isSubproject,depth:Se.depth||0,onToggle:()=>B(Se.dir),onCreateFile:me,onInstallPlugin:(Me,ht)=>W({open:!0,dir:Me,name:ht}),onSelectItem:q,selectedPath:c==null?void 0:c.path,onContextMenu:fe,expandedFolders:k,onToggleFolder:oe,hasSubprojects:Ve,onAddSubproject:Me=>O({open:!0,projectDir:Me}),onRemoveSubproject:ie,onHideSubproject:ye},Se.dir))})]}),n.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[n.jsx("div",{className:"flex items-center gap-2 text-sm",children:n.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:n.jsx(Cu,{className:"w-4 h-4"})}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ae(c),children:n.jsx(jn,{className:"w-4 h-4"})})]})]}),n.jsx("div",{className:"flex-1",children:Oe()})]}),K.item&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>G({x:0,y:0,item:null})}),n.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:K.x,top:K.y},children:[(((De=K.item)==null?void 0:De.type)==="rule"||((Re=K.item)==null?void 0:Re.type)==="command"||((Ze=K.item)==null?void 0:Ze.type)==="workflow")&&n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{T({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(N1,{className:"w-4 h-4 mr-2"})," Rename"]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(Cu,{className:"w-4 h-4 mr-2"})," Copy to..."]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(j1,{className:"w-4 h-4 mr-2"})," Move to..."]}),n.jsx("div",{className:"border-t my-1"}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ae(K.item),G({x:0,y:0,item:null})},children:[n.jsx(jn,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),n.jsx(WF,{open:g.open,onClose:()=>y({open:!1,item:null}),item:g.item,intermediatePaths:o,onMove:ne}),n.jsx(UF,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),n.jsx(VF,{open:P.open,onClose:()=>T({open:!1,item:null}),item:P.item,onRename:H}),n.jsx(YO,{open:N,onOpenChange:R,projectDir:e==null?void 0:e.dir,onSynced:M}),n.jsx(AB,{open:$.open,onOpenChange:Se=>W({...$,open:Se}),projectDir:$.dir,projectName:$.name}),n.jsx(_g,{open:I.open,onOpenChange:Se=>O({...I,open:Se}),onSelect:J,type:"directory",title:"Add Sub-project",initialPath:I.projectDir||"~"}),n.jsx(OB,{open:Y.open,onOpenChange:Se=>{z({...Y,open:Se}),Se||M()},title:"Initialize CLAUDE.md",description:"Running claude /init to generate project-aware CLAUDE.md",cwd:Y.dir,initialCommand:"claude /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function KF({projects:e=[],activeProject:t=null,onSwitch:r,onAddClick:s,onManageClick:o,disabled:u=!1}){const d=(t==null?void 0:t.name)||"No Project";return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:u,children:[n.jsx(si,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium",children:d}),n.jsx(Sr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ks,{align:"start",className:"w-72",children:[n.jsx(ul,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),n.jsx(Or,{}),e.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[n.jsx(wr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),n.jsx("p",{children:"No projects registered"}),n.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>n.jsxs(Pt,{onClick:()=>!l.isActive&&r(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?n.jsx(Kt,{className:"w-4 h-4 text-indigo-600"}):l.exists?n.jsx(wr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Xu,{className:"w-4 h-4 text-amber-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),n.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&n.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:s,className:"gap-2 cursor-pointer",children:[n.jsx(yt,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&n.jsxs(Pt,{onClick:o,className:"gap-2 cursor-pointer",children:[n.jsx(Tm,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}const Xf="claude-config-welcome-seen";function qF({onStartTutorial:e}){const[t,r]=C.useState(!1),[s,o]=C.useState(!0);C.useEffect(()=>{if(!localStorage.getItem(Xf)){const c=setTimeout(()=>r(!0),500);return()=>clearTimeout(c)}},[]);const u=()=>{s&&localStorage.setItem(Xf,"true"),r(!1)},d=()=>{s&&localStorage.setItem(Xf,"true"),r(!1),e==null||e()};return n.jsx(Tt,{open:t,onOpenChange:r,children:n.jsxs(St,{className:"sm:max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(kn,{className:"w-6 h-6 text-white"})}),n.jsx(kt,{className:"text-2xl",children:"Welcome to Coder Config"})]}),n.jsx(tr,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Coder Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(ns,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(as,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(Ht,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx(jl,{id:"dont-ask",checked:s,onCheckedChange:o}),n.jsx(Bt,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),n.jsxs(It,{className:"flex gap-2 sm:gap-2",children:[n.jsx(le,{variant:"ghost",onClick:u,children:"Skip for now"}),n.jsxs(le,{onClick:d,className:"gap-2",children:[n.jsx(ku,{className:"w-4 h-4"}),"Start Tutorial",n.jsx(Hp,{className:"w-4 h-4"})]})]})]})})}const Jf="claude-config:claude-init-preference";function Mj({open:e,onOpenChange:t,onAdded:r}){const[s,o]=C.useState(""),[u,d]=C.useState(""),[l,c]=C.useState(!1),[f,m]=C.useState(!1),[h,x]=C.useState(!0);C.useEffect(()=>{const v=localStorage.getItem(Jf);v==="never"?x(!1):v==="always"&&x(!0)},[]),C.useEffect(()=>{if(e){o(""),d("");const v=localStorage.getItem(Jf);x(v!=="never")}},[e]),C.useEffect(()=>{if(s&&!u){const v=s.split("/").pop();d(v||"")}},[s]);const w=v=>{o(v),c(!1)},k=async()=>{if(!s){ee.error("Please select a project path");return}m(!0);try{const v=await ke.addProject(s,u||void 0,h);v.error?ee.error(v.error):(v.claudeInitRan?ee.success(`Added project: ${v.project.name} (initialized with Claude Code)`):v.claudeInitError?(ee.success(`Added project: ${v.project.name}`),ee.warning("Could not run claude /init - is Claude Code installed?")):ee.success(`Added project: ${v.project.name}`),r==null||r(v.project),t(!1))}catch(v){ee.error("Failed to add project: "+v.message)}finally{m(!1)}},_=v=>{localStorage.setItem(Jf,v),v==="never"?x(!1):v==="always"&&x(!0),ee.success(`Preference saved: ${v==="always"?"Always":v==="never"?"Never":"Ask each time"} run claude /init`)};return n.jsxs(n.Fragment,{children:[n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(si,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),n.jsx(tr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"path",children:"Project Path"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{id:"path",value:s,onChange:v=>o(v.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:n.jsx(si,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"name",children:"Display Name"}),n.jsx(ct,{id:"name",value:u,onChange:v=>d(v.target.value),placeholder:"Auto-filled from folder name"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),n.jsxs("div",{className:"border-t pt-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(jl,{id:"claudeInit",checked:h,onCheckedChange:x,className:"mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs(Bt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[n.jsx(Ht,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("always"),children:"Always"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("never"),children:"Never"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("ask"),children:"Ask each time"})]})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:k,disabled:f||!s,children:f?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx(_g,{open:l,onOpenChange:c,onSelect:w,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Dj=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function YF({children:e}){const[t,r]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[s,o]=C.useState("light");C.useEffect(()=>{const d=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?d.classList.add("dark"):d.classList.remove("dark")};l(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{t==="auto"&&l("auto")};return c.addEventListener("change",f),()=>c.removeEventListener("change",f)},[t]);const u=d=>{r(d);try{localStorage.setItem("claude-config-theme",d)}catch{}};return n.jsx(Dj.Provider,{value:{theme:t,setTheme:u,resolvedTheme:s},children:e})}function XF(){return C.useContext(Dj)}function JF(){const{theme:e,setTheme:t,resolvedTheme:r}=XF(),s=r==="dark"?rb:ib;return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[n.jsx(s,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),n.jsxs(ks,{align:"end",children:[n.jsxs(Pt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[n.jsx(ib,{className:"mr-2 h-4 w-4"}),"Light"]}),n.jsxs(Pt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[n.jsx(rb,{className:"mr-2 h-4 w-4"}),"Dark"]}),n.jsxs(Pt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[n.jsx(k1,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var QF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZF=QF.reduce((e,t)=>{const r=Qu(`Primitive.${t}`),s=C.forwardRef((o,u)=>{const{asChild:d,...l}=o,c=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),e8="Separator",qb="horizontal",t8=["horizontal","vertical"],Lj=C.forwardRef((e,t)=>{const{decorative:r,orientation:s=qb,...o}=e,u=r8(s)?s:qb,l=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return n.jsx(ZF.div,{"data-orientation":u,...l,...o,ref:t})});Lj.displayName=e8;function r8(e){return t8.includes(e)}var Ij=Lj;const Oj=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>n.jsx(Ij,{ref:o,decorative:r,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Oj.displayName=Ij.displayName;function n8(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const s8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o8={};function Yb(e,t){return(o8.jsx?i8:s8).test(e)}const a8=/[ \t\n\f\r]/g;function l8(e){return typeof e=="object"?e.type==="text"?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(a8,"")===""}class Il{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}Il.prototype.normal={};Il.prototype.property={};Il.prototype.space=void 0;function Bj(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Il(r,s,t)}function Xm(e){return e.toLowerCase()}class Jr{constructor(t,r){this.attribute=r,this.property=t}}Jr.prototype.attribute="";Jr.prototype.booleanish=!1;Jr.prototype.boolean=!1;Jr.prototype.commaOrSpaceSeparated=!1;Jr.prototype.commaSeparated=!1;Jr.prototype.defined=!1;Jr.prototype.mustUseProperty=!1;Jr.prototype.number=!1;Jr.prototype.overloadedBoolean=!1;Jr.prototype.property="";Jr.prototype.spaceSeparated=!1;Jr.prototype.space=void 0;let c8=0;const ot=Ki(),er=Ki(),Jm=Ki(),Ce=Ki(),Et=Ki(),To=Ki(),nn=Ki();function Ki(){return 2**++c8}const Qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:er,commaOrSpaceSeparated:nn,commaSeparated:To,number:Ce,overloadedBoolean:Jm,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Qm);class Ig extends Jr{constructor(t,r,s,o){let u=-1;if(super(t,r),Jb(this,"space",o),typeof s=="number")for(;++u<Qf.length;){const d=Qf[u];Jb(this,Qf[u],(s&Qm[d])===Qm[d])}}}Ig.prototype.defined=!0;function Jb(e,t,r){r&&(e[t]=r)}function Qo(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const u=new Ig(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,r[Xm(s)]=s,r[Xm(u.attribute)]=s}return new Il(t,r,e.space)}const Fj=Qo({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:er,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:Et,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:Ce,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:Et,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:er,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $j(e,t){return t in e?e[t]:t}function zj(e,t){return $j(e,t.toLowerCase())}const u8=Qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:To,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Et,autoFocus:ot,autoPlay:ot,blocking:Et,capture:null,charSet:null,checked:ot,cite:null,className:Et,cols:Ce,colSpan:null,content:null,contentEditable:er,controls:ot,controlsList:Et,coords:Ce|To,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:Jm,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Et,height:Ce,hidden:Jm,high:Ce,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Et,itemRef:Et,itemScope:ot,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ce,pattern:null,ping:Et,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Et,required:ot,reversed:ot,rows:Ce,rowSpan:Ce,sandbox:Et,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:er,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:zj}),d8=Qo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:nn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:To,g2:To,glyphName:To,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nn,rev:nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nn,requiredFeatures:nn,requiredFonts:nn,requiredFormats:nn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$j}),Hj=Qo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wj=Qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zj}),Vj=Qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),h8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},f8=/[A-Z]/g,Qb=/-[a-z]/g,m8=/^data[-\w.:]+$/i;function p8(e,t){const r=Xm(t);let s=t,o=Jr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&m8.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Qb,x8);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Qb.test(u)){let d=u.replace(f8,g8);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}o=Ig}return new o(s,t)}function g8(e){return"-"+e.toLowerCase()}function x8(e){return e.charAt(1).toUpperCase()}const v8=Bj([Fj,u8,Hj,Wj,Vj],"html"),Og=Bj([Fj,d8,Hj,Wj,Vj],"svg");function y8(e){return e.join(" ").trim()}var wo={},Zf,Zb;function b8(){if(Zb)return Zf;Zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
569
|
+
}`}),children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([O,$])=>n.jsxs(Ml,{open:k[O],onOpenChange:()=>P(O),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Dl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[O]?n.jsx(Sr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(Kr,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Fn,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"font-medium text-sm",children:O}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.command})]}),n.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(O),children:n.jsx(jn,{className:"w-4 h-4"})})]}),n.jsx(Ll,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify($,null,2)})})})]},O))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ht,{className:"w-4 h-4 text-blue-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),n.jsxs(fr,{value:g("model","name",""),onValueChange:O=>b("model","name",O),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{placeholder:"Select model"})}),n.jsx(lr,{children:zF.map(O=>n.jsx(xt,{value:O.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:O.name})})},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),n.jsx(dt,{checked:g("general","previewFeatures",!1),onCheckedChange:O=>b("general","previewFeatures",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(u5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),n.jsxs(fr,{value:g("ui","theme","Default"),onValueChange:O=>b("ui","theme",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsx(lr,{children:$F.map(O=>n.jsx(xt,{value:O.id,children:O.name},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),n.jsxs(fr,{value:g("output","format","text"),onValueChange:O=>b("output","format",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"text",children:"Text"}),n.jsx(xt,{value:"json",children:"JSON"})]})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(k1,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),n.jsx(dt,{checked:g("ui","dynamicWindowTitle",!0),onCheckedChange:O=>b("ui","dynamicWindowTitle",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),n.jsx(dt,{checked:g("ui","showLineNumbers",!0),onCheckedChange:O=>b("ui","showLineNumbers",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),n.jsx(dt,{checked:g("ui","showCitations",!1),onCheckedChange:O=>b("ui","showCitations",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),n.jsx(dt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:O=>b("ui","hideContextSummary",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),n.jsx(dt,{checked:g("ui","hideFooter",!1),onCheckedChange:O=>b("ui","hideFooter",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),n.jsx(dt,{checked:((N=(T=o==null?void 0:o.ui)==null?void 0:T.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:O=>u($=>{var W;return{...$,ui:{...$.ui,accessibility:{...(W=$.ui)==null?void 0:W.accessibility,screenReader:O}}}})})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-blue-500"}),"General"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),n.jsx(dt,{checked:g("general","vimMode",!1),onCheckedChange:O=>b("general","vimMode",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),n.jsx(dt,{checked:g("general","enableAutoUpdate",!0),onCheckedChange:O=>b("general","enableAutoUpdate",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),n.jsx(dt,{checked:((I=(R=o==null?void 0:o.general)==null?void 0:R.checkpointing)==null?void 0:I.enabled)??!1,onCheckedChange:O=>u($=>{var W;return{...$,general:{...$.general,checkpointing:{...(W=$.general)==null?void 0:W.checkpointing,enabled:O}}}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),n.jsx(dt,{checked:g("general","respectGitignore",!0),onCheckedChange:O=>b("general","respectGitignore",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),n.jsx(dt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:O=>b("privacy","usageStatisticsEnabled",O)})]})})]})]}),n.jsx(Tt,{open:x.open,onOpenChange:O=>w({...x,open:O}),children:n.jsxs(St,{className:"bg-card",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP Server"}),n.jsx(tr,{children:"Add a new MCP server to Gemini CLI"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{value:x.name,onChange:O=>w({...x,name:O.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(pt,{value:x.json,onChange:O=>w({...x,json:O.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(le,{onClick:j,children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HF({content:e,parsed:t,onSave:r,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);r(c)},u=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),d=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return u&&!d?n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Rj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Tj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function WF({open:e,onClose:t,item:r,intermediatePaths:s,onMove:o}){const[u,d]=C.useState("copy"),[l,c]=C.useState(null),[f,m]=C.useState(""),[h,x]=C.useState(!1),w=()=>{const k=f.trim()||l;if(!k){ee.error("Please select or enter a target path");return}o(r.path,k,u,h)};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{children:[u==="copy"?"Copy":"Move"," ",r==null?void 0:r.name]}),n.jsx(tr,{children:"Select a destination for this file"})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:u==="copy"?"default":"outline",size:"sm",onClick:()=>d("copy"),children:[n.jsx(Cu,{className:"w-4 h-4 mr-1"})," Copy"]}),n.jsxs(le,{variant:u==="move"?"default":"outline",size:"sm",onClick:()=>d("move"),children:[n.jsx(j1,{className:"w-4 h-4 mr-1"})," Move"]})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>n.jsxs("div",{className:je("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?n.jsx(Vp,{className:"w-4 h-4"}):n.jsx(wr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?n.jsx(Qe,{variant:"secondary",className:"text-xs",children:"exists"}):n.jsx(Qe,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),n.jsx(ct,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(dt,{checked:h,onCheckedChange:x}),n.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:w,children:u==="copy"?"Copy":"Move"})]})]})})}function VF({open:e,onClose:t,item:r,onRename:s}){const[o,u]=C.useState("");C.useEffect(()=>{r!=null&&r.name&&u(r.name.replace(/\.md$/,""))},[r,e]);const d=()=>{if(!o.trim()){ee.error("Please enter a name");return}s(r,o.trim())};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Rename ",r==null?void 0:r.type]})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"New name"}),n.jsx(ct,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>l.key==="Enter"&&d()}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:d,children:"Rename"})]})]})})}function UF({open:e,onClose:t,dir:r,type:s,onCreate:o}){const[u,d]=C.useState("");C.useEffect(()=>{d("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!u.trim()){ee.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?u.endsWith(".md")?u:`${u}.md`:u;o(r,m,s)},c=dl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-sm",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Create ",c.label||s]})}),f&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:u,onChange:m=>d(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:l,children:"Create"})]})]})})}function GF({project:e,onRefresh:t}){var De,Re,Ze;const[r,s]=C.useState([]),[o,u]=C.useState([]),[d,l]=C.useState(null),[c,f]=C.useState(null),[m,h]=C.useState(null),[x,w]=C.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=C.useState({}),[v,b]=C.useState(!0),[g,y]=C.useState({open:!1,item:null}),[j,E]=C.useState({open:!1,dir:null,type:null}),[P,T]=C.useState({open:!1,item:null}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,projectDir:null}),[$,W]=C.useState({open:!1,dir:null,name:null}),[Y,z]=C.useState({open:!1,dir:null}),[K,G]=C.useState({x:0,y:0,item:null}),[U,L]=C.useState(["claude"]),M=C.useCallback(async()=>{var Se;try{b(!0);const[ge,Me,ht,Rt]=await Promise.all([ke.getClaudeFolders(),ke.getIntermediatePaths(),ke.getRegistry(),ke.getConfig()]);if(s(ge),u(Me),l(ht),L(((Se=Rt.config)==null?void 0:Se.enabledTools)||["claude"]),ge.length>0){const pe=localStorage.getItem("claude-config-expanded-folder");if(!pe||!ge.find(be=>be.dir===pe)){const be=ge.filter(Ke=>!Ke.isSubproject),Be=be.length>1?be[be.length-1]:be[0],Ge=(Be==null?void 0:Be.dir)||ge[0].dir;w(Ge);try{localStorage.setItem("claude-config-expanded-folder",Ge)}catch{}}}}catch(ge){ee.error("Failed to load data: "+ge.message)}finally{b(!1)}},[]);C.useEffect(()=>{M(),f(null),h(null)},[M,e==null?void 0:e.dir]);const B=Se=>{const ge=x===Se?null:Se;w(ge);try{ge?localStorage.setItem("claude-config-expanded-folder",ge):localStorage.removeItem("claude-config-expanded-folder")}catch{}},q=async Se=>{f(Se);try{const ge=await ke.getClaudeFile(Se.path);h(ge)}catch(ge){ee.error("Failed to load file: "+ge.message)}},F=async Se=>{if(c)try{await ke.saveClaudeFile(c.path,Se),ee.success("Saved");const ge=await ke.getClaudeFile(c.path);h(ge),M()}catch(ge){ee.error("Failed to save: "+ge.message)}},oe=Se=>{_(ge=>({...ge,[Se]:!ge[Se]}))},fe=(Se,ge)=>{Se.preventDefault(),G({x:Se.clientX,y:Se.clientY,item:ge})},me=async(Se,ge)=>{ge==="command"||ge==="rule"||ge==="workflow"||ge==="memory"?E({open:!0,dir:Se,type:ge}):ge==="claudemd"?z({open:!0,dir:Se}):X(Se,ge==="mcps"?"mcps.json":ge==="settings"?"settings.json":ge==="env"?".env":"CLAUDE.md",ge)},X=async(Se,ge,Me)=>{try{const ht=await ke.createClaudeFile(Se,ge,Me);if(ee.success("Created"),E({open:!1,dir:null,type:null}),await M(),ht.path){const Rt={path:ht.path,name:ge,type:Me==="command"?"command":Me==="rule"?"rule":Me==="workflow"?"workflow":"file"};f(Rt),h(ht.content||"")}}catch(ht){ee.error("Failed to create: "+ht.message)}},H=async(Se,ge)=>{try{const Me=await ke.renameClaudeFile(Se.path,ge);Me.success?(ee.success("Renamed"),T({open:!1,item:null}),await M(),f({...Se,path:Me.newPath,name:ge.endsWith(".md")?ge:`${ge}.md`})):ee.error(Me.error||"Failed to rename")}catch(Me){ee.error("Failed to rename: "+Me.message)}},ae=async Se=>{if(confirm(`Delete ${Se.name}?`))try{await ke.deleteClaudeFile(Se.path),ee.success("Deleted"),(c==null?void 0:c.path)===Se.path&&(f(null),h(null)),M()}catch(ge){ee.error("Failed to delete: "+ge.message)}},ne=async(Se,ge,Me,ht)=>{try{await ke.moveClaudeItem(Se,ge,Me,ht),ee.success(Me==="copy"?"Copied":"Moved"),y({open:!1,item:null}),M()}catch(Rt){ee.error("Failed: "+Rt.message)}},J=async Se=>{if(Se)try{const ge=await ke.addManualSubproject(I.projectDir,Se);ge.success?(ee.success(`Added sub-project: ${Se.split("/").pop()}`),O({open:!1,projectDir:null}),M()):ee.error(ge.error||"Failed to add sub-project")}catch(ge){ee.error("Failed to add sub-project: "+ge.message)}},ie=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.removeManualSubproject(ge.dir,Se);Me.success?(ee.success("Removed sub-project"),M()):ee.error(Me.error||"Failed to remove sub-project")}catch(Me){ee.error("Failed to remove sub-project: "+Me.message)}},ye=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.hideSubproject(ge.dir,Se);Me.success?(ee.success("Sub-project hidden"),M()):ee.error(Me.error||"Failed to hide sub-project")}catch(Me){ee.error("Failed to hide sub-project: "+Me.message)}},Oe=()=>{if(!c||!m)return n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Pm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return n.jsx(HB,{content:m.content,parsed:m.parsed,onSave:F,registry:d});case"settings":return n.jsx(HF,{content:m.content,parsed:m.parsed,onSave:F,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return n.jsx(Vb,{content:m.content,onSave:F,fileType:c.type});default:return n.jsx(Vb,{content:m.content,onSave:F,fileType:"claudemd"})}};if(v)return n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})});const Ve=r.some(Se=>Se.isSubproject),te=(Se,ge)=>ge===0,de=(Se,ge)=>{const Me=r.findIndex(ht=>ht.isSubproject);return!Se.isSubproject&&(Me>=0?ge===Me-1:ge===r.length-1)};return n.jsxs("div",{className:"h-full flex",children:[n.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[n.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),n.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&n.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),title:"Sync rules between tools",children:[n.jsx(Q4,{className:"w-4 h-4 mr-1"}),"Sync"]}),n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,children:n.jsx(pr,{className:"w-4 h-4"})})]})]}),n.jsx(Nn,{className:"flex-1",children:r.map((Se,ge)=>n.jsx(BB,{folder:Se,isExpanded:x===Se.dir,isHome:te(Se,ge),isProject:de(Se,ge),isSubproject:Se.isSubproject,depth:Se.depth||0,onToggle:()=>B(Se.dir),onCreateFile:me,onInstallPlugin:(Me,ht)=>W({open:!0,dir:Me,name:ht}),onSelectItem:q,selectedPath:c==null?void 0:c.path,onContextMenu:fe,expandedFolders:k,onToggleFolder:oe,hasSubprojects:Ve,onAddSubproject:Me=>O({open:!0,projectDir:Me}),onRemoveSubproject:ie,onHideSubproject:ye},Se.dir))})]}),n.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[n.jsx("div",{className:"flex items-center gap-2 text-sm",children:n.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:n.jsx(Cu,{className:"w-4 h-4"})}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ae(c),children:n.jsx(jn,{className:"w-4 h-4"})})]})]}),n.jsx("div",{className:"flex-1",children:Oe()})]}),K.item&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>G({x:0,y:0,item:null})}),n.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:K.x,top:K.y},children:[(((De=K.item)==null?void 0:De.type)==="rule"||((Re=K.item)==null?void 0:Re.type)==="command"||((Ze=K.item)==null?void 0:Ze.type)==="workflow")&&n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{T({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(N1,{className:"w-4 h-4 mr-2"})," Rename"]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(Cu,{className:"w-4 h-4 mr-2"})," Copy to..."]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(j1,{className:"w-4 h-4 mr-2"})," Move to..."]}),n.jsx("div",{className:"border-t my-1"}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ae(K.item),G({x:0,y:0,item:null})},children:[n.jsx(jn,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),n.jsx(WF,{open:g.open,onClose:()=>y({open:!1,item:null}),item:g.item,intermediatePaths:o,onMove:ne}),n.jsx(UF,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),n.jsx(VF,{open:P.open,onClose:()=>T({open:!1,item:null}),item:P.item,onRename:H}),n.jsx(YO,{open:N,onOpenChange:R,projectDir:e==null?void 0:e.dir,onSynced:M}),n.jsx(AB,{open:$.open,onOpenChange:Se=>W({...$,open:Se}),projectDir:$.dir,projectName:$.name}),n.jsx(_g,{open:I.open,onOpenChange:Se=>O({...I,open:Se}),onSelect:J,type:"directory",title:"Add Sub-project",initialPath:I.projectDir||"~"}),n.jsx(OB,{open:Y.open,onOpenChange:Se=>{z({...Y,open:Se}),Se||M()},title:"Initialize CLAUDE.md",description:"Running claude /init to generate project-aware CLAUDE.md",cwd:Y.dir,initialCommand:"claude /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function KF({projects:e=[],activeProject:t=null,onSwitch:r,onAddClick:s,onManageClick:o,disabled:u=!1}){const d=(t==null?void 0:t.name)||"No Project";return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:u,children:[n.jsx(si,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium",children:d}),n.jsx(Sr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ks,{align:"start",className:"w-72",children:[n.jsx(ul,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),n.jsx(Or,{}),e.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[n.jsx(wr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),n.jsx("p",{children:"No projects registered"}),n.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>n.jsxs(Pt,{onClick:()=>!l.isActive&&r(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?n.jsx(Kt,{className:"w-4 h-4 text-indigo-600"}):l.exists?n.jsx(wr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Xu,{className:"w-4 h-4 text-amber-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),n.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&n.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:s,className:"gap-2 cursor-pointer",children:[n.jsx(yt,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&n.jsxs(Pt,{onClick:o,className:"gap-2 cursor-pointer",children:[n.jsx(Tm,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}const Xf="claude-config-welcome-seen";function qF({onStartTutorial:e}){const[t,r]=C.useState(!1),[s,o]=C.useState(!0);C.useEffect(()=>{if(!localStorage.getItem(Xf)){const c=setTimeout(()=>r(!0),500);return()=>clearTimeout(c)}},[]);const u=()=>{s&&localStorage.setItem(Xf,"true"),r(!1)},d=()=>{s&&localStorage.setItem(Xf,"true"),r(!1),e==null||e()};return n.jsx(Tt,{open:t,onOpenChange:r,children:n.jsxs(St,{className:"sm:max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(kn,{className:"w-6 h-6 text-white"})}),n.jsx(kt,{className:"text-2xl",children:"Welcome to Coder Config"})]}),n.jsx(tr,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Coder Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(ns,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(as,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(Ht,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx(jl,{id:"dont-ask",checked:s,onCheckedChange:o}),n.jsx(Bt,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),n.jsxs(It,{className:"flex gap-2 sm:gap-2",children:[n.jsx(le,{variant:"ghost",onClick:u,children:"Skip for now"}),n.jsxs(le,{onClick:d,className:"gap-2",children:[n.jsx(ku,{className:"w-4 h-4"}),"Start Tutorial",n.jsx(Hp,{className:"w-4 h-4"})]})]})]})})}const Jf="claude-config:claude-init-preference";function Mj({open:e,onOpenChange:t,onAdded:r}){const[s,o]=C.useState(""),[u,d]=C.useState(""),[l,c]=C.useState(!1),[f,m]=C.useState(!1),[h,x]=C.useState(!0);C.useEffect(()=>{const v=localStorage.getItem(Jf);v==="never"?x(!1):v==="always"&&x(!0)},[]),C.useEffect(()=>{if(e){o(""),d("");const v=localStorage.getItem(Jf);x(v!=="never")}},[e]),C.useEffect(()=>{if(s&&!u){const v=s.split("/").pop();d(v||"")}},[s]);const w=v=>{o(v),c(!1)},k=async()=>{if(!s){ee.error("Please select a project path");return}m(!0);try{const v=await ke.addProject(s,u||void 0,h);v.error?ee.error(v.error):(v.claudeInitRan?ee.success(`Added project: ${v.project.name} (initialized with Claude Code)`):v.claudeInitError?(ee.success(`Added project: ${v.project.name}`),ee.warning("Could not run claude /init - is Claude Code installed?")):ee.success(`Added project: ${v.project.name}`),r==null||r(v.project),t(!1))}catch(v){ee.error("Failed to add project: "+v.message)}finally{m(!1)}},_=v=>{localStorage.setItem(Jf,v),v==="never"?x(!1):v==="always"&&x(!0),ee.success(`Preference saved: ${v==="always"?"Always":v==="never"?"Never":"Ask each time"} run claude /init`)};return n.jsxs(n.Fragment,{children:[n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(si,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),n.jsx(tr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"path",children:"Project Path"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{id:"path",value:s,onChange:v=>o(v.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:n.jsx(si,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"name",children:"Display Name"}),n.jsx(ct,{id:"name",value:u,onChange:v=>d(v.target.value),placeholder:"Auto-filled from folder name"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),n.jsxs("div",{className:"border-t pt-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(jl,{id:"claudeInit",checked:h,onCheckedChange:x,className:"mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs(Bt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[n.jsx(Ht,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("always"),children:"Always"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("never"),children:"Never"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("ask"),children:"Ask each time"})]})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:k,disabled:f||!s,children:f?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx(_g,{open:l,onOpenChange:c,onSelect:w,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Dj=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function YF({children:e}){const[t,r]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[s,o]=C.useState("light");C.useEffect(()=>{const d=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?d.classList.add("dark"):d.classList.remove("dark")};l(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{t==="auto"&&l("auto")};return c.addEventListener("change",f),()=>c.removeEventListener("change",f)},[t]);const u=d=>{r(d);try{localStorage.setItem("claude-config-theme",d)}catch{}};return n.jsx(Dj.Provider,{value:{theme:t,setTheme:u,resolvedTheme:s},children:e})}function XF(){return C.useContext(Dj)}function JF(){const{theme:e,setTheme:t,resolvedTheme:r}=XF(),s=r==="dark"?rb:ib;return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[n.jsx(s,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),n.jsxs(ks,{align:"end",children:[n.jsxs(Pt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[n.jsx(ib,{className:"mr-2 h-4 w-4"}),"Light"]}),n.jsxs(Pt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[n.jsx(rb,{className:"mr-2 h-4 w-4"}),"Dark"]}),n.jsxs(Pt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[n.jsx(k1,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var QF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZF=QF.reduce((e,t)=>{const r=Qu(`Primitive.${t}`),s=C.forwardRef((o,u)=>{const{asChild:d,...l}=o,c=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),e8="Separator",qb="horizontal",t8=["horizontal","vertical"],Lj=C.forwardRef((e,t)=>{const{decorative:r,orientation:s=qb,...o}=e,u=r8(s)?s:qb,l=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return n.jsx(ZF.div,{"data-orientation":u,...l,...o,ref:t})});Lj.displayName=e8;function r8(e){return t8.includes(e)}var Ij=Lj;const Oj=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>n.jsx(Ij,{ref:o,decorative:r,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Oj.displayName=Ij.displayName;function n8(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const s8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o8={};function Yb(e,t){return(o8.jsx?i8:s8).test(e)}const a8=/[ \t\n\f\r]/g;function l8(e){return typeof e=="object"?e.type==="text"?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(a8,"")===""}class Il{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}Il.prototype.normal={};Il.prototype.property={};Il.prototype.space=void 0;function Bj(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Il(r,s,t)}function Xm(e){return e.toLowerCase()}class Jr{constructor(t,r){this.attribute=r,this.property=t}}Jr.prototype.attribute="";Jr.prototype.booleanish=!1;Jr.prototype.boolean=!1;Jr.prototype.commaOrSpaceSeparated=!1;Jr.prototype.commaSeparated=!1;Jr.prototype.defined=!1;Jr.prototype.mustUseProperty=!1;Jr.prototype.number=!1;Jr.prototype.overloadedBoolean=!1;Jr.prototype.property="";Jr.prototype.spaceSeparated=!1;Jr.prototype.space=void 0;let c8=0;const ot=Ki(),er=Ki(),Jm=Ki(),Ce=Ki(),Et=Ki(),To=Ki(),nn=Ki();function Ki(){return 2**++c8}const Qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:er,commaOrSpaceSeparated:nn,commaSeparated:To,number:Ce,overloadedBoolean:Jm,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Qm);class Ig extends Jr{constructor(t,r,s,o){let u=-1;if(super(t,r),Jb(this,"space",o),typeof s=="number")for(;++u<Qf.length;){const d=Qf[u];Jb(this,Qf[u],(s&Qm[d])===Qm[d])}}}Ig.prototype.defined=!0;function Jb(e,t,r){r&&(e[t]=r)}function Qo(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const u=new Ig(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,r[Xm(s)]=s,r[Xm(u.attribute)]=s}return new Il(t,r,e.space)}const Fj=Qo({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:er,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:Et,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:Ce,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:Et,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:er,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $j(e,t){return t in e?e[t]:t}function zj(e,t){return $j(e,t.toLowerCase())}const u8=Qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:To,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Et,autoFocus:ot,autoPlay:ot,blocking:Et,capture:null,charSet:null,checked:ot,cite:null,className:Et,cols:Ce,colSpan:null,content:null,contentEditable:er,controls:ot,controlsList:Et,coords:Ce|To,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:Jm,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Et,height:Ce,hidden:Jm,high:Ce,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Et,itemRef:Et,itemScope:ot,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ce,pattern:null,ping:Et,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Et,required:ot,reversed:ot,rows:Ce,rowSpan:Ce,sandbox:Et,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:er,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:zj}),d8=Qo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:nn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:To,g2:To,glyphName:To,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nn,rev:nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nn,requiredFeatures:nn,requiredFonts:nn,requiredFormats:nn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$j}),Hj=Qo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wj=Qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zj}),Vj=Qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),h8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},f8=/[A-Z]/g,Qb=/-[a-z]/g,m8=/^data[-\w.:]+$/i;function p8(e,t){const r=Xm(t);let s=t,o=Jr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&m8.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Qb,x8);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Qb.test(u)){let d=u.replace(f8,g8);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}o=Ig}return new o(s,t)}function g8(e){return"-"+e.toLowerCase()}function x8(e){return e.charAt(1).toUpperCase()}const v8=Bj([Fj,u8,Hj,Wj,Vj],"html"),Og=Bj([Fj,d8,Hj,Wj,Vj],"svg");function y8(e){return e.join(" ").trim()}var wo={},Zf,Zb;function b8(){if(Zb)return Zf;Zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
570
570
|
`,f="/",m="*",h="",x="comment",w="declaration";function k(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var g=1,y=1;function j(Y){var z=Y.match(t);z&&(g+=z.length);var K=Y.lastIndexOf(c);y=~K?Y.length-K:y+Y.length}function E(){var Y={line:g,column:y};return function(z){return z.position=new P(Y),R(),z}}function P(Y){this.start=Y,this.end={line:g,column:y},this.source=b.source}P.prototype.content=v;function T(Y){var z=new Error(b.source+":"+g+":"+y+": "+Y);if(z.reason=Y,z.filename=b.source,z.line=g,z.column=y,z.source=v,!b.silent)throw z}function N(Y){var z=Y.exec(v);if(z){var K=z[0];return j(K),v=v.slice(K.length),z}}function R(){N(r)}function I(Y){var z;for(Y=Y||[];z=O();)z!==!1&&Y.push(z);return Y}function O(){var Y=E();if(!(f!=v.charAt(0)||m!=v.charAt(1))){for(var z=2;h!=v.charAt(z)&&(m!=v.charAt(z)||f!=v.charAt(z+1));)++z;if(z+=2,h===v.charAt(z-1))return T("End of comment missing");var K=v.slice(2,z-2);return y+=2,j(K),v=v.slice(z),y+=2,Y({type:x,comment:K})}}function $(){var Y=E(),z=N(s);if(z){if(O(),!N(o))return T("property missing ':'");var K=N(u),G=Y({type:w,property:_(z[0].replace(e,h)),value:K?_(K[0].replace(e,h)):h});return N(d),G}}function W(){var Y=[];I(Y);for(var z;z=$();)z!==!1&&(Y.push(z),I(Y));return Y}return R(),W()}function _(v){return v?v.replace(l,h):h}return Zf=k,Zf}var ew;function w8(){if(ew)return wo;ew=1;var e=wo&&wo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(wo,"__esModule",{value:!0}),wo.default=r;const t=e(b8());function r(s,o){let u=null;if(!s||typeof s!="string")return u;const d=(0,t.default)(s),l=typeof o=="function";return d.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:m}=c;l?o(f,m,c):m&&(u=u||{},u[f]=m)}),u}return wo}var Oa={},tw;function _8(){if(tw)return Oa;tw=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(f){return!f||r.test(f)||e.test(f)},d=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},c=function(f,m){return m===void 0&&(m={}),u(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,l):f=f.replace(s,l),f.replace(t,d))};return Oa.camelCase=c,Oa}var Ba,rw;function S8(){if(rw)return Ba;rw=1;var e=Ba&&Ba.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(w8()),r=_8();function s(o,u){var d={};return!o||typeof o!="string"||(0,t.default)(o,function(l,c){l&&c&&(d[(0,r.camelCase)(l,u)]=c)}),d}return s.default=s,Ba=s,Ba}var C8=S8();const k8=ml(C8),Uj=Gj("end"),Bg=Gj("start");function Gj(e){return t;function t(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function j8(e){const t=Bg(e),r=Uj(e);if(t&&r)return{start:t,end:r}}function Ja(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nw(e.position):"start"in e||"end"in e?nw(e):"line"in e||"column"in e?Zm(e):""}function Zm(e){return sw(e&&e.line)+":"+sw(e&&e.column)}function nw(e){return Zm(e&&e.start)+"-"+Zm(e&&e.end)}function sw(e){return e&&typeof e=="number"?e:1}class Dr extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",u={},d=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof t=="string"?o=t:!u.cause&&t&&(d=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?u.ruleId=s:(u.source=s.slice(0,c),u.ruleId=s.slice(c+1))}if(!u.place&&u.ancestors&&u.ancestors){const c=u.ancestors[u.ancestors.length-1];c&&(u.place=c.position)}const l=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=Ja(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dr.prototype.file="";Dr.prototype.name="";Dr.prototype.reason="";Dr.prototype.message="";Dr.prototype.stack="";Dr.prototype.column=void 0;Dr.prototype.line=void 0;Dr.prototype.ancestors=void 0;Dr.prototype.cause=void 0;Dr.prototype.fatal=void 0;Dr.prototype.place=void 0;Dr.prototype.ruleId=void 0;Dr.prototype.source=void 0;const Fg={}.hasOwnProperty,N8=new Map,E8=/[A-Z]/g,P8=new Set(["table","tbody","thead","tfoot","tr"]),A8=new Set(["td","th"]),Kj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=F8(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=B8(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Og:v8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=qj(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function qj(e,t,r){if(t.type==="element")return R8(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return M8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return L8(e,t,r);if(t.type==="mdxjsEsm")return D8(e,t);if(t.type==="root")return I8(e,t,r);if(t.type==="text")return O8(e,t)}function R8(e,t,r){const s=e.schema;let o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=Og,e.schema=o),e.ancestors.push(t);const u=Xj(e,t.tagName,!1),d=$8(e,t);let l=zg(e,t);return P8.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!l8(c):!0})),Yj(e,d,u,t),$g(d,l),e.ancestors.pop(),e.schema=s,e.create(t,u,d,r)}function M8(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}fl(e,t.position)}function D8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fl(e,t.position)}function L8(e,t,r){const s=e.schema;let o=s;t.name==="svg"&&s.space==="html"&&(o=Og,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:Xj(e,t.name,!0),d=z8(e,t),l=zg(e,t);return Yj(e,d,u,t),$g(d,l),e.ancestors.pop(),e.schema=s,e.create(t,u,d,r)}function I8(e,t,r){const s={};return $g(s,zg(e,t)),e.create(t,e.Fragment,s,r)}function O8(e,t){return t.value}function Yj(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function $g(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function B8(e,t,r){return s;function s(o,u,d,l){const f=Array.isArray(d.children)?r:t;return l?f(u,d,l):f(u,d)}}function F8(e,t){return r;function r(s,o,u,d){const l=Array.isArray(u.children),c=Bg(s);return t(o,u,d,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function $8(e,t){const r={};let s,o;for(o in t.properties)if(o!=="children"&&Fg.call(t.properties,o)){const u=H8(e,o,t.properties[o]);if(u){const[d,l]=u;e.tableCellAlignToStyle&&d==="align"&&typeof l=="string"&&A8.has(t.tagName)?s=l:r[d]=l}}if(s){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function z8(e,t){const r={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const u=s.data.estree.body[0];u.type;const d=u.expression;d.type;const l=d.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else fl(e,t.position);else{const o=s.name;let u;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,u=e.evaluater.evaluateExpression(l.expression)}else fl(e,t.position);else u=s.value===null?!0:s.value;r[o]=u}return r}function zg(e,t){const r=[];let s=-1;const o=e.passKeys?new Map:N8;for(;++s<t.children.length;){const u=t.children[s];let d;if(e.passKeys){const c=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(c){const f=o.get(c)||0;d=c+"-"+f,o.set(c,f+1)}}const l=qj(e,u,d);l!==void 0&&r.push(l)}return r}function H8(e,t,r){const s=p8(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?n8(r):y8(r)),s.property==="style"){let o=typeof r=="object"?r:W8(e,String(r));return e.stylePropertyNameCase==="css"&&(o=V8(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?h8[s.property]||s.property:s.attribute,r]}}function W8(e,t){try{return k8(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,o=new Dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Kj+"#cannot-parse-style-attribute",o}}function Xj(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,d;for(;++u<o.length;){const l=Yb(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:l,computed:!!(u&&l.type==="Literal"),optional:!1}:l}s=d}else s=Yb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const o=s.value;return Fg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);fl(e)}function fl(e,t){const r=new Dr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Kj+"#cannot-handle-mdx-estrees-without-createevaluater",r}function V8(e){const t={};let r;for(r in e)Fg.call(e,r)&&(t[U8(r)]=e[r]);return t}function U8(e){let t=e.replace(E8,G8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function G8(e){return"-"+e.toLowerCase()}const em={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},K8={};function q8(e,t){const r=K8,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Jj(e,s,o)}function Jj(e,t,r){if(Y8(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iw(e.children,t,r)}return Array.isArray(e)?iw(e,t,r):""}function iw(e,t,r){const s=[];let o=-1;for(;++o<e.length;)s[o]=Jj(e[o],t,r);return s.join("")}function Y8(e){return!!(e&&typeof e=="object")}const ow=document.createElement("i");function Hg(e){const t="&"+e+";";ow.innerHTML=t;const r=ow.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function os(e,t,r,s){const o=e.length;let u=0,d;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)d=Array.from(s),d.unshift(t,r),e.splice(...d);else for(r&&e.splice(t,r);u<s.length;)d=s.slice(u,u+1e4),d.unshift(t,0),e.splice(...d),u+=1e4,t+=1e4}function _n(e,t){return e.length>0?(os(e,e.length,0,t),e):t}const aw={}.hasOwnProperty;function X8(e){const t={};let r=-1;for(;++r<e.length;)J8(t,e[r]);return t}function J8(e,t){let r;for(r in t){const o=(aw.call(e,r)?e[r]:void 0)||(e[r]={}),u=t[r];let d;if(u)for(d in u){aw.call(o,d)||(o[d]=[]);const l=u[d];Q8(o[d],Array.isArray(l)?l:l?[l]:[])}}}function Q8(e,t){let r=-1;const s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);os(e,0,0,s)}function Qj(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ro(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jn=fi(/[A-Za-z]/),ln=fi(/[\dA-Za-z]/),Z8=fi(/[#-'*+\--9=?A-Z^-~]/);function ep(e){return e!==null&&(e<32||e===127)}const tp=fi(/\d/),e7=fi(/[\dA-Fa-f]/),t7=fi(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function Yr(e){return e!==null&&(e<0||e===32)}function vt(e){return e===-2||e===-1||e===32}const r7=fi(new RegExp("\\p{P}|\\p{S}","u")),n7=fi(/\s/);function fi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Zo(e){const t=[];let r=-1,s=0,o=0;for(;++r<e.length;){const u=e.charCodeAt(r);let d="";if(u===37&&ln(e.charCodeAt(r+1))&&ln(e.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const l=e.charCodeAt(r+1);u<56320&&l>56319&&l<57344?(d=String.fromCharCode(u,l),o=1):d="�"}else d=String.fromCharCode(u);d&&(t.push(e.slice(s,r),encodeURIComponent(d)),s=r+o+1,d=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function At(e,t,r,s){const o=s?s-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(c){return vt(c)?(e.enter(r),l(c)):t(c)}function l(c){return vt(c)&&u++<o?(e.consume(c),l):(e.exit(r),t(c))}}const s7={tokenize:i7};function i7(e){const t=e.attempt(this.parser.constructs.contentInitial,s,o);let r;return t;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),At(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),u(l)}function u(l){const c=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,d(l)}function d(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return nt(l)?(e.consume(l),e.exit("chunkText"),u):(e.consume(l),d)}}const o7={tokenize:a7},lw={tokenize:l7};function a7(e){const t=this,r=[];let s=0,o,u,d;return l;function l(y){if(s<r.length){const j=r[s];return t.containerState=j[1],e.attempt(j[0].continuation,c,f)(y)}return f(y)}function c(y){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&g();const j=t.events.length;let E=j,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){P=t.events[E][1].end;break}b(s);let T=j;for(;T<t.events.length;)t.events[T][1].end={...P},T++;return os(t.events,E+1,0,t.events.slice(j)),t.events.length=T,f(y)}return l(y)}function f(y){if(s===r.length){if(!o)return x(y);if(o.currentConstruct&&o.currentConstruct.concrete)return k(y);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lw,m,h)(y)}function m(y){return o&&g(),b(s),x(y)}function h(y){return t.parser.lazy[t.now().line]=s!==r.length,d=t.now().offset,k(y)}function x(y){return t.containerState={},e.attempt(lw,w,k)(y)}function w(y){return s++,r.push([t.currentConstruct,t.containerState]),x(y)}function k(y){if(y===null){o&&g(),b(0),e.consume(y);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),_(y)}function _(y){if(y===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(y);return}return nt(y)?(e.consume(y),v(e.exit("chunkFlow")),s=0,t.interrupt=void 0,l):(e.consume(y),_)}function v(y,j){const E=t.sliceStream(y);if(j&&E.push(null),y.previous=u,u&&(u.next=y),u=y,o.defineSkip(y.start),o.write(E),t.parser.lazy[y.start.line]){let P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<d&&(!o.events[P][1].end||o.events[P][1].end.offset>d))return;const T=t.events.length;let N=T,R,I;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(R){I=t.events[N][1].end;break}R=!0}for(b(s),P=T;P<t.events.length;)t.events[P][1].end={...I},P++;os(t.events,N+1,0,t.events.slice(T)),t.events.length=P}}function b(y){let j=r.length;for(;j-- >y;){const E=r[j];t.containerState=E[1],E[0].exit.call(t,e)}r.length=y}function g(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function l7(e,t,r){return At(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cw(e){if(e===null||Yr(e)||n7(e))return 1;if(r7(e))return 2}function Wg(e,t,r){const s=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!s.includes(u)&&(t=u(t,r),s.push(u))}return t}const rp={name:"attention",resolveAll:c7,tokenize:u7};function c7(e,t){let r=-1,s,o,u,d,l,c,f,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;c=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const h={...e[s][1].end},x={...e[r][1].start};uw(h,-c),uw(x,c),d={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[s][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},u={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:c>1?"strong":"emphasis",start:{...d.start},end:{...l.end}},e[s][1].end={...d.start},e[r][1].start={...l.end},f=[],e[s][1].end.offset-e[s][1].start.offset&&(f=_n(f,[["enter",e[s][1],t],["exit",e[s][1],t]])),f=_n(f,[["enter",o,t],["enter",d,t],["exit",d,t],["enter",u,t]]),f=_n(f,Wg(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),f=_n(f,[["exit",u,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,f=_n(f,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,os(e,s-1,r-s+3,f),r=s+f.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function u7(e,t){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=cw(s);let u;return d;function d(c){return u=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===u)return e.consume(c),l;const f=e.exit("attentionSequence"),m=cw(c),h=!m||m===2&&o||r.includes(c),x=!o||o===2&&m||r.includes(s);return f._open=!!(u===42?h:h&&(o||!x)),f._close=!!(u===42?x:x&&(m||!h)),t(c)}}function uw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const d7={name:"autolink",tokenize:h7};function h7(e,t,r){let s=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(w){return Jn(w)?(e.consume(w),d):w===64?r(w):f(w)}function d(w){return w===43||w===45||w===46||ln(w)?(s=1,l(w)):f(w)}function l(w){return w===58?(e.consume(w),s=0,c):(w===43||w===45||w===46||ln(w))&&s++<32?(e.consume(w),l):(s=0,f(w))}function c(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||ep(w)?r(w):(e.consume(w),c)}function f(w){return w===64?(e.consume(w),m):Z8(w)?(e.consume(w),f):r(w)}function m(w){return ln(w)?h(w):r(w)}function h(w){return w===46?(e.consume(w),s=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||ln(w))&&s++<63){const k=w===45?x:h;return e.consume(w),k}return r(w)}}const Ad={partial:!0,tokenize:f7};function f7(e,t,r){return s;function s(u){return vt(u)?At(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||nt(u)?t(u):r(u)}}const Zj={continuation:{tokenize:p7},exit:g7,name:"blockQuote",tokenize:m7};function m7(e,t,r){const s=this;return o;function o(d){if(d===62){const l=s.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return r(d)}function u(d){return vt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(d))}}function p7(e,t,r){const s=this;return o;function o(d){return vt(d)?At(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Zj,t,r)(d)}}function g7(e){e.exit("blockQuote")}const e2={name:"characterEscape",tokenize:x7};function x7(e,t,r){return s;function s(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return t7(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(u)}}const t2={name:"characterReference",tokenize:v7};function v7(e,t,r){const s=this;let o=0,u,d;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),u=31,d=ln,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=e7,m):(e.enter("characterReferenceValue"),u=7,d=tp,m(h))}function m(h){if(h===59&&o){const x=e.exit("characterReferenceValue");return d===ln&&!Hg(s.sliceSerialize(x))?r(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return d(h)&&o++<u?(e.consume(h),m):r(h)}}const dw={partial:!0,tokenize:b7},hw={concrete:!0,name:"codeFenced",tokenize:y7};function y7(e,t,r){const s=this,o={partial:!0,tokenize:E};let u=0,d=0,l;return c;function c(P){return f(P)}function f(P){const T=s.events[s.events.length-1];return u=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(P)}function m(P){return P===l?(d++,e.consume(P),m):d<3?r(P):(e.exit("codeFencedFenceSequence"),vt(P)?At(e,h,"whitespace")(P):h(P))}function h(P){return P===null||nt(P)?(e.exit("codeFencedFence"),s.interrupt?t(P):e.check(dw,_,j)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(P))}function x(P){return P===null||nt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(P)):vt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,w,"whitespace")(P)):P===96&&P===l?r(P):(e.consume(P),x)}function w(P){return P===null||nt(P)?h(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(P))}function k(P){return P===null||nt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(P)):P===96&&P===l?r(P):(e.consume(P),k)}function _(P){return e.attempt(o,j,v)(P)}function v(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b}function b(P){return u>0&&vt(P)?At(e,g,"linePrefix",u+1)(P):g(P)}function g(P){return P===null||nt(P)?e.check(dw,_,j)(P):(e.enter("codeFlowValue"),y(P))}function y(P){return P===null||nt(P)?(e.exit("codeFlowValue"),g(P)):(e.consume(P),y)}function j(P){return e.exit("codeFenced"),t(P)}function E(P,T,N){let R=0;return I;function I(z){return P.enter("lineEnding"),P.consume(z),P.exit("lineEnding"),O}function O(z){return P.enter("codeFencedFence"),vt(z)?At(P,$,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):$(z)}function $(z){return z===l?(P.enter("codeFencedFenceSequence"),W(z)):N(z)}function W(z){return z===l?(R++,P.consume(z),W):R>=d?(P.exit("codeFencedFenceSequence"),vt(z)?At(P,Y,"whitespace")(z):Y(z)):N(z)}function Y(z){return z===null||nt(z)?(P.exit("codeFencedFence"),T(z)):N(z)}}}function b7(e,t,r){const s=this;return o;function o(d){return d===null?r(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return s.parser.lazy[s.now().line]?r(d):t(d)}}const tm={name:"codeIndented",tokenize:_7},w7={partial:!0,tokenize:S7};function _7(e,t,r){const s=this;return o;function o(f){return e.enter("codeIndented"),At(e,u,"linePrefix",5)(f)}function u(f){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?d(f):r(f)}function d(f){return f===null?c(f):nt(f)?e.attempt(w7,d,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||nt(f)?(e.exit("codeFlowValue"),d(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function S7(e,t,r){const s=this;return o;function o(d){return s.parser.lazy[s.now().line]?r(d):nt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):At(e,u,"linePrefix",5)(d)}function u(d){const l=s.events[s.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(d):nt(d)?o(d):r(d)}}const C7={name:"codeText",previous:j7,resolve:k7,tokenize:N7};function k7(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function j7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function N7(e,t,r){let s=0,o,u;return d;function d(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),s++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?r(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(u=e.enter("codeTextSequence"),o=0,m(h)):nt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||nt(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),o++,m):o===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(u.type="codeTextData",f(h))}}class E7{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){const o=r||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&Fa(this.left,s),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fa(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fa(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Fa(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fa(this.left,r.reverse())}}}function Fa(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function r2(e){const t={};let r=-1,s,o,u,d,l,c,f;const m=new E7(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,u=0,u<c.length&&c[u][1].type==="lineEndingBlank"&&(u+=2),u<c.length&&c[u][1].type==="content"))for(;++u<c.length&&c[u][1].type!=="content";)c[u][1].type==="chunkText"&&(c[u][1]._isInFirstContentOfListItem=!0,u++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,P7(m,r)),r=t[r],f=!0);else if(s[1]._container){for(u=r,o=void 0;u--;)if(d=m.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(s[1].end={...m.get(o)[1].start},l=m.slice(o,r),l.unshift(s),m.splice(o,r-o+1,l))}}return os(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function P7(e,t){const r=e.get(t)[1],s=e.get(t)[2];let o=t-1;const u=[];let d=r._tokenizer;d||(d=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const l=d.events,c=[],f={};let m,h,x=-1,w=r,k=0,_=0;const v=[_];for(;w;){for(;e.get(++o)[1]!==w;);u.push(o),w._tokenizer||(m=s.sliceStream(w),w.next||m.push(null),h&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(m),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=r;++x<l.length;)l[x][0]==="exit"&&l[x-1][0]==="enter"&&l[x][1].type===l[x-1][1].type&&l[x][1].start.line!==l[x][1].end.line&&(_=x+1,v.push(_),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):v.pop(),x=v.length;x--;){const b=l.slice(v[x],v[x+1]),g=u.pop();c.push([g,g+b.length-1]),e.splice(g,2,b)}for(c.reverse(),x=-1;++x<c.length;)f[k+c[x][0]]=k+c[x][1],k+=c[x][1]-c[x][0]-1;return f}const A7={resolve:R7,tokenize:M7},T7={partial:!0,tokenize:D7};function R7(e){return r2(e),e}function M7(e,t){let r;return s;function s(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?u(l):nt(l)?e.check(T7,d,u)(l):(e.consume(l),o)}function u(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function d(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function D7(e,t,r){const s=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),At(e,u,"linePrefix")}function u(d){if(d===null||nt(d))return r(d);const l=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(d):e.interrupt(s.parser.constructs.flow,r,t)(d)}}function n2(e,t,r,s,o,u,d,l,c){const f=c||Number.POSITIVE_INFINITY;let m=0;return h;function h(b){return b===60?(e.enter(s),e.enter(o),e.enter(u),e.consume(b),e.exit(u),x):b===null||b===32||b===41||ep(b)?r(b):(e.enter(s),e.enter(d),e.enter(l),e.enter("chunkString",{contentType:"string"}),_(b))}function x(b){return b===62?(e.enter(u),e.consume(b),e.exit(u),e.exit(o),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),w(b))}function w(b){return b===62?(e.exit("chunkString"),e.exit(l),x(b)):b===null||b===60||nt(b)?r(b):(e.consume(b),b===92?k:w)}function k(b){return b===60||b===62||b===92?(e.consume(b),w):w(b)}function _(b){return!m&&(b===null||b===41||Yr(b))?(e.exit("chunkString"),e.exit(l),e.exit(d),e.exit(s),t(b)):m<f&&b===40?(e.consume(b),m++,_):b===41?(e.consume(b),m--,_):b===null||b===32||b===40||ep(b)?r(b):(e.consume(b),b===92?v:_)}function v(b){return b===40||b===41||b===92?(e.consume(b),_):_(b)}}function s2(e,t,r,s,o,u){const d=this;let l=0,c;return f;function f(w){return e.enter(s),e.enter(o),e.consume(w),e.exit(o),e.enter(u),m}function m(w){return l>999||w===null||w===91||w===93&&!c||w===94&&!l&&"_hiddenFootnoteSupport"in d.parser.constructs?r(w):w===93?(e.exit(u),e.enter(o),e.consume(w),e.exit(o),e.exit(s),t):nt(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||nt(w)||l++>999?(e.exit("chunkString"),m(w)):(e.consume(w),c||(c=!vt(w)),w===92?x:h)}function x(w){return w===91||w===92||w===93?(e.consume(w),l++,h):h(w)}}function i2(e,t,r,s,o,u){let d;return l;function l(x){return x===34||x===39||x===40?(e.enter(s),e.enter(o),e.consume(x),e.exit(o),d=x===40?41:x,c):r(x)}function c(x){return x===d?(e.enter(o),e.consume(x),e.exit(o),e.exit(s),t):(e.enter(u),f(x))}function f(x){return x===d?(e.exit(u),c(d)):x===null?r(x):nt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),At(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===d||x===null||nt(x)?(e.exit("chunkString"),f(x)):(e.consume(x),x===92?h:m)}function h(x){return x===d||x===92?(e.consume(x),m):m(x)}}function Qa(e,t){let r;return s;function s(o){return nt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):vt(o)?At(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}const L7={name:"definition",tokenize:O7},I7={partial:!0,tokenize:B7};function O7(e,t,r){const s=this;let o;return u;function u(w){return e.enter("definition"),d(w)}function d(w){return s2.call(s,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function l(w){return o=Ro(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),c):r(w)}function c(w){return Yr(w)?Qa(e,f)(w):f(w)}function f(w){return n2(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(I7,h,h)(w)}function h(w){return vt(w)?At(e,x,"whitespace")(w):x(w)}function x(w){return w===null||nt(w)?(e.exit("definition"),s.parser.defined.push(o),t(w)):r(w)}}function B7(e,t,r){return s;function s(l){return Yr(l)?Qa(e,o)(l):r(l)}function o(l){return i2(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function u(l){return vt(l)?At(e,d,"whitespace")(l):d(l)}function d(l){return l===null||nt(l)?t(l):r(l)}}const F7={name:"hardBreakEscape",tokenize:$7};function $7(e,t,r){return s;function s(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return nt(u)?(e.exit("hardBreakEscape"),t(u)):r(u)}}const z7={name:"headingAtx",resolve:H7,tokenize:W7};function H7(e,t){let r=e.length-2,s=3,o,u;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},u={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},os(e,s,r-s+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function W7(e,t,r){let s=0;return o;function o(m){return e.enter("atxHeading"),u(m)}function u(m){return e.enter("atxHeadingSequence"),d(m)}function d(m){return m===35&&s++<6?(e.consume(m),d):m===null||Yr(m)?(e.exit("atxHeadingSequence"),l(m)):r(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||nt(m)?(e.exit("atxHeading"),t(m)):vt(m)?At(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Yr(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fw=["pre","script","style","textarea"],U7={concrete:!0,name:"htmlFlow",resolveTo:q7,tokenize:Y7},G7={partial:!0,tokenize:J7},K7={partial:!0,tokenize:X7};function q7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Y7(e,t,r){const s=this;let o,u,d,l,c;return f;function f(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),x):F===47?(e.consume(F),u=!0,_):F===63?(e.consume(F),o=3,s.interrupt?t:M):Jn(F)?(e.consume(F),d=String.fromCharCode(F),v):r(F)}function x(F){return F===45?(e.consume(F),o=2,w):F===91?(e.consume(F),o=5,l=0,k):Jn(F)?(e.consume(F),o=4,s.interrupt?t:M):r(F)}function w(F){return F===45?(e.consume(F),s.interrupt?t:M):r(F)}function k(F){const oe="CDATA[";return F===oe.charCodeAt(l++)?(e.consume(F),l===oe.length?s.interrupt?t:$:k):r(F)}function _(F){return Jn(F)?(e.consume(F),d=String.fromCharCode(F),v):r(F)}function v(F){if(F===null||F===47||F===62||Yr(F)){const oe=F===47,fe=d.toLowerCase();return!oe&&!u&&fw.includes(fe)?(o=1,s.interrupt?t(F):$(F)):V7.includes(d.toLowerCase())?(o=6,oe?(e.consume(F),b):s.interrupt?t(F):$(F)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(F):u?g(F):y(F))}return F===45||ln(F)?(e.consume(F),d+=String.fromCharCode(F),v):r(F)}function b(F){return F===62?(e.consume(F),s.interrupt?t:$):r(F)}function g(F){return vt(F)?(e.consume(F),g):I(F)}function y(F){return F===47?(e.consume(F),I):F===58||F===95||Jn(F)?(e.consume(F),j):vt(F)?(e.consume(F),y):I(F)}function j(F){return F===45||F===46||F===58||F===95||ln(F)?(e.consume(F),j):E(F)}function E(F){return F===61?(e.consume(F),P):vt(F)?(e.consume(F),E):y(F)}function P(F){return F===null||F===60||F===61||F===62||F===96?r(F):F===34||F===39?(e.consume(F),c=F,T):vt(F)?(e.consume(F),P):N(F)}function T(F){return F===c?(e.consume(F),c=null,R):F===null||nt(F)?r(F):(e.consume(F),T)}function N(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Yr(F)?E(F):(e.consume(F),N)}function R(F){return F===47||F===62||vt(F)?y(F):r(F)}function I(F){return F===62?(e.consume(F),O):r(F)}function O(F){return F===null||nt(F)?$(F):vt(F)?(e.consume(F),O):r(F)}function $(F){return F===45&&o===2?(e.consume(F),K):F===60&&o===1?(e.consume(F),G):F===62&&o===4?(e.consume(F),B):F===63&&o===3?(e.consume(F),M):F===93&&o===5?(e.consume(F),L):nt(F)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(G7,q,W)(F)):F===null||nt(F)?(e.exit("htmlFlowData"),W(F)):(e.consume(F),$)}function W(F){return e.check(K7,Y,q)(F)}function Y(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),z}function z(F){return F===null||nt(F)?W(F):(e.enter("htmlFlowData"),$(F))}function K(F){return F===45?(e.consume(F),M):$(F)}function G(F){return F===47?(e.consume(F),d="",U):$(F)}function U(F){if(F===62){const oe=d.toLowerCase();return fw.includes(oe)?(e.consume(F),B):$(F)}return Jn(F)&&d.length<8?(e.consume(F),d+=String.fromCharCode(F),U):$(F)}function L(F){return F===93?(e.consume(F),M):$(F)}function M(F){return F===62?(e.consume(F),B):F===45&&o===2?(e.consume(F),M):$(F)}function B(F){return F===null||nt(F)?(e.exit("htmlFlowData"),q(F)):(e.consume(F),B)}function q(F){return e.exit("htmlFlow"),t(F)}}function X7(e,t,r){const s=this;return o;function o(d){return nt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):r(d)}function u(d){return s.parser.lazy[s.now().line]?r(d):t(d)}}function J7(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ad,t,r)}}const Q7={name:"htmlText",tokenize:Z7};function Z7(e,t,r){const s=this;let o,u,d;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),E):M===63?(e.consume(M),y):Jn(M)?(e.consume(M),N):r(M)}function f(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),u=0,k):Jn(M)?(e.consume(M),g):r(M)}function m(M){return M===45?(e.consume(M),w):r(M)}function h(M){return M===null?r(M):M===45?(e.consume(M),x):nt(M)?(d=h,G(M)):(e.consume(M),h)}function x(M){return M===45?(e.consume(M),w):h(M)}function w(M){return M===62?K(M):M===45?x(M):h(M)}function k(M){const B="CDATA[";return M===B.charCodeAt(u++)?(e.consume(M),u===B.length?_:k):r(M)}function _(M){return M===null?r(M):M===93?(e.consume(M),v):nt(M)?(d=_,G(M)):(e.consume(M),_)}function v(M){return M===93?(e.consume(M),b):_(M)}function b(M){return M===62?K(M):M===93?(e.consume(M),b):_(M)}function g(M){return M===null||M===62?K(M):nt(M)?(d=g,G(M)):(e.consume(M),g)}function y(M){return M===null?r(M):M===63?(e.consume(M),j):nt(M)?(d=y,G(M)):(e.consume(M),y)}function j(M){return M===62?K(M):y(M)}function E(M){return Jn(M)?(e.consume(M),P):r(M)}function P(M){return M===45||ln(M)?(e.consume(M),P):T(M)}function T(M){return nt(M)?(d=T,G(M)):vt(M)?(e.consume(M),T):K(M)}function N(M){return M===45||ln(M)?(e.consume(M),N):M===47||M===62||Yr(M)?R(M):r(M)}function R(M){return M===47?(e.consume(M),K):M===58||M===95||Jn(M)?(e.consume(M),I):nt(M)?(d=R,G(M)):vt(M)?(e.consume(M),R):K(M)}function I(M){return M===45||M===46||M===58||M===95||ln(M)?(e.consume(M),I):O(M)}function O(M){return M===61?(e.consume(M),$):nt(M)?(d=O,G(M)):vt(M)?(e.consume(M),O):R(M)}function $(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),o=M,W):nt(M)?(d=$,G(M)):vt(M)?(e.consume(M),$):(e.consume(M),Y)}function W(M){return M===o?(e.consume(M),o=void 0,z):M===null?r(M):nt(M)?(d=W,G(M)):(e.consume(M),W)}function Y(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||Yr(M)?R(M):(e.consume(M),Y)}function z(M){return M===47||M===62||Yr(M)?R(M):r(M)}function K(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):r(M)}function G(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return vt(M)?At(e,L,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),d(M)}}const Vg={name:"labelEnd",resolveAll:n9,resolveTo:s9,tokenize:i9},e9={tokenize:o9},t9={tokenize:a9},r9={tokenize:l9};function n9(e){let t=-1;const r=[];for(;++t<e.length;){const s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&os(e,0,e.length,r),e}function s9(e,t){let r=e.length,s=0,o,u,d,l;for(;r--;)if(o=e[r][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(d=r);const c={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},m={type:"labelText",start:{...e[u+s+2][1].end},end:{...e[d-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=_n(l,e.slice(u+1,u+s+3)),l=_n(l,[["enter",m,t]]),l=_n(l,Wg(t.parser.constructs.insideSpan.null,e.slice(u+s+4,d-3),t)),l=_n(l,[["exit",m,t],e[d-2],e[d-1],["exit",f,t]]),l=_n(l,e.slice(d+1)),l=_n(l,[["exit",c,t]]),os(e,u,e.length,l),e}function i9(e,t,r){const s=this;let o=s.events.length,u,d;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){u=s.events[o][1];break}return l;function l(x){return u?u._inactive?h(x):(d=s.parser.defined.includes(Ro(s.sliceSerialize({start:u.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),c):r(x)}function c(x){return x===40?e.attempt(e9,m,d?m:h)(x):x===91?e.attempt(t9,m,d?f:h)(x):d?m(x):h(x)}function f(x){return e.attempt(r9,m,h)(x)}function m(x){return t(x)}function h(x){return u._balanced=!0,r(x)}}function o9(e,t,r){return s;function s(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Yr(h)?Qa(e,u)(h):u(h)}function u(h){return h===41?m(h):n2(e,d,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function d(h){return Yr(h)?Qa(e,c)(h):m(h)}function l(h){return r(h)}function c(h){return h===34||h===39||h===40?i2(e,f,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Yr(h)?Qa(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):r(h)}}function a9(e,t,r){const s=this;return o;function o(l){return s2.call(s,e,u,d,"reference","referenceMarker","referenceString")(l)}function u(l){return s.parser.defined.includes(Ro(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function d(l){return r(l)}}function l9(e,t,r){return s;function s(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):r(u)}}const c9={name:"labelStartImage",resolveAll:Vg.resolveAll,tokenize:u9};function u9(e,t,r){const s=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),u}function u(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),d):r(l)}function d(l){return l===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(l):t(l)}}const d9={name:"labelStartLink",resolveAll:Vg.resolveAll,tokenize:h9};function h9(e,t,r){const s=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):t(d)}}const rm={name:"lineEnding",tokenize:f9};function f9(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),At(e,t,"linePrefix")}}const gu={name:"thematicBreak",tokenize:m9};function m9(e,t,r){let s=0,o;return u;function u(f){return e.enter("thematicBreak"),d(f)}function d(f){return o=f,l(f)}function l(f){return f===o?(e.enter("thematicBreakSequence"),c(f)):s>=3&&(f===null||nt(f))?(e.exit("thematicBreak"),t(f)):r(f)}function c(f){return f===o?(e.consume(f),s++,c):(e.exit("thematicBreakSequence"),vt(f)?At(e,l,"whitespace")(f):l(f))}}const Ur={continuation:{tokenize:v9},exit:b9,name:"list",tokenize:x9},p9={partial:!0,tokenize:w9},g9={partial:!0,tokenize:y9};function x9(e,t,r){const s=this,o=s.events[s.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return l;function l(w){const k=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:tp(w)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(gu,r,f)(w):f(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(w)}return r(w)}function c(w){return tp(w)&&++d<10?(e.consume(w),c):(!s.interrupt||d<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),f(w)):r(w)}function f(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(Ad,s.interrupt?r:m,e.attempt(p9,x,h))}function m(w){return s.containerState.initialBlankLine=!0,u++,x(w)}function h(w){return vt(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):r(w)}function x(w){return s.containerState.size=u+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function v9(e,t,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Ad,o,u);function o(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,At(e,t,"listItemIndent",s.containerState.size+1)(l)}function u(l){return s.containerState.furtherBlankLines||!vt(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(g9,t,d)(l))}function d(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,At(e,e.attempt(Ur,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function y9(e,t,r){const s=this;return At(e,o,"listItemIndent",s.containerState.size+1);function o(u){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?t(u):r(u)}}function b9(e){e.exit(this.containerState.type)}function w9(e,t,r){const s=this;return At(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=s.events[s.events.length-1];return!vt(u)&&d&&d[1].type==="listItemPrefixWhitespace"?t(u):r(u)}}const mw={name:"setextUnderline",resolveTo:_9,tokenize:S9};function _9(e,t){let r=e.length,s,o,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,t]),e.splice(u+1,0,["exit",e[s][1],t]),e[s][1].end={...e[u][1].end}):e[s][1]=d,e.push(["exit",d,t]),e}function S9(e,t,r){const s=this;let o;return u;function u(f){let m=s.events.length,h;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){h=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||h)?(e.enter("setextHeadingLine"),o=f,d(f)):r(f)}function d(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===o?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),vt(f)?At(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||nt(f)?(e.exit("setextHeadingLine"),t(f)):r(f)}}const C9={tokenize:k9};function k9(e){const t=this,r=e.attempt(Ad,s,e.attempt(this.parser.constructs.flowInitial,o,At(e,e.attempt(this.parser.constructs.flow,o,e.attempt(A7,o)),"linePrefix")));return r;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const j9={resolveAll:a2()},N9=o2("string"),E9=o2("text");function o2(e){return{resolveAll:a2(e==="text"?P9:void 0),tokenize:t};function t(r){const s=this,o=this.parser.constructs[e],u=r.attempt(o,d,l);return d;function d(m){return f(m)?u(m):l(m)}function l(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),c}function c(m){return f(m)?(r.exit("data"),u(m)):(r.consume(m),c)}function f(m){if(m===null)return!0;const h=o[m];let x=-1;if(h)for(;++x<h.length;){const w=h[x];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function a2(e){return t;function t(r,s){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(r,s):r}}function P9(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],o=t.sliceStream(s);let u=o.length,d=-1,l=0,c;for(;u--;){const f=o[u];if(typeof f=="string"){for(d=f.length;f.charCodeAt(d-1)===32;)l++,d--;if(d)break;d=-1}else if(f===-2)c=!0,l++;else if(f!==-1){u++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const f={type:r===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:s.start._bufferIndex+d,_index:s.start._index+u,line:s.end.line,column:s.end.column-l,offset:s.end.offset-l},end:{...s.end}};s.end={...f.start},s.start.offset===s.end.offset?Object.assign(s,f):(e.splice(r,0,["enter",f,t],["exit",f,t]),r+=2)}r++}return e}const A9={42:Ur,43:Ur,45:Ur,48:Ur,49:Ur,50:Ur,51:Ur,52:Ur,53:Ur,54:Ur,55:Ur,56:Ur,57:Ur,62:Zj},T9={91:L7},R9={[-2]:tm,[-1]:tm,32:tm},M9={35:z7,42:gu,45:[mw,gu],60:U7,61:mw,95:gu,96:hw,126:hw},D9={38:t2,92:e2},L9={[-5]:rm,[-4]:rm,[-3]:rm,33:c9,38:t2,42:rp,60:[d7,Q7],91:d9,92:[F7,e2],93:Vg,95:rp,96:C7},I9={null:[rp,j9]},O9={null:[42,95]},B9={null:[]},F9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:O9,contentInitial:T9,disable:B9,document:A9,flow:M9,flowInitial:R9,insideSpan:I9,string:D9,text:L9},Symbol.toStringTag,{value:"Module"}));function $9(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let d=[],l=[];const c={attempt:T(E),check:T(P),consume:g,enter:y,exit:j,interrupt:T(P,{interrupt:!0})},f={code:null,containerState:{},defineSkip:_,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:h};let m=t.tokenize.call(f,c);return t.resolveAll&&u.push(t),f;function h(O){return d=_n(d,O),v(),d[d.length-1]!==null?[]:(N(t,0),f.events=Wg(u,f.events,f),f.events)}function x(O,$){return H9(w(O),$)}function w(O){return z9(d,O)}function k(){const{_bufferIndex:O,_index:$,line:W,column:Y,offset:z}=s;return{_bufferIndex:O,_index:$,line:W,column:Y,offset:z}}function _(O){o[O.line]=O.column,I()}function v(){let O;for(;s._index<d.length;){const $=d[s._index];if(typeof $=="string")for(O=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===O&&s._bufferIndex<$.length;)b($.charCodeAt(s._bufferIndex));else b($)}}function b(O){m=m(O)}function g(O){nt(O)?(s.line++,s.column=1,s.offset+=O===-3?2:1,I()):O!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),f.previous=O}function y(O,$){const W=$||{};return W.type=O,W.start=k(),f.events.push(["enter",W,f]),l.push(W),W}function j(O){const $=l.pop();return $.end=k(),f.events.push(["exit",$,f]),$}function E(O,$){N(O,$.from)}function P(O,$){$.restore()}function T(O,$){return W;function W(Y,z,K){let G,U,L,M;return Array.isArray(Y)?q(Y):"tokenize"in Y?q([Y]):B(Y);function B(me){return X;function X(H){const ae=H!==null&&me[H],ne=H!==null&&me.null,J=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return q(J)(H)}}function q(me){return G=me,U=0,me.length===0?K:F(me[U])}function F(me){return X;function X(H){return M=R(),L=me,me.partial||(f.currentConstruct=me),me.name&&f.parser.constructs.disable.null.includes(me.name)?fe():me.tokenize.call($?Object.assign(Object.create(f),$):f,c,oe,fe)(H)}}function oe(me){return O(L,M),z}function fe(me){return M.restore(),++U<G.length?F(G[U]):K}}}function N(O,$){O.resolveAll&&!u.includes(O)&&u.push(O),O.resolve&&os(f.events,$,f.events.length-$,O.resolve(f.events.slice($),f)),O.resolveTo&&(f.events=O.resolveTo(f.events,f))}function R(){const O=k(),$=f.previous,W=f.currentConstruct,Y=f.events.length,z=Array.from(l);return{from:Y,restore:K};function K(){s=O,f.previous=$,f.currentConstruct=W,f.events.length=Y,l=z,I()}}function I(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function z9(e,t){const r=t.start._index,s=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let d;if(r===o)d=[e[r].slice(s,u)];else{if(d=e.slice(r,o),s>-1){const l=d[0];typeof l=="string"?d[0]=l.slice(s):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function H9(e,t){let r=-1;const s=[];let o;for(;++r<e.length;){const u=e[r];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
|
|
571
571
|
`;break}case-3:{d=`\r
|
|
572
|
-
`;break}case-2:{d=t?" ":" ";break}case-1:{if(!t&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,s.push(d)}return s.join("")}function W9(e){const s={constructs:X8([F9,...(e||{}).extensions||[]]),content:o(s7),defined:[],document:o(o7),flow:o(C9),lazy:{},string:o(N9),text:o(E9)};return s;function o(u){return d;function d(l){return $9(s,u,l)}}}function V9(e){for(;!r2(e););return e}const pw=/[\0\t\n\r]/g;function U9(){let e=1,t="",r=!0,s;return o;function o(u,d,l){const c=[];let f,m,h,x,w;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),h=0,t="",r&&(u.charCodeAt(0)===65279&&h++,r=void 0);h<u.length;){if(pw.lastIndex=h,f=pw.exec(u),x=f&&f.index!==void 0?f.index:u.length,w=u.charCodeAt(x),!f){t=u.slice(h);break}if(w===10&&h===x&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),h<x&&(c.push(u.slice(h,x)),e+=x-h),w){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}h=x+1}return l&&(s&&c.push(-5),t&&c.push(t),c.push(null)),c}}const G9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function K9(e){return e.replace(G9,q9)}function q9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Qj(r.slice(u?2:1),u?16:10)}return Hg(r)||e}const l2={}.hasOwnProperty;function Y9(e,t,r){return typeof t!="string"&&(r=t,t=void 0),X9(r)(V9(W9(r).document().write(U9()(e,t,!0))))}function X9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Re),autolinkProtocol:R,autolinkEmail:R,atxHeading:u(Ve),blockQuote:u(ne),characterEscape:R,characterReference:R,codeFenced:u(J),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(J,d),codeText:u(ie,d),codeTextData:R,data:R,codeFlowValue:R,definition:u(ye),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(Oe),hardBreakEscape:u(re),hardBreakTrailing:u(re),htmlFlow:u(de,d),htmlFlowData:R,htmlText:u(de,d),htmlTextData:R,image:u(De),label:d,link:u(Re),listItem:u(Se),listItemValue:x,listOrdered:u(Ze,h),listUnordered:u(Ze),paragraph:u(ge),reference:F,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(Ve),strong:u(Me),thematicBreak:u(Rt)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:ae,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:me,characterReference:X,codeFenced:c(v),codeFencedFence:_,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:c(b),codeText:c(z),codeTextData:I,data:I,definition:c(),definitionDestinationString:j,definitionLabelString:g,definitionTitleString:y,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(W),htmlFlowData:I,htmlText:c(Y),htmlTextData:I,image:c(G),label:L,labelText:U,lineEnding:O,link:c(K),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:B,resource:q,setextHeading:c(N),setextHeadingLineSequence:T,setextHeadingText:P,strong:c(),thematicBreak:c()}};c2(t,(e||{}).mdastExtensions||[]);const r={};return s;function s(pe){let be={type:"root",children:[]};const Be={stack:[be],tokenStack:[],config:t,enter:l,exit:f,buffer:d,resume:m,data:r},Ge=[];let Ke=-1;for(;++Ke<pe.length;)if(pe[Ke][1].type==="listOrdered"||pe[Ke][1].type==="listUnordered")if(pe[Ke][0]==="enter")Ge.push(Ke);else{const bt=Ge.pop();Ke=o(pe,bt,Ke)}for(Ke=-1;++Ke<pe.length;){const bt=t[pe[Ke][0]];l2.call(bt,pe[Ke][1].type)&&bt[pe[Ke][1].type].call(Object.assign({sliceSerialize:pe[Ke][2].sliceSerialize},Be),pe[Ke][1])}if(Be.tokenStack.length>0){const bt=Be.tokenStack[Be.tokenStack.length-1];(bt[1]||gw).call(Be,void 0,bt[0])}for(be.position={start:Xs(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Xs(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)be=t.transforms[Ke](be)||be;return be}function o(pe,be,Be){let Ge=be-1,Ke=-1,bt=!1,Z,Pe,Le,st;for(;++Ge<=Be;){const et=pe[Ge];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?Ke++:Ke--,st=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Z&&!st&&!Ke&&!Le&&(Le=Ge),st=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:st=void 0}if(!Ke&&et[0]==="enter"&&et[1].type==="listItemPrefix"||Ke===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Z){let jt=Ge;for(Pe=void 0;jt--;){const ft=pe[jt];if(ft[1].type==="lineEnding"||ft[1].type==="lineEndingBlank"){if(ft[0]==="exit")continue;Pe&&(pe[Pe][1].type="lineEndingBlank",bt=!0),ft[1].type="lineEnding",Pe=jt}else if(!(ft[1].type==="linePrefix"||ft[1].type==="blockQuotePrefix"||ft[1].type==="blockQuotePrefixWhitespace"||ft[1].type==="blockQuoteMarker"||ft[1].type==="listItemIndent"))break}Le&&(!Pe||Le<Pe)&&(Z._spread=!0),Z.end=Object.assign({},Pe?pe[Pe][1].start:et[1].end),pe.splice(Pe||Ge,0,["exit",Z,et[2]]),Ge++,Be++}if(et[1].type==="listItemPrefix"){const jt={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Z=jt,pe.splice(Ge,0,["enter",jt,et[2]]),Ge++,Be++,Le=void 0,st=!0}}}return pe[be][1]._spread=bt,Be}function u(pe,be){return Be;function Be(Ge){l.call(this,pe(Ge),Ge),be&&be.call(this,Ge)}}function d(){this.stack.push({type:"fragment",children:[]})}function l(pe,be,Be){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([be,Be||void 0]),pe.position={start:Xs(be.start),end:void 0}}function c(pe){return be;function be(Be){pe&&pe.call(this,Be),f.call(this,Be)}}function f(pe,be){const Be=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==pe.type&&(be?be.call(this,pe,Ge[0]):(Ge[1]||gw).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Ja({start:pe.start,end:pe.end})+"): it’s not open");Be.position.end=Xs(pe.end)}function m(){return q8(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function x(pe){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.lang=pe}function k(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.meta=pe}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/(\r?\n|\r)$/g,"")}function g(pe){const be=this.resume(),Be=this.stack[this.stack.length-1];Be.label=be,Be.identifier=Ro(this.sliceSerialize(pe)).toLowerCase()}function y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function j(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function E(pe){const be=this.stack[this.stack.length-1];if(!be.depth){const Be=this.sliceSerialize(pe).length;be.depth=Be}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function R(pe){const Be=this.stack[this.stack.length-1].children;let Ge=Be[Be.length-1];(!Ge||Ge.type!=="text")&&(Ge=ht(),Ge.position={start:Xs(pe.start),end:void 0},Be.push(Ge)),this.stack.push(Ge)}function I(pe){const be=this.stack.pop();be.value+=this.sliceSerialize(pe),be.position.end=Xs(pe.end)}function O(pe){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=be.children[be.children.length-1];Be.position.end=Xs(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(R.call(this,pe),I.call(this,pe))}function $(){this.data.atHardBreak=!0}function W(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function Y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function z(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function K(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function U(pe){const be=this.sliceSerialize(pe),Be=this.stack[this.stack.length-2];Be.label=K9(be),Be.identifier=Ro(be).toLowerCase()}function L(){const pe=this.stack[this.stack.length-1],be=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Ge=pe.children;Be.children=Ge}else Be.alt=be}function M(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function B(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function q(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function oe(pe){const be=this.resume(),Be=this.stack[this.stack.length-1];Be.label=be,Be.identifier=Ro(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function fe(pe){this.data.characterReferenceType=pe.type}function me(pe){const be=this.sliceSerialize(pe),Be=this.data.characterReferenceType;let Ge;Be?(Ge=Qj(be,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Hg(be);const Ke=this.stack[this.stack.length-1];Ke.value+=Ge}function X(pe){const be=this.stack.pop();be.position.end=Xs(pe.end)}function H(pe){I.call(this,pe);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(pe)}function ae(pe){I.call(this,pe);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(pe)}function ne(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function re(){return{type:"break"}}function de(){return{type:"html",value:""}}function De(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function Ze(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Se(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function ht(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function c2(e,t){let r=-1;for(;++r<t.length;){const s=t[r];Array.isArray(s)?c2(e,s):J9(e,s)}}function J9(e,t){let r;for(r in t)if(l2.call(t,r))switch(r){case"canContainEols":{const s=t[r];s&&e[r].push(...s);break}case"transforms":{const s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=t[r];s&&Object.assign(e[r],s);break}}}function gw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ja({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ja({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ja({start:t.start,end:t.end})+") is still open")}function Q9(e){const t=this;t.parser=r;function r(s){return Y9(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Z9(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function e$(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
572
|
+
`;break}case-2:{d=t?" ":" ";break}case-1:{if(!t&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,s.push(d)}return s.join("")}function W9(e){const s={constructs:X8([F9,...(e||{}).extensions||[]]),content:o(s7),defined:[],document:o(o7),flow:o(C9),lazy:{},string:o(N9),text:o(E9)};return s;function o(u){return d;function d(l){return $9(s,u,l)}}}function V9(e){for(;!r2(e););return e}const pw=/[\0\t\n\r]/g;function U9(){let e=1,t="",r=!0,s;return o;function o(u,d,l){const c=[];let f,m,h,x,w;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),h=0,t="",r&&(u.charCodeAt(0)===65279&&h++,r=void 0);h<u.length;){if(pw.lastIndex=h,f=pw.exec(u),x=f&&f.index!==void 0?f.index:u.length,w=u.charCodeAt(x),!f){t=u.slice(h);break}if(w===10&&h===x&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),h<x&&(c.push(u.slice(h,x)),e+=x-h),w){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}h=x+1}return l&&(s&&c.push(-5),t&&c.push(t),c.push(null)),c}}const G9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function K9(e){return e.replace(G9,q9)}function q9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Qj(r.slice(u?2:1),u?16:10)}return Hg(r)||e}const l2={}.hasOwnProperty;function Y9(e,t,r){return typeof t!="string"&&(r=t,t=void 0),X9(r)(V9(W9(r).document().write(U9()(e,t,!0))))}function X9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Re),autolinkProtocol:R,autolinkEmail:R,atxHeading:u(Ve),blockQuote:u(ne),characterEscape:R,characterReference:R,codeFenced:u(J),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(J,d),codeText:u(ie,d),codeTextData:R,data:R,codeFlowValue:R,definition:u(ye),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(Oe),hardBreakEscape:u(te),hardBreakTrailing:u(te),htmlFlow:u(de,d),htmlFlowData:R,htmlText:u(de,d),htmlTextData:R,image:u(De),label:d,link:u(Re),listItem:u(Se),listItemValue:x,listOrdered:u(Ze,h),listUnordered:u(Ze),paragraph:u(ge),reference:F,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(Ve),strong:u(Me),thematicBreak:u(Rt)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:ae,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:me,characterReference:X,codeFenced:c(v),codeFencedFence:_,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:c(b),codeText:c(z),codeTextData:I,data:I,definition:c(),definitionDestinationString:j,definitionLabelString:g,definitionTitleString:y,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(W),htmlFlowData:I,htmlText:c(Y),htmlTextData:I,image:c(G),label:L,labelText:U,lineEnding:O,link:c(K),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:B,resource:q,setextHeading:c(N),setextHeadingLineSequence:T,setextHeadingText:P,strong:c(),thematicBreak:c()}};c2(t,(e||{}).mdastExtensions||[]);const r={};return s;function s(pe){let be={type:"root",children:[]};const Be={stack:[be],tokenStack:[],config:t,enter:l,exit:f,buffer:d,resume:m,data:r},Ge=[];let Ke=-1;for(;++Ke<pe.length;)if(pe[Ke][1].type==="listOrdered"||pe[Ke][1].type==="listUnordered")if(pe[Ke][0]==="enter")Ge.push(Ke);else{const bt=Ge.pop();Ke=o(pe,bt,Ke)}for(Ke=-1;++Ke<pe.length;){const bt=t[pe[Ke][0]];l2.call(bt,pe[Ke][1].type)&&bt[pe[Ke][1].type].call(Object.assign({sliceSerialize:pe[Ke][2].sliceSerialize},Be),pe[Ke][1])}if(Be.tokenStack.length>0){const bt=Be.tokenStack[Be.tokenStack.length-1];(bt[1]||gw).call(Be,void 0,bt[0])}for(be.position={start:Xs(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Xs(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)be=t.transforms[Ke](be)||be;return be}function o(pe,be,Be){let Ge=be-1,Ke=-1,bt=!1,Z,Pe,Le,st;for(;++Ge<=Be;){const et=pe[Ge];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?Ke++:Ke--,st=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Z&&!st&&!Ke&&!Le&&(Le=Ge),st=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:st=void 0}if(!Ke&&et[0]==="enter"&&et[1].type==="listItemPrefix"||Ke===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Z){let jt=Ge;for(Pe=void 0;jt--;){const ft=pe[jt];if(ft[1].type==="lineEnding"||ft[1].type==="lineEndingBlank"){if(ft[0]==="exit")continue;Pe&&(pe[Pe][1].type="lineEndingBlank",bt=!0),ft[1].type="lineEnding",Pe=jt}else if(!(ft[1].type==="linePrefix"||ft[1].type==="blockQuotePrefix"||ft[1].type==="blockQuotePrefixWhitespace"||ft[1].type==="blockQuoteMarker"||ft[1].type==="listItemIndent"))break}Le&&(!Pe||Le<Pe)&&(Z._spread=!0),Z.end=Object.assign({},Pe?pe[Pe][1].start:et[1].end),pe.splice(Pe||Ge,0,["exit",Z,et[2]]),Ge++,Be++}if(et[1].type==="listItemPrefix"){const jt={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Z=jt,pe.splice(Ge,0,["enter",jt,et[2]]),Ge++,Be++,Le=void 0,st=!0}}}return pe[be][1]._spread=bt,Be}function u(pe,be){return Be;function Be(Ge){l.call(this,pe(Ge),Ge),be&&be.call(this,Ge)}}function d(){this.stack.push({type:"fragment",children:[]})}function l(pe,be,Be){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([be,Be||void 0]),pe.position={start:Xs(be.start),end:void 0}}function c(pe){return be;function be(Be){pe&&pe.call(this,Be),f.call(this,Be)}}function f(pe,be){const Be=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==pe.type&&(be?be.call(this,pe,Ge[0]):(Ge[1]||gw).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Ja({start:pe.start,end:pe.end})+"): it’s not open");Be.position.end=Xs(pe.end)}function m(){return q8(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function x(pe){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.lang=pe}function k(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.meta=pe}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/(\r?\n|\r)$/g,"")}function g(pe){const be=this.resume(),Be=this.stack[this.stack.length-1];Be.label=be,Be.identifier=Ro(this.sliceSerialize(pe)).toLowerCase()}function y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function j(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function E(pe){const be=this.stack[this.stack.length-1];if(!be.depth){const Be=this.sliceSerialize(pe).length;be.depth=Be}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function R(pe){const Be=this.stack[this.stack.length-1].children;let Ge=Be[Be.length-1];(!Ge||Ge.type!=="text")&&(Ge=ht(),Ge.position={start:Xs(pe.start),end:void 0},Be.push(Ge)),this.stack.push(Ge)}function I(pe){const be=this.stack.pop();be.value+=this.sliceSerialize(pe),be.position.end=Xs(pe.end)}function O(pe){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=be.children[be.children.length-1];Be.position.end=Xs(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(R.call(this,pe),I.call(this,pe))}function $(){this.data.atHardBreak=!0}function W(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function Y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function z(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function K(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function U(pe){const be=this.sliceSerialize(pe),Be=this.stack[this.stack.length-2];Be.label=K9(be),Be.identifier=Ro(be).toLowerCase()}function L(){const pe=this.stack[this.stack.length-1],be=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Ge=pe.children;Be.children=Ge}else Be.alt=be}function M(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function B(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function q(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function oe(pe){const be=this.resume(),Be=this.stack[this.stack.length-1];Be.label=be,Be.identifier=Ro(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function fe(pe){this.data.characterReferenceType=pe.type}function me(pe){const be=this.sliceSerialize(pe),Be=this.data.characterReferenceType;let Ge;Be?(Ge=Qj(be,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Hg(be);const Ke=this.stack[this.stack.length-1];Ke.value+=Ge}function X(pe){const be=this.stack.pop();be.position.end=Xs(pe.end)}function H(pe){I.call(this,pe);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(pe)}function ae(pe){I.call(this,pe);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(pe)}function ne(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function te(){return{type:"break"}}function de(){return{type:"html",value:""}}function De(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function Ze(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Se(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function ht(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function c2(e,t){let r=-1;for(;++r<t.length;){const s=t[r];Array.isArray(s)?c2(e,s):J9(e,s)}}function J9(e,t){let r;for(r in t)if(l2.call(t,r))switch(r){case"canContainEols":{const s=t[r];s&&e[r].push(...s);break}case"transforms":{const s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=t[r];s&&Object.assign(e[r],s);break}}}function gw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ja({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ja({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ja({start:t.start,end:t.end})+") is still open")}function Q9(e){const t=this;t.parser=r;function r(s){return Y9(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Z9(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function e$(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
573
573
|
`}]}function t$(e,t){const r=t.value?t.value+`
|
|
574
574
|
`:"",s={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(s.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function r$(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function n$(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function s$(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),o=Zo(s.toLowerCase()),u=e.footnoteOrder.indexOf(s);let d,l=e.footnoteCounts.get(s);l===void 0?(l=0,e.footnoteOrder.push(s),d=e.footnoteOrder.length):d=u+1,l+=1,e.footnoteCounts.set(s,l);const c={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function i$(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function o$(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function u2(e,t){const r=t.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const o=e.all(t),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=s:o.push({type:"text",value:s}),o}function a$(e,t){const r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return u2(e,t);const o={src:Zo(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(o.title=s.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,u),e.applyData(t,u)}function l$(e,t){const r={src:Zo(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function c$(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,s),e.applyData(t,s)}function u$(e,t){const r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return u2(e,t);const o={href:Zo(s.url||"")};s.title!==null&&s.title!==void 0&&(o.title=s.title);const u={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function d$(e,t){const r={href:Zo(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function h$(e,t,r){const s=e.all(t),o=r?f$(r):d2(t),u={},d=[];if(typeof t.checked=="boolean"){const m=s[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},s.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let l=-1;for(;++l<s.length;){const m=s[l];(o||l!==0||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
|
|
575
575
|
`}),m.type==="element"&&m.tagName==="p"&&!o?d.push(...m.children):d.push(m)}const c=s[s.length-1];c&&(o||c.type!=="element"||c.tagName!=="p")&&d.push({type:"text",value:`
|
|
@@ -579,12 +579,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
|
|
|
579
579
|
`});++s<e.length;)s&&r.push({type:"text",value:`
|
|
580
580
|
`}),r.push(e[s]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
581
581
|
`}),r}function Cw(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function kw(e,t){const r=H$(e,t),s=r.one(e,void 0),o=T$(r),u=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
|
|
582
|
-
`},o),u}function K$(e,t){return e&&"run"in e?async function(r,s){const o=kw(r,{file:s,...t});await e.run(o,s)}:function(r,s){return kw(r,{file:s,...e||t})}}function jw(e){if(e)throw e}var nm,Nw;function q$(){if(Nw)return nm;Nw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},u=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!h)return!1;var x;for(x in f);return typeof x>"u"||e.call(f,x)},d=function(f,m){r&&m.name==="__proto__"?r(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(s)return s(f,m).value}else return;return f[m]};return nm=function c(){var f,m,h,x,w,k,_=arguments[0],v=1,b=arguments.length,g=!1;for(typeof _=="boolean"&&(g=_,_=arguments[1]||{},v=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});v<b;++v)if(f=arguments[v],f!=null)for(m in f)h=l(_,m),x=l(f,m),_!==x&&(g&&x&&(u(x)||(w=o(x)))?(w?(w=!1,k=h&&o(h)?h:[]):k=h&&u(h)?h:{},d(_,{name:m,newValue:c(g,k,x)})):typeof x<"u"&&d(_,{name:m,newValue:x}));return _},nm}var Y$=q$();const sm=ml(Y$);function sp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function X$(){const e=[],t={run:r,use:s};return t;function r(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);l(null,...o);function l(c,...f){const m=e[++u];let h=-1;if(c){d(c);return}for(;++h<o.length;)(f[h]===null||f[h]===void 0)&&(f[h]=o[h]);o=f,m?J$(m,l)(...f):d(null,...f)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function J$(e,t){let r;return s;function s(...d){const l=e.length>d.length;let c;l&&d.push(o);try{c=e.apply(this,d)}catch(f){const m=f;if(l&&r)throw m;return o(m)}l||(c&&c.then&&typeof c.then=="function"?c.then(u,o):c instanceof Error?o(c):u(c))}function o(d,...l){r||(r=!0,t(d,...l))}function u(d){o(null,d)}}const Yn={basename:Q$,dirname:Z$,extname:ez,join:tz,sep:"/"};function Q$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ol(e);let r=0,s=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else s<0&&(u=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let d=-1,l=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else d<0&&(u=!0,d=o+1),l>-1&&(e.codePointAt(o)===t.codePointAt(l--)?l<0&&(s=o):(l=-1,s=d));return r===s?s=d:s<0&&(s=e.length),e.slice(r,s)}function Z$(e){if(Ol(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ez(e){Ol(e);let t=e.length,r=-1,s=0,o=-1,u=0,d;for(;t--;){const l=e.codePointAt(t);if(l===47){if(d){s=t+1;break}continue}r<0&&(d=!0,r=t+1),l===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function tz(...e){let t=-1,r;for(;++t<e.length;)Ol(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":rz(r)}function rz(e){Ol(e);const t=e.codePointAt(0)===47;let r=nz(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function nz(e,t){let r="",s=0,o=-1,u=0,d=-1,l,c;for(;++d<=e.length;){if(d<e.length)l=e.codePointAt(d);else{if(l===47)break;l=47}if(l===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(c=r.lastIndexOf("/"),c!==r.length-1){c<0?(r="",s=0):(r=r.slice(0,c),s=r.length-1-r.lastIndexOf("/")),o=d,u=0;continue}}else if(r.length>0){r="",s=0,o=d,u=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,d):r=e.slice(o+1,d),s=d-o-1;o=d,u=0}else l===46&&u>-1?u++:u=-1}return r}function Ol(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const sz={cwd:iz};function iz(){return"/"}function ip(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oz(e){if(typeof e=="string")e=new URL(e);else if(!ip(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return az(e)}function az(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const s=t.codePointAt(r+2);if(s===70||s===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const im=["history","path","basename","stem","extname","dirname"];class v2{constructor(t){let r;t?ip(t)?r={path:t}:typeof t=="string"||lz(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":sz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<im.length;){const u=im[s];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)im.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(t){am(t,"basename"),om(t,"basename"),this.path=Yn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(t){Ew(this.basename,"dirname"),this.path=Yn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(t){if(om(t,"extname"),Ew(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ip(t)&&(t=oz(t)),am(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(t){am(t,"stem"),om(t,"stem"),this.path=Yn.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){const o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){const o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){const o=new Dr(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function om(e,t){if(e&&e.includes(Yn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yn.sep+"`")}function am(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ew(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function lz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cz=(function(e){const s=this.constructor.prototype,o=s[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,s),u}),uz={}.hasOwnProperty;class Yg extends cz{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=X$()}copy(){const t=new Yg;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];t.use(...s)}return t.data(sm(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(um("data",this.frozen),this.namespace[t]=r,this):uz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(um("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=ou(t),s=this.parser||this.Parser;return lm("parse",s),s(String(r),r)}process(t,r){const s=this;return this.freeze(),lm("process",this.parser||this.Parser),cm("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,d){const l=ou(t),c=s.parse(l);s.run(c,l,function(m,h,x){if(m||!h||!x)return f(m);const w=h,k=s.stringify(w,x);fz(k)?x.value=k:x.result=k,f(m,x)});function f(m,h){m||!h?d(m):u?u(h):r(void 0,h)}}}processSync(t){let r=!1,s;return this.freeze(),lm("processSync",this.parser||this.Parser),cm("processSync",this.compiler||this.Compiler),this.process(t,o),Aw("processSync","process",r),s;function o(u,d){r=!0,jw(u),s=d}}run(t,r,s){Pw(t),this.freeze();const o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?u(void 0,s):new Promise(u);function u(d,l){const c=ou(r);o.run(t,c,f);function f(m,h,x){const w=h||t;m?l(m):d?d(w):s(void 0,w,x)}}}runSync(t,r){let s=!1,o;return this.run(t,r,u),Aw("runSync","run",s),o;function u(d,l){jw(d),o=l,s=!0}}stringify(t,r){this.freeze();const s=ou(r),o=this.compiler||this.Compiler;return cm("stringify",o),Pw(t),o(t,s)}use(t,...r){const s=this.attachers,o=this.namespace;if(um("use",this.frozen),t!=null)if(typeof t=="function")c(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...h]=f;c(m,h)}else d(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function d(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(o.settings=sm(!0,o.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const h=f[m];u(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,m){let h=-1,x=-1;for(;++h<s.length;)if(s[h][0]===f){x=h;break}if(x===-1)s.push([f,...m]);else if(m.length>0){let[w,...k]=m;const _=s[x][1];sp(_)&&sp(w)&&(w=sm(!0,_,w)),s[x]=[f,w,...k]}}}}const dz=new Yg().freeze();function lm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function um(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pw(e){if(!sp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Aw(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ou(e){return hz(e)?e:new v2(e)}function hz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fz(e){return typeof e=="string"||mz(e)}function mz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tw=[],Rw={allowDangerousHtml:!0},gz=/^(https?|ircs?|mailto|xmpp)$/i,xz=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function vz(e){const t=yz(e),r=bz(e);return wz(t.runSync(t.parse(r),r),e)}function yz(e){const t=e.rehypePlugins||Tw,r=e.remarkPlugins||Tw,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rw}:Rw;return dz().use(Q9).use(r).use(K$,s).use(t)}function bz(e){const t=e.children||"",r=new v2;return typeof t=="string"&&(r.value=t),r}function wz(e,t){const r=t.allowedElements,s=t.allowElement,o=t.components,u=t.disallowedElements,d=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||_z;for(const m of xz)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+pz+m.id,void 0);return x2(e,f),T8(e,{Fragment:n.Fragment,components:o,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0});function f(m,h,x){if(m.type==="raw"&&x&&typeof h=="number")return d?x.children.splice(h,1):x.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let w;for(w in em)if(Object.hasOwn(em,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],_=em[w];(_===null||_.includes(m.tagName))&&(m.properties[w]=c(String(k||""),w,m))}}if(m.type==="element"){let w=r?!r.includes(m.tagName):u?u.includes(m.tagName):!1;if(!w&&s&&typeof h=="number"&&(w=!s(m,h,x)),w&&x&&typeof h=="number")return l&&m.children?x.children.splice(h,1,...m.children):x.children.splice(h,1),h}}}function _z(e){const t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||gz.test(e.slice(0,t))?e:""}function Sz(){var z,K;const[e,t]=C.useState(null),[r,s]=C.useState(""),[o,u]=C.useState({open:!1,field:null,type:"directory"}),[d,l]=C.useState(!0),[c,f]=C.useState(!1),[m,h]=C.useState(null),[x,w]=C.useState(!1),[k,_]=C.useState(null),[v,b]=C.useState([]),[g,y]=C.useState({open:!1,content:"",loading:!1});C.useEffect(()=>{I(),j(),E()},[]);const j=async()=>{try{const G=await ke.checkVersion();h(G)}catch(G){console.error("Failed to load version info:",G)}},E=async()=>{try{const G=await ke.getProject();_(G.dir),P(G.dir)}catch(G){console.error("Failed to load project info:",G)}},P=async G=>{if(G)try{const U=await ke.getHiddenSubprojects(G);b(U.hidden||[])}catch(U){console.error("Failed to load hidden sub-projects:",U)}},T=async G=>{if(k)try{const U=await ke.unhideSubproject(k,G);U.success?(ee.success("Sub-project unhidden"),P(k)):ee.error(U.error||"Failed to unhide")}catch(U){ee.error("Failed to unhide: "+U.message)}},N=async()=>{var G;if(!(m!=null&&m.updateAvailable)){ee.error("No update available");return}w(!0);try{const U=await ke.performUpdate({updateMethod:m.updateMethod,sourcePath:m.sourcePath});U.success?(U.updateMethod==="npm"?ee.success(U.message||"Updated via npm! Restart the server to apply."):ee.success(`Updated! Files: ${((G=U.updated)==null?void 0:G.join(", "))||"all"}. Restart the server to apply.`),j()):ee.error("Update failed: "+U.error)}catch(U){ee.error("Update failed: "+U.message)}finally{w(!1)}},R=async()=>{y(G=>({...G,open:!0,loading:!0}));try{const G=await ke.getChangelog();G.success?y(U=>({...U,content:G.content,loading:!1})):(ee.error("Failed to load changelog"),y(U=>({...U,open:!1,loading:!1})))}catch(G){ee.error("Failed to load changelog: "+G.message),y(U=>({...U,open:!1,loading:!1}))}},I=async()=>{try{l(!0);const G=await ke.getConfig();t(G.config),s(G.path)}catch{ee.error("Failed to load settings")}finally{l(!1)}},O=async()=>{f(!0);try{await ke.saveConfig(e),ee.success("Preferences saved!")}catch{ee.error("Failed to save preferences")}finally{f(!1)}},$=(G,U)=>{t(L=>({...L,[G]:U}))},W=(G,U,L)=>{t(M=>({...M,[G]:{...M[G],[U]:L}}))},Y=async G=>{const U=(e==null?void 0:e.enabledTools)||["claude"];let L;if(U.includes(G)){if(U.length<=1){ee.error("At least one tool must be enabled");return}L=U.filter(B=>B!==G)}else L=[...U,G];const M={...e,enabledTools:L};t(M);try{await ke.saveConfig(M),ee.success(`${G==="claude"?"Claude Code":G==="gemini"?"Gemini CLI":"Antigravity"} ${L.includes(G)?"enabled":"disabled"}`)}catch{t(e),ee.error("Failed to save preference")}};return d?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:n.jsx(A1,{className:"w-5 h-5 text-muted-foreground"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"claude-config Preferences"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),n.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsx("div",{children:n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:r})]})}),n.jsxs(le,{onClick:O,disabled:c,children:[c?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(wr,{className:"w-4 h-4"}),"Directories"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),n.jsxs("div",{className:"space-y-2",children:[((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).map((G,U)=>n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{value:G||"",onChange:L=>{const M=[...(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])];M[U]=L.target.value,$("toolsDirs",M),e!=null&&e.toolsDir&&t(B=>{const{toolsDir:q,...F}=B;return{...F,toolsDirs:M}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>u({open:!0,field:"toolsDirs",type:"directory",index:U}),title:"Browse...",children:n.jsx(si,{className:"w-4 h-4"})}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>{const M=((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).filter((B,q)=>q!==U);t(B=>{const{toolsDir:q,...F}=B;return{...F,toolsDirs:M.length>0?M:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:n.jsx(ei,{className:"w-4 h-4"})})]},U)),n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>u({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[n.jsx(Mi,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{value:(e==null?void 0:e.registryPath)||"",onChange:G=>$("registryPath",G.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>u({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:n.jsx(si,{className:"w-4 h-4"})})]})]})]})]}),n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(h5,{className:"w-4 h-4"}),"User Interface"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),n.jsx(ct,{type:"number",value:((z=e==null?void 0:e.ui)==null?void 0:z.port)||3333,onChange:G=>W("ui","port",parseInt(G.target.value)||3333),placeholder:"3333",className:"w-32"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),n.jsx(dt,{checked:((K=e==null?void 0:e.ui)==null?void 0:K.openBrowser)??!0,onCheckedChange:G=>W("ui","openBrowser",G)})]})]})]}),n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(rM,{className:"w-4 h-4"}),"AI Assistant"]}),n.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Choose which AI assistant to use for features like MCP creation and tool import."}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${((e==null?void 0:e.aiAssistant)||"claude")==="claude"?"border-orange-500 bg-orange-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>$("aiAssistant","claude"),children:[n.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((e==null?void 0:e.aiAssistant)||"claude")==="claude",onChange:()=>$("aiAssistant","claude"),className:"sr-only"}),n.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-orange-500"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",n.jsx("code",{className:"text-xs",children:"claude"})]})]}),((e==null?void 0:e.aiAssistant)||"claude")==="claude"&&n.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),n.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${(e==null?void 0:e.aiAssistant)==="gemini"?"border-blue-500 bg-blue-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>$("aiAssistant","gemini"),children:[n.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(e==null?void 0:e.aiAssistant)==="gemini",onChange:()=>$("aiAssistant","gemini"),className:"sr-only"}),n.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:n.jsx(Ft,{className:"w-4 h-4 text-blue-500"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",n.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(e==null?void 0:e.aiAssistant)==="gemini"&&n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kM,{className:"w-4 h-4"}),"Enabled AI Tools"]}),n.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-orange-500"})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",n.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),n.jsx(dt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>Y("claude")})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-blue-500"})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",n.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),n.jsx(dt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>Y("gemini")})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-purple-500"})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",n.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),n.jsx(dt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>Y("antigravity")})]}),n.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",n.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),v.length>0&&n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(w1,{className:"w-4 h-4"}),"Hidden Sub-projects"]}),n.jsx("div",{className:"space-y-2",children:v.map(G=>n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(wr,{className:"w-4 h-4 text-muted-foreground"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:G.name}),n.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:G.dir.replace(k+"/","")})]})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>T(G.dir),className:"h-7",children:[n.jsx(_1,{className:"w-3 h-3 mr-1"}),"Unhide"]})]},G.dir))})]}),n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Cr,{className:"w-4 h-4"}),"About"]}),n.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),n.jsx("span",{className:"font-medium font-mono text-foreground",children:(m==null?void 0:m.installedVersion)||"Loading..."})]}),(m==null?void 0:m.updateAvailable)&&n.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),n.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",m.latestVersion," via ",m.updateMethod==="npm"?"npm":m.sourcePath]})]}),n.jsxs(le,{size:"sm",onClick:N,disabled:x,className:"bg-green-600 hover:bg-green-700 text-white",children:[x?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(bl,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(m!=null&&m.updateAvailable)&&(m==null?void 0:m.latestVersion)&&n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),n.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[m.latestVersion," ✓"]})]}),(m==null?void 0:m.sourcePath)&&!(m!=null&&m.updateAvailable)&&n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-xs text-muted-foreground",children:m.sourcePath}),n.jsx(le,{size:"sm",variant:"outline",onClick:N,disabled:x,className:"h-7",children:x?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(pr,{className:"w-3 h-3"})})]})]}),n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),n.jsx("code",{className:"text-xs text-muted-foreground",children:(m==null?void 0:m.installDir)||"~/.claude-config"})]}),n.jsxs("div",{className:"border-t border-border pt-3 mt-3 space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),n.jsx("a",{href:"https://github.com/regression-io/claude-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"What's New"}),n.jsxs("button",{onClick:R,className:"text-primary hover:underline flex items-center gap-1",children:[n.jsx(Am,{className:"w-3 h-3"}),"Changelog"]})]}),n.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",n.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"claude-config ui"})]})]})]})]})]})]}),n.jsx(_g,{open:o.open,onOpenChange:G=>u(U=>({...U,open:G})),onSelect:G=>{if(o.field==="toolsDirs"){const U=(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]);if(o.index===-1)t(L=>{const{toolsDir:M,...B}=L;return{...B,toolsDirs:[...U,G]}});else{const L=[...U];L[o.index]=G,t(M=>{const{toolsDir:B,...q}=M;return{...q,toolsDirs:L}})}}else o.field&&$(o.field,G)},type:o.type,initialPath:o.field==="toolsDirs"&&o.index>=0?((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]))[o.index]||"~":(e==null?void 0:e[o.field])||"~",title:o.type==="directory"?"Select Directory":"Select File"}),n.jsx(Tt,{open:g.open,onOpenChange:G=>y(U=>({...U,open:G})),children:n.jsxs(St,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[n.jsx(Ct,{className:"flex-shrink-0",children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Am,{className:"w-5 h-5"}),"Changelog"]})}),g.loading?n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ut,{className:"w-6 h-6 animate-spin text-primary"})}):n.jsx(Nn,{className:"h-[60vh]",children:n.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none pr-4",children:n.jsx(vz,{components:{h1:({children:G})=>n.jsx("h1",{className:"text-xl font-bold text-foreground mb-4",children:G}),h2:({children:G})=>n.jsx("h2",{className:"text-lg font-semibold text-foreground mt-6 mb-3 pb-2 border-b border-border",children:G}),h3:({children:G})=>n.jsx("h3",{className:"text-base font-medium text-foreground mt-4 mb-2",children:G}),p:({children:G})=>n.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:G}),ul:({children:G})=>n.jsx("ul",{className:"text-sm text-muted-foreground list-disc pl-5 mb-3 space-y-1",children:G}),li:({children:G})=>n.jsx("li",{className:"text-sm",children:G}),code:({children:G})=>n.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:G}),hr:()=>n.jsx("hr",{className:"my-4 border-border"}),strong:({children:G})=>n.jsx("strong",{className:"font-semibold text-foreground",children:G})},children:g.content})})})]})})]})}function Cz(){const[e,t]=C.useState(null),[r,s]=C.useState({}),[o,u]=C.useState(!0);C.useEffect(()=>{d()},[]);const d=async()=>{try{u(!0);const[c,f]=await Promise.all([ke.getClaudeSettings(),ke.getRegistry()]);t(c.settings),s(f.mcpServers||{})}catch(c){console.error("Failed to load Claude settings:",c)}finally{u(!1)}},l=async c=>{try{await ke.saveClaudeSettings(c),t(c),ee.success("Claude Code settings saved!")}catch(f){ee.error("Failed to save settings: "+f.message)}};return o?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:n.jsx(Tj,{settings:e,onSave:l,loading:o,settingsPath:"~/.claude/settings.json",mcpServers:r})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"claude-config init # Initialize project"}),n.jsx("p",{children:"claude-config apply # Generate .mcp.json from config"}),n.jsx("p",{children:"claude-config show # Show current project config"})]})]})]})}function kz(){const[e,t]=C.useState(null),[r,s]=C.useState(!0);C.useEffect(()=>{o()},[]);const o=async()=>{try{s(!0);const d=await ke.getGeminiSettings();t(d.settings)}catch(d){console.error("Failed to load Gemini settings:",d)}finally{s(!1)}},u=async d=>{try{await ke.saveGeminiSettings(d),t(d),ee.success("Gemini CLI settings saved!")}catch(l){ee.error("Failed to save settings: "+l.message)}};return r?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-blue-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:n.jsx(Rj,{settings:e,onSave:u,loading:r,settingsPath:"~/.gemini/settings.json"})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"claude-config apply # Generate settings for all tools"}),n.jsx("p",{children:"claude-config apply --gemini # Generate Gemini settings only"})]})]})]})}const jz=[{id:"off",name:"Off",description:"Never auto-execute; requires allow list"},{id:"auto",name:"Auto",description:"Safety model determines execution"},{id:"turbo",name:"Turbo",description:"Auto-execute unless in deny list",dangerous:!0}],Nz=[{id:"always-proceed",name:"Always Proceed",description:"Agent never requests review"},{id:"agent-decides",name:"Agent Decides",description:"Agent determines when review is needed"},{id:"request-review",name:"Request Review",description:"Agent always requests review"}],Ez=[{id:"always-proceed",name:"Always Proceed",description:"Maximum autonomy",dangerous:!0},{id:"request-review",name:"Request Review",description:"Ask before browser JavaScript"},{id:"disabled",name:"Disabled",description:"Never run browser JavaScript"}];function Pz({settings:e,onSave:t,loading:r,settingsPath:s}){const[o,u]=C.useState(e||{}),[d,l]=C.useState(!1),[c,f]=C.useState("rich"),[m,h]=C.useState(JSON.stringify(e||{},null,2)),[x,w]=C.useState({open:!1,name:"",json:""}),[k,_]=C.useState({}),v=async()=>{l(!0);try{if(c==="json")try{const T=JSON.parse(m);await t(T),u(T)}catch{ee.error("Invalid JSON"),l(!1);return}else await t(o),h(JSON.stringify(o,null,2));ee.success("Settings saved")}finally{l(!1)}},b=(T,N)=>{u(R=>({...R,[T]:N}))},g=(T,N)=>(o==null?void 0:o[T])??N,y=o.mcpServers||{},j=()=>{const{name:T,json:N}=x;if(!T.trim()){ee.error("Please enter a name for the MCP");return}let R;try{R=JSON.parse(N)}catch{ee.error("Invalid JSON configuration");return}if(!R.command){ee.error('MCP config must have a "command" field');return}u(I=>({...I,mcpServers:{...I.mcpServers,[T.trim()]:R}})),w({open:!1,name:"",json:""}),ee.success(`Added MCP: ${T}`)},E=T=>{u(N=>{const{[T]:R,...I}=N.mcpServers||{};return{...N,mcpServers:I}}),ee.success(`Removed MCP: ${T}`)},P=T=>{_(N=>({...N,[T]:!N[T]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-500/10 flex items-center justify-center",children:n.jsx(wl,{className:"w-5 h-5 text-purple-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Antigravity Settings",n.jsx(Qe,{variant:"outline",className:"text-xs font-normal text-purple-600 border-purple-300 dark:border-purple-700",children:"Google"})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:s})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),n.jsxs(le,{onClick:v,disabled:d||r,children:[d?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),c==="json"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(pt,{value:m,onChange:T=>h(T.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-purple-500"}),"Security Policies"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Terminal Command Execution"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Control how the agent executes shell commands"})]}),n.jsxs(fr,{value:g("terminalPolicy","auto"),onValueChange:T=>b("terminalPolicy",T),children:[n.jsx(ar,{className:"w-44",children:n.jsx(mr,{})}),n.jsx(lr,{children:jz.map(T=>n.jsx(xt,{value:T.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{children:T.name}),T.dangerous&&n.jsx(Qe,{variant:"destructive",className:"text-xs",children:"Risk"})]})},T.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Review Policy"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"When the agent should request human review"})]}),n.jsxs(fr,{value:g("reviewPolicy","agent-decides"),onValueChange:T=>b("reviewPolicy",T),children:[n.jsx(ar,{className:"w-44",children:n.jsx(mr,{})}),n.jsx(lr,{children:Nz.map(T=>n.jsx(xt,{value:T.id,children:T.name},T.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"JavaScript Execution"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Control browser JavaScript execution"})]}),n.jsxs(fr,{value:g("jsPolicy","request-review"),onValueChange:T=>b("jsPolicy",T),children:[n.jsx(ar,{className:"w-44",children:n.jsx(mr,{})}),n.jsx(lr,{children:Ez.map(T=>n.jsx(xt,{value:T.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{children:T.name}),T.dangerous&&n.jsx(Qe,{variant:"destructive",className:"text-xs",children:"Risk"})]})},T.id))})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Fn,{className:"w-4 h-4 text-purple-500"}),"MCP Servers",n.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(y).length})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
582
|
+
`},o),u}function K$(e,t){return e&&"run"in e?async function(r,s){const o=kw(r,{file:s,...t});await e.run(o,s)}:function(r,s){return kw(r,{file:s,...e||t})}}function jw(e){if(e)throw e}var nm,Nw;function q$(){if(Nw)return nm;Nw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},u=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!h)return!1;var x;for(x in f);return typeof x>"u"||e.call(f,x)},d=function(f,m){r&&m.name==="__proto__"?r(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(s)return s(f,m).value}else return;return f[m]};return nm=function c(){var f,m,h,x,w,k,_=arguments[0],v=1,b=arguments.length,g=!1;for(typeof _=="boolean"&&(g=_,_=arguments[1]||{},v=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});v<b;++v)if(f=arguments[v],f!=null)for(m in f)h=l(_,m),x=l(f,m),_!==x&&(g&&x&&(u(x)||(w=o(x)))?(w?(w=!1,k=h&&o(h)?h:[]):k=h&&u(h)?h:{},d(_,{name:m,newValue:c(g,k,x)})):typeof x<"u"&&d(_,{name:m,newValue:x}));return _},nm}var Y$=q$();const sm=ml(Y$);function sp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function X$(){const e=[],t={run:r,use:s};return t;function r(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);l(null,...o);function l(c,...f){const m=e[++u];let h=-1;if(c){d(c);return}for(;++h<o.length;)(f[h]===null||f[h]===void 0)&&(f[h]=o[h]);o=f,m?J$(m,l)(...f):d(null,...f)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function J$(e,t){let r;return s;function s(...d){const l=e.length>d.length;let c;l&&d.push(o);try{c=e.apply(this,d)}catch(f){const m=f;if(l&&r)throw m;return o(m)}l||(c&&c.then&&typeof c.then=="function"?c.then(u,o):c instanceof Error?o(c):u(c))}function o(d,...l){r||(r=!0,t(d,...l))}function u(d){o(null,d)}}const Yn={basename:Q$,dirname:Z$,extname:ez,join:tz,sep:"/"};function Q$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ol(e);let r=0,s=-1,o=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else s<0&&(u=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let d=-1,l=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else d<0&&(u=!0,d=o+1),l>-1&&(e.codePointAt(o)===t.codePointAt(l--)?l<0&&(s=o):(l=-1,s=d));return r===s?s=d:s<0&&(s=e.length),e.slice(r,s)}function Z$(e){if(Ol(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ez(e){Ol(e);let t=e.length,r=-1,s=0,o=-1,u=0,d;for(;t--;){const l=e.codePointAt(t);if(l===47){if(d){s=t+1;break}continue}r<0&&(d=!0,r=t+1),l===46?o<0?o=t:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function tz(...e){let t=-1,r;for(;++t<e.length;)Ol(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":rz(r)}function rz(e){Ol(e);const t=e.codePointAt(0)===47;let r=nz(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function nz(e,t){let r="",s=0,o=-1,u=0,d=-1,l,c;for(;++d<=e.length;){if(d<e.length)l=e.codePointAt(d);else{if(l===47)break;l=47}if(l===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(c=r.lastIndexOf("/"),c!==r.length-1){c<0?(r="",s=0):(r=r.slice(0,c),s=r.length-1-r.lastIndexOf("/")),o=d,u=0;continue}}else if(r.length>0){r="",s=0,o=d,u=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,d):r=e.slice(o+1,d),s=d-o-1;o=d,u=0}else l===46&&u>-1?u++:u=-1}return r}function Ol(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const sz={cwd:iz};function iz(){return"/"}function ip(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oz(e){if(typeof e=="string")e=new URL(e);else if(!ip(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return az(e)}function az(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const s=t.codePointAt(r+2);if(s===70||s===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const im=["history","path","basename","stem","extname","dirname"];class v2{constructor(t){let r;t?ip(t)?r={path:t}:typeof t=="string"||lz(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":sz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<im.length;){const u=im[s];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)im.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(t){am(t,"basename"),om(t,"basename"),this.path=Yn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(t){Ew(this.basename,"dirname"),this.path=Yn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(t){if(om(t,"extname"),Ew(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ip(t)&&(t=oz(t)),am(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(t){am(t,"stem"),om(t,"stem"),this.path=Yn.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){const o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){const o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){const o=new Dr(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function om(e,t){if(e&&e.includes(Yn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yn.sep+"`")}function am(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ew(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function lz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cz=(function(e){const s=this.constructor.prototype,o=s[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,s),u}),uz={}.hasOwnProperty;class Yg extends cz{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=X$()}copy(){const t=new Yg;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];t.use(...s)}return t.data(sm(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(um("data",this.frozen),this.namespace[t]=r,this):uz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(um("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=ou(t),s=this.parser||this.Parser;return lm("parse",s),s(String(r),r)}process(t,r){const s=this;return this.freeze(),lm("process",this.parser||this.Parser),cm("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,d){const l=ou(t),c=s.parse(l);s.run(c,l,function(m,h,x){if(m||!h||!x)return f(m);const w=h,k=s.stringify(w,x);fz(k)?x.value=k:x.result=k,f(m,x)});function f(m,h){m||!h?d(m):u?u(h):r(void 0,h)}}}processSync(t){let r=!1,s;return this.freeze(),lm("processSync",this.parser||this.Parser),cm("processSync",this.compiler||this.Compiler),this.process(t,o),Aw("processSync","process",r),s;function o(u,d){r=!0,jw(u),s=d}}run(t,r,s){Pw(t),this.freeze();const o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?u(void 0,s):new Promise(u);function u(d,l){const c=ou(r);o.run(t,c,f);function f(m,h,x){const w=h||t;m?l(m):d?d(w):s(void 0,w,x)}}}runSync(t,r){let s=!1,o;return this.run(t,r,u),Aw("runSync","run",s),o;function u(d,l){jw(d),o=l,s=!0}}stringify(t,r){this.freeze();const s=ou(r),o=this.compiler||this.Compiler;return cm("stringify",o),Pw(t),o(t,s)}use(t,...r){const s=this.attachers,o=this.namespace;if(um("use",this.frozen),t!=null)if(typeof t=="function")c(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...h]=f;c(m,h)}else d(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function d(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(o.settings=sm(!0,o.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const h=f[m];u(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,m){let h=-1,x=-1;for(;++h<s.length;)if(s[h][0]===f){x=h;break}if(x===-1)s.push([f,...m]);else if(m.length>0){let[w,...k]=m;const _=s[x][1];sp(_)&&sp(w)&&(w=sm(!0,_,w)),s[x]=[f,w,...k]}}}}const dz=new Yg().freeze();function lm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function um(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pw(e){if(!sp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Aw(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ou(e){return hz(e)?e:new v2(e)}function hz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fz(e){return typeof e=="string"||mz(e)}function mz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tw=[],Rw={allowDangerousHtml:!0},gz=/^(https?|ircs?|mailto|xmpp)$/i,xz=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function vz(e){const t=yz(e),r=bz(e);return wz(t.runSync(t.parse(r),r),e)}function yz(e){const t=e.rehypePlugins||Tw,r=e.remarkPlugins||Tw,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rw}:Rw;return dz().use(Q9).use(r).use(K$,s).use(t)}function bz(e){const t=e.children||"",r=new v2;return typeof t=="string"&&(r.value=t),r}function wz(e,t){const r=t.allowedElements,s=t.allowElement,o=t.components,u=t.disallowedElements,d=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||_z;for(const m of xz)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+pz+m.id,void 0);return x2(e,f),T8(e,{Fragment:n.Fragment,components:o,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0});function f(m,h,x){if(m.type==="raw"&&x&&typeof h=="number")return d?x.children.splice(h,1):x.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let w;for(w in em)if(Object.hasOwn(em,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],_=em[w];(_===null||_.includes(m.tagName))&&(m.properties[w]=c(String(k||""),w,m))}}if(m.type==="element"){let w=r?!r.includes(m.tagName):u?u.includes(m.tagName):!1;if(!w&&s&&typeof h=="number"&&(w=!s(m,h,x)),w&&x&&typeof h=="number")return l&&m.children?x.children.splice(h,1,...m.children):x.children.splice(h,1),h}}}function _z(e){const t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||gz.test(e.slice(0,t))?e:""}function Sz(){var z,K;const[e,t]=C.useState(null),[r,s]=C.useState(""),[o,u]=C.useState({open:!1,field:null,type:"directory"}),[d,l]=C.useState(!0),[c,f]=C.useState(!1),[m,h]=C.useState(null),[x,w]=C.useState(!1),[k,_]=C.useState(null),[v,b]=C.useState([]),[g,y]=C.useState({open:!1,content:"",loading:!1});C.useEffect(()=>{I(),j(),E()},[]);const j=async()=>{try{const G=await ke.checkVersion();h(G)}catch(G){console.error("Failed to load version info:",G)}},E=async()=>{try{const G=await ke.getProject();_(G.dir),P(G.dir)}catch(G){console.error("Failed to load project info:",G)}},P=async G=>{if(G)try{const U=await ke.getHiddenSubprojects(G);b(U.hidden||[])}catch(U){console.error("Failed to load hidden sub-projects:",U)}},T=async G=>{if(k)try{const U=await ke.unhideSubproject(k,G);U.success?(ee.success("Sub-project unhidden"),P(k)):ee.error(U.error||"Failed to unhide")}catch(U){ee.error("Failed to unhide: "+U.message)}},N=async()=>{if(!(m!=null&&m.updateAvailable)){ee.error("No update available");return}w(!0);try{const G=await ke.performUpdate({updateMethod:m.updateMethod,sourcePath:m.sourcePath});G.success?(G.updateMethod==="npm"?ee.success("Updated via npm! Run: coder-config ui stop && coder-config ui"):ee.success("Updated! Run: coder-config ui stop && coder-config ui"),j()):ee.error("Update failed: "+G.error)}catch(G){ee.error("Update failed: "+G.message)}finally{w(!1)}},R=async()=>{y(G=>({...G,open:!0,loading:!0}));try{const G=await ke.getChangelog();G.success?y(U=>({...U,content:G.content,loading:!1})):(ee.error("Failed to load changelog"),y(U=>({...U,open:!1,loading:!1})))}catch(G){ee.error("Failed to load changelog: "+G.message),y(U=>({...U,open:!1,loading:!1}))}},I=async()=>{try{l(!0);const G=await ke.getConfig();t(G.config),s(G.path)}catch{ee.error("Failed to load settings")}finally{l(!1)}},O=async()=>{f(!0);try{await ke.saveConfig(e),ee.success("Preferences saved!")}catch{ee.error("Failed to save preferences")}finally{f(!1)}},$=(G,U)=>{t(L=>({...L,[G]:U}))},W=(G,U,L)=>{t(M=>({...M,[G]:{...M[G],[U]:L}}))},Y=async G=>{const U=(e==null?void 0:e.enabledTools)||["claude"];let L;if(U.includes(G)){if(U.length<=1){ee.error("At least one tool must be enabled");return}L=U.filter(B=>B!==G)}else L=[...U,G];const M={...e,enabledTools:L};t(M);try{await ke.saveConfig(M),ee.success(`${G==="claude"?"Claude Code":G==="gemini"?"Gemini CLI":"Antigravity"} ${L.includes(G)?"enabled":"disabled"}`)}catch{t(e),ee.error("Failed to save preference")}};return d?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:n.jsx(A1,{className:"w-5 h-5 text-muted-foreground"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"coder-config Preferences"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),n.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsx("div",{children:n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:r})]})}),n.jsxs(le,{onClick:O,disabled:c,children:[c?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(wr,{className:"w-4 h-4"}),"Directories"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),n.jsxs("div",{className:"space-y-2",children:[((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).map((G,U)=>n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{value:G||"",onChange:L=>{const M=[...(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])];M[U]=L.target.value,$("toolsDirs",M),e!=null&&e.toolsDir&&t(B=>{const{toolsDir:q,...F}=B;return{...F,toolsDirs:M}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>u({open:!0,field:"toolsDirs",type:"directory",index:U}),title:"Browse...",children:n.jsx(si,{className:"w-4 h-4"})}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>{const M=((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).filter((B,q)=>q!==U);t(B=>{const{toolsDir:q,...F}=B;return{...F,toolsDirs:M.length>0?M:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:n.jsx(ei,{className:"w-4 h-4"})})]},U)),n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>u({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[n.jsx(Mi,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{value:(e==null?void 0:e.registryPath)||"",onChange:G=>$("registryPath",G.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>u({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:n.jsx(si,{className:"w-4 h-4"})})]})]})]})]}),n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(h5,{className:"w-4 h-4"}),"User Interface"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),n.jsx(ct,{type:"number",value:((z=e==null?void 0:e.ui)==null?void 0:z.port)||3333,onChange:G=>W("ui","port",parseInt(G.target.value)||3333),placeholder:"3333",className:"w-32"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),n.jsx(dt,{checked:((K=e==null?void 0:e.ui)==null?void 0:K.openBrowser)??!0,onCheckedChange:G=>W("ui","openBrowser",G)})]})]})]}),n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(rM,{className:"w-4 h-4"}),"AI Assistant"]}),n.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Choose which AI assistant to use for features like MCP creation and tool import."}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${((e==null?void 0:e.aiAssistant)||"claude")==="claude"?"border-orange-500 bg-orange-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>$("aiAssistant","claude"),children:[n.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((e==null?void 0:e.aiAssistant)||"claude")==="claude",onChange:()=>$("aiAssistant","claude"),className:"sr-only"}),n.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-orange-500"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",n.jsx("code",{className:"text-xs",children:"claude"})]})]}),((e==null?void 0:e.aiAssistant)||"claude")==="claude"&&n.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),n.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg cursor-pointer border-2 transition-colors ${(e==null?void 0:e.aiAssistant)==="gemini"?"border-blue-500 bg-blue-500/5":"border-transparent bg-muted/50 hover:bg-muted"}`,onClick:()=>$("aiAssistant","gemini"),children:[n.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(e==null?void 0:e.aiAssistant)==="gemini",onChange:()=>$("aiAssistant","gemini"),className:"sr-only"}),n.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:n.jsx(Ft,{className:"w-4 h-4 text-blue-500"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",n.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(e==null?void 0:e.aiAssistant)==="gemini"&&n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),n.jsxs("div",{className:"border-b border-border pb-6",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kM,{className:"w-4 h-4"}),"Enabled AI Tools"]}),n.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Select which AI coding tools to generate MCP configurations for. The Apply button will update all enabled tools."}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-orange-500"})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",n.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),n.jsx(dt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>Y("claude")})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-blue-500"})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",n.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),n.jsx(dt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>Y("gemini")})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:n.jsx(Ht,{className:"w-4 h-4 text-purple-500"})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",n.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),n.jsx(dt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>Y("antigravity")})]}),n.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",n.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),v.length>0&&n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(w1,{className:"w-4 h-4"}),"Hidden Sub-projects"]}),n.jsx("div",{className:"space-y-2",children:v.map(G=>n.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(wr,{className:"w-4 h-4 text-muted-foreground"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:G.name}),n.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:G.dir.replace(k+"/","")})]})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>T(G.dir),className:"h-7",children:[n.jsx(_1,{className:"w-3 h-3 mr-1"}),"Unhide"]})]},G.dir))})]}),n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Cr,{className:"w-4 h-4"}),"About"]}),n.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),n.jsx("span",{className:"font-medium font-mono text-foreground",children:(m==null?void 0:m.installedVersion)||"Loading..."})]}),(m==null?void 0:m.updateAvailable)&&n.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),n.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",m.latestVersion," via ",m.updateMethod==="npm"?"npm":m.sourcePath]})]}),n.jsxs(le,{size:"sm",onClick:N,disabled:x,className:"bg-green-600 hover:bg-green-700 text-white",children:[x?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(bl,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(m!=null&&m.updateAvailable)&&(m==null?void 0:m.latestVersion)&&n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),n.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[m.latestVersion," ✓"]})]}),(m==null?void 0:m.sourcePath)&&!(m!=null&&m.updateAvailable)&&n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-xs text-muted-foreground",children:m.sourcePath}),n.jsx(le,{size:"sm",variant:"outline",onClick:N,disabled:x,className:"h-7",children:x?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(pr,{className:"w-3 h-3"})})]})]}),n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),n.jsx("code",{className:"text-xs text-muted-foreground",children:(m==null?void 0:m.installDir)||"~/.coder-config"})]}),n.jsxs("div",{className:"border-t border-border pt-3 mt-3 space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),n.jsx("a",{href:"https://github.com/regression-io/coder-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-muted-foreground",children:"What's New"}),n.jsxs("button",{onClick:R,className:"text-primary hover:underline flex items-center gap-1",children:[n.jsx(Am,{className:"w-3 h-3"}),"Changelog"]})]}),n.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",n.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"coder-config ui"})]})]})]})]})]})]}),n.jsx(_g,{open:o.open,onOpenChange:G=>u(U=>({...U,open:G})),onSelect:G=>{if(o.field==="toolsDirs"){const U=(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]);if(o.index===-1)t(L=>{const{toolsDir:M,...B}=L;return{...B,toolsDirs:[...U,G]}});else{const L=[...U];L[o.index]=G,t(M=>{const{toolsDir:B,...q}=M;return{...q,toolsDirs:L}})}}else o.field&&$(o.field,G)},type:o.type,initialPath:o.field==="toolsDirs"&&o.index>=0?((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]))[o.index]||"~":(e==null?void 0:e[o.field])||"~",title:o.type==="directory"?"Select Directory":"Select File"}),n.jsx(Tt,{open:g.open,onOpenChange:G=>y(U=>({...U,open:G})),children:n.jsxs(St,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[n.jsx(Ct,{className:"flex-shrink-0",children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Am,{className:"w-5 h-5"}),"Changelog"]})}),g.loading?n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ut,{className:"w-6 h-6 animate-spin text-primary"})}):n.jsx(Nn,{className:"h-[60vh]",children:n.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none pr-4",children:n.jsx(vz,{components:{h1:({children:G})=>n.jsx("h1",{className:"text-xl font-bold text-foreground mb-4",children:G}),h2:({children:G})=>n.jsx("h2",{className:"text-lg font-semibold text-foreground mt-6 mb-3 pb-2 border-b border-border",children:G}),h3:({children:G})=>n.jsx("h3",{className:"text-base font-medium text-foreground mt-4 mb-2",children:G}),p:({children:G})=>n.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:G}),ul:({children:G})=>n.jsx("ul",{className:"text-sm text-muted-foreground list-disc pl-5 mb-3 space-y-1",children:G}),li:({children:G})=>n.jsx("li",{className:"text-sm",children:G}),code:({children:G})=>n.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:G}),hr:()=>n.jsx("hr",{className:"my-4 border-border"}),strong:({children:G})=>n.jsx("strong",{className:"font-semibold text-foreground",children:G})},children:g.content})})})]})})]})}function Cz(){const[e,t]=C.useState(null),[r,s]=C.useState({}),[o,u]=C.useState(!0);C.useEffect(()=>{d()},[]);const d=async()=>{try{u(!0);const[c,f]=await Promise.all([ke.getClaudeSettings(),ke.getRegistry()]);t(c.settings),s(f.mcpServers||{})}catch(c){console.error("Failed to load Claude settings:",c)}finally{u(!1)}},l=async c=>{try{await ke.saveClaudeSettings(c),t(c),ee.success("Claude Code settings saved!")}catch(f){ee.error("Failed to save settings: "+f.message)}};return o?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:n.jsx(Tj,{settings:e,onSave:l,loading:o,settingsPath:"~/.claude/settings.json",mcpServers:r})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config init # Initialize project"}),n.jsx("p",{children:"coder-config apply # Generate .mcp.json from config"}),n.jsx("p",{children:"coder-config show # Show current project config"})]})]})]})}function kz(){const[e,t]=C.useState(null),[r,s]=C.useState(!0);C.useEffect(()=>{o()},[]);const o=async()=>{try{s(!0);const d=await ke.getGeminiSettings();t(d.settings)}catch(d){console.error("Failed to load Gemini settings:",d)}finally{s(!1)}},u=async d=>{try{await ke.saveGeminiSettings(d),t(d),ee.success("Gemini CLI settings saved!")}catch(l){ee.error("Failed to save settings: "+l.message)}};return r?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-blue-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:n.jsx(Rj,{settings:e,onSave:u,loading:r,settingsPath:"~/.gemini/settings.json"})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config apply # Generate settings for all tools"}),n.jsx("p",{children:"coder-config apply --gemini # Generate Gemini settings only"})]})]})]})}const jz=[{id:"off",name:"Off",description:"Never auto-execute; requires allow list"},{id:"auto",name:"Auto",description:"Safety model determines execution"},{id:"turbo",name:"Turbo",description:"Auto-execute unless in deny list",dangerous:!0}],Nz=[{id:"always-proceed",name:"Always Proceed",description:"Agent never requests review"},{id:"agent-decides",name:"Agent Decides",description:"Agent determines when review is needed"},{id:"request-review",name:"Request Review",description:"Agent always requests review"}],Ez=[{id:"always-proceed",name:"Always Proceed",description:"Maximum autonomy",dangerous:!0},{id:"request-review",name:"Request Review",description:"Ask before browser JavaScript"},{id:"disabled",name:"Disabled",description:"Never run browser JavaScript"}];function Pz({settings:e,onSave:t,loading:r,settingsPath:s}){const[o,u]=C.useState(e||{}),[d,l]=C.useState(!1),[c,f]=C.useState("rich"),[m,h]=C.useState(JSON.stringify(e||{},null,2)),[x,w]=C.useState({open:!1,name:"",json:""}),[k,_]=C.useState({}),v=async()=>{l(!0);try{if(c==="json")try{const T=JSON.parse(m);await t(T),u(T)}catch{ee.error("Invalid JSON"),l(!1);return}else await t(o),h(JSON.stringify(o,null,2));ee.success("Settings saved")}finally{l(!1)}},b=(T,N)=>{u(R=>({...R,[T]:N}))},g=(T,N)=>(o==null?void 0:o[T])??N,y=o.mcpServers||{},j=()=>{const{name:T,json:N}=x;if(!T.trim()){ee.error("Please enter a name for the MCP");return}let R;try{R=JSON.parse(N)}catch{ee.error("Invalid JSON configuration");return}if(!R.command){ee.error('MCP config must have a "command" field');return}u(I=>({...I,mcpServers:{...I.mcpServers,[T.trim()]:R}})),w({open:!1,name:"",json:""}),ee.success(`Added MCP: ${T}`)},E=T=>{u(N=>{const{[T]:R,...I}=N.mcpServers||{};return{...N,mcpServers:I}}),ee.success(`Removed MCP: ${T}`)},P=T=>{_(N=>({...N,[T]:!N[T]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-500/10 flex items-center justify-center",children:n.jsx(wl,{className:"w-5 h-5 text-purple-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Antigravity Settings",n.jsx(Qe,{variant:"outline",className:"text-xs font-normal text-purple-600 border-purple-300 dark:border-purple-700",children:"Google"})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:s})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),n.jsxs(le,{onClick:v,disabled:d||r,children:[d?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),c==="json"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(pt,{value:m,onChange:T=>h(T.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-purple-500"}),"Security Policies"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Terminal Command Execution"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Control how the agent executes shell commands"})]}),n.jsxs(fr,{value:g("terminalPolicy","auto"),onValueChange:T=>b("terminalPolicy",T),children:[n.jsx(ar,{className:"w-44",children:n.jsx(mr,{})}),n.jsx(lr,{children:jz.map(T=>n.jsx(xt,{value:T.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{children:T.name}),T.dangerous&&n.jsx(Qe,{variant:"destructive",className:"text-xs",children:"Risk"})]})},T.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Review Policy"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"When the agent should request human review"})]}),n.jsxs(fr,{value:g("reviewPolicy","agent-decides"),onValueChange:T=>b("reviewPolicy",T),children:[n.jsx(ar,{className:"w-44",children:n.jsx(mr,{})}),n.jsx(lr,{children:Nz.map(T=>n.jsx(xt,{value:T.id,children:T.name},T.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"JavaScript Execution"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Control browser JavaScript execution"})]}),n.jsxs(fr,{value:g("jsPolicy","request-review"),onValueChange:T=>b("jsPolicy",T),children:[n.jsx(ar,{className:"w-44",children:n.jsx(mr,{})}),n.jsx(lr,{children:Ez.map(T=>n.jsx(xt,{value:T.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{children:T.name}),T.dangerous&&n.jsx(Qe,{variant:"destructive",className:"text-xs",children:"Risk"})]})},T.id))})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Fn,{className:"w-4 h-4 text-purple-500"}),"MCP Servers",n.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(y).length})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
|
|
583
583
|
"command": "npx",
|
|
584
584
|
"args": ["-y", "@example/mcp-server"]
|
|
585
585
|
}`}),children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([T,N])=>n.jsxs(Ml,{open:k[T],onOpenChange:()=>P(T),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Dl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[T]?n.jsx(Sr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(Kr,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Fn,{className:"w-4 h-4 text-purple-500"}),n.jsx("span",{className:"font-medium text-sm",children:T}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:N.command})]}),n.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(T),children:n.jsx(jn,{className:"w-4 h-4"})})]}),n.jsx(Ll,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify(N,null,2)})})})]},T))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Bi,{className:"w-4 h-4 text-purple-500"}),"Browser Settings"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"URL Allowlist"}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Domains the agent can visit (one per line)"}),n.jsx(pt,{value:g("browserAllowlist",""),onChange:T=>b("browserAllowlist",T.target.value),placeholder:`github.com
|
|
586
586
|
stackoverflow.com
|
|
587
|
-
docs.python.org`,className:"font-mono text-sm",rows:4})]})})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-purple-500"}),"Agent Behavior"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Planning mode uses structured plans; Fast mode executes directly"})]}),n.jsxs(fr,{value:g("agentMode","planning"),onValueChange:T=>b("agentMode",T),children:[n.jsx(ar,{className:"w-36",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"planning",children:"Planning"}),n.jsx(xt,{value:"fast",children:"Fast"})]})]})]})})]})]}),n.jsx(Tt,{open:x.open,onOpenChange:T=>w({...x,open:T}),children:n.jsxs(St,{className:"bg-card",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP Server"}),n.jsx(tr,{children:"Add a new MCP server to Antigravity"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{value:x.name,onChange:T=>w({...x,name:T.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(pt,{value:x.json,onChange:T=>w({...x,json:T.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(le,{onClick:j,children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function Az(){const[e,t]=C.useState(null),[r,s]=C.useState(!0);C.useEffect(()=>{o()},[]);const o=async()=>{try{s(!0);const d=await ke.getAntigravitySettings();t(d.settings)}catch(d){console.error("Failed to load Antigravity settings:",d)}finally{s(!1)}},u=async d=>{try{await ke.saveAntigravitySettings(d),t(d),ee.success("Antigravity settings saved!")}catch(l){ee.error("Failed to save settings: "+l.message)}};return r?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-purple-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:n.jsx(Pz,{settings:e,onSave:u,loading:r,settingsPath:"~/.gemini/antigravity/settings.json"})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"claude-config apply # Generate settings for all tools"}),n.jsx("p",{children:"claude-config apply --antigravity # Generate Antigravity settings only"})]})]})]})}const Tz=[{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",description:"Latest and most capable"},{id:"gpt-5-codex",name:"GPT-5 Codex",description:"Previous generation"},{id:"gpt-5",name:"GPT-5",description:"General purpose"},{id:"o3-mini",name:"o3-mini",description:"Fast reasoning model"}],Rz=[{id:"on-request",name:"On Request",description:"Ask before running commands (default)"},{id:"untrusted",name:"Untrusted",description:"Ask for everything"},{id:"on-failure",name:"On Failure",description:"Ask only when commands fail"},{id:"never",name:"Never",description:"Never ask (use with caution)"}],Mz=[{id:"read-only",name:"Read Only",description:"Can only read files (default)"},{id:"workspace-write",name:"Workspace Write",description:"Can write within workspace"},{id:"danger-full-access",name:"Full Access",description:"Full filesystem access (dangerous)"}],Dz=[{id:"minimal",name:"Minimal",description:"Fastest, least thorough"},{id:"low",name:"Low",description:"Quick responses"},{id:"medium",name:"Medium",description:"Balanced (default)"},{id:"high",name:"High",description:"More thorough"},{id:"xhigh",name:"Extra High",description:"Most thorough"}],Lz=[{id:"save-all",name:"Save All",description:"Keep all session history"},{id:"none",name:"None",description:"Do not persist history"}];function Iz({settings:e,rawToml:t,onSave:r,loading:s,settingsPath:o}){const[u,d]=C.useState(e||{}),[l,c]=C.useState(!1),[f,m]=C.useState("rich"),[h,x]=C.useState(t||""),[w,k]=C.useState({open:!1,name:"",json:""}),[_,v]=C.useState({}),b=async()=>{c(!0);try{f==="toml"?await r(null,h):await r(u),ee.success("Settings saved")}catch(I){ee.error("Failed to save: "+I.message)}finally{c(!1)}},g=(I,O)=>{d($=>({...$,[I]:O}))},y=(I,O,$)=>{d(W=>({...W,[I]:{...W[I],[O]:$}}))},j=(I,O="")=>(u==null?void 0:u[I])??O,E=(I,O,$=!1)=>{var W;return((W=u==null?void 0:u[I])==null?void 0:W[O])??$},P=u.mcp_servers||{},T=()=>{const{name:I,json:O}=w;if(!I.trim()){ee.error("Please enter a name for the MCP server");return}let $;try{$=JSON.parse(O)}catch{ee.error("Invalid JSON configuration");return}if(!$.command){ee.error('MCP config must have a "command" field');return}d(W=>({...W,mcp_servers:{...W.mcp_servers,[I.trim()]:$}})),k({open:!1,name:"",json:""}),ee.success(`Added MCP: ${I}`)},N=I=>{d(O=>{const{[I]:$,...W}=O.mcp_servers||{};return{...O,mcp_servers:W}}),ee.success(`Removed MCP: ${I}`)},R=I=>{v(O=>({...O,[I]:!O[I]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-green-500/10 flex items-center justify-center",children:n.jsx(Ft,{className:"w-5 h-5 text-green-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Codex CLI Settings",n.jsxs(Qe,{variant:"outline",className:"text-xs font-normal text-green-600 border-green-300 dark:border-green-700",children:[n.jsx(Ht,{className:"w-3 h-3 mr-1"}),"OpenAI"]})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:o})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${f==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>m("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${f==="toml"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>m("toml"),children:"TOML"})]}),n.jsxs(le,{onClick:b,disabled:l||s,children:[l?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),f==="toml"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(pt,{value:h,onChange:I=>x(I.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"# Codex CLI config.toml"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ht,{className:"w-4 h-4 text-green-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Codex CLI sessions"})]}),n.jsxs(fr,{value:j("model",""),onValueChange:I=>g("model",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{placeholder:"Select model"})}),n.jsx(lr,{children:Tz.map(I=>n.jsx(xt,{value:I.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:I.name})})},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Reasoning Effort"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"How thoroughly the model should reason"})]}),n.jsxs(fr,{value:j("model_reasoning_effort","medium"),onValueChange:I=>g("model_reasoning_effort",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{})}),n.jsx(lr,{children:Dz.map(I=>n.jsx(xt,{value:I.id,children:I.name},I.id))})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-green-500"}),"Security"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Approval Policy"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"When to ask for command approval"})]}),n.jsxs(fr,{value:j("approval_policy","on-request"),onValueChange:I=>g("approval_policy",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{})}),n.jsx(lr,{children:Rz.map(I=>n.jsx(xt,{value:I.id,children:I.name},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Sandbox Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Filesystem and network access level"})]}),n.jsxs(fr,{value:j("sandbox_mode","read-only"),onValueChange:I=>g("sandbox_mode",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{})}),n.jsx(lr,{children:Mz.map(I=>n.jsx(xt,{value:I.id,children:I.name},I.id))})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Fn,{className:"w-4 h-4 text-green-500"}),"MCP Servers",n.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(P).length})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>k({open:!0,name:"",json:`{
|
|
587
|
+
docs.python.org`,className:"font-mono text-sm",rows:4})]})})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-purple-500"}),"Agent Behavior"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Planning mode uses structured plans; Fast mode executes directly"})]}),n.jsxs(fr,{value:g("agentMode","planning"),onValueChange:T=>b("agentMode",T),children:[n.jsx(ar,{className:"w-36",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"planning",children:"Planning"}),n.jsx(xt,{value:"fast",children:"Fast"})]})]})]})})]})]}),n.jsx(Tt,{open:x.open,onOpenChange:T=>w({...x,open:T}),children:n.jsxs(St,{className:"bg-card",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP Server"}),n.jsx(tr,{children:"Add a new MCP server to Antigravity"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{value:x.name,onChange:T=>w({...x,name:T.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(pt,{value:x.json,onChange:T=>w({...x,json:T.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(le,{onClick:j,children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function Az(){const[e,t]=C.useState(null),[r,s]=C.useState(!0);C.useEffect(()=>{o()},[]);const o=async()=>{try{s(!0);const d=await ke.getAntigravitySettings();t(d.settings)}catch(d){console.error("Failed to load Antigravity settings:",d)}finally{s(!1)}},u=async d=>{try{await ke.saveAntigravitySettings(d),t(d),ee.success("Antigravity settings saved!")}catch(l){ee.error("Failed to save settings: "+l.message)}};return r?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-purple-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:n.jsx(Pz,{settings:e,onSave:u,loading:r,settingsPath:"~/.gemini/antigravity/settings.json"})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config apply # Generate settings for all tools"}),n.jsx("p",{children:"coder-config apply --antigravity # Generate Antigravity settings only"})]})]})]})}const Tz=[{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",description:"Latest and most capable"},{id:"gpt-5-codex",name:"GPT-5 Codex",description:"Previous generation"},{id:"gpt-5",name:"GPT-5",description:"General purpose"},{id:"o3-mini",name:"o3-mini",description:"Fast reasoning model"}],Rz=[{id:"on-request",name:"On Request",description:"Ask before running commands (default)"},{id:"untrusted",name:"Untrusted",description:"Ask for everything"},{id:"on-failure",name:"On Failure",description:"Ask only when commands fail"},{id:"never",name:"Never",description:"Never ask (use with caution)"}],Mz=[{id:"read-only",name:"Read Only",description:"Can only read files (default)"},{id:"workspace-write",name:"Workspace Write",description:"Can write within workspace"},{id:"danger-full-access",name:"Full Access",description:"Full filesystem access (dangerous)"}],Dz=[{id:"minimal",name:"Minimal",description:"Fastest, least thorough"},{id:"low",name:"Low",description:"Quick responses"},{id:"medium",name:"Medium",description:"Balanced (default)"},{id:"high",name:"High",description:"More thorough"},{id:"xhigh",name:"Extra High",description:"Most thorough"}],Lz=[{id:"save-all",name:"Save All",description:"Keep all session history"},{id:"none",name:"None",description:"Do not persist history"}];function Iz({settings:e,rawToml:t,onSave:r,loading:s,settingsPath:o}){const[u,d]=C.useState(e||{}),[l,c]=C.useState(!1),[f,m]=C.useState("rich"),[h,x]=C.useState(t||""),[w,k]=C.useState({open:!1,name:"",json:""}),[_,v]=C.useState({}),b=async()=>{c(!0);try{f==="toml"?await r(null,h):await r(u),ee.success("Settings saved")}catch(I){ee.error("Failed to save: "+I.message)}finally{c(!1)}},g=(I,O)=>{d($=>({...$,[I]:O}))},y=(I,O,$)=>{d(W=>({...W,[I]:{...W[I],[O]:$}}))},j=(I,O="")=>(u==null?void 0:u[I])??O,E=(I,O,$=!1)=>{var W;return((W=u==null?void 0:u[I])==null?void 0:W[O])??$},P=u.mcp_servers||{},T=()=>{const{name:I,json:O}=w;if(!I.trim()){ee.error("Please enter a name for the MCP server");return}let $;try{$=JSON.parse(O)}catch{ee.error("Invalid JSON configuration");return}if(!$.command){ee.error('MCP config must have a "command" field');return}d(W=>({...W,mcp_servers:{...W.mcp_servers,[I.trim()]:$}})),k({open:!1,name:"",json:""}),ee.success(`Added MCP: ${I}`)},N=I=>{d(O=>{const{[I]:$,...W}=O.mcp_servers||{};return{...O,mcp_servers:W}}),ee.success(`Removed MCP: ${I}`)},R=I=>{v(O=>({...O,[I]:!O[I]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-green-500/10 flex items-center justify-center",children:n.jsx(Ft,{className:"w-5 h-5 text-green-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Codex CLI Settings",n.jsxs(Qe,{variant:"outline",className:"text-xs font-normal text-green-600 border-green-300 dark:border-green-700",children:[n.jsx(Ht,{className:"w-3 h-3 mr-1"}),"OpenAI"]})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:o})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${f==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>m("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${f==="toml"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>m("toml"),children:"TOML"})]}),n.jsxs(le,{onClick:b,disabled:l||s,children:[l?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),f==="toml"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(pt,{value:h,onChange:I=>x(I.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"# Codex CLI config.toml"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ht,{className:"w-4 h-4 text-green-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Codex CLI sessions"})]}),n.jsxs(fr,{value:j("model",""),onValueChange:I=>g("model",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{placeholder:"Select model"})}),n.jsx(lr,{children:Tz.map(I=>n.jsx(xt,{value:I.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:I.name})})},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Reasoning Effort"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"How thoroughly the model should reason"})]}),n.jsxs(fr,{value:j("model_reasoning_effort","medium"),onValueChange:I=>g("model_reasoning_effort",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{})}),n.jsx(lr,{children:Dz.map(I=>n.jsx(xt,{value:I.id,children:I.name},I.id))})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-green-500"}),"Security"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Approval Policy"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"When to ask for command approval"})]}),n.jsxs(fr,{value:j("approval_policy","on-request"),onValueChange:I=>g("approval_policy",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{})}),n.jsx(lr,{children:Rz.map(I=>n.jsx(xt,{value:I.id,children:I.name},I.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Sandbox Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Filesystem and network access level"})]}),n.jsxs(fr,{value:j("sandbox_mode","read-only"),onValueChange:I=>g("sandbox_mode",I),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{})}),n.jsx(lr,{children:Mz.map(I=>n.jsx(xt,{value:I.id,children:I.name},I.id))})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Fn,{className:"w-4 h-4 text-green-500"}),"MCP Servers",n.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(P).length})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>k({open:!0,name:"",json:`{
|
|
588
588
|
"command": "npx",
|
|
589
589
|
"args": ["-y", "@example/mcp-server"],
|
|
590
590
|
"enabled": true
|
|
@@ -600,7 +600,7 @@ You can add a description to the \`${Mo}\` by passing a \`${C2}\` component as a
|
|
|
600
600
|
|
|
601
601
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Mo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
602
602
|
|
|
603
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Zz=y2,P2=b2,A2=w2,T2=j2,R2=E2,M2=S2,D2=k2;const eH=Zz,L2=C.forwardRef(({className:e,...t},r)=>n.jsx(P2,{className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));L2.displayName=P2.displayName;const tH=C.forwardRef(({className:e,...t},r)=>n.jsxs(eH,{children:[n.jsx(L2,{}),n.jsx(A2,{ref:r,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));tH.displayName=A2.displayName;const rH=C.forwardRef(({className:e,...t},r)=>n.jsx(M2,{ref:r,className:je("text-lg font-semibold",e),...t}));rH.displayName=M2.displayName;const nH=C.forwardRef(({className:e,...t},r)=>n.jsx(D2,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));nH.displayName=D2.displayName;const sH=C.forwardRef(({className:e,...t},r)=>n.jsx(T2,{ref:r,className:je(Gp(),e),...t}));sH.displayName=T2.displayName;const iH=C.forwardRef(({className:e,...t},r)=>n.jsx(R2,{ref:r,className:je(Gp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));iH.displayName=R2.displayName;const oH=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},aH=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}},Dw={claude:{name:"Claude Code",command:"claude",color:"orange"},gemini:{name:"Gemini CLI",command:"gemini",color:"blue"}};function lH({registry:e,searchQuery:t,setSearchQuery:r,onUpdate:s}){var ne;const[o,u]=C.useState(()=>oH("registrySearchMode","local")),d=J=>{u(J),aH("registrySearchMode",J)},[l,c]=C.useState([]),[f,m]=C.useState(!1),[h,x]=C.useState({open:!1,name:"",mcp:null,isNew:!1}),[w,k]=C.useState({name:"",command:"npx",args:"",env:"",description:""}),[_,v]=C.useState(!1),[b,g]=C.useState([]),[y,j]=C.useState(""),[E,P]=C.useState({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),[T,N]=C.useState(""),[R,I]=C.useState("claude");C.useEffect(()=>{(async()=>{var ie;try{const ye=await ke.getConfig();I(((ie=ye.config)==null?void 0:ie.aiAssistant)||"claude")}catch(ye){console.error("Failed to load preferences:",ye)}})()},[]);const O=Dw[R]||Dw.claude,$=Object.entries(e.mcpServers||{}),W=$.filter(([J])=>J.toLowerCase().includes(t.toLowerCase()));C.useEffect(()=>{(async()=>{try{const ie=await ke.getMcpTools();g(ie.tools||[]),j(ie.dir||"")}catch(ie){console.error("Failed to load MCP tools:",ie)}})()},[]);const Y=b.filter(J=>{var ie;return!((ie=e.mcpServers)!=null&&ie[J.name])&&J.name.toLowerCase().includes(t.toLowerCase())}),z=(J,ie)=>{k({name:J,command:ie.command||"npx",args:JSON.stringify(ie.args||[],null,2),env:JSON.stringify(ie.env||{},null,2),description:ie.description||""}),x({open:!0,name:J,mcp:ie,isNew:!1})},[K,G]=C.useState({open:!1,json:""}),U=()=>{G({open:!0,json:""})},L=async()=>{if(!K.json.trim()){ee.error("Please paste the MCP JSON configuration");return}try{let J;try{J=JSON.parse(K.json)}catch{ee.error("Invalid JSON format");return}let ie={};if(J.mcpServers&&typeof J.mcpServers=="object")ie=J.mcpServers;else if(typeof J=="object"&&!Array.isArray(J)){if(Object.keys(J).includes("command")){ee.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}ie=J}if(Object.keys(ie).length===0){ee.error("No MCP configurations found in the JSON");return}for(const[Ve,re]of Object.entries(ie))if(!re.command){ee.error(`MCP "${Ve}" is missing required "command" field`);return}const ye={...e};ye.mcpServers||(ye.mcpServers={});for(const[Ve,re]of Object.entries(ie))ye.mcpServers[Ve]=re;await ke.updateRegistry(ye);const Oe=Object.keys(ie).length;ee.success(`Added ${Oe} MCP${Oe>1?"s":""} to registry!`),G({open:!1,json:""}),s()}catch(J){ee.error("Failed to add: "+J.message)}},M=J=>{const ye={[J.name.replace("@modelcontextprotocol/server-","").replace("mcp-server-","").replace("mcp-","").replace(/-/g,"_")]:{command:J.suggestedCommand||"npx",args:J.suggestedArgs||["-y",J.name],...J.description&&{description:J.description}}};G({open:!0,json:JSON.stringify(ye,null,2)})},B=J=>{let ie,ye;J.type==="python"?(ie="uv",ye=["run","--directory",J.path,"python",J.entryPoint||"mcp_server.py"]):(ie="node",ye=[J.path+"/index.js"]);const Oe={[J.name]:{command:ie,args:ye,...J.description&&{description:J.description}}};G({open:!0,json:JSON.stringify(Oe,null,2)})},q=()=>{if(!E.url.trim()){ee.error("Please enter a URL");return}P(J=>({...J,showTerminal:!0}))},F=()=>{if(E.localTool){const ye=E.localTool,Oe=`Analyze the MCP server at ${ye.path}. Read the README and source files to understand how to run it. Output a JSON config block with name, command, args array, and description for the MCP registry. Be specific about the exact command needed.`;return`cd '${ye.path}' && ${O.command} '${Oe}'`}const ie=`Clone ${E.url.trim()} into ~/reg/tools. Read the README, determine if Python or Node MCP server, and output a JSON config block with name, command, args, and description.`;return`cd ~/reg/tools && ${O.command} '${ie}'`},oe=J=>{P({open:!0,url:"",showTerminal:!0,localTool:J,pastedConfig:""})},fe=J=>{J===0&&(ee.success("Import completed! Paste the JSON config below to add it to the registry."),ke.getMcpTools().then(ie=>{g(ie.tools||[])}))},me=async()=>{if(!E.pastedConfig.trim()){ee.error("Please paste the JSON config first");return}try{let J;try{J=JSON.parse(E.pastedConfig)}catch{ee.error("Invalid JSON format");return}let ie={};if(J.mcpServers&&typeof J.mcpServers=="object")ie=J.mcpServers;else if(typeof J=="object"&&!Array.isArray(J))if(Object.keys(J).includes("command")){ee.error('JSON is missing the MCP name. Expected format: { "name": { "command": "...", "args": [...] } }');return}else ie=J;if(Object.keys(ie).length===0){ee.error("No MCP configurations found in the pasted JSON");return}for(const[Ve,re]of Object.entries(ie))if(!re.command){ee.error(`MCP "${Ve}" is missing required "command" field`);return}const ye={...e};ye.mcpServers||(ye.mcpServers={});for(const[Ve,re]of Object.entries(ie))ye.mcpServers[Ve]=re;await ke.updateRegistry(ye);const Oe=Object.keys(ie).length;ee.success(`Added ${Oe} MCP${Oe>1?"s":""} to registry!`),P({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),s()}catch(J){ee.error("Failed to add config: "+J.message)}},X=async()=>{v(!0);try{let J,ie;try{J=JSON.parse(w.args),ie=JSON.parse(w.env)}catch{ee.error("Invalid JSON in args or env"),v(!1);return}const ye={...e};ye.mcpServers||(ye.mcpServers={});const Oe={command:w.command,args:J,...Object.keys(ie).length>0&&{env:ie},...w.description&&{description:w.description}};ye.mcpServers[h.name]=Oe,await ke.updateRegistry(ye),ee.success("MCP updated"),x({open:!1,name:"",mcp:null,isNew:!1}),s()}catch(J){ee.error("Failed to save: "+J.message)}finally{v(!1)}},H=async J=>{try{const ie={...e};delete ie.mcpServers[J],await ke.updateRegistry(ie),ee.success(`Removed ${J} from registry`),s()}catch(ie){ee.error("Failed to delete: "+ie.message)}},ae=async()=>{if(t.trim()){m(!0);try{const J=o==="github"?await ke.searchGithub(t):await ke.searchNpm(t);c(J.results||[])}catch(J){ee.error("Search failed: "+J.message),c([])}finally{m(!1)}}};return C.useEffect(()=>{o!=="local"&&c([])},[o]),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white dark:text-white flex items-center gap-2",children:[n.jsx(ns,{className:"w-5 h-5 text-blue-600"}),"MCP Registry"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>P({open:!0,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"folder"}),className:"border-green-300 dark:border-green-700 text-green-700 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-950/30",children:[n.jsx(wr,{className:"w-4 h-4 mr-2"}),"Import Folder"]}),n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>P({open:!0,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),className:"border-purple-300 dark:border-purple-700 text-purple-700 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-950/30",children:[n.jsx(du,{className:"w-4 h-4 mr-2"}),"Import URL"]}),n.jsxs(le,{variant:"outline",size:"sm",onClick:U,className:"border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/30",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]}),n.jsxs("div",{className:"flex gap-2 mb-4",children:[n.jsxs(le,{variant:o==="local"?"default":"outline",size:"sm",onClick:()=>d("local"),className:o==="local"?"bg-blue-600":"",children:[n.jsx(ns,{className:"w-4 h-4 mr-2"}),"Registry (",$.length,")"]}),n.jsxs(le,{variant:o==="tools"?"default":"outline",size:"sm",onClick:()=>d("tools"),className:o==="tools"?"bg-purple-600":"",children:[n.jsx(wr,{className:"w-4 h-4 mr-2"}),"Tools (",b.length,")"]}),n.jsxs(le,{variant:o==="github"?"default":"outline",size:"sm",onClick:()=>d("github"),className:o==="github"?"bg-gray-800":"",children:[n.jsx(KM,{className:"w-4 h-4 mr-2"}),"GitHub"]}),n.jsxs(le,{variant:o==="npm"?"default":"outline",size:"sm",onClick:()=>d("npm"),className:o==="npm"?"bg-red-600":"",children:[n.jsx(Bi,{className:"w-4 h-4 mr-2"}),"npm"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:t,onChange:J=>r(J.target.value),onKeyDown:J=>J.key==="Enter"&&!["local","tools"].includes(o)&&ae(),placeholder:o==="local"?"Filter registry...":o==="tools"?"Filter discovered tools...":`Search ${o} for MCPs...`,className:"pl-9 bg-white border-gray-300"})]}),!["local","tools"].includes(o)&&n.jsx(le,{onClick:ae,disabled:f,children:f?n.jsx(ut,{className:"w-4 h-4 animate-spin"}):"Search"})]})]}),o==="local"&&n.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[W.map(([J,ie],ye)=>{var Oe;return n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ye*.03},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 hover:border-blue-300 hover:shadow-md transition-all group",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:J}),n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:n.jsx(EM,{className:"w-4 h-4 text-gray-400"})})}),n.jsxs(ks,{children:[n.jsxs(Pt,{onClick:()=>z(J,ie),children:[n.jsx(N1,{className:"w-4 h-4 mr-2"}),"Edit"]}),n.jsxs(Pt,{className:"text-red-600",onClick:()=>H(J),children:[n.jsx(jn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3",children:ie.description||"MCP server"}),n.jsxs("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate bg-gray-50 dark:bg-slate-800 px-2 py-1 rounded",children:[ie.command," ",(Oe=ie.args)==null?void 0:Oe.join(" ")]}),ie.env&&Object.keys(ie.env).length>0&&n.jsxs("div",{className:"mt-2 text-xs text-amber-600",children:["Requires: ",Object.keys(ie.env).join(", ")]})]},J)}),W.length===0&&n.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:t?"No MCPs match your search.":"Registry is empty. Add MCPs or search online."})]}),o==="tools"&&n.jsxs("div",{className:"p-4",children:[y&&n.jsxs("div",{className:"mb-4 text-sm text-gray-500 dark:text-slate-400 flex items-center gap-2",children:[n.jsx(wr,{className:"w-4 h-4"}),"Scanning: ",y]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[Y.map((J,ie)=>n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ie*.03},className:"bg-purple-50 rounded-lg border border-purple-200 p-4 hover:border-purple-400 hover:shadow-md transition-all",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-purple-900",children:J.name}),n.jsx(Qe,{variant:"outline",className:"text-purple-600 border-purple-300",children:J.type==="python"?"Python":"Node"})]}),n.jsx("p",{className:"text-sm text-purple-700 mb-3",children:J.description||"MCP tool"}),n.jsx("code",{className:"text-xs text-purple-600 block truncate bg-purple-100 px-2 py-1 rounded mb-3",children:J.path}),J.framework&&n.jsxs("div",{className:"text-xs text-purple-500 mb-3",children:["Framework: ",J.framework]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>B(J),className:"flex-1 border-purple-300 text-purple-700 hover:bg-purple-100",children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Quick"]}),n.jsxs(le,{size:"sm",onClick:()=>oe(J),className:"flex-1 bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(Qn,{className:"w-4 h-4 mr-1"}),"Smart"]})]})]},J.name)),Y.length===0&&b.length>0&&n.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:"All discovered tools are already in the registry."}),b.length===0&&n.jsxs("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:["No MCP tools found in ",y,". Create one using the Developer > Create MCP view."]})]})]}),!["local","tools"].includes(o)&&n.jsx("div",{className:"p-4",children:f?n.jsxs("div",{className:"text-center py-8",children:[n.jsx(ut,{className:"w-8 h-8 animate-spin mx-auto text-gray-400"}),n.jsxs("p",{className:"text-gray-500 dark:text-slate-400 mt-2",children:["Searching ",o,"..."]})]}):l.length>0?n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map((J,ie)=>{var ye;return n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ie*.03},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 hover:border-blue-300 hover:shadow-md transition-all",children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:J.name}),J.stars!==void 0&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600",children:[n.jsx(R5,{className:"w-3 h-3"}),J.stars]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:J.description||"No description"}),n.jsxs("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate bg-gray-50 dark:bg-slate-800 px-2 py-1 rounded mb-3",children:[J.suggestedCommand," ",(ye=J.suggestedArgs)==null?void 0:ye.join(" ")]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{size:"sm",onClick:()=>M(J),className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white",children:[n.jsx(yt,{className:"w-3 h-3 mr-1"}),"Add to Registry"]}),J.url&&n.jsx(le,{size:"sm",variant:"outline",onClick:()=>window.open(J.url,"_blank"),children:n.jsx(du,{className:"w-3 h-3"})})]})]},J.name||ie)})}):n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:t?"No results found. Try a different search term.":`Enter a search term to find MCPs on ${o}.`})})]}),n.jsx(Tt,{open:K.open,onOpenChange:J=>G({...K,open:J}),children:n.jsxs(St,{className:" max-w-2xl",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP to Registry"}),n.jsx(tr,{children:"Paste the MCP JSON configuration block to add to your registry."})]}),n.jsxs("div",{className:"py-4",children:[n.jsx(pt,{value:K.json,onChange:J=>G({...K,json:J.target.value}),placeholder:`{
|
|
603
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Zz=y2,P2=b2,A2=w2,T2=j2,R2=E2,M2=S2,D2=k2;const eH=Zz,L2=C.forwardRef(({className:e,...t},r)=>n.jsx(P2,{className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));L2.displayName=P2.displayName;const tH=C.forwardRef(({className:e,...t},r)=>n.jsxs(eH,{children:[n.jsx(L2,{}),n.jsx(A2,{ref:r,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));tH.displayName=A2.displayName;const rH=C.forwardRef(({className:e,...t},r)=>n.jsx(M2,{ref:r,className:je("text-lg font-semibold",e),...t}));rH.displayName=M2.displayName;const nH=C.forwardRef(({className:e,...t},r)=>n.jsx(D2,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));nH.displayName=D2.displayName;const sH=C.forwardRef(({className:e,...t},r)=>n.jsx(T2,{ref:r,className:je(Gp(),e),...t}));sH.displayName=T2.displayName;const iH=C.forwardRef(({className:e,...t},r)=>n.jsx(R2,{ref:r,className:je(Gp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));iH.displayName=R2.displayName;const oH=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},aH=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}},Dw={claude:{name:"Claude Code",command:"claude",color:"orange"},gemini:{name:"Gemini CLI",command:"gemini",color:"blue"}};function lH({registry:e,searchQuery:t,setSearchQuery:r,onUpdate:s}){var ne;const[o,u]=C.useState(()=>oH("registrySearchMode","local")),d=J=>{u(J),aH("registrySearchMode",J)},[l,c]=C.useState([]),[f,m]=C.useState(!1),[h,x]=C.useState({open:!1,name:"",mcp:null,isNew:!1}),[w,k]=C.useState({name:"",command:"npx",args:"",env:"",description:""}),[_,v]=C.useState(!1),[b,g]=C.useState([]),[y,j]=C.useState(""),[E,P]=C.useState({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),[T,N]=C.useState(""),[R,I]=C.useState("claude");C.useEffect(()=>{(async()=>{var ie;try{const ye=await ke.getConfig();I(((ie=ye.config)==null?void 0:ie.aiAssistant)||"claude")}catch(ye){console.error("Failed to load preferences:",ye)}})()},[]);const O=Dw[R]||Dw.claude,$=Object.entries(e.mcpServers||{}),W=$.filter(([J])=>J.toLowerCase().includes(t.toLowerCase()));C.useEffect(()=>{(async()=>{try{const ie=await ke.getMcpTools();g(ie.tools||[]),j(ie.dir||"")}catch(ie){console.error("Failed to load MCP tools:",ie)}})()},[]);const Y=b.filter(J=>{var ie;return!((ie=e.mcpServers)!=null&&ie[J.name])&&J.name.toLowerCase().includes(t.toLowerCase())}),z=(J,ie)=>{k({name:J,command:ie.command||"npx",args:JSON.stringify(ie.args||[],null,2),env:JSON.stringify(ie.env||{},null,2),description:ie.description||""}),x({open:!0,name:J,mcp:ie,isNew:!1})},[K,G]=C.useState({open:!1,json:""}),U=()=>{G({open:!0,json:""})},L=async()=>{if(!K.json.trim()){ee.error("Please paste the MCP JSON configuration");return}try{let J;try{J=JSON.parse(K.json)}catch{ee.error("Invalid JSON format");return}let ie={};if(J.mcpServers&&typeof J.mcpServers=="object")ie=J.mcpServers;else if(typeof J=="object"&&!Array.isArray(J)){if(Object.keys(J).includes("command")){ee.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}ie=J}if(Object.keys(ie).length===0){ee.error("No MCP configurations found in the JSON");return}for(const[Ve,te]of Object.entries(ie))if(!te.command){ee.error(`MCP "${Ve}" is missing required "command" field`);return}const ye={...e};ye.mcpServers||(ye.mcpServers={});for(const[Ve,te]of Object.entries(ie))ye.mcpServers[Ve]=te;await ke.updateRegistry(ye);const Oe=Object.keys(ie).length;ee.success(`Added ${Oe} MCP${Oe>1?"s":""} to registry!`),G({open:!1,json:""}),s()}catch(J){ee.error("Failed to add: "+J.message)}},M=J=>{const ye={[J.name.replace("@modelcontextprotocol/server-","").replace("mcp-server-","").replace("mcp-","").replace(/-/g,"_")]:{command:J.suggestedCommand||"npx",args:J.suggestedArgs||["-y",J.name],...J.description&&{description:J.description}}};G({open:!0,json:JSON.stringify(ye,null,2)})},B=J=>{let ie,ye;J.type==="python"?(ie="uv",ye=["run","--directory",J.path,"python",J.entryPoint||"mcp_server.py"]):(ie="node",ye=[J.path+"/index.js"]);const Oe={[J.name]:{command:ie,args:ye,...J.description&&{description:J.description}}};G({open:!0,json:JSON.stringify(Oe,null,2)})},q=()=>{if(!E.url.trim()){ee.error("Please enter a URL");return}P(J=>({...J,showTerminal:!0}))},F=()=>{if(E.localTool){const ye=E.localTool,Oe=`Analyze the MCP server at ${ye.path}. Read the README and source files to understand how to run it. Output a JSON config block with name, command, args array, and description for the MCP registry. Be specific about the exact command needed.`;return`cd '${ye.path}' && ${O.command} '${Oe}'`}const ie=`Clone ${E.url.trim()} into ~/reg/tools. Read the README, determine if Python or Node MCP server, and output a JSON config block with name, command, args, and description.`;return`cd ~/reg/tools && ${O.command} '${ie}'`},oe=J=>{P({open:!0,url:"",showTerminal:!0,localTool:J,pastedConfig:""})},fe=J=>{J===0&&(ee.success("Import completed! Paste the JSON config below to add it to the registry."),ke.getMcpTools().then(ie=>{g(ie.tools||[])}))},me=async()=>{if(!E.pastedConfig.trim()){ee.error("Please paste the JSON config first");return}try{let J;try{J=JSON.parse(E.pastedConfig)}catch{ee.error("Invalid JSON format");return}let ie={};if(J.mcpServers&&typeof J.mcpServers=="object")ie=J.mcpServers;else if(typeof J=="object"&&!Array.isArray(J))if(Object.keys(J).includes("command")){ee.error('JSON is missing the MCP name. Expected format: { "name": { "command": "...", "args": [...] } }');return}else ie=J;if(Object.keys(ie).length===0){ee.error("No MCP configurations found in the pasted JSON");return}for(const[Ve,te]of Object.entries(ie))if(!te.command){ee.error(`MCP "${Ve}" is missing required "command" field`);return}const ye={...e};ye.mcpServers||(ye.mcpServers={});for(const[Ve,te]of Object.entries(ie))ye.mcpServers[Ve]=te;await ke.updateRegistry(ye);const Oe=Object.keys(ie).length;ee.success(`Added ${Oe} MCP${Oe>1?"s":""} to registry!`),P({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),s()}catch(J){ee.error("Failed to add config: "+J.message)}},X=async()=>{v(!0);try{let J,ie;try{J=JSON.parse(w.args),ie=JSON.parse(w.env)}catch{ee.error("Invalid JSON in args or env"),v(!1);return}const ye={...e};ye.mcpServers||(ye.mcpServers={});const Oe={command:w.command,args:J,...Object.keys(ie).length>0&&{env:ie},...w.description&&{description:w.description}};ye.mcpServers[h.name]=Oe,await ke.updateRegistry(ye),ee.success("MCP updated"),x({open:!1,name:"",mcp:null,isNew:!1}),s()}catch(J){ee.error("Failed to save: "+J.message)}finally{v(!1)}},H=async J=>{try{const ie={...e};delete ie.mcpServers[J],await ke.updateRegistry(ie),ee.success(`Removed ${J} from registry`),s()}catch(ie){ee.error("Failed to delete: "+ie.message)}},ae=async()=>{if(t.trim()){m(!0);try{const J=o==="github"?await ke.searchGithub(t):await ke.searchNpm(t);c(J.results||[])}catch(J){ee.error("Search failed: "+J.message),c([])}finally{m(!1)}}};return C.useEffect(()=>{o!=="local"&&c([])},[o]),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white dark:text-white flex items-center gap-2",children:[n.jsx(ns,{className:"w-5 h-5 text-blue-600"}),"MCP Registry"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>P({open:!0,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"folder"}),className:"border-green-300 dark:border-green-700 text-green-700 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-950/30",children:[n.jsx(wr,{className:"w-4 h-4 mr-2"}),"Import Folder"]}),n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>P({open:!0,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),className:"border-purple-300 dark:border-purple-700 text-purple-700 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-950/30",children:[n.jsx(du,{className:"w-4 h-4 mr-2"}),"Import URL"]}),n.jsxs(le,{variant:"outline",size:"sm",onClick:U,className:"border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/30",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]}),n.jsxs("div",{className:"flex gap-2 mb-4",children:[n.jsxs(le,{variant:o==="local"?"default":"outline",size:"sm",onClick:()=>d("local"),className:o==="local"?"bg-blue-600":"",children:[n.jsx(ns,{className:"w-4 h-4 mr-2"}),"Registry (",$.length,")"]}),n.jsxs(le,{variant:o==="tools"?"default":"outline",size:"sm",onClick:()=>d("tools"),className:o==="tools"?"bg-purple-600":"",children:[n.jsx(wr,{className:"w-4 h-4 mr-2"}),"Tools (",b.length,")"]}),n.jsxs(le,{variant:o==="github"?"default":"outline",size:"sm",onClick:()=>d("github"),className:o==="github"?"bg-gray-800":"",children:[n.jsx(KM,{className:"w-4 h-4 mr-2"}),"GitHub"]}),n.jsxs(le,{variant:o==="npm"?"default":"outline",size:"sm",onClick:()=>d("npm"),className:o==="npm"?"bg-red-600":"",children:[n.jsx(Bi,{className:"w-4 h-4 mr-2"}),"npm"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:t,onChange:J=>r(J.target.value),onKeyDown:J=>J.key==="Enter"&&!["local","tools"].includes(o)&&ae(),placeholder:o==="local"?"Filter registry...":o==="tools"?"Filter discovered tools...":`Search ${o} for MCPs...`,className:"pl-9 bg-white border-gray-300"})]}),!["local","tools"].includes(o)&&n.jsx(le,{onClick:ae,disabled:f,children:f?n.jsx(ut,{className:"w-4 h-4 animate-spin"}):"Search"})]})]}),o==="local"&&n.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[W.map(([J,ie],ye)=>{var Oe;return n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ye*.03},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 hover:border-blue-300 hover:shadow-md transition-all group",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:J}),n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:n.jsx(EM,{className:"w-4 h-4 text-gray-400"})})}),n.jsxs(ks,{children:[n.jsxs(Pt,{onClick:()=>z(J,ie),children:[n.jsx(N1,{className:"w-4 h-4 mr-2"}),"Edit"]}),n.jsxs(Pt,{className:"text-red-600",onClick:()=>H(J),children:[n.jsx(jn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3",children:ie.description||"MCP server"}),n.jsxs("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate bg-gray-50 dark:bg-slate-800 px-2 py-1 rounded",children:[ie.command," ",(Oe=ie.args)==null?void 0:Oe.join(" ")]}),ie.env&&Object.keys(ie.env).length>0&&n.jsxs("div",{className:"mt-2 text-xs text-amber-600",children:["Requires: ",Object.keys(ie.env).join(", ")]})]},J)}),W.length===0&&n.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:t?"No MCPs match your search.":"Registry is empty. Add MCPs or search online."})]}),o==="tools"&&n.jsxs("div",{className:"p-4",children:[y&&n.jsxs("div",{className:"mb-4 text-sm text-gray-500 dark:text-slate-400 flex items-center gap-2",children:[n.jsx(wr,{className:"w-4 h-4"}),"Scanning: ",y]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[Y.map((J,ie)=>n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ie*.03},className:"bg-purple-50 rounded-lg border border-purple-200 p-4 hover:border-purple-400 hover:shadow-md transition-all",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-purple-900",children:J.name}),n.jsx(Qe,{variant:"outline",className:"text-purple-600 border-purple-300",children:J.type==="python"?"Python":"Node"})]}),n.jsx("p",{className:"text-sm text-purple-700 mb-3",children:J.description||"MCP tool"}),n.jsx("code",{className:"text-xs text-purple-600 block truncate bg-purple-100 px-2 py-1 rounded mb-3",children:J.path}),J.framework&&n.jsxs("div",{className:"text-xs text-purple-500 mb-3",children:["Framework: ",J.framework]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>B(J),className:"flex-1 border-purple-300 text-purple-700 hover:bg-purple-100",children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Quick"]}),n.jsxs(le,{size:"sm",onClick:()=>oe(J),className:"flex-1 bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(Qn,{className:"w-4 h-4 mr-1"}),"Smart"]})]})]},J.name)),Y.length===0&&b.length>0&&n.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:"All discovered tools are already in the registry."}),b.length===0&&n.jsxs("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:["No MCP tools found in ",y,". Create one using the Developer > Create MCP view."]})]})]}),!["local","tools"].includes(o)&&n.jsx("div",{className:"p-4",children:f?n.jsxs("div",{className:"text-center py-8",children:[n.jsx(ut,{className:"w-8 h-8 animate-spin mx-auto text-gray-400"}),n.jsxs("p",{className:"text-gray-500 dark:text-slate-400 mt-2",children:["Searching ",o,"..."]})]}):l.length>0?n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map((J,ie)=>{var ye;return n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:ie*.03},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 hover:border-blue-300 hover:shadow-md transition-all",children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:J.name}),J.stars!==void 0&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600",children:[n.jsx(R5,{className:"w-3 h-3"}),J.stars]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:J.description||"No description"}),n.jsxs("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate bg-gray-50 dark:bg-slate-800 px-2 py-1 rounded mb-3",children:[J.suggestedCommand," ",(ye=J.suggestedArgs)==null?void 0:ye.join(" ")]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{size:"sm",onClick:()=>M(J),className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white",children:[n.jsx(yt,{className:"w-3 h-3 mr-1"}),"Add to Registry"]}),J.url&&n.jsx(le,{size:"sm",variant:"outline",onClick:()=>window.open(J.url,"_blank"),children:n.jsx(du,{className:"w-3 h-3"})})]})]},J.name||ie)})}):n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:t?"No results found. Try a different search term.":`Enter a search term to find MCPs on ${o}.`})})]}),n.jsx(Tt,{open:K.open,onOpenChange:J=>G({...K,open:J}),children:n.jsxs(St,{className:" max-w-2xl",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP to Registry"}),n.jsx(tr,{children:"Paste the MCP JSON configuration block to add to your registry."})]}),n.jsxs("div",{className:"py-4",children:[n.jsx(pt,{value:K.json,onChange:J=>G({...K,json:J.target.value}),placeholder:`{
|
|
604
604
|
"my-mcp": {
|
|
605
605
|
"command": "npx",
|
|
606
606
|
"args": ["-y", "@example/mcp-server"],
|
|
@@ -615,7 +615,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
615
615
|
"args": ["-y", "@example/mcp-server"]
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
}`,className:"font-mono text-sm bg-white",rows:6})]}),n.jsxs("div",{className:"mt-4 flex justify-between",children:[n.jsx(le,{variant:"outline",onClick:()=>P({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:"Close"}),n.jsxs(le,{onClick:me,disabled:!E.pastedConfig.trim(),className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]})]})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"
|
|
618
|
+
}`,className:"font-mono text-sm bg-white",rows:6})]}),n.jsxs("div",{className:"mt-4 flex justify-between",children:[n.jsx(le,{variant:"outline",onClick:()=>P({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:"Close"}),n.jsxs(le,{onClick:me,disabled:!E.pastedConfig.trim(),className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]})]})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config list # List available MCPs (✓ = active)"}),n.jsx("p",{children:"coder-config add <mcp> [mcp...] # Add MCP(s) to project"}),n.jsx("p",{children:"coder-config remove <mcp> [mcp...] # Remove MCP(s) from project"}),n.jsx("p",{children:"coder-config registry # List MCPs in registry"}),n.jsx("p",{children:"coder-config registry add <name> '...' # Add MCP to registry"}),n.jsx("p",{children:"coder-config registry remove <name> # Remove from registry"})]})]})]})}function cH({project:e,onUpdate:t}){var O,$,W,Y;const[r,s]=C.useState(null),[o,u]=C.useState(!0),[d,l]=C.useState(null),[c,f]=C.useState(""),[m,h]=C.useState(!1),[x,w]=C.useState("global"),[k,_]=C.useState(""),[v,b]=C.useState([]),[g,y]=C.useState({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""});C.useEffect(()=>{j()},[]);const j=async()=>{try{u(!0);const z=await ke.getMemory();s(z)}catch{ee.error("Failed to load memory")}finally{u(!1)}};C.useEffect(()=>{d&&E(d.path)},[d]);const E=async z=>{try{const K=await ke.getMemoryFile(z);f(K.content||"")}catch{ee.error("Failed to load file")}},P=async()=>{if(d){h(!0);try{await ke.saveMemoryFile(d.path,c),ee.success("Saved!"),j()}catch{ee.error("Failed to save")}finally{h(!1)}}},T=async()=>{if(!k.trim()){b([]);return}try{const z=await ke.searchMemory(k);b(z.results||[])}catch{ee.error("Search failed")}},N=async()=>{let z="";const{type:K}=g;switch(K){case"preference":if(!g.name.trim()){ee.error("Name required");return}z=`**${g.name}**: ${g.description}`;break;case"correction":if(!g.wrong.trim()||!g.right.trim()){ee.error('Both "wrong" and "right" are required');return}z=`**Wrong**: ${g.wrong}
|
|
619
619
|
**Right**: ${g.right}`;break;case"fact":if(!g.category.trim()){ee.error("Category required");return}z=`**${g.category}**: ${g.details}`;break;case"pattern":if(!g.name.trim()){ee.error("Name required");return}z=`**${g.name}**
|
|
620
620
|
${g.description}`;break;case"decision":if(!g.title.trim()){ee.error("Title required");return}z=`**${g.title}**
|
|
621
621
|
|
|
@@ -625,16 +625,16 @@ ${g.description}`;break;case"decision":if(!g.title.trim()){ee.error("Title requi
|
|
|
625
625
|
|
|
626
626
|
**Rationale**: ${g.rationale}`;break;case"issue":if(!g.title.trim()){ee.error("Title required");return}z=`**${g.title}**
|
|
627
627
|
|
|
628
|
-
${g.description}`;break;case"history":case"context":default:if(!g.content.trim()){ee.error("Content required");return}z=g.content;break}try{const G=["pattern","decision","issue","history","context"].includes(K)?"project":"global";await ke.addMemoryEntry(K,z,G),ee.success(`Added ${K} entry`),y({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),j()}catch{ee.error("Failed to add entry")}},R=async()=>{try{await ke.initProjectMemory(e.dir),ee.success("Project memory initialized!"),j()}catch(z){ee.error(z.message||"Failed to initialize")}};if(o)return n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})});const I={global:[{id:"preference",label:"Preference",icon:kn,desc:"User preferences (tools, style, etc.)"},{id:"correction",label:"Correction",icon:Oi,desc:"Mistakes to avoid"},{id:"fact",label:"Fact",icon:Li,desc:"Facts about your environment"}],project:[{id:"context",label:"Context",icon:Cr,desc:"Project overview and conventions"},{id:"pattern",label:"Pattern",icon:qu,desc:"Code patterns in this project"},{id:"decision",label:"Decision",icon:Ju,desc:"Architecture decisions"},{id:"issue",label:"Issue",icon:Oi,desc:"Known issues and workarounds"},{id:"history",label:"History",icon:Mf,desc:"Session work log"}]};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Ii,{className:"w-5 h-5 text-purple-600"}),"Memory System"]}),n.jsx("div",{className:"flex gap-2",children:n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>y({open:!0,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Entry"]})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{placeholder:"Search memory...",value:k,onChange:z=>_(z.target.value),onKeyDown:z=>z.key==="Enter"&&T(),className:"flex-1"}),n.jsx(le,{variant:"outline",onClick:T,children:n.jsx(_l,{className:"w-4 h-4"})})]}),v.length>0&&n.jsxs("div",{className:"mt-4 p-3 bg-gray-50 dark:bg-slate-900 rounded-lg",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Search Results"}),n.jsx("div",{className:"space-y-2",children:v.map((z,K)=>n.jsxs("div",{className:"text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Qe,{variant:z.scope==="global"?"default":"secondary",children:z.scope}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:z.file})]}),z.matches.map((G,U)=>n.jsxs("div",{className:"ml-4 text-gray-600 dark:text-slate-400 text-xs mt-1",children:["Line ",G.line,": ",G.text]},U))]},K))})]})]}),n.jsx("div",{className:"flex gap-2 border-b border-gray-200 dark:border-slate-700 pb-2",children:["global","project","sync"].map(z=>n.jsxs("button",{onClick:()=>w(z),className:`px-4 py-2 text-sm font-medium rounded-t-lg transition-colors ${x===z?"bg-white dark:bg-slate-950 border border-b-white dark:border-b-slate-950 border-gray-200 dark:border-slate-700 -mb-[1px] text-indigo-600 dark:text-indigo-400":"text-gray-600 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white"}`,children:[z.charAt(0).toUpperCase()+z.slice(1)," Memory"]},z))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("h3",{className:"font-medium text-gray-900 dark:text-white",children:[x==="global"&&"Global Memory Files",x==="project"&&"Project Memory Files",x==="sync"&&"Sync State"]}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:[x==="global"&&"~/.claude/memory/",x==="project"&&`${e.dir}/.claude/memory/`,x==="sync"&&"~/.claude/sync/"]})]}),n.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[x==="global"&&((O=r==null?void 0:r.global)==null?void 0:O.files.map(z=>n.jsxs("button",{onClick:()=>z.exists&&l(z),className:`w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-slate-900 transition-colors ${(d==null?void 0:d.path)===z.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${z.exists?"":"opacity-50"}`,children:[n.jsx(Cr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:z.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:z.type})]}),z.exists?n.jsx(Kt,{className:"w-4 h-4 text-green-500"}):n.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},z.name))),x==="project"&&n.jsx(n.Fragment,{children:($=r==null?void 0:r.project)!=null&&$.initialized?(W=r==null?void 0:r.project)==null?void 0:W.files.map(z=>n.jsxs("button",{onClick:()=>z.exists&&l(z),className:`w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-slate-900 transition-colors ${(d==null?void 0:d.path)===z.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${z.exists?"":"opacity-50"}`,children:[n.jsx(Cr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:z.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:z.type})]}),z.exists?n.jsx(Kt,{className:"w-4 h-4 text-green-500"}):n.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},z.name)):n.jsxs("div",{className:"p-6 text-center",children:[n.jsx(Ii,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Project memory not initialized"}),n.jsxs(le,{onClick:R,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Initialize Project Memory"]})]})}),x==="sync"&&n.jsx("div",{className:"p-4",children:(Y=r==null?void 0:r.sync)!=null&&Y.state?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Current State"}),n.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-slate-900 p-3 rounded overflow-auto max-h-48 text-gray-800 dark:text-slate-300",children:JSON.stringify(r.sync.state,null,2)})]}),r.sync.history.length>0&&n.jsxs("div",{children:[n.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:["History (",r.sync.history.length,")"]}),n.jsx("div",{className:"space-y-1",children:r.sync.history.map((z,K)=>n.jsxs("div",{className:"text-xs text-gray-600 dark:text-slate-400 flex items-center gap-2",children:[n.jsx(Mf,{className:"w-3 h-3"}),z.name]},K))})]})]}):n.jsxs("div",{className:"text-center py-6",children:[n.jsx(Mf,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No sync state"}),n.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:"State is created by session hooks"})]})})]})]}),n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[n.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:d?d.name:"Select a file"}),d&&n.jsxs(le,{size:"sm",onClick:P,disabled:m,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[m?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]}),n.jsx("div",{className:"p-4",children:d?n.jsx(pt,{value:c,onChange:z=>f(z.target.value),className:"font-mono text-sm min-h-[400px]",placeholder:"File content..."}):n.jsx("div",{className:"flex items-center justify-center h-[400px] text-gray-400 dark:text-slate-500",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Cr,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})})})]})]}),n.jsx(Tt,{open:g.open,onOpenChange:z=>y({...g,open:z}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add Memory Entry"}),n.jsx(tr,{children:"Add a new entry to the appropriate memory file."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Entry Type"}),n.jsx("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[...I.global,...I.project].map(z=>{const K=z.icon,G=I.global.some(U=>U.id===z.id);return n.jsxs("button",{onClick:()=>y({...g,type:z.id}),className:`p-2 rounded-lg border text-left transition-colors ${g.type===z.id?"border-indigo-500 bg-indigo-50 dark:bg-indigo-950/30":"border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(K,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),n.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:z.label})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:G?"Global":"Project"})]},z.id)})})]}),g.type==="preference"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Name"}),n.jsx(ct,{value:g.name,onChange:z=>y({...g,name:z.target.value}),placeholder:"e.g., package-manager",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),n.jsx(ct,{value:g.description,onChange:z=>y({...g,description:z.target.value}),placeholder:"e.g., Always use pnpm instead of npm",className:"mt-1"})]})]}),g.type==="correction"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Wrong (what to avoid)"}),n.jsx(pt,{value:g.wrong,onChange:z=>y({...g,wrong:z.target.value}),placeholder:"e.g., Using npm install",className:"mt-1",rows:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Right (what to do instead)"}),n.jsx(pt,{value:g.right,onChange:z=>y({...g,right:z.target.value}),placeholder:"e.g., Use pnpm install",className:"mt-1",rows:2})]})]}),g.type==="fact"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Category"}),n.jsx(ct,{value:g.category,onChange:z=>y({...g,category:z.target.value}),placeholder:"e.g., shell, editor, system",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Details"}),n.jsx(pt,{value:g.details,onChange:z=>y({...g,details:z.target.value}),placeholder:"e.g., Using zsh with oh-my-zsh",className:"mt-1",rows:2})]})]}),g.type==="pattern"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Pattern Name"}),n.jsx(ct,{value:g.name,onChange:z=>y({...g,name:z.target.value}),placeholder:"e.g., API Response Format",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),n.jsx(pt,{value:g.description,onChange:z=>y({...g,description:z.target.value}),placeholder:"Describe the pattern and when to use it...",className:"mt-1",rows:3})]})]}),g.type==="decision"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Title"}),n.jsx(ct,{value:g.title,onChange:z=>y({...g,title:z.target.value}),placeholder:"e.g., Use React Query for data fetching",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Context"}),n.jsx(pt,{value:g.context,onChange:z=>y({...g,context:z.target.value}),placeholder:"What problem were we solving?",className:"mt-1",rows:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Decision"}),n.jsx(pt,{value:g.decision,onChange:z=>y({...g,decision:z.target.value}),placeholder:"What did we decide?",className:"mt-1",rows:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Rationale"}),n.jsx(pt,{value:g.rationale,onChange:z=>y({...g,rationale:z.target.value}),placeholder:"Why this choice over alternatives?",className:"mt-1",rows:2})]})]}),g.type==="issue"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Issue Title"}),n.jsx(ct,{value:g.title,onChange:z=>y({...g,title:z.target.value}),placeholder:"e.g., Memory leak in useEffect",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description / Workaround"}),n.jsx(pt,{value:g.description,onChange:z=>y({...g,description:z.target.value}),placeholder:"Describe the issue and any workarounds...",className:"mt-1",rows:3})]})]}),(g.type==="history"||g.type==="context")&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Content"}),n.jsx(pt,{value:g.content,onChange:z=>y({...g,content:z.target.value}),placeholder:g.type==="history"?"What work was done this session?":"Project context and overview...",className:"mt-1",rows:4})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>y({...g,open:!1}),children:"Cancel"}),n.jsxs(le,{onClick:N,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Entry"]})]})]})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"claude-config memory # Show memory status"}),n.jsx("p",{children:"claude-config memory init # Initialize project memory"}),n.jsx("p",{children:'claude-config memory add <type> "<content>" # Add entry'}),n.jsx("p",{children:"claude-config memory search <query> # Search all memory"}),n.jsx("p",{className:"text-gray-400 dark:text-slate-500 text-xs mt-2",children:"# Types: preference, correction, fact (global) | context, pattern, decision, issue, history (project)"})]})]})]})}function uH({onProjectSwitch:e}){const[t,r]=C.useState([]),[s,o]=C.useState(null),[u,d]=C.useState(!0),[l,c]=C.useState(null),[f,m]=C.useState(!1);C.useEffect(()=>{h()},[]);const h=async()=>{try{d(!0);const _=await ke.getProjects();r(_.projects||[]),o(_.activeProjectId)}catch{ee.error("Failed to load projects")}finally{d(!1)}},x=async _=>{c(_);try{const v=await ke.setActiveProject(_);v.success?(o(_),r(b=>b.map(g=>({...g,isActive:g.id===_}))),ee.success(`Switched to ${v.project.name}`),e==null||e(v)):ee.error(v.error||"Failed to switch project")}catch(v){ee.error("Failed to switch project: "+v.message)}finally{c(null)}},w=async _=>{if(confirm(`Remove "${_.name}" from the registry?
|
|
628
|
+
${g.description}`;break;case"history":case"context":default:if(!g.content.trim()){ee.error("Content required");return}z=g.content;break}try{const G=["pattern","decision","issue","history","context"].includes(K)?"project":"global";await ke.addMemoryEntry(K,z,G),ee.success(`Added ${K} entry`),y({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),j()}catch{ee.error("Failed to add entry")}},R=async()=>{try{await ke.initProjectMemory(e.dir),ee.success("Project memory initialized!"),j()}catch(z){ee.error(z.message||"Failed to initialize")}};if(o)return n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})});const I={global:[{id:"preference",label:"Preference",icon:kn,desc:"User preferences (tools, style, etc.)"},{id:"correction",label:"Correction",icon:Oi,desc:"Mistakes to avoid"},{id:"fact",label:"Fact",icon:Li,desc:"Facts about your environment"}],project:[{id:"context",label:"Context",icon:Cr,desc:"Project overview and conventions"},{id:"pattern",label:"Pattern",icon:qu,desc:"Code patterns in this project"},{id:"decision",label:"Decision",icon:Ju,desc:"Architecture decisions"},{id:"issue",label:"Issue",icon:Oi,desc:"Known issues and workarounds"},{id:"history",label:"History",icon:Mf,desc:"Session work log"}]};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Ii,{className:"w-5 h-5 text-purple-600"}),"Memory System"]}),n.jsx("div",{className:"flex gap-2",children:n.jsxs(le,{variant:"outline",size:"sm",onClick:()=>y({open:!0,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Entry"]})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{placeholder:"Search memory...",value:k,onChange:z=>_(z.target.value),onKeyDown:z=>z.key==="Enter"&&T(),className:"flex-1"}),n.jsx(le,{variant:"outline",onClick:T,children:n.jsx(_l,{className:"w-4 h-4"})})]}),v.length>0&&n.jsxs("div",{className:"mt-4 p-3 bg-gray-50 dark:bg-slate-900 rounded-lg",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Search Results"}),n.jsx("div",{className:"space-y-2",children:v.map((z,K)=>n.jsxs("div",{className:"text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Qe,{variant:z.scope==="global"?"default":"secondary",children:z.scope}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:z.file})]}),z.matches.map((G,U)=>n.jsxs("div",{className:"ml-4 text-gray-600 dark:text-slate-400 text-xs mt-1",children:["Line ",G.line,": ",G.text]},U))]},K))})]})]}),n.jsx("div",{className:"flex gap-2 border-b border-gray-200 dark:border-slate-700 pb-2",children:["global","project","sync"].map(z=>n.jsxs("button",{onClick:()=>w(z),className:`px-4 py-2 text-sm font-medium rounded-t-lg transition-colors ${x===z?"bg-white dark:bg-slate-950 border border-b-white dark:border-b-slate-950 border-gray-200 dark:border-slate-700 -mb-[1px] text-indigo-600 dark:text-indigo-400":"text-gray-600 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white"}`,children:[z.charAt(0).toUpperCase()+z.slice(1)," Memory"]},z))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("h3",{className:"font-medium text-gray-900 dark:text-white",children:[x==="global"&&"Global Memory Files",x==="project"&&"Project Memory Files",x==="sync"&&"Sync State"]}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:[x==="global"&&"~/.claude/memory/",x==="project"&&`${e.dir}/.claude/memory/`,x==="sync"&&"~/.claude/sync/"]})]}),n.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[x==="global"&&((O=r==null?void 0:r.global)==null?void 0:O.files.map(z=>n.jsxs("button",{onClick:()=>z.exists&&l(z),className:`w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-slate-900 transition-colors ${(d==null?void 0:d.path)===z.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${z.exists?"":"opacity-50"}`,children:[n.jsx(Cr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:z.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:z.type})]}),z.exists?n.jsx(Kt,{className:"w-4 h-4 text-green-500"}):n.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},z.name))),x==="project"&&n.jsx(n.Fragment,{children:($=r==null?void 0:r.project)!=null&&$.initialized?(W=r==null?void 0:r.project)==null?void 0:W.files.map(z=>n.jsxs("button",{onClick:()=>z.exists&&l(z),className:`w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-slate-900 transition-colors ${(d==null?void 0:d.path)===z.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${z.exists?"":"opacity-50"}`,children:[n.jsx(Cr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:z.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:z.type})]}),z.exists?n.jsx(Kt,{className:"w-4 h-4 text-green-500"}):n.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},z.name)):n.jsxs("div",{className:"p-6 text-center",children:[n.jsx(Ii,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Project memory not initialized"}),n.jsxs(le,{onClick:R,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Initialize Project Memory"]})]})}),x==="sync"&&n.jsx("div",{className:"p-4",children:(Y=r==null?void 0:r.sync)!=null&&Y.state?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Current State"}),n.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-slate-900 p-3 rounded overflow-auto max-h-48 text-gray-800 dark:text-slate-300",children:JSON.stringify(r.sync.state,null,2)})]}),r.sync.history.length>0&&n.jsxs("div",{children:[n.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:["History (",r.sync.history.length,")"]}),n.jsx("div",{className:"space-y-1",children:r.sync.history.map((z,K)=>n.jsxs("div",{className:"text-xs text-gray-600 dark:text-slate-400 flex items-center gap-2",children:[n.jsx(Mf,{className:"w-3 h-3"}),z.name]},K))})]})]}):n.jsxs("div",{className:"text-center py-6",children:[n.jsx(Mf,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No sync state"}),n.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:"State is created by session hooks"})]})})]})]}),n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[n.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:d?d.name:"Select a file"}),d&&n.jsxs(le,{size:"sm",onClick:P,disabled:m,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[m?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]}),n.jsx("div",{className:"p-4",children:d?n.jsx(pt,{value:c,onChange:z=>f(z.target.value),className:"font-mono text-sm min-h-[400px]",placeholder:"File content..."}):n.jsx("div",{className:"flex items-center justify-center h-[400px] text-gray-400 dark:text-slate-500",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Cr,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})})})]})]}),n.jsx(Tt,{open:g.open,onOpenChange:z=>y({...g,open:z}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add Memory Entry"}),n.jsx(tr,{children:"Add a new entry to the appropriate memory file."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Entry Type"}),n.jsx("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[...I.global,...I.project].map(z=>{const K=z.icon,G=I.global.some(U=>U.id===z.id);return n.jsxs("button",{onClick:()=>y({...g,type:z.id}),className:`p-2 rounded-lg border text-left transition-colors ${g.type===z.id?"border-indigo-500 bg-indigo-50 dark:bg-indigo-950/30":"border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(K,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),n.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:z.label})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:G?"Global":"Project"})]},z.id)})})]}),g.type==="preference"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Name"}),n.jsx(ct,{value:g.name,onChange:z=>y({...g,name:z.target.value}),placeholder:"e.g., package-manager",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),n.jsx(ct,{value:g.description,onChange:z=>y({...g,description:z.target.value}),placeholder:"e.g., Always use pnpm instead of npm",className:"mt-1"})]})]}),g.type==="correction"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Wrong (what to avoid)"}),n.jsx(pt,{value:g.wrong,onChange:z=>y({...g,wrong:z.target.value}),placeholder:"e.g., Using npm install",className:"mt-1",rows:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Right (what to do instead)"}),n.jsx(pt,{value:g.right,onChange:z=>y({...g,right:z.target.value}),placeholder:"e.g., Use pnpm install",className:"mt-1",rows:2})]})]}),g.type==="fact"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Category"}),n.jsx(ct,{value:g.category,onChange:z=>y({...g,category:z.target.value}),placeholder:"e.g., shell, editor, system",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Details"}),n.jsx(pt,{value:g.details,onChange:z=>y({...g,details:z.target.value}),placeholder:"e.g., Using zsh with oh-my-zsh",className:"mt-1",rows:2})]})]}),g.type==="pattern"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Pattern Name"}),n.jsx(ct,{value:g.name,onChange:z=>y({...g,name:z.target.value}),placeholder:"e.g., API Response Format",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),n.jsx(pt,{value:g.description,onChange:z=>y({...g,description:z.target.value}),placeholder:"Describe the pattern and when to use it...",className:"mt-1",rows:3})]})]}),g.type==="decision"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Title"}),n.jsx(ct,{value:g.title,onChange:z=>y({...g,title:z.target.value}),placeholder:"e.g., Use React Query for data fetching",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Context"}),n.jsx(pt,{value:g.context,onChange:z=>y({...g,context:z.target.value}),placeholder:"What problem were we solving?",className:"mt-1",rows:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Decision"}),n.jsx(pt,{value:g.decision,onChange:z=>y({...g,decision:z.target.value}),placeholder:"What did we decide?",className:"mt-1",rows:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Rationale"}),n.jsx(pt,{value:g.rationale,onChange:z=>y({...g,rationale:z.target.value}),placeholder:"Why this choice over alternatives?",className:"mt-1",rows:2})]})]}),g.type==="issue"&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Issue Title"}),n.jsx(ct,{value:g.title,onChange:z=>y({...g,title:z.target.value}),placeholder:"e.g., Memory leak in useEffect",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description / Workaround"}),n.jsx(pt,{value:g.description,onChange:z=>y({...g,description:z.target.value}),placeholder:"Describe the issue and any workarounds...",className:"mt-1",rows:3})]})]}),(g.type==="history"||g.type==="context")&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Content"}),n.jsx(pt,{value:g.content,onChange:z=>y({...g,content:z.target.value}),placeholder:g.type==="history"?"What work was done this session?":"Project context and overview...",className:"mt-1",rows:4})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>y({...g,open:!1}),children:"Cancel"}),n.jsxs(le,{onClick:N,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Entry"]})]})]})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config memory # Show memory status"}),n.jsx("p",{children:"coder-config memory init # Initialize project memory"}),n.jsx("p",{children:'coder-config memory add <type> "<content>" # Add entry'}),n.jsx("p",{children:"coder-config memory search <query> # Search all memory"}),n.jsx("p",{className:"text-gray-400 dark:text-slate-500 text-xs mt-2",children:"# Types: preference, correction, fact (global) | context, pattern, decision, issue, history (project)"})]})]})]})}function uH({onProjectSwitch:e}){const[t,r]=C.useState([]),[s,o]=C.useState(null),[u,d]=C.useState(!0),[l,c]=C.useState(null),[f,m]=C.useState(!1);C.useEffect(()=>{h()},[]);const h=async()=>{try{d(!0);const _=await ke.getProjects();r(_.projects||[]),o(_.activeProjectId)}catch{ee.error("Failed to load projects")}finally{d(!1)}},x=async _=>{c(_);try{const v=await ke.setActiveProject(_);v.success?(o(_),r(b=>b.map(g=>({...g,isActive:g.id===_}))),ee.success(`Switched to ${v.project.name}`),e==null||e(v)):ee.error(v.error||"Failed to switch project")}catch(v){ee.error("Failed to switch project: "+v.message)}finally{c(null)}},w=async _=>{if(confirm(`Remove "${_.name}" from the registry?
|
|
629
629
|
|
|
630
|
-
This won't delete any files.`))try{const v=await ke.removeProject(_.id);v.success?(r(b=>b.filter(g=>g.id!==_.id)),ee.success(`Removed project: ${_.name}`)):ee.error(v.error||"Failed to remove project")}catch(v){ee.error("Failed to remove project: "+v.message)}},k=_=>{r(v=>[...v,{..._,exists:!0,hasClaudeConfig:!1}])};return u?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-900/30 flex items-center justify-center",children:n.jsx(si,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Projects"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Registered projects for quick switching"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:"outline",onClick:h,size:"sm",children:[n.jsx(pr,{className:"w-4 h-4 mr-2"}),"Refresh"]}),n.jsxs(le,{onClick:()=>m(!0),className:"bg-indigo-600 hover:bg-indigo-700",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Project"]})]})]}),n.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-lg p-4 text-sm text-blue-700 dark:text-blue-400",children:n.jsx("p",{children:"Projects registered here can be quickly switched in the header dropdown. The UI will update to show the selected project's configuration."})}),n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm overflow-hidden",children:t.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(wr,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-slate-600"}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"No Projects Yet"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-4",children:"Add your first project to get started with quick switching."}),n.jsxs(le,{onClick:()=>m(!0),children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Your First Project"]})]}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:t.map(_=>n.jsxs("div",{className:`p-4 flex items-center gap-4 transition-colors ${_.isActive?"bg-indigo-50 dark:bg-indigo-950/30":"hover:bg-gray-50 dark:hover:bg-slate-900"}`,children:[n.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${_.isActive?"bg-indigo-100 dark:bg-indigo-900/50":_.exists?"bg-gray-100 dark:bg-slate-800":"bg-amber-100 dark:bg-amber-900/30"}`,children:_.isActive?n.jsx(Kt,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}):_.exists?n.jsx(wr,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"}):n.jsx(Xu,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:`font-medium truncate ${_.isActive?"text-indigo-700 dark:text-indigo-400":"text-gray-900 dark:text-white"}`,children:_.name}),_.hasClaudeConfig&&n.jsx("span",{className:"text-xs bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 px-1.5 py-0.5 rounded",children:".claude"}),_.isActive&&n.jsx("span",{className:"text-xs bg-indigo-100 dark:bg-indigo-900/50 text-indigo-700 dark:text-indigo-400 px-1.5 py-0.5 rounded",children:"Active"})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 font-mono truncate",children:_.path.replace(/^\/Users\/[^/]+/,"~")}),!_.exists&&n.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-1",children:"Path not found - the directory may have been moved or deleted"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!_.isActive&&_.exists&&n.jsx(le,{size:"sm",onClick:()=>x(_.id),disabled:l===_.id,children:l===_.id?n.jsx(ut,{className:"w-4 h-4 animate-spin"}):"Select"}),n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>w(_),className:"text-gray-500 dark:text-slate-400 hover:text-red-600 dark:hover:text-red-400",title:"Remove from registry",children:n.jsx(jn,{className:"w-4 h-4"})})]})]},_.id))})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"
|
|
630
|
+
This won't delete any files.`))try{const v=await ke.removeProject(_.id);v.success?(r(b=>b.filter(g=>g.id!==_.id)),ee.success(`Removed project: ${_.name}`)):ee.error(v.error||"Failed to remove project")}catch(v){ee.error("Failed to remove project: "+v.message)}},k=_=>{r(v=>[...v,{..._,exists:!0,hasClaudeConfig:!1}])};return u?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-900/30 flex items-center justify-center",children:n.jsx(si,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Projects"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Registered projects for quick switching"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:"outline",onClick:h,size:"sm",children:[n.jsx(pr,{className:"w-4 h-4 mr-2"}),"Refresh"]}),n.jsxs(le,{onClick:()=>m(!0),className:"bg-indigo-600 hover:bg-indigo-700",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Project"]})]})]}),n.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded-lg p-4 text-sm text-blue-700 dark:text-blue-400",children:n.jsx("p",{children:"Projects registered here can be quickly switched in the header dropdown. The UI will update to show the selected project's configuration."})}),n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm overflow-hidden",children:t.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(wr,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-slate-600"}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"No Projects Yet"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-4",children:"Add your first project to get started with quick switching."}),n.jsxs(le,{onClick:()=>m(!0),children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Your First Project"]})]}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:t.map(_=>n.jsxs("div",{className:`p-4 flex items-center gap-4 transition-colors ${_.isActive?"bg-indigo-50 dark:bg-indigo-950/30":"hover:bg-gray-50 dark:hover:bg-slate-900"}`,children:[n.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${_.isActive?"bg-indigo-100 dark:bg-indigo-900/50":_.exists?"bg-gray-100 dark:bg-slate-800":"bg-amber-100 dark:bg-amber-900/30"}`,children:_.isActive?n.jsx(Kt,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}):_.exists?n.jsx(wr,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"}):n.jsx(Xu,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:`font-medium truncate ${_.isActive?"text-indigo-700 dark:text-indigo-400":"text-gray-900 dark:text-white"}`,children:_.name}),_.hasClaudeConfig&&n.jsx("span",{className:"text-xs bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 px-1.5 py-0.5 rounded",children:".claude"}),_.isActive&&n.jsx("span",{className:"text-xs bg-indigo-100 dark:bg-indigo-900/50 text-indigo-700 dark:text-indigo-400 px-1.5 py-0.5 rounded",children:"Active"})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 font-mono truncate",children:_.path.replace(/^\/Users\/[^/]+/,"~")}),!_.exists&&n.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-1",children:"Path not found - the directory may have been moved or deleted"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!_.isActive&&_.exists&&n.jsx(le,{size:"sm",onClick:()=>x(_.id),disabled:l===_.id,children:l===_.id?n.jsx(ut,{className:"w-4 h-4 animate-spin"}):"Select"}),n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>w(_),className:"text-gray-500 dark:text-slate-400 hover:text-red-600 dark:hover:text-red-400",title:"Remove from registry",children:n.jsx(jn,{className:"w-4 h-4"})})]})]},_.id))})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config project add [path] # Add project"}),n.jsx("p",{children:"coder-config project remove <name> # Remove project"}),n.jsx("p",{children:"coder-config project # List projects"})]})]}),n.jsx(Mj,{open:f,onOpenChange:m,onAdded:k})]})}const dH=[{id:"getting-started",title:"Getting Started",icon:Li,subsections:[{id:"installation",title:"Installation"},{id:"quick-start",title:"Quick Start"},{id:"updating",title:"Updating"}]},{id:"projects",title:"Project Management",icon:Zs,subsections:[{id:"project-registry",title:"Project Registry"},{id:"project-switching",title:"Switching Projects"},{id:"project-structure",title:"Project Structure"}]},{id:"file-explorer",title:"Project Explorer",icon:wr,subsections:[{id:"claude-folders",title:".claude Folders"},{id:"rules",title:"Rules"},{id:"commands",title:"Commands"},{id:"workflows",title:"Workflows"},{id:"hierarchy",title:"Configuration Hierarchy"},{id:"subprojects",title:"Sub-Projects"}]},{id:"workstreams",title:"Workstreams",icon:Zs,isNew:!0,subsections:[{id:"workstreams-overview",title:"Overview"},{id:"creating-workstreams",title:"Creating Workstreams"},{id:"workstream-hooks",title:"Hook Integration"},{id:"activity-tracking",title:"Activity Tracking"}]},{id:"plugins",title:"Plugins",icon:ns,isNew:!0,subsections:[{id:"plugins-overview",title:"Overview"},{id:"installing-plugins",title:"Installing Plugins"},{id:"plugin-marketplaces",title:"Marketplaces"}]},{id:"mcp-registry",title:"MCP Registry",icon:ns,subsections:[{id:"mcp-overview",title:"Overview"},{id:"adding-mcps",title:"Adding MCPs"},{id:"configuring-mcps",title:"Configuring MCPs"},{id:"environment-vars",title:"Environment Variables"}]},{id:"memory",title:"Memory System",icon:Ii,subsections:[{id:"memory-overview",title:"Overview"},{id:"global-memory",title:"Global Memory"},{id:"project-memory",title:"Project Memory"},{id:"memory-entries",title:"Memory Entry Types"}]},{id:"claude-settings",title:"Claude Code Settings",icon:as,subsections:[{id:"permissions",title:"Permissions"},{id:"model-selection",title:"Model Selection"},{id:"behavior",title:"Behavior Settings"},{id:"hooks",title:"Hooks"}]},{id:"gemini-settings",title:"Gemini CLI Settings",icon:Ft,isNew:!0,subsections:[{id:"gemini-model",title:"Model Selection"},{id:"gemini-display",title:"Display Options"},{id:"gemini-general",title:"General Settings"},{id:"gemini-sandbox",title:"Sandbox Mode"}]},{id:"antigravity-settings",title:"Antigravity Settings",icon:wl,isNew:!0,subsections:[{id:"antigravity-security",title:"Security Policies"},{id:"antigravity-mcp",title:"MCP Servers"},{id:"antigravity-browser",title:"Browser Allowlist"},{id:"antigravity-agent",title:"Agent Mode"}]},{id:"cli",title:"CLI Reference",icon:Ft,subsections:[{id:"cli-overview",title:"Overview"},{id:"cli-commands",title:"All Commands"},{id:"daemon-mode",title:"Daemon Mode"}]},{id:"multi-tool",title:"Multi-Tool Support",icon:Ht,subsections:[{id:"supported-tools",title:"Supported Tools"},{id:"gemini-cli",title:"Gemini CLI"},{id:"antigravity",title:"Antigravity"},{id:"tool-differences",title:"Tool Differences"},{id:"enabling-tools",title:"Enabling Tools"},{id:"syncing-rules",title:"Syncing Rules"}]},{id:"keyboard",title:"Keyboard Shortcuts",icon:e5,subsections:[]},{id:"troubleshooting",title:"Troubleshooting",icon:Ku,subsections:[{id:"common-issues",title:"Common Issues"},{id:"getting-help",title:"Getting Help"}]}],hH={installation:{title:"Installation",content:`
|
|
631
631
|
## Installation
|
|
632
632
|
|
|
633
633
|
Choose your preferred installation method:
|
|
634
634
|
|
|
635
635
|
### Option A: Desktop App (Recommended)
|
|
636
636
|
|
|
637
|
-
Download the native app from [GitHub Releases](https://github.com/regression-io/
|
|
637
|
+
Download the native app from [GitHub Releases](https://github.com/regression-io/coder-config/releases):
|
|
638
638
|
|
|
639
639
|
| Platform | Download |
|
|
640
640
|
|----------|----------|
|
|
@@ -658,13 +658,13 @@ npm install -g coder-config
|
|
|
658
658
|
Verify installation:
|
|
659
659
|
|
|
660
660
|
\`\`\`bash
|
|
661
|
-
|
|
661
|
+
coder-config --version
|
|
662
662
|
\`\`\`
|
|
663
663
|
|
|
664
664
|
Then start the UI:
|
|
665
665
|
|
|
666
666
|
\`\`\`bash
|
|
667
|
-
|
|
667
|
+
coder-config ui
|
|
668
668
|
\`\`\`
|
|
669
669
|
`},"quick-start":{title:"Quick Start",content:`
|
|
670
670
|
## Quick Start
|
|
@@ -675,7 +675,7 @@ Claude Code works great out of the box. This tool helps you manage its configura
|
|
|
675
675
|
|
|
676
676
|
**Desktop App:** Double-click the app after installing from GitHub Releases.
|
|
677
677
|
|
|
678
|
-
**CLI:** Run \`
|
|
678
|
+
**CLI:** Run \`coder-config ui\` in your terminal.
|
|
679
679
|
|
|
680
680
|
### 2. Add Your Projects
|
|
681
681
|
|
|
@@ -707,7 +707,7 @@ Using the CLI version? The UI is a PWA - install it to your taskbar via Chrome/E
|
|
|
707
707
|
|
|
708
708
|
### Desktop App
|
|
709
709
|
|
|
710
|
-
Download the latest version from [GitHub Releases](https://github.com/regression-io/
|
|
710
|
+
Download the latest version from [GitHub Releases](https://github.com/regression-io/coder-config/releases) and install over your existing installation.
|
|
711
711
|
|
|
712
712
|
### npm Package
|
|
713
713
|
|
|
@@ -722,13 +722,13 @@ npm install -g coder-config@latest
|
|
|
722
722
|
**After updating (if using daemon mode):**
|
|
723
723
|
|
|
724
724
|
\`\`\`bash
|
|
725
|
-
|
|
726
|
-
|
|
725
|
+
coder-config ui stop
|
|
726
|
+
coder-config ui
|
|
727
727
|
\`\`\`
|
|
728
728
|
`}},fH={"project-registry":{title:"Project Registry",content:`
|
|
729
729
|
## Project Registry
|
|
730
730
|
|
|
731
|
-
The project registry keeps track of all your Claude-enabled projects. It's stored in \`~/.claude-config/projects.json
|
|
731
|
+
The project registry keeps track of all your Claude-enabled projects. It's stored in \`~/.coder-config/projects.json\` (or \`~/.claude-config/projects.json\` for legacy installs).
|
|
732
732
|
|
|
733
733
|
### Adding Projects
|
|
734
734
|
|
|
@@ -738,21 +738,21 @@ The project registry keeps track of all your Claude-enabled projects. It's store
|
|
|
738
738
|
|
|
739
739
|
**Via CLI:**
|
|
740
740
|
\`\`\`bash
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
coder-config project add /path/to/project
|
|
742
|
+
coder-config project add /path/to/project --name "My Project"
|
|
743
743
|
\`\`\`
|
|
744
744
|
|
|
745
745
|
### Listing Projects
|
|
746
746
|
|
|
747
747
|
\`\`\`bash
|
|
748
|
-
|
|
748
|
+
coder-config project
|
|
749
749
|
\`\`\`
|
|
750
750
|
|
|
751
751
|
### Removing Projects
|
|
752
752
|
|
|
753
753
|
\`\`\`bash
|
|
754
|
-
|
|
755
|
-
|
|
754
|
+
coder-config project remove "My Project"
|
|
755
|
+
coder-config project remove /path/to/project
|
|
756
756
|
\`\`\`
|
|
757
757
|
|
|
758
758
|
Note: Removing a project from the registry does not delete the project files.
|
|
@@ -776,7 +776,7 @@ The project dropdown in the header switches which project's **configuration** yo
|
|
|
776
776
|
|
|
777
777
|
\`\`\`bash
|
|
778
778
|
# Start UI for a specific project
|
|
779
|
-
|
|
779
|
+
coder-config ui /path/to/project
|
|
780
780
|
\`\`\`
|
|
781
781
|
|
|
782
782
|
The UI remembers your last active project between sessions.
|
|
@@ -807,7 +807,7 @@ your-project/
|
|
|
807
807
|
|
|
808
808
|
### Generated Files
|
|
809
809
|
|
|
810
|
-
The \`.mcp.json\` file in your project root is generated by running \`
|
|
810
|
+
The \`.mcp.json\` file in your project root is generated by running \`coder-config apply\`. Claude Code reads this file to configure MCPs.
|
|
811
811
|
`}},mH={"claude-folders":{title:".claude Folders",content:`
|
|
812
812
|
## .claude Folders
|
|
813
813
|
|
|
@@ -1051,32 +1051,32 @@ Each workstream has:
|
|
|
1051
1051
|
|
|
1052
1052
|
\`\`\`bash
|
|
1053
1053
|
# Create a workstream for your product
|
|
1054
|
-
|
|
1054
|
+
coder-config workstream create "Acme App"
|
|
1055
1055
|
|
|
1056
1056
|
# Add repos to it
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1057
|
+
coder-config workstream add "Acme App" ~/projects/acme-frontend
|
|
1058
|
+
coder-config workstream add "Acme App" ~/projects/acme-api
|
|
1059
|
+
coder-config workstream add "Acme App" ~/projects/acme-shared
|
|
1060
1060
|
|
|
1061
1061
|
# Activate it
|
|
1062
|
-
|
|
1062
|
+
coder-config workstream use "Acme App"
|
|
1063
1063
|
\`\`\`
|
|
1064
1064
|
|
|
1065
1065
|
### Managing Workstreams
|
|
1066
1066
|
|
|
1067
1067
|
**List all workstreams:**
|
|
1068
1068
|
\`\`\`bash
|
|
1069
|
-
|
|
1069
|
+
coder-config workstream
|
|
1070
1070
|
\`\`\`
|
|
1071
1071
|
|
|
1072
1072
|
**Show active workstream:**
|
|
1073
1073
|
\`\`\`bash
|
|
1074
|
-
|
|
1074
|
+
coder-config workstream active
|
|
1075
1075
|
\`\`\`
|
|
1076
1076
|
|
|
1077
1077
|
**Delete a workstream:**
|
|
1078
1078
|
\`\`\`bash
|
|
1079
|
-
|
|
1079
|
+
coder-config workstream delete "Acme App"
|
|
1080
1080
|
\`\`\`
|
|
1081
1081
|
|
|
1082
1082
|
### Editing Rules
|
|
@@ -1110,7 +1110,7 @@ Add to \`~/.claude/hooks/pre-prompt.sh\`:
|
|
|
1110
1110
|
|
|
1111
1111
|
\`\`\`bash
|
|
1112
1112
|
#!/bin/bash
|
|
1113
|
-
|
|
1113
|
+
coder-config workstream inject --silent
|
|
1114
1114
|
\`\`\`
|
|
1115
1115
|
|
|
1116
1116
|
Make it executable:
|
|
@@ -1129,10 +1129,10 @@ chmod +x ~/.claude/hooks/pre-prompt.sh
|
|
|
1129
1129
|
|
|
1130
1130
|
\`\`\`bash
|
|
1131
1131
|
# See what would be injected
|
|
1132
|
-
|
|
1132
|
+
coder-config workstream inject
|
|
1133
1133
|
|
|
1134
1134
|
# Silent mode (no output if no workstream)
|
|
1135
|
-
|
|
1135
|
+
coder-config workstream inject --silent
|
|
1136
1136
|
\`\`\`
|
|
1137
1137
|
|
|
1138
1138
|
### Auto-Detection
|
|
@@ -1140,7 +1140,7 @@ claude-config workstream inject --silent
|
|
|
1140
1140
|
Claude-config can also detect which workstream to use based on your current directory:
|
|
1141
1141
|
|
|
1142
1142
|
\`\`\`bash
|
|
1143
|
-
|
|
1143
|
+
coder-config workstream detect /path/to/project
|
|
1144
1144
|
\`\`\`
|
|
1145
1145
|
`},"activity-tracking":{title:"Activity Tracking",content:`
|
|
1146
1146
|
## Activity Tracking
|
|
@@ -1159,7 +1159,7 @@ Add to \`~/.claude/hooks/post-response.sh\`:
|
|
|
1159
1159
|
|
|
1160
1160
|
\`\`\`bash
|
|
1161
1161
|
#!/bin/bash
|
|
1162
|
-
source /path/to/
|
|
1162
|
+
source /path/to/coder-config/hooks/activity-track.sh
|
|
1163
1163
|
\`\`\`
|
|
1164
1164
|
|
|
1165
1165
|
Or use the one-click install in the Workstreams view.
|
|
@@ -1174,7 +1174,7 @@ In the **Workstreams** view, the Activity Insights panel shows:
|
|
|
1174
1174
|
|
|
1175
1175
|
### Workstream Suggestions
|
|
1176
1176
|
|
|
1177
|
-
Based on co-activity patterns,
|
|
1177
|
+
Based on co-activity patterns, coder-config suggests workstreams:
|
|
1178
1178
|
|
|
1179
1179
|
- **Co-activity score** - Percentage showing how often projects are worked on together
|
|
1180
1180
|
- **Create button** - Opens pre-filled dialog (tweak projects as needed)
|
|
@@ -1182,7 +1182,7 @@ Based on co-activity patterns, claude-config suggests workstreams:
|
|
|
1182
1182
|
|
|
1183
1183
|
### Privacy
|
|
1184
1184
|
|
|
1185
|
-
- Activity data is stored locally in \`~/.
|
|
1185
|
+
- Activity data is stored locally in \`~/.coder-config/activity.json\`
|
|
1186
1186
|
- Only file paths are logged (not file contents)
|
|
1187
1187
|
- You can delete the activity file at any time
|
|
1188
1188
|
- Activity tracking is read-only and never modifies your code
|
|
@@ -1389,7 +1389,7 @@ Both formats work:
|
|
|
1389
1389
|
### Via CLI
|
|
1390
1390
|
|
|
1391
1391
|
\`\`\`bash
|
|
1392
|
-
|
|
1392
|
+
coder-config add filesystem github postgres
|
|
1393
1393
|
\`\`\`
|
|
1394
1394
|
|
|
1395
1395
|
### From Search Results
|
|
@@ -1885,19 +1885,19 @@ Agent mode can make many changes quickly. Use with code review policy enabled.
|
|
|
1885
1885
|
`}},_H={"cli-overview":{title:"CLI Overview",content:`
|
|
1886
1886
|
## CLI Overview
|
|
1887
1887
|
|
|
1888
|
-
The \`
|
|
1888
|
+
The \`coder-config\` CLI provides command-line access to all features.
|
|
1889
1889
|
|
|
1890
1890
|
### Basic Usage
|
|
1891
1891
|
|
|
1892
1892
|
\`\`\`bash
|
|
1893
|
-
|
|
1893
|
+
coder-config [command] [options]
|
|
1894
1894
|
\`\`\`
|
|
1895
1895
|
|
|
1896
1896
|
### Getting Help
|
|
1897
1897
|
|
|
1898
1898
|
\`\`\`bash
|
|
1899
|
-
|
|
1900
|
-
|
|
1899
|
+
coder-config --help
|
|
1900
|
+
coder-config <command> --help
|
|
1901
1901
|
\`\`\`
|
|
1902
1902
|
|
|
1903
1903
|
### Global Options
|
|
@@ -1910,87 +1910,87 @@ claude-config <command> --help
|
|
|
1910
1910
|
### UI Commands
|
|
1911
1911
|
|
|
1912
1912
|
\`\`\`bash
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1913
|
+
coder-config ui # Start UI (daemon mode)
|
|
1914
|
+
coder-config ui --foreground # Run in foreground
|
|
1915
|
+
coder-config ui --port 8080 # Custom port
|
|
1916
|
+
coder-config ui status # Check daemon status
|
|
1917
|
+
coder-config ui stop # Stop daemon
|
|
1918
1918
|
\`\`\`
|
|
1919
1919
|
|
|
1920
1920
|
### Project Commands
|
|
1921
1921
|
|
|
1922
1922
|
\`\`\`bash
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1923
|
+
coder-config init # Initialize project
|
|
1924
|
+
coder-config init --template X # Initialize with template
|
|
1925
|
+
coder-config apply # Generate .mcp.json
|
|
1926
|
+
coder-config show # Show configuration
|
|
1927
1927
|
\`\`\`
|
|
1928
1928
|
|
|
1929
1929
|
### MCP Commands
|
|
1930
1930
|
|
|
1931
1931
|
\`\`\`bash
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1932
|
+
coder-config list # List available MCPs
|
|
1933
|
+
coder-config add <mcp> # Add MCP to project
|
|
1934
|
+
coder-config remove <mcp> # Remove MCP
|
|
1935
|
+
coder-config registry # List registry
|
|
1936
|
+
coder-config registry add <name> '{}' # Add to registry
|
|
1937
|
+
coder-config registry remove <name> # Remove from registry
|
|
1938
1938
|
\`\`\`
|
|
1939
1939
|
|
|
1940
1940
|
### Project Registry
|
|
1941
1941
|
|
|
1942
1942
|
\`\`\`bash
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1943
|
+
coder-config project # List projects
|
|
1944
|
+
coder-config project add # Add project
|
|
1945
|
+
coder-config project remove # Remove project
|
|
1946
1946
|
\`\`\`
|
|
1947
1947
|
|
|
1948
1948
|
### Memory Commands
|
|
1949
1949
|
|
|
1950
1950
|
\`\`\`bash
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1951
|
+
coder-config memory # Show memory status
|
|
1952
|
+
coder-config memory init # Initialize memory
|
|
1953
|
+
coder-config memory add # Add entry
|
|
1954
|
+
coder-config memory search # Search memory
|
|
1955
1955
|
\`\`\`
|
|
1956
1956
|
|
|
1957
1957
|
### Environment
|
|
1958
1958
|
|
|
1959
1959
|
\`\`\`bash
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1960
|
+
coder-config env # List variables
|
|
1961
|
+
coder-config env set KEY value # Set variable
|
|
1962
|
+
coder-config env unset KEY # Remove variable
|
|
1963
1963
|
\`\`\`
|
|
1964
1964
|
|
|
1965
1965
|
### Templates
|
|
1966
1966
|
|
|
1967
1967
|
\`\`\`bash
|
|
1968
|
-
|
|
1969
|
-
|
|
1968
|
+
coder-config templates # List templates
|
|
1969
|
+
coder-config apply-template X # Apply template
|
|
1970
1970
|
\`\`\`
|
|
1971
1971
|
|
|
1972
1972
|
### Workstreams
|
|
1973
1973
|
|
|
1974
1974
|
\`\`\`bash
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1975
|
+
coder-config workstream # List workstreams
|
|
1976
|
+
coder-config workstream create "X" # Create workstream
|
|
1977
|
+
coder-config workstream delete "X" # Delete workstream
|
|
1978
|
+
coder-config workstream use "X" # Set active
|
|
1979
|
+
coder-config workstream active # Show active
|
|
1980
|
+
coder-config workstream add "X" /path # Add project
|
|
1981
|
+
coder-config workstream remove "X" /path # Remove project
|
|
1982
|
+
coder-config workstream inject # Output rules for hooks
|
|
1983
|
+
coder-config workstream detect # Detect from directory
|
|
1984
1984
|
\`\`\`
|
|
1985
1985
|
`},"daemon-mode":{title:"Daemon Mode",content:`
|
|
1986
1986
|
## Daemon Mode
|
|
1987
1987
|
|
|
1988
|
-
By default, \`
|
|
1988
|
+
By default, \`coder-config ui\` runs as a background daemon.
|
|
1989
1989
|
|
|
1990
1990
|
### Starting the Daemon
|
|
1991
1991
|
|
|
1992
1992
|
\`\`\`bash
|
|
1993
|
-
|
|
1993
|
+
coder-config ui
|
|
1994
1994
|
\`\`\`
|
|
1995
1995
|
|
|
1996
1996
|
The UI starts in the background and you can continue using your terminal.
|
|
@@ -1998,13 +1998,13 @@ The UI starts in the background and you can continue using your terminal.
|
|
|
1998
1998
|
### Checking Status
|
|
1999
1999
|
|
|
2000
2000
|
\`\`\`bash
|
|
2001
|
-
|
|
2001
|
+
coder-config ui status
|
|
2002
2002
|
\`\`\`
|
|
2003
2003
|
|
|
2004
2004
|
### Stopping the Daemon
|
|
2005
2005
|
|
|
2006
2006
|
\`\`\`bash
|
|
2007
|
-
|
|
2007
|
+
coder-config ui stop
|
|
2008
2008
|
\`\`\`
|
|
2009
2009
|
|
|
2010
2010
|
### Foreground Mode
|
|
@@ -2012,18 +2012,18 @@ claude-config ui stop
|
|
|
2012
2012
|
To run in the foreground (blocking):
|
|
2013
2013
|
|
|
2014
2014
|
\`\`\`bash
|
|
2015
|
-
|
|
2015
|
+
coder-config ui --foreground
|
|
2016
2016
|
# or
|
|
2017
|
-
|
|
2017
|
+
coder-config ui -f
|
|
2018
2018
|
\`\`\`
|
|
2019
2019
|
|
|
2020
2020
|
### Logs
|
|
2021
2021
|
|
|
2022
|
-
Daemon logs are stored in \`~/.
|
|
2022
|
+
Daemon logs are stored in \`~/.coder-config/ui.log\`
|
|
2023
2023
|
`}},SH={"supported-tools":{title:"Supported Tools",content:`
|
|
2024
2024
|
## Supported AI Coding Tools
|
|
2025
2025
|
|
|
2026
|
-
|
|
2026
|
+
coder-config supports multiple AI coding assistants:
|
|
2027
2027
|
|
|
2028
2028
|
| Tool | Type | Config Location |
|
|
2029
2029
|
|------|------|-----------------|
|
|
@@ -2033,7 +2033,7 @@ claude-config supports multiple AI coding assistants:
|
|
|
2033
2033
|
|
|
2034
2034
|
### Shared MCP Registry
|
|
2035
2035
|
|
|
2036
|
-
All tools use the **MCP (Model Context Protocol)** for server configurations.
|
|
2036
|
+
All tools use the **MCP (Model Context Protocol)** for server configurations. coder-config maintains a shared registry and generates tool-specific output files.
|
|
2037
2037
|
|
|
2038
2038
|
### Enabling Tools
|
|
2039
2039
|
|
|
@@ -2116,7 +2116,7 @@ Antigravity MCP config is stored at \`~/.gemini/antigravity/mcp_config.json\`:
|
|
|
2116
2116
|
|
|
2117
2117
|
**Important**: Antigravity does NOT support \`\${VAR}\` interpolation.
|
|
2118
2118
|
|
|
2119
|
-
When generating Antigravity configs,
|
|
2119
|
+
When generating Antigravity configs, coder-config automatically resolves all environment variables to their actual values.
|
|
2120
2120
|
|
|
2121
2121
|
Example:
|
|
2122
2122
|
- Claude Code: \`"path": "\${HOME}/projects"\`
|
|
@@ -2192,7 +2192,7 @@ When you click **Apply Config**:
|
|
|
2192
2192
|
|
|
2193
2193
|
### Config File
|
|
2194
2194
|
|
|
2195
|
-
Tool preferences are stored in \`~/.
|
|
2195
|
+
Tool preferences are stored in \`~/.coder-config/config.json\`:
|
|
2196
2196
|
|
|
2197
2197
|
\`\`\`json
|
|
2198
2198
|
{
|
|
@@ -2267,12 +2267,12 @@ Rules can be synced in any direction between these three tools.
|
|
|
2267
2267
|
|
|
2268
2268
|
### UI won't start
|
|
2269
2269
|
|
|
2270
|
-
**Symptom**: \`
|
|
2270
|
+
**Symptom**: \`coder-config ui\` shows "Started daemon" but the UI doesn't open.
|
|
2271
2271
|
|
|
2272
2272
|
**Solution**:
|
|
2273
2273
|
\`\`\`bash
|
|
2274
|
-
|
|
2275
|
-
|
|
2274
|
+
coder-config ui stop
|
|
2275
|
+
coder-config ui --foreground
|
|
2276
2276
|
\`\`\`
|
|
2277
2277
|
|
|
2278
2278
|
Check for errors in the output.
|
|
@@ -2283,7 +2283,7 @@ Check for errors in the output.
|
|
|
2283
2283
|
|
|
2284
2284
|
**Solution**:
|
|
2285
2285
|
\`\`\`bash
|
|
2286
|
-
|
|
2286
|
+
coder-config ui --port 3334
|
|
2287
2287
|
\`\`\`
|
|
2288
2288
|
|
|
2289
2289
|
Or find and stop the process using port 3333.
|
|
@@ -2293,7 +2293,7 @@ Or find and stop the process using port 3333.
|
|
|
2293
2293
|
**Symptom**: MCPs show in config but aren't available in Claude Code.
|
|
2294
2294
|
|
|
2295
2295
|
**Solution**:
|
|
2296
|
-
1. Run \`
|
|
2296
|
+
1. Run \`coder-config apply\` to regenerate .mcp.json
|
|
2297
2297
|
2. Restart Claude Code
|
|
2298
2298
|
3. Check environment variables are set
|
|
2299
2299
|
|
|
@@ -2304,7 +2304,7 @@ Or find and stop the process using port 3333.
|
|
|
2304
2304
|
**Solution**:
|
|
2305
2305
|
\`\`\`bash
|
|
2306
2306
|
npm cache clean --force
|
|
2307
|
-
npm install -g
|
|
2307
|
+
npm install -g coder-config
|
|
2308
2308
|
\`\`\`
|
|
2309
2309
|
`},"getting-help":{title:"Getting Help",content:`
|
|
2310
2310
|
## Getting Help
|
|
@@ -2316,27 +2316,27 @@ This documentation is available in the app under **Docs & Help**.
|
|
|
2316
2316
|
### GitHub Issues
|
|
2317
2317
|
|
|
2318
2318
|
Report bugs and request features:
|
|
2319
|
-
https://github.com/regression-io/
|
|
2319
|
+
https://github.com/regression-io/coder-config/issues
|
|
2320
2320
|
|
|
2321
2321
|
### Version Info
|
|
2322
2322
|
|
|
2323
2323
|
\`\`\`bash
|
|
2324
|
-
|
|
2324
|
+
coder-config --version
|
|
2325
2325
|
\`\`\`
|
|
2326
2326
|
|
|
2327
2327
|
### Debug Info
|
|
2328
2328
|
|
|
2329
2329
|
When reporting issues, include:
|
|
2330
|
-
-
|
|
2330
|
+
- coder-config version
|
|
2331
2331
|
- Node.js version (\`node --version\`)
|
|
2332
2332
|
- Operating system
|
|
2333
2333
|
- Error messages or logs
|
|
2334
2334
|
`}},jH={...hH,...fH,...mH,...pH,...gH,...xH,...vH,...yH,...bH,...wH,..._H,...SH,...CH,...kH};function I2(e){let t=e.replace(/```(\w*)\n([\s\S]*?)```/g,(r,s,o)=>`<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-lg overflow-x-auto my-4"><code class="text-sm">${o.replace(/\\\`/g,"`").replace(/</g,"<").replace(/>/g,">").trim()}</code></pre>`);return t=t.replace(/(\|[^\n]+\|\n\|[-| :]+\|\n(?:\|[^\n]+\|\n?)+)/g,r=>{const s=r.trim().split(`
|
|
2335
|
-
`);if(s.length<2)return r;const o=s[0].split("|").filter(d=>d.trim()).map(d=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${d.trim()}</th>`).join(""),u=s.slice(2).map(d=>`<tr>${d.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${o}</tr></thead><tbody>${u}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" class="rounded-lg shadow-lg my-4 max-w-full border border-border" />').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}function NH(){const[e,t]=C.useState("installation"),[r,s]=C.useState({"getting-started":!0}),o=d=>{s(l=>({...l,[d]:!l[d]}))},u=jH[e];return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[n.jsx("div",{className:"p-4 border-b border-border",children:n.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[n.jsx(Li,{className:"w-5 h-5"}),"Documentation"]})}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:dH.map(d=>n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===d.id||d.subsections.some(l=>l.id===e))&&"bg-accent"),onClick:()=>{d.subsections.length>0?(o(d.id),r[d.id]||t(d.subsections[0].id)):t(d.id)},children:[n.jsx(d.icon,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"flex-1",children:d.title}),d.isNew&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"}),d.subsections.length>0&&n.jsx(Kr,{className:je("w-4 h-4 text-muted-foreground transition-transform",r[d.id]&&"rotate-90")})]}),d.subsections.length>0&&r[d.id]&&n.jsx("div",{className:"ml-6 mt-1 space-y-1",children:d.subsections.map(l=>n.jsx("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===l.id&&"bg-accent text-primary font-medium"),onClick:()=>t(l.id),children:l.title},l.id))})]},d.id))})})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Nn,{className:"h-full",children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:u?n.jsx("div",{className:"prose prose-sm max-w-none",children:n.jsx("div",{dangerouslySetInnerHTML:{__html:I2(u.content)}})}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(Li,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}var EH={};const Lw={development:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:border-blue-800",productivity:"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800",integration:"bg-purple-100 text-purple-700 border-purple-200 dark:bg-purple-900/30 dark:text-purple-400 dark:border-purple-800",external:"bg-orange-100 text-orange-700 border-orange-200 dark:bg-orange-900/30 dark:text-orange-400 dark:border-orange-800",lsp:"bg-cyan-100 text-cyan-700 border-cyan-200 dark:bg-cyan-900/30 dark:text-cyan-400 dark:border-cyan-800",default:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700"};function PH(){var ae,ne,J,ie,ye,Oe,Ve;const[e,t]=C.useState(!0),[r,s]=C.useState({allPlugins:[],categories:[],marketplaces:[],enabledPlugins:null}),[o,u]=C.useState(""),[d,l]=C.useState([]),[c,f]=C.useState([]),[m,h]=C.useState(!0),[x,w]=C.useState(!0),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState("name"),[j,E]=C.useState(null),[P,T]=C.useState({open:!1,repo:""}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,plugin:null}),[$,W]=C.useState(!1),Y=async()=>{t(!0);try{const re=await ke.getPlugins();s(re)}catch(re){ee.error("Failed to load plugins: "+re.message)}finally{t(!1)}};C.useEffect(()=>{Y()},[]);const z=C.useMemo(()=>{let re=r.allPlugins||[];if(o){const de=o.toLowerCase();re=re.filter(De=>{var Re,Ze,Se;return((Re=De.name)==null?void 0:Re.toLowerCase().includes(de))||((Ze=De.description)==null?void 0:Ze.toLowerCase().includes(de))||((Se=De.category)==null?void 0:Se.toLowerCase().includes(de))})}return re=re.filter(de=>!(de.sourceType==="external"&&!x||de.sourceType==="internal"&&!m)),re=re.filter(de=>!(de.installed&&!k||!de.installed&&!v)),d.length>0&&(re=re.filter(de=>d.includes(de.category))),c.length>0&&(re=re.filter(de=>c.includes(de.marketplace))),re.sort((de,De)=>{if(g==="installed"){if(de.installed&&!De.installed)return-1;if(!de.installed&&De.installed)return 1}if(g==="category"){const Re=(de.category||"zzz").localeCompare(De.category||"zzz");if(Re!==0)return Re}return de.name.localeCompare(De.name)}),re},[r.allPlugins,o,x,m,k,v,d,c,g]),K=re=>{l(de=>de.includes(re)?de.filter(De=>De!==re):[...de,re])},G=re=>{f(de=>de.includes(re)?de.filter(De=>De!==re):[...de,re])},U=async re=>{E(re);try{const de=await ke.refreshMarketplace(re);de.success?(ee.success(`Refreshed ${re}`),await Y()):ee.error(de.error||"Failed to refresh marketplace")}catch(de){ee.error("Failed to refresh: "+de.message)}finally{E(null)}},L=async()=>{if(!P.repo.trim()){ee.error("Please enter a repository URL");return}try{const re=await ke.addMarketplace("",P.repo.trim());re.success?(ee.success("Marketplace added"),T({open:!1,repo:""}),await Y()):ee.error(re.error||"Failed to add marketplace")}catch(re){ee.error("Failed to add marketplace: "+re.message)}},M=async(re,de,De)=>{W(!0);try{const Re=De!==!0,Ze=await ke.setPluginEnabled(re,de,Re);Ze.success?(ee.success(`Plugin ${Re?"enabled":"disabled"} for ${re===EH.HOME?"~":re}`),await Y()):ee.error(Ze.error||"Failed to update plugin state")}catch(Re){ee.error("Failed to update plugin: "+Re.message)}finally{W(!1)}},B=async(re,de)=>{W(!0);try{const De=await ke.setPluginEnabled(re,de,null);De.success?(ee.success("Plugin override removed"),await Y()):ee.error(De.error||"Failed to remove override")}catch(De){ee.error("Failed to update plugin: "+De.message)}finally{W(!1)}},q=re=>{O({open:!0,plugin:re})},F=(r.allPlugins||[]).filter(re=>re.installed).length,oe=(r.allPlugins||[]).filter(re=>!re.installed).length,fe=(r.allPlugins||[]).filter(re=>re.sourceType==="internal").length,me=(r.allPlugins||[]).filter(re=>re.sourceType==="external").length,X=r.marketplaces||[],H=r.categories||[];return e?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 flex items-start gap-3",children:[n.jsx(Yu,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm text-indigo-800 dark:text-indigo-300",children:[n.jsx("p",{className:"font-medium",children:"Install plugins from Project Explorer"}),n.jsxs("p",{className:"text-indigo-600 dark:text-indigo-400 mt-1",children:["Use the ",n.jsx("kbd",{className:"px-1.5 py-0.5 bg-indigo-100 dark:bg-indigo-900 rounded text-xs",children:"+"}),' menu on any project and select "Install Plugins" to add plugins with project-level scope control.']})]})]}),n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Fi,{className:"w-5 h-5 text-indigo-600"}),"Plugin Directory",n.jsxs(Qe,{variant:"outline",className:"ml-2 font-normal",children:[z.length," of ",((ae=r.allPlugins)==null?void 0:ae.length)||0]})]}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Y,disabled:e,children:n.jsx(pr,{className:`w-4 h-4 ${e?"animate-spin":""}`})})]}),n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:o,onChange:re=>u(re.target.value),placeholder:"Search plugins...",className:"pl-9 bg-white dark:bg-slate-900 border-gray-300 dark:border-slate-700"})]}),n.jsxs(fr,{value:g,onValueChange:y,children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{placeholder:"Sort by"})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"name",children:"Name"}),n.jsx(xt,{value:"installed",children:"Installed first"}),n.jsx(xt,{value:"category",children:"Category"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(Yc,{className:"w-3 h-3"}),"Marketplace",c.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:c.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-56",children:[n.jsx(ul,{className:"text-xs",children:"Filter by marketplace"}),n.jsx(Or,{}),X.length>0?X.map(re=>n.jsx(cl,{checked:c.includes(re.name),onCheckedChange:()=>G(re.name),children:re.name},re.name)):n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No marketplaces"}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:()=>R(!0),children:[n.jsx(kn,{className:"w-3 h-3 mr-2"}),"Manage Marketplaces"]}),c.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>f([]),children:"Clear filters"})]})]})]}),n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(S1,{className:"w-3 h-3"}),"Category",d.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:d.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-48",children:[n.jsx(ul,{className:"text-xs",children:"Filter by category"}),n.jsx(Or,{}),H.map(re=>n.jsx(cl,{checked:d.includes(re),onCheckedChange:()=>K(re),children:re},re)),d.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>l([]),children:"Clear filters"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-green-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Installed (",F,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Available (",oe,")"]})]}),n.jsx("span",{className:"text-gray-300 dark:text-slate-600",children:"|"}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:m,onCheckedChange:h,className:"h-4 w-7 data-[state=checked]:bg-indigo-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(y1,{className:"w-3 h-3"})," Anthropic (",fe,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:x,onCheckedChange:w,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(Bi,{className:"w-3 h-3"})," Community (",me,")"]})]})]})]})]}),n.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[z.map((re,de)=>{const De=Lw[re.category]||Lw.default,Re=re.mcpServers?Object.keys(re.mcpServers).length:0,Ze=re.lspServers?Object.keys(re.lspServers).length:0,Se=`${re.name}@${re.marketplace}`,ge=re.enabledState,Me=(ge==null?void 0:ge.merged)===!0;return(ge==null?void 0:ge.merged)!==null&&(ge==null||ge.merged),n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:Math.min(de*.02,.3)},className:`rounded-lg border p-4 transition-all hover:shadow-md ${Me?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/20 dark:border-emerald-800":re.installed?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:re.name}),re.sourceType==="external"&&n.jsx(Bi,{className:"w-3.5 h-3.5 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[re.installed&&n.jsxs(Qe,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700 text-[10px]",children:[n.jsx(Kt,{className:"w-2.5 h-2.5 mr-0.5"}),"Installed"]}),Me&&n.jsxs(Qe,{variant:"outline",className:"text-emerald-600 border-emerald-300 dark:text-emerald-400 dark:border-emerald-700 text-[10px]",children:[n.jsx(sb,{className:"w-2.5 h-2.5 mr-0.5"}),"Enabled"]})]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[re.installed&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>q(re),children:n.jsx(kn,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Configure per-directory"})})]})}),re.homepage&&n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>window.open(re.homepage,"_blank"),children:n.jsx(du,{className:"w-4 h-4"})})]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:re.description||"No description available"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[re.category&&n.jsx(Qe,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${De}`,children:re.category}),re.version&&n.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",re.version]})]}),(Re>0||Ze>0||re.commands)&&n.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-500 dark:text-slate-500 pt-2 border-t border-gray-100 dark:border-slate-800",children:[Ze>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-cyan-50 dark:bg-cyan-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(ns,{className:"w-3 h-3 text-cyan-600"}),Ze," LSP"]}),Re>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-50 dark:bg-blue-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Fn,{className:"w-3 h-3 text-blue-600"}),Re," MCP"]}),re.commands&&n.jsxs("span",{className:"flex items-center gap-1 bg-green-50 dark:bg-green-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Ft,{className:"w-3 h-3 text-green-600"}),"Commands"]})]})]},Se)}),z.length===0&&n.jsxs("div",{className:"col-span-full text-center py-12 text-gray-500 dark:text-slate-400",children:[n.jsx(Fi,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{className:"font-medium",children:"No plugins found"}),n.jsx("p",{className:"text-sm mt-1",children:"Try adjusting your filters or search query"}),(d.length>0||c.length>0||o)&&n.jsx(le,{variant:"link",size:"sm",onClick:()=>{l([]),f([]),u("")},className:"mt-2",children:"Clear all filters"})]})]})]}),n.jsx(Tt,{open:P.open,onOpenChange:re=>T({...P,open:re}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Add Plugin Marketplace"]}),n.jsx(tr,{children:"Add a marketplace from a GitHub repository URL or local path."})]}),n.jsx("div",{className:"space-y-4 py-4",children:n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL or Path"}),n.jsx(ct,{value:P.repo,onChange:re=>T({...P,repo:re.target.value}),placeholder:"owner/repo or full GitHub URL",className:"mt-1"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:"Supported formats:"}),n.jsxs("ul",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"owner/repo"})," — GitHub shorthand"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"https://github.com/owner/repo"})," — Full URL"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"/local/path"})," — Local directory"]})]}),n.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-2",children:["Search GitHub for ",n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"claude-plugins"})," to find community marketplaces."]})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>T({open:!1,repo:""}),children:"Cancel"}),n.jsxs(le,{onClick:L,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:N,onOpenChange:R,children:n.jsxs(St,{className:"max-w-2xl",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Plugin Marketplaces",n.jsx(Qe,{variant:"outline",className:"ml-2 font-normal",children:X.length})]}),n.jsx(tr,{children:"Manage your plugin marketplaces. Add external marketplaces to discover more plugins."})]}),n.jsx("div",{className:"py-4",children:X.length>0?n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:X.map(re=>{var De,Re,Ze;const de=(((De=re.plugins)==null?void 0:De.length)||0)+(((Re=re.externalPlugins)==null?void 0:Re.length)||0);return n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/20 rounded-lg border border-purple-200 dark:border-purple-800 p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-200",children:re.name}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>U(re.name),disabled:j===re.name,className:"h-7 w-7 p-0",children:n.jsx(pr,{className:`w-4 h-4 text-purple-600 dark:text-purple-400 ${j===re.name?"animate-spin":""}`})})]}),n.jsx("p",{className:"text-sm text-purple-700 dark:text-purple-300 mb-2 truncate",children:typeof re.source=="string"?re.source:((Ze=re.source)==null?void 0:Ze.repo)||"Unknown source"}),n.jsxs("div",{className:"flex items-center justify-between text-xs text-purple-600 dark:text-purple-400",children:[n.jsxs("span",{children:[de," plugins"]}),re.lastUpdated&&n.jsxs("span",{children:["Updated: ",new Date(re.lastUpdated).toLocaleDateString()]})]})]},re.name)})}):n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(Yc,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No marketplaces configured."}),n.jsx("p",{className:"text-sm mt-1",children:"Add a marketplace to discover plugins."})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>R(!1),children:"Close"}),n.jsxs(le,{onClick:()=>{R(!1),T({open:!0,repo:""})},className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:I.open,onOpenChange:re=>O({...I,open:re}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(tb,{className:"w-5 h-5 text-emerald-600"}),"Configure Plugin: ",(ne=I.plugin)==null?void 0:ne.name]}),n.jsx(tr,{children:"Enable or disable this plugin for specific directories. Child directories inherit parent settings unless overridden."})]}),n.jsxs("div",{className:"space-y-3 py-4 max-h-[400px] overflow-y-auto",children:[(ye=(ie=(J=I.plugin)==null?void 0:J.enabledState)==null?void 0:ie.perDir)==null?void 0:ye.map((re,de)=>{const De=`${I.plugin.name}@${I.plugin.marketplace}`,Re=re.enabled!==null&&re.enabled!==void 0,Ze=re.enabled===!0,Se=re.enabled===!1;let ge=null;if(!Re&&de>0)for(let Me=de-1;Me>=0;Me--){const ht=I.plugin.enabledState.perDir[Me];if(ht.enabled!==null&&ht.enabled!==void 0){ge=ht.enabled;break}}return n.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${Ze?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/30 dark:border-emerald-800":Se?"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800":"bg-gray-50 border-gray-200 dark:bg-slate-800/50 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:re.label}),!Re&&ge!==null&&n.jsxs(Qe,{variant:"outline",className:"text-[10px] text-gray-500",children:["inherited: ",ge?"on":"off"]})]}),Re&&n.jsx("p",{className:"text-[10px] text-gray-500 dark:text-slate-400 mt-0.5",children:Ze?"Explicitly enabled":"Explicitly disabled"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[Re&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600",onClick:()=>B(re.dir,De),disabled:$,children:n.jsx(s5,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Remove override (inherit from parent)"})})]})}),n.jsxs("div",{className:"flex items-center gap-1 border rounded-lg overflow-hidden",children:[n.jsx(le,{variant:Ze?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Ze?"bg-emerald-600 hover:bg-emerald-700 text-white":""}`,onClick:()=>M(re.dir,De,!1),disabled:$||Ze,children:n.jsx(sb,{className:"w-3 h-3"})}),n.jsx(le,{variant:Se?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Se?"bg-red-600 hover:bg-red-700 text-white":""}`,onClick:()=>M(re.dir,De,!0),disabled:$||Se,children:n.jsx(y5,{className:"w-3 h-3"})})]})]})]},re.dir)}),(!((Ve=(Oe=I.plugin)==null?void 0:Oe.enabledState)!=null&&Ve.perDir)||I.plugin.enabledState.perDir.length===0)&&n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(tb,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No config hierarchy found."}),n.jsx("p",{className:"text-sm mt-1",children:"Create a .claude/mcps.json in your project first."})]})]}),n.jsx(It,{children:n.jsx(le,{variant:"ghost",onClick:()=>O({open:!1,plugin:null}),children:"Done"})})]})})]})}function AH({projects:e=[],onWorkstreamChange:t}){var Ke,bt;const[r,s]=C.useState([]),[o,u]=C.useState(!0),[d,l]=C.useState(null),[c,f]=C.useState(!1),[m,h]=C.useState(null),[x,w]=C.useState(!1),[k,_]=C.useState(null),[v,b]=C.useState(new Set),[g,y]=C.useState(""),[j,E]=C.useState(""),[P,T]=C.useState([]),[N,R]=C.useState(!1),[I,O]=C.useState(!1),[$,W]=C.useState({}),[Y,z]=C.useState({}),[K,G]=C.useState({}),[U,L]=C.useState({isInstalled:!1,loading:!0}),[M,B]=C.useState(!1),[q,F]=C.useState(null),[oe,fe]=C.useState([]),[me,X]=C.useState(!1),[H,ae]=C.useState(()=>{try{return JSON.parse(localStorage.getItem("dismissedWorkstreamSuggestions")||"[]")}catch{return[]}});C.useEffect(()=>{Ze(),ne(),J()},[]);const ne=async()=>{try{const Z=await ke.getWorkstreamHookStatus();L({...Z,loading:!1})}catch(Z){L({isInstalled:!1,loading:!1,error:Z.message})}},J=async()=>{try{X(!0);const[Z,Pe]=await Promise.all([ke.getActivitySummary(),ke.getWorkstreamSuggestions()]);F(Z),fe(Pe.suggestions||[])}catch(Z){console.log("Activity data not available:",Z.message)}finally{X(!1)}},ie=Z=>{y(Z.name),T([...Z.projects]),E(`# Auto-generated workstream based on activity patterns
|
|
2335
|
+
`);if(s.length<2)return r;const o=s[0].split("|").filter(d=>d.trim()).map(d=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${d.trim()}</th>`).join(""),u=s.slice(2).map(d=>`<tr>${d.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${o}</tr></thead><tbody>${u}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" class="rounded-lg shadow-lg my-4 max-w-full border border-border" />').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}function NH(){const[e,t]=C.useState("installation"),[r,s]=C.useState({"getting-started":!0}),o=d=>{s(l=>({...l,[d]:!l[d]}))},u=jH[e];return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[n.jsx("div",{className:"p-4 border-b border-border",children:n.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[n.jsx(Li,{className:"w-5 h-5"}),"Documentation"]})}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:dH.map(d=>n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===d.id||d.subsections.some(l=>l.id===e))&&"bg-accent"),onClick:()=>{d.subsections.length>0?(o(d.id),r[d.id]||t(d.subsections[0].id)):t(d.id)},children:[n.jsx(d.icon,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"flex-1",children:d.title}),d.isNew&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"}),d.subsections.length>0&&n.jsx(Kr,{className:je("w-4 h-4 text-muted-foreground transition-transform",r[d.id]&&"rotate-90")})]}),d.subsections.length>0&&r[d.id]&&n.jsx("div",{className:"ml-6 mt-1 space-y-1",children:d.subsections.map(l=>n.jsx("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===l.id&&"bg-accent text-primary font-medium"),onClick:()=>t(l.id),children:l.title},l.id))})]},d.id))})})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Nn,{className:"h-full",children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:u?n.jsx("div",{className:"prose prose-sm max-w-none",children:n.jsx("div",{dangerouslySetInnerHTML:{__html:I2(u.content)}})}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(Li,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}var EH={};const Lw={development:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:border-blue-800",productivity:"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800",integration:"bg-purple-100 text-purple-700 border-purple-200 dark:bg-purple-900/30 dark:text-purple-400 dark:border-purple-800",external:"bg-orange-100 text-orange-700 border-orange-200 dark:bg-orange-900/30 dark:text-orange-400 dark:border-orange-800",lsp:"bg-cyan-100 text-cyan-700 border-cyan-200 dark:bg-cyan-900/30 dark:text-cyan-400 dark:border-cyan-800",default:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700"};function PH(){var ae,ne,J,ie,ye,Oe,Ve;const[e,t]=C.useState(!0),[r,s]=C.useState({allPlugins:[],categories:[],marketplaces:[],enabledPlugins:null}),[o,u]=C.useState(""),[d,l]=C.useState([]),[c,f]=C.useState([]),[m,h]=C.useState(!0),[x,w]=C.useState(!0),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState("name"),[j,E]=C.useState(null),[P,T]=C.useState({open:!1,repo:""}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,plugin:null}),[$,W]=C.useState(!1),Y=async()=>{t(!0);try{const te=await ke.getPlugins();s(te)}catch(te){ee.error("Failed to load plugins: "+te.message)}finally{t(!1)}};C.useEffect(()=>{Y()},[]);const z=C.useMemo(()=>{let te=r.allPlugins||[];if(o){const de=o.toLowerCase();te=te.filter(De=>{var Re,Ze,Se;return((Re=De.name)==null?void 0:Re.toLowerCase().includes(de))||((Ze=De.description)==null?void 0:Ze.toLowerCase().includes(de))||((Se=De.category)==null?void 0:Se.toLowerCase().includes(de))})}return te=te.filter(de=>!(de.sourceType==="external"&&!x||de.sourceType==="internal"&&!m)),te=te.filter(de=>!(de.installed&&!k||!de.installed&&!v)),d.length>0&&(te=te.filter(de=>d.includes(de.category))),c.length>0&&(te=te.filter(de=>c.includes(de.marketplace))),te.sort((de,De)=>{if(g==="installed"){if(de.installed&&!De.installed)return-1;if(!de.installed&&De.installed)return 1}if(g==="category"){const Re=(de.category||"zzz").localeCompare(De.category||"zzz");if(Re!==0)return Re}return de.name.localeCompare(De.name)}),te},[r.allPlugins,o,x,m,k,v,d,c,g]),K=te=>{l(de=>de.includes(te)?de.filter(De=>De!==te):[...de,te])},G=te=>{f(de=>de.includes(te)?de.filter(De=>De!==te):[...de,te])},U=async te=>{E(te);try{const de=await ke.refreshMarketplace(te);de.success?(ee.success(`Refreshed ${te}`),await Y()):ee.error(de.error||"Failed to refresh marketplace")}catch(de){ee.error("Failed to refresh: "+de.message)}finally{E(null)}},L=async()=>{if(!P.repo.trim()){ee.error("Please enter a repository URL");return}try{const te=await ke.addMarketplace("",P.repo.trim());te.success?(ee.success("Marketplace added"),T({open:!1,repo:""}),await Y()):ee.error(te.error||"Failed to add marketplace")}catch(te){ee.error("Failed to add marketplace: "+te.message)}},M=async(te,de,De)=>{W(!0);try{const Re=De!==!0,Ze=await ke.setPluginEnabled(te,de,Re);Ze.success?(ee.success(`Plugin ${Re?"enabled":"disabled"} for ${te===EH.HOME?"~":te}`),await Y()):ee.error(Ze.error||"Failed to update plugin state")}catch(Re){ee.error("Failed to update plugin: "+Re.message)}finally{W(!1)}},B=async(te,de)=>{W(!0);try{const De=await ke.setPluginEnabled(te,de,null);De.success?(ee.success("Plugin override removed"),await Y()):ee.error(De.error||"Failed to remove override")}catch(De){ee.error("Failed to update plugin: "+De.message)}finally{W(!1)}},q=te=>{O({open:!0,plugin:te})},F=(r.allPlugins||[]).filter(te=>te.installed).length,oe=(r.allPlugins||[]).filter(te=>!te.installed).length,fe=(r.allPlugins||[]).filter(te=>te.sourceType==="internal").length,me=(r.allPlugins||[]).filter(te=>te.sourceType==="external").length,X=r.marketplaces||[],H=r.categories||[];return e?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 flex items-start gap-3",children:[n.jsx(Yu,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm text-indigo-800 dark:text-indigo-300",children:[n.jsx("p",{className:"font-medium",children:"Install plugins from Project Explorer"}),n.jsxs("p",{className:"text-indigo-600 dark:text-indigo-400 mt-1",children:["Use the ",n.jsx("kbd",{className:"px-1.5 py-0.5 bg-indigo-100 dark:bg-indigo-900 rounded text-xs",children:"+"}),' menu on any project and select "Install Plugins" to add plugins with project-level scope control.']})]})]}),n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Fi,{className:"w-5 h-5 text-indigo-600"}),"Plugin Directory",n.jsxs(Qe,{variant:"outline",className:"ml-2 font-normal",children:[z.length," of ",((ae=r.allPlugins)==null?void 0:ae.length)||0]})]}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Y,disabled:e,children:n.jsx(pr,{className:`w-4 h-4 ${e?"animate-spin":""}`})})]}),n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:o,onChange:te=>u(te.target.value),placeholder:"Search plugins...",className:"pl-9 bg-white dark:bg-slate-900 border-gray-300 dark:border-slate-700"})]}),n.jsxs(fr,{value:g,onValueChange:y,children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{placeholder:"Sort by"})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"name",children:"Name"}),n.jsx(xt,{value:"installed",children:"Installed first"}),n.jsx(xt,{value:"category",children:"Category"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(Yc,{className:"w-3 h-3"}),"Marketplace",c.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:c.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-56",children:[n.jsx(ul,{className:"text-xs",children:"Filter by marketplace"}),n.jsx(Or,{}),X.length>0?X.map(te=>n.jsx(cl,{checked:c.includes(te.name),onCheckedChange:()=>G(te.name),children:te.name},te.name)):n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No marketplaces"}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:()=>R(!0),children:[n.jsx(kn,{className:"w-3 h-3 mr-2"}),"Manage Marketplaces"]}),c.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>f([]),children:"Clear filters"})]})]})]}),n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(S1,{className:"w-3 h-3"}),"Category",d.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:d.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-48",children:[n.jsx(ul,{className:"text-xs",children:"Filter by category"}),n.jsx(Or,{}),H.map(te=>n.jsx(cl,{checked:d.includes(te),onCheckedChange:()=>K(te),children:te},te)),d.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>l([]),children:"Clear filters"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-green-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Installed (",F,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Available (",oe,")"]})]}),n.jsx("span",{className:"text-gray-300 dark:text-slate-600",children:"|"}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:m,onCheckedChange:h,className:"h-4 w-7 data-[state=checked]:bg-indigo-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(y1,{className:"w-3 h-3"})," Anthropic (",fe,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:x,onCheckedChange:w,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(Bi,{className:"w-3 h-3"})," Community (",me,")"]})]})]})]})]}),n.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[z.map((te,de)=>{const De=Lw[te.category]||Lw.default,Re=te.mcpServers?Object.keys(te.mcpServers).length:0,Ze=te.lspServers?Object.keys(te.lspServers).length:0,Se=`${te.name}@${te.marketplace}`,ge=te.enabledState,Me=(ge==null?void 0:ge.merged)===!0;return(ge==null?void 0:ge.merged)!==null&&(ge==null||ge.merged),n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:Math.min(de*.02,.3)},className:`rounded-lg border p-4 transition-all hover:shadow-md ${Me?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/20 dark:border-emerald-800":te.installed?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:te.name}),te.sourceType==="external"&&n.jsx(Bi,{className:"w-3.5 h-3.5 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[te.installed&&n.jsxs(Qe,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700 text-[10px]",children:[n.jsx(Kt,{className:"w-2.5 h-2.5 mr-0.5"}),"Installed"]}),Me&&n.jsxs(Qe,{variant:"outline",className:"text-emerald-600 border-emerald-300 dark:text-emerald-400 dark:border-emerald-700 text-[10px]",children:[n.jsx(sb,{className:"w-2.5 h-2.5 mr-0.5"}),"Enabled"]})]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[te.installed&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>q(te),children:n.jsx(kn,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Configure per-directory"})})]})}),te.homepage&&n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>window.open(te.homepage,"_blank"),children:n.jsx(du,{className:"w-4 h-4"})})]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:te.description||"No description available"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[te.category&&n.jsx(Qe,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${De}`,children:te.category}),te.version&&n.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",te.version]})]}),(Re>0||Ze>0||te.commands)&&n.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-500 dark:text-slate-500 pt-2 border-t border-gray-100 dark:border-slate-800",children:[Ze>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-cyan-50 dark:bg-cyan-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(ns,{className:"w-3 h-3 text-cyan-600"}),Ze," LSP"]}),Re>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-50 dark:bg-blue-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Fn,{className:"w-3 h-3 text-blue-600"}),Re," MCP"]}),te.commands&&n.jsxs("span",{className:"flex items-center gap-1 bg-green-50 dark:bg-green-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Ft,{className:"w-3 h-3 text-green-600"}),"Commands"]})]})]},Se)}),z.length===0&&n.jsxs("div",{className:"col-span-full text-center py-12 text-gray-500 dark:text-slate-400",children:[n.jsx(Fi,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{className:"font-medium",children:"No plugins found"}),n.jsx("p",{className:"text-sm mt-1",children:"Try adjusting your filters or search query"}),(d.length>0||c.length>0||o)&&n.jsx(le,{variant:"link",size:"sm",onClick:()=>{l([]),f([]),u("")},className:"mt-2",children:"Clear all filters"})]})]})]}),n.jsx(Tt,{open:P.open,onOpenChange:te=>T({...P,open:te}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Add Plugin Marketplace"]}),n.jsx(tr,{children:"Add a marketplace from a GitHub repository URL or local path."})]}),n.jsx("div",{className:"space-y-4 py-4",children:n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL or Path"}),n.jsx(ct,{value:P.repo,onChange:te=>T({...P,repo:te.target.value}),placeholder:"owner/repo or full GitHub URL",className:"mt-1"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:"Supported formats:"}),n.jsxs("ul",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"owner/repo"})," — GitHub shorthand"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"https://github.com/owner/repo"})," — Full URL"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"/local/path"})," — Local directory"]})]}),n.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-2",children:["Search GitHub for ",n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"claude-plugins"})," to find community marketplaces."]})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>T({open:!1,repo:""}),children:"Cancel"}),n.jsxs(le,{onClick:L,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:N,onOpenChange:R,children:n.jsxs(St,{className:"max-w-2xl",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Plugin Marketplaces",n.jsx(Qe,{variant:"outline",className:"ml-2 font-normal",children:X.length})]}),n.jsx(tr,{children:"Manage your plugin marketplaces. Add external marketplaces to discover more plugins."})]}),n.jsx("div",{className:"py-4",children:X.length>0?n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:X.map(te=>{var De,Re,Ze;const de=(((De=te.plugins)==null?void 0:De.length)||0)+(((Re=te.externalPlugins)==null?void 0:Re.length)||0);return n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/20 rounded-lg border border-purple-200 dark:border-purple-800 p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-200",children:te.name}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>U(te.name),disabled:j===te.name,className:"h-7 w-7 p-0",children:n.jsx(pr,{className:`w-4 h-4 text-purple-600 dark:text-purple-400 ${j===te.name?"animate-spin":""}`})})]}),n.jsx("p",{className:"text-sm text-purple-700 dark:text-purple-300 mb-2 truncate",children:typeof te.source=="string"?te.source:((Ze=te.source)==null?void 0:Ze.repo)||"Unknown source"}),n.jsxs("div",{className:"flex items-center justify-between text-xs text-purple-600 dark:text-purple-400",children:[n.jsxs("span",{children:[de," plugins"]}),te.lastUpdated&&n.jsxs("span",{children:["Updated: ",new Date(te.lastUpdated).toLocaleDateString()]})]})]},te.name)})}):n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(Yc,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No marketplaces configured."}),n.jsx("p",{className:"text-sm mt-1",children:"Add a marketplace to discover plugins."})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>R(!1),children:"Close"}),n.jsxs(le,{onClick:()=>{R(!1),T({open:!0,repo:""})},className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:I.open,onOpenChange:te=>O({...I,open:te}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(tb,{className:"w-5 h-5 text-emerald-600"}),"Configure Plugin: ",(ne=I.plugin)==null?void 0:ne.name]}),n.jsx(tr,{children:"Enable or disable this plugin for specific directories. Child directories inherit parent settings unless overridden."})]}),n.jsxs("div",{className:"space-y-3 py-4 max-h-[400px] overflow-y-auto",children:[(ye=(ie=(J=I.plugin)==null?void 0:J.enabledState)==null?void 0:ie.perDir)==null?void 0:ye.map((te,de)=>{const De=`${I.plugin.name}@${I.plugin.marketplace}`,Re=te.enabled!==null&&te.enabled!==void 0,Ze=te.enabled===!0,Se=te.enabled===!1;let ge=null;if(!Re&&de>0)for(let Me=de-1;Me>=0;Me--){const ht=I.plugin.enabledState.perDir[Me];if(ht.enabled!==null&&ht.enabled!==void 0){ge=ht.enabled;break}}return n.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${Ze?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/30 dark:border-emerald-800":Se?"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800":"bg-gray-50 border-gray-200 dark:bg-slate-800/50 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:te.label}),!Re&&ge!==null&&n.jsxs(Qe,{variant:"outline",className:"text-[10px] text-gray-500",children:["inherited: ",ge?"on":"off"]})]}),Re&&n.jsx("p",{className:"text-[10px] text-gray-500 dark:text-slate-400 mt-0.5",children:Ze?"Explicitly enabled":"Explicitly disabled"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[Re&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600",onClick:()=>B(te.dir,De),disabled:$,children:n.jsx(s5,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Remove override (inherit from parent)"})})]})}),n.jsxs("div",{className:"flex items-center gap-1 border rounded-lg overflow-hidden",children:[n.jsx(le,{variant:Ze?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Ze?"bg-emerald-600 hover:bg-emerald-700 text-white":""}`,onClick:()=>M(te.dir,De,!1),disabled:$||Ze,children:n.jsx(sb,{className:"w-3 h-3"})}),n.jsx(le,{variant:Se?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Se?"bg-red-600 hover:bg-red-700 text-white":""}`,onClick:()=>M(te.dir,De,!0),disabled:$||Se,children:n.jsx(y5,{className:"w-3 h-3"})})]})]})]},te.dir)}),(!((Ve=(Oe=I.plugin)==null?void 0:Oe.enabledState)!=null&&Ve.perDir)||I.plugin.enabledState.perDir.length===0)&&n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(tb,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No config hierarchy found."}),n.jsx("p",{className:"text-sm mt-1",children:"Create a .claude/mcps.json in your project first."})]})]}),n.jsx(It,{children:n.jsx(le,{variant:"ghost",onClick:()=>O({open:!1,plugin:null}),children:"Done"})})]})})]})}function AH({projects:e=[],onWorkstreamChange:t}){var Ke,bt;const[r,s]=C.useState([]),[o,u]=C.useState(!0),[d,l]=C.useState(null),[c,f]=C.useState(!1),[m,h]=C.useState(null),[x,w]=C.useState(!1),[k,_]=C.useState(null),[v,b]=C.useState(new Set),[g,y]=C.useState(""),[j,E]=C.useState(""),[P,T]=C.useState([]),[N,R]=C.useState(!1),[I,O]=C.useState(!1),[$,W]=C.useState({}),[Y,z]=C.useState({}),[K,G]=C.useState({}),[U,L]=C.useState({isInstalled:!1,loading:!0}),[M,B]=C.useState(!1),[q,F]=C.useState(null),[oe,fe]=C.useState([]),[me,X]=C.useState(!1),[H,ae]=C.useState(()=>{try{return JSON.parse(localStorage.getItem("dismissedWorkstreamSuggestions")||"[]")}catch{return[]}});C.useEffect(()=>{Ze(),ne(),J()},[]);const ne=async()=>{try{const Z=await ke.getWorkstreamHookStatus();L({...Z,loading:!1})}catch(Z){L({isInstalled:!1,loading:!1,error:Z.message})}},J=async()=>{try{X(!0);const[Z,Pe]=await Promise.all([ke.getActivitySummary(),ke.getWorkstreamSuggestions()]);F(Z),fe(Pe.suggestions||[])}catch(Z){console.log("Activity data not available:",Z.message)}finally{X(!1)}},ie=Z=>{y(Z.name),T([...Z.projects]),E(`# Auto-generated workstream based on activity patterns
|
|
2336
2336
|
|
|
2337
|
-
These projects are frequently worked on together.`),f(!0)},ye=Z=>{T(Pe=>Pe.filter(Le=>Le!==Z))},Oe=Z=>{P.includes(Z)||T(Pe=>[...Pe,Z])},Ve=async Z=>{const Pe=$[Z];if(!Pe&&!Y[Z]){G(Le=>({...Le,[Z]:!0}));try{const Le=await ke.getSubprojects(Z);z(st=>({...st,[Z]:Le.subprojects||[]}))}catch(Le){console.error("Failed to load subprojects:",Le),z(st=>({...st,[Z]:[]}))}finally{G(Le=>({...Le,[Z]:!1}))}}W(Le=>({...Le,[Z]:!Pe}))},
|
|
2337
|
+
These projects are frequently worked on together.`),f(!0)},ye=Z=>{T(Pe=>Pe.filter(Le=>Le!==Z))},Oe=Z=>{P.includes(Z)||T(Pe=>[...Pe,Z])},Ve=async Z=>{const Pe=$[Z];if(!Pe&&!Y[Z]){G(Le=>({...Le,[Z]:!0}));try{const Le=await ke.getSubprojects(Z);z(st=>({...st,[Z]:Le.subprojects||[]}))}catch(Le){console.error("Failed to load subprojects:",Le),z(st=>({...st,[Z]:[]}))}finally{G(Le=>({...Le,[Z]:!1}))}}W(Le=>({...Le,[Z]:!Pe}))},te=Z=>{const Pe=Z.projects.sort().join("|"),Le=[...H,Pe];ae(Le),localStorage.setItem("dismissedWorkstreamSuggestions",JSON.stringify(Le)),fe(st=>st.filter(et=>et.projects.sort().join("|")!==Pe)),ee.success("Suggestion dismissed")},de=oe.filter(Z=>{const Pe=Z.projects.sort().join("|");return!H.includes(Pe)}),De=async()=>{if(confirm("Clear activity data older than 30 days?"))try{const Z=await ke.clearActivity(30);Z.success&&(ee.success(`Cleared ${Z.cleared} old entries`),J())}catch(Z){ee.error("Failed to clear activity: "+Z.message)}},Re=async()=>{B(!0);try{const Z=await ke.installWorkstreamHook();Z.success?(ee.success(Z.message),L(Pe=>({...Pe,isInstalled:!0}))):ee.error(Z.error||"Failed to install hook")}catch(Z){ee.error("Failed to install hook: "+Z.message)}finally{B(!1)}},Ze=async()=>{try{u(!0);const Z=await ke.getWorkstreams();s(Z.workstreams||[])}catch{ee.error("Failed to load workstreams")}finally{u(!1)}},Se=async()=>{if(!g.trim()){ee.error("Name is required");return}R(!0);try{const Z=await ke.createWorkstream(g.trim(),P,j);Z.success?(s(Pe=>[...Pe,Z.workstream]),ee.success(`Created workstream: ${g}`),f(!1),y(""),E(""),T([]),fe(Pe=>Pe.filter(Le=>Le.name!==g.trim()))):ee.error(Z.error||"Failed to create workstream")}catch(Z){ee.error("Failed to create workstream: "+Z.message)}finally{R(!1)}},ge=async Z=>{if(confirm(`Delete workstream "${Z.name}"?
|
|
2338
2338
|
|
|
2339
|
-
This cannot be undone.`))try{const Pe=await ke.deleteWorkstream(Z.id);Pe.success?(s(Le=>Le.filter(st=>st.id!==Z.id)),ee.success(`Deleted workstream: ${Z.name}`)):ee.error(Pe.error||"Failed to delete workstream")}catch(Pe){ee.error("Failed to delete workstream: "+Pe.message)}},Me=async()=>{if(m){R(!0);try{const Z=await ke.updateWorkstream(m.id,{name:m.name,rules:m.rules,projects:m.projects||[]});Z.success?(s(Pe=>Pe.map(Le=>Le.id===m.id?Z.workstream:Le)),ee.success("Workstream updated"),h(null)):ee.error(Z.error||"Failed to update workstream")}catch(Z){ee.error("Failed to update workstream: "+Z.message)}finally{R(!1)}}},ht=Z=>{b(Pe=>{const Le=new Set(Pe);return Le.has(Z)?Le.delete(Z):Le.add(Z),Le})},Rt=async()=>{if(!k||v.size===0)return;R(!0);let Z=0,Pe=null;for(const Le of v)try{const st=await ke.addProjectToWorkstream(k.id,Le);st.success&&(Pe=st.workstream,Z++)}catch(st){console.error("Failed to add project:",Le,st)}Pe&&s(Le=>Le.map(st=>st.id===k.id?Pe:st)),Z>0?ee.success(`Added ${Z} project${Z>1?"s":""} to ${k.name}`):ee.error("Failed to add projects"),R(!1),w(!1),_(null),b(new Set)},pe=async(Z,Pe)=>{try{const Le=await ke.removeProjectFromWorkstream(Z.id,Pe);Le.success?(s(st=>st.map(et=>et.id===Z.id?Le.workstream:et)),ee.success(`Removed project from ${Z.name}`)):ee.error(Le.error||"Failed to remove project")}catch(Le){ee.error("Failed to remove project: "+Le.message)}},be=Z=>Z.split("/").pop()||Z,Be=Z=>r.filter(Pe=>{var Le;return(Le=Pe.projects)==null?void 0:Le.includes(Z)}).length,Ge=(Z,Pe=null)=>{var et,jt;const Le=Be(Z),st=Pe?(jt=(et=r.find(ft=>ft.id===Pe))==null?void 0:et.projects)==null?void 0:jt.includes(Z):!1;return Le===0?null:Le===1?st?null:"in use":"shared"};return o?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center",children:n.jsx(Zs,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Workstreams"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Context sets for multi-project workflows"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:"outline",onClick:Ze,size:"sm",children:[n.jsx(pr,{className:"w-4 h-4 mr-2"}),"Refresh"]}),n.jsxs(le,{onClick:()=>f(!0),className:"bg-purple-600 hover:bg-purple-700",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"New Workstream"]})]})]}),n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/30 border border-purple-200 dark:border-purple-800 rounded-lg p-4 text-sm text-purple-700 dark:text-purple-400",children:[n.jsx("p",{className:"font-medium mb-1",children:"What are Workstreams?"}),n.jsx("p",{children:"Workstreams are virtual projects that group repos belonging to the same product. When active, workstream rules are automatically injected into every Claude session."})]}),n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm overflow-hidden",children:r.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(Zs,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-slate-600"}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"No Workstreams Yet"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-4",children:"Create your first workstream to organize multi-project contexts."}),n.jsxs(le,{onClick:()=>f(!0),children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Create Your First Workstream"]})]}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:r.map(Z=>{var Pe,Le,st;return n.jsxs("div",{className:"group",children:[n.jsxs("div",{className:"p-4 flex items-center gap-4 transition-colors cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-900",onClick:()=>l(d===Z.id?null:Z.id),children:[n.jsx("div",{className:"w-5 h-5 flex items-center justify-center text-gray-400",children:d===Z.id?n.jsx(Sr,{className:"w-4 h-4"}):n.jsx(Kr,{className:"w-4 h-4"})}),n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center bg-gray-100 dark:bg-slate-800",children:n.jsx(Zs,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"font-medium truncate text-gray-900 dark:text-white",children:Z.name}),((Pe=Z.projects)==null?void 0:Pe.length)>0&&n.jsxs("span",{className:"text-xs bg-gray-100 dark:bg-slate-800 text-gray-600 dark:text-slate-400 px-1.5 py-0.5 rounded",children:[Z.projects.length," project",Z.projects.length!==1?"s":""]}),Z.rules&&n.jsxs("span",{className:"text-xs bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 px-1.5 py-0.5 rounded",children:[n.jsx(Cr,{className:"w-3 h-3 inline mr-0.5"}),"Rules"]})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 truncate",children:((Le=Z.projects)==null?void 0:Le.length)>0?Z.projects.map(et=>be(et)).join(", "):"No projects added"})]}),n.jsxs("div",{className:"flex items-center gap-2",onClick:et=>et.stopPropagation(),children:[n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>h({...Z}),className:"text-gray-500 dark:text-slate-400 hover:text-purple-600 dark:hover:text-purple-400",title:"Edit workstream",children:n.jsx(nb,{className:"w-4 h-4"})}),n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>ge(Z),className:"text-gray-500 dark:text-slate-400 hover:text-red-600 dark:hover:text-red-400",title:"Delete workstream",children:n.jsx(jn,{className:"w-4 h-4"})})]})]}),d===Z.id&&n.jsxs("div",{className:"px-4 pb-4 pl-16 space-y-4 bg-gray-50/50 dark:bg-slate-900/50",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Projects"}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>{_(Z),w(!0)},children:[n.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Add Project"]})]}),((st=Z.projects)==null?void 0:st.length)>0?n.jsx("div",{className:"space-y-1",children:Z.projects.map(et=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 bg-white dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700",children:[n.jsx("span",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:et.replace(/^\/Users\/[^/]+/,"~")}),n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>pe(Z,et),className:"text-gray-400 hover:text-red-500 h-6 w-6 p-0",children:n.jsx($M,{className:"w-4 h-4"})})]},et))}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic",children:"No projects added yet. Add projects to help organize your workstream."})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Rules"}),Z.rules?n.jsx("pre",{className:"text-sm text-gray-600 dark:text-slate-400 bg-white dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700 p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:Z.rules}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic",children:"No rules defined. Click Edit to add context rules for this workstream."})]})]})]},Z.id)})})}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Hook Integration"}),n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx("button",{className:"text-gray-400 hover:text-gray-600 dark:hover:text-slate-300",children:n.jsx(Ku,{className:"w-4 h-4"})})}),n.jsx(qr,{side:"right",className:"max-w-xs",children:n.jsxs("p",{className:"text-sm",children:[n.jsx("strong",{children:"What are hooks?"}),n.jsx("br",{}),n.jsx("br",{}),"Hooks are scripts that run automatically at specific points in Claude Code sessions. The workstream hook runs before each prompt and injects your active workstream's rules into the context.",n.jsx("br",{}),n.jsx("br",{}),n.jsx("strong",{children:"How it works:"}),n.jsx("br",{}),"1. You activate a workstream",n.jsx("br",{}),"2. Hook detects the active workstream",n.jsx("br",{}),"3. Rules are prepended to Claude's context",n.jsx("br",{}),"4. Claude understands your project context"]})})]})})]}),U.isInstalled?n.jsx("div",{className:"bg-green-50 dark:bg-green-950/30 border border-green-200 dark:border-green-800 rounded-lg p-4 text-sm text-green-700 dark:text-green-400",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Em,{className:"w-5 h-5 flex-shrink-0"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium",children:"Hook Installed"}),n.jsx("p",{className:"text-green-600 dark:text-green-500",children:"Workstream rules will be automatically injected into every Claude session."})]})]})}):n.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4 text-sm text-amber-700 dark:text-amber-400",children:n.jsxs("div",{className:"flex gap-3",children:[n.jsx(Oi,{className:"w-5 h-5 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"font-medium mb-1",children:"Hook Not Installed"}),n.jsx("p",{className:"mb-3",children:"Install the pre-prompt hook to automatically inject workstream rules into every Claude session."}),n.jsxs(le,{onClick:Re,disabled:M||U.loading,size:"sm",className:"bg-amber-600 hover:bg-amber-700 text-white",children:[M?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(bl,{className:"w-4 h-4 mr-2"}),"Install Hook"]}),n.jsxs("p",{className:"text-xs mt-2 text-amber-600 dark:text-amber-500",children:["Creates ",n.jsx("code",{className:"bg-amber-100 dark:bg-amber-900/50 px-1 rounded",children:"~/.claude/hooks/pre-prompt.sh"})]})]})]})})]}),q&&q.totalSessions>0&&n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(X4,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}),n.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Activity Insights"})]}),n.jsxs(le,{variant:"ghost",size:"sm",onClick:De,className:"text-gray-500 dark:text-slate-400 hover:text-red-500",children:[n.jsx(jn,{className:"w-4 h-4 mr-1"}),"Clear Old"]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-4",children:[n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-slate-400 text-xs mb-1",children:[n.jsx(b1,{className:"w-3 h-3"}),"Sessions"]}),n.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:q.totalSessions})]}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-slate-400 text-xs mb-1",children:[n.jsx(Cr,{className:"w-3 h-3"}),"Files Tracked"]}),n.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:q.totalFiles})]}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-slate-400 text-xs mb-1",children:[n.jsx(Zs,{className:"w-3 h-3"}),"Projects Active"]}),n.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:q.projectCount})]})]}),((Ke=q.topProjects)==null?void 0:Ke.length)>0&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Most Active Projects"}),n.jsx("div",{className:"space-y-1",children:q.topProjects.slice(0,5).map((Z,Pe)=>n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-gray-600 dark:text-slate-400 truncate",title:Z.path,children:Z.path.split("/").pop()}),n.jsxs("span",{className:"text-gray-400 dark:text-slate-500 text-xs",children:[Z.fileCount," files"]})]},Z.path))})]})]}),de.length>0&&n.jsxs("div",{className:"bg-gradient-to-r from-indigo-50 to-purple-50 dark:from-indigo-950/30 dark:to-purple-950/30 rounded-xl border border-indigo-200 dark:border-indigo-800 p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(Ht,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}),n.jsx("h3",{className:"font-medium text-indigo-900 dark:text-indigo-300",children:"Suggested Workstreams"}),n.jsx("span",{className:"text-xs bg-indigo-100 dark:bg-indigo-900/50 text-indigo-600 dark:text-indigo-400 px-1.5 py-0.5 rounded",children:"Based on activity patterns"})]}),n.jsx("p",{className:"text-sm text-indigo-700 dark:text-indigo-400 mb-4",children:"These projects are frequently worked on together. Create a workstream to group them?"}),n.jsx("div",{className:"space-y-3",children:de.map(Z=>n.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-lg border border-indigo-200 dark:border-indigo-800 p-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ju,{className:"w-4 h-4 text-amber-500"}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name}),Z.coActivityScore&&n.jsxs("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:[Z.coActivityScore,"% co-activity"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>re(Z),className:"text-gray-400 hover:text-gray-600 dark:hover:text-slate-300",title:"Dismiss suggestion",children:n.jsx(ei,{className:"w-4 h-4"})}),n.jsxs(le,{size:"sm",onClick:()=>ie(Z),className:"bg-indigo-600 hover:bg-indigo-700",children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Create"]})]})]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:Z.projects.map(Pe=>n.jsx("span",{className:"text-xs bg-gray-100 dark:bg-slate-800 text-gray-600 dark:text-slate-400 px-2 py-0.5 rounded",children:Pe.split("/").pop()},Pe))})]},Z.name))})]}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"claude-config workstream # List workstreams"}),n.jsx("p",{children:'claude-config workstream use "Name" # Set workstream for this tab'}),n.jsx("p",{children:'claude-config workstream create "Name" # Create workstream'})]})]}),n.jsx(Tt,{open:c,onOpenChange:Z=>{Z||(f(!1),y(""),E(""),T([]),O(!1),W({}))},children:n.jsxs(St,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Zs,{className:"w-5 h-5 text-purple-600"}),"Create Workstream"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Name"}),n.jsx(ct,{value:g,onChange:Z=>y(Z.target.value),placeholder:"e.g., User Auth, Admin Dashboard",autoFocus:!0})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Projects"}),n.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>O(!I),children:[n.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Add"]})]}),P.length>0?n.jsx("div",{className:"space-y-1 mb-2",children:P.map(Z=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 bg-gray-50 dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700",children:[n.jsx("span",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:Z.replace(/^\/Users\/[^/]+/,"~")}),n.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>ye(Z),className:"text-gray-400 hover:text-red-500 h-6 w-6 p-0",children:n.jsx(ei,{className:"w-4 h-4"})})]},Z))}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic mb-2",children:"No projects added. Add projects to help organize your workstream."}),I&&e.length>0&&n.jsx("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg p-2 max-h-64 overflow-y-auto bg-white dark:bg-slate-900",children:e.map(Z=>{const Pe=Ge(Z.path),Le=$[Z.path],st=K[Z.path],et=Y[Z.path]||[],jt=P.includes(Z.path);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>Ve(Z.path),className:"p-1 hover:bg-gray-100 dark:hover:bg-slate-800 rounded",title:"Show sub-projects",children:st?n.jsx(ut,{className:"w-4 h-4 animate-spin text-gray-400"}):Le?n.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})}),n.jsxs("button",{type:"button",onClick:()=>Oe(Z.path),disabled:jt,className:`flex-1 text-left p-2 rounded transition-colors ${jt?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[Pe&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${Pe==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:Pe}),jt&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate",children:Z.path.replace(/^\/Users\/[^/]+/,"~")})]})]}),Le&&et.length>0&&n.jsx("div",{className:"ml-6 mt-1 space-y-1 border-l-2 border-gray-200 dark:border-slate-700 pl-2",children:et.map(ft=>{const wt=P.includes(ft.dir),Vt=Ge(ft.dir);return n.jsxs("button",{type:"button",onClick:()=>Oe(ft.dir),disabled:wt,className:`w-full text-left p-2 rounded transition-colors ${wt?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:ft.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[Vt&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${Vt==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:Vt}),wt&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono",children:ft.relativePath})]},ft.dir)})}),Le&&et.length===0&&!st&&n.jsx("div",{className:"ml-6 mt-1 pl-2 text-xs text-gray-400 dark:text-slate-500 italic",children:"No sub-projects found"})]},Z.id)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Context (optional)"}),n.jsx(pt,{value:j,onChange:Z=>E(Z.target.value),placeholder:"Context rules for this workstream. These will be injected into every Claude session when this workstream is active.",rows:6}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:'Example: "Focus on user authentication. Use JWT tokens. React Query for state management."'})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>{f(!1),y(""),E(""),T([]),O(!1),W({})},children:"Cancel"}),n.jsxs(le,{onClick:Se,disabled:N||!g.trim(),className:"bg-purple-600 hover:bg-purple-700",children:[N?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Create"]})]})]})}),n.jsx(Tt,{open:!!m,onOpenChange:Z=>!Z&&h(null),children:n.jsxs(St,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(nb,{className:"w-5 h-5 text-purple-600"}),"Edit Workstream"]})}),m&&n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Name"}),n.jsx(ct,{value:m.name,onChange:Z=>h(Pe=>({...Pe,name:Z.target.value}))})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Projects"}),n.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>h(Z=>({...Z,showPicker:!Z.showPicker})),children:[n.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Add"]})]}),((bt=m.projects)==null?void 0:bt.length)>0?n.jsx("div",{className:"space-y-1 mb-2",children:m.projects.map(Z=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 bg-gray-50 dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700",children:[n.jsx("span",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:Z.replace(/^\/Users\/[^/]+/,"~")}),n.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>h(Pe=>({...Pe,projects:Pe.projects.filter(Le=>Le!==Z)})),className:"text-gray-400 hover:text-red-500 h-6 w-6 p-0",children:n.jsx(ei,{className:"w-4 h-4"})})]},Z))}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic mb-2",children:"No projects in this workstream."}),m.showPicker&&e.length>0&&n.jsx("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg p-2 max-h-48 overflow-y-auto bg-white dark:bg-slate-900",children:e.map(Z=>{var ft;const Pe=(ft=m.projects)==null?void 0:ft.includes(Z.path),Le=Ge(Z.path,m.id),st=$[Z.path],et=K[Z.path],jt=Y[Z.path]||[];return n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>Ve(Z.path),className:"p-1 hover:bg-gray-100 dark:hover:bg-slate-800 rounded",title:"Show sub-projects",children:et?n.jsx(ut,{className:"w-4 h-4 animate-spin text-gray-400"}):st?n.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})}),n.jsxs("button",{type:"button",onClick:()=>!Pe&&h(wt=>({...wt,projects:[...wt.projects||[],Z.path]})),disabled:Pe,className:`flex-1 text-left p-2 rounded transition-colors ${Pe?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[Le&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${Le==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:Le}),Pe&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate",children:Z.path.replace(/^\/Users\/[^/]+/,"~")})]})]}),st&&jt.length>0&&n.jsx("div",{className:"ml-6 mt-1 space-y-1 border-l-2 border-gray-200 dark:border-slate-700 pl-2",children:jt.map(wt=>{var jr;const Vt=(jr=m.projects)==null?void 0:jr.includes(wt.dir),rr=Ge(wt.dir,m.id);return n.jsxs("button",{type:"button",onClick:()=>!Vt&&h(hn=>({...hn,projects:[...hn.projects||[],wt.dir]})),disabled:Vt,className:`w-full text-left p-2 rounded transition-colors ${Vt?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:wt.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[rr&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${rr==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:rr}),Vt&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate",children:wt.relativePath})]},wt.dir)})}),st&&jt.length===0&&!et&&n.jsx("div",{className:"ml-6 mt-1 pl-2 text-xs text-gray-400 dark:text-slate-500 italic",children:"No sub-projects found"})]},Z.id)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Rules"}),n.jsx(pt,{value:m.rules||"",onChange:Z=>h(Pe=>({...Pe,rules:Z.target.value})),placeholder:"Context rules for this workstream...",rows:8})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>h(null),children:"Cancel"}),n.jsxs(le,{onClick:Me,disabled:N,className:"bg-purple-600 hover:bg-purple-700",children:[N?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]})]})}),n.jsx(Tt,{open:x,onOpenChange:Z=>{w(Z),Z||(W({}),b(new Set))},children:n.jsxs(St,{className:"max-w-lg",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Mi,{className:"w-5 h-5 text-purple-600"}),"Add Project to ",k==null?void 0:k.name]})}),n.jsxs("div",{className:"py-4",children:[n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Select projects to add to this workstream (multi-select enabled):"}),e.length>0?n.jsx("div",{className:"space-y-1 max-h-64 overflow-y-auto border border-gray-200 dark:border-slate-700 rounded-lg p-2 bg-white dark:bg-slate-900",children:e.map(Z=>{var wt;const Pe=(wt=k==null?void 0:k.projects)==null?void 0:wt.includes(Z.path),Le=v.has(Z.path),st=Ge(Z.path,k==null?void 0:k.id),et=$[Z.path],jt=K[Z.path],ft=Y[Z.path]||[];return n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>Ve(Z.path),className:"p-1 hover:bg-gray-100 dark:hover:bg-slate-800 rounded",title:"Show sub-projects",children:jt?n.jsx(ut,{className:"w-4 h-4 animate-spin text-gray-400"}):et?n.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})}),n.jsxs("button",{type:"button",onClick:()=>!Pe&&ht(Z.path),disabled:Pe,className:`flex-1 text-left p-2 rounded transition-colors ${Pe?"bg-gray-100 dark:bg-slate-800 opacity-50 cursor-not-allowed":Le?"bg-purple-100 dark:bg-purple-950/50 ring-2 ring-purple-500":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-4 h-4 rounded border-2 flex items-center justify-center ${Pe?"bg-gray-300 dark:bg-slate-600 border-gray-300 dark:border-slate-600":Le?"bg-purple-600 border-purple-600":"border-gray-300 dark:border-slate-600"}`,children:(Pe||Le)&&n.jsx(Kt,{className:"w-3 h-3 text-white"})}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[st&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${st==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:st}),Pe&&n.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:"added"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate ml-6",children:Z.path.replace(/^\/Users\/[^/]+/,"~")})]})]}),et&&ft.length>0&&n.jsx("div",{className:"ml-6 mt-1 space-y-1 border-l-2 border-gray-200 dark:border-slate-700 pl-2",children:ft.map(Vt=>{var tt;const rr=(tt=k==null?void 0:k.projects)==null?void 0:tt.includes(Vt.dir),jr=v.has(Vt.dir),hn=Ge(Vt.dir,k==null?void 0:k.id);return n.jsxs("button",{type:"button",onClick:()=>!rr&&ht(Vt.dir),disabled:rr,className:`w-full text-left p-2 rounded transition-colors ${rr?"bg-gray-100 dark:bg-slate-800 opacity-50 cursor-not-allowed":jr?"bg-purple-100 dark:bg-purple-950/50 ring-2 ring-purple-500":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-4 h-4 rounded border-2 flex items-center justify-center ${rr?"bg-gray-300 dark:bg-slate-600 border-gray-300 dark:border-slate-600":jr?"bg-purple-600 border-purple-600":"border-gray-300 dark:border-slate-600"}`,children:(rr||jr)&&n.jsx(Kt,{className:"w-3 h-3 text-white"})}),n.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:Vt.name})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[hn&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${hn==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:hn}),rr&&n.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:"added"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate ml-6",children:Vt.relativePath})]},Vt.dir)})}),et&&ft.length===0&&!jt&&n.jsx("div",{className:"ml-6 mt-1 pl-2 text-xs text-gray-400 dark:text-slate-500 italic",children:"No sub-projects found"})]},Z.id)})}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center py-4",children:"No projects registered. Add projects in the Projects view first."})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>{w(!1),b(new Set)},children:"Cancel"}),n.jsxs(le,{onClick:Rt,disabled:v.size===0||N,className:"bg-purple-600 hover:bg-purple-700",children:[N?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Selected (",v.size,")"]})]})]})})]})}function TH(e,t=[]){let r=[];function s(u,d){const l=C.createContext(d);l.displayName=u+"Context";const c=r.length;r=[...r,d];const f=h=>{var b;const{scope:x,children:w,...k}=h,_=((b=x==null?void 0:x[e])==null?void 0:b[c])||l,v=C.useMemo(()=>k,Object.values(k));return n.jsx(_.Provider,{value:v,children:w})};f.displayName=u+"Provider";function m(h,x){var _;const w=((_=x==null?void 0:x[e])==null?void 0:_[c])||l,k=C.useContext(w);if(k)return k;if(d!==void 0)return d;throw new Error(`\`${h}\` must be used within \`${u}\``)}return[f,m]}const o=()=>{const u=r.map(d=>C.createContext(d));return function(l){const c=(l==null?void 0:l[e])||u;return C.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[s,RH(o,...t)]}function RH(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=s.reduce((l,{useScope:c,scopeName:f})=>{const h=c(u)[`__scope${f}`];return{...l,...h}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return r.scopeName=t.scopeName,r}var MH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O2=MH.reduce((e,t)=>{const r=Qu(`Primitive.${t}`),s=C.forwardRef((o,u)=>{const{asChild:d,...l}=o,c=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),Xg="Progress",Jg=100,[DH]=TH(Xg),[LH,IH]=DH(Xg),B2=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:s=null,max:o,getValueLabel:u=OH,...d}=e;(o||o===0)&&!Iw(o)&&console.error(BH(`${o}`,"Progress"));const l=Iw(o)?o:Jg;s!==null&&!Ow(s,l)&&console.error(FH(`${s}`,"Progress"));const c=Ow(s,l)?s:null,f=$u(c)?u(c,l):void 0;return n.jsx(LH,{scope:r,value:c,max:l,children:n.jsx(O2.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":$u(c)?c:void 0,"aria-valuetext":f,role:"progressbar","data-state":z2(c,l),"data-value":c??void 0,"data-max":l,...d,ref:t})})});B2.displayName=Xg;var F2="ProgressIndicator",$2=C.forwardRef((e,t)=>{const{__scopeProgress:r,...s}=e,o=IH(F2,r);return n.jsx(O2.div,{"data-state":z2(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...s,ref:t})});$2.displayName=F2;function OH(e,t){return`${Math.round(e/t*100)}%`}function z2(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function $u(e){return typeof e=="number"}function Iw(e){return $u(e)&&!isNaN(e)&&e>0}function Ow(e,t){return $u(e)&&!isNaN(e)&&e<=t&&e>=0}function BH(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Jg}\`.`}function FH(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2339
|
+
This cannot be undone.`))try{const Pe=await ke.deleteWorkstream(Z.id);Pe.success?(s(Le=>Le.filter(st=>st.id!==Z.id)),ee.success(`Deleted workstream: ${Z.name}`)):ee.error(Pe.error||"Failed to delete workstream")}catch(Pe){ee.error("Failed to delete workstream: "+Pe.message)}},Me=async()=>{if(m){R(!0);try{const Z=await ke.updateWorkstream(m.id,{name:m.name,rules:m.rules,projects:m.projects||[]});Z.success?(s(Pe=>Pe.map(Le=>Le.id===m.id?Z.workstream:Le)),ee.success("Workstream updated"),h(null)):ee.error(Z.error||"Failed to update workstream")}catch(Z){ee.error("Failed to update workstream: "+Z.message)}finally{R(!1)}}},ht=Z=>{b(Pe=>{const Le=new Set(Pe);return Le.has(Z)?Le.delete(Z):Le.add(Z),Le})},Rt=async()=>{if(!k||v.size===0)return;R(!0);let Z=0,Pe=null;for(const Le of v)try{const st=await ke.addProjectToWorkstream(k.id,Le);st.success&&(Pe=st.workstream,Z++)}catch(st){console.error("Failed to add project:",Le,st)}Pe&&s(Le=>Le.map(st=>st.id===k.id?Pe:st)),Z>0?ee.success(`Added ${Z} project${Z>1?"s":""} to ${k.name}`):ee.error("Failed to add projects"),R(!1),w(!1),_(null),b(new Set)},pe=async(Z,Pe)=>{try{const Le=await ke.removeProjectFromWorkstream(Z.id,Pe);Le.success?(s(st=>st.map(et=>et.id===Z.id?Le.workstream:et)),ee.success(`Removed project from ${Z.name}`)):ee.error(Le.error||"Failed to remove project")}catch(Le){ee.error("Failed to remove project: "+Le.message)}},be=Z=>Z.split("/").pop()||Z,Be=Z=>r.filter(Pe=>{var Le;return(Le=Pe.projects)==null?void 0:Le.includes(Z)}).length,Ge=(Z,Pe=null)=>{var et,jt;const Le=Be(Z),st=Pe?(jt=(et=r.find(ft=>ft.id===Pe))==null?void 0:et.projects)==null?void 0:jt.includes(Z):!1;return Le===0?null:Le===1?st?null:"in use":"shared"};return o?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-indigo-600"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center",children:n.jsx(Zs,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Workstreams"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Context sets for multi-project workflows"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:"outline",onClick:Ze,size:"sm",children:[n.jsx(pr,{className:"w-4 h-4 mr-2"}),"Refresh"]}),n.jsxs(le,{onClick:()=>f(!0),className:"bg-purple-600 hover:bg-purple-700",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"New Workstream"]})]})]}),n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/30 border border-purple-200 dark:border-purple-800 rounded-lg p-4 text-sm text-purple-700 dark:text-purple-400",children:[n.jsx("p",{className:"font-medium mb-1",children:"What are Workstreams?"}),n.jsx("p",{children:"Workstreams are virtual projects that group repos belonging to the same product. When active, workstream rules are automatically injected into every Claude session."})]}),n.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm overflow-hidden",children:r.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(Zs,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-slate-600"}),n.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"No Workstreams Yet"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-4",children:"Create your first workstream to organize multi-project contexts."}),n.jsxs(le,{onClick:()=>f(!0),children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Create Your First Workstream"]})]}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:r.map(Z=>{var Pe,Le,st;return n.jsxs("div",{className:"group",children:[n.jsxs("div",{className:"p-4 flex items-center gap-4 transition-colors cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-900",onClick:()=>l(d===Z.id?null:Z.id),children:[n.jsx("div",{className:"w-5 h-5 flex items-center justify-center text-gray-400",children:d===Z.id?n.jsx(Sr,{className:"w-4 h-4"}):n.jsx(Kr,{className:"w-4 h-4"})}),n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center bg-gray-100 dark:bg-slate-800",children:n.jsx(Zs,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"font-medium truncate text-gray-900 dark:text-white",children:Z.name}),((Pe=Z.projects)==null?void 0:Pe.length)>0&&n.jsxs("span",{className:"text-xs bg-gray-100 dark:bg-slate-800 text-gray-600 dark:text-slate-400 px-1.5 py-0.5 rounded",children:[Z.projects.length," project",Z.projects.length!==1?"s":""]}),Z.rules&&n.jsxs("span",{className:"text-xs bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 px-1.5 py-0.5 rounded",children:[n.jsx(Cr,{className:"w-3 h-3 inline mr-0.5"}),"Rules"]})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 truncate",children:((Le=Z.projects)==null?void 0:Le.length)>0?Z.projects.map(et=>be(et)).join(", "):"No projects added"})]}),n.jsxs("div",{className:"flex items-center gap-2",onClick:et=>et.stopPropagation(),children:[n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>h({...Z}),className:"text-gray-500 dark:text-slate-400 hover:text-purple-600 dark:hover:text-purple-400",title:"Edit workstream",children:n.jsx(nb,{className:"w-4 h-4"})}),n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>ge(Z),className:"text-gray-500 dark:text-slate-400 hover:text-red-600 dark:hover:text-red-400",title:"Delete workstream",children:n.jsx(jn,{className:"w-4 h-4"})})]})]}),d===Z.id&&n.jsxs("div",{className:"px-4 pb-4 pl-16 space-y-4 bg-gray-50/50 dark:bg-slate-900/50",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Projects"}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>{_(Z),w(!0)},children:[n.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Add Project"]})]}),((st=Z.projects)==null?void 0:st.length)>0?n.jsx("div",{className:"space-y-1",children:Z.projects.map(et=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 bg-white dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700",children:[n.jsx("span",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:et.replace(/^\/Users\/[^/]+/,"~")}),n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>pe(Z,et),className:"text-gray-400 hover:text-red-500 h-6 w-6 p-0",children:n.jsx($M,{className:"w-4 h-4"})})]},et))}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic",children:"No projects added yet. Add projects to help organize your workstream."})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Rules"}),Z.rules?n.jsx("pre",{className:"text-sm text-gray-600 dark:text-slate-400 bg-white dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700 p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:Z.rules}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic",children:"No rules defined. Click Edit to add context rules for this workstream."})]})]})]},Z.id)})})}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Hook Integration"}),n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx("button",{className:"text-gray-400 hover:text-gray-600 dark:hover:text-slate-300",children:n.jsx(Ku,{className:"w-4 h-4"})})}),n.jsx(qr,{side:"right",className:"max-w-xs",children:n.jsxs("p",{className:"text-sm",children:[n.jsx("strong",{children:"What are hooks?"}),n.jsx("br",{}),n.jsx("br",{}),"Hooks are scripts that run automatically at specific points in Claude Code sessions. The workstream hook runs before each prompt and injects your active workstream's rules into the context.",n.jsx("br",{}),n.jsx("br",{}),n.jsx("strong",{children:"How it works:"}),n.jsx("br",{}),"1. You activate a workstream",n.jsx("br",{}),"2. Hook detects the active workstream",n.jsx("br",{}),"3. Rules are prepended to Claude's context",n.jsx("br",{}),"4. Claude understands your project context"]})})]})})]}),U.isInstalled?n.jsx("div",{className:"bg-green-50 dark:bg-green-950/30 border border-green-200 dark:border-green-800 rounded-lg p-4 text-sm text-green-700 dark:text-green-400",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Em,{className:"w-5 h-5 flex-shrink-0"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium",children:"Hook Installed"}),n.jsx("p",{className:"text-green-600 dark:text-green-500",children:"Workstream rules will be automatically injected into every Claude session."})]})]})}):n.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4 text-sm text-amber-700 dark:text-amber-400",children:n.jsxs("div",{className:"flex gap-3",children:[n.jsx(Oi,{className:"w-5 h-5 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"font-medium mb-1",children:"Hook Not Installed"}),n.jsx("p",{className:"mb-3",children:"Install the pre-prompt hook to automatically inject workstream rules into every Claude session."}),n.jsxs(le,{onClick:Re,disabled:M||U.loading,size:"sm",className:"bg-amber-600 hover:bg-amber-700 text-white",children:[M?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(bl,{className:"w-4 h-4 mr-2"}),"Install Hook"]}),n.jsxs("p",{className:"text-xs mt-2 text-amber-600 dark:text-amber-500",children:["Creates ",n.jsx("code",{className:"bg-amber-100 dark:bg-amber-900/50 px-1 rounded",children:"~/.claude/hooks/pre-prompt.sh"})]})]})]})})]}),q&&q.totalSessions>0&&n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 shadow-sm p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(X4,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}),n.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Activity Insights"})]}),n.jsxs(le,{variant:"ghost",size:"sm",onClick:De,className:"text-gray-500 dark:text-slate-400 hover:text-red-500",children:[n.jsx(jn,{className:"w-4 h-4 mr-1"}),"Clear Old"]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-4",children:[n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-slate-400 text-xs mb-1",children:[n.jsx(b1,{className:"w-3 h-3"}),"Sessions"]}),n.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:q.totalSessions})]}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-slate-400 text-xs mb-1",children:[n.jsx(Cr,{className:"w-3 h-3"}),"Files Tracked"]}),n.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:q.totalFiles})]}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-slate-400 text-xs mb-1",children:[n.jsx(Zs,{className:"w-3 h-3"}),"Projects Active"]}),n.jsx("div",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:q.projectCount})]})]}),((Ke=q.topProjects)==null?void 0:Ke.length)>0&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Most Active Projects"}),n.jsx("div",{className:"space-y-1",children:q.topProjects.slice(0,5).map((Z,Pe)=>n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-gray-600 dark:text-slate-400 truncate",title:Z.path,children:Z.path.split("/").pop()}),n.jsxs("span",{className:"text-gray-400 dark:text-slate-500 text-xs",children:[Z.fileCount," files"]})]},Z.path))})]})]}),de.length>0&&n.jsxs("div",{className:"bg-gradient-to-r from-indigo-50 to-purple-50 dark:from-indigo-950/30 dark:to-purple-950/30 rounded-xl border border-indigo-200 dark:border-indigo-800 p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(Ht,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}),n.jsx("h3",{className:"font-medium text-indigo-900 dark:text-indigo-300",children:"Suggested Workstreams"}),n.jsx("span",{className:"text-xs bg-indigo-100 dark:bg-indigo-900/50 text-indigo-600 dark:text-indigo-400 px-1.5 py-0.5 rounded",children:"Based on activity patterns"})]}),n.jsx("p",{className:"text-sm text-indigo-700 dark:text-indigo-400 mb-4",children:"These projects are frequently worked on together. Create a workstream to group them?"}),n.jsx("div",{className:"space-y-3",children:de.map(Z=>n.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-lg border border-indigo-200 dark:border-indigo-800 p-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ju,{className:"w-4 h-4 text-amber-500"}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name}),Z.coActivityScore&&n.jsxs("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:[Z.coActivityScore,"% co-activity"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(le,{size:"sm",variant:"ghost",onClick:()=>te(Z),className:"text-gray-400 hover:text-gray-600 dark:hover:text-slate-300",title:"Dismiss suggestion",children:n.jsx(ei,{className:"w-4 h-4"})}),n.jsxs(le,{size:"sm",onClick:()=>ie(Z),className:"bg-indigo-600 hover:bg-indigo-700",children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Create"]})]})]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:Z.projects.map(Pe=>n.jsx("span",{className:"text-xs bg-gray-100 dark:bg-slate-800 text-gray-600 dark:text-slate-400 px-2 py-0.5 rounded",children:Pe.split("/").pop()},Pe))})]},Z.name))})]}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{children:"coder-config workstream # List workstreams"}),n.jsx("p",{children:'coder-config workstream use "Name" # Set workstream for this tab'}),n.jsx("p",{children:'coder-config workstream create "Name" # Create workstream'})]})]}),n.jsx(Tt,{open:c,onOpenChange:Z=>{Z||(f(!1),y(""),E(""),T([]),O(!1),W({}))},children:n.jsxs(St,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Zs,{className:"w-5 h-5 text-purple-600"}),"Create Workstream"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Name"}),n.jsx(ct,{value:g,onChange:Z=>y(Z.target.value),placeholder:"e.g., User Auth, Admin Dashboard",autoFocus:!0})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Projects"}),n.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>O(!I),children:[n.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Add"]})]}),P.length>0?n.jsx("div",{className:"space-y-1 mb-2",children:P.map(Z=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 bg-gray-50 dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700",children:[n.jsx("span",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:Z.replace(/^\/Users\/[^/]+/,"~")}),n.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>ye(Z),className:"text-gray-400 hover:text-red-500 h-6 w-6 p-0",children:n.jsx(ei,{className:"w-4 h-4"})})]},Z))}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic mb-2",children:"No projects added. Add projects to help organize your workstream."}),I&&e.length>0&&n.jsx("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg p-2 max-h-64 overflow-y-auto bg-white dark:bg-slate-900",children:e.map(Z=>{const Pe=Ge(Z.path),Le=$[Z.path],st=K[Z.path],et=Y[Z.path]||[],jt=P.includes(Z.path);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>Ve(Z.path),className:"p-1 hover:bg-gray-100 dark:hover:bg-slate-800 rounded",title:"Show sub-projects",children:st?n.jsx(ut,{className:"w-4 h-4 animate-spin text-gray-400"}):Le?n.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})}),n.jsxs("button",{type:"button",onClick:()=>Oe(Z.path),disabled:jt,className:`flex-1 text-left p-2 rounded transition-colors ${jt?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[Pe&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${Pe==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:Pe}),jt&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate",children:Z.path.replace(/^\/Users\/[^/]+/,"~")})]})]}),Le&&et.length>0&&n.jsx("div",{className:"ml-6 mt-1 space-y-1 border-l-2 border-gray-200 dark:border-slate-700 pl-2",children:et.map(ft=>{const wt=P.includes(ft.dir),Vt=Ge(ft.dir);return n.jsxs("button",{type:"button",onClick:()=>Oe(ft.dir),disabled:wt,className:`w-full text-left p-2 rounded transition-colors ${wt?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:ft.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[Vt&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${Vt==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:Vt}),wt&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono",children:ft.relativePath})]},ft.dir)})}),Le&&et.length===0&&!st&&n.jsx("div",{className:"ml-6 mt-1 pl-2 text-xs text-gray-400 dark:text-slate-500 italic",children:"No sub-projects found"})]},Z.id)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Context (optional)"}),n.jsx(pt,{value:j,onChange:Z=>E(Z.target.value),placeholder:"Context rules for this workstream. These will be injected into every Claude session when this workstream is active.",rows:6}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:'Example: "Focus on user authentication. Use JWT tokens. React Query for state management."'})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>{f(!1),y(""),E(""),T([]),O(!1),W({})},children:"Cancel"}),n.jsxs(le,{onClick:Se,disabled:N||!g.trim(),className:"bg-purple-600 hover:bg-purple-700",children:[N?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Create"]})]})]})}),n.jsx(Tt,{open:!!m,onOpenChange:Z=>!Z&&h(null),children:n.jsxs(St,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(nb,{className:"w-5 h-5 text-purple-600"}),"Edit Workstream"]})}),m&&n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Name"}),n.jsx(ct,{value:m.name,onChange:Z=>h(Pe=>({...Pe,name:Z.target.value}))})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Projects"}),n.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>h(Z=>({...Z,showPicker:!Z.showPicker})),children:[n.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Add"]})]}),((bt=m.projects)==null?void 0:bt.length)>0?n.jsx("div",{className:"space-y-1 mb-2",children:m.projects.map(Z=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 bg-gray-50 dark:bg-slate-800 rounded border border-gray-200 dark:border-slate-700",children:[n.jsx("span",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:Z.replace(/^\/Users\/[^/]+/,"~")}),n.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>h(Pe=>({...Pe,projects:Pe.projects.filter(Le=>Le!==Z)})),className:"text-gray-400 hover:text-red-500 h-6 w-6 p-0",children:n.jsx(ei,{className:"w-4 h-4"})})]},Z))}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic mb-2",children:"No projects in this workstream."}),m.showPicker&&e.length>0&&n.jsx("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg p-2 max-h-48 overflow-y-auto bg-white dark:bg-slate-900",children:e.map(Z=>{var ft;const Pe=(ft=m.projects)==null?void 0:ft.includes(Z.path),Le=Ge(Z.path,m.id),st=$[Z.path],et=K[Z.path],jt=Y[Z.path]||[];return n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>Ve(Z.path),className:"p-1 hover:bg-gray-100 dark:hover:bg-slate-800 rounded",title:"Show sub-projects",children:et?n.jsx(ut,{className:"w-4 h-4 animate-spin text-gray-400"}):st?n.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})}),n.jsxs("button",{type:"button",onClick:()=>!Pe&&h(wt=>({...wt,projects:[...wt.projects||[],Z.path]})),disabled:Pe,className:`flex-1 text-left p-2 rounded transition-colors ${Pe?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[Le&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${Le==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:Le}),Pe&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate",children:Z.path.replace(/^\/Users\/[^/]+/,"~")})]})]}),st&&jt.length>0&&n.jsx("div",{className:"ml-6 mt-1 space-y-1 border-l-2 border-gray-200 dark:border-slate-700 pl-2",children:jt.map(wt=>{var jr;const Vt=(jr=m.projects)==null?void 0:jr.includes(wt.dir),rr=Ge(wt.dir,m.id);return n.jsxs("button",{type:"button",onClick:()=>!Vt&&h(hn=>({...hn,projects:[...hn.projects||[],wt.dir]})),disabled:Vt,className:`w-full text-left p-2 rounded transition-colors ${Vt?"bg-purple-50 dark:bg-purple-950/30 opacity-50":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:wt.name}),n.jsxs("div",{className:"flex items-center gap-1",children:[rr&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${rr==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:rr}),Vt&&n.jsx(Kt,{className:"w-4 h-4 text-purple-600"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate",children:wt.relativePath})]},wt.dir)})}),st&&jt.length===0&&!et&&n.jsx("div",{className:"ml-6 mt-1 pl-2 text-xs text-gray-400 dark:text-slate-500 italic",children:"No sub-projects found"})]},Z.id)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-1 block",children:"Rules"}),n.jsx(pt,{value:m.rules||"",onChange:Z=>h(Pe=>({...Pe,rules:Z.target.value})),placeholder:"Context rules for this workstream...",rows:8})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>h(null),children:"Cancel"}),n.jsxs(le,{onClick:Me,disabled:N,className:"bg-purple-600 hover:bg-purple-700",children:[N?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]})]})}),n.jsx(Tt,{open:x,onOpenChange:Z=>{w(Z),Z||(W({}),b(new Set))},children:n.jsxs(St,{className:"max-w-lg",children:[n.jsx(Ct,{children:n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Mi,{className:"w-5 h-5 text-purple-600"}),"Add Project to ",k==null?void 0:k.name]})}),n.jsxs("div",{className:"py-4",children:[n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Select projects to add to this workstream (multi-select enabled):"}),e.length>0?n.jsx("div",{className:"space-y-1 max-h-64 overflow-y-auto border border-gray-200 dark:border-slate-700 rounded-lg p-2 bg-white dark:bg-slate-900",children:e.map(Z=>{var wt;const Pe=(wt=k==null?void 0:k.projects)==null?void 0:wt.includes(Z.path),Le=v.has(Z.path),st=Ge(Z.path,k==null?void 0:k.id),et=$[Z.path],jt=K[Z.path],ft=Y[Z.path]||[];return n.jsxs("div",{className:"mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>Ve(Z.path),className:"p-1 hover:bg-gray-100 dark:hover:bg-slate-800 rounded",title:"Show sub-projects",children:jt?n.jsx(ut,{className:"w-4 h-4 animate-spin text-gray-400"}):et?n.jsx(Sr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Kr,{className:"w-4 h-4 text-gray-400"})}),n.jsxs("button",{type:"button",onClick:()=>!Pe&&ht(Z.path),disabled:Pe,className:`flex-1 text-left p-2 rounded transition-colors ${Pe?"bg-gray-100 dark:bg-slate-800 opacity-50 cursor-not-allowed":Le?"bg-purple-100 dark:bg-purple-950/50 ring-2 ring-purple-500":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-4 h-4 rounded border-2 flex items-center justify-center ${Pe?"bg-gray-300 dark:bg-slate-600 border-gray-300 dark:border-slate-600":Le?"bg-purple-600 border-purple-600":"border-gray-300 dark:border-slate-600"}`,children:(Pe||Le)&&n.jsx(Kt,{className:"w-3 h-3 text-white"})}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:Z.name})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[st&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${st==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:st}),Pe&&n.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:"added"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate ml-6",children:Z.path.replace(/^\/Users\/[^/]+/,"~")})]})]}),et&&ft.length>0&&n.jsx("div",{className:"ml-6 mt-1 space-y-1 border-l-2 border-gray-200 dark:border-slate-700 pl-2",children:ft.map(Vt=>{var tt;const rr=(tt=k==null?void 0:k.projects)==null?void 0:tt.includes(Vt.dir),jr=v.has(Vt.dir),hn=Ge(Vt.dir,k==null?void 0:k.id);return n.jsxs("button",{type:"button",onClick:()=>!rr&&ht(Vt.dir),disabled:rr,className:`w-full text-left p-2 rounded transition-colors ${rr?"bg-gray-100 dark:bg-slate-800 opacity-50 cursor-not-allowed":jr?"bg-purple-100 dark:bg-purple-950/50 ring-2 ring-purple-500":"hover:bg-purple-50 dark:hover:bg-purple-950/30"}`,children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-4 h-4 rounded border-2 flex items-center justify-center ${rr?"bg-gray-300 dark:bg-slate-600 border-gray-300 dark:border-slate-600":jr?"bg-purple-600 border-purple-600":"border-gray-300 dark:border-slate-600"}`,children:(rr||jr)&&n.jsx(Kt,{className:"w-3 h-3 text-white"})}),n.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:Vt.name})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[hn&&n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${hn==="shared"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-400":"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-400"}`,children:hn}),rr&&n.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:"added"})]})]}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 font-mono truncate ml-6",children:Vt.relativePath})]},Vt.dir)})}),et&&ft.length===0&&!jt&&n.jsx("div",{className:"ml-6 mt-1 pl-2 text-xs text-gray-400 dark:text-slate-500 italic",children:"No sub-projects found"})]},Z.id)})}):n.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center py-4",children:"No projects registered. Add projects in the Projects view first."})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>{w(!1),b(new Set)},children:"Cancel"}),n.jsxs(le,{onClick:Rt,disabled:v.size===0||N,className:"bg-purple-600 hover:bg-purple-700",children:[N?n.jsx(ut,{className:"w-4 h-4 animate-spin mr-2"}):n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Selected (",v.size,")"]})]})]})})]})}function TH(e,t=[]){let r=[];function s(u,d){const l=C.createContext(d);l.displayName=u+"Context";const c=r.length;r=[...r,d];const f=h=>{var b;const{scope:x,children:w,...k}=h,_=((b=x==null?void 0:x[e])==null?void 0:b[c])||l,v=C.useMemo(()=>k,Object.values(k));return n.jsx(_.Provider,{value:v,children:w})};f.displayName=u+"Provider";function m(h,x){var _;const w=((_=x==null?void 0:x[e])==null?void 0:_[c])||l,k=C.useContext(w);if(k)return k;if(d!==void 0)return d;throw new Error(`\`${h}\` must be used within \`${u}\``)}return[f,m]}const o=()=>{const u=r.map(d=>C.createContext(d));return function(l){const c=(l==null?void 0:l[e])||u;return C.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[s,RH(o,...t)]}function RH(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=s.reduce((l,{useScope:c,scopeName:f})=>{const h=c(u)[`__scope${f}`];return{...l,...h}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return r.scopeName=t.scopeName,r}var MH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O2=MH.reduce((e,t)=>{const r=Qu(`Primitive.${t}`),s=C.forwardRef((o,u)=>{const{asChild:d,...l}=o,c=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),Xg="Progress",Jg=100,[DH]=TH(Xg),[LH,IH]=DH(Xg),B2=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:s=null,max:o,getValueLabel:u=OH,...d}=e;(o||o===0)&&!Iw(o)&&console.error(BH(`${o}`,"Progress"));const l=Iw(o)?o:Jg;s!==null&&!Ow(s,l)&&console.error(FH(`${s}`,"Progress"));const c=Ow(s,l)?s:null,f=$u(c)?u(c,l):void 0;return n.jsx(LH,{scope:r,value:c,max:l,children:n.jsx(O2.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":$u(c)?c:void 0,"aria-valuetext":f,role:"progressbar","data-state":z2(c,l),"data-value":c??void 0,"data-max":l,...d,ref:t})})});B2.displayName=Xg;var F2="ProgressIndicator",$2=C.forwardRef((e,t)=>{const{__scopeProgress:r,...s}=e,o=IH(F2,r);return n.jsx(O2.div,{"data-state":z2(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...s,ref:t})});$2.displayName=F2;function OH(e,t){return`${Math.round(e/t*100)}%`}function z2(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function $u(e){return typeof e=="number"}function Iw(e){return $u(e)&&!isNaN(e)&&e>0}function Ow(e,t){return $u(e)&&!isNaN(e)&&e<=t&&e>=0}function BH(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Jg}\`.`}function FH(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2340
2340
|
- a positive number
|
|
2341
2341
|
- less than the value passed to \`max\` (or ${Jg} if no \`max\` prop is set)
|
|
2342
2342
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -2346,9 +2346,9 @@ Think of Coder Config as your **control center** for Claude Code (and other AI c
|
|
|
2346
2346
|
|
|
2347
2347
|
### How are you using Coder Config?
|
|
2348
2348
|
|
|
2349
|
-
**Desktop App** - Downloaded from [GitHub Releases](https://github.com/regression-io/
|
|
2349
|
+
**Desktop App** - Downloaded from [GitHub Releases](https://github.com/regression-io/coder-config/releases). No terminal needed!
|
|
2350
2350
|
|
|
2351
|
-
**npm Package** - Installed via \`npm install -g
|
|
2351
|
+
**npm Package** - Installed via \`npm install -g coder-config\` and running \`coder-config ui\`.
|
|
2352
2352
|
|
|
2353
2353
|
Both work identically - this tutorial applies to either.
|
|
2354
2354
|
|
|
@@ -3188,10 +3188,10 @@ Click **"Create MCP"** to build your own MCP server. Great for connecting Claude
|
|
|
3188
3188
|
|
|
3189
3189
|
**For CLI Users**
|
|
3190
3190
|
\`\`\`bash
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3191
|
+
coder-config ui # Start the UI
|
|
3192
|
+
coder-config ui stop # Stop the daemon
|
|
3193
|
+
coder-config apply # Apply config to current project
|
|
3194
|
+
coder-config --help # See all commands
|
|
3195
3195
|
\`\`\`
|
|
3196
3196
|
|
|
3197
3197
|
*Desktop app users: These commands are optional - the app handles everything automatically.*
|
|
@@ -3201,4 +3201,4 @@ claude-config --help # See all commands
|
|
|
3201
3201
|
Thanks for using Coder Config. We built this to make working with AI coding tools easier and more powerful.
|
|
3202
3202
|
|
|
3203
3203
|
Happy coding!
|
|
3204
|
-
`}},JH={...zH,...HH,...WH,...VH,...UH,...GH,...KH,...qH,...YH,...XH},au={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},Bw="claude-config-tutorial-visited";function QH(){const[e,t]=C.useState("intro"),[r,s]=C.useState({welcome:!0}),[o,u]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Bw)||"[]")}catch{return[]}}),d=C.useRef(null);C.useEffect(()=>{if(d.current){const y=d.current.querySelector("[data-radix-scroll-area-viewport]");y&&(y.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const y=[...o,e];u(y),localStorage.setItem(Bw,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=JH[e],f=za.flatMap(y=>y.subsections.length>0?y.subsections.map(j=>j.id):[y.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,x=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const y of za)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return za[0]})(),v=au[_.id]||au.welcome,b=y=>{for(const j of za){if(j.id===y)return j.title;const E=j.subsections.find(P=>P.id===y);if(E)return E.title}return""},g=y=>({__html:I2(y)});return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[n.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(ku,{className:"w-5 h-5 text-white"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[n.jsx("span",{children:"Progress"}),n.jsxs("span",{children:[w,"% complete"]})]}),n.jsx(W2,{value:w,className:"h-2"})]})]}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:za.map((y,j)=>{const E=y.icon,P=au[y.id]||au.welcome,T=e===y.id||y.subsections.some(R=>R.id===e),N=y.subsections.length>0?y.subsections.every(R=>o.includes(R.id)):o.includes(y.id);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",T&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),r[y.id]||t(y.subsections[0].id)):t(y.id)},children:[n.jsx("span",{className:je("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?n.jsx(Em,{className:"w-4 h-4"}):n.jsx(E,{className:je("w-4 h-4",!T&&P.text)})}),n.jsx("span",{className:je("flex-1",T&&"font-medium"),children:y.title}),y.subsections.length>0&&n.jsx(Kr,{className:je("w-4 h-4 text-muted-foreground transition-transform",r[y.id]&&"rotate-90")})]}),y.subsections.length>0&&r[y.id]&&n.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:y.subsections.map(R=>{const I=e===R.id,O=o.includes(R.id);return n.jsxs("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",I&&"bg-accent font-medium",I&&P.text),onClick:()=>t(R.id),children:[O&&!I&&n.jsx(Em,{className:"w-3 h-3 text-green-500"}),n.jsx("span",{className:je(!O&&!I&&"ml-5"),children:R.title})]},R.id)})})]},y.id)})})})]}),n.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:je("px-8 py-4 border-b border-border",v.light),children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[n.jsx("div",{className:je("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:n.jsx(_.icon,{className:"w-5 h-5"})}),n.jsxs("div",{children:[n.jsx("p",{className:je("text-sm font-medium",v.text),children:_.title}),n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),n.jsx(Nn,{className:"flex-1",ref:d,children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?n.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:bg-muted prose-pre:border prose-pre:border-border",dangerouslySetInnerHTML:g(c.content)}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(ku,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})}),n.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?n.jsxs(le,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[n.jsx(cM,{className:"w-4 h-4"}),n.jsx("span",{className:"max-w-[150px] truncate",children:b(h)})]}):n.jsx("div",{}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?n.jsxs(le,{onClick:()=>t(x),className:je("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[n.jsx("span",{className:"max-w-[150px] truncate",children:b(x)}),n.jsx(Hp,{className:"w-4 h-4"})]}):n.jsx(le,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const ZH=[{id:"projects",label:"All Projects",icon:Zs,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:si,section:"Projects"},{id:"registry",label:"MCP Registry",icon:ns,section:"Tools"},{id:"plugins",label:"Plugins",icon:Fi,section:"Tools"},{id:"memory",label:"Memory",icon:Ii,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:P1,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:as,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Ft,section:"Configuration"},{id:"codex-settings",label:"Codex CLI",icon:Ft,section:"Configuration",isNew:!0},{id:"antigravity-settings",label:"Antigravity",icon:wl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:Qn,section:"Developer"},{id:"preferences",label:"Preferences",icon:A1,section:"System"},{id:"tutorial",label:"Tutorial",icon:ku,section:"Help",isNew:!0},{id:"docs",label:"Docs & Help",icon:Li,section:"Help"}],Fw=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},eW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function tW(){const[e,t]=C.useState(()=>Fw("currentView","explorer")),[r,s]=C.useState(!0),[o,u]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[d,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[x,w]=C.useState([]),[k,_]=C.useState(null),[v,b]=C.useState(null),[g,y]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[P,T]=C.useState(""),[N,R]=C.useState(""),[I,O]=C.useState({}),[$,W]=C.useState(null),[Y,z]=C.useState(null),[K,G]=C.useState(!1),[U,L]=C.useState([]),[M,B]=C.useState(null),[q,F]=C.useState(!1),[oe,fe]=C.useState(null);C.useEffect(()=>{eW("currentView",e)},[e]);const me=C.useCallback(async()=>{try{const[re,de,De,Re,Ze]=await Promise.all([ke.getProject(),ke.getConfigs(),ke.getRegistry(),ke.getRules(),ke.getCommands()]);u(re),l(de),f(De),h(Re),w(Ze),de.length>0&&!k&&_(de[de.length-1])}catch(re){ee.error("Failed to load data: "+re.message)}finally{s(!1)}},[k]),X=C.useCallback(async(re=!1)=>{var de;try{const De=await ke.getProjects();L(De.projects||[]);const Re=(de=De.projects)==null?void 0:de.find(Ze=>Ze.isActive);if(B(Re||null),re&&Re){const Ze=await ke.getSubprojects(Re.path);fe({dir:Re.path,subprojects:Ze.subprojects||[]})}re&&!Re&&(Fw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),H=async re=>{try{const de=await ke.setActiveProject(re);de.success?(u({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),fe({dir:de.dir,subprojects:de.subprojects}),B(de.project),L(De=>De.map(Re=>({...Re,isActive:Re.id===re}))),await me(),ee.success(`Switched to ${de.project.name}`)):ee.error(de.error||"Failed to switch project")}catch(de){ee.error("Failed to switch project: "+de.message)}},ae=re=>{L(de=>[...de,{...re,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{me(),X(!0),ke.checkVersion().then(re=>{W(re==null?void 0:re.installedVersion),re!=null&&re.updateAvailable&&(re==null?void 0:re.updateMethod)==="npm"&&z(re)}).catch(()=>{})},[]);const ne=async()=>{if(Y!=null&&Y.updateAvailable){G(!0);try{const re=await ke.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath,targetVersion:Y.latestVersion});re.success?(ee.success(`Updated to v${re.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(ee.error("Update failed: "+re.error),G(!1))}catch(re){ee.error("Update failed: "+re.message),G(!1)}}};C.useEffect(()=>{const re=async()=>{try{const{hashes:De}=await ke.getFileHashes(),Re=I;(Object.keys(De).some(Se=>Re[Se]!==De[Se])||Object.keys(Re).some(Se=>!De[Se]))&&Object.keys(Re).length>0&&(ee.info("Files changed externally, reloading..."),await me()),O(De)}catch{}},de=setInterval(re,2e3);return re(),()=>clearInterval(de)},[I,me]);const J=new Set;d.forEach(re=>{var de,De;(((de=re.config)==null?void 0:de.include)||[]).forEach(Re=>J.add(Re)),Object.keys(((De=re.config)==null?void 0:De.mcpServers)||{}).forEach(Re=>J.add(Re))});const ie={mcps:J.size,rules:m.length,commands:x.length},ye=async()=>{try{const re=await ke.applyConfig(o.dir);if(re.tools){const de=Object.entries(re.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");de.length>0?ee.success(`Config applied to: ${de.join(", ")}`):ee.warning("No tools were updated")}else ee.success("Configuration applied successfully!")}catch(re){ee.error("Failed to apply config: "+re.message)}},Oe=async()=>{s(!0),await me(),ee.success("Data refreshed")};if(r)return n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"}),n.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ve=()=>{switch(e){case"explorer":return n.jsx(GF,{project:o,onRefresh:me});case"registry":return n.jsx(lH,{registry:c,searchQuery:P,setSearchQuery:T,onUpdate:me});case"plugins":return n.jsx(PH,{});case"memory":return n.jsx(cH,{project:o,onUpdate:me});case"create-mcp":return n.jsx(Fz,{project:o});case"claude-settings":return n.jsx(Cz,{});case"gemini-settings":return n.jsx(kz,{});case"codex-settings":return n.jsx(Oz,{});case"antigravity-settings":return n.jsx(Az,{});case"preferences":return n.jsx(Sz,{});case"projects":return n.jsx(uH,{onProjectSwitch:re=>{u({dir:re.dir,hierarchy:re.hierarchy,subprojects:re.subprojects}),fe({dir:re.dir,subprojects:re.subprojects}),me(),X()}});case"workstreams":return n.jsx(AH,{projects:U,onWorkstreamChange:re=>{ee.success(`Switched to workstream: ${re.name}`)}});case"docs":return n.jsx(NH,{});case"tutorial":return n.jsx(QH,{});default:return null}};return n.jsxs("div",{className:"min-h-screen bg-background",children:[n.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:n.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:n.jsx(kn,{className:"w-5 h-5 text-white"})}),n.jsx("div",{children:n.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",n.jsx("span",{className:"text-primary",children:"Config"})]})}),Y&&n.jsxs("button",{onClick:ne,disabled:K,className:"ml-3 px-2.5 py-1 text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 rounded-full flex items-center gap-1.5 transition-colors disabled:opacity-50",children:[K?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(bl,{className:"w-3 h-3"}),K?"Updating...":`Update to v${Y.latestVersion}`]})]}),n.jsx(Oj,{orientation:"vertical",className:"h-6"}),n.jsx(KF,{projects:U,activeProject:M,onSwitch:H,onAddClick:()=>F(!0),onManageClick:()=>t("projects")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(JF,{}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Oe,children:n.jsx(pr,{className:"w-4 h-4"})}),n.jsxs(le,{onClick:ye,variant:"ghost",size:"sm",className:"gap-2 text-muted-foreground hover:text-foreground",title:"Config auto-applies on save. Click to manually re-apply.",children:[n.jsx(wl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),n.jsxs("div",{className:"flex",children:[n.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[n.jsx(Nn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(re=>n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:re}),n.jsx("div",{className:"space-y-0.5",children:ZH.filter(de=>de.section===re).map(de=>{const De=de.icon,Re=e===de.id;return n.jsxs("button",{onClick:()=>t(de.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${Re?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[n.jsx(De,{className:"w-4 h-4"}),n.jsx("span",{className:"flex-1 text-left",children:de.label}),de.badge&&n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${Re?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ie[de.badge]}),de.isNew&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},de.id)})})]},re))}),n.jsx("div",{className:"px-4 py-3 border-t border-border",children:n.jsx("span",{className:"text-xs text-muted-foreground",children:$?`v${$}`:""})})]}),n.jsx("main",{className:je("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:n.jsx(Vw,{mode:"wait",children:n.jsx(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:["explorer","docs","tutorial"].includes(e)?"h-full":"",children:Ve()},e)})})]}),n.jsx(Mj,{open:q,onOpenChange:F,onAdded:ae}),n.jsx(qF,{onStartTutorial:()=>t("tutorial")})]})}function rW(){const[e,t]=C.useState(!1),[r,s]=C.useState(!1),[o,u]=C.useState(!1),d=C.useCallback(async()=>{s(!0);try{await ke.restartServer(),ee.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){ee.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{u(!0),t(!1),ee.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ke.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),n.jsx(YF,{children:n.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!r&&n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:d,children:[n.jsx(pr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),n.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:n.jsx(ei,{className:"w-4 h-4"})})]}),r&&n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[n.jsx(pr,{className:"w-4 h-4 animate-spin"}),n.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),n.jsx(tW,{}),n.jsx(yP,{position:"bottom-right",richColors:!0})]})})}GE.createRoot(document.getElementById("root")).render(n.jsx(rW,{}));
|
|
3204
|
+
`}},JH={...zH,...HH,...WH,...VH,...UH,...GH,...KH,...qH,...YH,...XH},au={welcome:{bg:"bg-violet-500",light:"bg-violet-100 dark:bg-violet-950",text:"text-violet-600 dark:text-violet-400"},"first-project":{bg:"bg-blue-500",light:"bg-blue-100 dark:bg-blue-950",text:"text-blue-600 dark:text-blue-400"},"rules-guide":{bg:"bg-emerald-500",light:"bg-emerald-100 dark:bg-emerald-950",text:"text-emerald-600 dark:text-emerald-400"},"mcp-guide":{bg:"bg-orange-500",light:"bg-orange-100 dark:bg-orange-950",text:"text-orange-600 dark:text-orange-400"},"permissions-guide":{bg:"bg-green-500",light:"bg-green-100 dark:bg-green-950",text:"text-green-600 dark:text-green-400"},"memory-guide":{bg:"bg-pink-500",light:"bg-pink-100 dark:bg-pink-950",text:"text-pink-600 dark:text-pink-400"},"plugins-guide":{bg:"bg-purple-500",light:"bg-purple-100 dark:bg-purple-950",text:"text-purple-600 dark:text-purple-400"},"workstreams-guide":{bg:"bg-cyan-500",light:"bg-cyan-100 dark:bg-cyan-950",text:"text-cyan-600 dark:text-cyan-400"},"multi-tool-guide":{bg:"bg-amber-500",light:"bg-amber-100 dark:bg-amber-950",text:"text-amber-600 dark:text-amber-400"},"next-steps":{bg:"bg-rose-500",light:"bg-rose-100 dark:bg-rose-950",text:"text-rose-600 dark:text-rose-400"}},Bw="claude-config-tutorial-visited";function QH(){const[e,t]=C.useState("intro"),[r,s]=C.useState({welcome:!0}),[o,u]=C.useState(()=>{try{return JSON.parse(localStorage.getItem(Bw)||"[]")}catch{return[]}}),d=C.useRef(null);C.useEffect(()=>{if(d.current){const y=d.current.querySelector("[data-radix-scroll-area-viewport]");y&&(y.scrollTop=0)}},[e]),C.useEffect(()=>{if(e&&!o.includes(e)){const y=[...o,e];u(y),localStorage.setItem(Bw,JSON.stringify(y))}},[e,o]);const l=y=>{s(j=>({...j,[y]:!j[y]}))},c=JH[e],f=za.flatMap(y=>y.subsections.length>0?y.subsections.map(j=>j.id):[y.id]),m=f.indexOf(e),h=m>0?f[m-1]:null,x=m<f.length-1?f[m+1]:null,w=Math.round(o.length/f.length*100),_=(()=>{for(const y of za)if(y.id===e||y.subsections.some(j=>j.id===e))return y;return za[0]})(),v=au[_.id]||au.welcome,b=y=>{for(const j of za){if(j.id===y)return j.title;const E=j.subsections.find(P=>P.id===y);if(E)return E.title}return""},g=y=>({__html:I2(y)});return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-72 border-r border-border bg-muted/30 flex flex-col",children:[n.jsxs("div",{className:"p-4 border-b border-border bg-gradient-to-r from-indigo-500/10 to-purple-500/10",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(ku,{className:"w-5 h-5 text-white"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"font-semibold text-foreground",children:"Tutorial"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Step-by-step guide"})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground mb-1",children:[n.jsx("span",{children:"Progress"}),n.jsxs("span",{children:[w,"% complete"]})]}),n.jsx(W2,{value:w,className:"h-2"})]})]}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:za.map((y,j)=>{const E=y.icon,P=au[y.id]||au.welcome,T=e===y.id||y.subsections.some(R=>R.id===e),N=y.subsections.length>0?y.subsections.every(R=>o.includes(R.id)):o.includes(y.id);return n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg hover:bg-accent text-left transition-all",T&&"bg-accent"),onClick:()=>{y.subsections.length>0?(l(y.id),r[y.id]||t(y.subsections[0].id)):t(y.id)},children:[n.jsx("span",{className:je("w-7 h-7 rounded-lg flex items-center justify-center transition-colors",T?P.bg+" text-white":P.light),children:N?n.jsx(Em,{className:"w-4 h-4"}):n.jsx(E,{className:je("w-4 h-4",!T&&P.text)})}),n.jsx("span",{className:je("flex-1",T&&"font-medium"),children:y.title}),y.subsections.length>0&&n.jsx(Kr,{className:je("w-4 h-4 text-muted-foreground transition-transform",r[y.id]&&"rotate-90")})]}),y.subsections.length>0&&r[y.id]&&n.jsx("div",{className:"ml-4 mt-1 space-y-0.5 border-l-2 border-border pl-3",children:y.subsections.map(R=>{const I=e===R.id,O=o.includes(R.id);return n.jsxs("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground flex items-center gap-2",I&&"bg-accent font-medium",I&&P.text),onClick:()=>t(R.id),children:[O&&!I&&n.jsx(Em,{className:"w-3 h-3 text-green-500"}),n.jsx("span",{className:je(!O&&!I&&"ml-5"),children:R.title})]},R.id)})})]},y.id)})})})]}),n.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[n.jsx("div",{className:je("px-8 py-4 border-b border-border",v.light),children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-3",children:[n.jsx("div",{className:je("w-10 h-10 rounded-xl flex items-center justify-center",v.bg,"text-white"),children:n.jsx(_.icon,{className:"w-5 h-5"})}),n.jsxs("div",{children:[n.jsx("p",{className:je("text-sm font-medium",v.text),children:_.title}),n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:(c==null?void 0:c.title)||b(e)})]})]})}),n.jsx(Nn,{className:"flex-1",ref:d,children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:c?n.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-headings:text-foreground prose-p:text-muted-foreground prose-strong:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-pre:bg-muted prose-pre:border prose-pre:border-border",dangerouslySetInnerHTML:g(c.content)}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(ku,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})}),n.jsx("div",{className:"border-t border-border p-4 bg-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[h?n.jsxs(le,{variant:"ghost",onClick:()=>t(h),className:"flex items-center gap-2",children:[n.jsx(cM,{className:"w-4 h-4"}),n.jsx("span",{className:"max-w-[150px] truncate",children:b(h)})]}):n.jsx("div",{}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[m+1," of ",f.length]}),x?n.jsxs(le,{onClick:()=>t(x),className:je("flex items-center gap-2",v.bg,"hover:opacity-90"),children:[n.jsx("span",{className:"max-w-[150px] truncate",children:b(x)}),n.jsx(Hp,{className:"w-4 h-4"})]}):n.jsx(le,{variant:"outline",onClick:()=>t("intro"),className:"flex items-center gap-2",children:"Start Over"})]})})]})]})}const ZH=[{id:"projects",label:"All Projects",icon:Zs,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:si,section:"Projects"},{id:"registry",label:"MCP Registry",icon:ns,section:"Tools"},{id:"plugins",label:"Plugins",icon:Fi,section:"Tools"},{id:"memory",label:"Memory",icon:Ii,section:"Tools"},{id:"workstreams",label:"Workstreams",icon:P1,section:"Tools"},{id:"claude-settings",label:"Claude Code",icon:as,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:Ft,section:"Configuration"},{id:"codex-settings",label:"Codex CLI",icon:Ft,section:"Configuration",isNew:!0},{id:"antigravity-settings",label:"Antigravity",icon:wl,section:"Configuration"},{id:"create-mcp",label:"Create MCP",icon:Qn,section:"Developer"},{id:"preferences",label:"Preferences",icon:A1,section:"System"},{id:"tutorial",label:"Tutorial",icon:ku,section:"Help",isNew:!0},{id:"docs",label:"Docs & Help",icon:Li,section:"Help"}],Fw=(e,t)=>{try{const r=localStorage.getItem(`claude-config-${e}`);return r?JSON.parse(r):t}catch{return t}},eW=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function tW(){const[e,t]=C.useState(()=>Fw("currentView","explorer")),[r,s]=C.useState(!0),[o,u]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[d,l]=C.useState([]),[c,f]=C.useState({mcpServers:{}}),[m,h]=C.useState([]),[x,w]=C.useState([]),[k,_]=C.useState(null),[v,b]=C.useState(null),[g,y]=C.useState(!1),[j,E]=C.useState({title:"",type:""}),[P,T]=C.useState(""),[N,R]=C.useState(""),[I,O]=C.useState({}),[$,W]=C.useState(null),[Y,z]=C.useState(null),[K,G]=C.useState(!1),[U,L]=C.useState([]),[M,B]=C.useState(null),[q,F]=C.useState(!1),[oe,fe]=C.useState(null);C.useEffect(()=>{eW("currentView",e)},[e]);const me=C.useCallback(async()=>{try{const[te,de,De,Re,Ze]=await Promise.all([ke.getProject(),ke.getConfigs(),ke.getRegistry(),ke.getRules(),ke.getCommands()]);u(te),l(de),f(De),h(Re),w(Ze),de.length>0&&!k&&_(de[de.length-1])}catch(te){ee.error("Failed to load data: "+te.message)}finally{s(!1)}},[k]),X=C.useCallback(async(te=!1)=>{var de;try{const De=await ke.getProjects();L(De.projects||[]);const Re=(de=De.projects)==null?void 0:de.find(Ze=>Ze.isActive);if(B(Re||null),te&&Re){const Ze=await ke.getSubprojects(Re.path);fe({dir:Re.path,subprojects:Ze.subprojects||[]})}te&&!Re&&(Fw("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),H=async te=>{try{const de=await ke.setActiveProject(te);de.success?(u({dir:de.dir,hierarchy:de.hierarchy,subprojects:de.subprojects}),fe({dir:de.dir,subprojects:de.subprojects}),B(de.project),L(De=>De.map(Re=>({...Re,isActive:Re.id===te}))),await me(),ee.success(`Switched to ${de.project.name}`)):ee.error(de.error||"Failed to switch project")}catch(de){ee.error("Failed to switch project: "+de.message)}},ae=te=>{L(de=>[...de,{...te,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{me(),X(!0),ke.checkVersion().then(te=>{W(te==null?void 0:te.installedVersion),te!=null&&te.updateAvailable&&(te==null?void 0:te.updateMethod)==="npm"&&z(te)}).catch(()=>{})},[]);const ne=async()=>{if(Y!=null&&Y.updateAvailable){G(!0);try{const te=await ke.performUpdate({updateMethod:Y.updateMethod,sourcePath:Y.sourcePath,targetVersion:Y.latestVersion});te.success?(ee.success(`Updated to v${te.newVersion}! Run: coder-config ui stop && coder-config ui`),z(null),W(te.newVersion)):ee.error("Update failed: "+te.error),G(!1)}catch(te){ee.error("Update failed: "+te.message),G(!1)}}};C.useEffect(()=>{const te=async()=>{try{const{hashes:De}=await ke.getFileHashes(),Re=I;(Object.keys(De).some(Se=>Re[Se]!==De[Se])||Object.keys(Re).some(Se=>!De[Se]))&&Object.keys(Re).length>0&&(ee.info("Files changed externally, reloading..."),await me()),O(De)}catch{}},de=setInterval(te,2e3);return te(),()=>clearInterval(de)},[I,me]);const J=new Set;d.forEach(te=>{var de,De;(((de=te.config)==null?void 0:de.include)||[]).forEach(Re=>J.add(Re)),Object.keys(((De=te.config)==null?void 0:De.mcpServers)||{}).forEach(Re=>J.add(Re))});const ie={mcps:J.size,rules:m.length,commands:x.length},ye=async()=>{try{const te=await ke.applyConfig(o.dir);if(te.tools){const de=Object.entries(te.tools).filter(([,De])=>De).map(([De])=>De==="claude"?"Claude Code":"Antigravity");de.length>0?ee.success(`Config applied to: ${de.join(", ")}`):ee.warning("No tools were updated")}else ee.success("Configuration applied successfully!")}catch(te){ee.error("Failed to apply config: "+te.message)}},Oe=async()=>{s(!0),await me(),ee.success("Data refreshed")};if(r)return n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"}),n.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const Ve=()=>{switch(e){case"explorer":return n.jsx(GF,{project:o,onRefresh:me});case"registry":return n.jsx(lH,{registry:c,searchQuery:P,setSearchQuery:T,onUpdate:me});case"plugins":return n.jsx(PH,{});case"memory":return n.jsx(cH,{project:o,onUpdate:me});case"create-mcp":return n.jsx(Fz,{project:o});case"claude-settings":return n.jsx(Cz,{});case"gemini-settings":return n.jsx(kz,{});case"codex-settings":return n.jsx(Oz,{});case"antigravity-settings":return n.jsx(Az,{});case"preferences":return n.jsx(Sz,{});case"projects":return n.jsx(uH,{onProjectSwitch:te=>{u({dir:te.dir,hierarchy:te.hierarchy,subprojects:te.subprojects}),fe({dir:te.dir,subprojects:te.subprojects}),me(),X()}});case"workstreams":return n.jsx(AH,{projects:U,onWorkstreamChange:te=>{ee.success(`Switched to workstream: ${te.name}`)}});case"docs":return n.jsx(NH,{});case"tutorial":return n.jsx(QH,{});default:return null}};return n.jsxs("div",{className:"min-h-screen bg-background",children:[n.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:n.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:n.jsx(kn,{className:"w-5 h-5 text-white"})}),n.jsx("div",{children:n.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Coder ",n.jsx("span",{className:"text-primary",children:"Config"})]})}),Y&&n.jsxs("button",{onClick:ne,disabled:K,className:"ml-3 px-2.5 py-1 text-xs font-medium bg-green-100 text-green-700 hover:bg-green-200 rounded-full flex items-center gap-1.5 transition-colors disabled:opacity-50",children:[K?n.jsx(ut,{className:"w-3 h-3 animate-spin"}):n.jsx(bl,{className:"w-3 h-3"}),K?"Updating...":`Update to v${Y.latestVersion}`]})]}),n.jsx(Oj,{orientation:"vertical",className:"h-6"}),n.jsx(KF,{projects:U,activeProject:M,onSwitch:H,onAddClick:()=>F(!0),onManageClick:()=>t("projects")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(JF,{}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Oe,children:n.jsx(pr,{className:"w-4 h-4"})}),n.jsxs(le,{onClick:ye,variant:"ghost",size:"sm",className:"gap-2 text-muted-foreground hover:text-foreground",title:"Config auto-applies on save. Click to manually re-apply.",children:[n.jsx(wl,{className:"w-4 h-4"}),"Re-apply"]})]})]})}),n.jsxs("div",{className:"flex",children:[n.jsxs("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16 flex flex-col",children:[n.jsx(Nn,{className:"flex-1 py-4",children:["Projects","Tools","Configuration","Developer","System","Help"].map(te=>n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:te}),n.jsx("div",{className:"space-y-0.5",children:ZH.filter(de=>de.section===te).map(de=>{const De=de.icon,Re=e===de.id;return n.jsxs("button",{onClick:()=>t(de.id),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-all duration-200 border-l-2 ${Re?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[n.jsx(De,{className:"w-4 h-4"}),n.jsx("span",{className:"flex-1 text-left",children:de.label}),de.badge&&n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${Re?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:ie[de.badge]}),de.isNew&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"})]},de.id)})})]},te))}),n.jsx("div",{className:"px-4 py-3 border-t border-border",children:n.jsx("span",{className:"text-xs text-muted-foreground",children:$?`v${$}`:""})})]}),n.jsx("main",{className:je("flex-1 overflow-auto",["explorer","docs","tutorial"].includes(e)?"h-[calc(100vh-64px)]":"p-6"),children:n.jsx(Vw,{mode:"wait",children:n.jsx(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:["explorer","docs","tutorial"].includes(e)?"h-full":"",children:Ve()},e)})})]}),n.jsx(Mj,{open:q,onOpenChange:F,onAdded:ae}),n.jsx(qF,{onStartTutorial:()=>t("tutorial")})]})}function rW(){const[e,t]=C.useState(!1),[r,s]=C.useState(!1),[o,u]=C.useState(!1),d=C.useCallback(async()=>{s(!0);try{await ke.restartServer(),ee.info("Server restarting... page will reload."),setTimeout(()=>{window.location.reload()},2e3)}catch(c){ee.error("Failed to restart: "+c.message),s(!1)}},[]),l=C.useCallback(()=>{u(!0),t(!1),ee.dismiss("update-available")},[]);return C.useEffect(()=>{let c;const f=async()=>{try{const m=await ke.getVersion();console.log("[Update Check]",m),m.needsRestart&&!o&&t(!0)}catch{}};return f(),c=setInterval(f,3e4),()=>clearInterval(c)},[o]),n.jsx(YF,{children:n.jsxs("div",{className:"min-h-screen bg-background",children:[e&&!r&&n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-blue-600 text-white px-4 py-2 flex items-center justify-center gap-2 shadow-lg cursor-pointer hover:bg-blue-700 transition-colors",onClick:d,children:[n.jsx(pr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm font-medium",children:"Update available — click to restart"}),n.jsx("button",{onClick:c=>{c.stopPropagation(),l()},className:"absolute right-3 p-1 hover:bg-blue-500 rounded",children:n.jsx(ei,{className:"w-4 h-4"})})]}),r&&n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-600 text-white px-4 py-2 flex items-center justify-center gap-2",children:[n.jsx(pr,{className:"w-4 h-4 animate-spin"}),n.jsx("span",{className:"text-sm font-medium",children:"Restarting server..."})]}),n.jsx(tW,{}),n.jsx(yP,{position:"bottom-right",richColors:!0})]})})}GE.createRoot(document.getElementById("root")).render(n.jsx(rW,{}));
|