@regression-io/claude-config 0.21.8 → 0.21.11
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 +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/index-DSNqWjp6.js +1771 -0
- package/ui/dist/assets/index-O8m4abTX.css +32 -0
- package/ui/dist/index.html +2 -2
- package/ui/server.cjs +147 -0
- package/ui/dist/assets/index-DUrG0pq3.css +0 -32
- package/ui/dist/assets/index-j2NN7tu-.js +0 -1766
|
@@ -0,0 +1,1771 @@
|
|
|
1
|
+
function S2(e,t){for(var s=0;s<t.length;s++){const o=t[s];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const m=Object.getOwnPropertyDescriptor(o,l);m&&Object.defineProperty(e,l,m.get?m:{enumerable:!0,get:()=>o[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const m of l)if(m.type==="childList")for(const f of m.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(l){const m={};return l.integrity&&(m.integrity=l.integrity),l.referrerPolicy&&(m.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?m.credentials="include":l.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(l){if(l.ep)return;l.ep=!0;const m=s(l);fetch(l.href,m)}})();function mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qu={exports:{}},Ko={},Yu={exports:{}},Ue={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Lv;function C2(){if(Lv)return Ue;Lv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),f=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),d=Symbol.iterator;function _(L){return L===null||typeof L!="object"?null:(L=d&&L[d]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,b={};function v(L,z,ee){this.props=L,this.context=z,this.refs=b,this.updater=ee||S}v.prototype.isReactComponent={},v.prototype.setState=function(L,z){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,z,"setState")},v.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function y(){}y.prototype=v.prototype;function p(L,z,ee){this.props=L,this.context=z,this.refs=b,this.updater=ee||S}var x=p.prototype=new y;x.constructor=p,E(x,v.prototype),x.isPureReactComponent=!0;var k=Array.isArray,P=Object.prototype.hasOwnProperty,T={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function j(L,z,ee){var ne,ce={},de=null,G=null;if(z!=null)for(ne in z.ref!==void 0&&(G=z.ref),z.key!==void 0&&(de=""+z.key),z)P.call(z,ne)&&!R.hasOwnProperty(ne)&&(ce[ne]=z[ne]);var O=arguments.length-2;if(O===1)ce.children=ee;else if(1<O){for(var Z=Array(O),X=0;X<O;X++)Z[X]=arguments[X+2];ce.children=Z}if(L&&L.defaultProps)for(ne in O=L.defaultProps,O)ce[ne]===void 0&&(ce[ne]=O[ne]);return{$$typeof:e,type:L,key:de,ref:G,props:ce,_owner:T.current}}function M(L,z){return{$$typeof:e,type:L.type,key:z,ref:L.ref,props:L.props,_owner:L._owner}}function $(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function F(L){var z={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ee){return z[ee]})}var U=/\/+/g;function H(L,z){return typeof L=="object"&&L!==null&&L.key!=null?F(""+L.key):z.toString(36)}function Q(L,z,ee,ne,ce){var de=typeof L;(de==="undefined"||de==="boolean")&&(L=null);var G=!1;if(L===null)G=!0;else switch(de){case"string":case"number":G=!0;break;case"object":switch(L.$$typeof){case e:case t:G=!0}}if(G)return G=L,ce=ce(G),L=ne===""?"."+H(G,0):ne,k(ce)?(ee="",L!=null&&(ee=L.replace(U,"$&/")+"/"),Q(ce,z,ee,"",function(X){return X})):ce!=null&&($(ce)&&(ce=M(ce,ee+(!ce.key||G&&G.key===ce.key?"":(""+ce.key).replace(U,"$&/")+"/")+L)),z.push(ce)),1;if(G=0,ne=ne===""?".":ne+":",k(L))for(var O=0;O<L.length;O++){de=L[O];var Z=ne+H(de,O);G+=Q(de,z,ee,Z,ce)}else if(Z=_(L),typeof Z=="function")for(L=Z.call(L),O=0;!(de=L.next()).done;)de=de.value,Z=ne+H(de,O++),G+=Q(de,z,ee,Z,ce);else if(de==="object")throw z=String(L),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return G}function V(L,z,ee){if(L==null)return L;var ne=[],ce=0;return Q(L,ne,"","",function(de){return z.call(ee,de,ce++)}),ne}function K(L){if(L._status===-1){var z=L._result;z=z(),z.then(function(ee){(L._status===0||L._status===-1)&&(L._status=1,L._result=ee)},function(ee){(L._status===0||L._status===-1)&&(L._status=2,L._result=ee)}),L._status===-1&&(L._status=0,L._result=z)}if(L._status===1)return L._result.default;throw L._result}var J={current:null},W={transition:null},D={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:W,ReactCurrentOwner:T};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ue.Children={map:V,forEach:function(L,z,ee){V(L,function(){z.apply(this,arguments)},ee)},count:function(L){var z=0;return V(L,function(){z++}),z},toArray:function(L){return V(L,function(z){return z})||[]},only:function(L){if(!$(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},Ue.Component=v,Ue.Fragment=s,Ue.Profiler=l,Ue.PureComponent=p,Ue.StrictMode=o,Ue.Suspense=c,Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,Ue.act=B,Ue.cloneElement=function(L,z,ee){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var ne=E({},L.props),ce=L.key,de=L.ref,G=L._owner;if(z!=null){if(z.ref!==void 0&&(de=z.ref,G=T.current),z.key!==void 0&&(ce=""+z.key),L.type&&L.type.defaultProps)var O=L.type.defaultProps;for(Z in z)P.call(z,Z)&&!R.hasOwnProperty(Z)&&(ne[Z]=z[Z]===void 0&&O!==void 0?O[Z]:z[Z])}var Z=arguments.length-2;if(Z===1)ne.children=ee;else if(1<Z){O=Array(Z);for(var X=0;X<Z;X++)O[X]=arguments[X+2];ne.children=O}return{$$typeof:e,type:L.type,key:ce,ref:de,props:ne,_owner:G}},Ue.createContext=function(L){return L={$$typeof:f,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:m,_context:L},L.Consumer=L},Ue.createElement=j,Ue.createFactory=function(L){var z=j.bind(null,L);return z.type=L,z},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(L){return{$$typeof:a,render:L}},Ue.isValidElement=$,Ue.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:K}},Ue.memo=function(L,z){return{$$typeof:h,type:L,compare:z===void 0?null:z}},Ue.startTransition=function(L){var z=W.transition;W.transition={};try{L()}finally{W.transition=z}},Ue.unstable_act=B,Ue.useCallback=function(L,z){return J.current.useCallback(L,z)},Ue.useContext=function(L){return J.current.useContext(L)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(L){return J.current.useDeferredValue(L)},Ue.useEffect=function(L,z){return J.current.useEffect(L,z)},Ue.useId=function(){return J.current.useId()},Ue.useImperativeHandle=function(L,z,ee){return J.current.useImperativeHandle(L,z,ee)},Ue.useInsertionEffect=function(L,z){return J.current.useInsertionEffect(L,z)},Ue.useLayoutEffect=function(L,z){return J.current.useLayoutEffect(L,z)},Ue.useMemo=function(L,z){return J.current.useMemo(L,z)},Ue.useReducer=function(L,z,ee){return J.current.useReducer(L,z,ee)},Ue.useRef=function(L){return J.current.useRef(L)},Ue.useState=function(L){return J.current.useState(L)},Ue.useSyncExternalStore=function(L,z,ee){return J.current.useSyncExternalStore(L,z,ee)},Ue.useTransition=function(){return J.current.useTransition()},Ue.version="18.3.1",Ue}var Ov;function gf(){return Ov||(Ov=1,Yu.exports=C2()),Yu.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Iv;function k2(){if(Iv)return Ko;Iv=1;var e=gf(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function f(a,c,h){var g,d={},_=null,S=null;h!==void 0&&(_=""+h),c.key!==void 0&&(_=""+c.key),c.ref!==void 0&&(S=c.ref);for(g in c)o.call(c,g)&&!m.hasOwnProperty(g)&&(d[g]=c[g]);if(a&&a.defaultProps)for(g in c=a.defaultProps,c)d[g]===void 0&&(d[g]=c[g]);return{$$typeof:t,type:a,key:_,ref:S,props:d,_owner:l.current}}return Ko.Fragment=s,Ko.jsx=f,Ko.jsxs=f,Ko}var Bv;function E2(){return Bv||(Bv=1,qu.exports=k2()),qu.exports}var i=E2(),C=gf();const ve=mf(C),vf=S2({__proto__:null,default:ve},[C]);var $l={},Xu={exports:{}},hr={},Ju={exports:{}},Qu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Fv;function j2(){return Fv||(Fv=1,(function(e){function t(W,D){var B=W.length;W.push(D);e:for(;0<B;){var L=B-1>>>1,z=W[L];if(0<l(z,D))W[L]=D,W[B]=z,B=L;else break e}}function s(W){return W.length===0?null:W[0]}function o(W){if(W.length===0)return null;var D=W[0],B=W.pop();if(B!==D){W[0]=B;e:for(var L=0,z=W.length,ee=z>>>1;L<ee;){var ne=2*(L+1)-1,ce=W[ne],de=ne+1,G=W[de];if(0>l(ce,B))de<z&&0>l(G,ce)?(W[L]=G,W[de]=B,L=de):(W[L]=ce,W[ne]=B,L=ne);else if(de<z&&0>l(G,B))W[L]=G,W[de]=B,L=de;else break e}}return D}function l(W,D){var B=W.sortIndex-D.sortIndex;return B!==0?B:W.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;e.unstable_now=function(){return m.now()}}else{var f=Date,a=f.now();e.unstable_now=function(){return f.now()-a}}var c=[],h=[],g=1,d=null,_=3,S=!1,E=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(W){for(var D=s(h);D!==null;){if(D.callback===null)o(h);else if(D.startTime<=W)o(h),D.sortIndex=D.expirationTime,t(c,D);else break;D=s(h)}}function k(W){if(b=!1,x(W),!E)if(s(c)!==null)E=!0,K(P);else{var D=s(h);D!==null&&J(k,D.startTime-W)}}function P(W,D){E=!1,b&&(b=!1,y(j),j=-1),S=!0;var B=_;try{for(x(D),d=s(c);d!==null&&(!(d.expirationTime>D)||W&&!F());){var L=d.callback;if(typeof L=="function"){d.callback=null,_=d.priorityLevel;var z=L(d.expirationTime<=D);D=e.unstable_now(),typeof z=="function"?d.callback=z:d===s(c)&&o(c),x(D)}else o(c);d=s(c)}if(d!==null)var ee=!0;else{var ne=s(h);ne!==null&&J(k,ne.startTime-D),ee=!1}return ee}finally{d=null,_=B,S=!1}}var T=!1,R=null,j=-1,M=5,$=-1;function F(){return!(e.unstable_now()-$<M)}function U(){if(R!==null){var W=e.unstable_now();$=W;var D=!0;try{D=R(!0,W)}finally{D?H():(T=!1,R=null)}}else T=!1}var H;if(typeof p=="function")H=function(){p(U)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,V=Q.port2;Q.port1.onmessage=U,H=function(){V.postMessage(null)}}else H=function(){v(U,0)};function K(W){R=W,T||(T=!0,H())}function J(W,D){j=v(function(){W(e.unstable_now())},D)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_continueExecution=function(){E||S||(E=!0,K(P))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return s(c)},e.unstable_next=function(W){switch(_){case 1:case 2:case 3:var D=3;break;default:D=_}var B=_;_=D;try{return W()}finally{_=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,D){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var B=_;_=W;try{return D()}finally{_=B}},e.unstable_scheduleCallback=function(W,D,B){var L=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?L+B:L):B=L,W){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=B+z,W={id:g++,callback:D,priorityLevel:W,startTime:B,expirationTime:z,sortIndex:-1},B>L?(W.sortIndex=B,t(h,W),s(c)===null&&W===s(h)&&(b?(y(j),j=-1):b=!0,J(k,B-L))):(W.sortIndex=z,t(c,W),E||S||(E=!0,K(P))),W},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(W){var D=_;return function(){var B=_;_=D;try{return W.apply(this,arguments)}finally{_=B}}}})(Qu)),Qu}var $v;function N2(){return $v||($v=1,Ju.exports=j2()),Ju.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Hv;function P2(){if(Hv)return hr;Hv=1;var e=gf(),t=N2();function s(r){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)n+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,l={};function m(r,n){f(r,n),f(r+"Capture",n)}function f(r,n){for(l[r]=n,r=0;r<n.length;r++)o.add(n[r])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},d={};function _(r){return c.call(d,r)?!0:c.call(g,r)?!1:h.test(r)?d[r]=!0:(g[r]=!0,!1)}function S(r,n,u,w){if(u!==null&&u.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return w?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function E(r,n,u,w){if(n===null||typeof n>"u"||S(r,n,u,w))return!0;if(w)return!1;if(u!==null)switch(u.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function b(r,n,u,w,N,A,I){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=w,this.attributeNamespace=N,this.mustUseProperty=u,this.propertyName=r,this.type=n,this.sanitizeURL=A,this.removeEmptyString=I}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){v[r]=new b(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var n=r[0];v[n]=new b(n,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){v[r]=new b(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){v[r]=new b(r,2,!1,r,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(r){v[r]=new b(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){v[r]=new b(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){v[r]=new b(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){v[r]=new b(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){v[r]=new b(r,5,!1,r.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function p(r){return r[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(r){var n=r.replace(y,p);v[n]=new b(n,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var n=r.replace(y,p);v[n]=new b(n,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var n=r.replace(y,p);v[n]=new b(n,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){v[r]=new b(r,1,!1,r.toLowerCase(),null,!1,!1)}),v.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){v[r]=new b(r,1,!1,r.toLowerCase(),null,!0,!0)});function x(r,n,u,w){var N=v.hasOwnProperty(n)?v[n]:null;(N!==null?N.type!==0:w||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(E(n,u,N,w)&&(u=null),w||N===null?_(n)&&(u===null?r.removeAttribute(n):r.setAttribute(n,""+u)):N.mustUseProperty?r[N.propertyName]=u===null?N.type===3?!1:"":u:(n=N.attributeName,w=N.attributeNamespace,u===null?r.removeAttribute(n):(N=N.type,u=N===3||N===4&&u===!0?"":""+u,w?r.setAttributeNS(w,n,u):r.setAttribute(n,u))))}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),F=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),W=Symbol.iterator;function D(r){return r===null||typeof r!="object"?null:(r=W&&r[W]||r["@@iterator"],typeof r=="function"?r:null)}var B=Object.assign,L;function z(r){if(L===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);L=n&&n[1]||""}return`
|
|
34
|
+
`+L+r}var ee=!1;function ne(r,n){if(!r||ee)return"";ee=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ae){var w=ae}Reflect.construct(r,[],n)}else{try{n.call()}catch(ae){w=ae}r.call(n.prototype)}else{try{throw Error()}catch(ae){w=ae}r()}}catch(ae){if(ae&&w&&typeof ae.stack=="string"){for(var N=ae.stack.split(`
|
|
35
|
+
`),A=w.stack.split(`
|
|
36
|
+
`),I=N.length-1,Y=A.length-1;1<=I&&0<=Y&&N[I]!==A[Y];)Y--;for(;1<=I&&0<=Y;I--,Y--)if(N[I]!==A[Y]){if(I!==1||Y!==1)do if(I--,Y--,0>Y||N[I]!==A[Y]){var te=`
|
|
37
|
+
`+N[I].replace(" at new "," at ");return r.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",r.displayName)),te}while(1<=I&&0<=Y);break}}}finally{ee=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?z(r):""}function ce(r){switch(r.tag){case 5:return z(r.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return r=ne(r.type,!1),r;case 11:return r=ne(r.type.render,!1),r;case 1:return r=ne(r.type,!0),r;default:return""}}function de(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case T:return"Portal";case M:return"Profiler";case j:return"StrictMode";case H:return"Suspense";case Q:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case F:return(r.displayName||"Context")+".Consumer";case $:return(r._context.displayName||"Context")+".Provider";case U:var n=r.render;return r=r.displayName,r||(r=n.displayName||n.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case V:return n=r.displayName||null,n!==null?n:de(r.type)||"Memo";case K:n=r._payload,r=r._init;try{return de(r(n))}catch{}}return null}function G(r){var n=r.type;switch(r.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=n.render,r=r.displayName||r.name||"",n.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(n);case 8:return n===j?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function O(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Z(r){var n=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function X(r){var n=Z(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,n),w=""+r[n];if(!r.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var N=u.get,A=u.set;return Object.defineProperty(r,n,{configurable:!0,get:function(){return N.call(this)},set:function(I){w=""+I,A.call(this,I)}}),Object.defineProperty(r,n,{enumerable:u.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){r._valueTracker=null,delete r[n]}}}}function q(r){r._valueTracker||(r._valueTracker=X(r))}function re(r){if(!r)return!1;var n=r._valueTracker;if(!n)return!0;var u=n.getValue(),w="";return r&&(w=Z(r)?r.checked?"true":"false":r.value),r=w,r!==u?(n.setValue(r),!0):!1}function he(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Te(r,n){var u=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function Be(r,n){var u=n.defaultValue==null?"":n.defaultValue,w=n.checked!=null?n.checked:n.defaultChecked;u=O(n.value!=null?n.value:u),r._wrapperState={initialChecked:w,initialValue:u,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Ke(r,n){n=n.checked,n!=null&&x(r,"checked",n,!1)}function je(r,n){Ke(r,n);var u=O(n.value),w=n.type;if(u!=null)w==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(w==="submit"||w==="reset"){r.removeAttribute("value");return}n.hasOwnProperty("value")?et(r,n.type,u):n.hasOwnProperty("defaultValue")&&et(r,n.type,O(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(r.defaultChecked=!!n.defaultChecked)}function zt(r,n,u){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var w=n.type;if(!(w!=="submit"&&w!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+r._wrapperState.initialValue,u||n===r.value||(r.value=n),r.defaultValue=n}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function et(r,n,u){(n!=="number"||he(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Ae=Array.isArray;function De(r,n,u,w){if(r=r.options,n){n={};for(var N=0;N<u.length;N++)n["$"+u[N]]=!0;for(u=0;u<r.length;u++)N=n.hasOwnProperty("$"+r[u].value),r[u].selected!==N&&(r[u].selected=N),N&&w&&(r[u].defaultSelected=!0)}else{for(u=""+O(u),n=null,N=0;N<r.length;N++){if(r[N].value===u){r[N].selected=!0,w&&(r[N].defaultSelected=!0);return}n!==null||r[N].disabled||(n=r[N])}n!==null&&(n.selected=!0)}}function Fe(r,n){if(n.dangerouslySetInnerHTML!=null)throw Error(s(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function He(r,n){var u=n.value;if(u==null){if(u=n.children,n=n.defaultValue,u!=null){if(n!=null)throw Error(s(92));if(Ae(u)){if(1<u.length)throw Error(s(93));u=u[0]}n=u}n==null&&(n=""),u=n}r._wrapperState={initialValue:O(u)}}function Pt(r,n){var u=O(n.value),w=O(n.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),n.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),w!=null&&(r.defaultValue=""+w)}function ut(r){var n=r.textContent;n===r._wrapperState.initialValue&&n!==""&&n!==null&&(r.value=n)}function xr(r){switch(r){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 ys(r,n){return r==null||r==="http://www.w3.org/1999/xhtml"?xr(n):r==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Wt,zr=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,u,w,N){MSApp.execUnsafeLocalFunction(function(){return r(n,u,w,N)})}:r})(function(r,n){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=n;else{for(Wt=Wt||document.createElement("div"),Wt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Wt.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;n.firstChild;)r.appendChild(n.firstChild)}});function pt(r,n){if(n){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=n;return}}r.textContent=n}var or={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},qe=["Webkit","ms","Moz","O"];Object.keys(or).forEach(function(r){qe.forEach(function(n){n=n+r.charAt(0).toUpperCase()+r.substring(1),or[n]=or[r]})});function li(r,n,u){return n==null||typeof n=="boolean"||n===""?"":u||typeof n!="number"||n===0||or.hasOwnProperty(r)&&or[r]?(""+n).trim():n+"px"}function Da(r,n){r=r.style;for(var u in n)if(n.hasOwnProperty(u)){var w=u.indexOf("--")===0,N=li(u,n[u],w);u==="float"&&(u="cssFloat"),w?r.setProperty(u,N):r[u]=N}}var Ma=B({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 ci(r,n){if(n){if(Ma[r]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,r));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function lo(r,n){if(r.indexOf("-")===-1)return typeof n.is=="string";switch(r){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 En=null;function Tr(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var co=null,$s=null,xs=null;function uo(r){if(r=To(r)){if(typeof co!="function")throw Error(s(280));var n=r.stateNode;n&&(n=tl(n),co(r.stateNode,r.type,n))}}function Ve(r){$s?xs?xs.push(r):xs=[r]:$s=r}function mt(){if($s){var r=$s,n=xs;if(xs=$s=null,uo(r),n)for(r=0;r<n.length;r++)uo(n[r])}}function Ct(r,n){return r(n)}function Ut(){}var Hs=!1;function _t(r,n,u){if(Hs)return r(n,u);Hs=!0;try{return Ct(r,n,u)}finally{Hs=!1,($s!==null||xs!==null)&&(Ut(),mt())}}function Rt(r,n){var u=r.stateNode;if(u===null)return null;var w=tl(u);if(w===null)return null;u=w[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(r=r.type,w=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!w;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(s(231,n,typeof u));return u}var Vs=!1;if(a)try{var Ot={};Object.defineProperty(Ot,"passive",{get:function(){Vs=!0}}),window.addEventListener("test",Ot,Ot),window.removeEventListener("test",Ot,Ot)}catch{Vs=!1}function _r(r,n,u,w,N,A,I,Y,te){var ae=Array.prototype.slice.call(arguments,3);try{n.apply(u,ae)}catch(pe){this.onError(pe)}}var zs=!1,Ar=null,ho=!1,fd=null,RC={onError:function(r){zs=!0,Ar=r}};function TC(r,n,u,w,N,A,I,Y,te){zs=!1,Ar=null,_r.apply(RC,arguments)}function AC(r,n,u,w,N,A,I,Y,te){if(TC.apply(this,arguments),zs){if(zs){var ae=Ar;zs=!1,Ar=null}else throw Error(s(198));ho||(ho=!0,fd=ae)}}function jn(r){var n=r,u=r;if(r.alternate)for(;n.return;)n=n.return;else{r=n;do n=r,(n.flags&4098)!==0&&(u=n.return),r=n.return;while(r)}return n.tag===3?u:null}function nm(r){if(r.tag===13){var n=r.memoizedState;if(n===null&&(r=r.alternate,r!==null&&(n=r.memoizedState)),n!==null)return n.dehydrated}return null}function im(r){if(jn(r)!==r)throw Error(s(188))}function DC(r){var n=r.alternate;if(!n){if(n=jn(r),n===null)throw Error(s(188));return n!==r?null:r}for(var u=r,w=n;;){var N=u.return;if(N===null)break;var A=N.alternate;if(A===null){if(w=N.return,w!==null){u=w;continue}break}if(N.child===A.child){for(A=N.child;A;){if(A===u)return im(N),r;if(A===w)return im(N),n;A=A.sibling}throw Error(s(188))}if(u.return!==w.return)u=N,w=A;else{for(var I=!1,Y=N.child;Y;){if(Y===u){I=!0,u=N,w=A;break}if(Y===w){I=!0,w=N,u=A;break}Y=Y.sibling}if(!I){for(Y=A.child;Y;){if(Y===u){I=!0,u=A,w=N;break}if(Y===w){I=!0,w=A,u=N;break}Y=Y.sibling}if(!I)throw Error(s(189))}}if(u.alternate!==w)throw Error(s(190))}if(u.tag!==3)throw Error(s(188));return u.stateNode.current===u?r:n}function om(r){return r=DC(r),r!==null?am(r):null}function am(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var n=am(r);if(n!==null)return n;r=r.sibling}return null}var lm=t.unstable_scheduleCallback,cm=t.unstable_cancelCallback,MC=t.unstable_shouldYield,LC=t.unstable_requestPaint,gt=t.unstable_now,OC=t.unstable_getCurrentPriorityLevel,pd=t.unstable_ImmediatePriority,dm=t.unstable_UserBlockingPriority,La=t.unstable_NormalPriority,IC=t.unstable_LowPriority,um=t.unstable_IdlePriority,Oa=null,ns=null;function BC(r){if(ns&&typeof ns.onCommitFiberRoot=="function")try{ns.onCommitFiberRoot(Oa,r,void 0,(r.current.flags&128)===128)}catch{}}var Wr=Math.clz32?Math.clz32:HC,FC=Math.log,$C=Math.LN2;function HC(r){return r>>>=0,r===0?32:31-(FC(r)/$C|0)|0}var Ia=64,Ba=4194304;function fo(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Fa(r,n){var u=r.pendingLanes;if(u===0)return 0;var w=0,N=r.suspendedLanes,A=r.pingedLanes,I=u&268435455;if(I!==0){var Y=I&~N;Y!==0?w=fo(Y):(A&=I,A!==0&&(w=fo(A)))}else I=u&~N,I!==0?w=fo(I):A!==0&&(w=fo(A));if(w===0)return 0;if(n!==0&&n!==w&&(n&N)===0&&(N=w&-w,A=n&-n,N>=A||N===16&&(A&4194240)!==0))return n;if((w&4)!==0&&(w|=u&16),n=r.entangledLanes,n!==0)for(r=r.entanglements,n&=w;0<n;)u=31-Wr(n),N=1<<u,w|=r[u],n&=~N;return w}function VC(r,n){switch(r){case 1:case 2:case 4:return n+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 n+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 zC(r,n){for(var u=r.suspendedLanes,w=r.pingedLanes,N=r.expirationTimes,A=r.pendingLanes;0<A;){var I=31-Wr(A),Y=1<<I,te=N[I];te===-1?((Y&u)===0||(Y&w)!==0)&&(N[I]=VC(Y,n)):te<=n&&(r.expiredLanes|=Y),A&=~Y}}function md(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function hm(){var r=Ia;return Ia<<=1,(Ia&4194240)===0&&(Ia=64),r}function gd(r){for(var n=[],u=0;31>u;u++)n.push(r);return n}function po(r,n,u){r.pendingLanes|=n,n!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,n=31-Wr(n),r[n]=u}function WC(r,n){var u=r.pendingLanes&~n;r.pendingLanes=n,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=n,r.mutableReadLanes&=n,r.entangledLanes&=n,n=r.entanglements;var w=r.eventTimes;for(r=r.expirationTimes;0<u;){var N=31-Wr(u),A=1<<N;n[N]=0,w[N]=-1,r[N]=-1,u&=~A}}function vd(r,n){var u=r.entangledLanes|=n;for(r=r.entanglements;u;){var w=31-Wr(u),N=1<<w;N&n|r[w]&n&&(r[w]|=n),u&=~N}}var Je=0;function fm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var pm,yd,mm,gm,vm,xd=!1,$a=[],Ws=null,Us=null,Ks=null,mo=new Map,go=new Map,Gs=[],UC="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 ym(r,n){switch(r){case"focusin":case"focusout":Ws=null;break;case"dragenter":case"dragleave":Us=null;break;case"mouseover":case"mouseout":Ks=null;break;case"pointerover":case"pointerout":mo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":go.delete(n.pointerId)}}function vo(r,n,u,w,N,A){return r===null||r.nativeEvent!==A?(r={blockedOn:n,domEventName:u,eventSystemFlags:w,nativeEvent:A,targetContainers:[N]},n!==null&&(n=To(n),n!==null&&yd(n)),r):(r.eventSystemFlags|=w,n=r.targetContainers,N!==null&&n.indexOf(N)===-1&&n.push(N),r)}function KC(r,n,u,w,N){switch(n){case"focusin":return Ws=vo(Ws,r,n,u,w,N),!0;case"dragenter":return Us=vo(Us,r,n,u,w,N),!0;case"mouseover":return Ks=vo(Ks,r,n,u,w,N),!0;case"pointerover":var A=N.pointerId;return mo.set(A,vo(mo.get(A)||null,r,n,u,w,N)),!0;case"gotpointercapture":return A=N.pointerId,go.set(A,vo(go.get(A)||null,r,n,u,w,N)),!0}return!1}function xm(r){var n=Nn(r.target);if(n!==null){var u=jn(n);if(u!==null){if(n=u.tag,n===13){if(n=nm(u),n!==null){r.blockedOn=n,vm(r.priority,function(){mm(u)});return}}else if(n===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ha(r){if(r.blockedOn!==null)return!1;for(var n=r.targetContainers;0<n.length;){var u=wd(r.domEventName,r.eventSystemFlags,n[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var w=new u.constructor(u.type,u);En=w,u.target.dispatchEvent(w),En=null}else return n=To(u),n!==null&&yd(n),r.blockedOn=u,!1;n.shift()}return!0}function _m(r,n,u){Ha(r)&&u.delete(n)}function GC(){xd=!1,Ws!==null&&Ha(Ws)&&(Ws=null),Us!==null&&Ha(Us)&&(Us=null),Ks!==null&&Ha(Ks)&&(Ks=null),mo.forEach(_m),go.forEach(_m)}function yo(r,n){r.blockedOn===n&&(r.blockedOn=null,xd||(xd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,GC)))}function xo(r){function n(N){return yo(N,r)}if(0<$a.length){yo($a[0],r);for(var u=1;u<$a.length;u++){var w=$a[u];w.blockedOn===r&&(w.blockedOn=null)}}for(Ws!==null&&yo(Ws,r),Us!==null&&yo(Us,r),Ks!==null&&yo(Ks,r),mo.forEach(n),go.forEach(n),u=0;u<Gs.length;u++)w=Gs[u],w.blockedOn===r&&(w.blockedOn=null);for(;0<Gs.length&&(u=Gs[0],u.blockedOn===null);)xm(u),u.blockedOn===null&&Gs.shift()}var di=k.ReactCurrentBatchConfig,Va=!0;function qC(r,n,u,w){var N=Je,A=di.transition;di.transition=null;try{Je=1,_d(r,n,u,w)}finally{Je=N,di.transition=A}}function YC(r,n,u,w){var N=Je,A=di.transition;di.transition=null;try{Je=4,_d(r,n,u,w)}finally{Je=N,di.transition=A}}function _d(r,n,u,w){if(Va){var N=wd(r,n,u,w);if(N===null)Bd(r,n,w,za,u),ym(r,w);else if(KC(N,r,n,u,w))w.stopPropagation();else if(ym(r,w),n&4&&-1<UC.indexOf(r)){for(;N!==null;){var A=To(N);if(A!==null&&pm(A),A=wd(r,n,u,w),A===null&&Bd(r,n,w,za,u),A===N)break;N=A}N!==null&&w.stopPropagation()}else Bd(r,n,w,null,u)}}var za=null;function wd(r,n,u,w){if(za=null,r=Tr(w),r=Nn(r),r!==null)if(n=jn(r),n===null)r=null;else if(u=n.tag,u===13){if(r=nm(n),r!==null)return r;r=null}else if(u===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;r=null}else n!==r&&(r=null);return za=r,null}function wm(r){switch(r){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(OC()){case pd:return 1;case dm:return 4;case La:case IC:return 16;case um:return 536870912;default:return 16}default:return 16}}var qs=null,bd=null,Wa=null;function bm(){if(Wa)return Wa;var r,n=bd,u=n.length,w,N="value"in qs?qs.value:qs.textContent,A=N.length;for(r=0;r<u&&n[r]===N[r];r++);var I=u-r;for(w=1;w<=I&&n[u-w]===N[A-w];w++);return Wa=N.slice(r,1<w?1-w:void 0)}function Ua(r){var n=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&n===13&&(r=13)):r=n,r===10&&(r=13),32<=r||r===13?r:0}function Ka(){return!0}function Sm(){return!1}function wr(r){function n(u,w,N,A,I){this._reactName=u,this._targetInst=N,this.type=w,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var Y in r)r.hasOwnProperty(Y)&&(u=r[Y],this[Y]=u?u(A):A[Y]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Ka:Sm,this.isPropagationStopped=Sm,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ka)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ka)},persist:function(){},isPersistent:Ka}),n}var ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=wr(ui),_o=B({},ui,{view:0,detail:0}),XC=wr(_o),Cd,kd,wo,Ga=B({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==wo&&(wo&&r.type==="mousemove"?(Cd=r.screenX-wo.screenX,kd=r.screenY-wo.screenY):kd=Cd=0,wo=r),Cd)},movementY:function(r){return"movementY"in r?r.movementY:kd}}),Cm=wr(Ga),JC=B({},Ga,{dataTransfer:0}),QC=wr(JC),ZC=B({},_o,{relatedTarget:0}),Ed=wr(ZC),ek=B({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),tk=wr(ek),rk=B({},ui,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),sk=wr(rk),nk=B({},ui,{data:0}),km=wr(nk),ik={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ok={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"},ak={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lk(r){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(r):(r=ak[r])?!!n[r]:!1}function jd(){return lk}var ck=B({},_o,{key:function(r){if(r.key){var n=ik[r.key]||r.key;if(n!=="Unidentified")return n}return r.type==="keypress"?(r=Ua(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?ok[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jd,charCode:function(r){return r.type==="keypress"?Ua(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ua(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),dk=wr(ck),uk=B({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Em=wr(uk),hk=B({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jd}),fk=wr(hk),pk=B({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),mk=wr(pk),gk=B({},Ga,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),vk=wr(gk),yk=[9,13,27,32],Nd=a&&"CompositionEvent"in window,bo=null;a&&"documentMode"in document&&(bo=document.documentMode);var xk=a&&"TextEvent"in window&&!bo,jm=a&&(!Nd||bo&&8<bo&&11>=bo),Nm=" ",Pm=!1;function Rm(r,n){switch(r){case"keyup":return yk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var hi=!1;function _k(r,n){switch(r){case"compositionend":return Tm(n);case"keypress":return n.which!==32?null:(Pm=!0,Nm);case"textInput":return r=n.data,r===Nm&&Pm?null:r;default:return null}}function wk(r,n){if(hi)return r==="compositionend"||!Nd&&Rm(r,n)?(r=bm(),Wa=bd=qs=null,hi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return jm&&n.locale!=="ko"?null:n.data;default:return null}}var bk={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 Am(r){var n=r&&r.nodeName&&r.nodeName.toLowerCase();return n==="input"?!!bk[r.type]:n==="textarea"}function Dm(r,n,u,w){Ve(w),n=Qa(n,"onChange"),0<n.length&&(u=new Sd("onChange","change",null,u,w),r.push({event:u,listeners:n}))}var So=null,Co=null;function Sk(r){Jm(r,0)}function qa(r){var n=vi(r);if(re(n))return r}function Ck(r,n){if(r==="change")return n}var Mm=!1;if(a){var Pd;if(a){var Rd="oninput"in document;if(!Rd){var Lm=document.createElement("div");Lm.setAttribute("oninput","return;"),Rd=typeof Lm.oninput=="function"}Pd=Rd}else Pd=!1;Mm=Pd&&(!document.documentMode||9<document.documentMode)}function Om(){So&&(So.detachEvent("onpropertychange",Im),Co=So=null)}function Im(r){if(r.propertyName==="value"&&qa(Co)){var n=[];Dm(n,Co,r,Tr(r)),_t(Sk,n)}}function kk(r,n,u){r==="focusin"?(Om(),So=n,Co=u,So.attachEvent("onpropertychange",Im)):r==="focusout"&&Om()}function Ek(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return qa(Co)}function jk(r,n){if(r==="click")return qa(n)}function Nk(r,n){if(r==="input"||r==="change")return qa(n)}function Pk(r,n){return r===n&&(r!==0||1/r===1/n)||r!==r&&n!==n}var Ur=typeof Object.is=="function"?Object.is:Pk;function ko(r,n){if(Ur(r,n))return!0;if(typeof r!="object"||r===null||typeof n!="object"||n===null)return!1;var u=Object.keys(r),w=Object.keys(n);if(u.length!==w.length)return!1;for(w=0;w<u.length;w++){var N=u[w];if(!c.call(n,N)||!Ur(r[N],n[N]))return!1}return!0}function Bm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Fm(r,n){var u=Bm(r);r=0;for(var w;u;){if(u.nodeType===3){if(w=r+u.textContent.length,r<=n&&w>=n)return{node:u,offset:n-r};r=w}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Bm(u)}}function $m(r,n){return r&&n?r===n?!0:r&&r.nodeType===3?!1:n&&n.nodeType===3?$m(r,n.parentNode):"contains"in r?r.contains(n):r.compareDocumentPosition?!!(r.compareDocumentPosition(n)&16):!1:!1}function Hm(){for(var r=window,n=he();n instanceof r.HTMLIFrameElement;){try{var u=typeof n.contentWindow.location.href=="string"}catch{u=!1}if(u)r=n.contentWindow;else break;n=he(r.document)}return n}function Td(r){var n=r&&r.nodeName&&r.nodeName.toLowerCase();return n&&(n==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||n==="textarea"||r.contentEditable==="true")}function Rk(r){var n=Hm(),u=r.focusedElem,w=r.selectionRange;if(n!==u&&u&&u.ownerDocument&&$m(u.ownerDocument.documentElement,u)){if(w!==null&&Td(u)){if(n=w.start,r=w.end,r===void 0&&(r=n),"selectionStart"in u)u.selectionStart=n,u.selectionEnd=Math.min(r,u.value.length);else if(r=(n=u.ownerDocument||document)&&n.defaultView||window,r.getSelection){r=r.getSelection();var N=u.textContent.length,A=Math.min(w.start,N);w=w.end===void 0?A:Math.min(w.end,N),!r.extend&&A>w&&(N=w,w=A,A=N),N=Fm(u,A);var I=Fm(u,w);N&&I&&(r.rangeCount!==1||r.anchorNode!==N.node||r.anchorOffset!==N.offset||r.focusNode!==I.node||r.focusOffset!==I.offset)&&(n=n.createRange(),n.setStart(N.node,N.offset),r.removeAllRanges(),A>w?(r.addRange(n),r.extend(I.node,I.offset)):(n.setEnd(I.node,I.offset),r.addRange(n)))}}for(n=[],r=u;r=r.parentNode;)r.nodeType===1&&n.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<n.length;u++)r=n[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var Tk=a&&"documentMode"in document&&11>=document.documentMode,fi=null,Ad=null,Eo=null,Dd=!1;function Vm(r,n,u){var w=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Dd||fi==null||fi!==he(w)||(w=fi,"selectionStart"in w&&Td(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),Eo&&ko(Eo,w)||(Eo=w,w=Qa(Ad,"onSelect"),0<w.length&&(n=new Sd("onSelect","select",null,n,u),r.push({event:n,listeners:w}),n.target=fi)))}function Ya(r,n){var u={};return u[r.toLowerCase()]=n.toLowerCase(),u["Webkit"+r]="webkit"+n,u["Moz"+r]="moz"+n,u}var pi={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},Md={},zm={};a&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete pi.animationend.animation,delete pi.animationiteration.animation,delete pi.animationstart.animation),"TransitionEvent"in window||delete pi.transitionend.transition);function Xa(r){if(Md[r])return Md[r];if(!pi[r])return r;var n=pi[r],u;for(u in n)if(n.hasOwnProperty(u)&&u in zm)return Md[r]=n[u];return r}var Wm=Xa("animationend"),Um=Xa("animationiteration"),Km=Xa("animationstart"),Gm=Xa("transitionend"),qm=new Map,Ym="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 Ys(r,n){qm.set(r,n),m(n,[r])}for(var Ld=0;Ld<Ym.length;Ld++){var Od=Ym[Ld],Ak=Od.toLowerCase(),Dk=Od[0].toUpperCase()+Od.slice(1);Ys(Ak,"on"+Dk)}Ys(Wm,"onAnimationEnd"),Ys(Um,"onAnimationIteration"),Ys(Km,"onAnimationStart"),Ys("dblclick","onDoubleClick"),Ys("focusin","onFocus"),Ys("focusout","onBlur"),Ys(Gm,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jo="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(" "),Mk=new Set("cancel close invalid load scroll toggle".split(" ").concat(jo));function Xm(r,n,u){var w=r.type||"unknown-event";r.currentTarget=u,AC(w,n,void 0,r),r.currentTarget=null}function Jm(r,n){n=(n&4)!==0;for(var u=0;u<r.length;u++){var w=r[u],N=w.event;w=w.listeners;e:{var A=void 0;if(n)for(var I=w.length-1;0<=I;I--){var Y=w[I],te=Y.instance,ae=Y.currentTarget;if(Y=Y.listener,te!==A&&N.isPropagationStopped())break e;Xm(N,Y,ae),A=te}else for(I=0;I<w.length;I++){if(Y=w[I],te=Y.instance,ae=Y.currentTarget,Y=Y.listener,te!==A&&N.isPropagationStopped())break e;Xm(N,Y,ae),A=te}}}if(ho)throw r=fd,ho=!1,fd=null,r}function tt(r,n){var u=n[Wd];u===void 0&&(u=n[Wd]=new Set);var w=r+"__bubble";u.has(w)||(Qm(n,r,2,!1),u.add(w))}function Id(r,n,u){var w=0;n&&(w|=4),Qm(u,r,w,n)}var Ja="_reactListening"+Math.random().toString(36).slice(2);function No(r){if(!r[Ja]){r[Ja]=!0,o.forEach(function(u){u!=="selectionchange"&&(Mk.has(u)||Id(u,!1,r),Id(u,!0,r))});var n=r.nodeType===9?r:r.ownerDocument;n===null||n[Ja]||(n[Ja]=!0,Id("selectionchange",!1,n))}}function Qm(r,n,u,w){switch(wm(n)){case 1:var N=qC;break;case 4:N=YC;break;default:N=_d}u=N.bind(null,n,u,r),N=void 0,!Vs||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(N=!0),w?N!==void 0?r.addEventListener(n,u,{capture:!0,passive:N}):r.addEventListener(n,u,!0):N!==void 0?r.addEventListener(n,u,{passive:N}):r.addEventListener(n,u,!1)}function Bd(r,n,u,w,N){var A=w;if((n&1)===0&&(n&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var Y=w.stateNode.containerInfo;if(Y===N||Y.nodeType===8&&Y.parentNode===N)break;if(I===4)for(I=w.return;I!==null;){var te=I.tag;if((te===3||te===4)&&(te=I.stateNode.containerInfo,te===N||te.nodeType===8&&te.parentNode===N))return;I=I.return}for(;Y!==null;){if(I=Nn(Y),I===null)return;if(te=I.tag,te===5||te===6){w=A=I;continue e}Y=Y.parentNode}}w=w.return}_t(function(){var ae=A,pe=Tr(u),me=[];e:{var fe=qm.get(r);if(fe!==void 0){var _e=Sd,Ce=r;switch(r){case"keypress":if(Ua(u)===0)break e;case"keydown":case"keyup":_e=dk;break;case"focusin":Ce="focus",_e=Ed;break;case"focusout":Ce="blur",_e=Ed;break;case"beforeblur":case"afterblur":_e=Ed;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=Cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=QC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=fk;break;case Wm:case Um:case Km:_e=tk;break;case Gm:_e=mk;break;case"scroll":_e=XC;break;case"wheel":_e=vk;break;case"copy":case"cut":case"paste":_e=sk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=Em}var Ne=(n&4)!==0,vt=!Ne&&r==="scroll",ie=Ne?fe!==null?fe+"Capture":null:fe;Ne=[];for(var se=ae,oe;se!==null;){oe=se;var ge=oe.stateNode;if(oe.tag===5&&ge!==null&&(oe=ge,ie!==null&&(ge=Rt(se,ie),ge!=null&&Ne.push(Po(se,ge,oe)))),vt)break;se=se.return}0<Ne.length&&(fe=new _e(fe,Ce,null,u,pe),me.push({event:fe,listeners:Ne}))}}if((n&7)===0){e:{if(fe=r==="mouseover"||r==="pointerover",_e=r==="mouseout"||r==="pointerout",fe&&u!==En&&(Ce=u.relatedTarget||u.fromElement)&&(Nn(Ce)||Ce[_s]))break e;if((_e||fe)&&(fe=pe.window===pe?pe:(fe=pe.ownerDocument)?fe.defaultView||fe.parentWindow:window,_e?(Ce=u.relatedTarget||u.toElement,_e=ae,Ce=Ce?Nn(Ce):null,Ce!==null&&(vt=jn(Ce),Ce!==vt||Ce.tag!==5&&Ce.tag!==6)&&(Ce=null)):(_e=null,Ce=ae),_e!==Ce)){if(Ne=Cm,ge="onMouseLeave",ie="onMouseEnter",se="mouse",(r==="pointerout"||r==="pointerover")&&(Ne=Em,ge="onPointerLeave",ie="onPointerEnter",se="pointer"),vt=_e==null?fe:vi(_e),oe=Ce==null?fe:vi(Ce),fe=new Ne(ge,se+"leave",_e,u,pe),fe.target=vt,fe.relatedTarget=oe,ge=null,Nn(pe)===ae&&(Ne=new Ne(ie,se+"enter",Ce,u,pe),Ne.target=oe,Ne.relatedTarget=vt,ge=Ne),vt=ge,_e&&Ce)t:{for(Ne=_e,ie=Ce,se=0,oe=Ne;oe;oe=mi(oe))se++;for(oe=0,ge=ie;ge;ge=mi(ge))oe++;for(;0<se-oe;)Ne=mi(Ne),se--;for(;0<oe-se;)ie=mi(ie),oe--;for(;se--;){if(Ne===ie||ie!==null&&Ne===ie.alternate)break t;Ne=mi(Ne),ie=mi(ie)}Ne=null}else Ne=null;_e!==null&&Zm(me,fe,_e,Ne,!1),Ce!==null&&vt!==null&&Zm(me,vt,Ce,Ne,!0)}}e:{if(fe=ae?vi(ae):window,_e=fe.nodeName&&fe.nodeName.toLowerCase(),_e==="select"||_e==="input"&&fe.type==="file")var Re=Ck;else if(Am(fe))if(Mm)Re=Nk;else{Re=Ek;var Me=kk}else(_e=fe.nodeName)&&_e.toLowerCase()==="input"&&(fe.type==="checkbox"||fe.type==="radio")&&(Re=jk);if(Re&&(Re=Re(r,ae))){Dm(me,Re,u,pe);break e}Me&&Me(r,fe,ae),r==="focusout"&&(Me=fe._wrapperState)&&Me.controlled&&fe.type==="number"&&et(fe,"number",fe.value)}switch(Me=ae?vi(ae):window,r){case"focusin":(Am(Me)||Me.contentEditable==="true")&&(fi=Me,Ad=ae,Eo=null);break;case"focusout":Eo=Ad=fi=null;break;case"mousedown":Dd=!0;break;case"contextmenu":case"mouseup":case"dragend":Dd=!1,Vm(me,u,pe);break;case"selectionchange":if(Tk)break;case"keydown":case"keyup":Vm(me,u,pe)}var Le;if(Nd)e:{switch(r){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else hi?Rm(r,u)&&($e="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&($e="onCompositionStart");$e&&(jm&&u.locale!=="ko"&&(hi||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&hi&&(Le=bm()):(qs=pe,bd="value"in qs?qs.value:qs.textContent,hi=!0)),Me=Qa(ae,$e),0<Me.length&&($e=new km($e,r,null,u,pe),me.push({event:$e,listeners:Me}),Le?$e.data=Le:(Le=Tm(u),Le!==null&&($e.data=Le)))),(Le=xk?_k(r,u):wk(r,u))&&(ae=Qa(ae,"onBeforeInput"),0<ae.length&&(pe=new km("onBeforeInput","beforeinput",null,u,pe),me.push({event:pe,listeners:ae}),pe.data=Le))}Jm(me,n)})}function Po(r,n,u){return{instance:r,listener:n,currentTarget:u}}function Qa(r,n){for(var u=n+"Capture",w=[];r!==null;){var N=r,A=N.stateNode;N.tag===5&&A!==null&&(N=A,A=Rt(r,u),A!=null&&w.unshift(Po(r,A,N)),A=Rt(r,n),A!=null&&w.push(Po(r,A,N))),r=r.return}return w}function mi(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Zm(r,n,u,w,N){for(var A=n._reactName,I=[];u!==null&&u!==w;){var Y=u,te=Y.alternate,ae=Y.stateNode;if(te!==null&&te===w)break;Y.tag===5&&ae!==null&&(Y=ae,N?(te=Rt(u,A),te!=null&&I.unshift(Po(u,te,Y))):N||(te=Rt(u,A),te!=null&&I.push(Po(u,te,Y)))),u=u.return}I.length!==0&&r.push({event:n,listeners:I})}var Lk=/\r\n?/g,Ok=/\u0000|\uFFFD/g;function eg(r){return(typeof r=="string"?r:""+r).replace(Lk,`
|
|
38
|
+
`).replace(Ok,"")}function Za(r,n,u){if(n=eg(n),eg(r)!==n&&u)throw Error(s(425))}function el(){}var Fd=null,$d=null;function Hd(r,n){return r==="textarea"||r==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Vd=typeof setTimeout=="function"?setTimeout:void 0,Ik=typeof clearTimeout=="function"?clearTimeout:void 0,tg=typeof Promise=="function"?Promise:void 0,Bk=typeof queueMicrotask=="function"?queueMicrotask:typeof tg<"u"?function(r){return tg.resolve(null).then(r).catch(Fk)}:Vd;function Fk(r){setTimeout(function(){throw r})}function zd(r,n){var u=n,w=0;do{var N=u.nextSibling;if(r.removeChild(u),N&&N.nodeType===8)if(u=N.data,u==="/$"){if(w===0){r.removeChild(N),xo(n);return}w--}else u!=="$"&&u!=="$?"&&u!=="$!"||w++;u=N}while(u);xo(n)}function Xs(r){for(;r!=null;r=r.nextSibling){var n=r.nodeType;if(n===1||n===3)break;if(n===8){if(n=r.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return r}function rg(r){r=r.previousSibling;for(var n=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(n===0)return r;n--}else u==="/$"&&n++}r=r.previousSibling}return null}var gi=Math.random().toString(36).slice(2),is="__reactFiber$"+gi,Ro="__reactProps$"+gi,_s="__reactContainer$"+gi,Wd="__reactEvents$"+gi,$k="__reactListeners$"+gi,Hk="__reactHandles$"+gi;function Nn(r){var n=r[is];if(n)return n;for(var u=r.parentNode;u;){if(n=u[_s]||u[is]){if(u=n.alternate,n.child!==null||u!==null&&u.child!==null)for(r=rg(r);r!==null;){if(u=r[is])return u;r=rg(r)}return n}r=u,u=r.parentNode}return null}function To(r){return r=r[is]||r[_s],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function vi(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(s(33))}function tl(r){return r[Ro]||null}var Ud=[],yi=-1;function Js(r){return{current:r}}function rt(r){0>yi||(r.current=Ud[yi],Ud[yi]=null,yi--)}function Qe(r,n){yi++,Ud[yi]=r.current,r.current=n}var Qs={},Kt=Js(Qs),ar=Js(!1),Pn=Qs;function xi(r,n){var u=r.type.contextTypes;if(!u)return Qs;var w=r.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===n)return w.__reactInternalMemoizedMaskedChildContext;var N={},A;for(A in u)N[A]=n[A];return w&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=n,r.__reactInternalMemoizedMaskedChildContext=N),N}function lr(r){return r=r.childContextTypes,r!=null}function rl(){rt(ar),rt(Kt)}function sg(r,n,u){if(Kt.current!==Qs)throw Error(s(168));Qe(Kt,n),Qe(ar,u)}function ng(r,n,u){var w=r.stateNode;if(n=n.childContextTypes,typeof w.getChildContext!="function")return u;w=w.getChildContext();for(var N in w)if(!(N in n))throw Error(s(108,G(r)||"Unknown",N));return B({},u,w)}function sl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Qs,Pn=Kt.current,Qe(Kt,r),Qe(ar,ar.current),!0}function ig(r,n,u){var w=r.stateNode;if(!w)throw Error(s(169));u?(r=ng(r,n,Pn),w.__reactInternalMemoizedMergedChildContext=r,rt(ar),rt(Kt),Qe(Kt,r)):rt(ar),Qe(ar,u)}var ws=null,nl=!1,Kd=!1;function og(r){ws===null?ws=[r]:ws.push(r)}function Vk(r){nl=!0,og(r)}function Zs(){if(!Kd&&ws!==null){Kd=!0;var r=0,n=Je;try{var u=ws;for(Je=1;r<u.length;r++){var w=u[r];do w=w(!0);while(w!==null)}ws=null,nl=!1}catch(N){throw ws!==null&&(ws=ws.slice(r+1)),lm(pd,Zs),N}finally{Je=n,Kd=!1}}return null}var _i=[],wi=0,il=null,ol=0,Dr=[],Mr=0,Rn=null,bs=1,Ss="";function Tn(r,n){_i[wi++]=ol,_i[wi++]=il,il=r,ol=n}function ag(r,n,u){Dr[Mr++]=bs,Dr[Mr++]=Ss,Dr[Mr++]=Rn,Rn=r;var w=bs;r=Ss;var N=32-Wr(w)-1;w&=~(1<<N),u+=1;var A=32-Wr(n)+N;if(30<A){var I=N-N%5;A=(w&(1<<I)-1).toString(32),w>>=I,N-=I,bs=1<<32-Wr(n)+N|u<<N|w,Ss=A+r}else bs=1<<A|u<<N|w,Ss=r}function Gd(r){r.return!==null&&(Tn(r,1),ag(r,1,0))}function qd(r){for(;r===il;)il=_i[--wi],_i[wi]=null,ol=_i[--wi],_i[wi]=null;for(;r===Rn;)Rn=Dr[--Mr],Dr[Mr]=null,Ss=Dr[--Mr],Dr[Mr]=null,bs=Dr[--Mr],Dr[Mr]=null}var br=null,Sr=null,it=!1,Kr=null;function lg(r,n){var u=Br(5,null,null,0);u.elementType="DELETED",u.stateNode=n,u.return=r,n=r.deletions,n===null?(r.deletions=[u],r.flags|=16):n.push(u)}function cg(r,n){switch(r.tag){case 5:var u=r.type;return n=n.nodeType!==1||u.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(r.stateNode=n,br=r,Sr=Xs(n.firstChild),!0):!1;case 6:return n=r.pendingProps===""||n.nodeType!==3?null:n,n!==null?(r.stateNode=n,br=r,Sr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(u=Rn!==null?{id:bs,overflow:Ss}:null,r.memoizedState={dehydrated:n,treeContext:u,retryLane:1073741824},u=Br(18,null,null,0),u.stateNode=n,u.return=r,r.child=u,br=r,Sr=null,!0):!1;default:return!1}}function Yd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Xd(r){if(it){var n=Sr;if(n){var u=n;if(!cg(r,n)){if(Yd(r))throw Error(s(418));n=Xs(u.nextSibling);var w=br;n&&cg(r,n)?lg(w,u):(r.flags=r.flags&-4097|2,it=!1,br=r)}}else{if(Yd(r))throw Error(s(418));r.flags=r.flags&-4097|2,it=!1,br=r}}}function dg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;br=r}function al(r){if(r!==br)return!1;if(!it)return dg(r),it=!0,!1;var n;if((n=r.tag!==3)&&!(n=r.tag!==5)&&(n=r.type,n=n!=="head"&&n!=="body"&&!Hd(r.type,r.memoizedProps)),n&&(n=Sr)){if(Yd(r))throw ug(),Error(s(418));for(;n;)lg(r,n),n=Xs(n.nextSibling)}if(dg(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));e:{for(r=r.nextSibling,n=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(n===0){Sr=Xs(r.nextSibling);break e}n--}else u!=="$"&&u!=="$!"&&u!=="$?"||n++}r=r.nextSibling}Sr=null}}else Sr=br?Xs(r.stateNode.nextSibling):null;return!0}function ug(){for(var r=Sr;r;)r=Xs(r.nextSibling)}function bi(){Sr=br=null,it=!1}function Jd(r){Kr===null?Kr=[r]:Kr.push(r)}var zk=k.ReactCurrentBatchConfig;function Ao(r,n,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(s(309));var w=u.stateNode}if(!w)throw Error(s(147,r));var N=w,A=""+r;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===A?n.ref:(n=function(I){var Y=N.refs;I===null?delete Y[A]:Y[A]=I},n._stringRef=A,n)}if(typeof r!="string")throw Error(s(284));if(!u._owner)throw Error(s(290,r))}return r}function ll(r,n){throw r=Object.prototype.toString.call(n),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":r))}function hg(r){var n=r._init;return n(r._payload)}function fg(r){function n(ie,se){if(r){var oe=ie.deletions;oe===null?(ie.deletions=[se],ie.flags|=16):oe.push(se)}}function u(ie,se){if(!r)return null;for(;se!==null;)n(ie,se),se=se.sibling;return null}function w(ie,se){for(ie=new Map;se!==null;)se.key!==null?ie.set(se.key,se):ie.set(se.index,se),se=se.sibling;return ie}function N(ie,se){return ie=ln(ie,se),ie.index=0,ie.sibling=null,ie}function A(ie,se,oe){return ie.index=oe,r?(oe=ie.alternate,oe!==null?(oe=oe.index,oe<se?(ie.flags|=2,se):oe):(ie.flags|=2,se)):(ie.flags|=1048576,se)}function I(ie){return r&&ie.alternate===null&&(ie.flags|=2),ie}function Y(ie,se,oe,ge){return se===null||se.tag!==6?(se=Vu(oe,ie.mode,ge),se.return=ie,se):(se=N(se,oe),se.return=ie,se)}function te(ie,se,oe,ge){var Re=oe.type;return Re===R?pe(ie,se,oe.props.children,ge,oe.key):se!==null&&(se.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===K&&hg(Re)===se.type)?(ge=N(se,oe.props),ge.ref=Ao(ie,se,oe),ge.return=ie,ge):(ge=Al(oe.type,oe.key,oe.props,null,ie.mode,ge),ge.ref=Ao(ie,se,oe),ge.return=ie,ge)}function ae(ie,se,oe,ge){return se===null||se.tag!==4||se.stateNode.containerInfo!==oe.containerInfo||se.stateNode.implementation!==oe.implementation?(se=zu(oe,ie.mode,ge),se.return=ie,se):(se=N(se,oe.children||[]),se.return=ie,se)}function pe(ie,se,oe,ge,Re){return se===null||se.tag!==7?(se=Fn(oe,ie.mode,ge,Re),se.return=ie,se):(se=N(se,oe),se.return=ie,se)}function me(ie,se,oe){if(typeof se=="string"&&se!==""||typeof se=="number")return se=Vu(""+se,ie.mode,oe),se.return=ie,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case P:return oe=Al(se.type,se.key,se.props,null,ie.mode,oe),oe.ref=Ao(ie,null,se),oe.return=ie,oe;case T:return se=zu(se,ie.mode,oe),se.return=ie,se;case K:var ge=se._init;return me(ie,ge(se._payload),oe)}if(Ae(se)||D(se))return se=Fn(se,ie.mode,oe,null),se.return=ie,se;ll(ie,se)}return null}function fe(ie,se,oe,ge){var Re=se!==null?se.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Re!==null?null:Y(ie,se,""+oe,ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case P:return oe.key===Re?te(ie,se,oe,ge):null;case T:return oe.key===Re?ae(ie,se,oe,ge):null;case K:return Re=oe._init,fe(ie,se,Re(oe._payload),ge)}if(Ae(oe)||D(oe))return Re!==null?null:pe(ie,se,oe,ge,null);ll(ie,oe)}return null}function _e(ie,se,oe,ge,Re){if(typeof ge=="string"&&ge!==""||typeof ge=="number")return ie=ie.get(oe)||null,Y(se,ie,""+ge,Re);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case P:return ie=ie.get(ge.key===null?oe:ge.key)||null,te(se,ie,ge,Re);case T:return ie=ie.get(ge.key===null?oe:ge.key)||null,ae(se,ie,ge,Re);case K:var Me=ge._init;return _e(ie,se,oe,Me(ge._payload),Re)}if(Ae(ge)||D(ge))return ie=ie.get(oe)||null,pe(se,ie,ge,Re,null);ll(se,ge)}return null}function Ce(ie,se,oe,ge){for(var Re=null,Me=null,Le=se,$e=se=0,Dt=null;Le!==null&&$e<oe.length;$e++){Le.index>$e?(Dt=Le,Le=null):Dt=Le.sibling;var Ye=fe(ie,Le,oe[$e],ge);if(Ye===null){Le===null&&(Le=Dt);break}r&&Le&&Ye.alternate===null&&n(ie,Le),se=A(Ye,se,$e),Me===null?Re=Ye:Me.sibling=Ye,Me=Ye,Le=Dt}if($e===oe.length)return u(ie,Le),it&&Tn(ie,$e),Re;if(Le===null){for(;$e<oe.length;$e++)Le=me(ie,oe[$e],ge),Le!==null&&(se=A(Le,se,$e),Me===null?Re=Le:Me.sibling=Le,Me=Le);return it&&Tn(ie,$e),Re}for(Le=w(ie,Le);$e<oe.length;$e++)Dt=_e(Le,ie,$e,oe[$e],ge),Dt!==null&&(r&&Dt.alternate!==null&&Le.delete(Dt.key===null?$e:Dt.key),se=A(Dt,se,$e),Me===null?Re=Dt:Me.sibling=Dt,Me=Dt);return r&&Le.forEach(function(cn){return n(ie,cn)}),it&&Tn(ie,$e),Re}function Ne(ie,se,oe,ge){var Re=D(oe);if(typeof Re!="function")throw Error(s(150));if(oe=Re.call(oe),oe==null)throw Error(s(151));for(var Me=Re=null,Le=se,$e=se=0,Dt=null,Ye=oe.next();Le!==null&&!Ye.done;$e++,Ye=oe.next()){Le.index>$e?(Dt=Le,Le=null):Dt=Le.sibling;var cn=fe(ie,Le,Ye.value,ge);if(cn===null){Le===null&&(Le=Dt);break}r&&Le&&cn.alternate===null&&n(ie,Le),se=A(cn,se,$e),Me===null?Re=cn:Me.sibling=cn,Me=cn,Le=Dt}if(Ye.done)return u(ie,Le),it&&Tn(ie,$e),Re;if(Le===null){for(;!Ye.done;$e++,Ye=oe.next())Ye=me(ie,Ye.value,ge),Ye!==null&&(se=A(Ye,se,$e),Me===null?Re=Ye:Me.sibling=Ye,Me=Ye);return it&&Tn(ie,$e),Re}for(Le=w(ie,Le);!Ye.done;$e++,Ye=oe.next())Ye=_e(Le,ie,$e,Ye.value,ge),Ye!==null&&(r&&Ye.alternate!==null&&Le.delete(Ye.key===null?$e:Ye.key),se=A(Ye,se,$e),Me===null?Re=Ye:Me.sibling=Ye,Me=Ye);return r&&Le.forEach(function(b2){return n(ie,b2)}),it&&Tn(ie,$e),Re}function vt(ie,se,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===R&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case P:e:{for(var Re=oe.key,Me=se;Me!==null;){if(Me.key===Re){if(Re=oe.type,Re===R){if(Me.tag===7){u(ie,Me.sibling),se=N(Me,oe.props.children),se.return=ie,ie=se;break e}}else if(Me.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===K&&hg(Re)===Me.type){u(ie,Me.sibling),se=N(Me,oe.props),se.ref=Ao(ie,Me,oe),se.return=ie,ie=se;break e}u(ie,Me);break}else n(ie,Me);Me=Me.sibling}oe.type===R?(se=Fn(oe.props.children,ie.mode,ge,oe.key),se.return=ie,ie=se):(ge=Al(oe.type,oe.key,oe.props,null,ie.mode,ge),ge.ref=Ao(ie,se,oe),ge.return=ie,ie=ge)}return I(ie);case T:e:{for(Me=oe.key;se!==null;){if(se.key===Me)if(se.tag===4&&se.stateNode.containerInfo===oe.containerInfo&&se.stateNode.implementation===oe.implementation){u(ie,se.sibling),se=N(se,oe.children||[]),se.return=ie,ie=se;break e}else{u(ie,se);break}else n(ie,se);se=se.sibling}se=zu(oe,ie.mode,ge),se.return=ie,ie=se}return I(ie);case K:return Me=oe._init,vt(ie,se,Me(oe._payload),ge)}if(Ae(oe))return Ce(ie,se,oe,ge);if(D(oe))return Ne(ie,se,oe,ge);ll(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,se!==null&&se.tag===6?(u(ie,se.sibling),se=N(se,oe),se.return=ie,ie=se):(u(ie,se),se=Vu(oe,ie.mode,ge),se.return=ie,ie=se),I(ie)):u(ie,se)}return vt}var Si=fg(!0),pg=fg(!1),cl=Js(null),dl=null,Ci=null,Qd=null;function Zd(){Qd=Ci=dl=null}function eu(r){var n=cl.current;rt(cl),r._currentValue=n}function tu(r,n,u){for(;r!==null;){var w=r.alternate;if((r.childLanes&n)!==n?(r.childLanes|=n,w!==null&&(w.childLanes|=n)):w!==null&&(w.childLanes&n)!==n&&(w.childLanes|=n),r===u)break;r=r.return}}function ki(r,n){dl=r,Qd=Ci=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&n)!==0&&(cr=!0),r.firstContext=null)}function Lr(r){var n=r._currentValue;if(Qd!==r)if(r={context:r,memoizedValue:n,next:null},Ci===null){if(dl===null)throw Error(s(308));Ci=r,dl.dependencies={lanes:0,firstContext:r}}else Ci=Ci.next=r;return n}var An=null;function ru(r){An===null?An=[r]:An.push(r)}function mg(r,n,u,w){var N=n.interleaved;return N===null?(u.next=u,ru(n)):(u.next=N.next,N.next=u),n.interleaved=u,Cs(r,w)}function Cs(r,n){r.lanes|=n;var u=r.alternate;for(u!==null&&(u.lanes|=n),u=r,r=r.return;r!==null;)r.childLanes|=n,u=r.alternate,u!==null&&(u.childLanes|=n),u=r,r=r.return;return u.tag===3?u.stateNode:null}var en=!1;function su(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gg(r,n){r=r.updateQueue,n.updateQueue===r&&(n.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function ks(r,n){return{eventTime:r,lane:n,tag:0,payload:null,callback:null,next:null}}function tn(r,n,u){var w=r.updateQueue;if(w===null)return null;if(w=w.shared,(Ge&2)!==0){var N=w.pending;return N===null?n.next=n:(n.next=N.next,N.next=n),w.pending=n,Cs(r,u)}return N=w.interleaved,N===null?(n.next=n,ru(w)):(n.next=N.next,N.next=n),w.interleaved=n,Cs(r,u)}function ul(r,n,u){if(n=n.updateQueue,n!==null&&(n=n.shared,(u&4194240)!==0)){var w=n.lanes;w&=r.pendingLanes,u|=w,n.lanes=u,vd(r,u)}}function vg(r,n){var u=r.updateQueue,w=r.alternate;if(w!==null&&(w=w.updateQueue,u===w)){var N=null,A=null;if(u=u.firstBaseUpdate,u!==null){do{var I={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};A===null?N=A=I:A=A.next=I,u=u.next}while(u!==null);A===null?N=A=n:A=A.next=n}else N=A=n;u={baseState:w.baseState,firstBaseUpdate:N,lastBaseUpdate:A,shared:w.shared,effects:w.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=n:r.next=n,u.lastBaseUpdate=n}function hl(r,n,u,w){var N=r.updateQueue;en=!1;var A=N.firstBaseUpdate,I=N.lastBaseUpdate,Y=N.shared.pending;if(Y!==null){N.shared.pending=null;var te=Y,ae=te.next;te.next=null,I===null?A=ae:I.next=ae,I=te;var pe=r.alternate;pe!==null&&(pe=pe.updateQueue,Y=pe.lastBaseUpdate,Y!==I&&(Y===null?pe.firstBaseUpdate=ae:Y.next=ae,pe.lastBaseUpdate=te))}if(A!==null){var me=N.baseState;I=0,pe=ae=te=null,Y=A;do{var fe=Y.lane,_e=Y.eventTime;if((w&fe)===fe){pe!==null&&(pe=pe.next={eventTime:_e,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ce=r,Ne=Y;switch(fe=n,_e=u,Ne.tag){case 1:if(Ce=Ne.payload,typeof Ce=="function"){me=Ce.call(_e,me,fe);break e}me=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ne.payload,fe=typeof Ce=="function"?Ce.call(_e,me,fe):Ce,fe==null)break e;me=B({},me,fe);break e;case 2:en=!0}}Y.callback!==null&&Y.lane!==0&&(r.flags|=64,fe=N.effects,fe===null?N.effects=[Y]:fe.push(Y))}else _e={eventTime:_e,lane:fe,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},pe===null?(ae=pe=_e,te=me):pe=pe.next=_e,I|=fe;if(Y=Y.next,Y===null){if(Y=N.shared.pending,Y===null)break;fe=Y,Y=fe.next,fe.next=null,N.lastBaseUpdate=fe,N.shared.pending=null}}while(!0);if(pe===null&&(te=me),N.baseState=te,N.firstBaseUpdate=ae,N.lastBaseUpdate=pe,n=N.shared.interleaved,n!==null){N=n;do I|=N.lane,N=N.next;while(N!==n)}else A===null&&(N.shared.lanes=0);Ln|=I,r.lanes=I,r.memoizedState=me}}function yg(r,n,u){if(r=n.effects,n.effects=null,r!==null)for(n=0;n<r.length;n++){var w=r[n],N=w.callback;if(N!==null){if(w.callback=null,w=u,typeof N!="function")throw Error(s(191,N));N.call(w)}}}var Do={},os=Js(Do),Mo=Js(Do),Lo=Js(Do);function Dn(r){if(r===Do)throw Error(s(174));return r}function nu(r,n){switch(Qe(Lo,n),Qe(Mo,r),Qe(os,Do),r=n.nodeType,r){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ys(null,"");break;default:r=r===8?n.parentNode:n,n=r.namespaceURI||null,r=r.tagName,n=ys(n,r)}rt(os),Qe(os,n)}function Ei(){rt(os),rt(Mo),rt(Lo)}function xg(r){Dn(Lo.current);var n=Dn(os.current),u=ys(n,r.type);n!==u&&(Qe(Mo,r),Qe(os,u))}function iu(r){Mo.current===r&&(rt(os),rt(Mo))}var ot=Js(0);function fl(r){for(var n=r;n!==null;){if(n.tag===13){var u=n.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break;for(;n.sibling===null;){if(n.return===null||n.return===r)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ou=[];function au(){for(var r=0;r<ou.length;r++)ou[r]._workInProgressVersionPrimary=null;ou.length=0}var pl=k.ReactCurrentDispatcher,lu=k.ReactCurrentBatchConfig,Mn=0,at=null,kt=null,Tt=null,ml=!1,Oo=!1,Io=0,Wk=0;function Gt(){throw Error(s(321))}function cu(r,n){if(n===null)return!1;for(var u=0;u<n.length&&u<r.length;u++)if(!Ur(r[u],n[u]))return!1;return!0}function du(r,n,u,w,N,A){if(Mn=A,at=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,pl.current=r===null||r.memoizedState===null?qk:Yk,r=u(w,N),Oo){A=0;do{if(Oo=!1,Io=0,25<=A)throw Error(s(301));A+=1,Tt=kt=null,n.updateQueue=null,pl.current=Xk,r=u(w,N)}while(Oo)}if(pl.current=yl,n=kt!==null&&kt.next!==null,Mn=0,Tt=kt=at=null,ml=!1,n)throw Error(s(300));return r}function uu(){var r=Io!==0;return Io=0,r}function as(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?at.memoizedState=Tt=r:Tt=Tt.next=r,Tt}function Or(){if(kt===null){var r=at.alternate;r=r!==null?r.memoizedState:null}else r=kt.next;var n=Tt===null?at.memoizedState:Tt.next;if(n!==null)Tt=n,kt=r;else{if(r===null)throw Error(s(310));kt=r,r={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Tt===null?at.memoizedState=Tt=r:Tt=Tt.next=r}return Tt}function Bo(r,n){return typeof n=="function"?n(r):n}function hu(r){var n=Or(),u=n.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=r;var w=kt,N=w.baseQueue,A=u.pending;if(A!==null){if(N!==null){var I=N.next;N.next=A.next,A.next=I}w.baseQueue=N=A,u.pending=null}if(N!==null){A=N.next,w=w.baseState;var Y=I=null,te=null,ae=A;do{var pe=ae.lane;if((Mn&pe)===pe)te!==null&&(te=te.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),w=ae.hasEagerState?ae.eagerState:r(w,ae.action);else{var me={lane:pe,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};te===null?(Y=te=me,I=w):te=te.next=me,at.lanes|=pe,Ln|=pe}ae=ae.next}while(ae!==null&&ae!==A);te===null?I=w:te.next=Y,Ur(w,n.memoizedState)||(cr=!0),n.memoizedState=w,n.baseState=I,n.baseQueue=te,u.lastRenderedState=w}if(r=u.interleaved,r!==null){N=r;do A=N.lane,at.lanes|=A,Ln|=A,N=N.next;while(N!==r)}else N===null&&(u.lanes=0);return[n.memoizedState,u.dispatch]}function fu(r){var n=Or(),u=n.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=r;var w=u.dispatch,N=u.pending,A=n.memoizedState;if(N!==null){u.pending=null;var I=N=N.next;do A=r(A,I.action),I=I.next;while(I!==N);Ur(A,n.memoizedState)||(cr=!0),n.memoizedState=A,n.baseQueue===null&&(n.baseState=A),u.lastRenderedState=A}return[A,w]}function _g(){}function wg(r,n){var u=at,w=Or(),N=n(),A=!Ur(w.memoizedState,N);if(A&&(w.memoizedState=N,cr=!0),w=w.queue,pu(Cg.bind(null,u,w,r),[r]),w.getSnapshot!==n||A||Tt!==null&&Tt.memoizedState.tag&1){if(u.flags|=2048,Fo(9,Sg.bind(null,u,w,N,n),void 0,null),At===null)throw Error(s(349));(Mn&30)!==0||bg(u,n,N)}return N}function bg(r,n,u){r.flags|=16384,r={getSnapshot:n,value:u},n=at.updateQueue,n===null?(n={lastEffect:null,stores:null},at.updateQueue=n,n.stores=[r]):(u=n.stores,u===null?n.stores=[r]:u.push(r))}function Sg(r,n,u,w){n.value=u,n.getSnapshot=w,kg(n)&&Eg(r)}function Cg(r,n,u){return u(function(){kg(n)&&Eg(r)})}function kg(r){var n=r.getSnapshot;r=r.value;try{var u=n();return!Ur(r,u)}catch{return!0}}function Eg(r){var n=Cs(r,1);n!==null&&Xr(n,r,1,-1)}function jg(r){var n=as();return typeof r=="function"&&(r=r()),n.memoizedState=n.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:r},n.queue=r,r=r.dispatch=Gk.bind(null,at,r),[n.memoizedState,r]}function Fo(r,n,u,w){return r={tag:r,create:n,destroy:u,deps:w,next:null},n=at.updateQueue,n===null?(n={lastEffect:null,stores:null},at.updateQueue=n,n.lastEffect=r.next=r):(u=n.lastEffect,u===null?n.lastEffect=r.next=r:(w=u.next,u.next=r,r.next=w,n.lastEffect=r)),r}function Ng(){return Or().memoizedState}function gl(r,n,u,w){var N=as();at.flags|=r,N.memoizedState=Fo(1|n,u,void 0,w===void 0?null:w)}function vl(r,n,u,w){var N=Or();w=w===void 0?null:w;var A=void 0;if(kt!==null){var I=kt.memoizedState;if(A=I.destroy,w!==null&&cu(w,I.deps)){N.memoizedState=Fo(n,u,A,w);return}}at.flags|=r,N.memoizedState=Fo(1|n,u,A,w)}function Pg(r,n){return gl(8390656,8,r,n)}function pu(r,n){return vl(2048,8,r,n)}function Rg(r,n){return vl(4,2,r,n)}function Tg(r,n){return vl(4,4,r,n)}function Ag(r,n){if(typeof n=="function")return r=r(),n(r),function(){n(null)};if(n!=null)return r=r(),n.current=r,function(){n.current=null}}function Dg(r,n,u){return u=u!=null?u.concat([r]):null,vl(4,4,Ag.bind(null,n,r),u)}function mu(){}function Mg(r,n){var u=Or();n=n===void 0?null:n;var w=u.memoizedState;return w!==null&&n!==null&&cu(n,w[1])?w[0]:(u.memoizedState=[r,n],r)}function Lg(r,n){var u=Or();n=n===void 0?null:n;var w=u.memoizedState;return w!==null&&n!==null&&cu(n,w[1])?w[0]:(r=r(),u.memoizedState=[r,n],r)}function Og(r,n,u){return(Mn&21)===0?(r.baseState&&(r.baseState=!1,cr=!0),r.memoizedState=u):(Ur(u,n)||(u=hm(),at.lanes|=u,Ln|=u,r.baseState=!0),n)}function Uk(r,n){var u=Je;Je=u!==0&&4>u?u:4,r(!0);var w=lu.transition;lu.transition={};try{r(!1),n()}finally{Je=u,lu.transition=w}}function Ig(){return Or().memoizedState}function Kk(r,n,u){var w=on(r);if(u={lane:w,action:u,hasEagerState:!1,eagerState:null,next:null},Bg(r))Fg(n,u);else if(u=mg(r,n,u,w),u!==null){var N=nr();Xr(u,r,w,N),$g(u,n,w)}}function Gk(r,n,u){var w=on(r),N={lane:w,action:u,hasEagerState:!1,eagerState:null,next:null};if(Bg(r))Fg(n,N);else{var A=r.alternate;if(r.lanes===0&&(A===null||A.lanes===0)&&(A=n.lastRenderedReducer,A!==null))try{var I=n.lastRenderedState,Y=A(I,u);if(N.hasEagerState=!0,N.eagerState=Y,Ur(Y,I)){var te=n.interleaved;te===null?(N.next=N,ru(n)):(N.next=te.next,te.next=N),n.interleaved=N;return}}catch{}finally{}u=mg(r,n,N,w),u!==null&&(N=nr(),Xr(u,r,w,N),$g(u,n,w))}}function Bg(r){var n=r.alternate;return r===at||n!==null&&n===at}function Fg(r,n){Oo=ml=!0;var u=r.pending;u===null?n.next=n:(n.next=u.next,u.next=n),r.pending=n}function $g(r,n,u){if((u&4194240)!==0){var w=n.lanes;w&=r.pendingLanes,u|=w,n.lanes=u,vd(r,u)}}var yl={readContext:Lr,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useInsertionEffect:Gt,useLayoutEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useMutableSource:Gt,useSyncExternalStore:Gt,useId:Gt,unstable_isNewReconciler:!1},qk={readContext:Lr,useCallback:function(r,n){return as().memoizedState=[r,n===void 0?null:n],r},useContext:Lr,useEffect:Pg,useImperativeHandle:function(r,n,u){return u=u!=null?u.concat([r]):null,gl(4194308,4,Ag.bind(null,n,r),u)},useLayoutEffect:function(r,n){return gl(4194308,4,r,n)},useInsertionEffect:function(r,n){return gl(4,2,r,n)},useMemo:function(r,n){var u=as();return n=n===void 0?null:n,r=r(),u.memoizedState=[r,n],r},useReducer:function(r,n,u){var w=as();return n=u!==void 0?u(n):n,w.memoizedState=w.baseState=n,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:n},w.queue=r,r=r.dispatch=Kk.bind(null,at,r),[w.memoizedState,r]},useRef:function(r){var n=as();return r={current:r},n.memoizedState=r},useState:jg,useDebugValue:mu,useDeferredValue:function(r){return as().memoizedState=r},useTransition:function(){var r=jg(!1),n=r[0];return r=Uk.bind(null,r[1]),as().memoizedState=r,[n,r]},useMutableSource:function(){},useSyncExternalStore:function(r,n,u){var w=at,N=as();if(it){if(u===void 0)throw Error(s(407));u=u()}else{if(u=n(),At===null)throw Error(s(349));(Mn&30)!==0||bg(w,n,u)}N.memoizedState=u;var A={value:u,getSnapshot:n};return N.queue=A,Pg(Cg.bind(null,w,A,r),[r]),w.flags|=2048,Fo(9,Sg.bind(null,w,A,u,n),void 0,null),u},useId:function(){var r=as(),n=At.identifierPrefix;if(it){var u=Ss,w=bs;u=(w&~(1<<32-Wr(w)-1)).toString(32)+u,n=":"+n+"R"+u,u=Io++,0<u&&(n+="H"+u.toString(32)),n+=":"}else u=Wk++,n=":"+n+"r"+u.toString(32)+":";return r.memoizedState=n},unstable_isNewReconciler:!1},Yk={readContext:Lr,useCallback:Mg,useContext:Lr,useEffect:pu,useImperativeHandle:Dg,useInsertionEffect:Rg,useLayoutEffect:Tg,useMemo:Lg,useReducer:hu,useRef:Ng,useState:function(){return hu(Bo)},useDebugValue:mu,useDeferredValue:function(r){var n=Or();return Og(n,kt.memoizedState,r)},useTransition:function(){var r=hu(Bo)[0],n=Or().memoizedState;return[r,n]},useMutableSource:_g,useSyncExternalStore:wg,useId:Ig,unstable_isNewReconciler:!1},Xk={readContext:Lr,useCallback:Mg,useContext:Lr,useEffect:pu,useImperativeHandle:Dg,useInsertionEffect:Rg,useLayoutEffect:Tg,useMemo:Lg,useReducer:fu,useRef:Ng,useState:function(){return fu(Bo)},useDebugValue:mu,useDeferredValue:function(r){var n=Or();return kt===null?n.memoizedState=r:Og(n,kt.memoizedState,r)},useTransition:function(){var r=fu(Bo)[0],n=Or().memoizedState;return[r,n]},useMutableSource:_g,useSyncExternalStore:wg,useId:Ig,unstable_isNewReconciler:!1};function Gr(r,n){if(r&&r.defaultProps){n=B({},n),r=r.defaultProps;for(var u in r)n[u]===void 0&&(n[u]=r[u]);return n}return n}function gu(r,n,u,w){n=r.memoizedState,u=u(w,n),u=u==null?n:B({},n,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var xl={isMounted:function(r){return(r=r._reactInternals)?jn(r)===r:!1},enqueueSetState:function(r,n,u){r=r._reactInternals;var w=nr(),N=on(r),A=ks(w,N);A.payload=n,u!=null&&(A.callback=u),n=tn(r,A,N),n!==null&&(Xr(n,r,N,w),ul(n,r,N))},enqueueReplaceState:function(r,n,u){r=r._reactInternals;var w=nr(),N=on(r),A=ks(w,N);A.tag=1,A.payload=n,u!=null&&(A.callback=u),n=tn(r,A,N),n!==null&&(Xr(n,r,N,w),ul(n,r,N))},enqueueForceUpdate:function(r,n){r=r._reactInternals;var u=nr(),w=on(r),N=ks(u,w);N.tag=2,n!=null&&(N.callback=n),n=tn(r,N,w),n!==null&&(Xr(n,r,w,u),ul(n,r,w))}};function Hg(r,n,u,w,N,A,I){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(w,A,I):n.prototype&&n.prototype.isPureReactComponent?!ko(u,w)||!ko(N,A):!0}function Vg(r,n,u){var w=!1,N=Qs,A=n.contextType;return typeof A=="object"&&A!==null?A=Lr(A):(N=lr(n)?Pn:Kt.current,w=n.contextTypes,A=(w=w!=null)?xi(r,N):Qs),n=new n(u,A),r.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=xl,r.stateNode=n,n._reactInternals=r,w&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=N,r.__reactInternalMemoizedMaskedChildContext=A),n}function zg(r,n,u,w){r=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(u,w),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(u,w),n.state!==r&&xl.enqueueReplaceState(n,n.state,null)}function vu(r,n,u,w){var N=r.stateNode;N.props=u,N.state=r.memoizedState,N.refs={},su(r);var A=n.contextType;typeof A=="object"&&A!==null?N.context=Lr(A):(A=lr(n)?Pn:Kt.current,N.context=xi(r,A)),N.state=r.memoizedState,A=n.getDerivedStateFromProps,typeof A=="function"&&(gu(r,n,A,u),N.state=r.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(n=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),n!==N.state&&xl.enqueueReplaceState(N,N.state,null),hl(r,u,N,w),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308)}function ji(r,n){try{var u="",w=n;do u+=ce(w),w=w.return;while(w);var N=u}catch(A){N=`
|
|
39
|
+
Error generating stack: `+A.message+`
|
|
40
|
+
`+A.stack}return{value:r,source:n,stack:N,digest:null}}function yu(r,n,u){return{value:r,source:null,stack:u??null,digest:n??null}}function xu(r,n){try{console.error(n.value)}catch(u){setTimeout(function(){throw u})}}var Jk=typeof WeakMap=="function"?WeakMap:Map;function Wg(r,n,u){u=ks(-1,u),u.tag=3,u.payload={element:null};var w=n.value;return u.callback=function(){El||(El=!0,Mu=w),xu(r,n)},u}function Ug(r,n,u){u=ks(-1,u),u.tag=3;var w=r.type.getDerivedStateFromError;if(typeof w=="function"){var N=n.value;u.payload=function(){return w(N)},u.callback=function(){xu(r,n)}}var A=r.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(u.callback=function(){xu(r,n),typeof w!="function"&&(sn===null?sn=new Set([this]):sn.add(this));var I=n.stack;this.componentDidCatch(n.value,{componentStack:I!==null?I:""})}),u}function Kg(r,n,u){var w=r.pingCache;if(w===null){w=r.pingCache=new Jk;var N=new Set;w.set(n,N)}else N=w.get(n),N===void 0&&(N=new Set,w.set(n,N));N.has(u)||(N.add(u),r=u2.bind(null,r,n,u),n.then(r,r))}function Gg(r){do{var n;if((n=r.tag===13)&&(n=r.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return r;r=r.return}while(r!==null);return null}function qg(r,n,u,w,N){return(r.mode&1)===0?(r===n?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(n=ks(-1,1),n.tag=2,tn(u,n,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=N,r)}var Qk=k.ReactCurrentOwner,cr=!1;function sr(r,n,u,w){n.child=r===null?pg(n,null,u,w):Si(n,r.child,u,w)}function Yg(r,n,u,w,N){u=u.render;var A=n.ref;return ki(n,N),w=du(r,n,u,w,A,N),u=uu(),r!==null&&!cr?(n.updateQueue=r.updateQueue,n.flags&=-2053,r.lanes&=~N,Es(r,n,N)):(it&&u&&Gd(n),n.flags|=1,sr(r,n,w,N),n.child)}function Xg(r,n,u,w,N){if(r===null){var A=u.type;return typeof A=="function"&&!Hu(A)&&A.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(n.tag=15,n.type=A,Jg(r,n,A,w,N)):(r=Al(u.type,null,w,n,n.mode,N),r.ref=n.ref,r.return=n,n.child=r)}if(A=r.child,(r.lanes&N)===0){var I=A.memoizedProps;if(u=u.compare,u=u!==null?u:ko,u(I,w)&&r.ref===n.ref)return Es(r,n,N)}return n.flags|=1,r=ln(A,w),r.ref=n.ref,r.return=n,n.child=r}function Jg(r,n,u,w,N){if(r!==null){var A=r.memoizedProps;if(ko(A,w)&&r.ref===n.ref)if(cr=!1,n.pendingProps=w=A,(r.lanes&N)!==0)(r.flags&131072)!==0&&(cr=!0);else return n.lanes=r.lanes,Es(r,n,N)}return _u(r,n,u,w,N)}function Qg(r,n,u){var w=n.pendingProps,N=w.children,A=r!==null?r.memoizedState:null;if(w.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(Pi,Cr),Cr|=u;else{if((u&1073741824)===0)return r=A!==null?A.baseLanes|u:u,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:r,cachePool:null,transitions:null},n.updateQueue=null,Qe(Pi,Cr),Cr|=r,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=A!==null?A.baseLanes:u,Qe(Pi,Cr),Cr|=w}else A!==null?(w=A.baseLanes|u,n.memoizedState=null):w=u,Qe(Pi,Cr),Cr|=w;return sr(r,n,N,u),n.child}function Zg(r,n){var u=n.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(n.flags|=512,n.flags|=2097152)}function _u(r,n,u,w,N){var A=lr(u)?Pn:Kt.current;return A=xi(n,A),ki(n,N),u=du(r,n,u,w,A,N),w=uu(),r!==null&&!cr?(n.updateQueue=r.updateQueue,n.flags&=-2053,r.lanes&=~N,Es(r,n,N)):(it&&w&&Gd(n),n.flags|=1,sr(r,n,u,N),n.child)}function ev(r,n,u,w,N){if(lr(u)){var A=!0;sl(n)}else A=!1;if(ki(n,N),n.stateNode===null)wl(r,n),Vg(n,u,w),vu(n,u,w,N),w=!0;else if(r===null){var I=n.stateNode,Y=n.memoizedProps;I.props=Y;var te=I.context,ae=u.contextType;typeof ae=="object"&&ae!==null?ae=Lr(ae):(ae=lr(u)?Pn:Kt.current,ae=xi(n,ae));var pe=u.getDerivedStateFromProps,me=typeof pe=="function"||typeof I.getSnapshotBeforeUpdate=="function";me||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==w||te!==ae)&&zg(n,I,w,ae),en=!1;var fe=n.memoizedState;I.state=fe,hl(n,w,I,N),te=n.memoizedState,Y!==w||fe!==te||ar.current||en?(typeof pe=="function"&&(gu(n,u,pe,w),te=n.memoizedState),(Y=en||Hg(n,u,Y,w,fe,te,ae))?(me||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(n.flags|=4194308)):(typeof I.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=w,n.memoizedState=te),I.props=w,I.state=te,I.context=ae,w=Y):(typeof I.componentDidMount=="function"&&(n.flags|=4194308),w=!1)}else{I=n.stateNode,gg(r,n),Y=n.memoizedProps,ae=n.type===n.elementType?Y:Gr(n.type,Y),I.props=ae,me=n.pendingProps,fe=I.context,te=u.contextType,typeof te=="object"&&te!==null?te=Lr(te):(te=lr(u)?Pn:Kt.current,te=xi(n,te));var _e=u.getDerivedStateFromProps;(pe=typeof _e=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==me||fe!==te)&&zg(n,I,w,te),en=!1,fe=n.memoizedState,I.state=fe,hl(n,w,I,N);var Ce=n.memoizedState;Y!==me||fe!==Ce||ar.current||en?(typeof _e=="function"&&(gu(n,u,_e,w),Ce=n.memoizedState),(ae=en||Hg(n,u,ae,w,fe,Ce,te)||!1)?(pe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,Ce,te),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,Ce,te)),typeof I.componentDidUpdate=="function"&&(n.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof I.componentDidUpdate!="function"||Y===r.memoizedProps&&fe===r.memoizedState||(n.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===r.memoizedProps&&fe===r.memoizedState||(n.flags|=1024),n.memoizedProps=w,n.memoizedState=Ce),I.props=w,I.state=Ce,I.context=te,w=ae):(typeof I.componentDidUpdate!="function"||Y===r.memoizedProps&&fe===r.memoizedState||(n.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===r.memoizedProps&&fe===r.memoizedState||(n.flags|=1024),w=!1)}return wu(r,n,u,w,A,N)}function wu(r,n,u,w,N,A){Zg(r,n);var I=(n.flags&128)!==0;if(!w&&!I)return N&&ig(n,u,!1),Es(r,n,A);w=n.stateNode,Qk.current=n;var Y=I&&typeof u.getDerivedStateFromError!="function"?null:w.render();return n.flags|=1,r!==null&&I?(n.child=Si(n,r.child,null,A),n.child=Si(n,null,Y,A)):sr(r,n,Y,A),n.memoizedState=w.state,N&&ig(n,u,!0),n.child}function tv(r){var n=r.stateNode;n.pendingContext?sg(r,n.pendingContext,n.pendingContext!==n.context):n.context&&sg(r,n.context,!1),nu(r,n.containerInfo)}function rv(r,n,u,w,N){return bi(),Jd(N),n.flags|=256,sr(r,n,u,w),n.child}var bu={dehydrated:null,treeContext:null,retryLane:0};function Su(r){return{baseLanes:r,cachePool:null,transitions:null}}function sv(r,n,u){var w=n.pendingProps,N=ot.current,A=!1,I=(n.flags&128)!==0,Y;if((Y=I)||(Y=r!==null&&r.memoizedState===null?!1:(N&2)!==0),Y?(A=!0,n.flags&=-129):(r===null||r.memoizedState!==null)&&(N|=1),Qe(ot,N&1),r===null)return Xd(n),r=n.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((n.mode&1)===0?n.lanes=1:r.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(I=w.children,r=w.fallback,A?(w=n.mode,A=n.child,I={mode:"hidden",children:I},(w&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=I):A=Dl(I,w,0,null),r=Fn(r,w,u,null),A.return=n,r.return=n,A.sibling=r,n.child=A,n.child.memoizedState=Su(u),n.memoizedState=bu,r):Cu(n,I));if(N=r.memoizedState,N!==null&&(Y=N.dehydrated,Y!==null))return Zk(r,n,I,w,Y,N,u);if(A){A=w.fallback,I=n.mode,N=r.child,Y=N.sibling;var te={mode:"hidden",children:w.children};return(I&1)===0&&n.child!==N?(w=n.child,w.childLanes=0,w.pendingProps=te,n.deletions=null):(w=ln(N,te),w.subtreeFlags=N.subtreeFlags&14680064),Y!==null?A=ln(Y,A):(A=Fn(A,I,u,null),A.flags|=2),A.return=n,w.return=n,w.sibling=A,n.child=w,w=A,A=n.child,I=r.child.memoizedState,I=I===null?Su(u):{baseLanes:I.baseLanes|u,cachePool:null,transitions:I.transitions},A.memoizedState=I,A.childLanes=r.childLanes&~u,n.memoizedState=bu,w}return A=r.child,r=A.sibling,w=ln(A,{mode:"visible",children:w.children}),(n.mode&1)===0&&(w.lanes=u),w.return=n,w.sibling=null,r!==null&&(u=n.deletions,u===null?(n.deletions=[r],n.flags|=16):u.push(r)),n.child=w,n.memoizedState=null,w}function Cu(r,n){return n=Dl({mode:"visible",children:n},r.mode,0,null),n.return=r,r.child=n}function _l(r,n,u,w){return w!==null&&Jd(w),Si(n,r.child,null,u),r=Cu(n,n.pendingProps.children),r.flags|=2,n.memoizedState=null,r}function Zk(r,n,u,w,N,A,I){if(u)return n.flags&256?(n.flags&=-257,w=yu(Error(s(422))),_l(r,n,I,w)):n.memoizedState!==null?(n.child=r.child,n.flags|=128,null):(A=w.fallback,N=n.mode,w=Dl({mode:"visible",children:w.children},N,0,null),A=Fn(A,N,I,null),A.flags|=2,w.return=n,A.return=n,w.sibling=A,n.child=w,(n.mode&1)!==0&&Si(n,r.child,null,I),n.child.memoizedState=Su(I),n.memoizedState=bu,A);if((n.mode&1)===0)return _l(r,n,I,null);if(N.data==="$!"){if(w=N.nextSibling&&N.nextSibling.dataset,w)var Y=w.dgst;return w=Y,A=Error(s(419)),w=yu(A,w,void 0),_l(r,n,I,w)}if(Y=(I&r.childLanes)!==0,cr||Y){if(w=At,w!==null){switch(I&-I){case 4:N=2;break;case 16:N=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:N=32;break;case 536870912:N=268435456;break;default:N=0}N=(N&(w.suspendedLanes|I))!==0?0:N,N!==0&&N!==A.retryLane&&(A.retryLane=N,Cs(r,N),Xr(w,r,N,-1))}return $u(),w=yu(Error(s(421))),_l(r,n,I,w)}return N.data==="$?"?(n.flags|=128,n.child=r.child,n=h2.bind(null,r),N._reactRetry=n,null):(r=A.treeContext,Sr=Xs(N.nextSibling),br=n,it=!0,Kr=null,r!==null&&(Dr[Mr++]=bs,Dr[Mr++]=Ss,Dr[Mr++]=Rn,bs=r.id,Ss=r.overflow,Rn=n),n=Cu(n,w.children),n.flags|=4096,n)}function nv(r,n,u){r.lanes|=n;var w=r.alternate;w!==null&&(w.lanes|=n),tu(r.return,n,u)}function ku(r,n,u,w,N){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:w,tail:u,tailMode:N}:(A.isBackwards=n,A.rendering=null,A.renderingStartTime=0,A.last=w,A.tail=u,A.tailMode=N)}function iv(r,n,u){var w=n.pendingProps,N=w.revealOrder,A=w.tail;if(sr(r,n,w.children,u),w=ot.current,(w&2)!==0)w=w&1|2,n.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=n.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&nv(r,u,n);else if(r.tag===19)nv(r,u,n);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}w&=1}if(Qe(ot,w),(n.mode&1)===0)n.memoizedState=null;else switch(N){case"forwards":for(u=n.child,N=null;u!==null;)r=u.alternate,r!==null&&fl(r)===null&&(N=u),u=u.sibling;u=N,u===null?(N=n.child,n.child=null):(N=u.sibling,u.sibling=null),ku(n,!1,N,u,A);break;case"backwards":for(u=null,N=n.child,n.child=null;N!==null;){if(r=N.alternate,r!==null&&fl(r)===null){n.child=N;break}r=N.sibling,N.sibling=u,u=N,N=r}ku(n,!0,u,null,A);break;case"together":ku(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function wl(r,n){(n.mode&1)===0&&r!==null&&(r.alternate=null,n.alternate=null,n.flags|=2)}function Es(r,n,u){if(r!==null&&(n.dependencies=r.dependencies),Ln|=n.lanes,(u&n.childLanes)===0)return null;if(r!==null&&n.child!==r.child)throw Error(s(153));if(n.child!==null){for(r=n.child,u=ln(r,r.pendingProps),n.child=u,u.return=n;r.sibling!==null;)r=r.sibling,u=u.sibling=ln(r,r.pendingProps),u.return=n;u.sibling=null}return n.child}function e2(r,n,u){switch(n.tag){case 3:tv(n),bi();break;case 5:xg(n);break;case 1:lr(n.type)&&sl(n);break;case 4:nu(n,n.stateNode.containerInfo);break;case 10:var w=n.type._context,N=n.memoizedProps.value;Qe(cl,w._currentValue),w._currentValue=N;break;case 13:if(w=n.memoizedState,w!==null)return w.dehydrated!==null?(Qe(ot,ot.current&1),n.flags|=128,null):(u&n.child.childLanes)!==0?sv(r,n,u):(Qe(ot,ot.current&1),r=Es(r,n,u),r!==null?r.sibling:null);Qe(ot,ot.current&1);break;case 19:if(w=(u&n.childLanes)!==0,(r.flags&128)!==0){if(w)return iv(r,n,u);n.flags|=128}if(N=n.memoizedState,N!==null&&(N.rendering=null,N.tail=null,N.lastEffect=null),Qe(ot,ot.current),w)break;return null;case 22:case 23:return n.lanes=0,Qg(r,n,u)}return Es(r,n,u)}var ov,Eu,av,lv;ov=function(r,n){for(var u=n.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===n)break;for(;u.sibling===null;){if(u.return===null||u.return===n)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},Eu=function(){},av=function(r,n,u,w){var N=r.memoizedProps;if(N!==w){r=n.stateNode,Dn(os.current);var A=null;switch(u){case"input":N=Te(r,N),w=Te(r,w),A=[];break;case"select":N=B({},N,{value:void 0}),w=B({},w,{value:void 0}),A=[];break;case"textarea":N=Fe(r,N),w=Fe(r,w),A=[];break;default:typeof N.onClick!="function"&&typeof w.onClick=="function"&&(r.onclick=el)}ci(u,w);var I;u=null;for(ae in N)if(!w.hasOwnProperty(ae)&&N.hasOwnProperty(ae)&&N[ae]!=null)if(ae==="style"){var Y=N[ae];for(I in Y)Y.hasOwnProperty(I)&&(u||(u={}),u[I]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(l.hasOwnProperty(ae)?A||(A=[]):(A=A||[]).push(ae,null));for(ae in w){var te=w[ae];if(Y=N!=null?N[ae]:void 0,w.hasOwnProperty(ae)&&te!==Y&&(te!=null||Y!=null))if(ae==="style")if(Y){for(I in Y)!Y.hasOwnProperty(I)||te&&te.hasOwnProperty(I)||(u||(u={}),u[I]="");for(I in te)te.hasOwnProperty(I)&&Y[I]!==te[I]&&(u||(u={}),u[I]=te[I])}else u||(A||(A=[]),A.push(ae,u)),u=te;else ae==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Y=Y?Y.__html:void 0,te!=null&&Y!==te&&(A=A||[]).push(ae,te)):ae==="children"?typeof te!="string"&&typeof te!="number"||(A=A||[]).push(ae,""+te):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(l.hasOwnProperty(ae)?(te!=null&&ae==="onScroll"&&tt("scroll",r),A||Y===te||(A=[])):(A=A||[]).push(ae,te))}u&&(A=A||[]).push("style",u);var ae=A;(n.updateQueue=ae)&&(n.flags|=4)}},lv=function(r,n,u,w){u!==w&&(n.flags|=4)};function $o(r,n){if(!it)switch(r.tailMode){case"hidden":n=r.tail;for(var u=null;n!==null;)n.alternate!==null&&(u=n),n=n.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var w=null;u!==null;)u.alternate!==null&&(w=u),u=u.sibling;w===null?n||r.tail===null?r.tail=null:r.tail.sibling=null:w.sibling=null}}function qt(r){var n=r.alternate!==null&&r.alternate.child===r.child,u=0,w=0;if(n)for(var N=r.child;N!==null;)u|=N.lanes|N.childLanes,w|=N.subtreeFlags&14680064,w|=N.flags&14680064,N.return=r,N=N.sibling;else for(N=r.child;N!==null;)u|=N.lanes|N.childLanes,w|=N.subtreeFlags,w|=N.flags,N.return=r,N=N.sibling;return r.subtreeFlags|=w,r.childLanes=u,n}function t2(r,n,u){var w=n.pendingProps;switch(qd(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(n),null;case 1:return lr(n.type)&&rl(),qt(n),null;case 3:return w=n.stateNode,Ei(),rt(ar),rt(Kt),au(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(r===null||r.child===null)&&(al(n)?n.flags|=4:r===null||r.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kr!==null&&(Iu(Kr),Kr=null))),Eu(r,n),qt(n),null;case 5:iu(n);var N=Dn(Lo.current);if(u=n.type,r!==null&&n.stateNode!=null)av(r,n,u,w,N),r.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!w){if(n.stateNode===null)throw Error(s(166));return qt(n),null}if(r=Dn(os.current),al(n)){w=n.stateNode,u=n.type;var A=n.memoizedProps;switch(w[is]=n,w[Ro]=A,r=(n.mode&1)!==0,u){case"dialog":tt("cancel",w),tt("close",w);break;case"iframe":case"object":case"embed":tt("load",w);break;case"video":case"audio":for(N=0;N<jo.length;N++)tt(jo[N],w);break;case"source":tt("error",w);break;case"img":case"image":case"link":tt("error",w),tt("load",w);break;case"details":tt("toggle",w);break;case"input":Be(w,A),tt("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!A.multiple},tt("invalid",w);break;case"textarea":He(w,A),tt("invalid",w)}ci(u,A),N=null;for(var I in A)if(A.hasOwnProperty(I)){var Y=A[I];I==="children"?typeof Y=="string"?w.textContent!==Y&&(A.suppressHydrationWarning!==!0&&Za(w.textContent,Y,r),N=["children",Y]):typeof Y=="number"&&w.textContent!==""+Y&&(A.suppressHydrationWarning!==!0&&Za(w.textContent,Y,r),N=["children",""+Y]):l.hasOwnProperty(I)&&Y!=null&&I==="onScroll"&&tt("scroll",w)}switch(u){case"input":q(w),zt(w,A,!0);break;case"textarea":q(w),ut(w);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(w.onclick=el)}w=N,n.updateQueue=w,w!==null&&(n.flags|=4)}else{I=N.nodeType===9?N:N.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=xr(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=I.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof w.is=="string"?r=I.createElement(u,{is:w.is}):(r=I.createElement(u),u==="select"&&(I=r,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):r=I.createElementNS(r,u),r[is]=n,r[Ro]=w,ov(r,n,!1,!1),n.stateNode=r;e:{switch(I=lo(u,w),u){case"dialog":tt("cancel",r),tt("close",r),N=w;break;case"iframe":case"object":case"embed":tt("load",r),N=w;break;case"video":case"audio":for(N=0;N<jo.length;N++)tt(jo[N],r);N=w;break;case"source":tt("error",r),N=w;break;case"img":case"image":case"link":tt("error",r),tt("load",r),N=w;break;case"details":tt("toggle",r),N=w;break;case"input":Be(r,w),N=Te(r,w),tt("invalid",r);break;case"option":N=w;break;case"select":r._wrapperState={wasMultiple:!!w.multiple},N=B({},w,{value:void 0}),tt("invalid",r);break;case"textarea":He(r,w),N=Fe(r,w),tt("invalid",r);break;default:N=w}ci(u,N),Y=N;for(A in Y)if(Y.hasOwnProperty(A)){var te=Y[A];A==="style"?Da(r,te):A==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&zr(r,te)):A==="children"?typeof te=="string"?(u!=="textarea"||te!=="")&&pt(r,te):typeof te=="number"&&pt(r,""+te):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(l.hasOwnProperty(A)?te!=null&&A==="onScroll"&&tt("scroll",r):te!=null&&x(r,A,te,I))}switch(u){case"input":q(r),zt(r,w,!1);break;case"textarea":q(r),ut(r);break;case"option":w.value!=null&&r.setAttribute("value",""+O(w.value));break;case"select":r.multiple=!!w.multiple,A=w.value,A!=null?De(r,!!w.multiple,A,!1):w.defaultValue!=null&&De(r,!!w.multiple,w.defaultValue,!0);break;default:typeof N.onClick=="function"&&(r.onclick=el)}switch(u){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return qt(n),null;case 6:if(r&&n.stateNode!=null)lv(r,n,r.memoizedProps,w);else{if(typeof w!="string"&&n.stateNode===null)throw Error(s(166));if(u=Dn(Lo.current),Dn(os.current),al(n)){if(w=n.stateNode,u=n.memoizedProps,w[is]=n,(A=w.nodeValue!==u)&&(r=br,r!==null))switch(r.tag){case 3:Za(w.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Za(w.nodeValue,u,(r.mode&1)!==0)}A&&(n.flags|=4)}else w=(u.nodeType===9?u:u.ownerDocument).createTextNode(w),w[is]=n,n.stateNode=w}return qt(n),null;case 13:if(rt(ot),w=n.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(it&&Sr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)ug(),bi(),n.flags|=98560,A=!1;else if(A=al(n),w!==null&&w.dehydrated!==null){if(r===null){if(!A)throw Error(s(318));if(A=n.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(s(317));A[is]=n}else bi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;qt(n),A=!1}else Kr!==null&&(Iu(Kr),Kr=null),A=!0;if(!A)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=u,n):(w=w!==null,w!==(r!==null&&r.memoizedState!==null)&&w&&(n.child.flags|=8192,(n.mode&1)!==0&&(r===null||(ot.current&1)!==0?Et===0&&(Et=3):$u())),n.updateQueue!==null&&(n.flags|=4),qt(n),null);case 4:return Ei(),Eu(r,n),r===null&&No(n.stateNode.containerInfo),qt(n),null;case 10:return eu(n.type._context),qt(n),null;case 17:return lr(n.type)&&rl(),qt(n),null;case 19:if(rt(ot),A=n.memoizedState,A===null)return qt(n),null;if(w=(n.flags&128)!==0,I=A.rendering,I===null)if(w)$o(A,!1);else{if(Et!==0||r!==null&&(r.flags&128)!==0)for(r=n.child;r!==null;){if(I=fl(r),I!==null){for(n.flags|=128,$o(A,!1),w=I.updateQueue,w!==null&&(n.updateQueue=w,n.flags|=4),n.subtreeFlags=0,w=u,u=n.child;u!==null;)A=u,r=w,A.flags&=14680066,I=A.alternate,I===null?(A.childLanes=0,A.lanes=r,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=I.childLanes,A.lanes=I.lanes,A.child=I.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=I.memoizedProps,A.memoizedState=I.memoizedState,A.updateQueue=I.updateQueue,A.type=I.type,r=I.dependencies,A.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return Qe(ot,ot.current&1|2),n.child}r=r.sibling}A.tail!==null&>()>Ri&&(n.flags|=128,w=!0,$o(A,!1),n.lanes=4194304)}else{if(!w)if(r=fl(I),r!==null){if(n.flags|=128,w=!0,u=r.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),$o(A,!0),A.tail===null&&A.tailMode==="hidden"&&!I.alternate&&!it)return qt(n),null}else 2*gt()-A.renderingStartTime>Ri&&u!==1073741824&&(n.flags|=128,w=!0,$o(A,!1),n.lanes=4194304);A.isBackwards?(I.sibling=n.child,n.child=I):(u=A.last,u!==null?u.sibling=I:n.child=I,A.last=I)}return A.tail!==null?(n=A.tail,A.rendering=n,A.tail=n.sibling,A.renderingStartTime=gt(),n.sibling=null,u=ot.current,Qe(ot,w?u&1|2:u&1),n):(qt(n),null);case 22:case 23:return Fu(),w=n.memoizedState!==null,r!==null&&r.memoizedState!==null!==w&&(n.flags|=8192),w&&(n.mode&1)!==0?(Cr&1073741824)!==0&&(qt(n),n.subtreeFlags&6&&(n.flags|=8192)):qt(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function r2(r,n){switch(qd(n),n.tag){case 1:return lr(n.type)&&rl(),r=n.flags,r&65536?(n.flags=r&-65537|128,n):null;case 3:return Ei(),rt(ar),rt(Kt),au(),r=n.flags,(r&65536)!==0&&(r&128)===0?(n.flags=r&-65537|128,n):null;case 5:return iu(n),null;case 13:if(rt(ot),r=n.memoizedState,r!==null&&r.dehydrated!==null){if(n.alternate===null)throw Error(s(340));bi()}return r=n.flags,r&65536?(n.flags=r&-65537|128,n):null;case 19:return rt(ot),null;case 4:return Ei(),null;case 10:return eu(n.type._context),null;case 22:case 23:return Fu(),null;case 24:return null;default:return null}}var bl=!1,Yt=!1,s2=typeof WeakSet=="function"?WeakSet:Set,be=null;function Ni(r,n){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(w){ht(r,n,w)}else u.current=null}function ju(r,n,u){try{u()}catch(w){ht(r,n,w)}}var cv=!1;function n2(r,n){if(Fd=Va,r=Hm(),Td(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var w=u.getSelection&&u.getSelection();if(w&&w.rangeCount!==0){u=w.anchorNode;var N=w.anchorOffset,A=w.focusNode;w=w.focusOffset;try{u.nodeType,A.nodeType}catch{u=null;break e}var I=0,Y=-1,te=-1,ae=0,pe=0,me=r,fe=null;t:for(;;){for(var _e;me!==u||N!==0&&me.nodeType!==3||(Y=I+N),me!==A||w!==0&&me.nodeType!==3||(te=I+w),me.nodeType===3&&(I+=me.nodeValue.length),(_e=me.firstChild)!==null;)fe=me,me=_e;for(;;){if(me===r)break t;if(fe===u&&++ae===N&&(Y=I),fe===A&&++pe===w&&(te=I),(_e=me.nextSibling)!==null)break;me=fe,fe=me.parentNode}me=_e}u=Y===-1||te===-1?null:{start:Y,end:te}}else u=null}u=u||{start:0,end:0}}else u=null;for($d={focusedElem:r,selectionRange:u},Va=!1,be=n;be!==null;)if(n=be,r=n.child,(n.subtreeFlags&1028)!==0&&r!==null)r.return=n,be=r;else for(;be!==null;){n=be;try{var Ce=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ce!==null){var Ne=Ce.memoizedProps,vt=Ce.memoizedState,ie=n.stateNode,se=ie.getSnapshotBeforeUpdate(n.elementType===n.type?Ne:Gr(n.type,Ne),vt);ie.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var oe=n.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ge){ht(n,n.return,ge)}if(r=n.sibling,r!==null){r.return=n.return,be=r;break}be=n.return}return Ce=cv,cv=!1,Ce}function Ho(r,n,u){var w=n.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var N=w=w.next;do{if((N.tag&r)===r){var A=N.destroy;N.destroy=void 0,A!==void 0&&ju(n,u,A)}N=N.next}while(N!==w)}}function Sl(r,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var u=n=n.next;do{if((u.tag&r)===r){var w=u.create;u.destroy=w()}u=u.next}while(u!==n)}}function Nu(r){var n=r.ref;if(n!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof n=="function"?n(r):n.current=r}}function dv(r){var n=r.alternate;n!==null&&(r.alternate=null,dv(n)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(n=r.stateNode,n!==null&&(delete n[is],delete n[Ro],delete n[Wd],delete n[$k],delete n[Hk])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function uv(r){return r.tag===5||r.tag===3||r.tag===4}function hv(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||uv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Pu(r,n,u){var w=r.tag;if(w===5||w===6)r=r.stateNode,n?u.nodeType===8?u.parentNode.insertBefore(r,n):u.insertBefore(r,n):(u.nodeType===8?(n=u.parentNode,n.insertBefore(r,u)):(n=u,n.appendChild(r)),u=u._reactRootContainer,u!=null||n.onclick!==null||(n.onclick=el));else if(w!==4&&(r=r.child,r!==null))for(Pu(r,n,u),r=r.sibling;r!==null;)Pu(r,n,u),r=r.sibling}function Ru(r,n,u){var w=r.tag;if(w===5||w===6)r=r.stateNode,n?u.insertBefore(r,n):u.appendChild(r);else if(w!==4&&(r=r.child,r!==null))for(Ru(r,n,u),r=r.sibling;r!==null;)Ru(r,n,u),r=r.sibling}var It=null,qr=!1;function rn(r,n,u){for(u=u.child;u!==null;)fv(r,n,u),u=u.sibling}function fv(r,n,u){if(ns&&typeof ns.onCommitFiberUnmount=="function")try{ns.onCommitFiberUnmount(Oa,u)}catch{}switch(u.tag){case 5:Yt||Ni(u,n);case 6:var w=It,N=qr;It=null,rn(r,n,u),It=w,qr=N,It!==null&&(qr?(r=It,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):It.removeChild(u.stateNode));break;case 18:It!==null&&(qr?(r=It,u=u.stateNode,r.nodeType===8?zd(r.parentNode,u):r.nodeType===1&&zd(r,u),xo(r)):zd(It,u.stateNode));break;case 4:w=It,N=qr,It=u.stateNode.containerInfo,qr=!0,rn(r,n,u),It=w,qr=N;break;case 0:case 11:case 14:case 15:if(!Yt&&(w=u.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){N=w=w.next;do{var A=N,I=A.destroy;A=A.tag,I!==void 0&&((A&2)!==0||(A&4)!==0)&&ju(u,n,I),N=N.next}while(N!==w)}rn(r,n,u);break;case 1:if(!Yt&&(Ni(u,n),w=u.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=u.memoizedProps,w.state=u.memoizedState,w.componentWillUnmount()}catch(Y){ht(u,n,Y)}rn(r,n,u);break;case 21:rn(r,n,u);break;case 22:u.mode&1?(Yt=(w=Yt)||u.memoizedState!==null,rn(r,n,u),Yt=w):rn(r,n,u);break;default:rn(r,n,u)}}function pv(r){var n=r.updateQueue;if(n!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new s2),n.forEach(function(w){var N=f2.bind(null,r,w);u.has(w)||(u.add(w),w.then(N,N))})}}function Yr(r,n){var u=n.deletions;if(u!==null)for(var w=0;w<u.length;w++){var N=u[w];try{var A=r,I=n,Y=I;e:for(;Y!==null;){switch(Y.tag){case 5:It=Y.stateNode,qr=!1;break e;case 3:It=Y.stateNode.containerInfo,qr=!0;break e;case 4:It=Y.stateNode.containerInfo,qr=!0;break e}Y=Y.return}if(It===null)throw Error(s(160));fv(A,I,N),It=null,qr=!1;var te=N.alternate;te!==null&&(te.return=null),N.return=null}catch(ae){ht(N,n,ae)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)mv(n,r),n=n.sibling}function mv(r,n){var u=r.alternate,w=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Yr(n,r),ls(r),w&4){try{Ho(3,r,r.return),Sl(3,r)}catch(Ne){ht(r,r.return,Ne)}try{Ho(5,r,r.return)}catch(Ne){ht(r,r.return,Ne)}}break;case 1:Yr(n,r),ls(r),w&512&&u!==null&&Ni(u,u.return);break;case 5:if(Yr(n,r),ls(r),w&512&&u!==null&&Ni(u,u.return),r.flags&32){var N=r.stateNode;try{pt(N,"")}catch(Ne){ht(r,r.return,Ne)}}if(w&4&&(N=r.stateNode,N!=null)){var A=r.memoizedProps,I=u!==null?u.memoizedProps:A,Y=r.type,te=r.updateQueue;if(r.updateQueue=null,te!==null)try{Y==="input"&&A.type==="radio"&&A.name!=null&&Ke(N,A),lo(Y,I);var ae=lo(Y,A);for(I=0;I<te.length;I+=2){var pe=te[I],me=te[I+1];pe==="style"?Da(N,me):pe==="dangerouslySetInnerHTML"?zr(N,me):pe==="children"?pt(N,me):x(N,pe,me,ae)}switch(Y){case"input":je(N,A);break;case"textarea":Pt(N,A);break;case"select":var fe=N._wrapperState.wasMultiple;N._wrapperState.wasMultiple=!!A.multiple;var _e=A.value;_e!=null?De(N,!!A.multiple,_e,!1):fe!==!!A.multiple&&(A.defaultValue!=null?De(N,!!A.multiple,A.defaultValue,!0):De(N,!!A.multiple,A.multiple?[]:"",!1))}N[Ro]=A}catch(Ne){ht(r,r.return,Ne)}}break;case 6:if(Yr(n,r),ls(r),w&4){if(r.stateNode===null)throw Error(s(162));N=r.stateNode,A=r.memoizedProps;try{N.nodeValue=A}catch(Ne){ht(r,r.return,Ne)}}break;case 3:if(Yr(n,r),ls(r),w&4&&u!==null&&u.memoizedState.isDehydrated)try{xo(n.containerInfo)}catch(Ne){ht(r,r.return,Ne)}break;case 4:Yr(n,r),ls(r);break;case 13:Yr(n,r),ls(r),N=r.child,N.flags&8192&&(A=N.memoizedState!==null,N.stateNode.isHidden=A,!A||N.alternate!==null&&N.alternate.memoizedState!==null||(Du=gt())),w&4&&pv(r);break;case 22:if(pe=u!==null&&u.memoizedState!==null,r.mode&1?(Yt=(ae=Yt)||pe,Yr(n,r),Yt=ae):Yr(n,r),ls(r),w&8192){if(ae=r.memoizedState!==null,(r.stateNode.isHidden=ae)&&!pe&&(r.mode&1)!==0)for(be=r,pe=r.child;pe!==null;){for(me=be=pe;be!==null;){switch(fe=be,_e=fe.child,fe.tag){case 0:case 11:case 14:case 15:Ho(4,fe,fe.return);break;case 1:Ni(fe,fe.return);var Ce=fe.stateNode;if(typeof Ce.componentWillUnmount=="function"){w=fe,u=fe.return;try{n=w,Ce.props=n.memoizedProps,Ce.state=n.memoizedState,Ce.componentWillUnmount()}catch(Ne){ht(w,u,Ne)}}break;case 5:Ni(fe,fe.return);break;case 22:if(fe.memoizedState!==null){yv(me);continue}}_e!==null?(_e.return=fe,be=_e):yv(me)}pe=pe.sibling}e:for(pe=null,me=r;;){if(me.tag===5){if(pe===null){pe=me;try{N=me.stateNode,ae?(A=N.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(Y=me.stateNode,te=me.memoizedProps.style,I=te!=null&&te.hasOwnProperty("display")?te.display:null,Y.style.display=li("display",I))}catch(Ne){ht(r,r.return,Ne)}}}else if(me.tag===6){if(pe===null)try{me.stateNode.nodeValue=ae?"":me.memoizedProps}catch(Ne){ht(r,r.return,Ne)}}else if((me.tag!==22&&me.tag!==23||me.memoizedState===null||me===r)&&me.child!==null){me.child.return=me,me=me.child;continue}if(me===r)break e;for(;me.sibling===null;){if(me.return===null||me.return===r)break e;pe===me&&(pe=null),me=me.return}pe===me&&(pe=null),me.sibling.return=me.return,me=me.sibling}}break;case 19:Yr(n,r),ls(r),w&4&&pv(r);break;case 21:break;default:Yr(n,r),ls(r)}}function ls(r){var n=r.flags;if(n&2){try{e:{for(var u=r.return;u!==null;){if(uv(u)){var w=u;break e}u=u.return}throw Error(s(160))}switch(w.tag){case 5:var N=w.stateNode;w.flags&32&&(pt(N,""),w.flags&=-33);var A=hv(r);Ru(r,A,N);break;case 3:case 4:var I=w.stateNode.containerInfo,Y=hv(r);Pu(r,Y,I);break;default:throw Error(s(161))}}catch(te){ht(r,r.return,te)}r.flags&=-3}n&4096&&(r.flags&=-4097)}function i2(r,n,u){be=r,gv(r)}function gv(r,n,u){for(var w=(r.mode&1)!==0;be!==null;){var N=be,A=N.child;if(N.tag===22&&w){var I=N.memoizedState!==null||bl;if(!I){var Y=N.alternate,te=Y!==null&&Y.memoizedState!==null||Yt;Y=bl;var ae=Yt;if(bl=I,(Yt=te)&&!ae)for(be=N;be!==null;)I=be,te=I.child,I.tag===22&&I.memoizedState!==null?xv(N):te!==null?(te.return=I,be=te):xv(N);for(;A!==null;)be=A,gv(A),A=A.sibling;be=N,bl=Y,Yt=ae}vv(r)}else(N.subtreeFlags&8772)!==0&&A!==null?(A.return=N,be=A):vv(r)}}function vv(r){for(;be!==null;){var n=be;if((n.flags&8772)!==0){var u=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Yt||Sl(5,n);break;case 1:var w=n.stateNode;if(n.flags&4&&!Yt)if(u===null)w.componentDidMount();else{var N=n.elementType===n.type?u.memoizedProps:Gr(n.type,u.memoizedProps);w.componentDidUpdate(N,u.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var A=n.updateQueue;A!==null&&yg(n,A,w);break;case 3:var I=n.updateQueue;if(I!==null){if(u=null,n.child!==null)switch(n.child.tag){case 5:u=n.child.stateNode;break;case 1:u=n.child.stateNode}yg(n,I,u)}break;case 5:var Y=n.stateNode;if(u===null&&n.flags&4){u=Y;var te=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&u.focus();break;case"img":te.src&&(u.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ae=n.alternate;if(ae!==null){var pe=ae.memoizedState;if(pe!==null){var me=pe.dehydrated;me!==null&&xo(me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Yt||n.flags&512&&Nu(n)}catch(fe){ht(n,n.return,fe)}}if(n===r){be=null;break}if(u=n.sibling,u!==null){u.return=n.return,be=u;break}be=n.return}}function yv(r){for(;be!==null;){var n=be;if(n===r){be=null;break}var u=n.sibling;if(u!==null){u.return=n.return,be=u;break}be=n.return}}function xv(r){for(;be!==null;){var n=be;try{switch(n.tag){case 0:case 11:case 15:var u=n.return;try{Sl(4,n)}catch(te){ht(n,u,te)}break;case 1:var w=n.stateNode;if(typeof w.componentDidMount=="function"){var N=n.return;try{w.componentDidMount()}catch(te){ht(n,N,te)}}var A=n.return;try{Nu(n)}catch(te){ht(n,A,te)}break;case 5:var I=n.return;try{Nu(n)}catch(te){ht(n,I,te)}}}catch(te){ht(n,n.return,te)}if(n===r){be=null;break}var Y=n.sibling;if(Y!==null){Y.return=n.return,be=Y;break}be=n.return}}var o2=Math.ceil,Cl=k.ReactCurrentDispatcher,Tu=k.ReactCurrentOwner,Ir=k.ReactCurrentBatchConfig,Ge=0,At=null,wt=null,Bt=0,Cr=0,Pi=Js(0),Et=0,Vo=null,Ln=0,kl=0,Au=0,zo=null,dr=null,Du=0,Ri=1/0,js=null,El=!1,Mu=null,sn=null,jl=!1,nn=null,Nl=0,Wo=0,Lu=null,Pl=-1,Rl=0;function nr(){return(Ge&6)!==0?gt():Pl!==-1?Pl:Pl=gt()}function on(r){return(r.mode&1)===0?1:(Ge&2)!==0&&Bt!==0?Bt&-Bt:zk.transition!==null?(Rl===0&&(Rl=hm()),Rl):(r=Je,r!==0||(r=window.event,r=r===void 0?16:wm(r.type)),r)}function Xr(r,n,u,w){if(50<Wo)throw Wo=0,Lu=null,Error(s(185));po(r,u,w),((Ge&2)===0||r!==At)&&(r===At&&((Ge&2)===0&&(kl|=u),Et===4&&an(r,Bt)),ur(r,w),u===1&&Ge===0&&(n.mode&1)===0&&(Ri=gt()+500,nl&&Zs()))}function ur(r,n){var u=r.callbackNode;zC(r,n);var w=Fa(r,r===At?Bt:0);if(w===0)u!==null&&cm(u),r.callbackNode=null,r.callbackPriority=0;else if(n=w&-w,r.callbackPriority!==n){if(u!=null&&cm(u),n===1)r.tag===0?Vk(wv.bind(null,r)):og(wv.bind(null,r)),Bk(function(){(Ge&6)===0&&Zs()}),u=null;else{switch(fm(w)){case 1:u=pd;break;case 4:u=dm;break;case 16:u=La;break;case 536870912:u=um;break;default:u=La}u=Pv(u,_v.bind(null,r))}r.callbackPriority=n,r.callbackNode=u}}function _v(r,n){if(Pl=-1,Rl=0,(Ge&6)!==0)throw Error(s(327));var u=r.callbackNode;if(Ti()&&r.callbackNode!==u)return null;var w=Fa(r,r===At?Bt:0);if(w===0)return null;if((w&30)!==0||(w&r.expiredLanes)!==0||n)n=Tl(r,w);else{n=w;var N=Ge;Ge|=2;var A=Sv();(At!==r||Bt!==n)&&(js=null,Ri=gt()+500,In(r,n));do try{c2();break}catch(Y){bv(r,Y)}while(!0);Zd(),Cl.current=A,Ge=N,wt!==null?n=0:(At=null,Bt=0,n=Et)}if(n!==0){if(n===2&&(N=md(r),N!==0&&(w=N,n=Ou(r,N))),n===1)throw u=Vo,In(r,0),an(r,w),ur(r,gt()),u;if(n===6)an(r,w);else{if(N=r.current.alternate,(w&30)===0&&!a2(N)&&(n=Tl(r,w),n===2&&(A=md(r),A!==0&&(w=A,n=Ou(r,A))),n===1))throw u=Vo,In(r,0),an(r,w),ur(r,gt()),u;switch(r.finishedWork=N,r.finishedLanes=w,n){case 0:case 1:throw Error(s(345));case 2:Bn(r,dr,js);break;case 3:if(an(r,w),(w&130023424)===w&&(n=Du+500-gt(),10<n)){if(Fa(r,0)!==0)break;if(N=r.suspendedLanes,(N&w)!==w){nr(),r.pingedLanes|=r.suspendedLanes&N;break}r.timeoutHandle=Vd(Bn.bind(null,r,dr,js),n);break}Bn(r,dr,js);break;case 4:if(an(r,w),(w&4194240)===w)break;for(n=r.eventTimes,N=-1;0<w;){var I=31-Wr(w);A=1<<I,I=n[I],I>N&&(N=I),w&=~A}if(w=N,w=gt()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*o2(w/1960))-w,10<w){r.timeoutHandle=Vd(Bn.bind(null,r,dr,js),w);break}Bn(r,dr,js);break;case 5:Bn(r,dr,js);break;default:throw Error(s(329))}}}return ur(r,gt()),r.callbackNode===u?_v.bind(null,r):null}function Ou(r,n){var u=zo;return r.current.memoizedState.isDehydrated&&(In(r,n).flags|=256),r=Tl(r,n),r!==2&&(n=dr,dr=u,n!==null&&Iu(n)),r}function Iu(r){dr===null?dr=r:dr.push.apply(dr,r)}function a2(r){for(var n=r;;){if(n.flags&16384){var u=n.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var w=0;w<u.length;w++){var N=u[w],A=N.getSnapshot;N=N.value;try{if(!Ur(A(),N))return!1}catch{return!1}}}if(u=n.child,n.subtreeFlags&16384&&u!==null)u.return=n,n=u;else{if(n===r)break;for(;n.sibling===null;){if(n.return===null||n.return===r)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function an(r,n){for(n&=~Au,n&=~kl,r.suspendedLanes|=n,r.pingedLanes&=~n,r=r.expirationTimes;0<n;){var u=31-Wr(n),w=1<<u;r[u]=-1,n&=~w}}function wv(r){if((Ge&6)!==0)throw Error(s(327));Ti();var n=Fa(r,0);if((n&1)===0)return ur(r,gt()),null;var u=Tl(r,n);if(r.tag!==0&&u===2){var w=md(r);w!==0&&(n=w,u=Ou(r,w))}if(u===1)throw u=Vo,In(r,0),an(r,n),ur(r,gt()),u;if(u===6)throw Error(s(345));return r.finishedWork=r.current.alternate,r.finishedLanes=n,Bn(r,dr,js),ur(r,gt()),null}function Bu(r,n){var u=Ge;Ge|=1;try{return r(n)}finally{Ge=u,Ge===0&&(Ri=gt()+500,nl&&Zs())}}function On(r){nn!==null&&nn.tag===0&&(Ge&6)===0&&Ti();var n=Ge;Ge|=1;var u=Ir.transition,w=Je;try{if(Ir.transition=null,Je=1,r)return r()}finally{Je=w,Ir.transition=u,Ge=n,(Ge&6)===0&&Zs()}}function Fu(){Cr=Pi.current,rt(Pi)}function In(r,n){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Ik(u)),wt!==null)for(u=wt.return;u!==null;){var w=u;switch(qd(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&rl();break;case 3:Ei(),rt(ar),rt(Kt),au();break;case 5:iu(w);break;case 4:Ei();break;case 13:rt(ot);break;case 19:rt(ot);break;case 10:eu(w.type._context);break;case 22:case 23:Fu()}u=u.return}if(At=r,wt=r=ln(r.current,null),Bt=Cr=n,Et=0,Vo=null,Au=kl=Ln=0,dr=zo=null,An!==null){for(n=0;n<An.length;n++)if(u=An[n],w=u.interleaved,w!==null){u.interleaved=null;var N=w.next,A=u.pending;if(A!==null){var I=A.next;A.next=N,w.next=I}u.pending=w}An=null}return r}function bv(r,n){do{var u=wt;try{if(Zd(),pl.current=yl,ml){for(var w=at.memoizedState;w!==null;){var N=w.queue;N!==null&&(N.pending=null),w=w.next}ml=!1}if(Mn=0,Tt=kt=at=null,Oo=!1,Io=0,Tu.current=null,u===null||u.return===null){Et=1,Vo=n,wt=null;break}e:{var A=r,I=u.return,Y=u,te=n;if(n=Bt,Y.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ae=te,pe=Y,me=pe.tag;if((pe.mode&1)===0&&(me===0||me===11||me===15)){var fe=pe.alternate;fe?(pe.updateQueue=fe.updateQueue,pe.memoizedState=fe.memoizedState,pe.lanes=fe.lanes):(pe.updateQueue=null,pe.memoizedState=null)}var _e=Gg(I);if(_e!==null){_e.flags&=-257,qg(_e,I,Y,A,n),_e.mode&1&&Kg(A,ae,n),n=_e,te=ae;var Ce=n.updateQueue;if(Ce===null){var Ne=new Set;Ne.add(te),n.updateQueue=Ne}else Ce.add(te);break e}else{if((n&1)===0){Kg(A,ae,n),$u();break e}te=Error(s(426))}}else if(it&&Y.mode&1){var vt=Gg(I);if(vt!==null){(vt.flags&65536)===0&&(vt.flags|=256),qg(vt,I,Y,A,n),Jd(ji(te,Y));break e}}A=te=ji(te,Y),Et!==4&&(Et=2),zo===null?zo=[A]:zo.push(A),A=I;do{switch(A.tag){case 3:A.flags|=65536,n&=-n,A.lanes|=n;var ie=Wg(A,te,n);vg(A,ie);break e;case 1:Y=te;var se=A.type,oe=A.stateNode;if((A.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(sn===null||!sn.has(oe)))){A.flags|=65536,n&=-n,A.lanes|=n;var ge=Ug(A,Y,n);vg(A,ge);break e}}A=A.return}while(A!==null)}kv(u)}catch(Re){n=Re,wt===u&&u!==null&&(wt=u=u.return);continue}break}while(!0)}function Sv(){var r=Cl.current;return Cl.current=yl,r===null?yl:r}function $u(){(Et===0||Et===3||Et===2)&&(Et=4),At===null||(Ln&268435455)===0&&(kl&268435455)===0||an(At,Bt)}function Tl(r,n){var u=Ge;Ge|=2;var w=Sv();(At!==r||Bt!==n)&&(js=null,In(r,n));do try{l2();break}catch(N){bv(r,N)}while(!0);if(Zd(),Ge=u,Cl.current=w,wt!==null)throw Error(s(261));return At=null,Bt=0,Et}function l2(){for(;wt!==null;)Cv(wt)}function c2(){for(;wt!==null&&!MC();)Cv(wt)}function Cv(r){var n=Nv(r.alternate,r,Cr);r.memoizedProps=r.pendingProps,n===null?kv(r):wt=n,Tu.current=null}function kv(r){var n=r;do{var u=n.alternate;if(r=n.return,(n.flags&32768)===0){if(u=t2(u,n,Cr),u!==null){wt=u;return}}else{if(u=r2(u,n),u!==null){u.flags&=32767,wt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{Et=6,wt=null;return}}if(n=n.sibling,n!==null){wt=n;return}wt=n=r}while(n!==null);Et===0&&(Et=5)}function Bn(r,n,u){var w=Je,N=Ir.transition;try{Ir.transition=null,Je=1,d2(r,n,u,w)}finally{Ir.transition=N,Je=w}return null}function d2(r,n,u,w){do Ti();while(nn!==null);if((Ge&6)!==0)throw Error(s(327));u=r.finishedWork;var N=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(s(177));r.callbackNode=null,r.callbackPriority=0;var A=u.lanes|u.childLanes;if(WC(r,A),r===At&&(wt=At=null,Bt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||jl||(jl=!0,Pv(La,function(){return Ti(),null})),A=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||A){A=Ir.transition,Ir.transition=null;var I=Je;Je=1;var Y=Ge;Ge|=4,Tu.current=null,n2(r,u),mv(u,r),Rk($d),Va=!!Fd,$d=Fd=null,r.current=u,i2(u),LC(),Ge=Y,Je=I,Ir.transition=A}else r.current=u;if(jl&&(jl=!1,nn=r,Nl=N),A=r.pendingLanes,A===0&&(sn=null),BC(u.stateNode),ur(r,gt()),n!==null)for(w=r.onRecoverableError,u=0;u<n.length;u++)N=n[u],w(N.value,{componentStack:N.stack,digest:N.digest});if(El)throw El=!1,r=Mu,Mu=null,r;return(Nl&1)!==0&&r.tag!==0&&Ti(),A=r.pendingLanes,(A&1)!==0?r===Lu?Wo++:(Wo=0,Lu=r):Wo=0,Zs(),null}function Ti(){if(nn!==null){var r=fm(Nl),n=Ir.transition,u=Je;try{if(Ir.transition=null,Je=16>r?16:r,nn===null)var w=!1;else{if(r=nn,nn=null,Nl=0,(Ge&6)!==0)throw Error(s(331));var N=Ge;for(Ge|=4,be=r.current;be!==null;){var A=be,I=A.child;if((be.flags&16)!==0){var Y=A.deletions;if(Y!==null){for(var te=0;te<Y.length;te++){var ae=Y[te];for(be=ae;be!==null;){var pe=be;switch(pe.tag){case 0:case 11:case 15:Ho(8,pe,A)}var me=pe.child;if(me!==null)me.return=pe,be=me;else for(;be!==null;){pe=be;var fe=pe.sibling,_e=pe.return;if(dv(pe),pe===ae){be=null;break}if(fe!==null){fe.return=_e,be=fe;break}be=_e}}}var Ce=A.alternate;if(Ce!==null){var Ne=Ce.child;if(Ne!==null){Ce.child=null;do{var vt=Ne.sibling;Ne.sibling=null,Ne=vt}while(Ne!==null)}}be=A}}if((A.subtreeFlags&2064)!==0&&I!==null)I.return=A,be=I;else e:for(;be!==null;){if(A=be,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:Ho(9,A,A.return)}var ie=A.sibling;if(ie!==null){ie.return=A.return,be=ie;break e}be=A.return}}var se=r.current;for(be=se;be!==null;){I=be;var oe=I.child;if((I.subtreeFlags&2064)!==0&&oe!==null)oe.return=I,be=oe;else e:for(I=se;be!==null;){if(Y=be,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Sl(9,Y)}}catch(Re){ht(Y,Y.return,Re)}if(Y===I){be=null;break e}var ge=Y.sibling;if(ge!==null){ge.return=Y.return,be=ge;break e}be=Y.return}}if(Ge=N,Zs(),ns&&typeof ns.onPostCommitFiberRoot=="function")try{ns.onPostCommitFiberRoot(Oa,r)}catch{}w=!0}return w}finally{Je=u,Ir.transition=n}}return!1}function Ev(r,n,u){n=ji(u,n),n=Wg(r,n,1),r=tn(r,n,1),n=nr(),r!==null&&(po(r,1,n),ur(r,n))}function ht(r,n,u){if(r.tag===3)Ev(r,r,u);else for(;n!==null;){if(n.tag===3){Ev(n,r,u);break}else if(n.tag===1){var w=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(sn===null||!sn.has(w))){r=ji(u,r),r=Ug(n,r,1),n=tn(n,r,1),r=nr(),n!==null&&(po(n,1,r),ur(n,r));break}}n=n.return}}function u2(r,n,u){var w=r.pingCache;w!==null&&w.delete(n),n=nr(),r.pingedLanes|=r.suspendedLanes&u,At===r&&(Bt&u)===u&&(Et===4||Et===3&&(Bt&130023424)===Bt&&500>gt()-Du?In(r,0):Au|=u),ur(r,n)}function jv(r,n){n===0&&((r.mode&1)===0?n=1:(n=Ba,Ba<<=1,(Ba&130023424)===0&&(Ba=4194304)));var u=nr();r=Cs(r,n),r!==null&&(po(r,n,u),ur(r,u))}function h2(r){var n=r.memoizedState,u=0;n!==null&&(u=n.retryLane),jv(r,u)}function f2(r,n){var u=0;switch(r.tag){case 13:var w=r.stateNode,N=r.memoizedState;N!==null&&(u=N.retryLane);break;case 19:w=r.stateNode;break;default:throw Error(s(314))}w!==null&&w.delete(n),jv(r,u)}var Nv;Nv=function(r,n,u){if(r!==null)if(r.memoizedProps!==n.pendingProps||ar.current)cr=!0;else{if((r.lanes&u)===0&&(n.flags&128)===0)return cr=!1,e2(r,n,u);cr=(r.flags&131072)!==0}else cr=!1,it&&(n.flags&1048576)!==0&&ag(n,ol,n.index);switch(n.lanes=0,n.tag){case 2:var w=n.type;wl(r,n),r=n.pendingProps;var N=xi(n,Kt.current);ki(n,u),N=du(null,n,w,r,N,u);var A=uu();return n.flags|=1,typeof N=="object"&&N!==null&&typeof N.render=="function"&&N.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,lr(w)?(A=!0,sl(n)):A=!1,n.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,su(n),N.updater=xl,n.stateNode=N,N._reactInternals=n,vu(n,w,r,u),n=wu(null,n,w,!0,A,u)):(n.tag=0,it&&A&&Gd(n),sr(null,n,N,u),n=n.child),n;case 16:w=n.elementType;e:{switch(wl(r,n),r=n.pendingProps,N=w._init,w=N(w._payload),n.type=w,N=n.tag=m2(w),r=Gr(w,r),N){case 0:n=_u(null,n,w,r,u);break e;case 1:n=ev(null,n,w,r,u);break e;case 11:n=Yg(null,n,w,r,u);break e;case 14:n=Xg(null,n,w,Gr(w.type,r),u);break e}throw Error(s(306,w,""))}return n;case 0:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Gr(w,N),_u(r,n,w,N,u);case 1:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Gr(w,N),ev(r,n,w,N,u);case 3:e:{if(tv(n),r===null)throw Error(s(387));w=n.pendingProps,A=n.memoizedState,N=A.element,gg(r,n),hl(n,w,null,u);var I=n.memoizedState;if(w=I.element,A.isDehydrated)if(A={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},n.updateQueue.baseState=A,n.memoizedState=A,n.flags&256){N=ji(Error(s(423)),n),n=rv(r,n,w,u,N);break e}else if(w!==N){N=ji(Error(s(424)),n),n=rv(r,n,w,u,N);break e}else for(Sr=Xs(n.stateNode.containerInfo.firstChild),br=n,it=!0,Kr=null,u=pg(n,null,w,u),n.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(bi(),w===N){n=Es(r,n,u);break e}sr(r,n,w,u)}n=n.child}return n;case 5:return xg(n),r===null&&Xd(n),w=n.type,N=n.pendingProps,A=r!==null?r.memoizedProps:null,I=N.children,Hd(w,N)?I=null:A!==null&&Hd(w,A)&&(n.flags|=32),Zg(r,n),sr(r,n,I,u),n.child;case 6:return r===null&&Xd(n),null;case 13:return sv(r,n,u);case 4:return nu(n,n.stateNode.containerInfo),w=n.pendingProps,r===null?n.child=Si(n,null,w,u):sr(r,n,w,u),n.child;case 11:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Gr(w,N),Yg(r,n,w,N,u);case 7:return sr(r,n,n.pendingProps,u),n.child;case 8:return sr(r,n,n.pendingProps.children,u),n.child;case 12:return sr(r,n,n.pendingProps.children,u),n.child;case 10:e:{if(w=n.type._context,N=n.pendingProps,A=n.memoizedProps,I=N.value,Qe(cl,w._currentValue),w._currentValue=I,A!==null)if(Ur(A.value,I)){if(A.children===N.children&&!ar.current){n=Es(r,n,u);break e}}else for(A=n.child,A!==null&&(A.return=n);A!==null;){var Y=A.dependencies;if(Y!==null){I=A.child;for(var te=Y.firstContext;te!==null;){if(te.context===w){if(A.tag===1){te=ks(-1,u&-u),te.tag=2;var ae=A.updateQueue;if(ae!==null){ae=ae.shared;var pe=ae.pending;pe===null?te.next=te:(te.next=pe.next,pe.next=te),ae.pending=te}}A.lanes|=u,te=A.alternate,te!==null&&(te.lanes|=u),tu(A.return,u,n),Y.lanes|=u;break}te=te.next}}else if(A.tag===10)I=A.type===n.type?null:A.child;else if(A.tag===18){if(I=A.return,I===null)throw Error(s(341));I.lanes|=u,Y=I.alternate,Y!==null&&(Y.lanes|=u),tu(I,u,n),I=A.sibling}else I=A.child;if(I!==null)I.return=A;else for(I=A;I!==null;){if(I===n){I=null;break}if(A=I.sibling,A!==null){A.return=I.return,I=A;break}I=I.return}A=I}sr(r,n,N.children,u),n=n.child}return n;case 9:return N=n.type,w=n.pendingProps.children,ki(n,u),N=Lr(N),w=w(N),n.flags|=1,sr(r,n,w,u),n.child;case 14:return w=n.type,N=Gr(w,n.pendingProps),N=Gr(w.type,N),Xg(r,n,w,N,u);case 15:return Jg(r,n,n.type,n.pendingProps,u);case 17:return w=n.type,N=n.pendingProps,N=n.elementType===w?N:Gr(w,N),wl(r,n),n.tag=1,lr(w)?(r=!0,sl(n)):r=!1,ki(n,u),Vg(n,w,N),vu(n,w,N,u),wu(null,n,w,!0,r,u);case 19:return iv(r,n,u);case 22:return Qg(r,n,u)}throw Error(s(156,n.tag))};function Pv(r,n){return lm(r,n)}function p2(r,n,u,w){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(r,n,u,w){return new p2(r,n,u,w)}function Hu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function m2(r){if(typeof r=="function")return Hu(r)?1:0;if(r!=null){if(r=r.$$typeof,r===U)return 11;if(r===V)return 14}return 2}function ln(r,n){var u=r.alternate;return u===null?(u=Br(r.tag,n,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=n,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,n=r.dependencies,u.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function Al(r,n,u,w,N,A){var I=2;if(w=r,typeof r=="function")Hu(r)&&(I=1);else if(typeof r=="string")I=5;else e:switch(r){case R:return Fn(u.children,N,A,n);case j:I=8,N|=8;break;case M:return r=Br(12,u,n,N|2),r.elementType=M,r.lanes=A,r;case H:return r=Br(13,u,n,N),r.elementType=H,r.lanes=A,r;case Q:return r=Br(19,u,n,N),r.elementType=Q,r.lanes=A,r;case J:return Dl(u,N,A,n);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case $:I=10;break e;case F:I=9;break e;case U:I=11;break e;case V:I=14;break e;case K:I=16,w=null;break e}throw Error(s(130,r==null?r:typeof r,""))}return n=Br(I,u,n,N),n.elementType=r,n.type=w,n.lanes=A,n}function Fn(r,n,u,w){return r=Br(7,r,w,n),r.lanes=u,r}function Dl(r,n,u,w){return r=Br(22,r,w,n),r.elementType=J,r.lanes=u,r.stateNode={isHidden:!1},r}function Vu(r,n,u){return r=Br(6,r,null,n),r.lanes=u,r}function zu(r,n,u){return n=Br(4,r.children!==null?r.children:[],r.key,n),n.lanes=u,n.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},n}function g2(r,n,u,w,N){this.tag=n,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gd(0),this.expirationTimes=gd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gd(0),this.identifierPrefix=w,this.onRecoverableError=N,this.mutableSourceEagerHydrationData=null}function Wu(r,n,u,w,N,A,I,Y,te){return r=new g2(r,n,u,Y,te),n===1?(n=1,A===!0&&(n|=8)):n=0,A=Br(3,null,null,n),r.current=A,A.stateNode=r,A.memoizedState={element:w,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},su(A),r}function v2(r,n,u){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:w==null?null:""+w,children:r,containerInfo:n,implementation:u}}function Rv(r){if(!r)return Qs;r=r._reactInternals;e:{if(jn(r)!==r||r.tag!==1)throw Error(s(170));var n=r;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(lr(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(s(171))}if(r.tag===1){var u=r.type;if(lr(u))return ng(r,u,n)}return n}function Tv(r,n,u,w,N,A,I,Y,te){return r=Wu(u,w,!0,r,N,A,I,Y,te),r.context=Rv(null),u=r.current,w=nr(),N=on(u),A=ks(w,N),A.callback=n??null,tn(u,A,N),r.current.lanes=N,po(r,N,w),ur(r,w),r}function Ml(r,n,u,w){var N=n.current,A=nr(),I=on(N);return u=Rv(u),n.context===null?n.context=u:n.pendingContext=u,n=ks(A,I),n.payload={element:r},w=w===void 0?null:w,w!==null&&(n.callback=w),r=tn(N,n,I),r!==null&&(Xr(r,N,I,A),ul(r,N,I)),I}function Ll(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Av(r,n){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<n?u:n}}function Uu(r,n){Av(r,n),(r=r.alternate)&&Av(r,n)}function y2(){return null}var Dv=typeof reportError=="function"?reportError:function(r){console.error(r)};function Ku(r){this._internalRoot=r}Ol.prototype.render=Ku.prototype.render=function(r){var n=this._internalRoot;if(n===null)throw Error(s(409));Ml(r,n,null,null)},Ol.prototype.unmount=Ku.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var n=r.containerInfo;On(function(){Ml(null,r,null,null)}),n[_s]=null}};function Ol(r){this._internalRoot=r}Ol.prototype.unstable_scheduleHydration=function(r){if(r){var n=gm();r={blockedOn:null,target:r,priority:n};for(var u=0;u<Gs.length&&n!==0&&n<Gs[u].priority;u++);Gs.splice(u,0,r),u===0&&xm(r)}};function Gu(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Il(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Mv(){}function x2(r,n,u,w,N){if(N){if(typeof w=="function"){var A=w;w=function(){var ae=Ll(I);A.call(ae)}}var I=Tv(n,w,r,0,null,!1,!1,"",Mv);return r._reactRootContainer=I,r[_s]=I.current,No(r.nodeType===8?r.parentNode:r),On(),I}for(;N=r.lastChild;)r.removeChild(N);if(typeof w=="function"){var Y=w;w=function(){var ae=Ll(te);Y.call(ae)}}var te=Wu(r,0,!1,null,null,!1,!1,"",Mv);return r._reactRootContainer=te,r[_s]=te.current,No(r.nodeType===8?r.parentNode:r),On(function(){Ml(n,te,u,w)}),te}function Bl(r,n,u,w,N){var A=u._reactRootContainer;if(A){var I=A;if(typeof N=="function"){var Y=N;N=function(){var te=Ll(I);Y.call(te)}}Ml(n,I,r,N)}else I=x2(u,n,r,N,w);return Ll(I)}pm=function(r){switch(r.tag){case 3:var n=r.stateNode;if(n.current.memoizedState.isDehydrated){var u=fo(n.pendingLanes);u!==0&&(vd(n,u|1),ur(n,gt()),(Ge&6)===0&&(Ri=gt()+500,Zs()))}break;case 13:On(function(){var w=Cs(r,1);if(w!==null){var N=nr();Xr(w,r,1,N)}}),Uu(r,1)}},yd=function(r){if(r.tag===13){var n=Cs(r,134217728);if(n!==null){var u=nr();Xr(n,r,134217728,u)}Uu(r,134217728)}},mm=function(r){if(r.tag===13){var n=on(r),u=Cs(r,n);if(u!==null){var w=nr();Xr(u,r,n,w)}Uu(r,n)}},gm=function(){return Je},vm=function(r,n){var u=Je;try{return Je=r,n()}finally{Je=u}},co=function(r,n,u){switch(n){case"input":if(je(r,u),n=u.name,u.type==="radio"&&n!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<u.length;n++){var w=u[n];if(w!==r&&w.form===r.form){var N=tl(w);if(!N)throw Error(s(90));re(w),je(w,N)}}}break;case"textarea":Pt(r,u);break;case"select":n=u.value,n!=null&&De(r,!!u.multiple,n,!1)}},Ct=Bu,Ut=On;var _2={usingClientEntryPoint:!1,Events:[To,vi,tl,Ve,mt,Bu]},Uo={findFiberByHostInstance:Nn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},w2={bundleType:Uo.bundleType,version:Uo.version,rendererPackageName:Uo.rendererPackageName,rendererConfig:Uo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=om(r),r===null?null:r.stateNode},findFiberByHostInstance:Uo.findFiberByHostInstance||y2,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 Fl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fl.isDisabled&&Fl.supportsFiber)try{Oa=Fl.inject(w2),ns=Fl}catch{}}return hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_2,hr.createPortal=function(r,n){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gu(n))throw Error(s(200));return v2(r,n,null,u)},hr.createRoot=function(r,n){if(!Gu(r))throw Error(s(299));var u=!1,w="",N=Dv;return n!=null&&(n.unstable_strictMode===!0&&(u=!0),n.identifierPrefix!==void 0&&(w=n.identifierPrefix),n.onRecoverableError!==void 0&&(N=n.onRecoverableError)),n=Wu(r,1,!1,null,null,u,!1,w,N),r[_s]=n.current,No(r.nodeType===8?r.parentNode:r),new Ku(n)},hr.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var n=r._reactInternals;if(n===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=om(n),r=r===null?null:r.stateNode,r},hr.flushSync=function(r){return On(r)},hr.hydrate=function(r,n,u){if(!Il(n))throw Error(s(200));return Bl(null,r,n,!0,u)},hr.hydrateRoot=function(r,n,u){if(!Gu(r))throw Error(s(405));var w=u!=null&&u.hydratedSources||null,N=!1,A="",I=Dv;if(u!=null&&(u.unstable_strictMode===!0&&(N=!0),u.identifierPrefix!==void 0&&(A=u.identifierPrefix),u.onRecoverableError!==void 0&&(I=u.onRecoverableError)),n=Tv(n,null,r,1,u??null,N,!1,A,I),r[_s]=n.current,No(r),w)for(r=0;r<w.length;r++)u=w[r],N=u._getVersion,N=N(u._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[u,N]:n.mutableSourceEagerHydrationData.push(u,N);return new Ol(n)},hr.render=function(r,n,u){if(!Il(n))throw Error(s(200));return Bl(null,r,n,!1,u)},hr.unmountComponentAtNode=function(r){if(!Il(r))throw Error(s(40));return r._reactRootContainer?(On(function(){Bl(null,null,r,!1,function(){r._reactRootContainer=null,r[_s]=null})}),!0):!1},hr.unstable_batchedUpdates=Bu,hr.unstable_renderSubtreeIntoContainer=function(r,n,u,w){if(!Il(u))throw Error(s(200));if(r==null||r._reactInternals===void 0)throw Error(s(38));return Bl(r,n,u,!1,w)},hr.version="18.3.1-next-f1338f8080-20240426",hr}var Vv;function Zy(){if(Vv)return Xu.exports;Vv=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(),Xu.exports=P2(),Xu.exports}var zv;function R2(){if(zv)return $l;zv=1;var e=Zy();return $l.createRoot=e.createRoot,$l.hydrateRoot=e.hydrateRoot,$l}var T2=R2();const A2=mf(T2);var va=Zy();const ex=mf(va);function D2(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const M2=e=>{switch(e){case"success":return I2;case"info":return F2;case"warning":return B2;case"error":return $2;default:return null}},L2=Array(12).fill(0),O2=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},L2.map((s,o)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),I2=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),B2=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),F2=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),$2=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),H2=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),V2=()=>{const[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let Ah=1;class z2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:o,...l}=t,m=typeof(t==null?void 0:t.id)=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:Ah++,f=this.toasts.find(c=>c.id===m),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(m)&&this.dismissedToasts.delete(m),f?this.toasts=this.toasts.map(c=>c.id===m?(this.publish({...c,...t,id:m,title:o}),{...c,...t,id:m,dismissible:a,title:o}):c):this.addToast({title:o,...l,dismissible:a,id:m}),m},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const l=Promise.resolve(t instanceof Function?t():t);let m=o!==void 0,f;const a=l.then(async h=>{if(f=["resolve",h],ve.isValidElement(h))m=!1,this.create({id:o,type:"default",message:h});else if(U2(h)&&!h.ok){m=!1;const d=typeof s.error=="function"?await s.error(`HTTP error! status: ${h.status}`):s.error,_=typeof s.description=="function"?await s.description(`HTTP error! status: ${h.status}`):s.description,E=typeof d=="object"&&!ve.isValidElement(d)?d:{message:d};this.create({id:o,type:"error",description:_,...E})}else if(h instanceof Error){m=!1;const d=typeof s.error=="function"?await s.error(h):s.error,_=typeof s.description=="function"?await s.description(h):s.description,E=typeof d=="object"&&!ve.isValidElement(d)?d:{message:d};this.create({id:o,type:"error",description:_,...E})}else if(s.success!==void 0){m=!1;const d=typeof s.success=="function"?await s.success(h):s.success,_=typeof s.description=="function"?await s.description(h):s.description,E=typeof d=="object"&&!ve.isValidElement(d)?d:{message:d};this.create({id:o,type:"success",description:_,...E})}}).catch(async h=>{if(f=["reject",h],s.error!==void 0){m=!1;const g=typeof s.error=="function"?await s.error(h):s.error,d=typeof s.description=="function"?await s.description(h):s.description,S=typeof g=="object"&&!ve.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:d,...S})}}).finally(()=>{m&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),c=()=>new Promise((h,g)=>a.then(()=>f[0]==="reject"?g(f[1]):h(f[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:c}:Object.assign(o,{unwrap:c})},this.custom=(t,s)=>{const o=(s==null?void 0:s.id)||Ah++;return this.create({jsx:t(o),id:o,...s}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const fr=new z2,W2=(e,t)=>{const s=(t==null?void 0:t.id)||Ah++;return fr.addToast({title:e,...t,id:s}),s},U2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",K2=W2,G2=()=>fr.toasts,q2=()=>fr.getActiveToasts(),le=Object.assign(K2,{success:fr.success,info:fr.info,warning:fr.warning,error:fr.error,custom:fr.custom,message:fr.message,promise:fr.promise,dismiss:fr.dismiss,loading:fr.loading},{getHistory:G2,getToasts:q2});D2("[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 Hl(e){return e.label!==void 0}const Y2=3,X2="24px",J2="16px",Wv=4e3,Q2=356,Z2=14,eE=45,tE=200;function cs(...e){return e.filter(Boolean).join(" ")}function rE(e){const[t,s]=e.split("-"),o=[];return t&&o.push(t),s&&o.push(s),o}const sE=e=>{var t,s,o,l,m,f,a,c,h;const{invert:g,toast:d,unstyled:_,interacting:S,setHeights:E,visibleToasts:b,heights:v,index:y,toasts:p,expanded:x,removeToast:k,defaultRichColors:P,closeButton:T,style:R,cancelButtonStyle:j,actionButtonStyle:M,className:$="",descriptionClassName:F="",duration:U,position:H,gap:Q,expandByDefault:V,classNames:K,icons:J,closeButtonAriaLabel:W="Close toast"}=e,[D,B]=ve.useState(null),[L,z]=ve.useState(null),[ee,ne]=ve.useState(!1),[ce,de]=ve.useState(!1),[G,O]=ve.useState(!1),[Z,X]=ve.useState(!1),[q,re]=ve.useState(!1),[he,Te]=ve.useState(0),[Be,Ke]=ve.useState(0),je=ve.useRef(d.duration||U||Wv),zt=ve.useRef(null),et=ve.useRef(null),Ae=y===0,De=y+1<=b,Fe=d.type,He=d.dismissible!==!1,Pt=d.className||"",ut=d.descriptionClassName||"",xr=ve.useMemo(()=>v.findIndex(Ve=>Ve.toastId===d.id)||0,[v,d.id]),ys=ve.useMemo(()=>{var Ve;return(Ve=d.closeButton)!=null?Ve:T},[d.closeButton,T]),Wt=ve.useMemo(()=>d.duration||U||Wv,[d.duration,U]),zr=ve.useRef(0),pt=ve.useRef(0),or=ve.useRef(0),qe=ve.useRef(null),[li,Da]=H.split("-"),Ma=ve.useMemo(()=>v.reduce((Ve,mt,Ct)=>Ct>=xr?Ve:Ve+mt.height,0),[v,xr]),ci=V2(),lo=d.invert||g,En=Fe==="loading";pt.current=ve.useMemo(()=>xr*Q+Ma,[xr,Ma]),ve.useEffect(()=>{je.current=Wt},[Wt]),ve.useEffect(()=>{ne(!0)},[]),ve.useEffect(()=>{const Ve=et.current;if(Ve){const mt=Ve.getBoundingClientRect().height;return Ke(mt),E(Ct=>[{toastId:d.id,height:mt,position:d.position},...Ct]),()=>E(Ct=>Ct.filter(Ut=>Ut.toastId!==d.id))}},[E,d.id]),ve.useLayoutEffect(()=>{if(!ee)return;const Ve=et.current,mt=Ve.style.height;Ve.style.height="auto";const Ct=Ve.getBoundingClientRect().height;Ve.style.height=mt,Ke(Ct),E(Ut=>Ut.find(_t=>_t.toastId===d.id)?Ut.map(_t=>_t.toastId===d.id?{..._t,height:Ct}:_t):[{toastId:d.id,height:Ct,position:d.position},...Ut])},[ee,d.title,d.description,E,d.id,d.jsx,d.action,d.cancel]);const Tr=ve.useCallback(()=>{de(!0),Te(pt.current),E(Ve=>Ve.filter(mt=>mt.toastId!==d.id)),setTimeout(()=>{k(d)},tE)},[d,k,E,pt]);ve.useEffect(()=>{if(d.promise&&Fe==="loading"||d.duration===1/0||d.type==="loading")return;let Ve;return x||S||ci?(()=>{if(or.current<zr.current){const Ut=new Date().getTime()-zr.current;je.current=je.current-Ut}or.current=new Date().getTime()})():(()=>{je.current!==1/0&&(zr.current=new Date().getTime(),Ve=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Tr()},je.current))})(),()=>clearTimeout(Ve)},[x,S,d,Fe,ci,Tr]),ve.useEffect(()=>{d.delete&&(Tr(),d.onDismiss==null||d.onDismiss.call(d,d))},[Tr,d.delete]);function co(){var Ve;if(J!=null&&J.loading){var mt;return ve.createElement("div",{className:cs(K==null?void 0:K.loader,d==null||(mt=d.classNames)==null?void 0:mt.loader,"sonner-loader"),"data-visible":Fe==="loading"},J.loading)}return ve.createElement(O2,{className:cs(K==null?void 0:K.loader,d==null||(Ve=d.classNames)==null?void 0:Ve.loader),visible:Fe==="loading"})}const $s=d.icon||(J==null?void 0:J[Fe])||M2(Fe);var xs,uo;return ve.createElement("li",{tabIndex:0,ref:et,className:cs($,Pt,K==null?void 0:K.toast,d==null||(t=d.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[Fe],d==null||(s=d.classNames)==null?void 0:s[Fe]),"data-sonner-toast":"","data-rich-colors":(xs=d.richColors)!=null?xs:P,"data-styled":!(d.jsx||d.unstyled||_),"data-mounted":ee,"data-promise":!!d.promise,"data-swiped":q,"data-removed":ce,"data-visible":De,"data-y-position":li,"data-x-position":Da,"data-index":y,"data-front":Ae,"data-swiping":G,"data-dismissible":He,"data-type":Fe,"data-invert":lo,"data-swipe-out":Z,"data-swipe-direction":L,"data-expanded":!!(x||V&&ee),"data-testid":d.testId,style:{"--index":y,"--toasts-before":y,"--z-index":p.length-y,"--offset":`${ce?he:pt.current}px`,"--initial-height":V?"auto":`${Be}px`,...R,...d.style},onDragEnd:()=>{O(!1),B(null),qe.current=null},onPointerDown:Ve=>{Ve.button!==2&&(En||!He||(zt.current=new Date,Te(pt.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(O(!0),qe.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,mt,Ct;if(Z||!He)return;qe.current=null;const Ut=Number(((Ve=et.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Hs=Number(((mt=et.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((Ct=zt.current)==null?void 0:Ct.getTime()),Rt=D==="x"?Ut:Hs,Vs=Math.abs(Rt)/_t;if(Math.abs(Rt)>=eE||Vs>.11){Te(pt.current),d.onDismiss==null||d.onDismiss.call(d,d),z(D==="x"?Ut>0?"right":"left":Hs>0?"down":"up"),Tr(),X(!0);return}else{var Ot,_r;(Ot=et.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(_r=et.current)==null||_r.style.setProperty("--swipe-amount-y","0px")}re(!1),O(!1),B(null)},onPointerMove:Ve=>{var mt,Ct,Ut;if(!qe.current||!He||((mt=window.getSelection())==null?void 0:mt.toString().length)>0)return;const _t=Ve.clientY-qe.current.y,Rt=Ve.clientX-qe.current.x;var Vs;const Ot=(Vs=e.swipeDirections)!=null?Vs:rE(H);!D&&(Math.abs(Rt)>1||Math.abs(_t)>1)&&B(Math.abs(Rt)>Math.abs(_t)?"x":"y");let _r={x:0,y:0};const zs=Ar=>1/(1.5+Math.abs(Ar)/20);if(D==="y"){if(Ot.includes("top")||Ot.includes("bottom"))if(Ot.includes("top")&&_t<0||Ot.includes("bottom")&&_t>0)_r.y=_t;else{const Ar=_t*zs(_t);_r.y=Math.abs(Ar)<Math.abs(_t)?Ar:_t}}else if(D==="x"&&(Ot.includes("left")||Ot.includes("right")))if(Ot.includes("left")&&Rt<0||Ot.includes("right")&&Rt>0)_r.x=Rt;else{const Ar=Rt*zs(Rt);_r.x=Math.abs(Ar)<Math.abs(Rt)?Ar:Rt}(Math.abs(_r.x)>0||Math.abs(_r.y)>0)&&re(!0),(Ct=et.current)==null||Ct.style.setProperty("--swipe-amount-x",`${_r.x}px`),(Ut=et.current)==null||Ut.style.setProperty("--swipe-amount-y",`${_r.y}px`)}},ys&&!d.jsx&&Fe!=="loading"?ve.createElement("button",{"aria-label":W,"data-disabled":En,"data-close-button":!0,onClick:En||!He?()=>{}:()=>{Tr(),d.onDismiss==null||d.onDismiss.call(d,d)},className:cs(K==null?void 0:K.closeButton,d==null||(o=d.classNames)==null?void 0:o.closeButton)},(uo=J==null?void 0:J.close)!=null?uo:H2):null,(Fe||d.icon||d.promise)&&d.icon!==null&&((J==null?void 0:J[Fe])!==null||d.icon)?ve.createElement("div",{"data-icon":"",className:cs(K==null?void 0:K.icon,d==null||(l=d.classNames)==null?void 0:l.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||co():null,d.type!=="loading"?$s:null):null,ve.createElement("div",{"data-content":"",className:cs(K==null?void 0:K.content,d==null||(m=d.classNames)==null?void 0:m.content)},ve.createElement("div",{"data-title":"",className:cs(K==null?void 0:K.title,d==null||(f=d.classNames)==null?void 0:f.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?ve.createElement("div",{"data-description":"",className:cs(F,ut,K==null?void 0:K.description,d==null||(a=d.classNames)==null?void 0:a.description)},typeof d.description=="function"?d.description():d.description):null),ve.isValidElement(d.cancel)?d.cancel:d.cancel&&Hl(d.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:Ve=>{Hl(d.cancel)&&He&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ve),Tr())},className:cs(K==null?void 0:K.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,ve.isValidElement(d.action)?d.action:d.action&&Hl(d.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:Ve=>{Hl(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ve),!Ve.defaultPrevented&&Tr())},className:cs(K==null?void 0:K.actionButton,d==null||(h=d.classNames)==null?void 0:h.actionButton)},d.action.label):null)};function Uv(){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 nE(e,t){const s={};return[e,t].forEach((o,l)=>{const m=l===1,f=m?"--mobile-offset":"--offset",a=m?J2:X2;function c(h){["top","right","bottom","left"].forEach(g=>{s[`${f}-${g}`]=typeof h=="number"?`${h}px`:h})}typeof o=="number"||typeof o=="string"?c(o):typeof o=="object"?["top","right","bottom","left"].forEach(h=>{o[h]===void 0?s[`${f}-${h}`]=a:s[`${f}-${h}`]=typeof o[h]=="number"?`${o[h]}px`:o[h]}):c(a)}),s}const iE=ve.forwardRef(function(t,s){const{id:o,invert:l,position:m="bottom-right",hotkey:f=["altKey","KeyT"],expand:a,closeButton:c,className:h,offset:g,mobileOffset:d,theme:_="light",richColors:S,duration:E,style:b,visibleToasts:v=Y2,toastOptions:y,dir:p=Uv(),gap:x=Z2,icons:k,containerAriaLabel:P="Notifications"}=t,[T,R]=ve.useState([]),j=ve.useMemo(()=>o?T.filter(ee=>ee.toasterId===o):T.filter(ee=>!ee.toasterId),[T,o]),M=ve.useMemo(()=>Array.from(new Set([m].concat(j.filter(ee=>ee.position).map(ee=>ee.position)))),[j,m]),[$,F]=ve.useState([]),[U,H]=ve.useState(!1),[Q,V]=ve.useState(!1),[K,J]=ve.useState(_!=="system"?_:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=ve.useRef(null),D=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ve.useRef(null),L=ve.useRef(!1),z=ve.useCallback(ee=>{R(ne=>{var ce;return(ce=ne.find(de=>de.id===ee.id))!=null&&ce.delete||fr.dismiss(ee.id),ne.filter(({id:de})=>de!==ee.id)})},[]);return ve.useEffect(()=>fr.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{R(ne=>ne.map(ce=>ce.id===ee.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{ex.flushSync(()=>{R(ne=>{const ce=ne.findIndex(de=>de.id===ee.id);return ce!==-1?[...ne.slice(0,ce),{...ne[ce],...ee},...ne.slice(ce+1)]:[ee,...ne]})})})}),[T]),ve.useEffect(()=>{if(_!=="system"){J(_);return}if(_==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:ne})=>{J(ne?"dark":"light")})}catch{ee.addListener(({matches:ce})=>{try{J(ce?"dark":"light")}catch(de){console.error(de)}})}},[_]),ve.useEffect(()=>{T.length<=1&&H(!1)},[T]),ve.useEffect(()=>{const ee=ne=>{var ce;if(f.every(O=>ne[O]||ne.code===O)){var G;H(!0),(G=W.current)==null||G.focus()}ne.code==="Escape"&&(document.activeElement===W.current||(ce=W.current)!=null&&ce.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[f]),ve.useEffect(()=>{if(W.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,L.current=!1)}},[W.current]),ve.createElement("section",{ref:s,"aria-label":`${P} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((ee,ne)=>{var ce;const[de,G]=ee.split("-");return j.length?ve.createElement("ol",{key:ee,dir:p==="auto"?Uv():p,tabIndex:-1,ref:W,className:h,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":de,"data-x-position":G,style:{"--front-toast-height":`${((ce=$[0])==null?void 0:ce.height)||0}px`,"--width":`${Q2}px`,"--gap":`${x}px`,...b,...nE(g,d)},onBlur:O=>{L.current&&!O.currentTarget.contains(O.relatedTarget)&&(L.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:O=>{O.target instanceof HTMLElement&&O.target.dataset.dismissible==="false"||L.current||(L.current=!0,B.current=O.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{Q||H(!1)},onDragEnd:()=>H(!1),onPointerDown:O=>{O.target instanceof HTMLElement&&O.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},j.filter(O=>!O.position&&ne===0||O.position===ee).map((O,Z)=>{var X,q;return ve.createElement(sE,{key:O.id,icons:k,index:Z,toast:O,defaultRichColors:S,duration:(X=y==null?void 0:y.duration)!=null?X:E,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:l,visibleToasts:v,closeButton:(q=y==null?void 0:y.closeButton)!=null?q:c,interacting:Q,position:ee,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:z,toasts:j.filter(re=>re.position==O.position),heights:$.filter(re=>re.position==O.position),setHeights:F,expandByDefault:a,gap:x,expanded:U,swipeDirections:t.swipeDirections})})):null}))}),yf=C.createContext({});function xf(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ac=C.createContext(null),_f=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class oE extends C.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(s&&t.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=s.offsetHeight||0,o.width=s.offsetWidth||0,o.top=s.offsetTop,o.left=s.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function aE({children:e,isPresent:t}){const s=C.useId(),o=C.useRef(null),l=C.useRef({width:0,height:0,top:0,left:0}),{nonce:m}=C.useContext(_f);return C.useInsertionEffect(()=>{const{width:f,height:a,top:c,left:h}=l.current;if(t||!o.current||!f||!a)return;o.current.dataset.motionPopId=s;const g=document.createElement("style");return m&&(g.nonce=m),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
41
|
+
[data-motion-pop-id="${s}"] {
|
|
42
|
+
position: absolute !important;
|
|
43
|
+
width: ${f}px !important;
|
|
44
|
+
height: ${a}px !important;
|
|
45
|
+
top: ${c}px !important;
|
|
46
|
+
left: ${h}px !important;
|
|
47
|
+
}
|
|
48
|
+
`),()=>{document.head.removeChild(g)}},[t]),i.jsx(oE,{isPresent:t,childRef:o,sizeRef:l,children:C.cloneElement(e,{ref:o})})}const lE=({children:e,initial:t,isPresent:s,onExitComplete:o,custom:l,presenceAffectsLayout:m,mode:f})=>{const a=xf(cE),c=C.useId(),h=C.useCallback(d=>{a.set(d,!0);for(const _ of a.values())if(!_)return;o&&o()},[a,o]),g=C.useMemo(()=>({id:c,initial:t,isPresent:s,custom:l,onExitComplete:h,register:d=>(a.set(d,!1),()=>a.delete(d))}),m?[Math.random(),h]:[s,h]);return C.useMemo(()=>{a.forEach((d,_)=>a.set(_,!1))},[s]),C.useEffect(()=>{!s&&!a.size&&o&&o()},[s]),f==="popLayout"&&(e=i.jsx(aE,{isPresent:s,children:e})),i.jsx(Ac.Provider,{value:g,children:e})};function cE(){return new Map}function tx(e=!0){const t=C.useContext(Ac);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:l}=t,m=C.useId();C.useEffect(()=>{e&&l(m)},[e]);const f=C.useCallback(()=>e&&o&&o(m),[m,o,e]);return!s&&o?[!1,f]:[!0]}const Vl=e=>e.key||"";function Kv(e){const t=[];return C.Children.forEach(e,s=>{C.isValidElement(s)&&t.push(s)}),t}const wf=typeof window<"u",rx=wf?C.useLayoutEffect:C.useEffect,bf=({children:e,custom:t,initial:s=!0,onExitComplete:o,presenceAffectsLayout:l=!0,mode:m="sync",propagate:f=!1})=>{const[a,c]=tx(f),h=C.useMemo(()=>Kv(e),[e]),g=f&&!a?[]:h.map(Vl),d=C.useRef(!0),_=C.useRef(h),S=xf(()=>new Map),[E,b]=C.useState(h),[v,y]=C.useState(h);rx(()=>{d.current=!1,_.current=h;for(let k=0;k<v.length;k++){const P=Vl(v[k]);g.includes(P)?S.delete(P):S.get(P)!==!0&&S.set(P,!1)}},[v,g.length,g.join("-")]);const p=[];if(h!==E){let k=[...h];for(let P=0;P<v.length;P++){const T=v[P],R=Vl(T);g.includes(R)||(k.splice(P,0,T),p.push(T))}m==="wait"&&p.length&&(k=p),y(Kv(k)),b(h);return}const{forceRender:x}=C.useContext(yf);return i.jsx(i.Fragment,{children:v.map(k=>{const P=Vl(k),T=f&&!a?!1:h===v||g.includes(P),R=()=>{if(S.has(P))S.set(P,!0);else return;let j=!0;S.forEach(M=>{M||(j=!1)}),j&&(x==null||x(),y(_.current),f&&(c==null||c()),o&&o())};return i.jsx(lE,{isPresent:T,initial:!d.current||s?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:l,mode:m,onExitComplete:T?void 0:R,children:k},P)})})},Er=e=>e;let sx=Er;function Sf(e){let t;return()=>(t===void 0&&(t=e()),t)}const Wi=(e,t,s)=>{const o=t-e;return o===0?1:(s-e)/o},Ts=e=>e*1e3,As=e=>e/1e3,dE={useManualTiming:!1};function uE(e){let t=new Set,s=new Set,o=!1,l=!1;const m=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function a(h){m.has(h)&&(c.schedule(h),e()),h(f)}const c={schedule:(h,g=!1,d=!1)=>{const S=d&&o?t:s;return g&&m.add(h),S.has(h)||S.add(h),h},cancel:h=>{s.delete(h),m.delete(h)},process:h=>{if(f=h,o){l=!0;return}o=!0,[t,s]=[s,t],t.forEach(a),t.clear(),o=!1,l&&(l=!1,c.process(h))}};return c}const zl=["read","resolveKeyframes","update","preRender","render","postRender"],hE=40;function nx(e,t){let s=!1,o=!0;const l={delta:0,timestamp:0,isProcessing:!1},m=()=>s=!0,f=zl.reduce((y,p)=>(y[p]=uE(m),y),{}),{read:a,resolveKeyframes:c,update:h,preRender:g,render:d,postRender:_}=f,S=()=>{const y=performance.now();s=!1,l.delta=o?1e3/60:Math.max(Math.min(y-l.timestamp,hE),1),l.timestamp=y,l.isProcessing=!0,a.process(l),c.process(l),h.process(l),g.process(l),d.process(l),_.process(l),l.isProcessing=!1,s&&t&&(o=!1,e(S))},E=()=>{s=!0,o=!0,l.isProcessing||e(S)};return{schedule:zl.reduce((y,p)=>{const x=f[p];return y[p]=(k,P=!1,T=!1)=>(s||E(),x.schedule(k,P,T)),y},{}),cancel:y=>{for(let p=0;p<zl.length;p++)f[zl[p]].cancel(y)},state:l,steps:f}}const{schedule:nt,cancel:gn,state:Ft,steps:Zu}=nx(typeof requestAnimationFrame<"u"?requestAnimationFrame:Er,!0),ix=C.createContext({strict:!1}),Gv={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ui={};for(const e in Gv)Ui[e]={isEnabled:t=>Gv[e].some(s=>!!t[s])};function fE(e){for(const t in e)Ui[t]={...Ui[t],...e[t]}}const pE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function lc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pE.has(e)}let ox=e=>!lc(e);function mE(e){e&&(ox=t=>t.startsWith("on")?!lc(t):e(t))}try{mE(require("@emotion/is-prop-valid").default)}catch{}function gE(e,t,s){const o={};for(const l in e)l==="values"&&typeof e.values=="object"||(ox(l)||s===!0&&lc(l)||!t&&!lc(l)||e.draggable&&l.startsWith("onDrag"))&&(o[l]=e[l]);return o}function vE(e){if(typeof Proxy>"u")return e;const t=new Map,s=(...o)=>e(...o);return new Proxy(s,{get:(o,l)=>l==="create"?e:(t.has(l)||t.set(l,e(l)),t.get(l))})}const Dc=C.createContext({});function na(e){return typeof e=="string"||Array.isArray(e)}function Mc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Cf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kf=["initial",...Cf];function Lc(e){return Mc(e.animate)||kf.some(t=>na(e[t]))}function ax(e){return!!(Lc(e)||e.variants)}function yE(e,t){if(Lc(e)){const{initial:s,animate:o}=e;return{initial:s===!1||na(s)?s:void 0,animate:na(o)?o:void 0}}return e.inherit!==!1?t:{}}function xE(e){const{initial:t,animate:s}=yE(e,C.useContext(Dc));return C.useMemo(()=>({initial:t,animate:s}),[qv(t),qv(s)])}function qv(e){return Array.isArray(e)?e.join(" "):e}const _E=Symbol.for("motionComponentSymbol");function Oi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wE(e,t,s){return C.useCallback(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),s&&(typeof s=="function"?s(o):Oi(s)&&(s.current=o))},[t])}const Ef=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bE="framerAppearId",lx="data-"+Ef(bE),{schedule:jf}=nx(queueMicrotask,!1),cx=C.createContext({});function SE(e,t,s,o,l){var m,f;const{visualElement:a}=C.useContext(Dc),c=C.useContext(ix),h=C.useContext(Ac),g=C.useContext(_f).reducedMotion,d=C.useRef(null);o=o||c.renderer,!d.current&&o&&(d.current=o(e,{visualState:t,parent:a,props:s,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:g}));const _=d.current,S=C.useContext(cx);_&&!_.projection&&l&&(_.type==="html"||_.type==="svg")&&CE(d.current,s,l,S);const E=C.useRef(!1);C.useInsertionEffect(()=>{_&&E.current&&_.update(s,h)});const b=s[lx],v=C.useRef(!!b&&!(!((m=window.MotionHandoffIsComplete)===null||m===void 0)&&m.call(window,b))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,b)));return rx(()=>{_&&(E.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),jf.render(_.render),v.current&&_.animationState&&_.animationState.animateChanges())}),C.useEffect(()=>{_&&(!v.current&&_.animationState&&_.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),_}function CE(e,t,s,o){const{layoutId:l,layout:m,drag:f,dragConstraints:a,layoutScroll:c,layoutRoot:h}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:dx(e.parent)),e.projection.setOptions({layoutId:l,layout:m,alwaysMeasureLayout:!!f||a&&Oi(a),visualElement:e,animationType:typeof m=="string"?m:"both",initialPromotionConfig:o,layoutScroll:c,layoutRoot:h})}function dx(e){if(e)return e.options.allowProjection!==!1?e.projection:dx(e.parent)}function kE({preloadedFeatures:e,createVisualElement:t,useRender:s,useVisualState:o,Component:l}){var m,f;e&&fE(e);function a(h,g){let d;const _={...C.useContext(_f),...h,layoutId:EE(h)},{isStatic:S}=_,E=xE(h),b=o(h,S);if(!S&&wf){jE();const v=NE(_);d=v.MeasureLayout,E.visualElement=SE(l,b,_,t,v.ProjectionNode)}return i.jsxs(Dc.Provider,{value:E,children:[d&&E.visualElement?i.jsx(d,{visualElement:E.visualElement,..._}):null,s(l,h,wE(b,E.visualElement,g),b,S,E.visualElement)]})}a.displayName=`motion.${typeof l=="string"?l:`create(${(f=(m=l.displayName)!==null&&m!==void 0?m:l.name)!==null&&f!==void 0?f:""})`}`;const c=C.forwardRef(a);return c[_E]=l,c}function EE({layoutId:e}){const t=C.useContext(yf).id;return t&&e!==void 0?t+"-"+e:e}function jE(e,t){C.useContext(ix).strict}function NE(e){const{drag:t,layout:s}=Ui;if(!t&&!s)return{};const o={...t,...s};return{MeasureLayout:t!=null&&t.isEnabled(e)||s!=null&&s.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const PE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Nf(e){return typeof e!="string"||e.includes("-")?!1:!!(PE.indexOf(e)>-1||/[A-Z]/u.test(e))}function Yv(e){const t=[{},{}];return e==null||e.values.forEach((s,o)=>{t[0][o]=s.get(),t[1][o]=s.getVelocity()}),t}function Pf(e,t,s,o){if(typeof t=="function"){const[l,m]=Yv(o);t=t(s!==void 0?s:e.custom,l,m)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[l,m]=Yv(o);t=t(s!==void 0?s:e.custom,l,m)}return t}const Dh=e=>Array.isArray(e),RE=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),TE=e=>Dh(e)?e[e.length-1]||0:e,Jt=e=>!!(e&&e.getVelocity);function ec(e){const t=Jt(e)?e.get():e;return RE(t)?t.toValue():t}function AE({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:s},o,l,m){const f={latestValues:DE(o,l,m,e),renderState:t()};return s&&(f.onMount=a=>s({props:o,current:a,...f}),f.onUpdate=a=>s(a)),f}const ux=e=>(t,s)=>{const o=C.useContext(Dc),l=C.useContext(Ac),m=()=>AE(e,t,o,l);return s?m():xf(m)};function DE(e,t,s,o){const l={},m=o(e,{});for(const _ in m)l[_]=ec(m[_]);let{initial:f,animate:a}=e;const c=Lc(e),h=ax(e);t&&h&&!c&&e.inherit!==!1&&(f===void 0&&(f=t.initial),a===void 0&&(a=t.animate));let g=s?s.initial===!1:!1;g=g||f===!1;const d=g?a:f;if(d&&typeof d!="boolean"&&!Mc(d)){const _=Array.isArray(d)?d:[d];for(let S=0;S<_.length;S++){const E=Pf(e,_[S]);if(E){const{transitionEnd:b,transition:v,...y}=E;for(const p in y){let x=y[p];if(Array.isArray(x)){const k=g?x.length-1:0;x=x[k]}x!==null&&(l[p]=x)}for(const p in b)l[p]=b[p]}}}return l}const Zi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ii=new Set(Zi),hx=e=>t=>typeof t=="string"&&t.startsWith(e),fx=hx("--"),ME=hx("var(--"),Rf=e=>ME(e)?LE.test(e.split("/*")[0].trim()):!1,LE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,px=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ls=(e,t,s)=>s>t?t:s<e?e:s,eo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ia={...eo,transform:e=>Ls(0,1,e)},Wl={...eo,default:1},ya=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),un=ya("deg"),hs=ya("%"),Ie=ya("px"),OE=ya("vh"),IE=ya("vw"),Xv={...hs,parse:e=>hs.parse(e)/100,transform:e=>hs.transform(e*100)},BE={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,backgroundPositionX:Ie,backgroundPositionY:Ie},FE={rotate:un,rotateX:un,rotateY:un,rotateZ:un,scale:Wl,scaleX:Wl,scaleY:Wl,scaleZ:Wl,skew:un,skewX:un,skewY:un,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:ia,originX:Xv,originY:Xv,originZ:Ie},Jv={...eo,transform:Math.round},Tf={...BE,...FE,zIndex:Jv,size:Ie,fillOpacity:ia,strokeOpacity:ia,numOctaves:Jv},$E={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HE=Zi.length;function VE(e,t,s){let o="",l=!0;for(let m=0;m<HE;m++){const f=Zi[m],a=e[f];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(f.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||s){const h=px(a,Tf[f]);if(!c){l=!1;const g=$E[f]||f;o+=`${g}(${h}) `}s&&(t[f]=h)}}return o=o.trim(),s?o=s(t,l?"":o):l&&(o="none"),o}function Af(e,t,s){const{style:o,vars:l,transformOrigin:m}=e;let f=!1,a=!1;for(const c in t){const h=t[c];if(ii.has(c)){f=!0;continue}else if(fx(c)){l[c]=h;continue}else{const g=px(h,Tf[c]);c.startsWith("origin")?(a=!0,m[c]=g):o[c]=g}}if(t.transform||(f||s?o.transform=VE(t,e.transform,s):o.transform&&(o.transform="none")),a){const{originX:c="50%",originY:h="50%",originZ:g=0}=m;o.transformOrigin=`${c} ${h} ${g}`}}const zE={offset:"stroke-dashoffset",array:"stroke-dasharray"},WE={offset:"strokeDashoffset",array:"strokeDasharray"};function UE(e,t,s=1,o=0,l=!0){e.pathLength=1;const m=l?zE:WE;e[m.offset]=Ie.transform(-o);const f=Ie.transform(t),a=Ie.transform(s);e[m.array]=`${f} ${a}`}function Qv(e,t,s){return typeof e=="string"?e:Ie.transform(t+s*e)}function KE(e,t,s){const o=Qv(t,e.x,e.width),l=Qv(s,e.y,e.height);return`${o} ${l}`}function Df(e,{attrX:t,attrY:s,attrScale:o,originX:l,originY:m,pathLength:f,pathSpacing:a=1,pathOffset:c=0,...h},g,d){if(Af(e,h,d),g){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:_,style:S,dimensions:E}=e;_.transform&&(E&&(S.transform=_.transform),delete _.transform),E&&(l!==void 0||m!==void 0||S.transform)&&(S.transformOrigin=KE(E,l!==void 0?l:.5,m!==void 0?m:.5)),t!==void 0&&(_.x=t),s!==void 0&&(_.y=s),o!==void 0&&(_.scale=o),f!==void 0&&UE(_,f,a,c,!1)}const Mf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),mx=()=>({...Mf(),attrs:{}}),Lf=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gx(e,{style:t,vars:s},o,l){Object.assign(e.style,t,l&&l.getProjectionStyles(o));for(const m in s)e.style.setProperty(m,s[m])}const vx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yx(e,t,s,o){gx(e,t,void 0,o);for(const l in t.attrs)e.setAttribute(vx.has(l)?l:Ef(l),t.attrs[l])}const cc={};function GE(e){Object.assign(cc,e)}function xx(e,{layout:t,layoutId:s}){return ii.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!cc[e]||e==="opacity")}function Of(e,t,s){var o;const{style:l}=e,m={};for(const f in l)(Jt(l[f])||t.style&&Jt(t.style[f])||xx(f,e)||((o=s==null?void 0:s.getValue(f))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(m[f]=l[f]);return m}function _x(e,t,s){const o=Of(e,t,s);for(const l in e)if(Jt(e[l])||Jt(t[l])){const m=Zi.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;o[m]=e[l]}return o}function qE(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Zv=["x","y","width","height","cx","cy","r"],YE={useVisualState:ux({scrapeMotionValuesFromProps:_x,createRenderState:mx,onUpdate:({props:e,prevProps:t,current:s,renderState:o,latestValues:l})=>{if(!s)return;let m=!!e.drag;if(!m){for(const a in l)if(ii.has(a)){m=!0;break}}if(!m)return;let f=!t;if(t)for(let a=0;a<Zv.length;a++){const c=Zv[a];e[c]!==t[c]&&(f=!0)}f&&nt.read(()=>{qE(s,o),nt.render(()=>{Df(o,l,Lf(s.tagName),e.transformTemplate),yx(s,o)})})}})},XE={useVisualState:ux({scrapeMotionValuesFromProps:Of,createRenderState:Mf})};function wx(e,t,s){for(const o in t)!Jt(t[o])&&!xx(o,s)&&(e[o]=t[o])}function JE({transformTemplate:e},t){return C.useMemo(()=>{const s=Mf();return Af(s,t,e),Object.assign({},s.vars,s.style)},[t])}function QE(e,t){const s=e.style||{},o={};return wx(o,s,e),Object.assign(o,JE(e,t)),o}function ZE(e,t){const s={},o=QE(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=o,s}function ej(e,t,s,o){const l=C.useMemo(()=>{const m=mx();return Df(m,t,Lf(o),e.transformTemplate),{...m.attrs,style:{...m.style}}},[t]);if(e.style){const m={};wx(m,e.style,e),l.style={...m,...l.style}}return l}function tj(e=!1){return(s,o,l,{latestValues:m},f)=>{const c=(Nf(s)?ej:ZE)(o,m,f,s),h=gE(o,typeof s=="string",e),g=s!==C.Fragment?{...h,...c,ref:l}:{},{children:d}=o,_=C.useMemo(()=>Jt(d)?d.get():d,[d]);return C.createElement(s,{...g,children:_})}}function rj(e,t){return function(o,{forwardMotionProps:l}={forwardMotionProps:!1}){const f={...Nf(o)?YE:XE,preloadedFeatures:e,useRender:tj(l),createVisualElement:t,Component:o};return kE(f)}}function bx(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let o=0;o<s;o++)if(t[o]!==e[o])return!1;return!0}function Oc(e,t,s){const o=e.getProps();return Pf(o,t,s!==void 0?s:o.custom,e)}const sj=Sf(()=>window.ScrollTimeline!==void 0);class nj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,s){for(let o=0;o<this.animations.length;o++)this.animations[o][t]=s}attachTimeline(t,s){const o=this.animations.map(l=>{if(sj()&&l.attachTimeline)return l.attachTimeline(t);if(typeof s=="function")return s(l)});return()=>{o.forEach((l,m)=>{l&&l(),this.animations[m].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let s=0;s<this.animations.length;s++)t=Math.max(t,this.animations[s].duration);return t}runAll(t){this.animations.forEach(s=>s[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ij extends nj{then(t,s){return Promise.all(this.animations).then(t).catch(s)}}function If(e,t){return e?e[t]||e.default||e:void 0}const Mh=2e4;function Sx(e){let t=0;const s=50;let o=e.next(t);for(;!o.done&&t<Mh;)t+=s,o=e.next(t);return t>=Mh?1/0:t}function Bf(e){return typeof e=="function"}function e0(e,t){e.timeline=t,e.onfinish=null}const Ff=e=>Array.isArray(e)&&typeof e[0]=="number",oj={linearEasing:void 0};function aj(e,t){const s=Sf(e);return()=>{var o;return(o=oj[t])!==null&&o!==void 0?o:s()}}const dc=aj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cx=(e,t,s=10)=>{let o="";const l=Math.max(Math.round(t/s),2);for(let m=0;m<l;m++)o+=e(Wi(0,l-1,m))+", ";return`linear(${o.substring(0,o.length-2)})`};function kx(e){return!!(typeof e=="function"&&dc()||!e||typeof e=="string"&&(e in Lh||dc())||Ff(e)||Array.isArray(e)&&e.every(kx))}const Yo=([e,t,s,o])=>`cubic-bezier(${e}, ${t}, ${s}, ${o})`,Lh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yo([0,.65,.55,1]),circOut:Yo([.55,0,1,.45]),backIn:Yo([.31,.01,.66,-.59]),backOut:Yo([.33,1.53,.69,.99])};function Ex(e,t){if(e)return typeof e=="function"&&dc()?Cx(e,t):Ff(e)?Yo(e):Array.isArray(e)?e.map(s=>Ex(s,t)||Lh.easeOut):Lh[e]}const Jr={x:!1,y:!1};function jx(){return Jr.x||Jr.y}function lj(e,t,s){var o;if(e instanceof Element)return[e];if(typeof e=="string"){let l=document;const m=(o=void 0)!==null&&o!==void 0?o:l.querySelectorAll(e);return m?Array.from(m):[]}return Array.from(e)}function Nx(e,t){const s=lj(e),o=new AbortController,l={passive:!0,...t,signal:o.signal};return[s,l,()=>o.abort()]}function t0(e){return t=>{t.pointerType==="touch"||jx()||e(t)}}function cj(e,t,s={}){const[o,l,m]=Nx(e,s),f=t0(a=>{const{target:c}=a,h=t(a);if(typeof h!="function"||!c)return;const g=t0(d=>{h(d),c.removeEventListener("pointerleave",g)});c.addEventListener("pointerleave",g,l)});return o.forEach(a=>{a.addEventListener("pointerenter",f,l)}),m}const Px=(e,t)=>t?e===t?!0:Px(e,t.parentElement):!1,$f=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,dj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uj(e){return dj.has(e.tagName)||e.tabIndex!==-1}const Xo=new WeakSet;function r0(e){return t=>{t.key==="Enter"&&e(t)}}function eh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hj=(e,t)=>{const s=e.currentTarget;if(!s)return;const o=r0(()=>{if(Xo.has(s))return;eh(s,"down");const l=r0(()=>{eh(s,"up")}),m=()=>eh(s,"cancel");s.addEventListener("keyup",l,t),s.addEventListener("blur",m,t)});s.addEventListener("keydown",o,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),t)};function s0(e){return $f(e)&&!jx()}function fj(e,t,s={}){const[o,l,m]=Nx(e,s),f=a=>{const c=a.currentTarget;if(!s0(a)||Xo.has(c))return;Xo.add(c);const h=t(a),g=(S,E)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",_),!(!s0(S)||!Xo.has(c))&&(Xo.delete(c),typeof h=="function"&&h(S,{success:E}))},d=S=>{g(S,s.useGlobalTarget||Px(c,S.target))},_=S=>{g(S,!1)};window.addEventListener("pointerup",d,l),window.addEventListener("pointercancel",_,l)};return o.forEach(a=>{!uj(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(s.useGlobalTarget?window:a).addEventListener("pointerdown",f,l),a.addEventListener("focus",h=>hj(h,l),l)}),m}function pj(e){return e==="x"||e==="y"?Jr[e]?null:(Jr[e]=!0,()=>{Jr[e]=!1}):Jr.x||Jr.y?null:(Jr.x=Jr.y=!0,()=>{Jr.x=Jr.y=!1})}const Rx=new Set(["width","height","top","left","right","bottom",...Zi]);let tc;function mj(){tc=void 0}const fs={now:()=>(tc===void 0&&fs.set(Ft.isProcessing||dE.useManualTiming?Ft.timestamp:performance.now()),tc),set:e=>{tc=e,queueMicrotask(mj)}};function Hf(e,t){e.indexOf(t)===-1&&e.push(t)}function Vf(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}class zf{constructor(){this.subscriptions=[]}add(t){return Hf(this.subscriptions,t),()=>Vf(this.subscriptions,t)}notify(t,s,o){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](t,s,o);else for(let m=0;m<l;m++){const f=this.subscriptions[m];f&&f(t,s,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Tx(e,t){return t?e*(1e3/t):0}const n0=30,gj=e=>!isNaN(parseFloat(e));class vj{constructor(t,s={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,l=!0)=>{const m=fs.now();this.updatedAt!==m&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),l&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=fs.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new zf);const o=this.events[t].add(s);return t==="change"?()=>{o(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t,s=!0){!s||!this.passiveEffect?this.updateAndNotify(t,s):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>n0)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,n0);return Tx(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function oa(e,t){return new vj(e,t)}function yj(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,oa(s))}function xj(e,t){const s=Oc(e,t);let{transitionEnd:o={},transition:l={},...m}=s||{};m={...m,...o};for(const f in m){const a=TE(m[f]);yj(e,f,a)}}function _j(e){return!!(Jt(e)&&e.add)}function Oh(e,t){const s=e.getValue("willChange");if(_j(s))return s.add(t)}function Ax(e){return e.props[lx]}const Dx=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,wj=1e-7,bj=12;function Sj(e,t,s,o,l){let m,f,a=0;do f=t+(s-t)/2,m=Dx(f,o,l)-e,m>0?s=f:t=f;while(Math.abs(m)>wj&&++a<bj);return f}function xa(e,t,s,o){if(e===t&&s===o)return Er;const l=m=>Sj(m,0,1,e,s);return m=>m===0||m===1?m:Dx(l(m),t,o)}const Mx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Lx=e=>t=>1-e(1-t),Ox=xa(.33,1.53,.69,.99),Wf=Lx(Ox),Ix=Mx(Wf),Bx=e=>(e*=2)<1?.5*Wf(e):.5*(2-Math.pow(2,-10*(e-1))),Uf=e=>1-Math.sin(Math.acos(e)),Fx=Lx(Uf),$x=Mx(Uf),Hx=e=>/^0[^.\s]+$/u.test(e);function Cj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Hx(e):!0}const ea=e=>Math.round(e*1e5)/1e5,Kf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kj(e){return e==null}const Ej=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Gf=(e,t)=>s=>!!(typeof s=="string"&&Ej.test(s)&&s.startsWith(e)||t&&!kj(s)&&Object.prototype.hasOwnProperty.call(s,t)),Vx=(e,t,s)=>o=>{if(typeof o!="string")return o;const[l,m,f,a]=o.match(Kf);return{[e]:parseFloat(l),[t]:parseFloat(m),[s]:parseFloat(f),alpha:a!==void 0?parseFloat(a):1}},jj=e=>Ls(0,255,e),th={...eo,transform:e=>Math.round(jj(e))},Wn={test:Gf("rgb","red"),parse:Vx("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:o=1})=>"rgba("+th.transform(e)+", "+th.transform(t)+", "+th.transform(s)+", "+ea(ia.transform(o))+")"};function Nj(e){let t="",s="",o="",l="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),o=e.substring(5,7),l=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),o=e.substring(3,4),l=e.substring(4,5),t+=t,s+=s,o+=o,l+=l),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:l?parseInt(l,16)/255:1}}const Ih={test:Gf("#"),parse:Nj,transform:Wn.transform},Ii={test:Gf("hsl","hue"),parse:Vx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:o=1})=>"hsla("+Math.round(e)+", "+hs.transform(ea(t))+", "+hs.transform(ea(s))+", "+ea(ia.transform(o))+")"},Xt={test:e=>Wn.test(e)||Ih.test(e)||Ii.test(e),parse:e=>Wn.test(e)?Wn.parse(e):Ii.test(e)?Ii.parse(e):Ih.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Wn.transform(e):Ii.transform(e)},Pj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rj(e){var t,s;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Kf))===null||t===void 0?void 0:t.length)||0)+(((s=e.match(Pj))===null||s===void 0?void 0:s.length)||0)>0}const zx="number",Wx="color",Tj="var",Aj="var(",i0="${}",Dj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function aa(e){const t=e.toString(),s=[],o={color:[],number:[],var:[]},l=[];let m=0;const a=t.replace(Dj,c=>(Xt.test(c)?(o.color.push(m),l.push(Wx),s.push(Xt.parse(c))):c.startsWith(Aj)?(o.var.push(m),l.push(Tj),s.push(c)):(o.number.push(m),l.push(zx),s.push(parseFloat(c))),++m,i0)).split(i0);return{values:s,split:a,indexes:o,types:l}}function Ux(e){return aa(e).values}function Kx(e){const{split:t,types:s}=aa(e),o=t.length;return l=>{let m="";for(let f=0;f<o;f++)if(m+=t[f],l[f]!==void 0){const a=s[f];a===zx?m+=ea(l[f]):a===Wx?m+=Xt.transform(l[f]):m+=l[f]}return m}}const Mj=e=>typeof e=="number"?0:e;function Lj(e){const t=Ux(e);return Kx(e)(t.map(Mj))}const vn={test:Rj,parse:Ux,createTransformer:Kx,getAnimatableNone:Lj},Oj=new Set(["brightness","contrast","saturate","opacity"]);function Ij(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[o]=s.match(Kf)||[];if(!o)return e;const l=s.replace(o,"");let m=Oj.has(t)?1:0;return o!==s&&(m*=100),t+"("+m+l+")"}const Bj=/\b([a-z-]*)\(.*?\)/gu,Bh={...vn,getAnimatableNone:e=>{const t=e.match(Bj);return t?t.map(Ij).join(" "):e}},Fj={...Tf,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Bh,WebkitFilter:Bh},qf=e=>Fj[e];function Gx(e,t){let s=qf(e);return s!==Bh&&(s=vn),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const $j=new Set(["auto","none","0"]);function Hj(e,t,s){let o=0,l;for(;o<e.length&&!l;){const m=e[o];typeof m=="string"&&!$j.has(m)&&aa(m).values.length&&(l=e[o]),o++}if(l&&s)for(const m of t)e[m]=Gx(s,l)}const o0=e=>e===eo||e===Ie,a0=(e,t)=>parseFloat(e.split(", ")[t]),l0=(e,t)=>(s,{transform:o})=>{if(o==="none"||!o)return 0;const l=o.match(/^matrix3d\((.+)\)$/u);if(l)return a0(l[1],t);{const m=o.match(/^matrix\((.+)\)$/u);return m?a0(m[1],e):0}},Vj=new Set(["x","y","z"]),zj=Zi.filter(e=>!Vj.has(e));function Wj(e){const t=[];return zj.forEach(s=>{const o=e.getValue(s);o!==void 0&&(t.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),t}const Ki={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:l0(4,13),y:l0(5,14)};Ki.translateX=Ki.x;Ki.translateY=Ki.y;const Un=new Set;let Fh=!1,$h=!1;function qx(){if($h){const e=Array.from(Un).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),s=new Map;t.forEach(o=>{const l=Wj(o);l.length&&(s.set(o,l),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();const l=s.get(o);l&&l.forEach(([m,f])=>{var a;(a=o.getValue(m))===null||a===void 0||a.set(f)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}$h=!1,Fh=!1,Un.forEach(e=>e.complete()),Un.clear()}function Yx(){Un.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($h=!0)})}function Uj(){Yx(),qx()}class Yf{constructor(t,s,o,l,m,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=o,this.motionValue=l,this.element=m,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Un.add(this),Fh||(Fh=!0,nt.read(Yx),nt.resolveKeyframes(qx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:o,motionValue:l}=this;for(let m=0;m<t.length;m++)if(t[m]===null)if(m===0){const f=l==null?void 0:l.get(),a=t[t.length-1];if(f!==void 0)t[0]=f;else if(o&&s){const c=o.readValue(s,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),l&&f===void 0&&l.set(t[0])}else t[m]=t[m-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Un.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Un.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Xx=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Kj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gj(e){const t=Kj.exec(e);if(!t)return[,];const[,s,o,l]=t;return[`--${s??o}`,l]}function Jx(e,t,s=1){const[o,l]=Gj(e);if(!o)return;const m=window.getComputedStyle(t).getPropertyValue(o);if(m){const f=m.trim();return Xx(f)?parseFloat(f):f}return Rf(l)?Jx(l,t,s+1):l}const Qx=e=>t=>t.test(e),qj={test:e=>e==="auto",parse:e=>e},Zx=[eo,Ie,hs,un,IE,OE,qj],c0=e=>Zx.find(Qx(e));class e_ extends Yf{constructor(t,s,o,l,m){super(t,s,o,l,m,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:o}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),Rf(h))){const g=Jx(h,s.current);g!==void 0&&(t[c]=g),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Rx.has(o)||t.length!==2)return;const[l,m]=t,f=c0(l),a=c0(m);if(f!==a)if(o0(f)&&o0(a))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,o=[];for(let l=0;l<t.length;l++)Cj(t[l])&&o.push(l);o.length&&Hj(t,o,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:o}=this;if(!t||!t.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ki[o](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const l=s[s.length-1];l!==void 0&&t.getValue(o,l).jump(l,!1)}measureEndState(){var t;const{element:s,name:o,unresolvedKeyframes:l}=this;if(!s||!s.current)return;const m=s.getValue(o);m&&m.jump(this.measuredOrigin,!1);const f=l.length-1,a=l[f];l[f]=Ki[o](s.measureViewportBox(),window.getComputedStyle(s.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,h])=>{s.getValue(c).set(h)}),this.resolveNoneKeyframes()}}const d0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(vn.test(e)||e==="0")&&!e.startsWith("url("));function Yj(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function Xj(e,t,s,o){const l=e[0];if(l===null)return!1;if(t==="display"||t==="visibility")return!0;const m=e[e.length-1],f=d0(l,t),a=d0(m,t);return!f||!a?!1:Yj(e)||(s==="spring"||Bf(s))&&o}const Jj=e=>e!==null;function Ic(e,{repeat:t,repeatType:s="loop"},o){const l=e.filter(Jj),m=t&&s!=="loop"&&t%2===1?0:l.length-1;return!m||o===void 0?l[m]:o}const Qj=40;class t_{constructor({autoplay:t=!0,delay:s=0,type:o="keyframes",repeat:l=0,repeatDelay:m=0,repeatType:f="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=fs.now(),this.options={autoplay:t,delay:s,type:o,repeat:l,repeatDelay:m,repeatType:f,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Qj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Uj(),this._resolved}onKeyframesResolved(t,s){this.resolvedAt=fs.now(),this.hasAttemptedResolve=!0;const{name:o,type:l,velocity:m,delay:f,onComplete:a,onUpdate:c,isGenerator:h}=this.options;if(!h&&!Xj(t,o,l,m))if(f)this.options.duration=0;else{c&&c(Ic(t,this.options,s)),a&&a(),this.resolveFinishedPromise();return}const g=this.initPlayback(t,s);g!==!1&&(this._resolved={keyframes:t,finalKeyframe:s,...g},this.onPostResolved())}onPostResolved(){}then(t,s){return this.currentFinishedPromise.then(t,s)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const ct=(e,t,s)=>e+(t-e)*s;function rh(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function Zj({hue:e,saturation:t,lightness:s,alpha:o}){e/=360,t/=100,s/=100;let l=0,m=0,f=0;if(!t)l=m=f=s;else{const a=s<.5?s*(1+t):s+t-s*t,c=2*s-a;l=rh(c,a,e+1/3),m=rh(c,a,e),f=rh(c,a,e-1/3)}return{red:Math.round(l*255),green:Math.round(m*255),blue:Math.round(f*255),alpha:o}}function uc(e,t){return s=>s>0?t:e}const sh=(e,t,s)=>{const o=e*e,l=s*(t*t-o)+o;return l<0?0:Math.sqrt(l)},eN=[Ih,Wn,Ii],tN=e=>eN.find(t=>t.test(e));function u0(e){const t=tN(e);if(!t)return!1;let s=t.parse(e);return t===Ii&&(s=Zj(s)),s}const h0=(e,t)=>{const s=u0(e),o=u0(t);if(!s||!o)return uc(e,t);const l={...s};return m=>(l.red=sh(s.red,o.red,m),l.green=sh(s.green,o.green,m),l.blue=sh(s.blue,o.blue,m),l.alpha=ct(s.alpha,o.alpha,m),Wn.transform(l))},rN=(e,t)=>s=>t(e(s)),_a=(...e)=>e.reduce(rN),Hh=new Set(["none","hidden"]);function sN(e,t){return Hh.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function nN(e,t){return s=>ct(e,t,s)}function Xf(e){return typeof e=="number"?nN:typeof e=="string"?Rf(e)?uc:Xt.test(e)?h0:aN:Array.isArray(e)?r_:typeof e=="object"?Xt.test(e)?h0:iN:uc}function r_(e,t){const s=[...e],o=s.length,l=e.map((m,f)=>Xf(m)(m,t[f]));return m=>{for(let f=0;f<o;f++)s[f]=l[f](m);return s}}function iN(e,t){const s={...e,...t},o={};for(const l in s)e[l]!==void 0&&t[l]!==void 0&&(o[l]=Xf(e[l])(e[l],t[l]));return l=>{for(const m in o)s[m]=o[m](l);return s}}function oN(e,t){var s;const o=[],l={color:0,var:0,number:0};for(let m=0;m<t.values.length;m++){const f=t.types[m],a=e.indexes[f][l[f]],c=(s=e.values[a])!==null&&s!==void 0?s:0;o[m]=c,l[f]++}return o}const aN=(e,t)=>{const s=vn.createTransformer(t),o=aa(e),l=aa(t);return o.indexes.var.length===l.indexes.var.length&&o.indexes.color.length===l.indexes.color.length&&o.indexes.number.length>=l.indexes.number.length?Hh.has(e)&&!l.values.length||Hh.has(t)&&!o.values.length?sN(e,t):_a(r_(oN(o,l),l.values),s):uc(e,t)};function s_(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?ct(e,t,s):Xf(e)(e,t)}const lN=5;function n_(e,t,s){const o=Math.max(t-lN,0);return Tx(s-e(o),t-o)}const ft={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nh=.001;function cN({duration:e=ft.duration,bounce:t=ft.bounce,velocity:s=ft.velocity,mass:o=ft.mass}){let l,m,f=1-t;f=Ls(ft.minDamping,ft.maxDamping,f),e=Ls(ft.minDuration,ft.maxDuration,As(e)),f<1?(l=h=>{const g=h*f,d=g*e,_=g-s,S=Vh(h,f),E=Math.exp(-d);return nh-_/S*E},m=h=>{const d=h*f*e,_=d*s+s,S=Math.pow(f,2)*Math.pow(h,2)*e,E=Math.exp(-d),b=Vh(Math.pow(h,2),f);return(-l(h)+nh>0?-1:1)*((_-S)*E)/b}):(l=h=>{const g=Math.exp(-h*e),d=(h-s)*e+1;return-nh+g*d},m=h=>{const g=Math.exp(-h*e),d=(s-h)*(e*e);return g*d});const a=5/e,c=uN(l,m,a);if(e=Ts(e),isNaN(c))return{stiffness:ft.stiffness,damping:ft.damping,duration:e};{const h=Math.pow(c,2)*o;return{stiffness:h,damping:f*2*Math.sqrt(o*h),duration:e}}}const dN=12;function uN(e,t,s){let o=s;for(let l=1;l<dN;l++)o=o-e(o)/t(o);return o}function Vh(e,t){return e*Math.sqrt(1-t*t)}const hN=["duration","bounce"],fN=["stiffness","damping","mass"];function f0(e,t){return t.some(s=>e[s]!==void 0)}function pN(e){let t={velocity:ft.velocity,stiffness:ft.stiffness,damping:ft.damping,mass:ft.mass,isResolvedFromDuration:!1,...e};if(!f0(e,fN)&&f0(e,hN))if(e.visualDuration){const s=e.visualDuration,o=2*Math.PI/(s*1.2),l=o*o,m=2*Ls(.05,1,1-(e.bounce||0))*Math.sqrt(l);t={...t,mass:ft.mass,stiffness:l,damping:m}}else{const s=cN(e);t={...t,...s,mass:ft.mass},t.isResolvedFromDuration=!0}return t}function i_(e=ft.visualDuration,t=ft.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:o,restDelta:l}=s;const m=s.keyframes[0],f=s.keyframes[s.keyframes.length-1],a={done:!1,value:m},{stiffness:c,damping:h,mass:g,duration:d,velocity:_,isResolvedFromDuration:S}=pN({...s,velocity:-As(s.velocity||0)}),E=_||0,b=h/(2*Math.sqrt(c*g)),v=f-m,y=As(Math.sqrt(c/g)),p=Math.abs(v)<5;o||(o=p?ft.restSpeed.granular:ft.restSpeed.default),l||(l=p?ft.restDelta.granular:ft.restDelta.default);let x;if(b<1){const P=Vh(y,b);x=T=>{const R=Math.exp(-b*y*T);return f-R*((E+b*y*v)/P*Math.sin(P*T)+v*Math.cos(P*T))}}else if(b===1)x=P=>f-Math.exp(-y*P)*(v+(E+y*v)*P);else{const P=y*Math.sqrt(b*b-1);x=T=>{const R=Math.exp(-b*y*T),j=Math.min(P*T,300);return f-R*((E+b*y*v)*Math.sinh(j)+P*v*Math.cosh(j))/P}}const k={calculatedDuration:S&&d||null,next:P=>{const T=x(P);if(S)a.done=P>=d;else{let R=0;b<1&&(R=P===0?Ts(E):n_(x,P,T));const j=Math.abs(R)<=o,M=Math.abs(f-T)<=l;a.done=j&&M}return a.value=a.done?f:T,a},toString:()=>{const P=Math.min(Sx(k),Mh),T=Cx(R=>k.next(P*R).value,P,30);return P+"ms "+T}};return k}function p0({keyframes:e,velocity:t=0,power:s=.8,timeConstant:o=325,bounceDamping:l=10,bounceStiffness:m=500,modifyTarget:f,min:a,max:c,restDelta:h=.5,restSpeed:g}){const d=e[0],_={done:!1,value:d},S=j=>a!==void 0&&j<a||c!==void 0&&j>c,E=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let b=s*t;const v=d+b,y=f===void 0?v:f(v);y!==v&&(b=y-d);const p=j=>-b*Math.exp(-j/o),x=j=>y+p(j),k=j=>{const M=p(j),$=x(j);_.done=Math.abs(M)<=h,_.value=_.done?y:$};let P,T;const R=j=>{S(_.value)&&(P=j,T=i_({keyframes:[_.value,E(_.value)],velocity:n_(x,j,_.value),damping:l,stiffness:m,restDelta:h,restSpeed:g}))};return R(0),{calculatedDuration:null,next:j=>{let M=!1;return!T&&P===void 0&&(M=!0,k(j),R(j)),P!==void 0&&j>=P?T.next(j-P):(!M&&k(j),_)}}}const mN=xa(.42,0,1,1),gN=xa(0,0,.58,1),o_=xa(.42,0,.58,1),vN=e=>Array.isArray(e)&&typeof e[0]!="number",yN={linear:Er,easeIn:mN,easeInOut:o_,easeOut:gN,circIn:Uf,circInOut:$x,circOut:Fx,backIn:Wf,backInOut:Ix,backOut:Ox,anticipate:Bx},m0=e=>{if(Ff(e)){sx(e.length===4);const[t,s,o,l]=e;return xa(t,s,o,l)}else if(typeof e=="string")return yN[e];return e};function xN(e,t,s){const o=[],l=s||s_,m=e.length-1;for(let f=0;f<m;f++){let a=l(e[f],e[f+1]);if(t){const c=Array.isArray(t)?t[f]||Er:t;a=_a(c,a)}o.push(a)}return o}function _N(e,t,{clamp:s=!0,ease:o,mixer:l}={}){const m=e.length;if(sx(m===t.length),m===1)return()=>t[0];if(m===2&&t[0]===t[1])return()=>t[1];const f=e[0]===e[1];e[0]>e[m-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=xN(t,o,l),c=a.length,h=g=>{if(f&&g<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(g<e[d+1]);d++);const _=Wi(e[d],e[d+1],g);return a[d](_)};return s?g=>h(Ls(e[0],e[m-1],g)):h}function wN(e,t){const s=e[e.length-1];for(let o=1;o<=t;o++){const l=Wi(0,t,o);e.push(ct(s,1,l))}}function bN(e){const t=[0];return wN(t,e.length-1),t}function SN(e,t){return e.map(s=>s*t)}function CN(e,t){return e.map(()=>t||o_).splice(0,e.length-1)}function hc({duration:e=300,keyframes:t,times:s,ease:o="easeInOut"}){const l=vN(o)?o.map(m0):m0(o),m={done:!1,value:t[0]},f=SN(s&&s.length===t.length?s:bN(t),e),a=_N(f,t,{ease:Array.isArray(l)?l:CN(t,l)});return{calculatedDuration:e,next:c=>(m.value=a(c),m.done=c>=e,m)}}const kN=e=>{const t=({timestamp:s})=>e(s);return{start:()=>nt.update(t,!0),stop:()=>gn(t),now:()=>Ft.isProcessing?Ft.timestamp:fs.now()}},EN={decay:p0,inertia:p0,tween:hc,keyframes:hc,spring:i_},jN=e=>e/100;class Jf extends t_{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:s,motionValue:o,element:l,keyframes:m}=this.options,f=(l==null?void 0:l.KeyframeResolver)||Yf,a=(c,h)=>this.onKeyframesResolved(c,h);this.resolver=new f(m,a,s,o,l),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:s="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:m,velocity:f=0}=this.options,a=Bf(s)?s:EN[s]||hc;let c,h;a!==hc&&typeof t[0]!="number"&&(c=_a(jN,s_(t[0],t[1])),t=[0,100]);const g=a({...this.options,keyframes:t});m==="mirror"&&(h=a({...this.options,keyframes:[...t].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=Sx(g));const{calculatedDuration:d}=g,_=d+l,S=_*(o+1)-l;return{generator:g,mirroredGenerator:h,mapPercentToKeyframes:c,calculatedDuration:d,resolvedDuration:_,totalDuration:S}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,s=!1){const{resolved:o}=this;if(!o){const{keyframes:j}=this.options;return{done:!0,value:j[j.length-1]}}const{finalKeyframe:l,generator:m,mirroredGenerator:f,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:h,totalDuration:g,resolvedDuration:d}=o;if(this.startTime===null)return m.next(0);const{delay:_,repeat:S,repeatType:E,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-g/this.speed,this.startTime)),s?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-_*(this.speed>=0?1:-1),p=this.speed>=0?y<0:y>g;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let x=this.currentTime,k=m;if(S){const j=Math.min(this.currentTime,g)/d;let M=Math.floor(j),$=j%1;!$&&j>=1&&($=1),$===1&&M--,M=Math.min(M,S+1),!!(M%2)&&(E==="reverse"?($=1-$,b&&($-=b/d)):E==="mirror"&&(k=f)),x=Ls(0,1,$)*d}const P=p?{done:!1,value:c[0]}:k.next(x);a&&(P.value=a(P.value));let{done:T}=P;!p&&h!==null&&(T=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return R&&l!==void 0&&(P.value=Ic(c,this.options,l)),v&&v(P.value),R&&this.finish(),P}get duration(){const{resolved:t}=this;return t?As(t.calculatedDuration):0}get time(){return As(this.currentTime)}set time(t){t=Ts(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;this.playbackSpeed=t,s&&(this.time=As(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=kN,onPlay:s,startTime:o}=this.options;this.driver||(this.driver=t(m=>this.tick(m))),s&&s();const l=this.driver.now();this.holdTime!==null?this.startTime=l-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=l):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const NN=new Set(["opacity","clipPath","filter","transform"]);function PN(e,t,s,{delay:o=0,duration:l=300,repeat:m=0,repeatType:f="loop",ease:a="easeInOut",times:c}={}){const h={[t]:s};c&&(h.offset=c);const g=Ex(a,l);return Array.isArray(g)&&(h.easing=g),e.animate(h,{delay:o,duration:l,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:m+1,direction:f==="reverse"?"alternate":"normal"})}const RN=Sf(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fc=10,TN=2e4;function AN(e){return Bf(e.type)||e.type==="spring"||!kx(e.ease)}function DN(e,t){const s=new Jf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:e[0]};const l=[];let m=0;for(;!o.done&&m<TN;)o=s.sample(m),l.push(o.value),m+=fc;return{times:void 0,keyframes:l,duration:m-fc,ease:"linear"}}const a_={anticipate:Bx,backInOut:Ix,circInOut:$x};function MN(e){return e in a_}class g0 extends t_{constructor(t){super(t);const{name:s,motionValue:o,element:l,keyframes:m}=this.options;this.resolver=new e_(m,(f,a)=>this.onKeyframesResolved(f,a),s,o,l),this.resolver.scheduleResolve()}initPlayback(t,s){let{duration:o=300,times:l,ease:m,type:f,motionValue:a,name:c,startTime:h}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof m=="string"&&dc()&&MN(m)&&(m=a_[m]),AN(this.options)){const{onComplete:d,onUpdate:_,motionValue:S,element:E,...b}=this.options,v=DN(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),o=v.duration,l=v.times,m=v.ease,f="keyframes"}const g=PN(a.owner.current,c,t,{...this.options,duration:o,times:l,ease:m});return g.startTime=h??this.calcStartTime(),this.pendingTimeline?(e0(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:d}=this.options;a.set(Ic(t,this.options,s)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:o,times:l,type:f,ease:m,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:s}=t;return As(s)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:s}=t;return As(s.currentTime||0)}set time(t){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.currentTime=Ts(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:s}=t;return s.playbackRate}set speed(t){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:s}=t;return s.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:s}=t;return s.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:s}=this;if(!s)return Er;const{animation:o}=s;e0(o,t)}return Er}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:s}=t;s.playState==="finished"&&this.updateFinishedPromise(),s.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:s}=t;s.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:s,keyframes:o,duration:l,type:m,ease:f,times:a}=t;if(s.playState==="idle"||s.playState==="finished")return;if(this.time){const{motionValue:h,onUpdate:g,onComplete:d,element:_,...S}=this.options,E=new Jf({...S,keyframes:o,duration:l,type:m,ease:f,times:a,isGenerator:!0}),b=Ts(this.time);h.setWithVelocity(E.sample(b-fc).value,E.sample(b).value,fc)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:s,name:o,repeatDelay:l,repeatType:m,damping:f,type:a}=t;if(!s||!s.owner||!(s.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=s.owner.getProps();return RN()&&o&&NN.has(o)&&!c&&!h&&!l&&m!=="mirror"&&f!==0&&a!=="inertia"}}const LN={type:"spring",stiffness:500,damping:25,restSpeed:10},ON=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),IN={type:"keyframes",duration:.8},BN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},FN=(e,{keyframes:t})=>t.length>2?IN:ii.has(e)?e.startsWith("scale")?ON(t[1]):LN:BN;function $N({when:e,delay:t,delayChildren:s,staggerChildren:o,staggerDirection:l,repeat:m,repeatType:f,repeatDelay:a,from:c,elapsed:h,...g}){return!!Object.keys(g).length}const Qf=(e,t,s,o={},l,m)=>f=>{const a=If(o,e)||{},c=a.delay||o.delay||0;let{elapsed:h=0}=o;h=h-Ts(c);let g={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-h,onUpdate:_=>{t.set(_),a.onUpdate&&a.onUpdate(_)},onComplete:()=>{f(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:m?void 0:l};$N(a)||(g={...g,...FN(e,g)}),g.duration&&(g.duration=Ts(g.duration)),g.repeatDelay&&(g.repeatDelay=Ts(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let d=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(d=!0)),d&&!m&&t.get()!==void 0){const _=Ic(g.keyframes,a);if(_!==void 0)return nt.update(()=>{g.onUpdate(_),g.onComplete()}),new ij([])}return!m&&g0.supports(g)?new g0(g):new Jf(g)};function HN({protectedKeys:e,needsAnimating:t},s){const o=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,o}function l_(e,t,{delay:s=0,transitionOverride:o,type:l}={}){var m;let{transition:f=e.getDefaultTransition(),transitionEnd:a,...c}=t;o&&(f=o);const h=[],g=l&&e.animationState&&e.animationState.getState()[l];for(const d in c){const _=e.getValue(d,(m=e.latestValues[d])!==null&&m!==void 0?m:null),S=c[d];if(S===void 0||g&&HN(g,d))continue;const E={delay:s,...If(f||{},d)};let b=!1;if(window.MotionHandoffAnimation){const y=Ax(e);if(y){const p=window.MotionHandoffAnimation(y,d,nt);p!==null&&(E.startTime=p,b=!0)}}Oh(e,d),_.start(Qf(d,_,S,e.shouldReduceMotion&&Rx.has(d)?{type:!1}:E,e,b));const v=_.animation;v&&h.push(v)}return a&&Promise.all(h).then(()=>{nt.update(()=>{a&&xj(e,a)})}),h}function zh(e,t,s={}){var o;const l=Oc(e,t,s.type==="exit"?(o=e.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:m=e.getDefaultTransition()||{}}=l||{};s.transitionOverride&&(m=s.transitionOverride);const f=l?()=>Promise.all(l_(e,l,s)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:g=0,staggerChildren:d,staggerDirection:_}=m;return VN(e,t,g+h,d,_,s)}:()=>Promise.resolve(),{when:c}=m;if(c){const[h,g]=c==="beforeChildren"?[f,a]:[a,f];return h().then(()=>g())}else return Promise.all([f(),a(s.delay)])}function VN(e,t,s=0,o=0,l=1,m){const f=[],a=(e.variantChildren.size-1)*o,c=l===1?(h=0)=>h*o:(h=0)=>a-h*o;return Array.from(e.variantChildren).sort(zN).forEach((h,g)=>{h.notify("AnimationStart",t),f.push(zh(h,t,{...m,delay:s+c(g)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(f)}function zN(e,t){return e.sortNodePosition(t)}function WN(e,t,s={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){const l=t.map(m=>zh(e,m,s));o=Promise.all(l)}else if(typeof t=="string")o=zh(e,t,s);else{const l=typeof t=="function"?Oc(e,t,s.custom):t;o=Promise.all(l_(e,l,s))}return o.then(()=>{e.notify("AnimationComplete",t)})}const UN=kf.length;function c_(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?c_(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<UN;s++){const o=kf[s],l=e.props[o];(na(l)||l===!1)&&(t[o]=l)}return t}const KN=[...Cf].reverse(),GN=Cf.length;function qN(e){return t=>Promise.all(t.map(({animation:s,options:o})=>WN(e,s,o)))}function YN(e){let t=qN(e),s=v0(),o=!0;const l=c=>(h,g)=>{var d;const _=Oc(e,g,c==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(_){const{transition:S,transitionEnd:E,...b}=_;h={...h,...b,...E}}return h};function m(c){t=c(e)}function f(c){const{props:h}=e,g=c_(e.parent)||{},d=[],_=new Set;let S={},E=1/0;for(let v=0;v<GN;v++){const y=KN[v],p=s[y],x=h[y]!==void 0?h[y]:g[y],k=na(x),P=y===c?p.isActive:null;P===!1&&(E=v);let T=x===g[y]&&x!==h[y]&&k;if(T&&o&&e.manuallyAnimateOnMount&&(T=!1),p.protectedKeys={...S},!p.isActive&&P===null||!x&&!p.prevProp||Mc(x)||typeof x=="boolean")continue;const R=XN(p.prevProp,x);let j=R||y===c&&p.isActive&&!T&&k||v>E&&k,M=!1;const $=Array.isArray(x)?x:[x];let F=$.reduce(l(y),{});P===!1&&(F={});const{prevResolvedValues:U={}}=p,H={...U,...F},Q=J=>{j=!0,_.has(J)&&(M=!0,_.delete(J)),p.needsAnimating[J]=!0;const W=e.getValue(J);W&&(W.liveStyle=!1)};for(const J in H){const W=F[J],D=U[J];if(S.hasOwnProperty(J))continue;let B=!1;Dh(W)&&Dh(D)?B=!bx(W,D):B=W!==D,B?W!=null?Q(J):_.add(J):W!==void 0&&_.has(J)?Q(J):p.protectedKeys[J]=!0}p.prevProp=x,p.prevResolvedValues=F,p.isActive&&(S={...S,...F}),o&&e.blockInitialAnimation&&(j=!1),j&&(!(T&&R)||M)&&d.push(...$.map(J=>({animation:J,options:{type:y}})))}if(_.size){const v={};_.forEach(y=>{const p=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=p??null}),d.push({animation:v})}let b=!!d.length;return o&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(b=!1),o=!1,b?t(d):Promise.resolve()}function a(c,h){var g;if(s[c].isActive===h)return Promise.resolve();(g=e.variantChildren)===null||g===void 0||g.forEach(_=>{var S;return(S=_.animationState)===null||S===void 0?void 0:S.setActive(c,h)}),s[c].isActive=h;const d=f(c);for(const _ in s)s[_].protectedKeys={};return d}return{animateChanges:f,setActive:a,setAnimateFunction:m,getState:()=>s,reset:()=>{s=v0(),o=!0}}}function XN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bx(t,e):!1}function $n(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function v0(){return{animate:$n(!0),whileInView:$n(),whileHover:$n(),whileTap:$n(),whileDrag:$n(),whileFocus:$n(),exit:$n()}}class bn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class JN extends bn{constructor(t){super(t),t.animationState||(t.animationState=YN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let QN=0;class ZN extends bn{constructor(){super(...arguments),this.id=QN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const l=this.node.animationState.setActive("exit",!t);s&&!t&&l.then(()=>s(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const eP={animation:{Feature:JN},exit:{Feature:ZN}};function la(e,t,s,o={passive:!0}){return e.addEventListener(t,s,o),()=>e.removeEventListener(t,s)}function wa(e){return{point:{x:e.pageX,y:e.pageY}}}const tP=e=>t=>$f(t)&&e(t,wa(t));function ta(e,t,s,o){return la(e,t,tP(s),o)}const y0=(e,t)=>Math.abs(e-t);function rP(e,t){const s=y0(e.x,t.x),o=y0(e.y,t.y);return Math.sqrt(s**2+o**2)}class d_{constructor(t,s,{transformPagePoint:o,contextWindow:l,dragSnapToOrigin:m=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=oh(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,S=rP(d.offset,{x:0,y:0})>=3;if(!_&&!S)return;const{point:E}=d,{timestamp:b}=Ft;this.history.push({...E,timestamp:b});const{onStart:v,onMove:y}=this.handlers;_||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,_)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ih(_,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(d,_)=>{this.end();const{onEnd:S,onSessionEnd:E,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=oh(d.type==="pointercancel"?this.lastMoveEventInfo:ih(_,this.transformPagePoint),this.history);this.startEvent&&S&&S(d,v),E&&E(d,v)},!$f(t))return;this.dragSnapToOrigin=m,this.handlers=s,this.transformPagePoint=o,this.contextWindow=l||window;const f=wa(t),a=ih(f,this.transformPagePoint),{point:c}=a,{timestamp:h}=Ft;this.history=[{...c,timestamp:h}];const{onSessionStart:g}=s;g&&g(t,oh(a,this.history)),this.removeListeners=_a(ta(this.contextWindow,"pointermove",this.handlePointerMove),ta(this.contextWindow,"pointerup",this.handlePointerUp),ta(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),gn(this.updatePoint)}}function ih(e,t){return t?{point:t(e.point)}:e}function x0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oh({point:e},t){return{point:e,delta:x0(e,u_(t)),offset:x0(e,sP(t)),velocity:nP(t,.1)}}function sP(e){return e[0]}function u_(e){return e[e.length-1]}function nP(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const l=u_(e);for(;s>=0&&(o=e[s],!(l.timestamp-o.timestamp>Ts(t)));)s--;if(!o)return{x:0,y:0};const m=As(l.timestamp-o.timestamp);if(m===0)return{x:0,y:0};const f={x:(l.x-o.x)/m,y:(l.y-o.y)/m};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const h_=1e-4,iP=1-h_,oP=1+h_,f_=.01,aP=0-f_,lP=0+f_;function Pr(e){return e.max-e.min}function cP(e,t,s){return Math.abs(e-t)<=s}function _0(e,t,s,o=.5){e.origin=o,e.originPoint=ct(t.min,t.max,e.origin),e.scale=Pr(s)/Pr(t),e.translate=ct(s.min,s.max,e.origin)-e.originPoint,(e.scale>=iP&&e.scale<=oP||isNaN(e.scale))&&(e.scale=1),(e.translate>=aP&&e.translate<=lP||isNaN(e.translate))&&(e.translate=0)}function ra(e,t,s,o){_0(e.x,t.x,s.x,o?o.originX:void 0),_0(e.y,t.y,s.y,o?o.originY:void 0)}function w0(e,t,s){e.min=s.min+t.min,e.max=e.min+Pr(t)}function dP(e,t,s){w0(e.x,t.x,s.x),w0(e.y,t.y,s.y)}function b0(e,t,s){e.min=t.min-s.min,e.max=e.min+Pr(t)}function sa(e,t,s){b0(e.x,t.x,s.x),b0(e.y,t.y,s.y)}function uP(e,{min:t,max:s},o){return t!==void 0&&e<t?e=o?ct(t,e,o.min):Math.max(e,t):s!==void 0&&e>s&&(e=o?ct(s,e,o.max):Math.min(e,s)),e}function S0(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function hP(e,{top:t,left:s,bottom:o,right:l}){return{x:S0(e.x,s,l),y:S0(e.y,t,o)}}function C0(e,t){let s=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,o]=[o,s]),{min:s,max:o}}function fP(e,t){return{x:C0(e.x,t.x),y:C0(e.y,t.y)}}function pP(e,t){let s=.5;const o=Pr(e),l=Pr(t);return l>o?s=Wi(t.min,t.max-o,e.min):o>l&&(s=Wi(e.min,e.max-l,t.min)),Ls(0,1,s)}function mP(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Wh=.35;function gP(e=Wh){return e===!1?e=0:e===!0&&(e=Wh),{x:k0(e,"left","right"),y:k0(e,"top","bottom")}}function k0(e,t,s){return{min:E0(e,t),max:E0(e,s)}}function E0(e,t){return typeof e=="number"?e:e[t]||0}const j0=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bi=()=>({x:j0(),y:j0()}),N0=()=>({min:0,max:0}),yt=()=>({x:N0(),y:N0()});function $r(e){return[e("x"),e("y")]}function p_({top:e,left:t,right:s,bottom:o}){return{x:{min:t,max:s},y:{min:e,max:o}}}function vP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function yP(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function ah(e){return e===void 0||e===1}function Uh({scale:e,scaleX:t,scaleY:s}){return!ah(e)||!ah(t)||!ah(s)}function Vn(e){return Uh(e)||m_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function m_(e){return P0(e.x)||P0(e.y)}function P0(e){return e&&e!=="0%"}function pc(e,t,s){const o=e-s,l=t*o;return s+l}function R0(e,t,s,o,l){return l!==void 0&&(e=pc(e,l,o)),pc(e,s,o)+t}function Kh(e,t=0,s=1,o,l){e.min=R0(e.min,t,s,o,l),e.max=R0(e.max,t,s,o,l)}function g_(e,{x:t,y:s}){Kh(e.x,t.translate,t.scale,t.originPoint),Kh(e.y,s.translate,s.scale,s.originPoint)}const T0=.999999999999,A0=1.0000000000001;function xP(e,t,s,o=!1){const l=s.length;if(!l)return;t.x=t.y=1;let m,f;for(let a=0;a<l;a++){m=s[a],f=m.projectionDelta;const{visualElement:c}=m.options;c&&c.props.style&&c.props.style.display==="contents"||(o&&m.options.layoutScroll&&m.scroll&&m!==m.root&&$i(e,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),f&&(t.x*=f.x.scale,t.y*=f.y.scale,g_(e,f)),o&&Vn(m.latestValues)&&$i(e,m.latestValues))}t.x<A0&&t.x>T0&&(t.x=1),t.y<A0&&t.y>T0&&(t.y=1)}function Fi(e,t){e.min=e.min+t,e.max=e.max+t}function D0(e,t,s,o,l=.5){const m=ct(e.min,e.max,l);Kh(e,t,s,m,o)}function $i(e,t){D0(e.x,t.x,t.scaleX,t.scale,t.originX),D0(e.y,t.y,t.scaleY,t.scale,t.originY)}function v_(e,t){return p_(yP(e.getBoundingClientRect(),t))}function _P(e,t,s){const o=v_(e,s),{scroll:l}=t;return l&&(Fi(o.x,l.offset.x),Fi(o.y,l.offset.y)),o}const y_=({current:e})=>e?e.ownerDocument.defaultView:null,wP=new WeakMap;class bP{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=yt(),this.visualElement=t}start(t,{snapToCursor:s=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=g=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(wa(g).point)},m=(g,d)=>{const{drag:_,dragPropagation:S,onDragStart:E}=this.getProps();if(_&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pj(_),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$r(v=>{let y=this.getAxisMotionValue(v).get()||0;if(hs.test(y)){const{projection:p}=this.visualElement;if(p&&p.layout){const x=p.layout.layoutBox[v];x&&(y=Pr(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),E&&nt.postRender(()=>E(g,d)),Oh(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},f=(g,d)=>{const{dragPropagation:_,dragDirectionLock:S,onDirectionLock:E,onDrag:b}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:v}=d;if(S&&this.currentDirection===null){this.currentDirection=SP(v),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),b&&b(g,d)},a=(g,d)=>this.stop(g,d),c=()=>$r(g=>{var d;return this.getAnimationState(g)==="paused"&&((d=this.getAxisMotionValue(g).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new d_(t,{onSessionStart:l,onStart:m,onMove:f,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,contextWindow:y_(this.visualElement)})}stop(t,s){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:m}=this.getProps();m&&nt.postRender(()=>m(t,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(t,s,o){const{drag:l}=this.getProps();if(!o||!Ul(t,l,this.currentDirection))return;const m=this.getAxisMotionValue(t);let f=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(f=uP(f,this.constraints[t],this.elastic[t])),m.set(f)}resolveConstraints(){var t;const{dragConstraints:s,dragElastic:o}=this.getProps(),l=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,m=this.constraints;s&&Oi(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&l?this.constraints=hP(l.layoutBox,s):this.constraints=!1,this.elastic=gP(o),m!==this.constraints&&l&&this.constraints&&!this.hasMutatedConstraints&&$r(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=mP(l.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Oi(t))return!1;const o=t.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;const m=_P(o,l.root,this.visualElement.getTransformPagePoint());let f=fP(l.layout.layoutBox,m);if(s){const a=s(vP(f));this.hasMutatedConstraints=!!a,a&&(f=p_(a))}return f}startAnimation(t){const{drag:s,dragMomentum:o,dragElastic:l,dragTransition:m,dragSnapToOrigin:f,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},h=$r(g=>{if(!Ul(g,s,this.currentDirection))return;let d=c&&c[g]||{};f&&(d={min:0,max:0});const _=l?200:1e6,S=l?40:1e7,E={type:"inertia",velocity:o?t[g]:0,bounceStiffness:_,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...m,...d};return this.startAxisValueAnimation(g,E)});return Promise.all(h).then(a)}startAxisValueAnimation(t,s){const o=this.getAxisMotionValue(t);return Oh(this.visualElement,t),o.start(Qf(t,o,0,s,this.visualElement,!1))}stopAnimation(){$r(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$r(t=>{var s;return(s=this.getAxisMotionValue(t).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(t){var s;return(s=this.getAxisMotionValue(t).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps(),l=o[s];return l||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){$r(s=>{const{drag:o}=this.getProps();if(!Ul(s,o,this.currentDirection))return;const{projection:l}=this.visualElement,m=this.getAxisMotionValue(s);if(l&&l.layout){const{min:f,max:a}=l.layout.layoutBox[s];m.set(t[s]-ct(f,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!Oi(s)||!o||!this.constraints)return;this.stopAnimation();const l={x:0,y:0};$r(f=>{const a=this.getAxisMotionValue(f);if(a&&this.constraints!==!1){const c=a.get();l[f]=pP({min:c,max:c},this.constraints[f])}});const{transformTemplate:m}=this.visualElement.getProps();this.visualElement.current.style.transform=m?m({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),$r(f=>{if(!Ul(f,t,null))return;const a=this.getAxisMotionValue(f),{min:c,max:h}=this.constraints[f];a.set(ct(c,h,l[f]))})}addListeners(){if(!this.visualElement.current)return;wP.set(this.visualElement,this);const t=this.visualElement.current,s=ta(t,"pointerdown",c=>{const{drag:h,dragListener:g=!0}=this.getProps();h&&g&&this.start(c)}),o=()=>{const{dragConstraints:c}=this.getProps();Oi(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:l}=this.visualElement,m=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),nt.read(o);const f=la(window,"resize",()=>this.scalePositionWithinConstraints()),a=l.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&($r(g=>{const d=this.getAxisMotionValue(g);d&&(this.originPoint[g]+=c[g].translate,d.set(d.get()+c[g].translate))}),this.visualElement.render())}));return()=>{f(),s(),m(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:l=!1,dragConstraints:m=!1,dragElastic:f=Wh,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:o,dragPropagation:l,dragConstraints:m,dragElastic:f,dragMomentum:a}}}function Ul(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function SP(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class CP extends bn{constructor(t){super(t),this.removeGroupControls=Er,this.removeListeners=Er,this.controls=new bP(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Er}unmount(){this.removeGroupControls(),this.removeListeners()}}const M0=e=>(t,s)=>{e&&nt.postRender(()=>e(t,s))};class kP extends bn{constructor(){super(...arguments),this.removePointerDownListener=Er}onPointerDown(t){this.session=new d_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:y_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:o,onPanEnd:l}=this.node.getProps();return{onSessionStart:M0(t),onStart:M0(s),onMove:o,onEnd:(m,f)=>{delete this.session,l&&nt.postRender(()=>l(m,f))}}}mount(){this.removePointerDownListener=ta(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function L0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ie.test(e))e=parseFloat(e);else return e;const s=L0(e,t.target.x),o=L0(e,t.target.y);return`${s}% ${o}%`}},EP={correct:(e,{treeScale:t,projectionDelta:s})=>{const o=e,l=vn.parse(e);if(l.length>5)return o;const m=vn.createTransformer(e),f=typeof l[0]!="number"?1:0,a=s.x.scale*t.x,c=s.y.scale*t.y;l[0+f]/=a,l[1+f]/=c;const h=ct(a,c,.5);return typeof l[2+f]=="number"&&(l[2+f]/=h),typeof l[3+f]=="number"&&(l[3+f]/=h),m(l)}};class jP extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:o,layoutId:l}=this.props,{projection:m}=t;GE(NP),m&&(s.group&&s.group.add(m),o&&o.register&&l&&o.register(m),m.root.didUpdate(),m.addEventListener("animationComplete",()=>{this.safeToRemove()}),m.setOptions({...m.options,onExitComplete:()=>this.safeToRemove()})),rc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:o,drag:l,isPresent:m}=this.props,f=o.projection;return f&&(f.isPresent=m,l||t.layoutDependency!==s||s===void 0?f.willUpdate():this.safeToRemove(),t.isPresent!==m&&(m?f.promote():f.relegate()||nt.postRender(()=>{const a=f.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),jf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:l}=t;l&&(l.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(l),o&&o.deregister&&o.deregister(l))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function x_(e){const[t,s]=tx(),o=C.useContext(yf);return i.jsx(jP,{...e,layoutGroup:o,switchLayoutGroup:C.useContext(cx),isPresent:t,safeToRemove:s})}const NP={borderRadius:{...Go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Go,borderTopRightRadius:Go,borderBottomLeftRadius:Go,borderBottomRightRadius:Go,boxShadow:EP};function PP(e,t,s){const o=Jt(e)?e:oa(e);return o.start(Qf("",o,t,s)),o.animation}function RP(e){return e instanceof SVGElement&&e.tagName!=="svg"}const TP=(e,t)=>e.depth-t.depth;class AP{constructor(){this.children=[],this.isDirty=!1}add(t){Hf(this.children,t),this.isDirty=!0}remove(t){Vf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TP),this.isDirty=!1,this.children.forEach(t)}}function DP(e,t){const s=fs.now(),o=({timestamp:l})=>{const m=l-s;m>=t&&(gn(o),e(m-t))};return nt.read(o,!0),()=>gn(o)}const __=["TopLeft","TopRight","BottomLeft","BottomRight"],MP=__.length,O0=e=>typeof e=="string"?parseFloat(e):e,I0=e=>typeof e=="number"||Ie.test(e);function LP(e,t,s,o,l,m){l?(e.opacity=ct(0,s.opacity!==void 0?s.opacity:1,OP(o)),e.opacityExit=ct(t.opacity!==void 0?t.opacity:1,0,IP(o))):m&&(e.opacity=ct(t.opacity!==void 0?t.opacity:1,s.opacity!==void 0?s.opacity:1,o));for(let f=0;f<MP;f++){const a=`border${__[f]}Radius`;let c=B0(t,a),h=B0(s,a);if(c===void 0&&h===void 0)continue;c||(c=0),h||(h=0),c===0||h===0||I0(c)===I0(h)?(e[a]=Math.max(ct(O0(c),O0(h),o),0),(hs.test(h)||hs.test(c))&&(e[a]+="%")):e[a]=h}(t.rotate||s.rotate)&&(e.rotate=ct(t.rotate||0,s.rotate||0,o))}function B0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const OP=w_(0,.5,Fx),IP=w_(.5,.95,Er);function w_(e,t,s){return o=>o<e?0:o>t?1:s(Wi(e,t,o))}function F0(e,t){e.min=t.min,e.max=t.max}function Fr(e,t){F0(e.x,t.x),F0(e.y,t.y)}function $0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function H0(e,t,s,o,l){return e-=t,e=pc(e,1/s,o),l!==void 0&&(e=pc(e,1/l,o)),e}function BP(e,t=0,s=1,o=.5,l,m=e,f=e){if(hs.test(t)&&(t=parseFloat(t),t=ct(f.min,f.max,t/100)-f.min),typeof t!="number")return;let a=ct(m.min,m.max,o);e===m&&(a-=t),e.min=H0(e.min,t,s,a,l),e.max=H0(e.max,t,s,a,l)}function V0(e,t,[s,o,l],m,f){BP(e,t[s],t[o],t[l],t.scale,m,f)}const FP=["x","scaleX","originX"],$P=["y","scaleY","originY"];function z0(e,t,s,o){V0(e.x,t,FP,s?s.x:void 0,o?o.x:void 0),V0(e.y,t,$P,s?s.y:void 0,o?o.y:void 0)}function W0(e){return e.translate===0&&e.scale===1}function b_(e){return W0(e.x)&&W0(e.y)}function U0(e,t){return e.min===t.min&&e.max===t.max}function HP(e,t){return U0(e.x,t.x)&&U0(e.y,t.y)}function K0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function S_(e,t){return K0(e.x,t.x)&&K0(e.y,t.y)}function G0(e){return Pr(e.x)/Pr(e.y)}function q0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class VP{constructor(){this.members=[]}add(t){Hf(this.members,t),t.scheduleRender()}remove(t){if(Vf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){const s=this.members.findIndex(l=>t===l);if(s===0)return!1;let o;for(let l=s;l>=0;l--){const m=this.members[l];if(m.isPresent!==!1){o=m;break}}return o?(this.promote(o),!0):!1}promote(t,s){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,s&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:l}=t.options;l===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:s,resumingFrom:o}=t;s.onExitComplete&&s.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function zP(e,t,s){let o="";const l=e.x.translate/t.x,m=e.y.translate/t.y,f=(s==null?void 0:s.z)||0;if((l||m||f)&&(o=`translate3d(${l}px, ${m}px, ${f}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:h,rotate:g,rotateX:d,rotateY:_,skewX:S,skewY:E}=s;h&&(o=`perspective(${h}px) ${o}`),g&&(o+=`rotate(${g}deg) `),d&&(o+=`rotateX(${d}deg) `),_&&(o+=`rotateY(${_}deg) `),S&&(o+=`skewX(${S}deg) `),E&&(o+=`skewY(${E}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(o+=`scale(${a}, ${c})`),o||"none"}const zn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Jo=typeof window<"u"&&window.MotionDebug!==void 0,lh=["","X","Y","Z"],WP={visibility:"hidden"},Y0=1e3;let UP=0;function ch(e,t,s,o){const{latestValues:l}=t;l[e]&&(s[e]=l[e],t.setStaticValue(e,0),o&&(o[e]=0))}function C_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=Ax(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:l,layoutId:m}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",nt,!(l||m))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&C_(o)}function k_({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:o,resetTransform:l}){return class{constructor(f={},a=t==null?void 0:t()){this.id=UP++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Jo&&(zn.totalNodes=zn.resolvedTargetDeltas=zn.recalculatedProjection=0),this.nodes.forEach(qP),this.nodes.forEach(ZP),this.nodes.forEach(eR),this.nodes.forEach(YP),Jo&&window.MotionDebug.record(zn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new AP)}addEventListener(f,a){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new zf),this.eventHandlers.get(f).add(a)}notifyListeners(f,...a){const c=this.eventHandlers.get(f);c&&c.notify(...a)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=RP(f),this.instance=f;const{layoutId:c,layout:h,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(h||c)&&(this.isLayoutDirty=!0),e){let d;const _=()=>this.root.updateBlockedByResize=!1;e(f,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=DP(_,250),rc.hasAnimatedSinceResize&&(rc.hasAnimatedSinceResize=!1,this.nodes.forEach(J0))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&g&&(c||h)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:_,hasRelativeTargetChanged:S,layout:E})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||g.getDefaultTransition()||iR,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=g.getProps(),p=!this.targetLayout||!S_(this.targetLayout,E)||S,x=!_&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||_&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const k={...If(b,"layout"),onPlay:v,onComplete:y};(g.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else _||J0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=E})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,gn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(tR),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&C_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const d=this.path[g];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(X0);return}this.isUpdating||this.nodes.forEach(JP),this.isUpdating=!1,this.nodes.forEach(QP),this.nodes.forEach(KP),this.nodes.forEach(GP),this.clearAllSnapshots();const a=fs.now();Ft.delta=Ls(0,1e3/60,a-Ft.timestamp),Ft.timestamp=a,Ft.isProcessing=!0,Zu.update.process(Ft),Zu.preRender.process(Ft),Zu.render.process(Ft),Ft.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(XP),this.sharedNodes.forEach(rR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=yt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(a=!1),a){const c=o(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:c,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!l)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!b_(this.projectionDelta),c=this.getTransformTemplate(),h=c?c(this.latestValues,""):void 0,g=h!==this.prevTransformTemplateValue;f&&(a||Vn(this.latestValues)||g)&&(l(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return f&&(c=this.removeTransform(c)),oR(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return yt();const c=a.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(aR))){const{scroll:g}=this.root;g&&(Fi(c.x,g.offset.x),Fi(c.y,g.offset.y))}return c}removeElementScroll(f){var a;const c=yt();if(Fr(c,f),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return c;for(let h=0;h<this.path.length;h++){const g=this.path[h],{scroll:d,options:_}=g;g!==this.root&&d&&_.layoutScroll&&(d.wasRoot&&Fr(c,f),Fi(c.x,d.offset.x),Fi(c.y,d.offset.y))}return c}applyTransform(f,a=!1){const c=yt();Fr(c,f);for(let h=0;h<this.path.length;h++){const g=this.path[h];!a&&g.options.layoutScroll&&g.scroll&&g!==g.root&&$i(c,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Vn(g.latestValues)&&$i(c,g.latestValues)}return Vn(this.latestValues)&&$i(c,this.latestValues),c}removeTransform(f){const a=yt();Fr(a,f);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!h.instance||!Vn(h.latestValues))continue;Uh(h.latestValues)&&h.updateSnapshot();const g=yt(),d=h.measurePageBox();Fr(g,d),z0(a,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,g)}return Vn(this.latestValues)&&z0(a,this.latestValues),a}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ft.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var a;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==c;if(!(f||h&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:_}=this.options;if(!(!this.layout||!(d||_))){if(this.resolvedRelativeTargetAt=Ft.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yt(),this.relativeTargetOrigin=yt(),sa(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Fr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=yt(),this.targetWithTransforms=yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),dP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Fr(this.target,this.layout.layoutBox),g_(this.target,this.targetDelta)):Fr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yt(),this.relativeTargetOrigin=yt(),sa(this.relativeTargetOrigin,this.target,S.target),Fr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jo&&zn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Uh(this.parent.latestValues)||m_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var f;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let h=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(h=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Ft.timestamp&&(h=!1),h)return;const{layout:g,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||d))return;Fr(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,S=this.treeScale.y;xP(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=yt());const{target:E}=a;if(!E){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($0(this.prevProjectionDelta.x,this.projectionDelta.x),$0(this.prevProjectionDelta.y,this.projectionDelta.y)),ra(this.projectionDelta,this.layoutCorrected,E,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==S||!q0(this.projectionDelta.x,this.prevProjectionDelta.x)||!q0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",E)),Jo&&zn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),f){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Bi(),this.projectionDelta=Bi(),this.projectionDeltaWithTransform=Bi()}setAnimationOrigin(f,a=!1){const c=this.snapshot,h=c?c.latestValues:{},g={...this.latestValues},d=Bi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const _=yt(),S=c?c.source:void 0,E=this.layout?this.layout.source:void 0,b=S!==E,v=this.getStack(),y=!v||v.members.length<=1,p=!!(b&&!y&&this.options.crossfade===!0&&!this.path.some(nR));this.animationProgress=0;let x;this.mixTargetDelta=k=>{const P=k/1e3;Q0(d.x,f.x,P),Q0(d.y,f.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sa(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sR(this.relativeTarget,this.relativeTargetOrigin,_,P),x&&HP(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=yt()),Fr(x,this.relativeTarget)),b&&(this.animationValues=g,LP(g,h,this.latestValues,P,p,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(gn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{rc.hasAnimatedSinceResize=!0,this.currentAnimation=PP(0,Y0,{...f,onUpdate:a=>{this.mixTargetDelta(a),f.onUpdate&&f.onUpdate(a)},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Y0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:a,target:c,layout:h,latestValues:g}=f;if(!(!a||!c||!h)){if(this!==f&&this.layout&&h&&E_(this.options.animationType,this.layout.layoutBox,h.layoutBox)){c=this.target||yt();const d=Pr(this.layout.layoutBox.x);c.x.min=f.target.x.min,c.x.max=c.x.min+d;const _=Pr(this.layout.layoutBox.y);c.y.min=f.target.y.min,c.y.max=c.y.min+_}Fr(a,c),$i(a,g),ra(this.projectionDeltaWithTransform,this.layoutCorrected,a,g)}}registerSharedNode(f,a){this.sharedNodes.has(f)||this.sharedNodes.set(f,new VP),this.sharedNodes.get(f).add(a);const h=a.options.initialPromotionConfig;a.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(a):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:a}=this.options;return a?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:a}=this.options;return a?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:a,preserveFollowOpacity:c}={}){const h=this.getStack();h&&h.promote(this,c),f&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let a=!1;const{latestValues:c}=f;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const h={};c.z&&ch("z",f,h,this.animationValues);for(let g=0;g<lh.length;g++)ch(`rotate${lh[g]}`,f,h,this.animationValues),ch(`skew${lh[g]}`,f,h,this.animationValues);f.render();for(const g in h)f.setStaticValue(g,h[g]),this.animationValues&&(this.animationValues[g]=h[g]);f.scheduleRender()}getProjectionStyles(f){var a,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return WP;const h={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,h.opacity="",h.pointerEvents=ec(f==null?void 0:f.pointerEvents)||"",h.transform=g?g(this.latestValues,""):"none",h;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const b={};return this.options.layoutId&&(b.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,b.pointerEvents=ec(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Vn(this.latestValues)&&(b.transform=g?g({},""):"none",this.hasProjected=!1),b}const _=d.animationValues||d.latestValues;this.applyTransformsToTarget(),h.transform=zP(this.projectionDeltaWithTransform,this.treeScale,_),g&&(h.transform=g(_,h.transform));const{x:S,y:E}=this.projectionDelta;h.transformOrigin=`${S.origin*100}% ${E.origin*100}% 0`,d.animationValues?h.opacity=d===this?(c=(a=_.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:_.opacityExit:h.opacity=d===this?_.opacity!==void 0?_.opacity:"":_.opacityExit!==void 0?_.opacityExit:0;for(const b in cc){if(_[b]===void 0)continue;const{correct:v,applyTo:y}=cc[b],p=h.transform==="none"?_[b]:v(_[b],d);if(y){const x=y.length;for(let k=0;k<x;k++)h[y[k]]=p}else h[b]=p}return this.options.layoutId&&(h.pointerEvents=d===this?ec(f==null?void 0:f.pointerEvents)||"":"none"),h}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var a;return(a=f.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(X0),this.root.sharedNodes.clear()}}}function KP(e){e.updateLayout()}function GP(e){var t;const s=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&s&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:l}=e.layout,{animationType:m}=e.options,f=s.source!==e.layout.source;m==="size"?$r(d=>{const _=f?s.measuredBox[d]:s.layoutBox[d],S=Pr(_);_.min=o[d].min,_.max=_.min+S}):E_(m,s.layoutBox,o)&&$r(d=>{const _=f?s.measuredBox[d]:s.layoutBox[d],S=Pr(o[d]);_.max=_.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+S)});const a=Bi();ra(a,o,s.layoutBox);const c=Bi();f?ra(c,e.applyTransform(l,!0),s.measuredBox):ra(c,o,s.layoutBox);const h=!b_(a);let g=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:_,layout:S}=d;if(_&&S){const E=yt();sa(E,s.layoutBox,_.layoutBox);const b=yt();sa(b,o,S.layoutBox),S_(E,b)||(g=!0),d.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=E,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:s,delta:c,layoutDelta:a,hasLayoutChanged:h,hasRelativeTargetChanged:g})}else if(e.isLead()){const{onExitComplete:o}=e.options;o&&o()}e.options.transition=void 0}function qP(e){Jo&&zn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function YP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function XP(e){e.clearSnapshot()}function X0(e){e.clearMeasurements()}function JP(e){e.isLayoutDirty=!1}function QP(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function J0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ZP(e){e.resolveTargetDelta()}function eR(e){e.calcProjection()}function tR(e){e.resetSkewAndRotation()}function rR(e){e.removeLeadSnapshot()}function Q0(e,t,s){e.translate=ct(t.translate,0,s),e.scale=ct(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function Z0(e,t,s,o){e.min=ct(t.min,s.min,o),e.max=ct(t.max,s.max,o)}function sR(e,t,s,o){Z0(e.x,t.x,s.x,o),Z0(e.y,t.y,s.y,o)}function nR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const iR={duration:.45,ease:[.4,0,.1,1]},ey=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ty=ey("applewebkit/")&&!ey("chrome/")?Math.round:Er;function ry(e){e.min=ty(e.min),e.max=ty(e.max)}function oR(e){ry(e.x),ry(e.y)}function E_(e,t,s){return e==="position"||e==="preserve-aspect"&&!cP(G0(t),G0(s),.2)}function aR(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const lR=k_({attachResizeListener:(e,t)=>la(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),dh={current:void 0},j_=k_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dh.current){const e=new lR({});e.mount(window),e.setOptions({layoutScroll:!0}),dh.current=e}return dh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),cR={pan:{Feature:kP},drag:{Feature:CP,ProjectionNode:j_,MeasureLayout:x_}};function sy(e,t,s){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",s==="Start");const l="onHover"+s,m=o[l];m&&nt.postRender(()=>m(t,wa(t)))}class dR extends bn{mount(){const{current:t}=this.node;t&&(this.unmount=cj(t,s=>(sy(this.node,s,"Start"),o=>sy(this.node,o,"End"))))}unmount(){}}class uR extends bn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_a(la(this.node.current,"focus",()=>this.onFocus()),la(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ny(e,t,s){const{props:o}=e;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",s==="Start");const l="onTap"+(s==="End"?"":s),m=o[l];m&&nt.postRender(()=>m(t,wa(t)))}class hR extends bn{mount(){const{current:t}=this.node;t&&(this.unmount=fj(t,s=>(ny(this.node,s,"Start"),(o,{success:l})=>ny(this.node,o,l?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Gh=new WeakMap,uh=new WeakMap,fR=e=>{const t=Gh.get(e.target);t&&t(e)},pR=e=>{e.forEach(fR)};function mR({root:e,...t}){const s=e||document;uh.has(s)||uh.set(s,{});const o=uh.get(s),l=JSON.stringify(t);return o[l]||(o[l]=new IntersectionObserver(pR,{root:e,...t})),o[l]}function gR(e,t,s){const o=mR(t);return Gh.set(e,s),o.observe(e),()=>{Gh.delete(e),o.unobserve(e)}}const vR={some:0,all:1};class yR extends bn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:s,margin:o,amount:l="some",once:m}=t,f={root:s?s.current:void 0,rootMargin:o,threshold:typeof l=="number"?l:vR[l]},a=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,m&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:g,onViewportLeave:d}=this.node.getProps(),_=h?g:d;_&&_(c)};return gR(this.node.current,f,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(xR(t,s))&&this.startObserver()}unmount(){}}function xR({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const _R={inView:{Feature:yR},tap:{Feature:hR},focus:{Feature:uR},hover:{Feature:dR}},wR={layout:{ProjectionNode:j_,MeasureLayout:x_}},qh={current:null},N_={current:!1};function bR(){if(N_.current=!0,!!wf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>qh.current=e.matches;e.addListener(t),t()}else qh.current=!1}const SR=[...Zx,Xt,vn],CR=e=>SR.find(Qx(e)),iy=new WeakMap;function kR(e,t,s){for(const o in t){const l=t[o],m=s[o];if(Jt(l))e.addValue(o,l);else if(Jt(m))e.addValue(o,oa(l,{owner:e}));else if(m!==l)if(e.hasValue(o)){const f=e.getValue(o);f.liveStyle===!0?f.jump(l):f.hasAnimated||f.set(l)}else{const f=e.getStaticValue(o);e.addValue(o,oa(f!==void 0?f:l,{owner:e}))}}for(const o in s)t[o]===void 0&&e.removeValue(o);return t}const oy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ER{scrapeMotionValuesFromProps(t,s,o){return{}}constructor({parent:t,props:s,presenceContext:o,reducedMotionConfig:l,blockInitialAnimation:m,visualState:f},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=fs.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,nt.render(this.render,!1,!0))};const{latestValues:c,renderState:h,onUpdate:g}=f;this.onUpdate=g,this.latestValues=c,this.baseTarget={...c},this.initialValues=s.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=s,this.presenceContext=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=l,this.options=a,this.blockInitialAnimation=!!m,this.isControllingVariants=Lc(s),this.isVariantNode=ax(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,..._}=this.scrapeMotionValuesFromProps(s,{},this);for(const S in _){const E=_[S];c[S]!==void 0&&Jt(E)&&E.set(c[S],!1)}}mount(t){this.current=t,iy.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),N_.current||bR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:qh.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){iy.delete(this.current),this.projection&&this.projection.unmount(),gn(this.notifyUpdate),gn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}bindToMotionValue(t,s){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const o=ii.has(t),l=s.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&nt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),m=s.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{l(),m(),f&&f(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ui){const s=Ui[t];if(!s)continue;const{isEnabled:o,Feature:l}=s;if(!this.features[t]&&l&&o(this.props)&&(this.features[t]=new l(this)),this.features[t]){const m=this.features[t];m.isMounted?m.update():(m.mount(),m.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;o<oy.length;o++){const l=oy[o];this.propEventSubscriptions[l]&&(this.propEventSubscriptions[l](),delete this.propEventSubscriptions[l]);const m="on"+l,f=t[m];f&&(this.propEventSubscriptions[l]=this.on(l,f))}this.prevMotionValues=kR(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const o=this.values.get(t);s!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&s!==void 0&&(o=oa(s===null?void 0:s,{owner:this}),this.addValue(t,o)),o}readValue(t,s){var o;let l=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(o=this.getBaseTargetFromProps(this.props,t))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,t,this.options);return l!=null&&(typeof l=="string"&&(Xx(l)||Hx(l))?l=parseFloat(l):!CR(l)&&vn.test(s)&&(l=Gx(t,s)),this.setBaseTarget(t,Jt(l)?l.get():l)),Jt(l)?l.get():l}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){var s;const{initial:o}=this.props;let l;if(typeof o=="string"||typeof o=="object"){const f=Pf(this.props,o,(s=this.presenceContext)===null||s===void 0?void 0:s.custom);f&&(l=f[t])}if(o&&l!==void 0)return l;const m=this.getBaseTargetFromProps(this.props,t);return m!==void 0&&!Jt(m)?m:this.initialValues[t]!==void 0&&l===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new zf),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}}class P_ extends ER{constructor(){super(...arguments),this.KeyframeResolver=e_}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){return t.style?t.style[s]:void 0}removeValueFromRenderState(t,{vars:s,style:o}){delete s[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function jR(e){return window.getComputedStyle(e)}class NR extends P_{constructor(){super(...arguments),this.type="html",this.renderInstance=gx}readValueFromInstance(t,s){if(ii.has(s)){const o=qf(s);return o&&o.default||0}else{const o=jR(t),l=(fx(s)?o.getPropertyValue(s):o[s])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(t,{transformPagePoint:s}){return v_(t,s)}build(t,s,o){Af(t,s,o.transformTemplate)}scrapeMotionValuesFromProps(t,s,o){return Of(t,s,o)}}class PR extends P_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yt}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(ii.has(s)){const o=qf(s);return o&&o.default||0}return s=vx.has(s)?s:Ef(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,o){return _x(t,s,o)}build(t,s,o){Df(t,s,this.isSVGTag,o.transformTemplate)}renderInstance(t,s,o,l){yx(t,s,o,l)}mount(t){this.isSVGTag=Lf(t.tagName),super.mount(t)}}const RR=(e,t)=>Nf(e)?new PR(t):new NR(t,{allowProjection:e!==C.Fragment}),TR=rj({...eP,..._R,...cR,...wR},RR),Ds=vE(TR);/**
|
|
49
|
+
* @license lucide-react v0.475.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const AR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),R_=(...e)=>e.filter((t,s,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===s).join(" ").trim();/**
|
|
54
|
+
* @license lucide-react v0.475.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var DR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
59
|
+
* @license lucide-react v0.475.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const MR=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:l="",children:m,iconNode:f,...a},c)=>C.createElement("svg",{ref:c,...DR,width:t,height:t,stroke:e,strokeWidth:o?Number(s)*24/Number(t):s,className:R_("lucide",l),...a},[...f.map(([h,g])=>C.createElement(h,g)),...Array.isArray(m)?m:[m]]));/**
|
|
64
|
+
* @license lucide-react v0.475.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const we=(e,t)=>{const s=C.forwardRef(({className:o,...l},m)=>C.createElement(MR,{ref:m,iconNode:t,className:R_(`lucide-${AR(e)}`,o),...l}));return s.displayName=`${e}`,s};/**
|
|
69
|
+
* @license lucide-react v0.475.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const LR=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],OR=we("ArrowLeftRight",LR);/**
|
|
74
|
+
* @license lucide-react v0.475.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const IR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BR=we("ArrowLeft",IR);/**
|
|
79
|
+
* @license lucide-react v0.475.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const FR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],T_=we("ArrowRight",FR);/**
|
|
84
|
+
* @license lucide-react v0.475.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const $R=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Kn=we("BookOpen",$R);/**
|
|
89
|
+
* @license lucide-react v0.475.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const HR=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],VR=we("Bot",HR);/**
|
|
94
|
+
* @license lucide-react v0.475.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const zR=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],mc=we("Brain",zR);/**
|
|
99
|
+
* @license lucide-react v0.475.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const WR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Rr=we("Check",WR);/**
|
|
104
|
+
* @license lucide-react v0.475.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const UR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],to=we("ChevronDown",UR);/**
|
|
109
|
+
* @license lucide-react v0.475.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const KR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Bc=we("ChevronRight",KR);/**
|
|
114
|
+
* @license lucide-react v0.475.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const GR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qR=we("ChevronUp",GR);/**
|
|
119
|
+
* @license lucide-react v0.475.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const YR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ca=we("CircleAlert",YR);/**
|
|
124
|
+
* @license lucide-react v0.475.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const XR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Zf=we("CircleHelp",XR);/**
|
|
129
|
+
* @license lucide-react v0.475.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const JR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],QR=we("Circle",JR);/**
|
|
134
|
+
* @license lucide-react v0.475.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const ZR=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],eT=we("Clipboard",ZR);/**
|
|
139
|
+
* @license lucide-react v0.475.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const tT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],hh=we("Clock",tT);/**
|
|
144
|
+
* @license lucide-react v0.475.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const rT=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],sT=we("Code",rT);/**
|
|
149
|
+
* @license lucide-react v0.475.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const nT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Gi=we("Copy",nT);/**
|
|
154
|
+
* @license lucide-react v0.475.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const iT=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],oT=we("Cpu",iT);/**
|
|
159
|
+
* @license lucide-react v0.475.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const aT=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Fc=we("Download",aT);/**
|
|
164
|
+
* @license lucide-react v0.475.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const lT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],ep=we("EllipsisVertical",lT);/**
|
|
169
|
+
* @license lucide-react v0.475.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const cT=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],fh=we("ExternalLink",cT);/**
|
|
174
|
+
* @license lucide-react v0.475.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const dT=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],A_=we("Eye",dT);/**
|
|
179
|
+
* @license lucide-react v0.475.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const uT=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],D_=we("FileCode",uT);/**
|
|
184
|
+
* @license lucide-react v0.475.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const hT=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],tp=we("FilePen",hT);/**
|
|
189
|
+
* @license lucide-react v0.475.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const fT=[["path",{d:"M21 7h-3a2 2 0 0 1-2-2V2",key:"9rb54x"}],["path",{d:"M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z",key:"1059l0"}],["path",{d:"M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15",key:"16874u"}],["path",{d:"M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11",key:"k2ox98"}]],ay=we("FileStack",fT);/**
|
|
194
|
+
* @license lucide-react v0.475.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const pT=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],mr=we("FileText",pT);/**
|
|
199
|
+
* @license lucide-react v0.475.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const mT=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],Yh=we("File",mT);/**
|
|
204
|
+
* @license lucide-react v0.475.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const gT=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Gn=we("FolderOpen",gT);/**
|
|
209
|
+
* @license lucide-react v0.475.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const vT=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],sc=we("FolderPlus",vT);/**
|
|
214
|
+
* @license lucide-react v0.475.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const yT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Nt=we("Folder",yT);/**
|
|
219
|
+
* @license lucide-react v0.475.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const xT=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],M_=we("GitBranch",xT);/**
|
|
224
|
+
* @license lucide-react v0.475.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const _T=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],wT=we("Github",_T);/**
|
|
229
|
+
* @license lucide-react v0.475.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const bT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],L_=we("Globe",bT);/**
|
|
234
|
+
* @license lucide-react v0.475.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const ST=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],rp=we("House",ST);/**
|
|
239
|
+
* @license lucide-react v0.475.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const CT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],kT=we("Info",CT);/**
|
|
244
|
+
* @license lucide-react v0.475.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const ET=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],jT=we("Keyboard",ET);/**
|
|
249
|
+
* @license lucide-react v0.475.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const NT=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],O_=we("Layers",NT);/**
|
|
254
|
+
* @license lucide-react v0.475.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const PT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dt=we("LoaderCircle",PT);/**
|
|
259
|
+
* @license lucide-react v0.475.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const RT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],I_=we("Lock",RT);/**
|
|
264
|
+
* @license lucide-react v0.475.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const TT=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],B_=we("Monitor",TT);/**
|
|
269
|
+
* @license lucide-react v0.475.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const AT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],ly=we("Moon",AT);/**
|
|
274
|
+
* @license lucide-react v0.475.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const DT=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],F_=we("Move",DT);/**
|
|
279
|
+
* @license lucide-react v0.475.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const MT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],da=we("Package",MT);/**
|
|
284
|
+
* @license lucide-react v0.475.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const LT=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],OT=we("Palette",LT);/**
|
|
289
|
+
* @license lucide-react v0.475.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const IT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],$c=we("PanelsTopLeft",IT);/**
|
|
294
|
+
* @license lucide-react v0.475.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const BT=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],sp=we("PenLine",BT);/**
|
|
299
|
+
* @license lucide-react v0.475.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const FT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$_=we("Pencil",FT);/**
|
|
304
|
+
* @license lucide-react v0.475.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const $T=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],gc=we("Plug",$T);/**
|
|
309
|
+
* @license lucide-react v0.475.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const HT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ht=we("Plus",HT);/**
|
|
314
|
+
* @license lucide-react v0.475.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const VT=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],gr=we("RefreshCw",VT);/**
|
|
319
|
+
* @license lucide-react v0.475.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const zT=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],WT=we("Rocket",zT);/**
|
|
324
|
+
* @license lucide-react v0.475.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const UT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],oi=we("Save",UT);/**
|
|
329
|
+
* @license lucide-react v0.475.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const KT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],np=we("Search",KT);/**
|
|
334
|
+
* @license lucide-react v0.475.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const GT=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ip=we("Server",GT);/**
|
|
339
|
+
* @license lucide-react v0.475.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const qT=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],YT=we("Settings2",qT);/**
|
|
344
|
+
* @license lucide-react v0.475.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const XT=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],yn=we("Settings",XT);/**
|
|
349
|
+
* @license lucide-react v0.475.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const JT=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ba=we("Shield",JT);/**
|
|
354
|
+
* @license lucide-react v0.475.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const QT=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],$t=we("Sparkles",QT);/**
|
|
359
|
+
* @license lucide-react v0.475.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const ZT=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],eA=we("Star",ZT);/**
|
|
364
|
+
* @license lucide-react v0.475.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const tA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],cy=we("Sun",tA);/**
|
|
369
|
+
* @license lucide-react v0.475.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const rA=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],St=we("Terminal",rA);/**
|
|
374
|
+
* @license lucide-react v0.475.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const sA=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],qn=we("Trash2",sA);/**
|
|
379
|
+
* @license lucide-react v0.475.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const nA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Hc=we("TriangleAlert",nA);/**
|
|
384
|
+
* @license lucide-react v0.475.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const iA=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Xh=we("Upload",iA);/**
|
|
389
|
+
* @license lucide-react v0.475.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const oA=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Ps=we("WandSparkles",oA);/**
|
|
394
|
+
* @license lucide-react v0.475.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const aA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],H_=we("Wrench",aA);/**
|
|
399
|
+
* @license lucide-react v0.475.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const lA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],op=we("X",lA);/**
|
|
404
|
+
* @license lucide-react v0.475.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const cA=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],V_=we("Zap",cA),dA="/api";async function Pe(e,t={}){const s=`${dA}${e}`,o={headers:{"Content-Type":"application/json"},...t};t.body&&typeof t.body=="object"&&(o.body=JSON.stringify(t.body));const l=await fetch(s,o);if(!l.ok){const m=await l.json().catch(()=>({error:"Request failed"}));throw new Error(m.error||`HTTP ${l.status}`)}return l.json()}const Se={async getProject(){return Pe("/project")},async getSubprojects(e){return Pe(`/subprojects?dir=${encodeURIComponent(e)}`)},async switchProject(e){return Pe("/switch-project",{method:"POST",body:{dir:e}})},async getProjects(){return Pe("/projects")},async addProject(e,t=null){return Pe("/projects",{method:"POST",body:{path:e,name:t}})},async removeProject(e){return Pe(`/projects/${e}`,{method:"DELETE"})},async setActiveProject(e){return Pe("/projects/active",{method:"PUT",body:{id:e}})},async getConfigs(){return Pe("/configs")},async updateConfig(e,t){return Pe("/config",{method:"PUT",body:{dir:e,config:t}})},async getRegistry(){return Pe("/registry")},async updateRegistry(e){return Pe("/registry",{method:"PUT",body:e})},async getRules(){return Pe("/rules")},async getRule(e){return Pe(`/rule?path=${encodeURIComponent(e)}`)},async saveRule(e,t){return Pe("/rule",{method:"PUT",body:{path:e,content:t}})},async createRule(e,t,s=""){return Pe("/rule",{method:"POST",body:{dir:e,name:t,content:s}})},async deleteRule(e){return Pe(`/rule?path=${encodeURIComponent(e)}`,{method:"DELETE"})},async getCommands(){return Pe("/commands")},async getCommand(e){return Pe(`/command?path=${encodeURIComponent(e)}`)},async saveCommand(e,t){return Pe("/command",{method:"PUT",body:{path:e,content:t}})},async createCommand(e,t,s=""){return Pe("/command",{method:"POST",body:{dir:e,name:t,content:s}})},async deleteCommand(e){return Pe(`/command?path=${encodeURIComponent(e)}`,{method:"DELETE"})},async getTemplates(){return Pe("/templates")},async applyTemplate(e,t){return Pe("/apply-template",{method:"POST",body:{template:e,dir:t}})},async applyConfig(e){return Pe("/apply",{method:"POST",body:{dir:e}})},async getEnv(e){return Pe(`/env?dir=${encodeURIComponent(e)}`)},async saveEnv(e,t){return Pe("/env",{method:"PUT",body:{dir:e,content:t}})},async getFileHashes(){return Pe("/file-hashes")},async checkVersion(){return Pe("/version-check")},async performUpdate(e){return Pe("/update",{method:"POST",body:e})},async reload(){return Pe("/reload",{method:"POST"})},async searchGithub(e){return Pe(`/search/github?q=${encodeURIComponent(e)}`)},async searchNpm(e){return Pe(`/search/npm?q=${encodeURIComponent(e)}`)},async getMcpTools(e){const t=e?`?dir=${encodeURIComponent(e)}`:"";return Pe(`/mcp-tools${t}`)},async getClaudeFolders(){return Pe("/claude-folders")},async getIntermediatePaths(){return Pe("/intermediate-paths")},async getClaudeFile(e){return Pe(`/claude-file?path=${encodeURIComponent(e)}`)},async saveClaudeFile(e,t){return Pe("/claude-file",{method:"PUT",body:{path:e,content:t}})},async deleteClaudeFile(e){return Pe(`/claude-file?path=${encodeURIComponent(e)}`,{method:"DELETE"})},async createClaudeFile(e,t,s,o=""){return Pe("/claude-file",{method:"POST",body:{dir:e,name:t,type:s,content:o}})},async initClaudeFolder(e){return Pe("/init-claude-folder",{method:"POST",body:{dir:e}})},async deleteClaudeFolder(e){return Pe("/delete-claude-folder",{method:"POST",body:{dir:e}})},async initClaudeFolderBatch(e){return Pe("/init-claude-folder-batch",{method:"POST",body:{dirs:e}})},async applyTemplateToProjects(e,t){return Pe("/apply-template-batch",{method:"POST",body:{templateId:e,dirs:t}})},async getSyncPreview(e,t="claude",s="antigravity"){return Pe("/sync/preview",{method:"POST",body:{dir:e,source:t,target:s}})},async syncRules(e,t="claude",s="antigravity",o=null){return Pe("/sync/rules",{method:"POST",body:{dir:e,source:t,target:s,files:o}})},async moveClaudeItem(e,t,s="copy",o=!1){return Pe("/claude-move",{method:"POST",body:{sourcePath:e,targetDir:t,mode:s,merge:o}})},async renameClaudeFile(e,t){return Pe("/claude-rename",{method:"POST",body:{oldPath:e,newName:t}})},async getMemory(){return Pe("/memory")},async getMemoryFile(e){return Pe(`/memory/file?path=${encodeURIComponent(e)}`)},async saveMemoryFile(e,t){return Pe("/memory/file",{method:"PUT",body:{path:e,content:t}})},async addMemoryEntry(e,t,s="global"){return Pe("/memory/entry",{method:"POST",body:{type:e,content:t,scope:s}})},async initProjectMemory(e){return Pe("/memory/init",{method:"POST",body:{dir:e}})},async searchMemory(e){return Pe(`/memory/search?q=${encodeURIComponent(e)}`)},async getSyncState(){return Pe("/memory/sync")},async getClaudeSettings(){return Pe("/claude-settings")},async saveClaudeSettings(e){return Pe("/claude-settings",{method:"PUT",body:{settings:e}})},async getGeminiSettings(){return Pe("/gemini-settings")},async saveGeminiSettings(e){return Pe("/gemini-settings",{method:"PUT",body:e})},async getConfig(){return Pe("/preferences")},async saveConfig(e){return Pe("/preferences",{method:"PUT",body:e})},async browse(e,t="directory"){return Pe("/browse",{method:"POST",body:{path:e,type:t}})}};function z_(e){var t,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(s=z_(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}function W_(){for(var e,t,s=0,o="",l=arguments.length;s<l;s++)(e=arguments[s])&&(t=z_(e))&&(o&&(o+=" "),o+=t);return o}const uA=(e,t)=>{const s=new Array(e.length+t.length);for(let o=0;o<e.length;o++)s[o]=e[o];for(let o=0;o<t.length;o++)s[e.length+o]=t[o];return s},hA=(e,t)=>({classGroupId:e,validator:t}),U_=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),vc="-",dy=[],fA="arbitrary..",pA=e=>{const t=gA(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return mA(f);const a=f.split(vc),c=a[0]===""&&a.length>1?1:0;return K_(a,c,t)},getConflictingClassGroupIds:(f,a)=>{if(a){const c=o[f],h=s[f];return c?h?uA(h,c):c:h||dy}return s[f]||dy}}},K_=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const l=e[t],m=s.nextPart.get(l);if(m){const h=K_(e,t+1,m);if(h)return h}const f=s.validators;if(f===null)return;const a=t===0?e.join(vc):e.slice(t).join(vc),c=f.length;for(let h=0;h<c;h++){const g=f[h];if(g.validator(a))return g.classGroupId}},mA=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),o=t.slice(0,s);return o?fA+o:void 0})(),gA=e=>{const{theme:t,classGroups:s}=e;return vA(s,t)},vA=(e,t)=>{const s=U_();for(const o in e){const l=e[o];ap(l,s,o,t)}return s},ap=(e,t,s,o)=>{const l=e.length;for(let m=0;m<l;m++){const f=e[m];yA(f,t,s,o)}},yA=(e,t,s,o)=>{if(typeof e=="string"){xA(e,t,s);return}if(typeof e=="function"){_A(e,t,s,o);return}wA(e,t,s,o)},xA=(e,t,s)=>{const o=e===""?t:G_(t,e);o.classGroupId=s},_A=(e,t,s,o)=>{if(bA(e)){ap(e(o),t,s,o);return}t.validators===null&&(t.validators=[]),t.validators.push(hA(s,e))},wA=(e,t,s,o)=>{const l=Object.entries(e),m=l.length;for(let f=0;f<m;f++){const[a,c]=l[f];ap(c,G_(t,a),s,o)}},G_=(e,t)=>{let s=e;const o=t.split(vc),l=o.length;for(let m=0;m<l;m++){const f=o[m];let a=s.nextPart.get(f);a||(a=U_(),s.nextPart.set(f,a)),s=a}return s},bA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),o=Object.create(null);const l=(m,f)=>{s[m]=f,t++,t>e&&(t=0,o=s,s=Object.create(null))};return{get(m){let f=s[m];if(f!==void 0)return f;if((f=o[m])!==void 0)return l(m,f),f},set(m,f){m in s?s[m]=f:l(m,f)}}},Jh="!",uy=":",CA=[],hy=(e,t,s,o,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:o,isExternal:l}),kA=e=>{const{prefix:t,experimentalParseClassName:s}=e;let o=l=>{const m=[];let f=0,a=0,c=0,h;const g=l.length;for(let b=0;b<g;b++){const v=l[b];if(f===0&&a===0){if(v===uy){m.push(l.slice(c,b)),c=b+1;continue}if(v==="/"){h=b;continue}}v==="["?f++:v==="]"?f--:v==="("?a++:v===")"&&a--}const d=m.length===0?l:l.slice(c);let _=d,S=!1;d.endsWith(Jh)?(_=d.slice(0,-1),S=!0):d.startsWith(Jh)&&(_=d.slice(1),S=!0);const E=h&&h>c?h-c:void 0;return hy(m,S,_,E)};if(t){const l=t+uy,m=o;o=f=>f.startsWith(l)?m(f.slice(l.length)):hy(CA,!1,f,void 0,!0)}if(s){const l=o;o=m=>s({className:m,parseClassName:l})}return o},EA=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,o)=>{t.set(s,1e6+o)}),s=>{const o=[];let l=[];for(let m=0;m<s.length;m++){const f=s[m],a=f[0]==="[",c=t.has(f);a||c?(l.length>0&&(l.sort(),o.push(...l),l=[]),o.push(f)):l.push(f)}return l.length>0&&(l.sort(),o.push(...l)),o}},jA=e=>({cache:SA(e.cacheSize),parseClassName:kA(e),sortModifiers:EA(e),...pA(e)}),NA=/\s+/,PA=(e,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:m}=t,f=[],a=e.trim().split(NA);let c="";for(let h=a.length-1;h>=0;h-=1){const g=a[h],{isExternal:d,modifiers:_,hasImportantModifier:S,baseClassName:E,maybePostfixModifierPosition:b}=s(g);if(d){c=g+(c.length>0?" "+c:c);continue}let v=!!b,y=o(v?E.substring(0,b):E);if(!y){if(!v){c=g+(c.length>0?" "+c:c);continue}if(y=o(E),!y){c=g+(c.length>0?" "+c:c);continue}v=!1}const p=_.length===0?"":_.length===1?_[0]:m(_).join(":"),x=S?p+Jh:p,k=x+y;if(f.indexOf(k)>-1)continue;f.push(k);const P=l(y,v);for(let T=0;T<P.length;++T){const R=P[T];f.push(x+R)}c=g+(c.length>0?" "+c:c)}return c},RA=(...e)=>{let t=0,s,o,l="";for(;t<e.length;)(s=e[t++])&&(o=q_(s))&&(l&&(l+=" "),l+=o);return l},q_=e=>{if(typeof e=="string")return e;let t,s="";for(let o=0;o<e.length;o++)e[o]&&(t=q_(e[o]))&&(s&&(s+=" "),s+=t);return s},TA=(e,...t)=>{let s,o,l,m;const f=c=>{const h=t.reduce((g,d)=>d(g),e());return s=jA(h),o=s.cache.get,l=s.cache.set,m=a,a(c)},a=c=>{const h=o(c);if(h)return h;const g=PA(c,s);return l(c,g),g};return m=f,(...c)=>m(RA(...c))},AA=[],jt=e=>{const t=s=>s[e]||AA;return t.isThemeGetter=!0,t},Y_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,X_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,DA=/^\d+\/\d+$/,MA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,OA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ai=e=>DA.test(e),We=e=>!!e&&!Number.isNaN(Number(e)),dn=e=>!!e&&Number.isInteger(Number(e)),ph=e=>e.endsWith("%")&&We(e.slice(0,-1)),Ns=e=>MA.test(e),FA=()=>!0,$A=e=>LA.test(e)&&!OA.test(e),J_=()=>!1,HA=e=>IA.test(e),VA=e=>BA.test(e),zA=e=>!ke(e)&&!Ee(e),WA=e=>ro(e,ew,J_),ke=e=>Y_.test(e),Hn=e=>ro(e,tw,$A),mh=e=>ro(e,YA,We),fy=e=>ro(e,Q_,J_),UA=e=>ro(e,Z_,VA),Kl=e=>ro(e,rw,HA),Ee=e=>X_.test(e),qo=e=>so(e,tw),KA=e=>so(e,XA),py=e=>so(e,Q_),GA=e=>so(e,ew),qA=e=>so(e,Z_),Gl=e=>so(e,rw,!0),ro=(e,t,s)=>{const o=Y_.exec(e);return o?o[1]?t(o[1]):s(o[2]):!1},so=(e,t,s=!1)=>{const o=X_.exec(e);return o?o[1]?t(o[1]):s:!1},Q_=e=>e==="position"||e==="percentage",Z_=e=>e==="image"||e==="url",ew=e=>e==="length"||e==="size"||e==="bg-size",tw=e=>e==="length",YA=e=>e==="number",XA=e=>e==="family-name",rw=e=>e==="shadow",JA=()=>{const e=jt("color"),t=jt("font"),s=jt("text"),o=jt("font-weight"),l=jt("tracking"),m=jt("leading"),f=jt("breakpoint"),a=jt("container"),c=jt("spacing"),h=jt("radius"),g=jt("shadow"),d=jt("inset-shadow"),_=jt("text-shadow"),S=jt("drop-shadow"),E=jt("blur"),b=jt("perspective"),v=jt("aspect"),y=jt("ease"),p=jt("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...k(),Ee,ke],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],j=()=>[Ee,ke,c],M=()=>[Ai,"full","auto",...j()],$=()=>[dn,"none","subgrid",Ee,ke],F=()=>["auto",{span:["full",dn,Ee,ke]},dn,Ee,ke],U=()=>[dn,"auto",Ee,ke],H=()=>["auto","min","max","fr",Ee,ke],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...j()],J=()=>[Ai,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],W=()=>[e,Ee,ke],D=()=>[...k(),py,fy,{position:[Ee,ke]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",GA,WA,{size:[Ee,ke]}],z=()=>[ph,qo,Hn],ee=()=>["","none","full",h,Ee,ke],ne=()=>["",We,qo,Hn],ce=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[We,ph,py,fy],O=()=>["","none",E,Ee,ke],Z=()=>["none",We,Ee,ke],X=()=>["none",We,Ee,ke],q=()=>[We,Ee,ke],re=()=>[Ai,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ns],breakpoint:[Ns],color:[FA],container:[Ns],"drop-shadow":[Ns],ease:["in","out","in-out"],font:[zA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ns],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ns],shadow:[Ns],spacing:["px",We],text:[Ns],"text-shadow":[Ns],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ai,ke,Ee,v]}],container:["container"],columns:[{columns:[We,ke,Ee,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[dn,"auto",Ee,ke]}],basis:[{basis:[Ai,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Ai,"auto","initial","none",ke]}],grow:[{grow:["",We,Ee,ke]}],shrink:[{shrink:["",We,Ee,ke]}],order:[{order:[dn,"first","last","none",Ee,ke]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[a,"screen",...J()]}],"min-w":[{"min-w":[a,"screen","none",...J()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[f]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",s,qo,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ee,mh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ph,ke]}],"font-family":[{font:[KA,ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ee,ke]}],"line-clamp":[{"line-clamp":[We,"none",Ee,mh]}],leading:[{leading:[m,...j()]}],"list-image":[{"list-image":["none",Ee,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",Ee,Hn]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[We,"auto",Ee,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dn,Ee,ke],radial:["",Ee,ke],conic:[dn,Ee,ke]},qA,UA]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[We,Ee,ke]}],"outline-w":[{outline:["",We,qo,Hn]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",g,Gl,Kl]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",d,Gl,Kl]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[We,Hn]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",_,Gl,Kl]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[We,Ee,ke]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[Ee,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,ke]}],filter:[{filter:["","none",Ee,ke]}],blur:[{blur:O()}],brightness:[{brightness:[We,Ee,ke]}],contrast:[{contrast:[We,Ee,ke]}],"drop-shadow":[{"drop-shadow":["","none",S,Gl,Kl]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",We,Ee,ke]}],"hue-rotate":[{"hue-rotate":[We,Ee,ke]}],invert:[{invert:["",We,Ee,ke]}],saturate:[{saturate:[We,Ee,ke]}],sepia:[{sepia:["",We,Ee,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,ke]}],"backdrop-blur":[{"backdrop-blur":O()}],"backdrop-brightness":[{"backdrop-brightness":[We,Ee,ke]}],"backdrop-contrast":[{"backdrop-contrast":[We,Ee,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,Ee,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,Ee,ke]}],"backdrop-invert":[{"backdrop-invert":["",We,Ee,ke]}],"backdrop-opacity":[{"backdrop-opacity":[We,Ee,ke]}],"backdrop-saturate":[{"backdrop-saturate":[We,Ee,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",We,Ee,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",Ee,ke]}],ease:[{ease:["linear","initial",y,Ee,ke]}],delay:[{delay:[We,Ee,ke]}],animate:[{animate:["none",p,Ee,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ee,ke]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:q()}],"skew-x":[{"skew-x":q()}],"skew-y":[{"skew-y":q()}],transform:[{transform:[Ee,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,ke]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[We,qo,Hn,mh]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},QA=TA(JA);function xe(...e){return QA(W_(e))}function my(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bs(...e){return t=>{let s=!1;const o=e.map(l=>{const m=my(l,t);return!s&&typeof m=="function"&&(s=!0),m});if(s)return()=>{for(let l=0;l<o.length;l++){const m=o[l];typeof m=="function"?m():my(e[l],null)}}}}function ze(...e){return C.useCallback(Bs(...e),e)}var ZA=Symbol.for("react.lazy"),yc=vf[" use ".trim().toString()];function eD(e){return typeof e=="object"&&e!==null&&"then"in e}function sw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ZA&&"_payload"in e&&eD(e._payload)}function lp(e){const t=rD(e),s=C.forwardRef((o,l)=>{let{children:m,...f}=o;sw(m)&&typeof yc=="function"&&(m=yc(m._payload));const a=C.Children.toArray(m),c=a.find(nD);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return i.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return i.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}var tD=lp("Slot");function rD(e){const t=C.forwardRef((s,o)=>{let{children:l,...m}=s;if(sw(l)&&typeof yc=="function"&&(l=yc(l._payload)),C.isValidElement(l)){const f=oD(l),a=iD(m,l.props);return l.type!==C.Fragment&&(a.ref=o?Bs(o,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sD=Symbol("radix.slottable");function nD(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sD}function iD(e,t){const s={...t};for(const o in t){const l=e[o],m=t[o];/^on[A-Z]/.test(o)?l&&m?s[o]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[o]=l):o==="style"?s[o]={...l,...m}:o==="className"&&(s[o]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function oD(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}const gy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vy=W_,Vc=(e,t)=>s=>{var o;if((t==null?void 0:t.variants)==null)return vy(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:l,defaultVariants:m}=t,f=Object.keys(l).map(h=>{const g=s==null?void 0:s[h],d=m==null?void 0:m[h];if(g===null)return null;const _=gy(g)||gy(d);return l[h][_]}),a=s&&Object.entries(s).reduce((h,g)=>{let[d,_]=g;return _===void 0||(h[d]=_),h},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((h,g)=>{let{class:d,className:_,...S}=g;return Object.entries(S).every(E=>{let[b,v]=E;return Array.isArray(v)?v.includes({...m,...a}[b]):{...m,...a}[b]===v})?[...h,d,_]:h},[]);return vy(e,f,c,s==null?void 0:s.class,s==null?void 0:s.className)},cp=Vc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ue=C.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...l},m)=>{const f=o?tD:"button";return i.jsx(f,{className:xe(cp({variant:t,size:s,className:e})),ref:m,...l})});ue.displayName="Button";const Xe=C.forwardRef(({className:e,type:t,...s},o)=>i.jsx("input",{type:t,className:xe("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:o,...s}));Xe.displayName="Input";const Ze=C.forwardRef(({className:e,...t},s)=>i.jsx("textarea",{className:xe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm 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,...t}));Ze.displayName="Textarea";var aD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lD=aD.reduce((e,t)=>{const s=lp(`Primitive.${t}`),o=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:m})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),cD="Label",nw=C.forwardRef((e,t)=>i.jsx(lD.label,{...e,ref:t,onMouseDown:s=>{var l;s.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));nw.displayName=cD;var iw=nw;const dD=Vc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),bt=C.forwardRef(({className:e,...t},s)=>i.jsx(iw,{ref:s,className:xe(dD(),e),...t}));bt.displayName=iw.displayName;const uD=Vc("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function st({className:e,variant:t,...s}){return i.jsx("div",{className:xe(uD({variant:t}),e),...s})}function ye(e,t,{checkForDefaultPrevented:s=!0}={}){return function(l){if(e==null||e(l),s===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function hD(e,t){const s=C.createContext(t),o=m=>{const{children:f,...a}=m,c=C.useMemo(()=>a,Object.values(a));return i.jsx(s.Provider,{value:c,children:f})};o.displayName=e+"Provider";function l(m){const f=C.useContext(s);if(f)return f;if(t!==void 0)return t;throw new Error(`\`${m}\` must be used within \`${e}\``)}return[o,l]}function yr(e,t=[]){let s=[];function o(m,f){const a=C.createContext(f),c=s.length;s=[...s,f];const h=d=>{var y;const{scope:_,children:S,...E}=d,b=((y=_==null?void 0:_[e])==null?void 0:y[c])||a,v=C.useMemo(()=>E,Object.values(E));return i.jsx(b.Provider,{value:v,children:S})};h.displayName=m+"Provider";function g(d,_){var b;const S=((b=_==null?void 0:_[e])==null?void 0:b[c])||a,E=C.useContext(S);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${d}\` must be used within \`${m}\``)}return[h,g]}const l=()=>{const m=s.map(f=>C.createContext(f));return function(a){const c=(a==null?void 0:a[e])||m;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return l.scopeName=e,[o,fD(l,...t)]}function fD(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(m){const f=o.reduce((a,{useScope:c,scopeName:h})=>{const d=c(m)[`__scope${h}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:f}),[f])}};return s.scopeName=t.scopeName,s}var Lt=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},pD=vf[" useInsertionEffect ".trim().toString()]||Lt;function es({prop:e,defaultProp:t,onChange:s=()=>{},caller:o}){const[l,m,f]=mD({defaultProp:t,onChange:s}),a=e!==void 0,c=a?e:l;{const g=C.useRef(e!==void 0);C.useEffect(()=>{const d=g.current;d!==a&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=a},[a,o])}const h=C.useCallback(g=>{var d;if(a){const _=gD(g)?g(e):g;_!==e&&((d=f.current)==null||d.call(f,_))}else m(g)},[a,e,m,f]);return[c,h]}function mD({defaultProp:e,onChange:t}){const[s,o]=C.useState(e),l=C.useRef(s),m=C.useRef(t);return pD(()=>{m.current=t},[t]),C.useEffect(()=>{var f;l.current!==s&&((f=m.current)==null||f.call(m,s),l.current=s)},[s,l]),[s,o,m]}function gD(e){return typeof e=="function"}function dp(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 up(e){const[t,s]=C.useState(void 0);return Lt(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const m=l[0];let f,a;if("borderBoxSize"in m){const c=m.borderBoxSize,h=Array.isArray(c)?c[0]:c;f=h.inlineSize,a=h.blockSize}else f=e.offsetWidth,a=e.offsetHeight;s({width:f,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else s(void 0)},[e]),t}function vD(e){const t=yD(e),s=C.forwardRef((o,l)=>{const{children:m,...f}=o,a=C.Children.toArray(m),c=a.find(_D);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return i.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return i.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function yD(e){const t=C.forwardRef((s,o)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=bD(l),a=wD(m,l.props);return l.type!==C.Fragment&&(a.ref=o?Bs(o,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xD=Symbol("radix.slottable");function _D(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xD}function wD(e,t){const s={...t};for(const o in t){const l=e[o],m=t[o];/^on[A-Z]/.test(o)?l&&m?s[o]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[o]=l):o==="style"?s[o]={...l,...m}:o==="className"&&(s[o]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function bD(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var SD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oe=SD.reduce((e,t)=>{const s=vD(`Primitive.${t}`),o=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:m})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function ow(e,t){e&&va.flushSync(()=>e.dispatchEvent(t))}var zc="Switch",[CD]=yr(zc),[kD,ED]=CD(zc),aw=C.forwardRef((e,t)=>{const{__scopeSwitch:s,name:o,checked:l,defaultChecked:m,required:f,disabled:a,value:c="on",onCheckedChange:h,form:g,...d}=e,[_,S]=C.useState(null),E=ze(t,x=>S(x)),b=C.useRef(!1),v=_?g||!!_.closest("form"):!0,[y,p]=es({prop:l,defaultProp:m??!1,onChange:h,caller:zc});return i.jsxs(kD,{scope:s,checked:y,disabled:a,children:[i.jsx(Oe.button,{type:"button",role:"switch","aria-checked":y,"aria-required":f,"data-state":uw(y),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:E,onClick:ye(e.onClick,x=>{p(k=>!k),v&&(b.current=x.isPropagationStopped(),b.current||x.stopPropagation())})}),v&&i.jsx(dw,{control:_,bubbles:!b.current,name:o,value:c,checked:y,required:f,disabled:a,form:g,style:{transform:"translateX(-100%)"}})]})});aw.displayName=zc;var lw="SwitchThumb",cw=C.forwardRef((e,t)=>{const{__scopeSwitch:s,...o}=e,l=ED(lw,s);return i.jsx(Oe.span,{"data-state":uw(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t})});cw.displayName=lw;var jD="SwitchBubbleInput",dw=C.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:o=!0,...l},m)=>{const f=C.useRef(null),a=ze(f,m),c=dp(s),h=up(t);return C.useEffect(()=>{const g=f.current;if(!g)return;const d=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==s&&S){const E=new Event("click",{bubbles:o});S.call(g,s),g.dispatchEvent(E)}},[c,s,o]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...l,tabIndex:-1,ref:a,style:{...l.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});dw.displayName=jD;function uw(e){return e?"checked":"unchecked"}var hw=aw,ND=cw;const xt=C.forwardRef(({className:e,...t},s)=>i.jsx(hw,{className:xe("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:s,children:i.jsx(ND,{className:xe("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")})}));xt.displayName=hw.displayName;function yy(e){const t=PD(e),s=C.forwardRef((o,l)=>{const{children:m,...f}=o,a=C.Children.toArray(m),c=a.find(TD);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return i.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return i.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function PD(e){const t=C.forwardRef((s,o)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=DD(l),a=AD(m,l.props);return l.type!==C.Fragment&&(a.ref=o?Bs(o,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RD=Symbol("radix.slottable");function TD(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RD}function AD(e,t){const s={...t};for(const o in t){const l=e[o],m=t[o];/^on[A-Z]/.test(o)?l&&m?s[o]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[o]=l):o==="style"?s[o]={...l,...m}:o==="className"&&(s[o]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function DD(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function hp(e){const t=e+"CollectionProvider",[s,o]=yr(t),[l,m]=s(t,{collectionRef:{current:null},itemMap:new Map}),f=b=>{const{scope:v,children:y}=b,p=ve.useRef(null),x=ve.useRef(new Map).current;return i.jsx(l,{scope:v,itemMap:x,collectionRef:p,children:y})};f.displayName=t;const a=e+"CollectionSlot",c=yy(a),h=ve.forwardRef((b,v)=>{const{scope:y,children:p}=b,x=m(a,y),k=ze(v,x.collectionRef);return i.jsx(c,{ref:k,children:p})});h.displayName=a;const g=e+"CollectionItemSlot",d="data-radix-collection-item",_=yy(g),S=ve.forwardRef((b,v)=>{const{scope:y,children:p,...x}=b,k=ve.useRef(null),P=ze(v,k),T=m(g,y);return ve.useEffect(()=>(T.itemMap.set(k,{ref:k,...x}),()=>void T.itemMap.delete(k))),i.jsx(_,{[d]:"",ref:P,children:p})});S.displayName=g;function E(b){const v=m(e+"CollectionConsumer",b);return ve.useCallback(()=>{const p=v.collectionRef.current;if(!p)return[];const x=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((T,R)=>x.indexOf(T.ref.current)-x.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:f,Slot:h,ItemSlot:S},E,o]}var MD=vf[" useId ".trim().toString()]||(()=>{}),LD=0;function vr(e){const[t,s]=C.useState(MD());return Lt(()=>{s(o=>o??String(LD++))},[e]),t?`radix-${t}`:""}function Mt(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...s)=>{var o;return(o=t.current)==null?void 0:o.call(t,...s)},[])}var OD=C.createContext(void 0);function Sa(e){const t=C.useContext(OD);return e||t||"ltr"}var gh="rovingFocusGroup.onEntryFocus",ID={bubbles:!1,cancelable:!0},Ca="RovingFocusGroup",[Qh,fw,BD]=hp(Ca),[FD,Wc]=yr(Ca,[BD]),[$D,HD]=FD(Ca),pw=C.forwardRef((e,t)=>i.jsx(Qh.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Qh.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(VD,{...e,ref:t})})}));pw.displayName=Ca;var VD=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:l=!1,dir:m,currentTabStopId:f,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...d}=e,_=C.useRef(null),S=ze(t,_),E=Sa(m),[b,v]=es({prop:f,defaultProp:a??null,onChange:c,caller:Ca}),[y,p]=C.useState(!1),x=Mt(h),k=fw(s),P=C.useRef(!1),[T,R]=C.useState(0);return C.useEffect(()=>{const j=_.current;if(j)return j.addEventListener(gh,x),()=>j.removeEventListener(gh,x)},[x]),i.jsx($D,{scope:s,orientation:o,dir:E,loop:l,currentTabStopId:b,onItemFocus:C.useCallback(j=>v(j),[v]),onItemShiftTab:C.useCallback(()=>p(!0),[]),onFocusableItemAdd:C.useCallback(()=>R(j=>j+1),[]),onFocusableItemRemove:C.useCallback(()=>R(j=>j-1),[]),children:i.jsx(Oe.div,{tabIndex:y||T===0?-1:0,"data-orientation":o,...d,ref:S,style:{outline:"none",...e.style},onMouseDown:ye(e.onMouseDown,()=>{P.current=!0}),onFocus:ye(e.onFocus,j=>{const M=!P.current;if(j.target===j.currentTarget&&M&&!y){const $=new CustomEvent(gh,ID);if(j.currentTarget.dispatchEvent($),!$.defaultPrevented){const F=k().filter(K=>K.focusable),U=F.find(K=>K.active),H=F.find(K=>K.id===b),V=[U,H,...F].filter(Boolean).map(K=>K.ref.current);vw(V,g)}}P.current=!1}),onBlur:ye(e.onBlur,()=>p(!1))})})}),mw="RovingFocusGroupItem",gw=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:l=!1,tabStopId:m,children:f,...a}=e,c=vr(),h=m||c,g=HD(mw,s),d=g.currentTabStopId===h,_=fw(s),{onFocusableItemAdd:S,onFocusableItemRemove:E,currentTabStopId:b}=g;return C.useEffect(()=>{if(o)return S(),()=>E()},[o,S,E]),i.jsx(Qh.ItemSlot,{scope:s,id:h,focusable:o,active:l,children:i.jsx(Oe.span,{tabIndex:d?0:-1,"data-orientation":g.orientation,...a,ref:t,onMouseDown:ye(e.onMouseDown,v=>{o?g.onItemFocus(h):v.preventDefault()}),onFocus:ye(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:ye(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){g.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=UD(v,g.orientation,g.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=_().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const k=x.indexOf(v.currentTarget);x=g.loop?KD(x,k+1):x.slice(k+1)}setTimeout(()=>vw(x))}}),children:typeof f=="function"?f({isCurrentTabStop:d,hasTabStop:b!=null}):f})})});gw.displayName=mw;var zD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WD(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UD(e,t,s){const o=WD(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return zD[o]}function vw(e,t=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:t}),document.activeElement!==s))return}function KD(e,t){return e.map((s,o)=>e[(t+o)%e.length])}var yw=pw,xw=gw;function GD(e,t){return C.useReducer((s,o)=>t[s][o]??s,e)}var Vt=e=>{const{present:t,children:s}=e,o=qD(t),l=typeof s=="function"?s({present:o.isPresent}):C.Children.only(s),m=ze(o.ref,YD(l));return typeof s=="function"||o.isPresent?C.cloneElement(l,{ref:m}):null};Vt.displayName="Presence";function qD(e){const[t,s]=C.useState(),o=C.useRef(null),l=C.useRef(e),m=C.useRef("none"),f=e?"mounted":"unmounted",[a,c]=GD(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const h=ql(o.current);m.current=a==="mounted"?h:"none"},[a]),Lt(()=>{const h=o.current,g=l.current;if(g!==e){const _=m.current,S=ql(h);e?c("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?c("UNMOUNT"):c(g&&_!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Lt(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,d=S=>{const b=ql(o.current).includes(CSS.escape(S.animationName));if(S.target===t&&b&&(c("ANIMATION_END"),!l.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},_=S=>{S.target===t&&(m.current=ql(o.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(h=>{o.current=h?getComputedStyle(h):null,s(h)},[])}}function ql(e){return(e==null?void 0:e.animationName)||"none"}function YD(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Uc="Tabs",[XD]=yr(Uc,[Wc]),_w=Wc(),[JD,fp]=XD(Uc),ww=C.forwardRef((e,t)=>{const{__scopeTabs:s,value:o,onValueChange:l,defaultValue:m,orientation:f="horizontal",dir:a,activationMode:c="automatic",...h}=e,g=Sa(a),[d,_]=es({prop:o,onChange:l,defaultProp:m??"",caller:Uc});return i.jsx(JD,{scope:s,baseId:vr(),value:d,onValueChange:_,orientation:f,dir:g,activationMode:c,children:i.jsx(Oe.div,{dir:g,"data-orientation":f,...h,ref:t})})});ww.displayName=Uc;var bw="TabsList",Sw=C.forwardRef((e,t)=>{const{__scopeTabs:s,loop:o=!0,...l}=e,m=fp(bw,s),f=_w(s);return i.jsx(yw,{asChild:!0,...f,orientation:m.orientation,dir:m.dir,loop:o,children:i.jsx(Oe.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:t})})});Sw.displayName=bw;var Cw="TabsTrigger",kw=C.forwardRef((e,t)=>{const{__scopeTabs:s,value:o,disabled:l=!1,...m}=e,f=fp(Cw,s),a=_w(s),c=Nw(f.baseId,o),h=Pw(f.baseId,o),g=o===f.value;return i.jsx(xw,{asChild:!0,...a,focusable:!l,active:g,children:i.jsx(Oe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...m,ref:t,onMouseDown:ye(e.onMouseDown,d=>{!l&&d.button===0&&d.ctrlKey===!1?f.onValueChange(o):d.preventDefault()}),onKeyDown:ye(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&f.onValueChange(o)}),onFocus:ye(e.onFocus,()=>{const d=f.activationMode!=="manual";!g&&!l&&d&&f.onValueChange(o)})})})});kw.displayName=Cw;var Ew="TabsContent",jw=C.forwardRef((e,t)=>{const{__scopeTabs:s,value:o,forceMount:l,children:m,...f}=e,a=fp(Ew,s),c=Nw(a.baseId,o),h=Pw(a.baseId,o),g=o===a.value,d=C.useRef(g);return C.useEffect(()=>{const _=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(_)},[]),i.jsx(Vt,{present:l||g,children:({present:_})=>i.jsx(Oe.div,{"data-state":g?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!_,id:h,tabIndex:0,...f,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:_&&m})})});jw.displayName=Ew;function Nw(e,t){return`${e}-trigger-${t}`}function Pw(e,t){return`${e}-content-${t}`}var QD=ww,Rw=Sw,Tw=kw,Aw=jw;const Kc=QD,ka=C.forwardRef(({className:e,...t},s)=>i.jsx(Rw,{ref:s,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ka.displayName=Rw.displayName;const Zr=C.forwardRef(({className:e,...t},s)=>i.jsx(Tw,{ref:s,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Zr.displayName=Tw.displayName;const Rs=C.forwardRef(({className:e,...t},s)=>i.jsx(Aw,{ref:s,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rs.displayName=Aw.displayName;function Zh(e,[t,s]){return Math.min(s,Math.max(t,e))}function ZD(e,t=globalThis==null?void 0:globalThis.document){const s=Mt(e);C.useEffect(()=>{const o=l=>{l.key==="Escape"&&s(l)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[s,t])}var eM="DismissableLayer",ef="dismissableLayer.update",tM="dismissableLayer.pointerDownOutside",rM="dismissableLayer.focusOutside",xy,Dw=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ea=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m,onInteractOutside:f,onDismiss:a,...c}=e,h=C.useContext(Dw),[g,d]=C.useState(null),_=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=C.useState({}),E=ze(t,R=>d(R)),b=Array.from(h.layers),[v]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),p=g?b.indexOf(g):-1,x=h.layersWithOutsidePointerEventsDisabled.size>0,k=p>=y,P=iM(R=>{const j=R.target,M=[...h.branches].some($=>$.contains(j));!k||M||(l==null||l(R),f==null||f(R),R.defaultPrevented||a==null||a())},_),T=oM(R=>{const j=R.target;[...h.branches].some($=>$.contains(j))||(m==null||m(R),f==null||f(R),R.defaultPrevented||a==null||a())},_);return ZD(R=>{p===h.layers.size-1&&(o==null||o(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},_),C.useEffect(()=>{if(g)return s&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(xy=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),_y(),()=>{s&&h.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=xy)}},[g,_,s,h]),C.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),_y())},[g,h]),C.useEffect(()=>{const R=()=>S({});return document.addEventListener(ef,R),()=>document.removeEventListener(ef,R)},[]),i.jsx(Oe.div,{...c,ref:E,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,P.onPointerDownCapture)})});Ea.displayName=eM;var sM="DismissableLayerBranch",nM=C.forwardRef((e,t)=>{const s=C.useContext(Dw),o=C.useRef(null),l=ze(t,o);return C.useEffect(()=>{const m=o.current;if(m)return s.branches.add(m),()=>{s.branches.delete(m)}},[s.branches]),i.jsx(Oe.div,{...e,ref:l})});nM.displayName=sM;function iM(e,t=globalThis==null?void 0:globalThis.document){const s=Mt(e),o=C.useRef(!1),l=C.useRef(()=>{});return C.useEffect(()=>{const m=a=>{if(a.target&&!o.current){let c=function(){Mw(tM,s,h,{discrete:!0})};const h={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=c,t.addEventListener("click",l.current,{once:!0})):c()}else t.removeEventListener("click",l.current);o.current=!1},f=window.setTimeout(()=>{t.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(f),t.removeEventListener("pointerdown",m),t.removeEventListener("click",l.current)}},[t,s]),{onPointerDownCapture:()=>o.current=!0}}function oM(e,t=globalThis==null?void 0:globalThis.document){const s=Mt(e),o=C.useRef(!1);return C.useEffect(()=>{const l=m=>{m.target&&!o.current&&Mw(rM,s,{originalEvent:m},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function _y(){const e=new CustomEvent(ef);document.dispatchEvent(e)}function Mw(e,t,s,{discrete:o}){const l=s.originalEvent.target,m=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&l.addEventListener(e,t,{once:!0}),o?ow(l,m):l.dispatchEvent(m)}var vh=0;function pp(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wy()),document.body.insertAdjacentElement("beforeend",e[1]??wy()),vh++,()=>{vh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vh--}},[])}function wy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var yh="focusScope.autoFocusOnMount",xh="focusScope.autoFocusOnUnmount",by={bubbles:!1,cancelable:!0},aM="FocusScope",Gc=C.forwardRef((e,t)=>{const{loop:s=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:m,...f}=e,[a,c]=C.useState(null),h=Mt(l),g=Mt(m),d=C.useRef(null),_=ze(t,b=>c(b)),S=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(o){let b=function(x){if(S.paused||!a)return;const k=x.target;a.contains(k)?d.current=k:hn(d.current,{select:!0})},v=function(x){if(S.paused||!a)return;const k=x.relatedTarget;k!==null&&(a.contains(k)||hn(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const P of x)P.removedNodes.length>0&&hn(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const p=new MutationObserver(y);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),p.disconnect()}}},[o,a,S.paused]),C.useEffect(()=>{if(a){Cy.add(S);const b=document.activeElement;if(!a.contains(b)){const y=new CustomEvent(yh,by);a.addEventListener(yh,h),a.dispatchEvent(y),y.defaultPrevented||(lM(fM(Lw(a)),{select:!0}),document.activeElement===b&&hn(a))}return()=>{a.removeEventListener(yh,h),setTimeout(()=>{const y=new CustomEvent(xh,by);a.addEventListener(xh,g),a.dispatchEvent(y),y.defaultPrevented||hn(b??document.body,{select:!0}),a.removeEventListener(xh,g),Cy.remove(S)},0)}}},[a,h,g,S]);const E=C.useCallback(b=>{if(!s&&!o||S.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(v&&y){const p=b.currentTarget,[x,k]=cM(p);x&&k?!b.shiftKey&&y===k?(b.preventDefault(),s&&hn(x,{select:!0})):b.shiftKey&&y===x&&(b.preventDefault(),s&&hn(k,{select:!0})):y===p&&b.preventDefault()}},[s,o,S.paused]);return i.jsx(Oe.div,{tabIndex:-1,...f,ref:_,onKeyDown:E})});Gc.displayName=aM;function lM(e,{select:t=!1}={}){const s=document.activeElement;for(const o of e)if(hn(o,{select:t}),document.activeElement!==s)return}function cM(e){const t=Lw(e),s=Sy(t,e),o=Sy(t.reverse(),e);return[s,o]}function Lw(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Sy(e,t){for(const s of e)if(!dM(s,{upTo:t}))return s}function dM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uM(e){return e instanceof HTMLInputElement&&"select"in e}function hn(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&uM(e)&&t&&e.select()}}var Cy=hM();function hM(){let e=[];return{add(t){const s=e[0];t!==s&&(s==null||s.pause()),e=ky(e,t),e.unshift(t)},remove(t){var s;e=ky(e,t),(s=e[0])==null||s.resume()}}}function ky(e,t){const s=[...e],o=s.indexOf(t);return o!==-1&&s.splice(o,1),s}function fM(e){return e.filter(t=>t.tagName!=="A")}const pM=["top","right","bottom","left"],xn=Math.min,kr=Math.max,xc=Math.round,Yl=Math.floor,ps=e=>({x:e,y:e}),mM={left:"right",right:"left",bottom:"top",top:"bottom"},gM={start:"end",end:"start"};function tf(e,t,s){return kr(e,xn(t,s))}function Os(e,t){return typeof e=="function"?e(t):e}function Is(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function mp(e){return e==="x"?"y":"x"}function gp(e){return e==="y"?"height":"width"}const vM=new Set(["top","bottom"]);function us(e){return vM.has(Is(e))?"y":"x"}function vp(e){return mp(us(e))}function yM(e,t,s){s===void 0&&(s=!1);const o=no(e),l=vp(e),m=gp(l);let f=l==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[m]>t.floating[m]&&(f=_c(f)),[f,_c(f)]}function xM(e){const t=_c(e);return[rf(e),t,rf(t)]}function rf(e){return e.replace(/start|end/g,t=>gM[t])}const Ey=["left","right"],jy=["right","left"],_M=["top","bottom"],wM=["bottom","top"];function bM(e,t,s){switch(e){case"top":case"bottom":return s?t?jy:Ey:t?Ey:jy;case"left":case"right":return t?_M:wM;default:return[]}}function SM(e,t,s,o){const l=no(e);let m=bM(Is(e),s==="start",o);return l&&(m=m.map(f=>f+"-"+l),t&&(m=m.concat(m.map(rf)))),m}function _c(e){return e.replace(/left|right|bottom|top/g,t=>mM[t])}function CM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ow(e){return typeof e!="number"?CM(e):{top:e,right:e,bottom:e,left:e}}function wc(e){const{x:t,y:s,width:o,height:l}=e;return{width:o,height:l,top:s,left:t,right:t+o,bottom:s+l,x:t,y:s}}function Ny(e,t,s){let{reference:o,floating:l}=e;const m=us(t),f=vp(t),a=gp(f),c=Is(t),h=m==="y",g=o.x+o.width/2-l.width/2,d=o.y+o.height/2-l.height/2,_=o[a]/2-l[a]/2;let S;switch(c){case"top":S={x:g,y:o.y-l.height};break;case"bottom":S={x:g,y:o.y+o.height};break;case"right":S={x:o.x+o.width,y:d};break;case"left":S={x:o.x-l.width,y:d};break;default:S={x:o.x,y:o.y}}switch(no(t)){case"start":S[f]-=_*(s&&h?-1:1);break;case"end":S[f]+=_*(s&&h?-1:1);break}return S}const kM=async(e,t,s)=>{const{placement:o="bottom",strategy:l="absolute",middleware:m=[],platform:f}=s,a=m.filter(Boolean),c=await(f.isRTL==null?void 0:f.isRTL(t));let h=await f.getElementRects({reference:e,floating:t,strategy:l}),{x:g,y:d}=Ny(h,o,c),_=o,S={},E=0;for(let b=0;b<a.length;b++){const{name:v,fn:y}=a[b],{x:p,y:x,data:k,reset:P}=await y({x:g,y:d,initialPlacement:o,placement:_,strategy:l,middlewareData:S,rects:h,platform:f,elements:{reference:e,floating:t}});g=p??g,d=x??d,S={...S,[v]:{...S[v],...k}},P&&E<=50&&(E++,typeof P=="object"&&(P.placement&&(_=P.placement),P.rects&&(h=P.rects===!0?await f.getElementRects({reference:e,floating:t,strategy:l}):P.rects),{x:g,y:d}=Ny(h,_,c)),b=-1)}return{x:g,y:d,placement:_,strategy:l,middlewareData:S}};async function ua(e,t){var s;t===void 0&&(t={});const{x:o,y:l,platform:m,rects:f,elements:a,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:d="floating",altBoundary:_=!1,padding:S=0}=Os(t,e),E=Ow(S),v=a[_?d==="floating"?"reference":"floating":d],y=wc(await m.getClippingRect({element:(s=await(m.isElement==null?void 0:m.isElement(v)))==null||s?v:v.contextElement||await(m.getDocumentElement==null?void 0:m.getDocumentElement(a.floating)),boundary:h,rootBoundary:g,strategy:c})),p=d==="floating"?{x:o,y:l,width:f.floating.width,height:f.floating.height}:f.reference,x=await(m.getOffsetParent==null?void 0:m.getOffsetParent(a.floating)),k=await(m.isElement==null?void 0:m.isElement(x))?await(m.getScale==null?void 0:m.getScale(x))||{x:1,y:1}:{x:1,y:1},P=wc(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:x,strategy:c}):p);return{top:(y.top-P.top+E.top)/k.y,bottom:(P.bottom-y.bottom+E.bottom)/k.y,left:(y.left-P.left+E.left)/k.x,right:(P.right-y.right+E.right)/k.x}}const EM=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:o,placement:l,rects:m,platform:f,elements:a,middlewareData:c}=t,{element:h,padding:g=0}=Os(e,t)||{};if(h==null)return{};const d=Ow(g),_={x:s,y:o},S=vp(l),E=gp(S),b=await f.getDimensions(h),v=S==="y",y=v?"top":"left",p=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=m.reference[E]+m.reference[S]-_[S]-m.floating[E],P=_[S]-m.reference[S],T=await(f.getOffsetParent==null?void 0:f.getOffsetParent(h));let R=T?T[x]:0;(!R||!await(f.isElement==null?void 0:f.isElement(T)))&&(R=a.floating[x]||m.floating[E]);const j=k/2-P/2,M=R/2-b[E]/2-1,$=xn(d[y],M),F=xn(d[p],M),U=$,H=R-b[E]-F,Q=R/2-b[E]/2+j,V=tf(U,Q,H),K=!c.arrow&&no(l)!=null&&Q!==V&&m.reference[E]/2-(Q<U?$:F)-b[E]/2<0,J=K?Q<U?Q-U:Q-H:0;return{[S]:_[S]+J,data:{[S]:V,centerOffset:Q-V-J,...K&&{alignmentOffset:J}},reset:K}}}),jM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,o;const{placement:l,middlewareData:m,rects:f,initialPlacement:a,platform:c,elements:h}=t,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:_,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:b=!0,...v}=Os(e,t);if((s=m.arrow)!=null&&s.alignmentOffset)return{};const y=Is(l),p=us(a),x=Is(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(h.floating)),P=_||(x||!b?[_c(a)]:xM(a)),T=E!=="none";!_&&T&&P.push(...SM(a,b,E,k));const R=[a,...P],j=await ua(t,v),M=[];let $=((o=m.flip)==null?void 0:o.overflows)||[];if(g&&M.push(j[y]),d){const Q=yM(l,f,k);M.push(j[Q[0]],j[Q[1]])}if($=[...$,{placement:l,overflows:M}],!M.every(Q=>Q<=0)){var F,U;const Q=(((F=m.flip)==null?void 0:F.index)||0)+1,V=R[Q];if(V&&(!(d==="alignment"?p!==us(V):!1)||$.every(W=>us(W.placement)===p?W.overflows[0]>0:!0)))return{data:{index:Q,overflows:$},reset:{placement:V}};let K=(U=$.filter(J=>J.overflows[0]<=0).sort((J,W)=>J.overflows[1]-W.overflows[1])[0])==null?void 0:U.placement;if(!K)switch(S){case"bestFit":{var H;const J=(H=$.filter(W=>{if(T){const D=us(W.placement);return D===p||D==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(D=>D>0).reduce((D,B)=>D+B,0)]).sort((W,D)=>W[1]-D[1])[0])==null?void 0:H[0];J&&(K=J);break}case"initialPlacement":K=a;break}if(l!==K)return{reset:{placement:K}}}return{}}}};function Py(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ry(e){return pM.some(t=>e[t]>=0)}const NM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s}=t,{strategy:o="referenceHidden",...l}=Os(e,t);switch(o){case"referenceHidden":{const m=await ua(t,{...l,elementContext:"reference"}),f=Py(m,s.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Ry(f)}}}case"escaped":{const m=await ua(t,{...l,altBoundary:!0}),f=Py(m,s.floating);return{data:{escapedOffsets:f,escaped:Ry(f)}}}default:return{}}}}},Iw=new Set(["left","top"]);async function PM(e,t){const{placement:s,platform:o,elements:l}=e,m=await(o.isRTL==null?void 0:o.isRTL(l.floating)),f=Is(s),a=no(s),c=us(s)==="y",h=Iw.has(f)?-1:1,g=m&&c?-1:1,d=Os(t,e);let{mainAxis:_,crossAxis:S,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(S=a==="end"?E*-1:E),c?{x:S*g,y:_*h}:{x:_*h,y:S*g}}const RM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,o;const{x:l,y:m,placement:f,middlewareData:a}=t,c=await PM(t,e);return f===((s=a.offset)==null?void 0:s.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:l+c.x,y:m+c.y,data:{...c,placement:f}}}}},TM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:o,placement:l}=t,{mainAxis:m=!0,crossAxis:f=!1,limiter:a={fn:v=>{let{x:y,y:p}=v;return{x:y,y:p}}},...c}=Os(e,t),h={x:s,y:o},g=await ua(t,c),d=us(Is(l)),_=mp(d);let S=h[_],E=h[d];if(m){const v=_==="y"?"top":"left",y=_==="y"?"bottom":"right",p=S+g[v],x=S-g[y];S=tf(p,S,x)}if(f){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",p=E+g[v],x=E-g[y];E=tf(p,E,x)}const b=a.fn({...t,[_]:S,[d]:E});return{...b,data:{x:b.x-s,y:b.y-o,enabled:{[_]:m,[d]:f}}}}}},AM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:s,y:o,placement:l,rects:m,middlewareData:f}=t,{offset:a=0,mainAxis:c=!0,crossAxis:h=!0}=Os(e,t),g={x:s,y:o},d=us(l),_=mp(d);let S=g[_],E=g[d];const b=Os(a,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const x=_==="y"?"height":"width",k=m.reference[_]-m.floating[x]+v.mainAxis,P=m.reference[_]+m.reference[x]-v.mainAxis;S<k?S=k:S>P&&(S=P)}if(h){var y,p;const x=_==="y"?"width":"height",k=Iw.has(Is(l)),P=m.reference[d]-m.floating[x]+(k&&((y=f.offset)==null?void 0:y[d])||0)+(k?0:v.crossAxis),T=m.reference[d]+m.reference[x]+(k?0:((p=f.offset)==null?void 0:p[d])||0)-(k?v.crossAxis:0);E<P?E=P:E>T&&(E=T)}return{[_]:S,[d]:E}}}},DM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var s,o;const{placement:l,rects:m,platform:f,elements:a}=t,{apply:c=()=>{},...h}=Os(e,t),g=await ua(t,h),d=Is(l),_=no(l),S=us(l)==="y",{width:E,height:b}=m.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=_===(await(f.isRTL==null?void 0:f.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=_==="end"?"top":"bottom");const p=b-g.top-g.bottom,x=E-g.left-g.right,k=xn(b-g[v],p),P=xn(E-g[y],x),T=!t.middlewareData.shift;let R=k,j=P;if((s=t.middlewareData.shift)!=null&&s.enabled.x&&(j=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(R=p),T&&!_){const $=kr(g.left,0),F=kr(g.right,0),U=kr(g.top,0),H=kr(g.bottom,0);S?j=E-2*($!==0||F!==0?$+F:kr(g.left,g.right)):R=b-2*(U!==0||H!==0?U+H:kr(g.top,g.bottom))}await c({...t,availableWidth:j,availableHeight:R});const M=await f.getDimensions(a.floating);return E!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function qc(){return typeof window<"u"}function io(e){return Bw(e)?(e.nodeName||"").toLowerCase():"#document"}function jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gs(e){var t;return(t=(Bw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bw(e){return qc()?e instanceof Node||e instanceof jr(e).Node:!1}function ts(e){return qc()?e instanceof Element||e instanceof jr(e).Element:!1}function ms(e){return qc()?e instanceof HTMLElement||e instanceof jr(e).HTMLElement:!1}function Ty(e){return!qc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jr(e).ShadowRoot}const MM=new Set(["inline","contents"]);function ja(e){const{overflow:t,overflowX:s,overflowY:o,display:l}=rs(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+s)&&!MM.has(l)}const LM=new Set(["table","td","th"]);function OM(e){return LM.has(io(e))}const IM=[":popover-open",":modal"];function Yc(e){return IM.some(t=>{try{return e.matches(t)}catch{return!1}})}const BM=["transform","translate","scale","rotate","perspective"],FM=["transform","translate","scale","rotate","perspective","filter"],$M=["paint","layout","strict","content"];function yp(e){const t=xp(),s=ts(e)?rs(e):e;return BM.some(o=>s[o]?s[o]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!t&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!t&&(s.filter?s.filter!=="none":!1)||FM.some(o=>(s.willChange||"").includes(o))||$M.some(o=>(s.contain||"").includes(o))}function HM(e){let t=_n(e);for(;ms(t)&&!qi(t);){if(yp(t))return t;if(Yc(t))return null;t=_n(t)}return null}function xp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const VM=new Set(["html","body","#document"]);function qi(e){return VM.has(io(e))}function rs(e){return jr(e).getComputedStyle(e)}function Xc(e){return ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _n(e){if(io(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ty(e)&&e.host||gs(e);return Ty(t)?t.host:t}function Fw(e){const t=_n(e);return qi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ms(t)&&ja(t)?t:Fw(t)}function ha(e,t,s){var o;t===void 0&&(t=[]),s===void 0&&(s=!0);const l=Fw(e),m=l===((o=e.ownerDocument)==null?void 0:o.body),f=jr(l);if(m){const a=sf(f);return t.concat(f,f.visualViewport||[],ja(l)?l:[],a&&s?ha(a):[])}return t.concat(l,ha(l,[],s))}function sf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $w(e){const t=rs(e);let s=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=ms(e),m=l?e.offsetWidth:s,f=l?e.offsetHeight:o,a=xc(s)!==m||xc(o)!==f;return a&&(s=m,o=f),{width:s,height:o,$:a}}function _p(e){return ts(e)?e:e.contextElement}function Hi(e){const t=_p(e);if(!ms(t))return ps(1);const s=t.getBoundingClientRect(),{width:o,height:l,$:m}=$w(t);let f=(m?xc(s.width):s.width)/o,a=(m?xc(s.height):s.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!a||!Number.isFinite(a))&&(a=1),{x:f,y:a}}const zM=ps(0);function Hw(e){const t=jr(e);return!xp()||!t.visualViewport?zM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WM(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==jr(e)?!1:t}function Yn(e,t,s,o){t===void 0&&(t=!1),s===void 0&&(s=!1);const l=e.getBoundingClientRect(),m=_p(e);let f=ps(1);t&&(o?ts(o)&&(f=Hi(o)):f=Hi(e));const a=WM(m,s,o)?Hw(m):ps(0);let c=(l.left+a.x)/f.x,h=(l.top+a.y)/f.y,g=l.width/f.x,d=l.height/f.y;if(m){const _=jr(m),S=o&&ts(o)?jr(o):o;let E=_,b=sf(E);for(;b&&o&&S!==E;){const v=Hi(b),y=b.getBoundingClientRect(),p=rs(b),x=y.left+(b.clientLeft+parseFloat(p.paddingLeft))*v.x,k=y.top+(b.clientTop+parseFloat(p.paddingTop))*v.y;c*=v.x,h*=v.y,g*=v.x,d*=v.y,c+=x,h+=k,E=jr(b),b=sf(E)}}return wc({width:g,height:d,x:c,y:h})}function Jc(e,t){const s=Xc(e).scrollLeft;return t?t.left+s:Yn(gs(e)).left+s}function Vw(e,t){const s=e.getBoundingClientRect(),o=s.left+t.scrollLeft-Jc(e,s),l=s.top+t.scrollTop;return{x:o,y:l}}function UM(e){let{elements:t,rect:s,offsetParent:o,strategy:l}=e;const m=l==="fixed",f=gs(o),a=t?Yc(t.floating):!1;if(o===f||a&&m)return s;let c={scrollLeft:0,scrollTop:0},h=ps(1);const g=ps(0),d=ms(o);if((d||!d&&!m)&&((io(o)!=="body"||ja(f))&&(c=Xc(o)),ms(o))){const S=Yn(o);h=Hi(o),g.x=S.x+o.clientLeft,g.y=S.y+o.clientTop}const _=f&&!d&&!m?Vw(f,c):ps(0);return{width:s.width*h.x,height:s.height*h.y,x:s.x*h.x-c.scrollLeft*h.x+g.x+_.x,y:s.y*h.y-c.scrollTop*h.y+g.y+_.y}}function KM(e){return Array.from(e.getClientRects())}function GM(e){const t=gs(e),s=Xc(e),o=e.ownerDocument.body,l=kr(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),m=kr(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let f=-s.scrollLeft+Jc(e);const a=-s.scrollTop;return rs(o).direction==="rtl"&&(f+=kr(t.clientWidth,o.clientWidth)-l),{width:l,height:m,x:f,y:a}}const Ay=25;function qM(e,t){const s=jr(e),o=gs(e),l=s.visualViewport;let m=o.clientWidth,f=o.clientHeight,a=0,c=0;if(l){m=l.width,f=l.height;const g=xp();(!g||g&&t==="fixed")&&(a=l.offsetLeft,c=l.offsetTop)}const h=Jc(o);if(h<=0){const g=o.ownerDocument,d=g.body,_=getComputedStyle(d),S=g.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,E=Math.abs(o.clientWidth-d.clientWidth-S);E<=Ay&&(m-=E)}else h<=Ay&&(m+=h);return{width:m,height:f,x:a,y:c}}const YM=new Set(["absolute","fixed"]);function XM(e,t){const s=Yn(e,!0,t==="fixed"),o=s.top+e.clientTop,l=s.left+e.clientLeft,m=ms(e)?Hi(e):ps(1),f=e.clientWidth*m.x,a=e.clientHeight*m.y,c=l*m.x,h=o*m.y;return{width:f,height:a,x:c,y:h}}function Dy(e,t,s){let o;if(t==="viewport")o=qM(e,s);else if(t==="document")o=GM(gs(e));else if(ts(t))o=XM(t,s);else{const l=Hw(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return wc(o)}function zw(e,t){const s=_n(e);return s===t||!ts(s)||qi(s)?!1:rs(s).position==="fixed"||zw(s,t)}function JM(e,t){const s=t.get(e);if(s)return s;let o=ha(e,[],!1).filter(a=>ts(a)&&io(a)!=="body"),l=null;const m=rs(e).position==="fixed";let f=m?_n(e):e;for(;ts(f)&&!qi(f);){const a=rs(f),c=yp(f);!c&&a.position==="fixed"&&(l=null),(m?!c&&!l:!c&&a.position==="static"&&!!l&&YM.has(l.position)||ja(f)&&!c&&zw(e,f))?o=o.filter(g=>g!==f):l=a,f=_n(f)}return t.set(e,o),o}function QM(e){let{element:t,boundary:s,rootBoundary:o,strategy:l}=e;const f=[...s==="clippingAncestors"?Yc(t)?[]:JM(t,this._c):[].concat(s),o],a=f[0],c=f.reduce((h,g)=>{const d=Dy(t,g,l);return h.top=kr(d.top,h.top),h.right=xn(d.right,h.right),h.bottom=xn(d.bottom,h.bottom),h.left=kr(d.left,h.left),h},Dy(t,a,l));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ZM(e){const{width:t,height:s}=$w(e);return{width:t,height:s}}function e4(e,t,s){const o=ms(t),l=gs(t),m=s==="fixed",f=Yn(e,!0,m,t);let a={scrollLeft:0,scrollTop:0};const c=ps(0);function h(){c.x=Jc(l)}if(o||!o&&!m)if((io(t)!=="body"||ja(l))&&(a=Xc(t)),o){const S=Yn(t,!0,m,t);c.x=S.x+t.clientLeft,c.y=S.y+t.clientTop}else l&&h();m&&!o&&l&&h();const g=l&&!o&&!m?Vw(l,a):ps(0),d=f.left+a.scrollLeft-c.x-g.x,_=f.top+a.scrollTop-c.y-g.y;return{x:d,y:_,width:f.width,height:f.height}}function _h(e){return rs(e).position==="static"}function My(e,t){if(!ms(e)||rs(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return gs(e)===s&&(s=s.ownerDocument.body),s}function Ww(e,t){const s=jr(e);if(Yc(e))return s;if(!ms(e)){let l=_n(e);for(;l&&!qi(l);){if(ts(l)&&!_h(l))return l;l=_n(l)}return s}let o=My(e,t);for(;o&&OM(o)&&_h(o);)o=My(o,t);return o&&qi(o)&&_h(o)&&!yp(o)?s:o||HM(e)||s}const t4=async function(e){const t=this.getOffsetParent||Ww,s=this.getDimensions,o=await s(e.floating);return{reference:e4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function r4(e){return rs(e).direction==="rtl"}const s4={convertOffsetParentRelativeRectToViewportRelativeRect:UM,getDocumentElement:gs,getClippingRect:QM,getOffsetParent:Ww,getElementRects:t4,getClientRects:KM,getDimensions:ZM,getScale:Hi,isElement:ts,isRTL:r4};function Uw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function n4(e,t){let s=null,o;const l=gs(e);function m(){var a;clearTimeout(o),(a=s)==null||a.disconnect(),s=null}function f(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),m();const h=e.getBoundingClientRect(),{left:g,top:d,width:_,height:S}=h;if(a||t(),!_||!S)return;const E=Yl(d),b=Yl(l.clientWidth-(g+_)),v=Yl(l.clientHeight-(d+S)),y=Yl(g),x={rootMargin:-E+"px "+-b+"px "+-v+"px "+-y+"px",threshold:kr(0,xn(1,c))||1};let k=!0;function P(T){const R=T[0].intersectionRatio;if(R!==c){if(!k)return f();R?f(!1,R):o=setTimeout(()=>{f(!1,1e-7)},1e3)}R===1&&!Uw(h,e.getBoundingClientRect())&&f(),k=!1}try{s=new IntersectionObserver(P,{...x,root:l.ownerDocument})}catch{s=new IntersectionObserver(P,x)}s.observe(e)}return f(!0),m}function i4(e,t,s,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:m=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,h=_p(e),g=l||m?[...h?ha(h):[],...ha(t)]:[];g.forEach(y=>{l&&y.addEventListener("scroll",s,{passive:!0}),m&&y.addEventListener("resize",s)});const d=h&&a?n4(h,s):null;let _=-1,S=null;f&&(S=new ResizeObserver(y=>{let[p]=y;p&&p.target===h&&S&&(S.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var x;(x=S)==null||x.observe(t)})),s()}),h&&!c&&S.observe(h),S.observe(t));let E,b=c?Yn(e):null;c&&v();function v(){const y=Yn(e);b&&!Uw(b,y)&&s(),b=y,E=requestAnimationFrame(v)}return s(),()=>{var y;g.forEach(p=>{l&&p.removeEventListener("scroll",s),m&&p.removeEventListener("resize",s)}),d==null||d(),(y=S)==null||y.disconnect(),S=null,c&&cancelAnimationFrame(E)}}const o4=RM,a4=TM,l4=jM,c4=DM,d4=NM,Ly=EM,u4=AM,h4=(e,t,s)=>{const o=new Map,l={platform:s4,...s},m={...l.platform,_c:o};return kM(e,t,{...l,platform:m})};var f4=typeof document<"u",p4=function(){},nc=f4?C.useLayoutEffect:p4;function bc(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 s,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(o=s;o--!==0;)if(!bc(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=s;o--!==0;){const m=l[o];if(!(m==="_owner"&&e.$$typeof)&&!bc(e[m],t[m]))return!1}return!0}return e!==e&&t!==t}function Kw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oy(e,t){const s=Kw(e);return Math.round(t*s)/s}function wh(e){const t=C.useRef(e);return nc(()=>{t.current=e}),t}function m4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:o=[],platform:l,elements:{reference:m,floating:f}={},transform:a=!0,whileElementsMounted:c,open:h}=e,[g,d]=C.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[_,S]=C.useState(o);bc(_,o)||S(o);const[E,b]=C.useState(null),[v,y]=C.useState(null),p=C.useCallback(W=>{W!==T.current&&(T.current=W,b(W))},[]),x=C.useCallback(W=>{W!==R.current&&(R.current=W,y(W))},[]),k=m||E,P=f||v,T=C.useRef(null),R=C.useRef(null),j=C.useRef(g),M=c!=null,$=wh(c),F=wh(l),U=wh(h),H=C.useCallback(()=>{if(!T.current||!R.current)return;const W={placement:t,strategy:s,middleware:_};F.current&&(W.platform=F.current),h4(T.current,R.current,W).then(D=>{const B={...D,isPositioned:U.current!==!1};Q.current&&!bc(j.current,B)&&(j.current=B,va.flushSync(()=>{d(B)}))})},[_,t,s,F,U]);nc(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,d(W=>({...W,isPositioned:!1})))},[h]);const Q=C.useRef(!1);nc(()=>(Q.current=!0,()=>{Q.current=!1}),[]),nc(()=>{if(k&&(T.current=k),P&&(R.current=P),k&&P){if($.current)return $.current(k,P,H);H()}},[k,P,H,$,M]);const V=C.useMemo(()=>({reference:T,floating:R,setReference:p,setFloating:x}),[p,x]),K=C.useMemo(()=>({reference:k,floating:P}),[k,P]),J=C.useMemo(()=>{const W={position:s,left:0,top:0};if(!K.floating)return W;const D=Oy(K.floating,g.x),B=Oy(K.floating,g.y);return a?{...W,transform:"translate("+D+"px, "+B+"px)",...Kw(K.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:D,top:B}},[s,a,K.floating,g.x,g.y]);return C.useMemo(()=>({...g,update:H,refs:V,elements:K,floatingStyles:J}),[g,H,V,K,J])}const g4=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:o,padding:l}=typeof e=="function"?e(s):e;return o&&t(o)?o.current!=null?Ly({element:o.current,padding:l}).fn(s):{}:o?Ly({element:o,padding:l}).fn(s):{}}}},v4=(e,t)=>({...o4(e),options:[e,t]}),y4=(e,t)=>({...a4(e),options:[e,t]}),x4=(e,t)=>({...u4(e),options:[e,t]}),_4=(e,t)=>({...l4(e),options:[e,t]}),w4=(e,t)=>({...c4(e),options:[e,t]}),b4=(e,t)=>({...d4(e),options:[e,t]}),S4=(e,t)=>({...g4(e),options:[e,t]});var C4="Arrow",Gw=C.forwardRef((e,t)=>{const{children:s,width:o=10,height:l=5,...m}=e;return i.jsx(Oe.svg,{...m,ref:t,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});Gw.displayName=C4;var k4=Gw,wp="Popper",[qw,oo]=yr(wp),[E4,Yw]=qw(wp),Xw=e=>{const{__scopePopper:t,children:s}=e,[o,l]=C.useState(null);return i.jsx(E4,{scope:t,anchor:o,onAnchorChange:l,children:s})};Xw.displayName=wp;var Jw="PopperAnchor",Qw=C.forwardRef((e,t)=>{const{__scopePopper:s,virtualRef:o,...l}=e,m=Yw(Jw,s),f=C.useRef(null),a=ze(t,f),c=C.useRef(null);return C.useEffect(()=>{const h=c.current;c.current=(o==null?void 0:o.current)||f.current,h!==c.current&&m.onAnchorChange(c.current)}),o?null:i.jsx(Oe.div,{...l,ref:a})});Qw.displayName=Jw;var bp="PopperContent",[j4,N4]=qw(bp),Zw=C.forwardRef((e,t)=>{var G,O,Z,X,q,re;const{__scopePopper:s,side:o="bottom",sideOffset:l=0,align:m="center",alignOffset:f=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:d="partial",hideWhenDetached:_=!1,updatePositionStrategy:S="optimized",onPlaced:E,...b}=e,v=Yw(bp,s),[y,p]=C.useState(null),x=ze(t,he=>p(he)),[k,P]=C.useState(null),T=up(k),R=(T==null?void 0:T.width)??0,j=(T==null?void 0:T.height)??0,M=o+(m!=="center"?"-"+m:""),$=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},F=Array.isArray(h)?h:[h],U=F.length>0,H={padding:$,boundary:F.filter(R4),altBoundary:U},{refs:Q,floatingStyles:V,placement:K,isPositioned:J,middlewareData:W}=m4({strategy:"fixed",placement:M,whileElementsMounted:(...he)=>i4(...he,{animationFrame:S==="always"}),elements:{reference:v.anchor},middleware:[v4({mainAxis:l+j,alignmentAxis:f}),c&&y4({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?x4():void 0,...H}),c&&_4({...H}),w4({...H,apply:({elements:he,rects:Te,availableWidth:Be,availableHeight:Ke})=>{const{width:je,height:zt}=Te.reference,et=he.floating.style;et.setProperty("--radix-popper-available-width",`${Be}px`),et.setProperty("--radix-popper-available-height",`${Ke}px`),et.setProperty("--radix-popper-anchor-width",`${je}px`),et.setProperty("--radix-popper-anchor-height",`${zt}px`)}}),k&&S4({element:k,padding:a}),T4({arrowWidth:R,arrowHeight:j}),_&&b4({strategy:"referenceHidden",...H})]}),[D,B]=rb(K),L=Mt(E);Lt(()=>{J&&(L==null||L())},[J,L]);const z=(G=W.arrow)==null?void 0:G.x,ee=(O=W.arrow)==null?void 0:O.y,ne=((Z=W.arrow)==null?void 0:Z.centerOffset)!==0,[ce,de]=C.useState();return Lt(()=>{y&&de(window.getComputedStyle(y).zIndex)},[y]),i.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:J?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(X=W.transformOrigin)==null?void 0:X.x,(q=W.transformOrigin)==null?void 0:q.y].join(" "),...((re=W.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(j4,{scope:s,placedSide:D,onArrowChange:P,arrowX:z,arrowY:ee,shouldHideArrow:ne,children:i.jsx(Oe.div,{"data-side":D,"data-align":B,...b,ref:x,style:{...b.style,animation:J?void 0:"none"}})})})});Zw.displayName=bp;var eb="PopperArrow",P4={top:"bottom",right:"left",bottom:"top",left:"right"},tb=C.forwardRef(function(t,s){const{__scopePopper:o,...l}=t,m=N4(eb,o),f=P4[m.placedSide];return i.jsx("span",{ref:m.onArrowChange,style:{position:"absolute",left:m.arrowX,top:m.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[m.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[m.placedSide],visibility:m.shouldHideArrow?"hidden":void 0},children:i.jsx(k4,{...l,ref:s,style:{...l.style,display:"block"}})})});tb.displayName=eb;function R4(e){return e!==null}var T4=e=>({name:"transformOrigin",options:e,fn(t){var v,y,p;const{placement:s,rects:o,middlewareData:l}=t,f=((v=l.arrow)==null?void 0:v.centerOffset)!==0,a=f?0:e.arrowWidth,c=f?0:e.arrowHeight,[h,g]=rb(s),d={start:"0%",center:"50%",end:"100%"}[g],_=(((y=l.arrow)==null?void 0:y.x)??0)+a/2,S=(((p=l.arrow)==null?void 0:p.y)??0)+c/2;let E="",b="";return h==="bottom"?(E=f?d:`${_}px`,b=`${-c}px`):h==="top"?(E=f?d:`${_}px`,b=`${o.floating.height+c}px`):h==="right"?(E=`${-c}px`,b=f?d:`${S}px`):h==="left"&&(E=`${o.floating.width+c}px`,b=f?d:`${S}px`),{data:{x:E,y:b}}}});function rb(e){const[t,s="center"]=e.split("-");return[t,s]}var Qc=Xw,Sp=Qw,Cp=Zw,kp=tb,A4="Portal",Na=C.forwardRef((e,t)=>{var a;const{container:s,...o}=e,[l,m]=C.useState(!1);Lt(()=>m(!0),[]);const f=s||l&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return f?ex.createPortal(i.jsx(Oe.div,{...o,ref:t}),f):null});Na.displayName=A4;function D4(e){const t=M4(e),s=C.forwardRef((o,l)=>{const{children:m,...f}=o,a=C.Children.toArray(m),c=a.find(O4);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return i.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return i.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function M4(e){const t=C.forwardRef((s,o)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=B4(l),a=I4(m,l.props);return l.type!==C.Fragment&&(a.ref=o?Bs(o,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var L4=Symbol("radix.slottable");function O4(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===L4}function I4(e,t){const s={...t};for(const o in t){const l=e[o],m=t[o];/^on[A-Z]/.test(o)?l&&m?s[o]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[o]=l):o==="style"?s[o]={...l,...m}:o==="className"&&(s[o]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function B4(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var sb=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"}),F4="VisuallyHidden",nb=C.forwardRef((e,t)=>i.jsx(Oe.span,{...e,ref:t,style:{...sb,...e.style}}));nb.displayName=F4;var $4=nb,H4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Di=new WeakMap,Xl=new WeakMap,Jl={},bh=0,ib=function(e){return e&&(e.host||ib(e.parentNode))},V4=function(e,t){return t.map(function(s){if(e.contains(s))return s;var o=ib(s);return o&&e.contains(o)?o:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},z4=function(e,t,s,o){var l=V4(t,Array.isArray(e)?e:[e]);Jl[s]||(Jl[s]=new WeakMap);var m=Jl[s],f=[],a=new Set,c=new Set(l),h=function(d){!d||a.has(d)||(a.add(d),h(d.parentNode))};l.forEach(h);var g=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(_){if(a.has(_))g(_);else try{var S=_.getAttribute(o),E=S!==null&&S!=="false",b=(Di.get(_)||0)+1,v=(m.get(_)||0)+1;Di.set(_,b),m.set(_,v),f.push(_),b===1&&E&&Xl.set(_,!0),v===1&&_.setAttribute(s,"true"),E||_.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",_,y)}})};return g(t),a.clear(),bh++,function(){f.forEach(function(d){var _=Di.get(d)-1,S=m.get(d)-1;Di.set(d,_),m.set(d,S),_||(Xl.has(d)||d.removeAttribute(o),Xl.delete(d)),S||d.removeAttribute(s)}),bh--,bh||(Di=new WeakMap,Di=new WeakMap,Xl=new WeakMap,Jl={})}},Ep=function(e,t,s){s===void 0&&(s="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=H4(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),z4(o,l,s,"aria-hidden")):function(){return null}},ds=function(){return ds=Object.assign||function(t){for(var s,o=1,l=arguments.length;o<l;o++){s=arguments[o];for(var m in s)Object.prototype.hasOwnProperty.call(s,m)&&(t[m]=s[m])}return t},ds.apply(this,arguments)};function ob(e,t){var s={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(s[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(s[o[l]]=e[o[l]]);return s}function W4(e,t,s){if(s||arguments.length===2)for(var o=0,l=t.length,m;o<l;o++)(m||!(o in t))&&(m||(m=Array.prototype.slice.call(t,0,o)),m[o]=t[o]);return e.concat(m||Array.prototype.slice.call(t))}var ic="right-scroll-bar-position",oc="width-before-scroll-bar",U4="with-scroll-bars-hidden",K4="--removed-body-scroll-bar-size";function Sh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function G4(e,t){var s=C.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(o){var l=s.value;l!==o&&(s.value=o,s.callback(o,l))}}}})[0];return s.callback=t,s.facade}var q4=typeof window<"u"?C.useLayoutEffect:C.useEffect,Iy=new WeakMap;function Y4(e,t){var s=G4(null,function(o){return e.forEach(function(l){return Sh(l,o)})});return q4(function(){var o=Iy.get(s);if(o){var l=new Set(o),m=new Set(e),f=s.current;l.forEach(function(a){m.has(a)||Sh(a,null)}),m.forEach(function(a){l.has(a)||Sh(a,f)})}Iy.set(s,e)},[e]),s}function X4(e){return e}function J4(e,t){t===void 0&&(t=X4);var s=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(m){var f=t(m,o);return s.push(f),function(){s=s.filter(function(a){return a!==f})}},assignSyncMedium:function(m){for(o=!0;s.length;){var f=s;s=[],f.forEach(m)}s={push:function(a){return m(a)},filter:function(){return s}}},assignMedium:function(m){o=!0;var f=[];if(s.length){var a=s;s=[],a.forEach(m),f=s}var c=function(){var g=f;f=[],g.forEach(m)},h=function(){return Promise.resolve().then(c)};h(),s={push:function(g){f.push(g),h()},filter:function(g){return f=f.filter(g),s}}}};return l}function Q4(e){e===void 0&&(e={});var t=J4(null);return t.options=ds({async:!0,ssr:!1},e),t}var ab=function(e){var t=e.sideCar,s=ob(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return C.createElement(o,ds({},s))};ab.isSideCarExport=!0;function Z4(e,t){return e.useMedium(t),ab}var lb=Q4(),Ch=function(){},Zc=C.forwardRef(function(e,t){var s=C.useRef(null),o=C.useState({onScrollCapture:Ch,onWheelCapture:Ch,onTouchMoveCapture:Ch}),l=o[0],m=o[1],f=e.forwardProps,a=e.children,c=e.className,h=e.removeScrollBar,g=e.enabled,d=e.shards,_=e.sideCar,S=e.noRelative,E=e.noIsolation,b=e.inert,v=e.allowPinchZoom,y=e.as,p=y===void 0?"div":y,x=e.gapMode,k=ob(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=_,T=Y4([s,t]),R=ds(ds({},k),l);return C.createElement(C.Fragment,null,g&&C.createElement(P,{sideCar:lb,removeScrollBar:h,shards:d,noRelative:S,noIsolation:E,inert:b,setCallbacks:m,allowPinchZoom:!!v,lockRef:s,gapMode:x}),f?C.cloneElement(C.Children.only(a),ds(ds({},R),{ref:T})):C.createElement(p,ds({},R,{className:c,ref:T}),a))});Zc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zc.classNames={fullWidth:oc,zeroRight:ic};var e5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function t5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=e5();return t&&e.setAttribute("nonce",t),e}function r5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function s5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var n5=function(){var e=0,t=null;return{add:function(s){e==0&&(t=t5())&&(r5(t,s),s5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},i5=function(){var e=n5();return function(t,s){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},cb=function(){var e=i5(),t=function(s){var o=s.styles,l=s.dynamic;return e(o,l),null};return t},o5={left:0,top:0,right:0,gap:0},kh=function(e){return parseInt(e||"",10)||0},a5=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[kh(s),kh(o),kh(l)]},l5=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return o5;var t=a5(e),s=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-s+t[2]-t[0])}},c5=cb(),Vi="data-scroll-locked",d5=function(e,t,s,o){var l=e.left,m=e.top,f=e.right,a=e.gap;return s===void 0&&(s="margin"),`
|
|
409
|
+
.`.concat(U4,` {
|
|
410
|
+
overflow: hidden `).concat(o,`;
|
|
411
|
+
padding-right: `).concat(a,"px ").concat(o,`;
|
|
412
|
+
}
|
|
413
|
+
body[`).concat(Vi,`] {
|
|
414
|
+
overflow: hidden `).concat(o,`;
|
|
415
|
+
overscroll-behavior: contain;
|
|
416
|
+
`).concat([t&&"position: relative ".concat(o,";"),s==="margin"&&`
|
|
417
|
+
padding-left: `.concat(l,`px;
|
|
418
|
+
padding-top: `).concat(m,`px;
|
|
419
|
+
padding-right: `).concat(f,`px;
|
|
420
|
+
margin-left:0;
|
|
421
|
+
margin-top:0;
|
|
422
|
+
margin-right: `).concat(a,"px ").concat(o,`;
|
|
423
|
+
`),s==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.`).concat(ic,` {
|
|
427
|
+
right: `).concat(a,"px ").concat(o,`;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.`).concat(oc,` {
|
|
431
|
+
margin-right: `).concat(a,"px ").concat(o,`;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.`).concat(ic," .").concat(ic,` {
|
|
435
|
+
right: 0 `).concat(o,`;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.`).concat(oc," .").concat(oc,` {
|
|
439
|
+
margin-right: 0 `).concat(o,`;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
body[`).concat(Vi,`] {
|
|
443
|
+
`).concat(K4,": ").concat(a,`px;
|
|
444
|
+
}
|
|
445
|
+
`)},By=function(){var e=parseInt(document.body.getAttribute(Vi)||"0",10);return isFinite(e)?e:0},u5=function(){C.useEffect(function(){return document.body.setAttribute(Vi,(By()+1).toString()),function(){var e=By()-1;e<=0?document.body.removeAttribute(Vi):document.body.setAttribute(Vi,e.toString())}},[])},h5=function(e){var t=e.noRelative,s=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;u5();var m=C.useMemo(function(){return l5(l)},[l]);return C.createElement(c5,{styles:d5(m,!t,l,s?"":"!important")})},nf=!1;if(typeof window<"u")try{var Ql=Object.defineProperty({},"passive",{get:function(){return nf=!0,!0}});window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{nf=!1}var Mi=nf?{passive:!1}:!1,f5=function(e){return e.tagName==="TEXTAREA"},db=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!f5(e)&&s[t]==="visible")},p5=function(e){return db(e,"overflowY")},m5=function(e){return db(e,"overflowX")},Fy=function(e,t){var s=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=ub(e,o);if(l){var m=hb(e,o),f=m[1],a=m[2];if(f>a)return!0}o=o.parentNode}while(o&&o!==s.body);return!1},g5=function(e){var t=e.scrollTop,s=e.scrollHeight,o=e.clientHeight;return[t,s,o]},v5=function(e){var t=e.scrollLeft,s=e.scrollWidth,o=e.clientWidth;return[t,s,o]},ub=function(e,t){return e==="v"?p5(t):m5(t)},hb=function(e,t){return e==="v"?g5(t):v5(t)},y5=function(e,t){return e==="h"&&t==="rtl"?-1:1},x5=function(e,t,s,o,l){var m=y5(e,window.getComputedStyle(t).direction),f=m*o,a=s.target,c=t.contains(a),h=!1,g=f>0,d=0,_=0;do{if(!a)break;var S=hb(e,a),E=S[0],b=S[1],v=S[2],y=b-v-m*E;(E||y)&&ub(e,a)&&(d+=y,_+=E);var p=a.parentNode;a=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(g&&Math.abs(d)<1||!g&&Math.abs(_)<1)&&(h=!0),h},Zl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$y=function(e){return[e.deltaX,e.deltaY]},Hy=function(e){return e&&"current"in e?e.current:e},_5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},w5=function(e){return`
|
|
446
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
447
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
448
|
+
`)},b5=0,Li=[];function S5(e){var t=C.useRef([]),s=C.useRef([0,0]),o=C.useRef(),l=C.useState(b5++)[0],m=C.useState(cb)[0],f=C.useRef(e);C.useEffect(function(){f.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var b=W4([e.lockRef.current],(e.shards||[]).map(Hy),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!f.current.allowPinchZoom;var y=Zl(b),p=s.current,x="deltaX"in b?b.deltaX:p[0]-y[0],k="deltaY"in b?b.deltaY:p[1]-y[1],P,T=b.target,R=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in b&&R==="h"&&T.type==="range")return!1;var j=window.getSelection(),M=j&&j.anchorNode,$=M?M===T||M.contains(T):!1;if($)return!1;var F=Fy(R,T);if(!F)return!0;if(F?P=R:(P=R==="v"?"h":"v",F=Fy(R,T)),!F)return!1;if(!o.current&&"changedTouches"in b&&(x||k)&&(o.current=P),!P)return!0;var U=o.current||P;return x5(U,v,b,U==="h"?x:k)},[]),c=C.useCallback(function(b){var v=b;if(!(!Li.length||Li[Li.length-1]!==m)){var y="deltaY"in v?$y(v):Zl(v),p=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&_5(P.delta,y)})[0];if(p&&p.should){v.cancelable&&v.preventDefault();return}if(!p){var x=(f.current.shards||[]).map(Hy).filter(Boolean).filter(function(P){return P.contains(v.target)}),k=x.length>0?a(v,x[0]):!f.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),h=C.useCallback(function(b,v,y,p){var x={name:b,delta:v,target:y,should:p,shadowParent:C5(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),g=C.useCallback(function(b){s.current=Zl(b),o.current=void 0},[]),d=C.useCallback(function(b){h(b.type,$y(b),b.target,a(b,e.lockRef.current))},[]),_=C.useCallback(function(b){h(b.type,Zl(b),b.target,a(b,e.lockRef.current))},[]);C.useEffect(function(){return Li.push(m),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:_}),document.addEventListener("wheel",c,Mi),document.addEventListener("touchmove",c,Mi),document.addEventListener("touchstart",g,Mi),function(){Li=Li.filter(function(b){return b!==m}),document.removeEventListener("wheel",c,Mi),document.removeEventListener("touchmove",c,Mi),document.removeEventListener("touchstart",g,Mi)}},[]);var S=e.removeScrollBar,E=e.inert;return C.createElement(C.Fragment,null,E?C.createElement(m,{styles:w5(l)}):null,S?C.createElement(h5,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function C5(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const k5=Z4(lb,S5);var ed=C.forwardRef(function(e,t){return C.createElement(Zc,ds({},e,{ref:t,sideCar:k5}))});ed.classNames=Zc.classNames;var E5=[" ","Enter","ArrowUp","ArrowDown"],j5=[" ","Enter"],Xn="Select",[td,rd,N5]=hp(Xn),[ao]=yr(Xn,[N5,oo]),sd=oo(),[P5,Sn]=ao(Xn),[R5,T5]=ao(Xn),fb=e=>{const{__scopeSelect:t,children:s,open:o,defaultOpen:l,onOpenChange:m,value:f,defaultValue:a,onValueChange:c,dir:h,name:g,autoComplete:d,disabled:_,required:S,form:E}=e,b=sd(t),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,P]=C.useState(!1),T=Sa(h),[R,j]=es({prop:o,defaultProp:l??!1,onChange:m,caller:Xn}),[M,$]=es({prop:f,defaultProp:a,onChange:c,caller:Xn}),F=C.useRef(null),U=v?E||!!v.closest("form"):!0,[H,Q]=C.useState(new Set),V=Array.from(H).map(K=>K.props.value).join(";");return i.jsx(Qc,{...b,children:i.jsxs(P5,{required:S,scope:t,trigger:v,onTriggerChange:y,valueNode:p,onValueNodeChange:x,valueNodeHasChildren:k,onValueNodeHasChildrenChange:P,contentId:vr(),value:M,onValueChange:$,open:R,onOpenChange:j,dir:T,triggerPointerDownPosRef:F,disabled:_,children:[i.jsx(td.Provider,{scope:t,children:i.jsx(R5,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(K=>{Q(J=>new Set(J).add(K))},[]),onNativeOptionRemove:C.useCallback(K=>{Q(J=>{const W=new Set(J);return W.delete(K),W})},[]),children:s})}),U?i.jsxs(Ib,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:d,value:M,onChange:K=>$(K.target.value),disabled:_,form:E,children:[M===void 0?i.jsx("option",{value:""}):null,Array.from(H)]},V):null]})})};fb.displayName=Xn;var pb="SelectTrigger",mb=C.forwardRef((e,t)=>{const{__scopeSelect:s,disabled:o=!1,...l}=e,m=sd(s),f=Sn(pb,s),a=f.disabled||o,c=ze(t,f.onTriggerChange),h=rd(s),g=C.useRef("touch"),[d,_,S]=Fb(b=>{const v=h().filter(x=>!x.disabled),y=v.find(x=>x.value===f.value),p=$b(v,b,y);p!==void 0&&f.onValueChange(p.value)}),E=b=>{a||(f.onOpenChange(!0),S()),b&&(f.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return i.jsx(Sp,{asChild:!0,...m,children:i.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Bb(f.value)?"":void 0,...l,ref:c,onClick:ye(l.onClick,b=>{b.currentTarget.focus(),g.current!=="mouse"&&E(b)}),onPointerDown:ye(l.onPointerDown,b=>{g.current=b.pointerType;const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(E(b),b.preventDefault())}),onKeyDown:ye(l.onKeyDown,b=>{const v=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&_(b.key),!(v&&b.key===" ")&&E5.includes(b.key)&&(E(),b.preventDefault())})})})});mb.displayName=pb;var gb="SelectValue",vb=C.forwardRef((e,t)=>{const{__scopeSelect:s,className:o,style:l,children:m,placeholder:f="",...a}=e,c=Sn(gb,s),{onValueNodeHasChildrenChange:h}=c,g=m!==void 0,d=ze(t,c.onValueNodeChange);return Lt(()=>{h(g)},[h,g]),i.jsx(Oe.span,{...a,ref:d,style:{pointerEvents:"none"},children:Bb(c.value)?i.jsx(i.Fragment,{children:f}):m})});vb.displayName=gb;var A5="SelectIcon",yb=C.forwardRef((e,t)=>{const{__scopeSelect:s,children:o,...l}=e;return i.jsx(Oe.span,{"aria-hidden":!0,...l,ref:t,children:o||"▼"})});yb.displayName=A5;var D5="SelectPortal",xb=e=>i.jsx(Na,{asChild:!0,...e});xb.displayName=D5;var Jn="SelectContent",_b=C.forwardRef((e,t)=>{const s=Sn(Jn,e.__scopeSelect),[o,l]=C.useState();if(Lt(()=>{l(new DocumentFragment)},[]),!s.open){const m=o;return m?va.createPortal(i.jsx(wb,{scope:e.__scopeSelect,children:i.jsx(td.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),m):null}return i.jsx(bb,{...e,ref:t})});_b.displayName=Jn;var Qr=10,[wb,Cn]=ao(Jn),M5="SelectContentImpl",L5=D4("SelectContent.RemoveScroll"),bb=C.forwardRef((e,t)=>{const{__scopeSelect:s,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:m,onPointerDownOutside:f,side:a,sideOffset:c,align:h,alignOffset:g,arrowPadding:d,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:b,avoidCollisions:v,...y}=e,p=Sn(Jn,s),[x,k]=C.useState(null),[P,T]=C.useState(null),R=ze(t,G=>k(G)),[j,M]=C.useState(null),[$,F]=C.useState(null),U=rd(s),[H,Q]=C.useState(!1),V=C.useRef(!1);C.useEffect(()=>{if(x)return Ep(x)},[x]),pp();const K=C.useCallback(G=>{const[O,...Z]=U().map(re=>re.ref.current),[X]=Z.slice(-1),q=document.activeElement;for(const re of G)if(re===q||(re==null||re.scrollIntoView({block:"nearest"}),re===O&&P&&(P.scrollTop=0),re===X&&P&&(P.scrollTop=P.scrollHeight),re==null||re.focus(),document.activeElement!==q))return},[U,P]),J=C.useCallback(()=>K([j,x]),[K,j,x]);C.useEffect(()=>{H&&J()},[H,J]);const{onOpenChange:W,triggerPointerDownPosRef:D}=p;C.useEffect(()=>{if(x){let G={x:0,y:0};const O=X=>{var q,re;G={x:Math.abs(Math.round(X.pageX)-(((q=D.current)==null?void 0:q.x)??0)),y:Math.abs(Math.round(X.pageY)-(((re=D.current)==null?void 0:re.y)??0))}},Z=X=>{G.x<=10&&G.y<=10?X.preventDefault():x.contains(X.target)||W(!1),document.removeEventListener("pointermove",O),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",Z,{capture:!0})}}},[x,W,D]),C.useEffect(()=>{const G=()=>W(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[W]);const[B,L]=Fb(G=>{const O=U().filter(q=>!q.disabled),Z=O.find(q=>q.ref.current===document.activeElement),X=$b(O,G,Z);X&&setTimeout(()=>X.ref.current.focus())}),z=C.useCallback((G,O,Z)=>{const X=!V.current&&!Z;(p.value!==void 0&&p.value===O||X)&&(M(G),X&&(V.current=!0))},[p.value]),ee=C.useCallback(()=>x==null?void 0:x.focus(),[x]),ne=C.useCallback((G,O,Z)=>{const X=!V.current&&!Z;(p.value!==void 0&&p.value===O||X)&&F(G)},[p.value]),ce=o==="popper"?of:Sb,de=ce===of?{side:a,sideOffset:c,align:h,alignOffset:g,arrowPadding:d,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:b,avoidCollisions:v}:{};return i.jsx(wb,{scope:s,content:x,viewport:P,onViewportChange:T,itemRefCallback:z,selectedItem:j,onItemLeave:ee,itemTextRefCallback:ne,focusSelectedItem:J,selectedItemText:$,position:o,isPositioned:H,searchRef:B,children:i.jsx(ed,{as:L5,allowPinchZoom:!0,children:i.jsx(Gc,{asChild:!0,trapped:p.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ye(l,G=>{var O;(O=p.trigger)==null||O.focus({preventScroll:!0}),G.preventDefault()}),children:i.jsx(Ea,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:G=>G.preventDefault(),...y,...de,onPlaced:()=>Q(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ye(y.onKeyDown,G=>{const O=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!O&&G.key.length===1&&L(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let X=U().filter(q=>!q.disabled).map(q=>q.ref.current);if(["ArrowUp","End"].includes(G.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const q=G.target,re=X.indexOf(q);X=X.slice(re+1)}setTimeout(()=>K(X)),G.preventDefault()}})})})})})})});bb.displayName=M5;var O5="SelectItemAlignedPosition",Sb=C.forwardRef((e,t)=>{const{__scopeSelect:s,onPlaced:o,...l}=e,m=Sn(Jn,s),f=Cn(Jn,s),[a,c]=C.useState(null),[h,g]=C.useState(null),d=ze(t,R=>g(R)),_=rd(s),S=C.useRef(!1),E=C.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:p}=f,x=C.useCallback(()=>{if(m.trigger&&m.valueNode&&a&&h&&b&&v&&y){const R=m.trigger.getBoundingClientRect(),j=h.getBoundingClientRect(),M=m.valueNode.getBoundingClientRect(),$=y.getBoundingClientRect();if(m.dir!=="rtl"){const q=$.left-j.left,re=M.left-q,he=R.left-re,Te=R.width+he,Be=Math.max(Te,j.width),Ke=window.innerWidth-Qr,je=Zh(re,[Qr,Math.max(Qr,Ke-Be)]);a.style.minWidth=Te+"px",a.style.left=je+"px"}else{const q=j.right-$.right,re=window.innerWidth-M.right-q,he=window.innerWidth-R.right-re,Te=R.width+he,Be=Math.max(Te,j.width),Ke=window.innerWidth-Qr,je=Zh(re,[Qr,Math.max(Qr,Ke-Be)]);a.style.minWidth=Te+"px",a.style.right=je+"px"}const F=_(),U=window.innerHeight-Qr*2,H=b.scrollHeight,Q=window.getComputedStyle(h),V=parseInt(Q.borderTopWidth,10),K=parseInt(Q.paddingTop,10),J=parseInt(Q.borderBottomWidth,10),W=parseInt(Q.paddingBottom,10),D=V+K+H+W+J,B=Math.min(v.offsetHeight*5,D),L=window.getComputedStyle(b),z=parseInt(L.paddingTop,10),ee=parseInt(L.paddingBottom,10),ne=R.top+R.height/2-Qr,ce=U-ne,de=v.offsetHeight/2,G=v.offsetTop+de,O=V+K+G,Z=D-O;if(O<=ne){const q=F.length>0&&v===F[F.length-1].ref.current;a.style.bottom="0px";const re=h.clientHeight-b.offsetTop-b.offsetHeight,he=Math.max(ce,de+(q?ee:0)+re+J),Te=O+he;a.style.height=Te+"px"}else{const q=F.length>0&&v===F[0].ref.current;a.style.top="0px";const he=Math.max(ne,V+b.offsetTop+(q?z:0)+de)+Z;a.style.height=he+"px",b.scrollTop=O-ne+b.offsetTop}a.style.margin=`${Qr}px 0`,a.style.minHeight=B+"px",a.style.maxHeight=U+"px",o==null||o(),requestAnimationFrame(()=>S.current=!0)}},[_,m.trigger,m.valueNode,a,h,b,v,y,m.dir,o]);Lt(()=>x(),[x]);const[k,P]=C.useState();Lt(()=>{h&&P(window.getComputedStyle(h).zIndex)},[h]);const T=C.useCallback(R=>{R&&E.current===!0&&(x(),p==null||p(),E.current=!1)},[x,p]);return i.jsx(B5,{scope:s,contentWrapper:a,shouldExpandOnScrollRef:S,onScrollButtonChange:T,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:i.jsx(Oe.div,{...l,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Sb.displayName=O5;var I5="SelectPopperPosition",of=C.forwardRef((e,t)=>{const{__scopeSelect:s,align:o="start",collisionPadding:l=Qr,...m}=e,f=sd(s);return i.jsx(Cp,{...f,...m,ref:t,align:o,collisionPadding:l,style:{boxSizing:"border-box",...m.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)"}})});of.displayName=I5;var[B5,jp]=ao(Jn,{}),af="SelectViewport",Cb=C.forwardRef((e,t)=>{const{__scopeSelect:s,nonce:o,...l}=e,m=Cn(af,s),f=jp(af,s),a=ze(t,m.onViewportChange),c=C.useRef(0);return i.jsxs(i.Fragment,{children:[i.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:o}),i.jsx(td.Slot,{scope:s,children:i.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:ye(l.onScroll,h=>{const g=h.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:_}=f;if(_!=null&&_.current&&d){const S=Math.abs(c.current-g.scrollTop);if(S>0){const E=window.innerHeight-Qr*2,b=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),y=Math.max(b,v);if(y<E){const p=y+S,x=Math.min(E,p),k=p-x;d.style.height=x+"px",d.style.bottom==="0px"&&(g.scrollTop=k>0?k:0,d.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});Cb.displayName=af;var kb="SelectGroup",[F5,$5]=ao(kb),H5=C.forwardRef((e,t)=>{const{__scopeSelect:s,...o}=e,l=vr();return i.jsx(F5,{scope:s,id:l,children:i.jsx(Oe.div,{role:"group","aria-labelledby":l,...o,ref:t})})});H5.displayName=kb;var Eb="SelectLabel",jb=C.forwardRef((e,t)=>{const{__scopeSelect:s,...o}=e,l=$5(Eb,s);return i.jsx(Oe.div,{id:l.id,...o,ref:t})});jb.displayName=Eb;var Sc="SelectItem",[V5,Nb]=ao(Sc),Pb=C.forwardRef((e,t)=>{const{__scopeSelect:s,value:o,disabled:l=!1,textValue:m,...f}=e,a=Sn(Sc,s),c=Cn(Sc,s),h=a.value===o,[g,d]=C.useState(m??""),[_,S]=C.useState(!1),E=ze(t,p=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,p,o,l)}),b=vr(),v=C.useRef("touch"),y=()=>{l||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")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 i.jsx(V5,{scope:s,value:o,disabled:l,textId:b,isSelected:h,onItemTextChange:C.useCallback(p=>{d(x=>x||((p==null?void 0:p.textContent)??"").trim())},[]),children:i.jsx(td.ItemSlot,{scope:s,value:o,disabled:l,textValue:g,children:i.jsx(Oe.div,{role:"option","aria-labelledby":b,"data-highlighted":_?"":void 0,"aria-selected":h&&_,"data-state":h?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:E,onFocus:ye(f.onFocus,()=>S(!0)),onBlur:ye(f.onBlur,()=>S(!1)),onClick:ye(f.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:ye(f.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:ye(f.onPointerDown,p=>{v.current=p.pointerType}),onPointerMove:ye(f.onPointerMove,p=>{var x;v.current=p.pointerType,l?(x=c.onItemLeave)==null||x.call(c):v.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(f.onPointerLeave,p=>{var x;p.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:ye(f.onKeyDown,p=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&p.key===" "||(j5.includes(p.key)&&y(),p.key===" "&&p.preventDefault())})})})})});Pb.displayName=Sc;var Qo="SelectItemText",Rb=C.forwardRef((e,t)=>{const{__scopeSelect:s,className:o,style:l,...m}=e,f=Sn(Qo,s),a=Cn(Qo,s),c=Nb(Qo,s),h=T5(Qo,s),[g,d]=C.useState(null),_=ze(t,y=>d(y),c.onItemTextChange,y=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,y,c.value,c.disabled)}),S=g==null?void 0:g.textContent,E=C.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:S},c.value),[c.disabled,c.value,S]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=h;return Lt(()=>(b(E),()=>v(E)),[b,v,E]),i.jsxs(i.Fragment,{children:[i.jsx(Oe.span,{id:c.textId,...m,ref:_}),c.isSelected&&f.valueNode&&!f.valueNodeHasChildren?va.createPortal(m.children,f.valueNode):null]})});Rb.displayName=Qo;var Tb="SelectItemIndicator",Ab=C.forwardRef((e,t)=>{const{__scopeSelect:s,...o}=e;return Nb(Tb,s).isSelected?i.jsx(Oe.span,{"aria-hidden":!0,...o,ref:t}):null});Ab.displayName=Tb;var lf="SelectScrollUpButton",Db=C.forwardRef((e,t)=>{const s=Cn(lf,e.__scopeSelect),o=jp(lf,e.__scopeSelect),[l,m]=C.useState(!1),f=ze(t,o.onScrollButtonChange);return Lt(()=>{if(s.viewport&&s.isPositioned){let a=function(){const h=c.scrollTop>0;m(h)};const c=s.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[s.viewport,s.isPositioned]),l?i.jsx(Lb,{...e,ref:f,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=s;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Db.displayName=lf;var cf="SelectScrollDownButton",Mb=C.forwardRef((e,t)=>{const s=Cn(cf,e.__scopeSelect),o=jp(cf,e.__scopeSelect),[l,m]=C.useState(!1),f=ze(t,o.onScrollButtonChange);return Lt(()=>{if(s.viewport&&s.isPositioned){let a=function(){const h=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<h;m(g)};const c=s.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[s.viewport,s.isPositioned]),l?i.jsx(Lb,{...e,ref:f,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=s;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Mb.displayName=cf;var Lb=C.forwardRef((e,t)=>{const{__scopeSelect:s,onAutoScroll:o,...l}=e,m=Cn("SelectScrollButton",s),f=C.useRef(null),a=rd(s),c=C.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Lt(()=>{var g;const h=a().find(d=>d.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[a]),i.jsx(Oe.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:ye(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:ye(l.onPointerMove,()=>{var h;(h=m.onItemLeave)==null||h.call(m),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:ye(l.onPointerLeave,()=>{c()})})}),z5="SelectSeparator",Ob=C.forwardRef((e,t)=>{const{__scopeSelect:s,...o}=e;return i.jsx(Oe.div,{"aria-hidden":!0,...o,ref:t})});Ob.displayName=z5;var df="SelectArrow",W5=C.forwardRef((e,t)=>{const{__scopeSelect:s,...o}=e,l=sd(s),m=Sn(df,s),f=Cn(df,s);return m.open&&f.position==="popper"?i.jsx(kp,{...l,...o,ref:t}):null});W5.displayName=df;var U5="SelectBubbleInput",Ib=C.forwardRef(({__scopeSelect:e,value:t,...s},o)=>{const l=C.useRef(null),m=ze(o,l),f=dp(t);return C.useEffect(()=>{const a=l.current;if(!a)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(f!==t&&g){const d=new Event("change",{bubbles:!0});g.call(a,t),a.dispatchEvent(d)}},[f,t]),i.jsx(Oe.select,{...s,style:{...sb,...s.style},ref:m,defaultValue:t})});Ib.displayName=U5;function Bb(e){return e===""||e===void 0}function Fb(e){const t=Mt(e),s=C.useRef(""),o=C.useRef(0),l=C.useCallback(f=>{const a=s.current+f;t(a),(function c(h){s.current=h,window.clearTimeout(o.current),h!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),m=C.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,l,m]}function $b(e,t,s){const l=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,m=s?e.indexOf(s):-1;let f=K5(e,Math.max(m,0));l.length===1&&(f=f.filter(h=>h!==s));const c=f.find(h=>h.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==s?c:void 0}function K5(e,t){return e.map((s,o)=>e[(t+o)%e.length])}var G5=fb,Hb=mb,q5=vb,Y5=yb,X5=xb,Vb=_b,J5=Cb,zb=jb,Wb=Pb,Q5=Rb,Z5=Ab,Ub=Db,Kb=Mb,Gb=Ob;const Yi=G5,Xi=q5,Qn=C.forwardRef(({className:e,children:t,...s},o)=>i.jsxs(Hb,{ref:o,className:xe("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),...s,children:[t,i.jsx(Y5,{asChild:!0,children:i.jsx(to,{className:"h-4 w-4 opacity-50"})})]}));Qn.displayName=Hb.displayName;const qb=C.forwardRef(({className:e,...t},s)=>i.jsx(Ub,{ref:s,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(qR,{className:"h-4 w-4"})}));qb.displayName=Ub.displayName;const Yb=C.forwardRef(({className:e,...t},s)=>i.jsx(Kb,{ref:s,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(to,{className:"h-4 w-4"})}));Yb.displayName=Kb.displayName;const Zn=C.forwardRef(({className:e,children:t,position:s="popper",...o},l)=>i.jsx(X5,{children:i.jsxs(Vb,{ref:l,className:xe("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",s==="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:s,...o,children:[i.jsx(qb,{}),i.jsx(J5,{className:xe("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(Yb,{})]})}));Zn.displayName=Vb.displayName;const e3=C.forwardRef(({className:e,...t},s)=>i.jsx(zb,{ref:s,className:xe("px-2 py-1.5 text-sm font-semibold",e),...t}));e3.displayName=zb.displayName;const pr=C.forwardRef(({className:e,children:t,...s},o)=>i.jsxs(Wb,{ref:o,className:xe("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),...s,children:[i.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(Z5,{children:i.jsx(Rr,{className:"h-4 w-4"})})}),i.jsx(Q5,{children:t})]}));pr.displayName=Wb.displayName;const t3=C.forwardRef(({className:e,...t},s)=>i.jsx(Gb,{ref:s,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));t3.displayName=Gb.displayName;var r3=Symbol("radix.slottable");function s3(e){const t=({children:s})=>i.jsx(i.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=r3,t}var[nd]=yr("Tooltip",[oo]),id=oo(),Xb="TooltipProvider",n3=700,uf="tooltip.open",[i3,Np]=nd(Xb),Jb=e=>{const{__scopeTooltip:t,delayDuration:s=n3,skipDelayDuration:o=300,disableHoverableContent:l=!1,children:m}=e,f=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),i.jsx(i3,{scope:t,isOpenDelayedRef:f,delayDuration:s,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),f.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>f.current=!0,o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(h=>{a.current=h},[]),disableHoverableContent:l,children:m})};Jb.displayName=Xb;var fa="Tooltip",[o3,Pa]=nd(fa),Qb=e=>{const{__scopeTooltip:t,children:s,open:o,defaultOpen:l,onOpenChange:m,disableHoverableContent:f,delayDuration:a}=e,c=Np(fa,e.__scopeTooltip),h=id(t),[g,d]=C.useState(null),_=vr(),S=C.useRef(0),E=f??c.disableHoverableContent,b=a??c.delayDuration,v=C.useRef(!1),[y,p]=es({prop:o,defaultProp:l??!1,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(uf))):c.onClose(),m==null||m(R)},caller:fa}),x=C.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),k=C.useCallback(()=>{window.clearTimeout(S.current),S.current=0,v.current=!1,p(!0)},[p]),P=C.useCallback(()=>{window.clearTimeout(S.current),S.current=0,p(!1)},[p]),T=C.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{v.current=!0,p(!0),S.current=0},b)},[b,p]);return C.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),i.jsx(Qc,{...h,children:i.jsx(o3,{scope:t,contentId:_,open:y,stateAttribute:x,trigger:g,onTriggerChange:d,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?T():k()},[c.isOpenDelayedRef,T,k]),onTriggerLeave:C.useCallback(()=>{E?P():(window.clearTimeout(S.current),S.current=0)},[P,E]),onOpen:k,onClose:P,disableHoverableContent:E,children:s})})};Qb.displayName=fa;var hf="TooltipTrigger",Zb=C.forwardRef((e,t)=>{const{__scopeTooltip:s,...o}=e,l=Pa(hf,s),m=Np(hf,s),f=id(s),a=C.useRef(null),c=ze(t,a,l.onTriggerChange),h=C.useRef(!1),g=C.useRef(!1),d=C.useCallback(()=>h.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),i.jsx(Sp,{asChild:!0,...f,children:i.jsx(Oe.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...o,ref:c,onPointerMove:ye(e.onPointerMove,_=>{_.pointerType!=="touch"&&!g.current&&!m.isPointerInTransitRef.current&&(l.onTriggerEnter(),g.current=!0)}),onPointerLeave:ye(e.onPointerLeave,()=>{l.onTriggerLeave(),g.current=!1}),onPointerDown:ye(e.onPointerDown,()=>{l.open&&l.onClose(),h.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ye(e.onFocus,()=>{h.current||l.onOpen()}),onBlur:ye(e.onBlur,l.onClose),onClick:ye(e.onClick,l.onClose)})})});Zb.displayName=hf;var Pp="TooltipPortal",[a3,l3]=nd(Pp,{forceMount:void 0}),eS=e=>{const{__scopeTooltip:t,forceMount:s,children:o,container:l}=e,m=Pa(Pp,t);return i.jsx(a3,{scope:t,forceMount:s,children:i.jsx(Vt,{present:s||m.open,children:i.jsx(Na,{asChild:!0,container:l,children:o})})})};eS.displayName=Pp;var Ji="TooltipContent",tS=C.forwardRef((e,t)=>{const s=l3(Ji,e.__scopeTooltip),{forceMount:o=s.forceMount,side:l="top",...m}=e,f=Pa(Ji,e.__scopeTooltip);return i.jsx(Vt,{present:o||f.open,children:f.disableHoverableContent?i.jsx(rS,{side:l,...m,ref:t}):i.jsx(c3,{side:l,...m,ref:t})})}),c3=C.forwardRef((e,t)=>{const s=Pa(Ji,e.__scopeTooltip),o=Np(Ji,e.__scopeTooltip),l=C.useRef(null),m=ze(t,l),[f,a]=C.useState(null),{trigger:c,onClose:h}=s,g=l.current,{onPointerInTransitChange:d}=o,_=C.useCallback(()=>{a(null),d(!1)},[d]),S=C.useCallback((E,b)=>{const v=E.currentTarget,y={x:E.clientX,y:E.clientY},p=p3(y,v.getBoundingClientRect()),x=m3(y,p),k=g3(b.getBoundingClientRect()),P=y3([...x,...k]);a(P),d(!0)},[d]);return C.useEffect(()=>()=>_(),[_]),C.useEffect(()=>{if(c&&g){const E=v=>S(v,g),b=v=>S(v,c);return c.addEventListener("pointerleave",E),g.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",E),g.removeEventListener("pointerleave",b)}}},[c,g,S,_]),C.useEffect(()=>{if(f){const E=b=>{const v=b.target,y={x:b.clientX,y:b.clientY},p=(c==null?void 0:c.contains(v))||(g==null?void 0:g.contains(v)),x=!v3(y,f);p?_():x&&(_(),h())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[c,g,f,h,_]),i.jsx(rS,{...e,ref:m})}),[d3,u3]=nd(fa,{isInside:!1}),h3=s3("TooltipContent"),rS=C.forwardRef((e,t)=>{const{__scopeTooltip:s,children:o,"aria-label":l,onEscapeKeyDown:m,onPointerDownOutside:f,...a}=e,c=Pa(Ji,s),h=id(s),{onClose:g}=c;return C.useEffect(()=>(document.addEventListener(uf,g),()=>document.removeEventListener(uf,g)),[g]),C.useEffect(()=>{if(c.trigger){const d=_=>{const S=_.target;S!=null&&S.contains(c.trigger)&&g()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,g]),i.jsx(Ea,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:d=>d.preventDefault(),onDismiss:g,children:i.jsxs(Cp,{"data-state":c.stateAttribute,...h,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(h3,{children:o}),i.jsx(d3,{scope:s,isInside:!0,children:i.jsx($4,{id:c.contentId,role:"tooltip",children:l||o})})]})})});tS.displayName=Ji;var sS="TooltipArrow",f3=C.forwardRef((e,t)=>{const{__scopeTooltip:s,...o}=e,l=id(s);return u3(sS,s).isInside?null:i.jsx(kp,{...l,...o,ref:t})});f3.displayName=sS;function p3(e,t){const s=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),m=Math.abs(t.left-e.x);switch(Math.min(s,o,l,m)){case m:return"left";case l:return"right";case s:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function m3(e,t,s=5){const o=[];switch(t){case"top":o.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":o.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":o.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":o.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return o}function g3(e){const{top:t,right:s,bottom:o,left:l}=e;return[{x:l,y:t},{x:s,y:t},{x:s,y:o},{x:l,y:o}]}function v3(e,t){const{x:s,y:o}=e;let l=!1;for(let m=0,f=t.length-1;m<t.length;f=m++){const a=t[m],c=t[f],h=a.x,g=a.y,d=c.x,_=c.y;g>o!=_>o&&s<(d-h)*(o-g)/(_-g)+h&&(l=!l)}return l}function y3(e){const t=e.slice();return t.sort((s,o)=>s.x<o.x?-1:s.x>o.x?1:s.y<o.y?-1:s.y>o.y?1:0),x3(t)}function x3(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const l=e[o];for(;t.length>=2;){const m=t[t.length-1],f=t[t.length-2];if((m.x-f.x)*(l.y-f.y)>=(m.y-f.y)*(l.x-f.x))t.pop();else break}t.push(l)}t.pop();const s=[];for(let o=e.length-1;o>=0;o--){const l=e[o];for(;s.length>=2;){const m=s[s.length-1],f=s[s.length-2];if((m.x-f.x)*(l.y-f.y)>=(m.y-f.y)*(l.x-f.x))s.pop();else break}s.push(l)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}var _3=Jb,w3=Qb,b3=Zb,S3=eS,nS=tS;const iS=_3,fn=w3,pn=b3,Ms=C.forwardRef(({className:e,sideOffset:t=4,...s},o)=>i.jsx(S3,{children:i.jsx(nS,{ref:o,sideOffset:t,className:xe("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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),...s})}));Ms.displayName=nS.displayName;const C3=Vc("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Cc=C.forwardRef(({className:e,variant:t,...s},o)=>i.jsx("div",{ref:o,role:"alert",className:xe(C3({variant:t}),e),...s}));Cc.displayName="Alert";const k3=C.forwardRef(({className:e,...t},s)=>i.jsx("h5",{ref:s,className:xe("mb-1 font-medium leading-none tracking-tight",e),...t}));k3.displayName="AlertTitle";const kc=C.forwardRef(({className:e,...t},s)=>i.jsx("div",{ref:s,className:xe("text-sm [&_p]:leading-relaxed",e),...t}));kc.displayName="AlertDescription";var od="Collapsible",[E3]=yr(od),[j3,Rp]=E3(od),oS=C.forwardRef((e,t)=>{const{__scopeCollapsible:s,open:o,defaultOpen:l,disabled:m,onOpenChange:f,...a}=e,[c,h]=es({prop:o,defaultProp:l??!1,onChange:f,caller:od});return i.jsx(j3,{scope:s,disabled:m,contentId:vr(),open:c,onOpenToggle:C.useCallback(()=>h(g=>!g),[h]),children:i.jsx(Oe.div,{"data-state":Ap(c),"data-disabled":m?"":void 0,...a,ref:t})})});oS.displayName=od;var aS="CollapsibleTrigger",lS=C.forwardRef((e,t)=>{const{__scopeCollapsible:s,...o}=e,l=Rp(aS,s);return i.jsx(Oe.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":Ap(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...o,ref:t,onClick:ye(e.onClick,l.onOpenToggle)})});lS.displayName=aS;var Tp="CollapsibleContent",cS=C.forwardRef((e,t)=>{const{forceMount:s,...o}=e,l=Rp(Tp,e.__scopeCollapsible);return i.jsx(Vt,{present:s||l.open,children:({present:m})=>i.jsx(N3,{...o,ref:t,present:m})})});cS.displayName=Tp;var N3=C.forwardRef((e,t)=>{const{__scopeCollapsible:s,present:o,children:l,...m}=e,f=Rp(Tp,s),[a,c]=C.useState(o),h=C.useRef(null),g=ze(t,h),d=C.useRef(0),_=d.current,S=C.useRef(0),E=S.current,b=f.open||a,v=C.useRef(b),y=C.useRef(void 0);return C.useEffect(()=>{const p=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(p)},[]),Lt(()=>{const p=h.current;if(p){y.current=y.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const x=p.getBoundingClientRect();d.current=x.height,S.current=x.width,v.current||(p.style.transitionDuration=y.current.transitionDuration,p.style.animationName=y.current.animationName),c(o)}},[f.open,o]),i.jsx(Oe.div,{"data-state":Ap(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!b,...m,ref:g,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:b&&l})});function Ap(e){return e?"open":"closed"}var P3=oS;const R3=P3,T3=lS,A3=cS;function D3(e){const t=M3(e),s=C.forwardRef((o,l)=>{const{children:m,...f}=o,a=C.Children.toArray(m),c=a.find(O3);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return i.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return i.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function M3(e){const t=C.forwardRef((s,o)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=B3(l),a=I3(m,l.props);return l.type!==C.Fragment&&(a.ref=o?Bs(o,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var L3=Symbol("radix.slottable");function O3(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===L3}function I3(e,t){const s={...t};for(const o in t){const l=e[o],m=t[o];/^on[A-Z]/.test(o)?l&&m?s[o]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[o]=l):o==="style"?s[o]={...l,...m}:o==="className"&&(s[o]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function B3(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var ad="Dialog",[dS,uS]=yr(ad),[F3,ss]=dS(ad),hS=e=>{const{__scopeDialog:t,children:s,open:o,defaultOpen:l,onOpenChange:m,modal:f=!0}=e,a=C.useRef(null),c=C.useRef(null),[h,g]=es({prop:o,defaultProp:l??!1,onChange:m,caller:ad});return i.jsx(F3,{scope:t,triggerRef:a,contentRef:c,contentId:vr(),titleId:vr(),descriptionId:vr(),open:h,onOpenChange:g,onOpenToggle:C.useCallback(()=>g(d=>!d),[g]),modal:f,children:s})};hS.displayName=ad;var fS="DialogTrigger",pS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...o}=e,l=ss(fS,s),m=ze(t,l.triggerRef);return i.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Lp(l.open),...o,ref:m,onClick:ye(e.onClick,l.onOpenToggle)})});pS.displayName=fS;var Dp="DialogPortal",[$3,mS]=dS(Dp,{forceMount:void 0}),gS=e=>{const{__scopeDialog:t,forceMount:s,children:o,container:l}=e,m=ss(Dp,t);return i.jsx($3,{scope:t,forceMount:s,children:C.Children.map(o,f=>i.jsx(Vt,{present:s||m.open,children:i.jsx(Na,{asChild:!0,container:l,children:f})}))})};gS.displayName=Dp;var Ec="DialogOverlay",vS=C.forwardRef((e,t)=>{const s=mS(Ec,e.__scopeDialog),{forceMount:o=s.forceMount,...l}=e,m=ss(Ec,e.__scopeDialog);return m.modal?i.jsx(Vt,{present:o||m.open,children:i.jsx(V3,{...l,ref:t})}):null});vS.displayName=Ec;var H3=D3("DialogOverlay.RemoveScroll"),V3=C.forwardRef((e,t)=>{const{__scopeDialog:s,...o}=e,l=ss(Ec,s);return i.jsx(ed,{as:H3,allowPinchZoom:!0,shards:[l.contentRef],children:i.jsx(Oe.div,{"data-state":Lp(l.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),ei="DialogContent",yS=C.forwardRef((e,t)=>{const s=mS(ei,e.__scopeDialog),{forceMount:o=s.forceMount,...l}=e,m=ss(ei,e.__scopeDialog);return i.jsx(Vt,{present:o||m.open,children:m.modal?i.jsx(z3,{...l,ref:t}):i.jsx(W3,{...l,ref:t})})});yS.displayName=ei;var z3=C.forwardRef((e,t)=>{const s=ss(ei,e.__scopeDialog),o=C.useRef(null),l=ze(t,s.contentRef,o);return C.useEffect(()=>{const m=o.current;if(m)return Ep(m)},[]),i.jsx(xS,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,m=>{var f;m.preventDefault(),(f=s.triggerRef.current)==null||f.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,m=>{const f=m.detail.originalEvent,a=f.button===0&&f.ctrlKey===!0;(f.button===2||a)&&m.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,m=>m.preventDefault())})}),W3=C.forwardRef((e,t)=>{const s=ss(ei,e.__scopeDialog),o=C.useRef(!1),l=C.useRef(!1);return i.jsx(xS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:m=>{var f,a;(f=e.onCloseAutoFocus)==null||f.call(e,m),m.defaultPrevented||(o.current||(a=s.triggerRef.current)==null||a.focus(),m.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:m=>{var c,h;(c=e.onInteractOutside)==null||c.call(e,m),m.defaultPrevented||(o.current=!0,m.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=m.target;((h=s.triggerRef.current)==null?void 0:h.contains(f))&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&l.current&&m.preventDefault()}})}),xS=C.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:m,...f}=e,a=ss(ei,s),c=C.useRef(null),h=ze(t,c);return pp(),i.jsxs(i.Fragment,{children:[i.jsx(Gc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:m,children:i.jsx(Ea,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Lp(a.open),...f,ref:h,onDismiss:()=>a.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(K3,{titleId:a.titleId}),i.jsx(q3,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Mp="DialogTitle",_S=C.forwardRef((e,t)=>{const{__scopeDialog:s,...o}=e,l=ss(Mp,s);return i.jsx(Oe.h2,{id:l.titleId,...o,ref:t})});_S.displayName=Mp;var wS="DialogDescription",bS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...o}=e,l=ss(wS,s);return i.jsx(Oe.p,{id:l.descriptionId,...o,ref:t})});bS.displayName=wS;var SS="DialogClose",CS=C.forwardRef((e,t)=>{const{__scopeDialog:s,...o}=e,l=ss(SS,s);return i.jsx(Oe.button,{type:"button",...o,ref:t,onClick:ye(e.onClick,()=>l.onOpenChange(!1))})});CS.displayName=SS;function Lp(e){return e?"open":"closed"}var kS="DialogTitleWarning",[U3,ES]=hD(kS,{contentName:ei,titleName:Mp,docsSlug:"dialog"}),K3=({titleId:e})=>{const t=ES(kS),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
449
|
+
|
|
450
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
451
|
+
|
|
452
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},G3="DialogDescriptionWarning",q3=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ES(G3).contentName}}.`;return C.useEffect(()=>{var m;const l=(m=e.current)==null?void 0:m.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},jS=hS,Y3=pS,NS=gS,Op=vS,Ip=yS,Bp=_S,Fp=bS,$p=CS;const ir=jS,X3=NS,PS=C.forwardRef(({className:e,...t},s)=>i.jsx(Op,{ref:s,className:xe("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}));PS.displayName=Op.displayName;const Qt=C.forwardRef(({className:e,children:t,...s},o)=>i.jsxs(X3,{children:[i.jsx(PS,{}),i.jsxs(Ip,{ref:o,className:xe("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),...s,children:[t,i.jsxs($p,{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:[i.jsx(op,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Qt.displayName=Ip.displayName;const Zt=({className:e,...t})=>i.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Zt.displayName="DialogHeader";const er=({className:e,...t})=>i.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});er.displayName="DialogFooter";const tr=C.forwardRef(({className:e,...t},s)=>i.jsx(Bp,{ref:s,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));tr.displayName=Bp.displayName;const Nr=C.forwardRef(({className:e,...t},s)=>i.jsx(Fp,{ref:s,className:xe("text-sm text-muted-foreground",e),...t}));Nr.displayName=Fp.displayName;function J3(e){const t=Q3(e),s=C.forwardRef((o,l)=>{const{children:m,...f}=o,a=C.Children.toArray(m),c=a.find(eL);if(c){const h=c.props.children,g=a.map(d=>d===c?C.Children.count(h)>1?C.Children.only(null):C.isValidElement(h)?h.props.children:null:d);return i.jsx(t,{...f,ref:l,children:C.isValidElement(h)?C.cloneElement(h,void 0,g):null})}return i.jsx(t,{...f,ref:l,children:m})});return s.displayName=`${e}.Slot`,s}function Q3(e){const t=C.forwardRef((s,o)=>{const{children:l,...m}=s;if(C.isValidElement(l)){const f=rL(l),a=tL(m,l.props);return l.type!==C.Fragment&&(a.ref=o?Bs(o,f):f),C.cloneElement(l,a)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z3=Symbol("radix.slottable");function eL(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z3}function tL(e,t){const s={...t};for(const o in t){const l=e[o],m=t[o];/^on[A-Z]/.test(o)?l&&m?s[o]=(...a)=>{const c=m(...a);return l(...a),c}:l&&(s[o]=l):o==="style"?s[o]={...l,...m}:o==="className"&&(s[o]=[l,m].filter(Boolean).join(" "))}return{...e,...s}}function rL(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var ff=["Enter"," "],sL=["ArrowDown","PageUp","Home"],RS=["ArrowUp","PageDown","End"],nL=[...sL,...RS],iL={ltr:[...ff,"ArrowRight"],rtl:[...ff,"ArrowLeft"]},oL={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ra="Menu",[pa,aL,lL]=hp(Ra),[ai,TS]=yr(Ra,[lL,oo,Wc]),Ta=oo(),AS=Wc(),[DS,kn]=ai(Ra),[cL,Aa]=ai(Ra),MS=e=>{const{__scopeMenu:t,open:s=!1,children:o,dir:l,onOpenChange:m,modal:f=!0}=e,a=Ta(t),[c,h]=C.useState(null),g=C.useRef(!1),d=Mt(m),_=Sa(l);return C.useEffect(()=>{const S=()=>{g.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>g.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),i.jsx(Qc,{...a,children:i.jsx(DS,{scope:t,open:s,onOpenChange:d,content:c,onContentChange:h,children:i.jsx(cL,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:g,dir:_,modal:f,children:o})})})};MS.displayName=Ra;var dL="MenuAnchor",Hp=C.forwardRef((e,t)=>{const{__scopeMenu:s,...o}=e,l=Ta(s);return i.jsx(Sp,{...l,...o,ref:t})});Hp.displayName=dL;var Vp="MenuPortal",[uL,LS]=ai(Vp,{forceMount:void 0}),OS=e=>{const{__scopeMenu:t,forceMount:s,children:o,container:l}=e,m=kn(Vp,t);return i.jsx(uL,{scope:t,forceMount:s,children:i.jsx(Vt,{present:s||m.open,children:i.jsx(Na,{asChild:!0,container:l,children:o})})})};OS.displayName=Vp;var Hr="MenuContent",[hL,zp]=ai(Hr),IS=C.forwardRef((e,t)=>{const s=LS(Hr,e.__scopeMenu),{forceMount:o=s.forceMount,...l}=e,m=kn(Hr,e.__scopeMenu),f=Aa(Hr,e.__scopeMenu);return i.jsx(pa.Provider,{scope:e.__scopeMenu,children:i.jsx(Vt,{present:o||m.open,children:i.jsx(pa.Slot,{scope:e.__scopeMenu,children:f.modal?i.jsx(fL,{...l,ref:t}):i.jsx(pL,{...l,ref:t})})})})}),fL=C.forwardRef((e,t)=>{const s=kn(Hr,e.__scopeMenu),o=C.useRef(null),l=ze(t,o);return C.useEffect(()=>{const m=o.current;if(m)return Ep(m)},[]),i.jsx(Wp,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:ye(e.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),pL=C.forwardRef((e,t)=>{const s=kn(Hr,e.__scopeMenu);return i.jsx(Wp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),mL=J3("MenuContent.ScrollLock"),Wp=C.forwardRef((e,t)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:l,onOpenAutoFocus:m,onCloseAutoFocus:f,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:S,disableOutsideScroll:E,...b}=e,v=kn(Hr,s),y=Aa(Hr,s),p=Ta(s),x=AS(s),k=aL(s),[P,T]=C.useState(null),R=C.useRef(null),j=ze(t,R,v.onContentChange),M=C.useRef(0),$=C.useRef(""),F=C.useRef(0),U=C.useRef(null),H=C.useRef("right"),Q=C.useRef(0),V=E?ed:C.Fragment,K=E?{as:mL,allowPinchZoom:!0}:void 0,J=D=>{var G,O;const B=$.current+D,L=k().filter(Z=>!Z.disabled),z=document.activeElement,ee=(G=L.find(Z=>Z.ref.current===z))==null?void 0:G.textValue,ne=L.map(Z=>Z.textValue),ce=jL(ne,B,ee),de=(O=L.find(Z=>Z.textValue===ce))==null?void 0:O.ref.current;(function Z(X){$.current=X,window.clearTimeout(M.current),X!==""&&(M.current=window.setTimeout(()=>Z(""),1e3))})(B),de&&setTimeout(()=>de.focus())};C.useEffect(()=>()=>window.clearTimeout(M.current),[]),pp();const W=C.useCallback(D=>{var L,z;return H.current===((L=U.current)==null?void 0:L.side)&&PL(D,(z=U.current)==null?void 0:z.area)},[]);return i.jsx(hL,{scope:s,searchRef:$,onItemEnter:C.useCallback(D=>{W(D)&&D.preventDefault()},[W]),onItemLeave:C.useCallback(D=>{var B;W(D)||((B=R.current)==null||B.focus(),T(null))},[W]),onTriggerLeave:C.useCallback(D=>{W(D)&&D.preventDefault()},[W]),pointerGraceTimerRef:F,onPointerGraceIntentChange:C.useCallback(D=>{U.current=D},[]),children:i.jsx(V,{...K,children:i.jsx(Gc,{asChild:!0,trapped:l,onMountAutoFocus:ye(m,D=>{var B;D.preventDefault(),(B=R.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:i.jsx(Ea,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:_,onDismiss:S,children:i.jsx(yw,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:T,onEntryFocus:ye(c,D=>{y.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Cp,{role:"menu","aria-orientation":"vertical","data-state":e1(v.open),"data-radix-menu-content":"",dir:y.dir,...p,...b,ref:j,style:{outline:"none",...b.style},onKeyDown:ye(b.onKeyDown,D=>{const L=D.target.closest("[data-radix-menu-content]")===D.currentTarget,z=D.ctrlKey||D.altKey||D.metaKey,ee=D.key.length===1;L&&(D.key==="Tab"&&D.preventDefault(),!z&&ee&&J(D.key));const ne=R.current;if(D.target!==ne||!nL.includes(D.key))return;D.preventDefault();const de=k().filter(G=>!G.disabled).map(G=>G.ref.current);RS.includes(D.key)&&de.reverse(),kL(de)}),onBlur:ye(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(M.current),$.current="")}),onPointerMove:ye(e.onPointerMove,ma(D=>{const B=D.target,L=Q.current!==D.clientX;if(D.currentTarget.contains(B)&&L){const z=D.clientX>Q.current?"right":"left";H.current=z,Q.current=D.clientX}}))})})})})})})});IS.displayName=Hr;var gL="MenuGroup",Up=C.forwardRef((e,t)=>{const{__scopeMenu:s,...o}=e;return i.jsx(Oe.div,{role:"group",...o,ref:t})});Up.displayName=gL;var vL="MenuLabel",BS=C.forwardRef((e,t)=>{const{__scopeMenu:s,...o}=e;return i.jsx(Oe.div,{...o,ref:t})});BS.displayName=vL;var jc="MenuItem",Vy="menu.itemSelect",ld=C.forwardRef((e,t)=>{const{disabled:s=!1,onSelect:o,...l}=e,m=C.useRef(null),f=Aa(jc,e.__scopeMenu),a=zp(jc,e.__scopeMenu),c=ze(t,m),h=C.useRef(!1),g=()=>{const d=m.current;if(!s&&d){const _=new CustomEvent(Vy,{bubbles:!0,cancelable:!0});d.addEventListener(Vy,S=>o==null?void 0:o(S),{once:!0}),ow(d,_),_.defaultPrevented?h.current=!1:f.onClose()}};return i.jsx(FS,{...l,ref:c,disabled:s,onClick:ye(e.onClick,g),onPointerDown:d=>{var _;(_=e.onPointerDown)==null||_.call(e,d),h.current=!0},onPointerUp:ye(e.onPointerUp,d=>{var _;h.current||(_=d.currentTarget)==null||_.click()}),onKeyDown:ye(e.onKeyDown,d=>{const _=a.searchRef.current!=="";s||_&&d.key===" "||ff.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ld.displayName=jc;var FS=C.forwardRef((e,t)=>{const{__scopeMenu:s,disabled:o=!1,textValue:l,...m}=e,f=zp(jc,s),a=AS(s),c=C.useRef(null),h=ze(t,c),[g,d]=C.useState(!1),[_,S]=C.useState("");return C.useEffect(()=>{const E=c.current;E&&S((E.textContent??"").trim())},[m.children]),i.jsx(pa.ItemSlot,{scope:s,disabled:o,textValue:l??_,children:i.jsx(xw,{asChild:!0,...a,focusable:!o,children:i.jsx(Oe.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...m,ref:h,onPointerMove:ye(e.onPointerMove,ma(E=>{o?f.onItemLeave(E):(f.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(e.onPointerLeave,ma(E=>f.onItemLeave(E))),onFocus:ye(e.onFocus,()=>d(!0)),onBlur:ye(e.onBlur,()=>d(!1))})})})}),yL="MenuCheckboxItem",$S=C.forwardRef((e,t)=>{const{checked:s=!1,onCheckedChange:o,...l}=e;return i.jsx(US,{scope:e.__scopeMenu,checked:s,children:i.jsx(ld,{role:"menuitemcheckbox","aria-checked":Nc(s)?"mixed":s,...l,ref:t,"data-state":qp(s),onSelect:ye(l.onSelect,()=>o==null?void 0:o(Nc(s)?!0:!s),{checkForDefaultPrevented:!1})})})});$S.displayName=yL;var HS="MenuRadioGroup",[xL,_L]=ai(HS,{value:void 0,onValueChange:()=>{}}),VS=C.forwardRef((e,t)=>{const{value:s,onValueChange:o,...l}=e,m=Mt(o);return i.jsx(xL,{scope:e.__scopeMenu,value:s,onValueChange:m,children:i.jsx(Up,{...l,ref:t})})});VS.displayName=HS;var zS="MenuRadioItem",WS=C.forwardRef((e,t)=>{const{value:s,...o}=e,l=_L(zS,e.__scopeMenu),m=s===l.value;return i.jsx(US,{scope:e.__scopeMenu,checked:m,children:i.jsx(ld,{role:"menuitemradio","aria-checked":m,...o,ref:t,"data-state":qp(m),onSelect:ye(o.onSelect,()=>{var f;return(f=l.onValueChange)==null?void 0:f.call(l,s)},{checkForDefaultPrevented:!1})})})});WS.displayName=zS;var Kp="MenuItemIndicator",[US,wL]=ai(Kp,{checked:!1}),KS=C.forwardRef((e,t)=>{const{__scopeMenu:s,forceMount:o,...l}=e,m=wL(Kp,s);return i.jsx(Vt,{present:o||Nc(m.checked)||m.checked===!0,children:i.jsx(Oe.span,{...l,ref:t,"data-state":qp(m.checked)})})});KS.displayName=Kp;var bL="MenuSeparator",GS=C.forwardRef((e,t)=>{const{__scopeMenu:s,...o}=e;return i.jsx(Oe.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});GS.displayName=bL;var SL="MenuArrow",qS=C.forwardRef((e,t)=>{const{__scopeMenu:s,...o}=e,l=Ta(s);return i.jsx(kp,{...l,...o,ref:t})});qS.displayName=SL;var Gp="MenuSub",[CL,YS]=ai(Gp),XS=e=>{const{__scopeMenu:t,children:s,open:o=!1,onOpenChange:l}=e,m=kn(Gp,t),f=Ta(t),[a,c]=C.useState(null),[h,g]=C.useState(null),d=Mt(l);return C.useEffect(()=>(m.open===!1&&d(!1),()=>d(!1)),[m.open,d]),i.jsx(Qc,{...f,children:i.jsx(DS,{scope:t,open:o,onOpenChange:d,content:h,onContentChange:g,children:i.jsx(CL,{scope:t,contentId:vr(),triggerId:vr(),trigger:a,onTriggerChange:c,children:s})})})};XS.displayName=Gp;var Zo="MenuSubTrigger",JS=C.forwardRef((e,t)=>{const s=kn(Zo,e.__scopeMenu),o=Aa(Zo,e.__scopeMenu),l=YS(Zo,e.__scopeMenu),m=zp(Zo,e.__scopeMenu),f=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=m,h={__scopeMenu:e.__scopeMenu},g=C.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return C.useEffect(()=>g,[g]),C.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),i.jsx(Hp,{asChild:!0,...h,children:i.jsx(FS,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":l.contentId,"data-state":e1(s.open),...e,ref:Bs(t,l.onTriggerChange),onClick:d=>{var _;(_=e.onClick)==null||_.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:ye(e.onPointerMove,ma(d=>{m.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!s.open&&!f.current&&(m.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{s.onOpenChange(!0),g()},100))})),onPointerLeave:ye(e.onPointerLeave,ma(d=>{var S,E;g();const _=(S=s.content)==null?void 0:S.getBoundingClientRect();if(_){const b=(E=s.content)==null?void 0:E.dataset.side,v=b==="right",y=v?-5:5,p=_[v?"left":"right"],x=_[v?"right":"left"];m.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:p,y:_.top},{x,y:_.top},{x,y:_.bottom},{x:p,y:_.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>m.onPointerGraceIntentChange(null),300)}else{if(m.onTriggerLeave(d),d.defaultPrevented)return;m.onPointerGraceIntentChange(null)}})),onKeyDown:ye(e.onKeyDown,d=>{var S;const _=m.searchRef.current!=="";e.disabled||_&&d.key===" "||iL[o.dir].includes(d.key)&&(s.onOpenChange(!0),(S=s.content)==null||S.focus(),d.preventDefault())})})})});JS.displayName=Zo;var QS="MenuSubContent",ZS=C.forwardRef((e,t)=>{const s=LS(Hr,e.__scopeMenu),{forceMount:o=s.forceMount,...l}=e,m=kn(Hr,e.__scopeMenu),f=Aa(Hr,e.__scopeMenu),a=YS(QS,e.__scopeMenu),c=C.useRef(null),h=ze(t,c);return i.jsx(pa.Provider,{scope:e.__scopeMenu,children:i.jsx(Vt,{present:o||m.open,children:i.jsx(pa.Slot,{scope:e.__scopeMenu,children:i.jsx(Wp,{id:a.contentId,"aria-labelledby":a.triggerId,...l,ref:h,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var d;f.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ye(e.onFocusOutside,g=>{g.target!==a.trigger&&m.onOpenChange(!1)}),onEscapeKeyDown:ye(e.onEscapeKeyDown,g=>{f.onClose(),g.preventDefault()}),onKeyDown:ye(e.onKeyDown,g=>{var S;const d=g.currentTarget.contains(g.target),_=oL[f.dir].includes(g.key);d&&_&&(m.onOpenChange(!1),(S=a.trigger)==null||S.focus(),g.preventDefault())})})})})})});ZS.displayName=QS;function e1(e){return e?"open":"closed"}function Nc(e){return e==="indeterminate"}function qp(e){return Nc(e)?"indeterminate":e?"checked":"unchecked"}function kL(e){const t=document.activeElement;for(const s of e)if(s===t||(s.focus(),document.activeElement!==t))return}function EL(e,t){return e.map((s,o)=>e[(t+o)%e.length])}function jL(e,t,s){const l=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,m=s?e.indexOf(s):-1;let f=EL(e,Math.max(m,0));l.length===1&&(f=f.filter(h=>h!==s));const c=f.find(h=>h.toLowerCase().startsWith(l.toLowerCase()));return c!==s?c:void 0}function NL(e,t){const{x:s,y:o}=e;let l=!1;for(let m=0,f=t.length-1;m<t.length;f=m++){const a=t[m],c=t[f],h=a.x,g=a.y,d=c.x,_=c.y;g>o!=_>o&&s<(d-h)*(o-g)/(_-g)+h&&(l=!l)}return l}function PL(e,t){if(!t)return!1;const s={x:e.clientX,y:e.clientY};return NL(s,t)}function ma(e){return t=>t.pointerType==="mouse"?e(t):void 0}var RL=MS,TL=Hp,AL=OS,DL=IS,ML=Up,LL=BS,OL=ld,IL=$S,BL=VS,FL=WS,$L=KS,HL=GS,VL=qS,zL=XS,WL=JS,UL=ZS,cd="DropdownMenu",[KL]=yr(cd,[TS]),rr=TS(),[GL,t1]=KL(cd),r1=e=>{const{__scopeDropdownMenu:t,children:s,dir:o,open:l,defaultOpen:m,onOpenChange:f,modal:a=!0}=e,c=rr(t),h=C.useRef(null),[g,d]=es({prop:l,defaultProp:m??!1,onChange:f,caller:cd});return i.jsx(GL,{scope:t,triggerId:vr(),triggerRef:h,contentId:vr(),open:g,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(_=>!_),[d]),modal:a,children:i.jsx(RL,{...c,open:g,onOpenChange:d,dir:o,modal:a,children:s})})};r1.displayName=cd;var s1="DropdownMenuTrigger",n1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...l}=e,m=t1(s1,s),f=rr(s);return i.jsx(TL,{asChild:!0,...f,children:i.jsx(Oe.button,{type:"button",id:m.triggerId,"aria-haspopup":"menu","aria-expanded":m.open,"aria-controls":m.open?m.contentId:void 0,"data-state":m.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:Bs(t,m.triggerRef),onPointerDown:ye(e.onPointerDown,a=>{!o&&a.button===0&&a.ctrlKey===!1&&(m.onOpenToggle(),m.open||a.preventDefault())}),onKeyDown:ye(e.onKeyDown,a=>{o||(["Enter"," "].includes(a.key)&&m.onOpenToggle(),a.key==="ArrowDown"&&m.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});n1.displayName=s1;var qL="DropdownMenuPortal",i1=e=>{const{__scopeDropdownMenu:t,...s}=e,o=rr(t);return i.jsx(AL,{...o,...s})};i1.displayName=qL;var o1="DropdownMenuContent",a1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=t1(o1,s),m=rr(s),f=C.useRef(!1);return i.jsx(DL,{id:l.contentId,"aria-labelledby":l.triggerId,...m,...o,ref:t,onCloseAutoFocus:ye(e.onCloseAutoFocus,a=>{var c;f.current||(c=l.triggerRef.current)==null||c.focus(),f.current=!1,a.preventDefault()}),onInteractOutside:ye(e.onInteractOutside,a=>{const c=a.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0,g=c.button===2||h;(!l.modal||g)&&(f.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)"}})});a1.displayName=o1;var YL="DropdownMenuGroup",XL=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(ML,{...l,...o,ref:t})});XL.displayName=YL;var JL="DropdownMenuLabel",l1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(LL,{...l,...o,ref:t})});l1.displayName=JL;var QL="DropdownMenuItem",c1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(OL,{...l,...o,ref:t})});c1.displayName=QL;var ZL="DropdownMenuCheckboxItem",d1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(IL,{...l,...o,ref:t})});d1.displayName=ZL;var eO="DropdownMenuRadioGroup",tO=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(BL,{...l,...o,ref:t})});tO.displayName=eO;var rO="DropdownMenuRadioItem",u1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(FL,{...l,...o,ref:t})});u1.displayName=rO;var sO="DropdownMenuItemIndicator",h1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx($L,{...l,...o,ref:t})});h1.displayName=sO;var nO="DropdownMenuSeparator",f1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(HL,{...l,...o,ref:t})});f1.displayName=nO;var iO="DropdownMenuArrow",oO=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(VL,{...l,...o,ref:t})});oO.displayName=iO;var aO=e=>{const{__scopeDropdownMenu:t,children:s,open:o,onOpenChange:l,defaultOpen:m}=e,f=rr(t),[a,c]=es({prop:o,defaultProp:m??!1,onChange:l,caller:"DropdownMenuSub"});return i.jsx(zL,{...f,open:a,onOpenChange:c,children:s})},lO="DropdownMenuSubTrigger",p1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(WL,{...l,...o,ref:t})});p1.displayName=lO;var cO="DropdownMenuSubContent",m1=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...o}=e,l=rr(s);return i.jsx(UL,{...l,...o,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)"}})});m1.displayName=cO;var dO=r1,uO=n1,hO=i1,g1=a1,v1=l1,y1=c1,x1=d1,_1=u1,w1=h1,b1=f1,fO=aO,S1=p1,C1=m1;const ti=dO,ri=uO,k1=fO,Yp=C.forwardRef(({className:e,inset:t,children:s,...o},l)=>i.jsxs(S1,{ref:l,className:xe("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),...o,children:[s,i.jsx(Bc,{className:"ml-auto"})]}));Yp.displayName=S1.displayName;const Xp=C.forwardRef(({className:e,...t},s)=>i.jsx(C1,{ref:s,className:xe("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}));Xp.displayName=C1.displayName;const wn=C.forwardRef(({className:e,sideOffset:t=4,...s},o)=>i.jsx(hO,{children:i.jsx(g1,{ref:o,sideOffset:t,className:xe("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),...s})}));wn.displayName=g1.displayName;const lt=C.forwardRef(({className:e,inset:t,...s},o)=>i.jsx(y1,{ref:o,className:xe("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),...s}));lt.displayName=y1.displayName;const pO=C.forwardRef(({className:e,children:t,checked:s,...o},l)=>i.jsxs(x1,{ref:l,className:xe("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:s,...o,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(w1,{children:i.jsx(Rr,{className:"h-4 w-4"})})}),t]}));pO.displayName=x1.displayName;const mO=C.forwardRef(({className:e,children:t,...s},o)=>i.jsxs(_1,{ref:o,className:xe("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),...s,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(w1,{children:i.jsx(QR,{className:"h-2 w-2 fill-current"})})}),t]}));mO.displayName=_1.displayName;const E1=C.forwardRef(({className:e,inset:t,...s},o)=>i.jsx(v1,{ref:o,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));E1.displayName=v1.displayName;const si=C.forwardRef(({className:e,...t},s)=>i.jsx(b1,{ref:s,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));si.displayName=b1.displayName;const pf=[{name:"Bash",icon:St,description:"Shell commands",color:"text-purple-600",bgColor:"bg-purple-50",badgeClass:"bg-purple-100 text-purple-700 border-purple-200"},{name:"Read",icon:mr,description:"Read file contents",color:"text-blue-600",bgColor:"bg-blue-50",badgeClass:"bg-blue-100 text-blue-700 border-blue-200"},{name:"Edit",icon:tp,description:"Edit existing files",color:"text-amber-600",bgColor:"bg-amber-50",badgeClass:"bg-amber-100 text-amber-700 border-amber-200"},{name:"Write",icon:$_,description:"Create/write files",color:"text-orange-600",bgColor:"bg-orange-50",badgeClass:"bg-orange-100 text-orange-700 border-orange-200"},{name:"WebFetch",icon:L_,description:"Fetch web content",color:"text-green-600",bgColor:"bg-green-50",badgeClass:"bg-green-100 text-green-700 border-green-200"},{name:"WebSearch",icon:np,description:"Web search capability",color:"text-teal-600",bgColor:"bg-teal-50",badgeClass:"bg-teal-100 text-teal-700 border-teal-200"},{name:"mcp",icon:gc,description:"MCP server tools",color:"text-indigo-600",bgColor:"bg-indigo-50",badgeClass:"bg-indigo-100 text-indigo-700 border-indigo-200"}],Eh=[{category:"Git",name:"Git Status",pattern:"Bash(git status:*)",description:"Check repository status",icon:St},{category:"Git",name:"Git Add",pattern:"Bash(git add:*)",description:"Stage files for commit",icon:St},{category:"Git",name:"Git Commit",pattern:"Bash(git commit:*)",description:"Create commits",icon:St},{category:"Git",name:"Git Push",pattern:"Bash(git push:*)",description:"Push to remote repository",icon:St},{category:"Git",name:"Git Diff",pattern:"Bash(git diff:*)",description:"Show changes",icon:St},{category:"NPM",name:"NPM Install",pattern:"Bash(npm install:*)",description:"Install dependencies",icon:St},{category:"NPM",name:"NPM Run Scripts",pattern:"Bash(npm run:*)",description:"Run package scripts",icon:St},{category:"NPM",name:"NPM Test",pattern:"Bash(npm test:*)",description:"Run tests",icon:St},{category:"Files",name:"Read All Files",pattern:"Read(**)",description:"Read any file in the project",icon:mr},{category:"Files",name:"Edit All Files",pattern:"Edit(**)",description:"Edit any file in the project",icon:tp},{category:"Security",name:"Deny .env Files",pattern:"Read(./.env)",description:"Block reading environment files",icon:mr,suggestedCategory:"deny"},{category:"Security",name:"Deny All .env",pattern:"Read(**/.env*)",description:"Block all environment files",icon:mr,suggestedCategory:"deny"},{category:"Commands",name:"List Files",pattern:"Bash(ls:*)",description:"List directory contents",icon:St},{category:"Commands",name:"Find Files",pattern:"Bash(find:*)",description:"Find files and directories",icon:St},{category:"MCP",name:"Filesystem Operations",pattern:"mcp__filesystem__*",description:"All filesystem MCP operations",icon:gc},{category:"MCP",name:"GitHub Operations",pattern:"mcp__github__*",description:"All GitHub MCP operations",icon:gc}];function j1(e){if(!e)return{type:"unknown",value:"",hasWildcard:!1,description:""};if(e.startsWith("mcp__")){const s=e.split("__");return{type:"mcp",value:e,server:s[1]||"",tool:s[2]||"",hasWildcard:e.includes("*"),description:`MCP tool: ${s.slice(1).join("/")}`}}if(e==="WebSearch")return{type:"WebSearch",value:"",hasWildcard:!1,description:"Web search capability"};const t=e.match(/^(\w+)\((.+)\)$/);if(t){const[,s,o]=t,l=o.includes("*");return{type:s,value:o,hasWildcard:l,description:yO(s,o)}}return{type:"unknown",value:e,hasWildcard:e.includes("*"),description:e}}function gO(e,t){return e==="WebSearch"?"WebSearch":e==="mcp"?t:t?`${e}(${t})`:""}function vO(e){if(!e)return"Rule cannot be empty";if(e==="WebSearch")return null;if(e.startsWith("mcp__"))return e.includes("*")||e.match(/^mcp__\w+__\w+$/)?null:"MCP pattern must be: mcp__server__tool";const t=e.match(/^(\w+)\((.+)\)$/);if(!t)return"Invalid pattern format. Expected: Type(value) or mcp__server__tool";const[,s]=t,o=["Bash","Read","Edit","Write","WebFetch"];return o.includes(s)?null:`Unknown permission type: ${s}. Valid types: ${o.join(", ")}`}function yO(e,t){switch(e){case"Bash":if(t.includes(":")){const[s,o]=t.split(":");return o==="*"?`Run "${s}" with any arguments`:`Run "${s} ${o}"`}return`Run "${t}"`;case"Read":return t==="**"?"Read all files":t.includes("**")?`Read files matching ${t}`:`Read ${t}`;case"Edit":return t==="**"?"Edit all files":t.includes("**")?`Edit files matching ${t}`:`Edit ${t}`;case"Write":return t==="**"?"Write to any file":t.includes("**")?`Write files matching ${t}`:`Write to ${t}`;case"WebFetch":return t==="*"?"Fetch any URL":`Fetch URLs matching ${t}`;default:return t}}function xO(e){return pf.find(s=>s.name===e)||pf[0]}function _O(e){return{allow:'Rules in "Allow" will execute automatically without prompting. Use wildcards (*) for flexible matching.',ask:'Rules in "Ask" will prompt for confirmation each time. Good for potentially destructive operations.',deny:'Rules in "Deny" are blocked entirely. Use this to prevent access to sensitive files or dangerous operations.'}[e]}function zy(e){return{allow:{label:"Allow",color:"text-green-600",bgColor:"bg-green-50",borderColor:"border-green-200",badgeColor:"bg-green-100 text-green-700",description:"Operations that run without asking"},ask:{label:"Ask",color:"text-amber-600",bgColor:"bg-amber-50",borderColor:"border-amber-200",badgeColor:"bg-amber-100 text-amber-700",description:"Operations that require confirmation"},deny:{label:"Deny",color:"text-red-600",bgColor:"bg-red-50",borderColor:"border-red-200",badgeColor:"bg-red-100 text-red-700",description:"Operations that are blocked"}}[e]}function wO({rule:e,category:t,onEdit:s,onDelete:o,onMove:l,readOnly:m}){const[f,a]=C.useState(!1),c=j1(e),h=xO(c.type),g=h.icon,d=_=>{_.stopPropagation(),navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)};return i.jsxs(Ds.div,{layout:!0,initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:xe("group flex items-center gap-3 p-3 rounded-lg bg-white dark:bg-slate-900 border border-gray-200 dark:border-slate-700","hover:border-gray-300 dark:hover:border-slate-600 hover:shadow-sm transition-all"),children:[i.jsx("div",{className:xe("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",h.bgColor),children:i.jsx(g,{className:xe("w-4 h-4",h.color)})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(st,{variant:"outline",className:xe("text-xs",h.badgeClass),children:c.type}),c.hasWildcard&&i.jsxs(fn,{children:[i.jsx(pn,{children:i.jsx(st,{variant:"secondary",className:"text-xs",children:"Wildcard"})}),i.jsx(Ms,{children:"Pattern uses wildcard (*) matching"})]})]}),i.jsxs(fn,{children:[i.jsx(pn,{asChild:!0,children:i.jsx("code",{className:"block text-sm font-mono text-gray-700 dark:text-slate-300 truncate mt-1 cursor-default",children:e})}),i.jsx(Ms,{side:"bottom",className:"max-w-md",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("code",{className:"text-xs break-all",children:e}),i.jsx("p",{className:"text-xs text-gray-300",children:c.description})]})})]})]}),i.jsxs("div",{className:xe("flex items-center gap-1 transition-opacity",m?"opacity-50 pointer-events-none":"opacity-0 group-hover:opacity-100"),children:[i.jsxs(fn,{children:[i.jsx(pn,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:d,children:f?i.jsx(Rr,{className:"w-4 h-4 text-green-500"}):i.jsx(Gi,{className:"w-4 h-4"})})}),i.jsx(Ms,{children:"Copy rule"})]}),i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"icon",className:"h-8 w-8",children:i.jsx(ep,{className:"w-4 h-4"})})}),i.jsxs(wn,{align:"end",children:[i.jsxs(lt,{onClick:s,children:[i.jsx(sp,{className:"w-4 h-4 mr-2"}),"Edit Rule"]}),i.jsxs(k1,{children:[i.jsxs(Yp,{children:[i.jsx(T_,{className:"w-4 h-4 mr-2"}),"Move to..."]}),i.jsx(Xp,{children:["allow","ask","deny"].filter(_=>_!==t).map(_=>i.jsxs(lt,{onClick:()=>l(_),children:["Move to ",_]},_))})]}),i.jsx(si,{}),i.jsxs(lt,{onClick:o,className:"text-red-600",children:[i.jsx(qn,{className:"w-4 h-4 mr-2"}),"Delete Rule"]})]})]})]})]})}function bO({open:e,onOpenChange:t,onSubmit:s,defaultCategory:o="allow",defaultRule:l="",isEditing:m=!1}){const[f,a]=C.useState("preset"),[c,h]=C.useState(o),[g,d]=C.useState("Bash"),[_,S]=C.useState(""),[E,b]=C.useState(l),[v,y]=C.useState(null),[p,x]=C.useState(""),[k,P]=C.useState(null);C.useEffect(()=>{if(e)if(h(o),l&&m){const F=j1(l);d(F.type==="unknown"?"Bash":F.type),S(F.value),b(l);const U=Eh.find(H=>H.pattern===l);U?(y(U),a("preset")):a("builder")}else d("Bash"),S(""),b(""),y(null),a("preset")},[e,l,o,m]);const T=C.useMemo(()=>f==="preset"&&v?v.pattern:f==="freeform"?E:gO(g,_),[f,v,g,_,E]);C.useEffect(()=>{const F=vO(T);P(F)},[T]);const R=C.useMemo(()=>{if(!p)return Eh;const F=p.toLowerCase();return Eh.filter(U=>U.name.toLowerCase().includes(F)||U.pattern.toLowerCase().includes(F)||U.description.toLowerCase().includes(F)||U.category.toLowerCase().includes(F))},[p]),j=C.useMemo(()=>{const F={};return R.forEach(U=>{F[U.category]||(F[U.category]=[]),F[U.category].push(U)}),F},[R]),M=()=>{k||(s(c,T),t(!1))},$=kO(g);return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:[i.jsxs(Zt,{children:[i.jsx(tr,{className:"flex items-center gap-2",children:m?i.jsxs(i.Fragment,{children:[i.jsx($_,{className:"w-5 h-5 text-indigo-600"}),"Edit Permission Rule"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ps,{className:"w-5 h-5 text-indigo-600"}),"Add Permission Rule"]})}),i.jsx(Nr,{children:"Create a permission rule to control Claude Code's behavior."})]}),i.jsxs("div",{className:"flex-1 overflow-auto space-y-6 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{children:"Permission Category"}),i.jsxs(Yi,{value:c,onValueChange:h,children:[i.jsx(Qn,{children:i.jsx(Xi,{})}),i.jsxs(Zn,{children:[i.jsx(pr,{value:"allow",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),"Allow - Execute without asking"]})}),i.jsx(pr,{value:"ask",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-3 h-3 rounded-full bg-amber-500"}),"Ask - Require confirmation"]})}),i.jsx(pr,{value:"deny",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),"Deny - Block entirely"]})})]})]})]}),i.jsxs(Kc,{value:f,onValueChange:a,children:[i.jsxs(ka,{className:"grid w-full grid-cols-3",children:[i.jsxs(Zr,{value:"preset",children:[i.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Presets"]}),i.jsxs(Zr,{value:"builder",children:[i.jsx(St,{className:"w-4 h-4 mr-2"}),"Builder"]}),i.jsxs(Zr,{value:"freeform",children:[i.jsx(tp,{className:"w-4 h-4 mr-2"}),"Freeform"]})]}),i.jsxs(Rs,{value:"preset",className:"space-y-4",children:[i.jsx(Xe,{placeholder:"Search presets...",value:p,onChange:F=>x(F.target.value)}),i.jsx("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg max-h-[250px] overflow-auto",children:Object.entries(j).map(([F,U])=>i.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700 last:border-b-0",children:[i.jsx("div",{className:"px-3 py-2 bg-gray-50 dark:bg-slate-800 font-medium text-sm text-gray-600 dark:text-slate-300",children:F}),U.map(H=>{const Q=H.icon;return i.jsx("button",{onClick:()=>y(H),className:xe("w-full text-left px-3 py-2 hover:bg-gray-50 dark:hover:bg-slate-800 transition-colors",(v==null?void 0:v.pattern)===H.pattern&&"bg-indigo-50 dark:bg-indigo-950/50 border-l-2 border-indigo-500"),children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Q,{className:"w-4 h-4 mt-0.5 text-gray-400 dark:text-slate-500"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm",children:H.name}),i.jsx("code",{className:"text-xs text-gray-500 dark:text-slate-400 block truncate",children:H.pattern}),i.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:H.description})]})]})},H.pattern)})]},F))})]}),i.jsxs(Rs,{value:"builder",className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{children:"Permission Type"}),i.jsxs(Yi,{value:g,onValueChange:d,children:[i.jsx(Qn,{children:i.jsx(Xi,{})}),i.jsx(Zn,{children:pf.map(F=>{const U=F.icon;return i.jsx(pr,{value:F.name,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(U,{className:"w-4 h-4"}),F.name,i.jsxs("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:["- ",F.description]})]})},F.name)})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(bt,{children:SO(g)}),i.jsxs(fn,{children:[i.jsx(pn,{children:i.jsx(Zf,{className:"w-4 h-4 text-gray-400"})}),i.jsx(Ms,{className:"max-w-xs",children:CO(g)})]})]}),g==="WebSearch"?i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 italic",children:"WebSearch does not require a value pattern."}):i.jsx(Xe,{value:_,onChange:F=>S(F.target.value),placeholder:g==="Bash"?"command:arguments":"path/pattern",className:"font-mono"})]}),$.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{className:"text-xs text-gray-500 dark:text-slate-400",children:"Quick examples:"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:$.map(F=>i.jsx(ue,{variant:"outline",size:"sm",className:"text-xs h-7",onClick:()=>S(F.value),children:F.label},F.value))})]})]}),i.jsx(Rs,{value:"freeform",className:"space-y-4",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{children:"Rule Pattern"}),i.jsx(Ze,{value:E,onChange:F=>b(F.target.value),placeholder:"e.g., Bash(npm run build), Read(**/*.ts)",className:"font-mono text-sm",rows:3}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Enter the full permission pattern. Use * for wildcards and : for Bash argument separation."})]})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{children:"Generated Rule"}),i.jsx("div",{className:xe("p-3 rounded-lg border font-mono text-sm",k?"bg-red-50 dark:bg-red-950/50 border-red-200 dark:border-red-800 text-red-700 dark:text-red-400":"bg-gray-50 dark:bg-slate-800 border-gray-200 dark:border-slate-700 text-gray-700 dark:text-slate-300"),children:T||i.jsx("span",{className:"text-gray-400 dark:text-slate-500",children:"No rule configured"})}),k&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-600",children:[i.jsx(ca,{className:"w-4 h-4"}),k]})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),i.jsx(ue,{onClick:M,disabled:!T||!!k,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:m?"Update Rule":"Add Rule"})]})]})})}function SO(e){return{Bash:"Command Pattern",Read:"File Path Pattern",Edit:"File Path Pattern",Write:"File Path Pattern",WebFetch:"URL Pattern",WebSearch:"N/A",mcp:"Tool Name"}[e]||"Value"}function CO(e){return{Bash:"Format: command:arguments. Use * for wildcards. Example: npm run:* matches npm run build, npm run test, etc.",Read:"File path pattern. Use ** for recursive matching. Example: **/*.ts matches all TypeScript files.",Edit:"File path pattern. Use ** for recursive matching.",Write:"File path pattern. Use ** for recursive matching.",WebFetch:"URL pattern. Example: https://api.github.com/* matches all GitHub API calls.",WebSearch:"No value needed - this enables/disables web search entirely.",mcp:"MCP tool name in format: mcp__server__tool"}[e]||""}function kO(e){return{Bash:[{label:"npm run *",value:"npm run:*"},{label:"git add *",value:"git add:*"},{label:"git commit *",value:"git commit:*"},{label:"ls *",value:"ls:*"}],Read:[{label:"All files",value:"**"},{label:"TypeScript",value:"**/*.ts"},{label:"Source only",value:"./src/**"}],Edit:[{label:"All files",value:"**"},{label:"Source only",value:"./src/**"}],Write:[{label:"All files",value:"**"}],WebFetch:[{label:"Any URL",value:"*"},{label:"GitHub API",value:"https://api.github.com/*"}],mcp:[{label:"Filesystem read",value:"mcp__filesystem__read_file"},{label:"GitHub PR",value:"mcp__github__create_pull_request"}]}[e]||[]}function EO({open:e,onOpenChange:t,mode:s,permissions:o,onImport:l}){const[m,f]=C.useState(""),[a,c]=C.useState(null),[h,g]=C.useState(!1);C.useEffect(()=>{e&&s==="export"?(f(JSON.stringify({permissions:o},null,2)),c(null)):e&&s==="import"&&(f(""),c(null))},[e,s,o]);const d=()=>{navigator.clipboard.writeText(m),g(!0),setTimeout(()=>g(!1),2e3),le.success("Copied to clipboard")},_=()=>{try{const S=JSON.parse(m);if(!S.permissions){c('JSON must have a "permissions" key');return}const{allow:E=[],ask:b=[],deny:v=[]}=S.permissions;if(!Array.isArray(E)||!Array.isArray(b)||!Array.isArray(v)){c("allow, ask, and deny must be arrays");return}if([...E,...b,...v].some(p=>typeof p!="string")){c("All permission rules must be strings");return}l(S.permissions),t(!1)}catch(S){c("Invalid JSON: "+S.message)}};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-lg",children:[i.jsxs(Zt,{children:[i.jsx(tr,{className:"flex items-center gap-2",children:s==="export"?i.jsxs(i.Fragment,{children:[i.jsx(Fc,{className:"w-5 h-5 text-indigo-600"}),"Export Permissions"]}):i.jsxs(i.Fragment,{children:[i.jsx(Xh,{className:"w-5 h-5 text-indigo-600"}),"Import Permissions"]})}),i.jsx(Nr,{children:s==="export"?"Copy this JSON to save or share your permission configuration.":"Paste a JSON permission configuration to import."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsx(Ze,{value:m,onChange:S=>{f(S.target.value),c(null)},placeholder:s==="import"?"Paste JSON here...":"",className:"font-mono text-sm min-h-[300px]",readOnly:s==="export"}),a&&i.jsxs("div",{className:"flex items-center gap-2 text-sm text-red-600",children:[i.jsx(ca,{className:"w-4 h-4"}),a]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),s==="export"?i.jsxs(ue,{onClick:d,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[h?i.jsx(Rr,{className:"w-4 h-4 mr-2"}):i.jsx(Gi,{className:"w-4 h-4 mr-2"}),h?"Copied!":"Copy to Clipboard"]}):i.jsxs(ue,{onClick:_,disabled:!m.trim(),className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[i.jsx(Xh,{className:"w-4 h-4 mr-2"}),"Import"]})]})]})})}function jO({permissions:e,onSave:t,loading:s,readOnly:o=!1}){const[l,m]=C.useState({allow:[],ask:[],deny:[]}),[f,a]=C.useState("allow"),[c,h]=C.useState(!1),[g,d]=C.useState(!1),[_,S]=C.useState(!1),[E,b]=C.useState(!1),[v,y]=C.useState(null),[p,x]=C.useState(!1),[k,P]=C.useState("export");C.useEffect(()=>{e&&(m({allow:e.allow||[],ask:e.ask||[],deny:e.deny||[]}),h(!1))},[e]);const T=C.useCallback((K,J)=>{m(W=>[...W.allow,...W.ask,...W.deny].includes(J)?(le.error("This rule already exists"),W):{...W,[K]:[...W[K],J]}),h(!0),le.success(`Rule added to ${K}`)},[]),R=C.useCallback((K,J,W,D)=>{m(B=>{const L={...B};return L[K]=L[K].filter(z=>z!==J),L[W]=[...L[W],D],L}),h(!0),le.success("Rule updated")},[]),j=C.useCallback((K,J)=>{m(W=>({...W,[K]:W[K].filter(D=>D!==J)})),h(!0),le.success("Rule deleted")},[]),M=C.useCallback((K,J,W)=>{m(D=>({...D,[K]:D[K].filter(B=>B!==J),[W]:[...D[W],J]})),h(!0),le.success(`Moved to ${W}`)},[]),$=C.useCallback(K=>{m({allow:K.allow||[],ask:K.ask||[],deny:K.deny||[]}),h(!0),le.success("Permissions imported")},[]),F=async()=>{if(t){d(!0);try{await t(l),h(!1),le.success("Permissions saved")}catch(K){le.error("Failed to save: "+K.message)}finally{d(!1)}}},U=()=>{e&&(m({allow:e.allow||[],ask:e.ask||[],deny:e.deny||[]}),h(!1),le.info("Changes reset"))},H=K=>{y(null),a(K),b(!0)},Q=(K,J)=>{y({category:K,rule:J}),b(!0)},V=l.allow.length+l.ask.length+l.deny.length;return i.jsx(iS,{children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-950 flex items-center justify-center",children:i.jsx(ba,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Claude Code Permissions"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Configure what Claude Code can do automatically"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[c&&i.jsx(st,{variant:"outline",className:"bg-amber-50 dark:bg-amber-950/50 text-amber-700 dark:text-amber-400 border-amber-200 dark:border-amber-800",children:"Unsaved changes"}),i.jsxs(fn,{children:[i.jsx(pn,{asChild:!0,children:i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>{P("export"),x(!0)},children:i.jsx(Fc,{className:"w-4 h-4"})})}),i.jsx(Ms,{children:"Export permissions"})]}),i.jsxs(fn,{children:[i.jsx(pn,{asChild:!0,children:i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>{P("import"),x(!0)},disabled:o,children:i.jsx(Xh,{className:"w-4 h-4"})})}),i.jsx(Ms,{children:"Import permissions"})]}),c&&i.jsxs(i.Fragment,{children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:U,children:[i.jsx(gr,{className:"w-4 h-4 mr-1"}),"Reset"]}),i.jsxs(ue,{size:"sm",onClick:F,disabled:g,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[g?i.jsx(gr,{className:"w-4 h-4 mr-1 animate-spin"}):i.jsx(Rr,{className:"w-4 h-4 mr-1"}),"Save"]})]})]})]}),i.jsxs(R3,{open:_,onOpenChange:S,children:[i.jsx(T3,{asChild:!0,children:i.jsxs(ue,{variant:"ghost",size:"sm",className:"text-gray-500 dark:text-slate-400",children:[i.jsx(Zf,{className:"w-4 h-4 mr-2"}),"How permissions work",i.jsx(to,{className:xe("w-4 h-4 ml-2 transition-transform",_&&"rotate-180")})]})}),i.jsx(A3,{children:i.jsxs(Cc,{className:"mt-2",children:[i.jsx(kT,{className:"w-4 h-4"}),i.jsxs(kc,{className:"text-sm",children:[i.jsxs("p",{className:"mb-2",children:["Permissions control what Claude Code can do automatically vs. what requires your approval. These settings are stored in ",i.jsx("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-slate-700 rounded text-xs",children:"~/.claude/settings.json"}),"."]}),i.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-3",children:[i.jsxs("div",{children:[i.jsx(st,{className:"bg-green-100 dark:bg-green-950 text-green-700 dark:text-green-400 mb-1",children:"Allow"}),i.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:"Operations run without asking"})]}),i.jsxs("div",{children:[i.jsx(st,{className:"bg-amber-100 dark:bg-amber-950 text-amber-700 dark:text-amber-400 mb-1",children:"Ask"}),i.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:"Prompts for confirmation each time"})]}),i.jsxs("div",{children:[i.jsx(st,{className:"bg-red-100 dark:bg-red-950 text-red-700 dark:text-red-400 mb-1",children:"Deny"}),i.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:"Blocked entirely"})]})]}),i.jsxs("p",{className:"mt-3 text-xs text-gray-500 dark:text-slate-400",children:["Use wildcards: ",i.jsx("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-slate-700 rounded",children:"*"})," matches anything,"," ",i.jsx("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-slate-700 rounded",children:"**"})," matches recursively in paths."]})]})]})})]}),s&&i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx(gr,{className:"w-6 h-6 animate-spin text-gray-400"})}),!s&&V===0&&i.jsxs(Cc,{children:[i.jsx(Hc,{className:"w-4 h-4"}),i.jsxs(kc,{children:["No permission rules configured. Claude Code will use default behavior and ask for permission on sensitive operations.",i.jsx(ue,{variant:"link",size:"sm",className:"ml-2 p-0 h-auto",onClick:()=>H("allow"),children:"Add your first rule"})]})]}),!s&&i.jsxs(Kc,{value:f,onValueChange:a,children:[i.jsx(ka,{className:"grid w-full grid-cols-3",children:["allow","ask","deny"].map(K=>{var D;const J=zy(K),W=((D=l[K])==null?void 0:D.length)||0;return i.jsxs(Zr,{value:K,className:"flex items-center gap-2",children:[i.jsx("div",{className:xe("w-2 h-2 rounded-full",K==="allow"&&"bg-green-500",K==="ask"&&"bg-amber-500",K==="deny"&&"bg-red-500")}),J.label,W>0&&i.jsx(st,{variant:"secondary",className:"ml-1 text-xs",children:W})]},K)})}),["allow","ask","deny"].map(K=>{const J=zy(K),W=l[K]||[];return i.jsxs(Rs,{value:K,className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(fn,{children:[i.jsx(pn,{asChild:!0,children:i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 cursor-help",children:J.description})}),i.jsx(Ms,{className:"max-w-xs",children:_O(K)})]}),i.jsxs(ue,{size:"sm",variant:"outline",onClick:()=>H(K),disabled:o,children:[i.jsx(Ht,{className:"w-4 h-4 mr-1"}),"Add Rule"]})]}),W.length===0?i.jsxs("div",{className:xe("text-center py-8 rounded-lg border-2 border-dashed",J.borderColor),children:[i.jsxs("p",{className:"text-gray-500 dark:text-slate-400",children:["No rules in ",K]}),i.jsx(ue,{variant:"link",size:"sm",onClick:()=>H(K),disabled:o,children:"Add a rule"})]}):i.jsx("div",{className:"space-y-2",children:i.jsx(bf,{mode:"popLayout",children:W.map(D=>i.jsx(wO,{rule:D,category:K,onEdit:()=>Q(K,D),onDelete:()=>j(K,D),onMove:B=>M(K,D,B),readOnly:o},D))})})]},K)})]}),i.jsx(bO,{open:E,onOpenChange:b,onSubmit:(K,J)=>{v?R(v.category,v.rule,K,J):T(K,J)},defaultCategory:(v==null?void 0:v.category)||f,defaultRule:(v==null?void 0:v.rule)||"",isEditing:!!v}),i.jsx(EO,{open:p,onOpenChange:x,mode:k,permissions:l,onImport:$})]})})}const NO=[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",description:"Best balance of speed and capability",tier:"sonnet",recommended:!0},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",description:"Most capable, best for complex tasks",tier:"opus"},{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",description:"Fastest, best for simple tasks",tier:"haiku"}],PO=[{key:"ANTHROPIC_SMALL_FAST_MODEL",label:"Small/Fast Model",description:"Model for background tasks and quick operations",placeholder:"claude-haiku-4-5-20251001"},{key:"CLAUDE_CODE_SUBAGENT_MODEL",label:"Subagent Model",description:"Model used for subagent/background processing",placeholder:"claude-haiku-4-20241022"}];function N1({settings:e,onSave:t,loading:s,settingsPath:o="~/.claude/settings.json"}){const[l,m]=C.useState({}),[f,a]=C.useState("permissions"),[c,h]=C.useState(!1),[g,d]=C.useState(!1),[_,S]=C.useState(!1),[E,b]=C.useState(""),[v,y]=C.useState(null);C.useEffect(()=>{e&&(m(e),b(JSON.stringify(e,null,2)),h(!1))},[e]),C.useEffect(()=>{_||b(JSON.stringify(l,null,2))},[l,_]);const p=C.useCallback((R,j)=>{m(M=>{const $={...M,[R]:j};return(j===""||j===null||j===void 0)&&delete $[R],$}),h(!0)},[]),x=C.useCallback(R=>{m(j=>({...j,permissions:R})),h(!0)},[]),k=R=>{b(R);try{const j=JSON.parse(R);m(j),y(null),h(!0)}catch(j){y(j.message)}},P=async()=>{if(t){if(v){le.error("Fix JSON errors before saving");return}d(!0);try{await t(l),h(!1),le.success("Settings saved")}catch(R){le.error("Failed to save: "+R.message)}finally{d(!1)}}},T=()=>{e&&(m(e),b(JSON.stringify(e,null,2)),y(null),h(!1),le.info("Changes reset"))};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-950 flex items-center justify-center",children:i.jsx(yn,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Claude Code Settings"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Configure Claude Code behavior globally"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[c&&i.jsx(st,{variant:"outline",className:"bg-amber-50 dark:bg-amber-950/50 text-amber-700 dark:text-amber-400 border-amber-200 dark:border-amber-800",children:"Unsaved changes"}),i.jsx(iS,{children:i.jsxs(fn,{children:[i.jsx(pn,{asChild:!0,children:i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>S(!_),children:_?i.jsx(A_,{className:"w-4 h-4"}):i.jsx(sT,{className:"w-4 h-4"})})}),i.jsx(Ms,{children:_?"Show UI":"Show JSON"})]})}),c&&i.jsxs(i.Fragment,{children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:T,children:[i.jsx(gr,{className:"w-4 h-4 mr-1"}),"Reset"]}),i.jsxs(ue,{size:"sm",onClick:P,disabled:g||!!v,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[g?i.jsx(gr,{className:"w-4 h-4 mr-1 animate-spin"}):i.jsx(Rr,{className:"w-4 h-4 mr-1"}),"Save"]})]})]})]}),i.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:["Settings file: ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-2 py-0.5 rounded text-xs",children:o})]}),s&&i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx(gr,{className:"w-6 h-6 animate-spin text-gray-400"})}),!s&&_&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(bt,{children:"Raw JSON"}),v&&i.jsx(st,{variant:"destructive",className:"text-xs",children:v})]}),i.jsx(Ze,{value:E,onChange:R=>k(R.target.value),className:xe("font-mono text-sm min-h-[400px]",v&&"border-red-300 focus:border-red-500")})]}),!s&&!_&&i.jsxs(Kc,{value:f,onValueChange:a,children:[i.jsxs(ka,{className:"grid w-full grid-cols-4",children:[i.jsxs(Zr,{value:"permissions",className:"flex items-center gap-2",children:[i.jsx(ba,{className:"w-4 h-4"}),"Permissions"]}),i.jsxs(Zr,{value:"model",className:"flex items-center gap-2",children:[i.jsx(V_,{className:"w-4 h-4"}),"Model"]}),i.jsxs(Zr,{value:"behavior",className:"flex items-center gap-2",children:[i.jsx(yn,{className:"w-4 h-4"}),"Behavior"]}),i.jsxs(Zr,{value:"advanced",className:"flex items-center gap-2",children:[i.jsx(St,{className:"w-4 h-4"}),"Advanced"]})]}),i.jsx(Rs,{value:"permissions",className:"pt-4",children:i.jsx(jO,{permissions:l.permissions,onSave:x,loading:!1})}),i.jsx(Rs,{value:"model",className:"space-y-6 pt-4",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(bt,{className:"text-base font-medium",children:"Default Model"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Select the default model for Claude Code sessions"}),i.jsx("div",{className:"grid gap-3",children:NO.map(R=>i.jsx("button",{onClick:()=>p("model",R.id),className:xe("w-full p-4 rounded-lg border text-left transition-all",l.model===R.id?"border-indigo-500 bg-indigo-50 dark:bg-indigo-950/50":"border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"),children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-medium",children:R.name}),R.recommended&&i.jsx(st,{variant:"secondary",className:"text-xs",children:"Recommended"}),i.jsx(st,{variant:"outline",className:xe("text-xs",R.tier==="opus"&&"border-purple-300 text-purple-700",R.tier==="sonnet"&&"border-blue-300 text-blue-700",R.tier==="haiku"&&"border-green-300 text-green-700"),children:R.tier})]}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mt-1",children:R.description})]}),l.model===R.id&&i.jsx(Rr,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})]})},R.id))})]}),i.jsxs("div",{children:[i.jsx(bt,{children:"Custom Model ID"}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mb-2",children:"Override with a specific model ID (for AWS Bedrock, etc.)"}),i.jsx(Xe,{value:l.model||"",onChange:R=>p("model",R.target.value),placeholder:"claude-sonnet-4-20250514",className:"font-mono"})]})]})}),i.jsx(Rs,{value:"behavior",className:"space-y-6 pt-4",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-gray-200 dark:border-slate-700",children:[i.jsxs("div",{children:[i.jsx(bt,{children:"Auto-accept Edits"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Automatically accept file edits without confirmation"})]}),i.jsx(xt,{checked:l.autoAcceptEdits??!1,onCheckedChange:R=>p("autoAcceptEdits",R)})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-gray-200 dark:border-slate-700",children:[i.jsxs("div",{children:[i.jsx(bt,{children:"Verbose Output"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Show detailed output for operations"})]}),i.jsx(xt,{checked:l.verbose??!1,onCheckedChange:R=>p("verbose",R)})]}),i.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-gray-200 dark:border-slate-700",children:[i.jsxs("div",{children:[i.jsx(bt,{children:"Enable MCP Servers"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Allow Claude Code to use MCP server connections"})]}),i.jsx(xt,{checked:l.enableMcp??!0,onCheckedChange:R=>p("enableMcp",R)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{children:"API Base URL"}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Custom API endpoint (for proxies or enterprise deployments)"}),i.jsx(Xe,{value:l.apiBaseUrl||"",onChange:R=>p("apiBaseUrl",R.target.value),placeholder:"https://api.anthropic.com",className:"font-mono"})]})]})}),i.jsxs(Rs,{value:"advanced",className:"space-y-6 pt-4",children:[i.jsxs(Cc,{children:[i.jsx(Hc,{className:"w-4 h-4"}),i.jsx(kc,{children:"Advanced settings for power users. Incorrect values may cause Claude Code to malfunction."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(bt,{className:"text-base font-medium",children:"Environment Variables"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Configure model-related environment variables"}),i.jsx("div",{className:"space-y-3",children:PO.map(R=>{var j;return i.jsxs("div",{className:"space-y-1",children:[i.jsx(bt,{className:"text-sm",children:R.label}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:R.description}),i.jsx(Xe,{value:((j=l.env)==null?void 0:j[R.key])||"",onChange:M=>{const $={...l.env||{},[R.key]:M.target.value};M.target.value||delete $[R.key],p("env",Object.keys($).length?$:void 0)},placeholder:R.placeholder,className:"font-mono text-sm"})]},R.key)})})]}),i.jsxs("div",{children:[i.jsx(bt,{className:"text-base font-medium",children:"Hooks"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Scripts to run before/after tool executions (JSON format)"}),i.jsx(Ze,{value:l.hooks?JSON.stringify(l.hooks,null,2):"",onChange:R=>{try{const j=R.target.value?JSON.parse(R.target.value):void 0;p("hooks",j)}catch{}},placeholder:`{
|
|
453
|
+
"preToolExecution": "~/.claude/hooks/pre.sh",
|
|
454
|
+
"postToolExecution": "~/.claude/hooks/post.sh"
|
|
455
|
+
}`,className:"font-mono text-sm min-h-[120px]"})]}),i.jsxs("div",{children:[i.jsx(bt,{className:"text-base font-medium",children:"Custom Settings"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 mb-3",children:"Add any additional settings as JSON key-value pairs"}),i.jsx(Ze,{value:(()=>{const R=["permissions","model","autoAcceptEdits","verbose","enableMcp","apiBaseUrl","env","hooks"],j=Object.keys(l).filter(M=>!R.includes(M)).reduce((M,$)=>({...M,[$]:l[$]}),{});return Object.keys(j).length?JSON.stringify(j,null,2):""})(),onChange:R=>{try{const j=R.target.value?JSON.parse(R.target.value):{},$=["permissions","model","autoAcceptEdits","verbose","enableMcp","apiBaseUrl","env","hooks"].reduce((F,U)=>(l[U]!==void 0&&(F[U]=l[U]),F),{});m({...$,...j}),h(!0)}catch{}},placeholder:`{
|
|
456
|
+
"customKey": "customValue"
|
|
457
|
+
}`,className:"font-mono text-sm min-h-[100px]"})]})]})]})]})]})}const RO=[{id:"Default",name:"Default"},{id:"GitHub",name:"GitHub"},{id:"Monokai",name:"Monokai"},{id:"SolarizedDark",name:"Solarized Dark"},{id:"SolarizedLight",name:"Solarized Light"}];function P1({settings:e,onSave:t,loading:s,settingsPath:o}){const[l,m]=C.useState(e||{}),[f,a]=C.useState(!1),c=async()=>{a(!0);try{await t(l)}finally{a(!1)}},h=(d,_,S)=>{m(E=>({...E,[d]:{...E[d],[_]:S}}))},g=(d,_,S=!1)=>{var E;return((E=l==null?void 0:l[d])==null?void 0:E[_])??S};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:i.jsx(St,{className:"w-5 h-5 text-blue-500"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Gemini CLI Settings",i.jsxs(st,{variant:"outline",className:"text-xs font-normal text-blue-600 border-blue-300 dark:border-blue-700",children:[i.jsx($t,{className:"w-3 h-3 mr-1"}),"Google"]})]}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",i.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:o})]})]})]}),i.jsxs(ue,{onClick:c,disabled:f||s,children:[f?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(oi,{className:"w-4 h-4 mr-2"}),"Save Settings"]})]}),i.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(OT,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),i.jsxs(Yi,{value:g("theme","name","Default"),onValueChange:d=>h("theme","name",d),children:[i.jsx(Qn,{className:"w-40",children:i.jsx(Xi,{})}),i.jsx(Zn,{children:RO.map(d=>i.jsx(pr,{value:d.id,children:d.name},d.id))})]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),i.jsxs(Yi,{value:g("core","outputFormat","text"),onValueChange:d=>h("core","outputFormat",d),children:[i.jsx(Qn,{className:"w-40",children:i.jsx(Xi,{})}),i.jsxs(Zn,{children:[i.jsx(pr,{value:"text",children:"Text"}),i.jsx(pr,{value:"json",children:"JSON"})]})]})]})]})]}),i.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(B_,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Update Window Title"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Show status icons in terminal title"})]}),i.jsx(xt,{checked:g("ui","updateWindowTitle",!0),onCheckedChange:d=>h("ui","updateWindowTitle",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),i.jsx(xt,{checked:g("ui","showLineNumbers",!1),onCheckedChange:d=>h("ui","showLineNumbers",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Show citations for generated text"})]}),i.jsx(xt,{checked:g("ui","showCitations",!1),onCheckedChange:d=>h("ui","showCitations",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),i.jsx(xt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:d=>h("ui","hideContextSummary",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Working Directory"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide current directory path in footer"})]}),i.jsx(xt,{checked:g("ui","hideWorkingDirectory",!1),onCheckedChange:d=>h("ui","hideWorkingDirectory",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Model Info"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide model name and context usage in footer"})]}),i.jsx(xt,{checked:g("ui","hideModelInfo",!1),onCheckedChange:d=>h("ui","hideModelInfo",d)})]})]})]}),i.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(yn,{className:"w-4 h-4 text-blue-500"}),"Advanced"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Keybindings"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Use Vim keybindings in the prompt editor"})]}),i.jsx(xt,{checked:g("core","enableVimKeybindings",!1),onCheckedChange:d=>h("core","enableVimKeybindings",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto-Compress History"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Compress conversation when context exceeds threshold"})]}),i.jsx(xt,{checked:g("core","autoCompressHistory",!0),onCheckedChange:d=>h("core","autoCompressHistory",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Sandbox Mode"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Run tool executions in isolated container"})]}),i.jsx(xt,{checked:g("sandbox","enabled",!1),onCheckedChange:d=>h("sandbox","enabled",d)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:["YOLO Mode",i.jsx(st,{variant:"destructive",className:"text-xs",children:"Dangerous"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Auto-approve all tool calls without confirmation"})]}),i.jsx(xt,{checked:g("core","yoloMode",!1),onCheckedChange:d=>h("core","yoloMode",d)})]})]})]}),i.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(ba,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),i.jsx("div",{className:"space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),i.jsx(xt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:d=>h("privacy","usageStatisticsEnabled",d)})]})})]})]})}var dd="Checkbox",[TO]=yr(dd),[AO,Jp]=TO(dd);function DO(e){const{__scopeCheckbox:t,checked:s,children:o,defaultChecked:l,disabled:m,form:f,name:a,onCheckedChange:c,required:h,value:g="on",internal_do_not_use_render:d}=e,[_,S]=es({prop:s,defaultProp:l??!1,onChange:c,caller:dd}),[E,b]=C.useState(null),[v,y]=C.useState(null),p=C.useRef(!1),x=E?!!f||!!E.closest("form"):!0,k={checked:_,disabled:m,setChecked:S,control:E,setControl:b,name:a,form:f,value:g,hasConsumerStoppedPropagationRef:p,required:h,defaultChecked:mn(l)?!1:l,isFormControl:x,bubbleInput:v,setBubbleInput:y};return i.jsx(AO,{scope:t,...k,children:MO(d)?d(k):o})}var R1="CheckboxTrigger",T1=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:s,...o},l)=>{const{control:m,value:f,disabled:a,checked:c,required:h,setControl:g,setChecked:d,hasConsumerStoppedPropagationRef:_,isFormControl:S,bubbleInput:E}=Jp(R1,e),b=ze(l,g),v=C.useRef(c);return C.useEffect(()=>{const y=m==null?void 0:m.form;if(y){const p=()=>d(v.current);return y.addEventListener("reset",p),()=>y.removeEventListener("reset",p)}},[m,d]),i.jsx(Oe.button,{type:"button",role:"checkbox","aria-checked":mn(c)?"mixed":c,"aria-required":h,"data-state":O1(c),"data-disabled":a?"":void 0,disabled:a,value:f,...o,ref:b,onKeyDown:ye(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:ye(s,y=>{d(p=>mn(p)?!0:!p),E&&S&&(_.current=y.isPropagationStopped(),_.current||y.stopPropagation())})})});T1.displayName=R1;var Qp=C.forwardRef((e,t)=>{const{__scopeCheckbox:s,name:o,checked:l,defaultChecked:m,required:f,disabled:a,value:c,onCheckedChange:h,form:g,...d}=e;return i.jsx(DO,{__scopeCheckbox:s,checked:l,defaultChecked:m,disabled:a,required:f,onCheckedChange:h,name:o,form:g,value:c,internal_do_not_use_render:({isFormControl:_})=>i.jsxs(i.Fragment,{children:[i.jsx(T1,{...d,ref:t,__scopeCheckbox:s}),_&&i.jsx(L1,{__scopeCheckbox:s})]})})});Qp.displayName=dd;var A1="CheckboxIndicator",D1=C.forwardRef((e,t)=>{const{__scopeCheckbox:s,forceMount:o,...l}=e,m=Jp(A1,s);return i.jsx(Vt,{present:o||mn(m.checked)||m.checked===!0,children:i.jsx(Oe.span,{"data-state":O1(m.checked),"data-disabled":m.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});D1.displayName=A1;var M1="CheckboxBubbleInput",L1=C.forwardRef(({__scopeCheckbox:e,...t},s)=>{const{control:o,hasConsumerStoppedPropagationRef:l,checked:m,defaultChecked:f,required:a,disabled:c,name:h,value:g,form:d,bubbleInput:_,setBubbleInput:S}=Jp(M1,e),E=ze(s,S),b=dp(m),v=up(o);C.useEffect(()=>{const p=_;if(!p)return;const x=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(x,"checked").set,T=!l.current;if(b!==m&&P){const R=new Event("click",{bubbles:T});p.indeterminate=mn(m),P.call(p,mn(m)?!1:m),p.dispatchEvent(R)}},[_,b,m,l]);const y=C.useRef(mn(m)?!1:m);return i.jsx(Oe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??y.current,required:a,disabled:c,name:h,value:g,form:d,...t,tabIndex:-1,ref:E,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});L1.displayName=M1;function MO(e){return typeof e=="function"}function mn(e){return e==="indeterminate"}function O1(e){return mn(e)?"indeterminate":e?"checked":"unchecked"}const Pc=C.forwardRef(({className:e,...t},s)=>i.jsx(Qp,{ref:s,className:xe("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:i.jsx(D1,{className:xe("flex items-center justify-center text-current"),children:i.jsx(Rr,{className:"h-4 w-4"})})}));Pc.displayName=Qp.displayName;const jh={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 LO({open:e,onOpenChange:t,projectDir:s,onSynced:o}){var j,M,$;const[l,m]=C.useState("claude"),[f,a]=C.useState("antigravity"),[c,h]=C.useState(null),[g,d]=C.useState(!1),[_,S]=C.useState(!1),[E,b]=C.useState(new Set);C.useEffect(()=>{e&&s&&v()},[e,l,f,s]),C.useEffect(()=>{e&&b(new Set)},[e]);const v=async()=>{var F;d(!0);try{const U=await Se.getSyncPreview(s,l,f);h(U);const H=new Set(((F=U.files)==null?void 0:F.filter(Q=>Q.status==="new"||Q.status==="different").map(Q=>Q.name))||[]);b(H)}catch(U){le.error("Failed to load sync preview: "+U.message),h(null)}finally{d(!1)}},y=()=>{m(f),a(l)},p=F=>{const U=new Set(E);U.has(F)?U.delete(F):U.add(F),b(U)},x=()=>{var F,U;E.size===((F=c==null?void 0:c.files)==null?void 0:F.length)?b(new Set):b(new Set(((U=c==null?void 0:c.files)==null?void 0:U.map(H=>H.name))||[]))},k=async()=>{if(E.size===0){le.error("Please select at least one file to sync");return}S(!0);try{const F=await Se.syncRules(s,l,f,Array.from(E));F.success?(le.success(`Synced ${F.synced.length} file(s) to ${jh[f].name}`),o==null||o(),t(!1)):le.error(F.error||"Sync failed")}catch(F){le.error("Sync failed: "+F.message)}finally{S(!1)}},P=F=>{switch(F){case"new":return i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700",children:"New"});case"different":return i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-yellow-100 text-yellow-700",children:"Modified"});case"identical":return i.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}},T=jh[l],R=jh[f];return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-lg",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx(gr,{className:"w-5 h-5 text-indigo-500"}),"Sync Rules Between Tools"]}),i.jsx(Nr,{children:"Copy rules from one AI tool's configuration to another."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"From"}),i.jsxs(Yi,{value:l,onValueChange:m,children:[i.jsx(Qn,{className:"w-full",children:i.jsx(Xi,{})}),i.jsxs(Zn,{children:[i.jsx(pr,{value:"claude",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),i.jsx(pr,{value:"gemini",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),i.jsx(pr,{value:"antigravity",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]}),i.jsx(ue,{variant:"ghost",size:"icon",onClick:y,className:"mt-5",title:"Swap direction",children:i.jsx(T_,{className:"w-4 h-4"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"To"}),i.jsxs(Yi,{value:f,onValueChange:a,children:[i.jsx(Qn,{className:"w-full",children:i.jsx(Xi,{})}),i.jsxs(Zn,{children:[i.jsx(pr,{value:"claude",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),i.jsx(pr,{value:"gemini",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),i.jsx(pr,{value:"antigravity",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]})]}),i.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[i.jsxs("div",{children:["Source: ",i.jsxs("code",{className:"bg-muted px-1 rounded",children:[T.folder,"/rules/"]})]}),i.jsxs("div",{children:["Target: ",i.jsxs("code",{className:"bg-muted px-1 rounded",children:[R.folder,"/rules/"]})]})]}),i.jsxs("div",{className:"border rounded-lg",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[i.jsx("span",{className:"text-sm font-medium",children:"Rules to Sync"}),((j=c==null?void 0:c.files)==null?void 0:j.length)>0&&i.jsx(ue,{variant:"ghost",size:"sm",onClick:x,className:"h-6 text-xs",children:E.size===c.files.length?"Deselect All":"Select All"})]}),i.jsx("div",{className:"max-h-64 overflow-auto",children:g?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(dt,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):c!=null&&c.error?i.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-amber-600",children:[i.jsx(ca,{className:"w-4 h-4"}),c.error]}):((M=c==null?void 0:c.files)==null?void 0:M.length)===0?i.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No rules found in source folder"}):i.jsx("div",{className:"divide-y",children:($=c==null?void 0:c.files)==null?void 0:$.map(F=>i.jsxs("label",{className:xe("flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-muted/30",E.has(F.name)&&"bg-primary/5"),children:[i.jsx(Pc,{checked:E.has(F.name),onCheckedChange:()=>p(F.name)}),i.jsx(mr,{className:"w-4 h-4 text-purple-500"}),i.jsx("span",{className:"flex-1 text-sm",children:F.name}),P(F.status)]},F.name))})})]}),(c==null?void 0:c.files)&&E.size>0&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[E.size," file(s) selected for sync"]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(ue,{onClick:k,disabled:_||g||E.size===0,children:_?i.jsxs(i.Fragment,{children:[i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}),"Syncing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Rr,{className:"w-4 h-4 mr-2"}),"Sync ",E.size," File(s)"]})})]})]})})}function OO(e,t){return C.useReducer((s,o)=>t[s][o]??s,e)}var Zp="ScrollArea",[I1]=yr(Zp),[IO,Vr]=I1(Zp),B1=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,type:o="hover",dir:l,scrollHideDelay:m=600,...f}=e,[a,c]=C.useState(null),[h,g]=C.useState(null),[d,_]=C.useState(null),[S,E]=C.useState(null),[b,v]=C.useState(null),[y,p]=C.useState(0),[x,k]=C.useState(0),[P,T]=C.useState(!1),[R,j]=C.useState(!1),M=ze(t,F=>c(F)),$=Sa(l);return i.jsx(IO,{scope:s,type:o,dir:$,scrollHideDelay:m,scrollArea:a,viewport:h,onViewportChange:g,content:d,onContentChange:_,scrollbarX:S,onScrollbarXChange:E,scrollbarXEnabled:P,onScrollbarXEnabledChange:T,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:R,onScrollbarYEnabledChange:j,onCornerWidthChange:p,onCornerHeightChange:k,children:i.jsx(Oe.div,{dir:$,...f,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});B1.displayName=Zp;var F1="ScrollAreaViewport",$1=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,children:o,nonce:l,...m}=e,f=Vr(F1,s),a=C.useRef(null),c=ze(t,a,f.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),i.jsx(Oe.div,{"data-radix-scroll-area-viewport":"",...m,ref:c,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:f.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});$1.displayName=F1;var vs="ScrollAreaScrollbar",em=C.forwardRef((e,t)=>{const{forceMount:s,...o}=e,l=Vr(vs,e.__scopeScrollArea),{onScrollbarXEnabledChange:m,onScrollbarYEnabledChange:f}=l,a=e.orientation==="horizontal";return C.useEffect(()=>(a?m(!0):f(!0),()=>{a?m(!1):f(!1)}),[a,m,f]),l.type==="hover"?i.jsx(BO,{...o,ref:t,forceMount:s}):l.type==="scroll"?i.jsx(FO,{...o,ref:t,forceMount:s}):l.type==="auto"?i.jsx(H1,{...o,ref:t,forceMount:s}):l.type==="always"?i.jsx(tm,{...o,ref:t}):null});em.displayName=vs;var BO=C.forwardRef((e,t)=>{const{forceMount:s,...o}=e,l=Vr(vs,e.__scopeScrollArea),[m,f]=C.useState(!1);return C.useEffect(()=>{const a=l.scrollArea;let c=0;if(a){const h=()=>{window.clearTimeout(c),f(!0)},g=()=>{c=window.setTimeout(()=>f(!1),l.scrollHideDelay)};return a.addEventListener("pointerenter",h),a.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",h),a.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),i.jsx(Vt,{present:s||m,children:i.jsx(H1,{"data-state":m?"visible":"hidden",...o,ref:t})})}),FO=C.forwardRef((e,t)=>{const{forceMount:s,...o}=e,l=Vr(vs,e.__scopeScrollArea),m=e.orientation==="horizontal",f=hd(()=>c("SCROLL_END"),100),[a,c]=OO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return C.useEffect(()=>{if(a==="idle"){const h=window.setTimeout(()=>c("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(h)}},[a,l.scrollHideDelay,c]),C.useEffect(()=>{const h=l.viewport,g=m?"scrollLeft":"scrollTop";if(h){let d=h[g];const _=()=>{const S=h[g];d!==S&&(c("SCROLL"),f()),d=S};return h.addEventListener("scroll",_),()=>h.removeEventListener("scroll",_)}},[l.viewport,m,c,f]),i.jsx(Vt,{present:s||a!=="hidden",children:i.jsx(tm,{"data-state":a==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:ye(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ye(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),H1=C.forwardRef((e,t)=>{const s=Vr(vs,e.__scopeScrollArea),{forceMount:o,...l}=e,[m,f]=C.useState(!1),a=e.orientation==="horizontal",c=hd(()=>{if(s.viewport){const h=s.viewport.offsetWidth<s.viewport.scrollWidth,g=s.viewport.offsetHeight<s.viewport.scrollHeight;f(a?h:g)}},10);return Qi(s.viewport,c),Qi(s.content,c),i.jsx(Vt,{present:o||m,children:i.jsx(tm,{"data-state":m?"visible":"hidden",...l,ref:t})})}),tm=C.forwardRef((e,t)=>{const{orientation:s="vertical",...o}=e,l=Vr(vs,e.__scopeScrollArea),m=C.useRef(null),f=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=K1(a.viewport,a.content),g={...o,sizes:a,onSizesChange:c,hasThumb:h>0&&h<1,onThumbChange:_=>m.current=_,onThumbPointerUp:()=>f.current=0,onThumbPointerDown:_=>f.current=_};function d(_,S){return UO(_,f.current,a,S)}return s==="horizontal"?i.jsx($O,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&m.current){const _=l.viewport.scrollLeft,S=Wy(_,a,l.dir);m.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:_=>{l.viewport&&(l.viewport.scrollLeft=_)},onDragScroll:_=>{l.viewport&&(l.viewport.scrollLeft=d(_,l.dir))}}):s==="vertical"?i.jsx(HO,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&m.current){const _=l.viewport.scrollTop,S=Wy(_,a);m.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:_=>{l.viewport&&(l.viewport.scrollTop=_)},onDragScroll:_=>{l.viewport&&(l.viewport.scrollTop=d(_))}}):null}),$O=C.forwardRef((e,t)=>{const{sizes:s,onSizesChange:o,...l}=e,m=Vr(vs,e.__scopeScrollArea),[f,a]=C.useState(),c=C.useRef(null),h=ze(t,c,m.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),i.jsx(z1,{"data-orientation":"horizontal",...l,ref:h,sizes:s,style:{bottom:0,left:m.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:m.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ud(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,d)=>{if(m.viewport){const _=m.viewport.scrollLeft+g.deltaX;e.onWheelScroll(_),q1(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&m.viewport&&f&&o({content:m.viewport.scrollWidth,viewport:m.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Tc(f.paddingLeft),paddingEnd:Tc(f.paddingRight)}})}})}),HO=C.forwardRef((e,t)=>{const{sizes:s,onSizesChange:o,...l}=e,m=Vr(vs,e.__scopeScrollArea),[f,a]=C.useState(),c=C.useRef(null),h=ze(t,c,m.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),i.jsx(z1,{"data-orientation":"vertical",...l,ref:h,sizes:s,style:{top:0,right:m.dir==="ltr"?0:void 0,left:m.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ud(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,d)=>{if(m.viewport){const _=m.viewport.scrollTop+g.deltaY;e.onWheelScroll(_),q1(_,d)&&g.preventDefault()}},onResize:()=>{c.current&&m.viewport&&f&&o({content:m.viewport.scrollHeight,viewport:m.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Tc(f.paddingTop),paddingEnd:Tc(f.paddingBottom)}})}})}),[VO,V1]=I1(vs),z1=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,sizes:o,hasThumb:l,onThumbChange:m,onThumbPointerUp:f,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:h,onWheelScroll:g,onResize:d,..._}=e,S=Vr(vs,s),[E,b]=C.useState(null),v=ze(t,M=>b(M)),y=C.useRef(null),p=C.useRef(""),x=S.viewport,k=o.content-o.viewport,P=Mt(g),T=Mt(c),R=hd(d,10);function j(M){if(y.current){const $=M.clientX-y.current.left,F=M.clientY-y.current.top;h({x:$,y:F})}}return C.useEffect(()=>{const M=$=>{const F=$.target;(E==null?void 0:E.contains(F))&&P($,k)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,E,k,P]),C.useEffect(T,[o,T]),Qi(E,R),Qi(S.content,R),i.jsx(VO,{scope:s,scrollbar:E,hasThumb:l,onThumbChange:Mt(m),onThumbPointerUp:Mt(f),onThumbPositionChange:T,onThumbPointerDown:Mt(a),children:i.jsx(Oe.div,{..._,ref:v,style:{position:"absolute",..._.style},onPointerDown:ye(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),y.current=E.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),j(M))}),onPointerMove:ye(e.onPointerMove,j),onPointerUp:ye(e.onPointerUp,M=>{const $=M.target;$.hasPointerCapture(M.pointerId)&&$.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=p.current,S.viewport&&(S.viewport.style.scrollBehavior=""),y.current=null})})})}),Rc="ScrollAreaThumb",W1=C.forwardRef((e,t)=>{const{forceMount:s,...o}=e,l=V1(Rc,e.__scopeScrollArea);return i.jsx(Vt,{present:s||l.hasThumb,children:i.jsx(zO,{ref:t,...o})})}),zO=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,style:o,...l}=e,m=Vr(Rc,s),f=V1(Rc,s),{onThumbPositionChange:a}=f,c=ze(t,d=>f.onThumbChange(d)),h=C.useRef(void 0),g=hd(()=>{h.current&&(h.current(),h.current=void 0)},100);return C.useEffect(()=>{const d=m.viewport;if(d){const _=()=>{if(g(),!h.current){const S=KO(d,a);h.current=S,a()}};return a(),d.addEventListener("scroll",_),()=>d.removeEventListener("scroll",_)}},[m.viewport,g,a]),i.jsx(Oe.div,{"data-state":f.hasThumb?"visible":"hidden",...l,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:ye(e.onPointerDownCapture,d=>{const S=d.target.getBoundingClientRect(),E=d.clientX-S.left,b=d.clientY-S.top;f.onThumbPointerDown({x:E,y:b})}),onPointerUp:ye(e.onPointerUp,f.onThumbPointerUp)})});W1.displayName=Rc;var rm="ScrollAreaCorner",U1=C.forwardRef((e,t)=>{const s=Vr(rm,e.__scopeScrollArea),o=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&o?i.jsx(WO,{...e,ref:t}):null});U1.displayName=rm;var WO=C.forwardRef((e,t)=>{const{__scopeScrollArea:s,...o}=e,l=Vr(rm,s),[m,f]=C.useState(0),[a,c]=C.useState(0),h=!!(m&&a);return Qi(l.scrollbarX,()=>{var d;const g=((d=l.scrollbarX)==null?void 0:d.offsetHeight)||0;l.onCornerHeightChange(g),c(g)}),Qi(l.scrollbarY,()=>{var d;const g=((d=l.scrollbarY)==null?void 0:d.offsetWidth)||0;l.onCornerWidthChange(g),f(g)}),h?i.jsx(Oe.div,{...o,ref:t,style:{width:m,height:a,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Tc(e){return e?parseInt(e,10):0}function K1(e,t){const s=e/t;return isNaN(s)?0:s}function ud(e){const t=K1(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-s)*t;return Math.max(o,18)}function UO(e,t,s,o="ltr"){const l=ud(s),m=l/2,f=t||m,a=l-f,c=s.scrollbar.paddingStart+f,h=s.scrollbar.size-s.scrollbar.paddingEnd-a,g=s.content-s.viewport,d=o==="ltr"?[0,g]:[g*-1,0];return G1([c,h],d)(e)}function Wy(e,t,s="ltr"){const o=ud(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,m=t.scrollbar.size-l,f=t.content-t.viewport,a=m-o,c=s==="ltr"?[0,f]:[f*-1,0],h=Zh(e,c);return G1([0,f],[0,a])(h)}function G1(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(s-e[0])}}function q1(e,t){return e>0&&e<t}var KO=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},o=0;return(function l(){const m={left:e.scrollLeft,top:e.scrollTop},f=s.left!==m.left,a=s.top!==m.top;(f||a)&&t(),s=m,o=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(o)};function hd(e,t){const s=Mt(e),o=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(o.current),[]),C.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(s,t)},[s,t])}function Qi(e,t){const s=Mt(t);Lt(()=>{let o=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(s)});return l.observe(e),()=>{window.cancelAnimationFrame(o),l.unobserve(e)}}},[e,s])}var Y1=B1,GO=$1,qO=U1;const ni=C.forwardRef(({className:e,children:t,...s},o)=>i.jsxs(Y1,{ref:o,className:xe("relative overflow-hidden",e),...s,children:[i.jsx(GO,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(X1,{}),i.jsx(qO,{})]}));ni.displayName=Y1.displayName;const X1=C.forwardRef(({className:e,orientation:t="vertical",...s},o)=>i.jsx(em,{ref:o,orientation:t,className:xe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...s,children:i.jsx(W1,{className:"relative flex-1 rounded-full bg-border"})}));X1.displayName=em.displayName;const ga={mcps:{icon:ip,color:"text-blue-600",bgColor:"bg-blue-50",label:"MCP Servers"},settings:{icon:yn,color:"text-gray-600 dark:text-slate-400",bgColor:"bg-gray-50 dark:bg-slate-800",label:"Settings"},command:{icon:St,color:"text-green-600",bgColor:"bg-green-50",label:"Command"},rule:{icon:Kn,color:"text-purple-600",bgColor:"bg-purple-50",label:"Rule"},workflow:{icon:M_,color:"text-cyan-600",bgColor:"bg-cyan-50",label:"Workflow"},claudemd:{icon:mr,color:"text-orange-600",bgColor:"bg-orange-50",label:"CLAUDE.md"},geminimd:{icon:mr,color:"text-blue-600",bgColor:"bg-blue-50",label:"GEMINI.md"},folder:{icon:Nt,color:"text-yellow-600",bgColor:"bg-yellow-50",label:"Folder"}},Nh={home:{bg:"bg-indigo-50",border:"border-indigo-200",text:"text-indigo-700"},intermediate:{bg:"bg-gray-50 dark:bg-slate-800",border:"border-gray-200 dark:border-slate-700",text:"text-gray-700 dark:text-slate-300"},project:{bg:"bg-green-50",border:"border-green-200",text:"text-green-700"}};function ac({item:e,level:t=0,selectedPath:s,onSelect:o,onContextMenu:l,expandedFolders:m,onToggleFolder:f}){const a=ga[e.type]||ga.folder,c=a.icon,h=s===e.path,g=e.type==="folder",d=m[e.path];return i.jsxs("div",{children:[i.jsxs("div",{className:xe("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 transition-colors",h&&"bg-blue-100 hover:bg-blue-100"),style:{paddingLeft:`${t*16+8}px`},onClick:()=>g?f(e.path):o(e),onContextMenu:_=>l(_,e),children:[g&&i.jsx("span",{className:"w-4 h-4 flex items-center justify-center",children:d?i.jsx(to,{className:"w-3 h-3"}):i.jsx(Bc,{className:"w-3 h-3"})}),!g&&i.jsx("span",{className:"w-4"}),i.jsx(c,{className:xe("w-4 h-4",a.color)}),i.jsx("span",{className:"flex-1 truncate",children:e.name}),e.mcpCount>0&&i.jsx(st,{variant:"secondary",className:"text-xs px-1.5 py-0",children:e.mcpCount})]}),g&&d&&e.children&&i.jsx("div",{children:e.children.map(_=>i.jsx(ac,{item:_,level:t+1,selectedPath:s,onSelect:o,onContextMenu:l,expandedFolders:m,onToggleFolder:f},_.path))})]})}function YO({folder:e,isFirst:t,isLast:s,onCreateFile:o}){const l=t?Nh.home:s?Nh.project:Nh.intermediate;return i.jsxs("div",{className:xe("flex items-center justify-between px-3 py-2 border-b",l.bg,l.border),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[t?i.jsx(rp,{className:"w-4 h-4"}):i.jsx(Nt,{className:"w-4 h-4"}),i.jsx("span",{className:xe("font-medium text-sm",l.text),children:e.label}),!e.exists&&i.jsx(st,{variant:"outline",className:"text-xs",children:"no .claude"})]}),i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",children:i.jsx(Ht,{className:"w-4 h-4"})})}),i.jsxs(wn,{align:"end",children:[i.jsxs(lt,{onClick:()=>o(e.dir,"mcps"),children:[i.jsx(ip,{className:"w-4 h-4 mr-2"}),"mcps.json"]}),i.jsxs(lt,{onClick:()=>o(e.dir,"settings"),children:[i.jsx(yn,{className:"w-4 h-4 mr-2"}),"settings.json"]}),i.jsx(si,{}),i.jsxs(lt,{onClick:()=>o(e.dir,"command"),children:[i.jsx(St,{className:"w-4 h-4 mr-2"}),"New Command"]}),i.jsxs(lt,{onClick:()=>o(e.dir,"rule"),children:[i.jsx(Kn,{className:"w-4 h-4 mr-2"}),"New Rule"]}),i.jsxs(lt,{onClick:()=>o(e.dir,"workflow"),children:[i.jsx(M_,{className:"w-4 h-4 mr-2"}),"New Workflow"]}),i.jsx(si,{}),i.jsxs(lt,{onClick:()=>o(e.dir,"claudemd"),children:[i.jsx(mr,{className:"w-4 h-4 mr-2"}),"CLAUDE.md"]})]})]})]})}function XO({content:e,parsed:t,onSave:s,registry:o}){const[l,m]=C.useState(t||{include:[],mcpServers:{}}),[f,a]=C.useState("rich"),[c,h]=C.useState(JSON.stringify(t||{},null,2)),[g,d]=C.useState(!1),[_,S]=C.useState({open:!1,json:""});C.useEffect(()=>{m(t||{include:[],mcpServers:{}}),h(JSON.stringify(t||{},null,2)),d(!1)},[t]);const E=p=>{var k;const x=(k=l.include)!=null&&k.includes(p)?l.include.filter(P=>P!==p):[...l.include||[],p];m({...l,include:x}),d(!0)},b=()=>{if(f==="json")try{const p=JSON.parse(c);s(JSON.stringify(p,null,2))}catch{le.error("Invalid JSON");return}else s(JSON.stringify(l,null,2));d(!1)},v=()=>{if(!_.json.trim()){le.error("Please paste the MCP JSON configuration");return}try{let p;try{p=JSON.parse(_.json)}catch{le.error("Invalid JSON format");return}let x={};if(p.mcpServers&&typeof p.mcpServers=="object")x=p.mcpServers;else if(typeof p=="object"&&!Array.isArray(p)){if(Object.keys(p).includes("command")){le.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}x=p}if(Object.keys(x).length===0){le.error("No MCP configurations found in the JSON");return}for(const[R,j]of Object.entries(x))if(!j.command){le.error(`MCP "${R}" is missing required "command" field`);return}const k={...l.mcpServers||{},...x},P={...l,mcpServers:k};m(P),h(JSON.stringify(P,null,2)),d(!0);const T=Object.keys(x).length;le.success(`Added ${T} MCP${T>1?"s":""} - click Save to apply`),S({open:!1,json:""})}catch(p){le.error("Failed to add: "+p.message)}},y=o!=null&&o.mcpServers?Object.keys(o.mcpServers):[];return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[i.jsx(Kc,{value:f,onValueChange:a,children:i.jsxs(ka,{className:"h-8",children:[i.jsx(Zr,{value:"rich",className:"text-xs px-3",children:"Rich Editor"}),i.jsx(Zr,{value:"json",className:"text-xs px-3",children:"JSON"})]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{size:"sm",variant:"outline",onClick:()=>S({open:!0,json:""}),children:[i.jsx(Ht,{className:"w-4 h-4 mr-1"}),"Add MCP"]}),g&&i.jsxs(ue,{size:"sm",onClick:b,children:[i.jsx(oi,{className:"w-4 h-4 mr-1"}),"Save"]})]})]}),i.jsx(ni,{className:"flex-1",children:f==="rich"?i.jsxs("div",{className:"p-4 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium mb-2",children:"Registry MCPs"}),i.jsx("div",{className:"space-y-2",children:y.length===0?i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"No MCPs in registry"}):y.map(p=>{var x;return i.jsxs("div",{className:"flex items-center justify-between p-2 rounded border bg-white dark:bg-slate-950",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ip,{className:"w-4 h-4 text-blue-500"}),i.jsx("span",{className:"text-sm",children:p})]}),i.jsx(xt,{checked:(x=l.include)==null?void 0:x.includes(p),onCheckedChange:()=>E(p)})]},p)})})]}),Object.keys(l.mcpServers||{}).length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium mb-2",children:"Inline MCPs"}),i.jsx("div",{className:"space-y-2",children:Object.entries(l.mcpServers).map(([p,x])=>{var k;return i.jsxs("div",{className:"p-2 rounded border bg-white dark:bg-slate-950 group",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm font-medium",children:p}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(st,{variant:"outline",className:"text-xs",children:"inline"}),i.jsx(ue,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>{const{[p]:P,...T}=l.mcpServers,R={...l,mcpServers:T};m(R),h(JSON.stringify(R,null,2)),d(!0),le.success(`Removed ${p} - click Save to apply`)},children:i.jsx(qn,{className:"w-3.5 h-3.5"})})]})]}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 font-mono",children:[x.command," ",(k=x.args)==null?void 0:k.join(" ")]})]},p)})})]})]}):i.jsx(Ze,{className:"w-full h-full min-h-[400px] font-mono text-sm border-0 rounded-none resize-none",value:c,onChange:p=>{h(p.target.value),d(!0)}})}),i.jsx(ir,{open:_.open,onOpenChange:p=>S({..._,open:p}),children:i.jsxs(Qt,{className:"bg-white dark:bg-slate-950 max-w-2xl",children:[i.jsxs(Zt,{children:[i.jsx(tr,{children:"Add MCP to Config"}),i.jsx(Nr,{children:"Paste the MCP JSON configuration to add to this config file."})]}),i.jsxs("div",{className:"py-4",children:[i.jsx(Ze,{value:_.json,onChange:p=>S({..._,json:p.target.value}),placeholder:`{
|
|
458
|
+
"my-mcp": {
|
|
459
|
+
"command": "npx",
|
|
460
|
+
"args": ["-y", "@example/mcp-server"],
|
|
461
|
+
"env": {
|
|
462
|
+
"API_KEY": "\${API_KEY}"
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}`,className:"font-mono text-sm bg-gray-50 dark:bg-slate-800",rows:12}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:["Accepts formats: ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "name": { "command": "...", "args": [...] } }'})," or ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "mcpServers": { ... } }'})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>S({open:!1,json:""}),children:"Cancel"}),i.jsxs(ue,{onClick:v,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function JO({open:e,onClose:t,fileType:s,currentContent:o,onInsert:l}){const[m,f]=C.useState(""),[a,c]=C.useState(""),[h,g]=C.useState(!1),d={rule:[{label:"Code Style",prompt:"Create a rule for code formatting and style conventions"},{label:"Testing",prompt:"Create a rule for testing requirements and best practices"},{label:"Security",prompt:"Create a rule for security guidelines and vulnerability prevention"},{label:"Documentation",prompt:"Create a rule for documentation standards"}],command:[{label:"Build & Deploy",prompt:"Create a command for building and deploying the project"},{label:"Testing",prompt:"Create a command for running tests with coverage"},{label:"Database",prompt:"Create a command for database migrations"},{label:"Code Generation",prompt:"Create a command for generating boilerplate code"}],claudemd:[{label:"Project Overview",prompt:"Create a project overview section with tech stack and conventions"},{label:"API Documentation",prompt:"Create API documentation template"},{label:"Development Setup",prompt:"Create development environment setup instructions"},{label:"Architecture",prompt:"Create architecture documentation"}]},_=d[s]||d.claudemd,S=v=>{const y=v||m;if(!y.trim()){le.error("Please enter a prompt or select a template");return}g(!0),setTimeout(()=>{let p="";if(s==="rule")p=`# ${y.replace(/^Create a rule for\s*/i,"").replace(/\s+/g," ").trim()}
|
|
466
|
+
|
|
467
|
+
`,p+=`## Guidelines
|
|
468
|
+
|
|
469
|
+
`,p+=`- Follow consistent patterns throughout the codebase
|
|
470
|
+
`,p+=`- Document any deviations from these guidelines
|
|
471
|
+
`,p+=`- Review changes for compliance before merging
|
|
472
|
+
|
|
473
|
+
`,p+=`## Examples
|
|
474
|
+
|
|
475
|
+
`,p+="```\n// Good example\n// TODO: Add specific examples\n```\n\n",p+=`## Exceptions
|
|
476
|
+
|
|
477
|
+
`,p+=`- None documented yet
|
|
478
|
+
`;else if(s==="command"){const x=y.replace(/^Create a command for\s*/i,"").toLowerCase().replace(/\s+/g,"-");p=`---
|
|
479
|
+
`,p+=`name: ${x}
|
|
480
|
+
`,p+=`description: ${y}
|
|
481
|
+
`,p+=`---
|
|
482
|
+
|
|
483
|
+
`,p+=`# ${y}
|
|
484
|
+
|
|
485
|
+
`,p+=`## Usage
|
|
486
|
+
|
|
487
|
+
`,p+=`Run this command when you need to ${y.toLowerCase()}.
|
|
488
|
+
|
|
489
|
+
`,p+=`## Steps
|
|
490
|
+
|
|
491
|
+
`,p+=`1. First, verify prerequisites are met
|
|
492
|
+
`,p+=`2. Execute the main operation
|
|
493
|
+
`,p+=`3. Verify the results
|
|
494
|
+
|
|
495
|
+
`,p+=`## Example Output
|
|
496
|
+
|
|
497
|
+
`,p+="```\n// Expected output format\n```\n"}else p=`# ${y.replace(/^Create\s*/i,"")}
|
|
498
|
+
|
|
499
|
+
`,p+=`## Overview
|
|
500
|
+
|
|
501
|
+
`,p+=`TODO: Add overview here.
|
|
502
|
+
|
|
503
|
+
`,p+=`## Details
|
|
504
|
+
|
|
505
|
+
`,p+=`TODO: Add detailed information.
|
|
506
|
+
|
|
507
|
+
`,p+=`## Related
|
|
508
|
+
|
|
509
|
+
`,p+=`- See also: related documentation
|
|
510
|
+
`;c(p),g(!1)},500)},E=v=>{if(!a){le.error("Generate content first");return}l(v==="replace"?a:o+`
|
|
511
|
+
|
|
512
|
+
`+a),t(),le.success("Content inserted")},b=()=>{f(""),c(""),t()};return i.jsx(ir,{open:e,onOpenChange:b,children:i.jsxs(Qt,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx($t,{className:"w-5 h-5 text-indigo-600"}),"AI Assist"]}),i.jsxs(Nr,{children:["Generate content for your ",s||"file"," using templates or custom prompts"]})]}),i.jsxs("div",{className:"flex-1 overflow-auto space-y-4 py-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Quick Templates"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(v=>i.jsx(ue,{variant:"outline",size:"sm",onClick:()=>{f(v.prompt),S(v.prompt)},disabled:h,children:v.label},v.label))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Custom Prompt"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{placeholder:"Describe what you want to generate...",value:m,onChange:v=>f(v.target.value),onKeyDown:v=>v.key==="Enter"&&S()}),i.jsx(ue,{onClick:()=>S(),disabled:h||!m.trim(),children:h?i.jsx(gr,{className:"w-4 h-4 animate-spin"}):"Generate"})]})]}),a&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2 block",children:"Generated Content"}),i.jsx(Ze,{value:a,onChange:v=>c(v.target.value),className:"font-mono text-sm min-h-[200px]"})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:b,children:"Cancel"}),a&&i.jsxs(i.Fragment,{children:[i.jsx(ue,{variant:"outline",onClick:()=>E("append"),children:"Append to File"}),i.jsx(ue,{onClick:()=>E("replace"),className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:"Replace Content"})]})]})]})})}function Uy({content:e,onSave:t,fileType:s}){const[o,l]=C.useState(e||""),[m,f]=C.useState(!1),[a,c]=C.useState(!1);C.useEffect(()=>{l(e||""),f(!1)},[e]);const h=()=>{t(o),f(!1)},g=_=>{l(_),f(!0)},d=ga[s]||ga.claudemd;return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b bg-gray-50 dark:bg-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(d.icon,{className:xe("w-4 h-4",d.color)}),i.jsx("span",{className:"text-sm font-medium",children:d.label})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>c(!0),children:[i.jsx($t,{className:"w-4 h-4 mr-1"}),"AI Assist"]}),m&&i.jsxs(ue,{size:"sm",onClick:h,children:[i.jsx(oi,{className:"w-4 h-4 mr-1"}),"Save"]})]})]}),i.jsx(Ze,{className:"flex-1 w-full font-mono text-sm border-0 rounded-none resize-none p-4",value:o,onChange:_=>{l(_.target.value),f(!0)},placeholder:`Enter ${d.label.toLowerCase()} content...`}),i.jsx(JO,{open:a,onClose:()=>c(!1),fileType:s,currentContent:o,onInsert:g})]})}function QO({content:e,parsed:t,onSave:s,filePath:o}){const l=async a=>{const c=JSON.stringify(a,null,2);s(c)},m=(o==null?void 0:o.includes(".gemini"))||(o==null?void 0:o.includes("/.gemini/")),f=(o==null?void 0:o.includes(".agent"))||(o==null?void 0:o.includes("/antigravity/"));return m&&!f?i.jsx("div",{className:"h-full overflow-auto p-4",children:i.jsx(P1,{settings:t||{},onSave:l,loading:!1,settingsPath:o||"~/.gemini/settings.json"})}):i.jsx("div",{className:"h-full overflow-auto p-4",children:i.jsx(N1,{settings:t||{},onSave:l,loading:!1,settingsPath:o||"~/.claude/settings.json"})})}function ZO({open:e,onClose:t,item:s,intermediatePaths:o,onMove:l}){const[m,f]=C.useState("copy"),[a,c]=C.useState(null),[h,g]=C.useState(""),[d,_]=C.useState(!1),S=()=>{const E=h.trim()||a;if(!E){le.error("Please select or enter a target path");return}l(s.path,E,m,d)};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-md",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{children:[m==="copy"?"Copy":"Move"," ",s==null?void 0:s.name]}),i.jsx(Nr,{children:"Select a destination for this file"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{variant:m==="copy"?"default":"outline",size:"sm",onClick:()=>f("copy"),children:[i.jsx(Gi,{className:"w-4 h-4 mr-1"}),"Copy"]}),i.jsxs(ue,{variant:m==="move"?"default":"outline",size:"sm",onClick:()=>f("move"),children:[i.jsx(F_,{className:"w-4 h-4 mr-1"}),"Move"]})]}),i.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:o==null?void 0:o.map(E=>i.jsxs("div",{className:xe("flex items-center justify-between p-2 rounded border cursor-pointer",a===E.dir?"border-blue-500 bg-blue-50":"hover:bg-gray-50 dark:bg-slate-800"),onClick:()=>{c(E.dir),g("")},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[E.isHome?i.jsx(rp,{className:"w-4 h-4"}):i.jsx(Nt,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm",children:E.label})]}),E.hasClaudeFolder?i.jsx(st,{variant:"secondary",className:"text-xs",children:"exists"}):i.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},E.dir))}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),i.jsx(Xe,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:h,onChange:E=>{g(E.target.value),c(null)}})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(xt,{checked:d,onCheckedChange:_}),i.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(ue,{onClick:S,children:m==="copy"?"Copy":"Move"})]})]})})}function eI({open:e,onClose:t,item:s,onRename:o}){const[l,m]=C.useState("");C.useEffect(()=>{s!=null&&s.name&&m(s.name.replace(/\.md$/,""))},[s,e]);const f=()=>{if(!l.trim()){le.error("Please enter a name");return}o(s,l.trim())};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-md",children:[i.jsx(Zt,{children:i.jsxs(tr,{children:["Rename ",s==null?void 0:s.type]})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"New name"}),i.jsx(Xe,{className:"mt-1",placeholder:"new-name",value:l,onChange:a=>m(a.target.value),onKeyDown:a=>a.key==="Enter"&&f()}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(ue,{onClick:f,children:"Rename"})]})]})})}function tI({open:e,onClose:t,dir:s,type:o,onCreate:l}){const[m,f]=C.useState("");C.useEffect(()=>{f("")},[e]);const a=()=>{if((o==="command"||o==="rule"||o==="workflow")&&!m.trim()){le.error("Please enter a name");return}const g=o==="command"||o==="rule"||o==="workflow"?m.endsWith(".md")?m:`${m}.md`:m;l(s,g,o)},c=ga[o]||{},h=o==="command"||o==="rule"||o==="workflow";return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-sm",children:[i.jsx(Zt,{children:i.jsxs(tr,{children:["Create ",c.label||o]})}),h&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Name"}),i.jsx(Xe,{className:"mt-1",placeholder:o==="command"?"my-command.md":o==="workflow"?"my-workflow.md":"my-rule.md",value:m,onChange:g=>f(g.target.value),onKeyDown:g=>g.key==="Enter"&&a()})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:t,children:"Cancel"}),i.jsx(ue,{onClick:a,children:"Create"})]})]})})}function rI({project:e,onRefresh:t}){var de,G,O;const[s,o]=C.useState([]),[l,m]=C.useState([]),[f,a]=C.useState(null),[c,h]=C.useState(null),[g,d]=C.useState(null),[_,S]=C.useState({}),[E,b]=C.useState(!0),[v,y]=C.useState({open:!1,item:null}),[p,x]=C.useState({open:!1,dir:null,type:null}),[k,P]=C.useState({open:!1,item:null}),[T,R]=C.useState(!1),[j,M]=C.useState(!1),[$,F]=C.useState({x:0,y:0,item:null}),[U,H]=C.useState(["claude"]),Q=C.useCallback(async()=>{var Z;try{b(!0);const[X,q,re,he]=await Promise.all([Se.getClaudeFolders(),Se.getIntermediatePaths(),Se.getRegistry(),Se.getConfig()]);o(X),m(q),a(re),H(((Z=he.config)==null?void 0:Z.enabledTools)||["claude"])}catch(X){le.error("Failed to load data: "+X.message)}finally{b(!1)}},[]);C.useEffect(()=>{Q(),h(null),d(null)},[Q,e==null?void 0:e.dir]);const V=async Z=>{h(Z);try{const X=await Se.getClaudeFile(Z.path);d(X)}catch(X){le.error("Failed to load file: "+X.message)}},K=async Z=>{if(c)try{await Se.saveClaudeFile(c.path,Z),le.success("Saved");const X=await Se.getClaudeFile(c.path);d(X),Q()}catch(X){le.error("Failed to save: "+X.message)}},J=Z=>{S(X=>({...X,[Z]:!X[Z]}))},W=(Z,X)=>{Z.preventDefault(),F({x:Z.clientX,y:Z.clientY,item:X})},D=(Z,X)=>{X==="command"||X==="rule"||X==="workflow"?x({open:!0,dir:Z,type:X}):B(Z,X==="mcps"?"mcps.json":X==="settings"?"settings.json":"CLAUDE.md",X)},B=async(Z,X,q)=>{try{const re=await Se.createClaudeFile(Z,X,q);if(le.success("Created"),x({open:!1,dir:null,type:null}),await Q(),re.path){const he={path:re.path,name:X,type:q==="command"?"command":q==="rule"?"rule":q==="workflow"?"workflow":"file"};h(he),d(re.content||"")}}catch(re){le.error("Failed to create: "+re.message)}},L=async Z=>{try{await Se.createClaudeFile(Z,"mcps.json","mcps"),le.success(`Created .claude folder at ${Z}`),R(!1),Q()}catch(X){le.error("Failed to create: "+X.message)}},z=async(Z,X)=>{try{const q=await Se.renameClaudeFile(Z.path,X);q.success?(le.success("Renamed"),P({open:!1,item:null}),await Q(),h({...Z,path:q.newPath,name:X.endsWith(".md")?X:`${X}.md`})):le.error(q.error||"Failed to rename")}catch(q){le.error("Failed to rename: "+q.message)}},ee=async Z=>{if(confirm(`Delete ${Z.name}?`))try{await Se.deleteClaudeFile(Z.path),le.success("Deleted"),(c==null?void 0:c.path)===Z.path&&(h(null),d(null)),Q()}catch(X){le.error("Failed to delete: "+X.message)}},ne=async(Z,X,q,re)=>{try{await Se.moveClaudeItem(Z,X,q,re),le.success(q==="copy"?"Copied":"Moved"),y({open:!1,item:null}),Q()}catch(he){le.error("Failed: "+he.message)}},ce=()=>{if(!c||!g)return i.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Yh,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),i.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return i.jsx(XO,{content:g.content,parsed:g.parsed,onSave:K,registry:f});case"settings":return i.jsx(QO,{content:g.content,parsed:g.parsed,onSave:K,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":return i.jsx(Uy,{content:g.content,onSave:K,fileType:c.type});default:return i.jsx(Uy,{content:g.content,onSave:K,fileType:"claudemd"})}};return E?i.jsx("div",{className:"h-full flex items-center justify-center",children:i.jsx(gr,{className:"w-6 h-6 animate-spin text-gray-400"})}):i.jsxs("div",{className:"h-full flex",children:[i.jsxs("div",{className:"w-72 border-r flex flex-col bg-white dark:bg-slate-950",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[i.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),i.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&i.jsxs(ue,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>M(!0),title:"Sync rules between tools",children:[i.jsx(OR,{className:"w-4 h-4 mr-1"}),"Sync"]}),i.jsxs(ue,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),children:[i.jsx(Ht,{className:"w-4 h-4 mr-1"}),"New"]}),i.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:Q,children:i.jsx(gr,{className:"w-4 h-4"})})]})]}),i.jsx(ni,{className:"flex-1",children:s.map((Z,X)=>{var q,re;return i.jsxs("div",{children:[i.jsx(YO,{folder:Z,isFirst:X===0,isLast:X===s.length-1,onCreateFile:D}),Z.exists&&Z.files.length>0?i.jsxs("div",{className:"py-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-orange-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Claude Code"]}),Z.files.map(he=>i.jsx(ac,{item:he,selectedPath:c==null?void 0:c.path,onSelect:V,onContextMenu:W,expandedFolders:_,onToggleFolder:J},he.path))]}):i.jsx("div",{className:"px-4 py-2 text-sm text-gray-400 italic",children:Z.exists?"Empty .claude":"No .claude folder"}),Z.geminiExists&&((q=Z.geminiFiles)==null?void 0:q.length)>0&&i.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-blue-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Gemini CLI"]}),Z.geminiFiles.map(he=>i.jsx(ac,{item:he,selectedPath:c==null?void 0:c.path,onSelect:V,onContextMenu:W,expandedFolders:_,onToggleFolder:J},he.path))]}),Z.agentExists&&((re=Z.agentFiles)==null?void 0:re.length)>0&&i.jsxs("div",{className:"py-1 border-t border-dashed border-gray-200 dark:border-slate-700 mt-1",children:[i.jsxs("div",{className:"px-3 py-1 text-[10px] font-medium text-purple-600 uppercase tracking-wide flex items-center gap-1",children:[i.jsx($t,{className:"w-3 h-3"}),"Antigravity"]}),Z.agentFiles.map(he=>i.jsx(ac,{item:he,selectedPath:c==null?void 0:c.path,onSelect:V,onContextMenu:W,expandedFolders:_,onToggleFolder:J},he.path))]})]},Z.dir)})})]}),i.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-800",children:[c&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[i.jsx("div",{className:"flex items-center gap-2 text-sm",children:i.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:i.jsx(Gi,{className:"w-4 h-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>ee(c),children:i.jsx(qn,{className:"w-4 h-4"})})]})]}),i.jsx("div",{className:"flex-1",children:ce()})]}),$.item&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>F({x:0,y:0,item:null})}),i.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:$.x,top:$.y},children:[(((de=$.item)==null?void 0:de.type)==="rule"||((G=$.item)==null?void 0:G.type)==="command"||((O=$.item)==null?void 0:O.type)==="workflow")&&i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{P({open:!0,item:$.item}),F({x:0,y:0,item:null})},children:[i.jsx(sp,{className:"w-4 h-4 mr-2"}),"Rename"]}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),F({x:0,y:0,item:null})},children:[i.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Copy to..."]}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center",onClick:()=>{y({open:!0,item:$.item}),F({x:0,y:0,item:null})},children:[i.jsx(F_,{className:"w-4 h-4 mr-2"}),"Move to..."]}),i.jsx("div",{className:"border-t my-1"}),i.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-700 dark:bg-slate-700 flex items-center text-red-600",onClick:()=>{ee($.item),F({x:0,y:0,item:null})},children:[i.jsx(qn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]}),i.jsx(ZO,{open:v.open,onClose:()=>y({open:!1,item:null}),item:v.item,intermediatePaths:l,onMove:ne}),i.jsx(tI,{open:p.open,onClose:()=>x({open:!1,dir:null,type:null}),dir:p.dir,type:p.type,onCreate:B}),i.jsx(eI,{open:k.open,onClose:()=>P({open:!1,item:null}),item:k.item,onRename:z}),i.jsx(ir,{open:T,onOpenChange:R,children:i.jsxs(Qt,{className:"max-w-md",children:[i.jsxs(Zt,{children:[i.jsx(tr,{children:"Create New .claude Folder"}),i.jsx(Nr,{children:"Select a location to create a new .claude configuration folder"})]}),i.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.filter(Z=>!s.some(X=>X.dir===Z.dir)).map(Z=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded border hover:bg-gray-50 dark:bg-slate-800 cursor-pointer",onClick:()=>L(Z.dir),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Nt,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),i.jsx("span",{className:"text-sm font-mono",children:Z.label})]}),i.jsx(st,{variant:"outline",className:"text-xs",children:"create"})]},Z.dir)),l.filter(Z=>!s.some(X=>X.dir===Z.dir)).length===0&&i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center py-4",children:"All intermediate directories already have .claude folders"})]}),i.jsx(er,{children:i.jsx(ue,{variant:"ghost",onClick:()=>R(!1),children:"Cancel"})})]})}),i.jsx(LO,{open:j,onOpenChange:M,projectDir:e==null?void 0:e.dir,onSynced:Q})]})}function sI({projects:e=[],activeProject:t=null,onSwitch:s,onAddClick:o,onManageClick:l,disabled:m=!1}){const f=(t==null?void 0:t.name)||"No Project";return i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsxs(ue,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:m,children:[i.jsx(Gn,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),i.jsx("span",{className:"truncate font-medium",children:f}),i.jsx(to,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),i.jsxs(wn,{align:"start",className:"w-72",children:[i.jsx(E1,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),i.jsx(si,{}),e.length===0?i.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[i.jsx(Nt,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),i.jsx("p",{children:"No projects registered"}),i.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):i.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(a=>i.jsxs(lt,{onClick:()=>!a.isActive&&s(a.id),className:`flex items-start gap-2 py-2 cursor-pointer ${a.isActive?"bg-indigo-50":""}`,disabled:a.isActive,children:[i.jsx("div",{className:"mt-0.5 flex-shrink-0",children:a.isActive?i.jsx(Rr,{className:"w-4 h-4 text-indigo-600"}):a.exists?i.jsx(Nt,{className:"w-4 h-4 text-gray-400"}):i.jsx(Hc,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:`truncate font-medium ${a.isActive?"text-indigo-700":""}`,children:a.name}),i.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:a.path.replace(/^\/Users\/[^/]+/,"~")}),!a.exists&&i.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),a.hasClaudeConfig&&i.jsx("div",{className:"flex-shrink-0",children:i.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},a.id))}),i.jsx(si,{}),i.jsxs(lt,{onClick:o,className:"gap-2 cursor-pointer",children:[i.jsx(Ht,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&i.jsxs(lt,{onClick:l,className:"gap-2 cursor-pointer",children:[i.jsx(YT,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}function J1({open:e,onOpenChange:t,onSelect:s,type:o="directory",initialPath:l="~",title:m="Select Path"}){const[f,a]=C.useState(""),[c,h]=C.useState([]),[g,d]=C.useState(!1),[_,S]=C.useState(null),[E,b]=C.useState(""),[v,y]=C.useState("");C.useEffect(()=>{e&&p(l)},[e,l]);const p=async R=>{d(!0),S(null);try{const j=await Se.browse(R,o);j.error?(S(j.error),j.path&&(a(j.path),y(j.path))):(a(j.path),y(j.path),h(j.items||[]),j.home&&b(j.home))}catch(j){S(j.message)}finally{d(!1)}},x=R=>{R.type==="directory"?p(R.path):o==="file"&&(s(R.path),t(!1))},k=()=>{s(f),t(!1)},P=()=>{v&&p(v)},T=R=>{R.key==="Enter"&&P()};return i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"max-w-lg",children:[i.jsx(Zt,{children:i.jsxs(tr,{className:"flex items-center gap-2",children:[o==="directory"?i.jsx(Nt,{className:"w-5 h-5"}):i.jsx(Yh,{className:"w-5 h-5"}),m]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:v,onChange:R=>y(R.target.value),onKeyDown:T,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),i.jsx(ue,{variant:"outline",size:"icon",onClick:()=>p(E||"~"),title:"Go to home",children:i.jsx(rp,{className:"w-4 h-4"})}),i.jsx(ue,{onClick:P,disabled:g,children:"Go"})]}),i.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:f}),_&&i.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:_}),i.jsx(ni,{className:"h-64 border rounded-lg",children:g?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx(dt,{className:"w-6 h-6 animate-spin text-gray-400"})}):i.jsx("div",{className:"p-1",children:c.length===0?i.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:o==="directory"?"No subdirectories":"No files found"}):c.map((R,j)=>i.jsxs("button",{onClick:()=>x(R),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[R.type==="directory"?i.jsx(Nt,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):i.jsx(Yh,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:`flex-1 truncate ${R.isParent?"text-gray-500":""}`,children:R.name}),R.type==="directory"&&!R.isParent&&i.jsx(Bc,{className:"w-4 h-4 text-gray-400"})]},j))})})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(ue,{onClick:k,disabled:!f,children:o==="directory"?"Select Folder":"Select"})]})]})})}function Q1({open:e,onOpenChange:t,onAdded:s}){const[o,l]=C.useState(""),[m,f]=C.useState(""),[a,c]=C.useState(!1),[h,g]=C.useState(!1);C.useEffect(()=>{e&&(l(""),f(""))},[e]),C.useEffect(()=>{if(o&&!m){const S=o.split("/").pop();f(S||"")}},[o]);const d=S=>{l(S),c(!1)},_=async()=>{if(!o){le.error("Please select a project path");return}g(!0);try{const S=await Se.addProject(o,m||void 0);S.error?le.error(S.error):(le.success(`Added project: ${S.project.name}`),s==null||s(S.project),t(!1))}catch(S){le.error("Failed to add project: "+S.message)}finally{g(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(ir,{open:e,onOpenChange:t,children:i.jsxs(Qt,{className:"sm:max-w-md",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{className:"flex items-center gap-2",children:[i.jsx(Gn,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),i.jsx(Nr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{htmlFor:"path",children:"Project Path"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{id:"path",value:o,onChange:S=>l(S.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),i.jsx(ue,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:i.jsx(Gn,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(bt,{htmlFor:"name",children:"Display Name"}),i.jsx(Xe,{id:"name",value:m,onChange:S=>f(S.target.value),placeholder:"Auto-filled from folder name"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),i.jsx(ue,{onClick:_,disabled:h||!o,children:h?i.jsxs(i.Fragment,{children:[i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),i.jsx(J1,{open:a,onOpenChange:c,onSelect:d,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Z1=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function nI({children:e}){const[t,s]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[o,l]=C.useState("light");C.useEffect(()=>{const f=window.document.documentElement,a=g=>{let d;g==="auto"?d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d=g,l(d),d==="dark"?f.classList.add("dark"):f.classList.remove("dark")};a(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{t==="auto"&&a("auto")};return c.addEventListener("change",h),()=>c.removeEventListener("change",h)},[t]);const m=f=>{s(f);try{localStorage.setItem("claude-config-theme",f)}catch{}};return i.jsx(Z1.Provider,{value:{theme:t,setTheme:m,resolvedTheme:o},children:e})}function iI(){return C.useContext(Z1)}function oI(){const{theme:e,setTheme:t,resolvedTheme:s}=iI(),o=s==="dark"?ly:cy;return i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsxs(ue,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[i.jsx(o,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),i.jsxs(wn,{align:"end",children:[i.jsxs(lt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[i.jsx(cy,{className:"mr-2 h-4 w-4"}),"Light"]}),i.jsxs(lt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[i.jsx(ly,{className:"mr-2 h-4 w-4"}),"Dark"]}),i.jsxs(lt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[i.jsx(B_,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var aI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lI=aI.reduce((e,t)=>{const s=lp(`Primitive.${t}`),o=C.forwardRef((l,m)=>{const{asChild:f,...a}=l,c=f?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:m})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),cI="Separator",Ky="horizontal",dI=["horizontal","vertical"],eC=C.forwardRef((e,t)=>{const{decorative:s,orientation:o=Ky,...l}=e,m=uI(o)?o:Ky,a=s?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return i.jsx(lI.div,{"data-orientation":m,...a,...l,ref:t})});eC.displayName=cI;function uI(e){return dI.includes(e)}var tC=eC;const rC=C.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},l)=>i.jsx(tC,{ref:l,decorative:s,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));rC.displayName=tC.displayName;function hI(){var P,T;const[e,t]=C.useState(null),[s,o]=C.useState(""),[l,m]=C.useState({open:!1,field:null,type:"directory"}),[f,a]=C.useState(!0),[c,h]=C.useState(!1),[g,d]=C.useState(null),[_,S]=C.useState(!1);C.useEffect(()=>{v(),E()},[]);const E=async()=>{try{const R=await Se.checkVersion();d(R)}catch(R){console.error("Failed to load version info:",R)}},b=async()=>{var R;if(!(g!=null&&g.updateAvailable)){le.error("No update available");return}S(!0);try{const j=await Se.performUpdate({updateMethod:g.updateMethod,sourcePath:g.sourcePath});j.success?(j.updateMethod==="npm"?le.success(j.message||"Updated via npm! Restart the server to apply."):le.success(`Updated! Files: ${((R=j.updated)==null?void 0:R.join(", "))||"all"}. Restart the server to apply.`),E()):le.error("Update failed: "+j.error)}catch(j){le.error("Update failed: "+j.message)}finally{S(!1)}},v=async()=>{try{a(!0);const R=await Se.getConfig();t(R.config),o(R.path)}catch{le.error("Failed to load settings")}finally{a(!1)}},y=async()=>{h(!0);try{await Se.saveConfig(e),le.success("Preferences saved!")}catch{le.error("Failed to save preferences")}finally{h(!1)}},p=(R,j)=>{t(M=>({...M,[R]:j}))},x=(R,j,M)=>{t($=>({...$,[R]:{...$[R],[j]:M}}))},k=R=>{const j=(e==null?void 0:e.enabledTools)||["claude"];j.includes(R)?j.length>1&&p("enabledTools",j.filter(M=>M!==R)):p("enabledTools",[...j,R])};return f?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(dt,{className:"w-8 h-8 animate-spin text-primary"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center",children:i.jsx(H_,{className:"w-5 h-5 text-muted-foreground"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"claude-config Preferences"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Tool settings for this configuration manager"})]})]}),i.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("div",{children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",i.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:s})]})}),i.jsxs(ue,{onClick:y,disabled:c,children:[c?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(oi,{className:"w-4 h-4 mr-2"}),"Save"]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(Nt,{className:"w-4 h-4"}),"Directories"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"MCP Tools Directories"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Folders containing local MCP tool repositories for discovery"}),i.jsxs("div",{className:"space-y-2",children:[((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).map((R,j)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:R||"",onChange:M=>{const $=[...(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])];$[j]=M.target.value,p("toolsDirs",$),e!=null&&e.toolsDir&&t(F=>{const{toolsDir:U,...H}=F;return{...H,toolsDirs:$}})},placeholder:"~/mcp-tools",className:"font-mono flex-1"}),i.jsx(ue,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:j}),title:"Browse...",children:i.jsx(Gn,{className:"w-4 h-4"})}),i.jsx(ue,{variant:"outline",size:"icon",onClick:()=>{const $=((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[])).filter((F,U)=>U!==j);t(F=>{const{toolsDir:U,...H}=F;return{...H,toolsDirs:$.length>0?$:void 0}})},title:"Remove",className:"text-destructive hover:text-destructive",children:i.jsx(op,{className:"w-4 h-4"})})]},j)),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>m({open:!0,field:"toolsDirs",type:"directory",index:-1}),className:"mt-2",children:[i.jsx(sc,{className:"w-4 h-4 mr-2"}),"Add Tools Folder"]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Global Registry Path"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Path to the global MCP registry file"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{value:(e==null?void 0:e.registryPath)||"",onChange:R=>p("registryPath",R.target.value),placeholder:"~/.claude/registry.json",className:"font-mono flex-1"}),i.jsx(ue,{variant:"outline",size:"icon",onClick:()=>m({open:!0,field:"registryPath",type:"file"}),title:"Browse...",children:i.jsx(Gn,{className:"w-4 h-4"})})]})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx($c,{className:"w-4 h-4"}),"User Interface"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Port"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Port for the web UI server"}),i.jsx(Xe,{type:"number",value:((P=e==null?void 0:e.ui)==null?void 0:P.port)||3333,onChange:R=>x("ui","port",parseInt(R.target.value)||3333),placeholder:"3333",className:"w-32"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Open Browser on Start"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically open browser when starting the UI"})]}),i.jsx(xt,{checked:((T=e==null?void 0:e.ui)==null?void 0:T.openBrowser)??!0,onCheckedChange:R=>x("ui","openBrowser",R)})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(VR,{className:"w-4 h-4"}),"AI Assistant"]}),i.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."}),i.jsxs("div",{className:"space-y-2",children:[i.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:()=>p("aiAssistant","claude"),children:[i.jsx("input",{type:"radio",name:"aiAssistant",value:"claude",checked:((e==null?void 0:e.aiAssistant)||"claude")==="claude",onChange:()=>p("aiAssistant","claude"),className:"sr-only"}),i.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-orange-500"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Command: ",i.jsx("code",{className:"text-xs",children:"claude"})]})]}),((e==null?void 0:e.aiAssistant)||"claude")==="claude"&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-500"})]}),i.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:()=>p("aiAssistant","gemini"),children:[i.jsx("input",{type:"radio",name:"aiAssistant",value:"gemini",checked:(e==null?void 0:e.aiAssistant)==="gemini",onChange:()=>p("aiAssistant","gemini"),className:"sr-only"}),i.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:i.jsx(St,{className:"w-4 h-4 text-blue-500"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI coding assistant • Command: ",i.jsx("code",{className:"text-xs",children:"gemini"})]})]}),(e==null?void 0:e.aiAssistant)==="gemini"&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})]})]})]}),i.jsxs("div",{className:"border-b border-border pb-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(oT,{className:"w-4 h-4"}),"Enabled AI Tools"]}),i.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."}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-orange-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-orange-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Claude Code"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anthropic's AI coding assistant • Output: ",i.jsx("code",{className:"text-xs",children:".mcp.json"})]})]})]}),i.jsx(xt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("claude"),onCheckedChange:()=>k("claude")})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-blue-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-blue-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Gemini CLI"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's terminal AI coding assistant • Output: ",i.jsx("code",{className:"text-xs",children:"~/.gemini/settings.json"})]})]})]}),i.jsx(xt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("gemini"),onCheckedChange:()=>k("gemini")})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-md bg-purple-500/10 flex items-center justify-center",children:i.jsx($t,{className:"w-4 h-4 text-purple-500"})}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-foreground",children:"Antigravity"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Google's AI IDE • Output: ",i.jsx("code",{className:"text-xs",children:"~/.gemini/antigravity/mcp_config.json"})]})]})]}),i.jsx(xt,{checked:((e==null?void 0:e.enabledTools)||["claude"]).includes("antigravity"),onCheckedChange:()=>k("antigravity")})]}),i.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["Note: Antigravity does not support environment variable interpolation (",i.jsx("code",{children:"${VAR}"}),"). Variables are resolved to actual values when generating its config."]})]})]}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[i.jsx(mr,{className:"w-4 h-4"}),"About"]}),i.jsxs("div",{className:"bg-muted rounded-lg p-4 space-y-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Installed Version"}),i.jsx("span",{className:"font-medium font-mono text-foreground",children:(g==null?void 0:g.installedVersion)||"Loading..."})]}),(g==null?void 0:g.updateAvailable)&&i.jsx("div",{className:"p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:"Update Available!"}),i.jsxs("p",{className:"text-xs text-green-600/80 dark:text-green-400/80",children:["Version ",g.latestVersion," via ",g.updateMethod==="npm"?"npm":g.sourcePath]})]}),i.jsxs(ue,{size:"sm",onClick:b,disabled:_,className:"bg-green-600 hover:bg-green-700 text-white",children:[_?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(Fc,{className:"w-4 h-4 mr-2"}),"Update Now"]})]})}),!(g!=null&&g.updateAvailable)&&(g==null?void 0:g.latestVersion)&&i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Latest Version"}),i.jsxs("span",{className:"font-mono text-green-600 dark:text-green-400",children:[g.latestVersion," ✓"]})]}),(g==null?void 0:g.sourcePath)&&!(g!=null&&g.updateAvailable)&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Dev Source"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"text-xs text-muted-foreground",children:g.sourcePath}),i.jsx(ue,{size:"sm",variant:"outline",onClick:b,disabled:_,className:"h-7",children:_?i.jsx(dt,{className:"w-3 h-3 animate-spin"}):i.jsx(gr,{className:"w-3 h-3"})})]})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Install Location"}),i.jsx("code",{className:"text-xs text-muted-foreground",children:(g==null?void 0:g.installDir)||"~/.claude-config"})]}),i.jsxs("div",{className:"border-t border-border pt-3 mt-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Documentation"}),i.jsx("a",{href:"https://github.com/regression-io/claude-config",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GitHub"})]}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["After updating, restart the server with ",i.jsx("code",{className:"bg-muted-foreground/10 px-1 rounded",children:"claude-config ui"})]})]})]})]})]})]}),i.jsx(J1,{open:l.open,onOpenChange:R=>m(j=>({...j,open:R})),onSelect:R=>{if(l.field==="toolsDirs"){const j=(e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]);if(l.index===-1)t(M=>{const{toolsDir:$,...F}=M;return{...F,toolsDirs:[...j,R]}});else{const M=[...j];M[l.index]=R,t($=>{const{toolsDir:F,...U}=$;return{...U,toolsDirs:M}})}}else l.field&&p(l.field,R)},type:l.type,initialPath:l.field==="toolsDirs"&&l.index>=0?((e==null?void 0:e.toolsDirs)||(e!=null&&e.toolsDir?[e.toolsDir]:[]))[l.index]||"~":(e==null?void 0:e[l.field])||"~",title:l.type==="directory"?"Select Directory":"Select File"})]})}function fI(){const[e,t]=C.useState(null),[s,o]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{o(!0);const f=await Se.getClaudeSettings();t(f.settings)}catch(f){console.error("Failed to load Claude settings:",f)}finally{o(!1)}},m=async f=>{try{await Se.saveClaudeSettings(f),t(f),le.success("Claude Code settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(dt,{className:"w-8 h-8 animate-spin text-indigo-600"})}):i.jsx("div",{className:"space-y-6",children:i.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:i.jsx(N1,{settings:e,onSave:m,loading:s,settingsPath:"~/.claude/settings.json"})})})}function pI(){const[e,t]=C.useState(null),[s,o]=C.useState(!0);C.useEffect(()=>{l()},[]);const l=async()=>{try{o(!0);const f=await Se.getGeminiSettings();t(f.settings)}catch(f){console.error("Failed to load Gemini settings:",f)}finally{o(!1)}},m=async f=>{try{await Se.saveGeminiSettings(f),t(f),le.success("Gemini CLI settings saved!")}catch(a){le.error("Failed to save settings: "+a.message)}};return s?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(dt,{className:"w-8 h-8 animate-spin text-blue-600"})}):i.jsx("div",{className:"space-y-6",children:i.jsx("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-6 shadow-sm",children:i.jsx(P1,{settings:e,onSave:m,loading:s,settingsPath:"~/.gemini/settings.json"})})})}var Ph={exports:{}},Gy;function mI(){return Gy||(Gy=1,(function(e,t){(function(s,o){e.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=c(9042),_=c(9924),S=c(844),E=c(4725),b=c(2585),v=c(3656);let y=a.AccessibilityManager=class extends S.Disposable{constructor(p,x,k,P){super(),this._terminal=p,this._coreBrowserService=k,this._renderService=P,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 T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,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 _.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((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
513
|
+
`)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.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,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(p){for(let x=0;x<p;x++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
|
|
514
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,x){this._liveRegionDebouncer.refresh(p,x,this._terminal.rows)}_renderRows(p,x){const k=this._terminal.buffer,P=k.lines.length.toString();for(let T=p;T<=x;T++){const R=k.lines.get(k.ydisp+T),j=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,j))||"",$=(k.ydisp+T+1).toString(),F=this._rowElements[T];F&&(M.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=M,this._rowColumns.set(F,j)),F.setAttribute("aria-posinset",$),F.setAttribute("aria-setsize",P))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,x){const k=p.target,P=this._rowElements[x===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==P)return;let T,R;if(x===0?(T=k,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(T=this._rowElements.shift(),R=k,this._rowContainer.removeChild(T)),T.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:p.anchorNode,offset:p.anchorOffset},k={node:p.focusNode,offset:p.focusOffset};if((x.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===k.node&&x.offset>k.offset)&&([x,k]=[k,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const P=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(P)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:P,offset:((M=P.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(k.node))return;const T=({node:$,offset:F})=>{const U=$ instanceof Text?$.parentNode:$;let H=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(U);if(!Q)return console.warn("columns is null. Race condition?"),null;let V=F<Q.length?Q[F]:Q.slice(-1)[0]+1;return V>=this._terminal.cols&&(++H,V=0),{row:H,column:V}},R=T(x),j=T(k);if(R&&j){if(R.row>j.row||R.row===j.row&&R.column>=j.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(j.row-R.row)*this._terminal.cols-R.column+j.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=y=h([g(1,b.IInstantiationService),g(2,E.ICoreBrowserService),g(3,E.IRenderService)],y)},3614:(f,a)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function h(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function g(_,S,E,b){_=h(_=c(_),E.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(_,!0),S.value=""}function d(_,S,E){const b=E.getBoundingClientRect(),v=_.clientX-b.left-10,y=_.clientY-b.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${v}px`,S.style.top=`${y}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=h,a.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,S,E,b){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),S,E,b)},a.paste=g,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(_,S,E,b,v){d(_,S,E),v&&b.rightClickSelect(_),S.value=b.selectionText,S.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,d,_){this._css.set(g,d,_)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,_){this._color.set(g,d,_)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,g,d){c.addEventListener(h,g,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(h,g,d))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const d=c(3656),_=c(8460),S=c(844),E=c(2585),b=c(4725);let v=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(y,p,x,k,P){super(),this._element=y,this._mouseService=p,this._renderService=x,this._bufferService=k,this._linkProviderService=P,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var T;this._lastMouseEvent=void 0,(T=this._activeProviderReplies)==null||T.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const p=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const x=y.composedPath();for(let k=0;k<x.length;k++){const P=x[k];if(P.classList.contains("xterm"))break;if(P.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,p){var k,P;this._activeProviderReplies&&p||((k=this._activeProviderReplies)==null||k.forEach((T=>{T==null||T.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let x=!1;for(const[T,R]of this._linkProviderService.linkProviders.entries())p?(P=this._activeProviderReplies)!=null&&P.get(T)&&(x=this._checkLinkProviderResult(T,y,x)):R.provideLinks(y.y,(j=>{var $,F;if(this._isMouseOut)return;const M=j==null?void 0:j.map((U=>({link:U})));($=this._activeProviderReplies)==null||$.set(T,M),x=this._checkLinkProviderResult(T,y,x),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,p){const x=new Set;for(let k=0;k<p.size;k++){const P=p.get(k);if(P)for(let T=0;T<P.length;T++){const R=P[T],j=R.link.range.start.y<y?0:R.link.range.start.x,M=R.link.range.end.y>y?this._bufferService.cols:R.link.range.end.x;for(let $=j;$<=M;$++){if(x.has($)){P.splice(T--,1);break}x.add($)}}}}_checkLinkProviderResult(y,p,x){var T;if(!this._activeProviderReplies)return x;const k=this._activeProviderReplies.get(y);let P=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(P=!0);if(!P&&k){const R=k.find((j=>this._linkAtPosition(j.link,p)));R&&(x=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let R=0;R<this._activeProviderReplies.size;R++){const j=(T=this._activeProviderReplies.get(R))==null?void 0:T.find((M=>this._linkAtPosition(M.link,p)));if(j){x=!0,this._handleNewLink(j);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const p=this._positionFromMouseEvent(y,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,p){this._currentLink&&this._lastMouseEvent&&(!y||!p||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(y.link,p)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.pointerCursor},set:x=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,k;return(k=(x=this._currentLink)==null?void 0:x.state)==null?void 0:k.decorations.underline},set:x=>{var k,P,T;(k=this._currentLink)!=null&&k.state&&((T=(P=this._currentLink)==null?void 0:P.state)==null?void 0:T.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const k=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,P=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=P&&(this._clearCurrentLink(k,P),this._lastMouseEvent)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(y,p,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(x,p.text)}_fireUnderlineEvent(y,p){const x=y.range,k=this._bufferService.buffer.ydisp,P=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-k-1,x.end.x,x.end.y-k-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(P)}_linkLeave(y,p,x){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(x,p.text)}_linkAtPosition(y,p){const x=y.range.start.y*this._bufferService.cols+y.range.start.x,k=y.range.end.y*this._bufferService.cols+y.range.end.x,P=p.y*this._bufferService.cols+p.x;return x<=P&&P<=k}_positionFromMouseEvent(y,p,x){const k=x.getCoords(y,p,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,p,x,k,P){return{x1:y,y1:p,x2:x,y2:k,cols:this._bufferService.cols,fg:P}}};a.Linkifier=v=h([g(1,b.IMouseService),g(2,b.IRenderService),g(3,E.IBufferService),g(4,b.ILinkProviderService)],v)},9042:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=c(511),_=c(2585);let S=a.OscLinkProvider=class{constructor(b,v,y){this._bufferService=b,this._optionsService=v,this._oscLinkService=y}provideLinks(b,v){var M;const y=this._bufferService.buffer.lines.get(b-1);if(!y)return void v(void 0);const p=[],x=this._optionsService.rawOptions.linkHandler,k=new d.CellData,P=y.getTrimmedLength();let T=-1,R=-1,j=!1;for(let $=0;$<P;$++)if(R!==-1||y.hasContent($)){if(y.loadCell($,k),k.hasExtendedAttrs()&&k.extended.urlId){if(R===-1){R=$,T=k.extended.urlId;continue}j=k.extended.urlId!==T}else R!==-1&&(j=!0);if(j||R!==-1&&$===P-1){const F=(M=this._oscLinkService.getLinkData(T))==null?void 0:M.uri;if(F){const U={start:{x:R+1,y:b},end:{x:$+(j||$!==P-1?0:1),y:b}};let H=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const Q=new URL(F);["http:","https:"].includes(Q.protocol)||(H=!0)}catch{H=!0}H||p.push({text:F,range:U,activate:(Q,V)=>x?x.activate(Q,V,U):E(0,V),hover:(Q,V)=>{var K;return(K=x==null?void 0:x.hover)==null?void 0:K.call(x,Q,V,U)},leave:(Q,V)=>{var K;return(K=x==null?void 0:x.leave)==null?void 0:K.call(x,Q,V,U)}})}j=!1,k.hasExtendedAttrs()&&k.extended.urlId?(R=$,T=k.extended.urlId):(R=-1,T=-1)}}v(p)}};function E(b,v){if(confirm(`Do you want to navigate to ${v}?
|
|
515
|
+
|
|
516
|
+
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=S=h([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],S)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,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,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h: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,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),g=c(3656),d=c(3551),_=c(9042),S=c(3730),E=c(1680),b=c(3107),v=c(5744),y=c(2950),p=c(1296),x=c(428),k=c(4269),P=c(5114),T=c(8934),R=c(3230),j=c(9312),M=c(4725),$=c(6731),F=c(8055),U=c(8969),H=c(8460),Q=c(844),V=c(6114),K=c(8437),J=c(2584),W=c(7399),D=c(5941),B=c(9074),L=c(2585),z=c(5435),ee=c(4567),ne=c(779);class ce extends U.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(G={}){super(G),this.browser=V,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((O,Z)=>this.refresh(O,Z)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((O=>this._reportWindowsOptions(O)))),this.register(this._inputHandler.onColor((O=>this._handleColorEvent(O)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((O=>this._afterResize(O.cols,O.rows)))),this.register((0,Q.toDisposable)((()=>{var O,Z;this._customKeyEventHandler=void 0,(Z=(O=this.element)==null?void 0:O.parentNode)==null||Z.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const O of G){let Z,X="";switch(O.index){case 256:Z="foreground",X="10";break;case 257:Z="background",X="11";break;case 258:Z="cursor",X="12";break;default:Z="ansi",X="4;"+O.index}switch(O.type){case 0:const q=F.color.toColorRGB(Z==="ansi"?this._themeService.colors.ansi[O.index]:this._themeService.colors[Z]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${X};${(0,D.toRgbString)(q)}${J.C1_ESCAPED.ST}`);break;case 1:if(Z==="ansi")this._themeService.modifyColors((re=>re.ansi[O.index]=F.channels.toColor(...O.color)));else{const re=Z;this._themeService.modifyColors((he=>he[re]=F.channels.toColor(...O.color)))}break;case 2:this._themeService.restoreColor(O.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(G){G?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ee.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var G;return(G=this.textarea)==null?void 0:G.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.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 G=this.buffer.ybase+this.buffer.y,O=this.buffer.lines.get(G);if(!O)return;const Z=Math.min(this.buffer.x,this.cols-1),X=this._renderService.dimensions.css.cell.height,q=O.getWidth(Z),re=this._renderService.dimensions.css.cell.width*q,he=this.buffer.y*this._renderService.dimensions.css.cell.height,Te=Z*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Te+"px",this.textarea.style.top=he+"px",this.textarea.style.width=re+"px",this.textarea.style.height=X+"px",this.textarea.style.lineHeight=X+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(O=>{this.hasSelection()&&(0,h.copyHandler)(O,this._selectionService)})));const G=O=>(0,h.handlePasteEvent)(O,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,g.addDisposableDomListener)(this.element,"paste",G)),V.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(O=>{O.button===2&&(0,h.rightClickHandler)(O,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(O=>{(0,h.rightClickHandler)(O,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),V.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(O=>{O.button===1&&(0,h.moveTextAreaUnderMouseCursor)(O,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var Z;if(!G)throw new Error("Terminal requires a parent element.");if(G.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((Z=this.element)==null?void 0:Z.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=G.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"),G.appendChild(this.element);const O=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),O.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(X=>this.updateCursorStyle(X)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),O.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),V.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(P.CoreBrowserService,this.textarea,G.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(X=>this._handleTextAreaFocus(X)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((X=>this._onRender.fire(X)))),this.onResize((X=>this._renderService.resize(X.cols,X.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(T.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(O);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((X=>this.scrollLines(X.amount,X.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(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((X=>this.scrollLines(X.amount,X.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((X=>this._renderService.handleSelectionChanged(X.start,X.end,X.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((X=>{this.textarea.value=X,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((X=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(X=>this._selectionService.handleMouseDown(X)))),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(ee.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(X=>this._handleScreenReaderModeOptionChange(X)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(X=>{!this._overviewRulerRenderer&&X&&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(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,O=this.element;function Z(re){const he=G._mouseService.getMouseReportCoords(re,G.screenElement);if(!he)return!1;let Te,Be;switch(re.overrideType||re.type){case"mousemove":Be=32,re.buttons===void 0?(Te=3,re.button!==void 0&&(Te=re.button<3?re.button:3)):Te=1&re.buttons?0:4&re.buttons?1:2&re.buttons?2:3;break;case"mouseup":Be=0,Te=re.button<3?re.button:3;break;case"mousedown":Be=1,Te=re.button<3?re.button:3;break;case"wheel":if(G._customWheelEventHandler&&G._customWheelEventHandler(re)===!1||G.viewport.getLinesScrolled(re)===0)return!1;Be=re.deltaY<0?0:1,Te=4;break;default:return!1}return!(Be===void 0||Te===void 0||Te>4)&&G.coreMouseService.triggerMouseEvent({col:he.col,row:he.row,x:he.x,y:he.y,button:Te,action:Be,ctrl:re.ctrlKey,alt:re.altKey,shift:re.shiftKey})}const X={mouseup:null,wheel:null,mousedrag:null,mousemove:null},q={mouseup:re=>(Z(re),re.buttons||(this._document.removeEventListener("mouseup",X.mouseup),X.mousedrag&&this._document.removeEventListener("mousemove",X.mousedrag)),this.cancel(re)),wheel:re=>(Z(re),this.cancel(re,!0)),mousedrag:re=>{re.buttons&&Z(re)},mousemove:re=>{re.buttons||Z(re)}};this.register(this.coreMouseService.onProtocolChange((re=>{re?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(re)),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&re?X.mousemove||(O.addEventListener("mousemove",q.mousemove),X.mousemove=q.mousemove):(O.removeEventListener("mousemove",X.mousemove),X.mousemove=null),16&re?X.wheel||(O.addEventListener("wheel",q.wheel,{passive:!1}),X.wheel=q.wheel):(O.removeEventListener("wheel",X.wheel),X.wheel=null),2&re?X.mouseup||(X.mouseup=q.mouseup):(this._document.removeEventListener("mouseup",X.mouseup),X.mouseup=null),4&re?X.mousedrag||(X.mousedrag=q.mousedrag):(this._document.removeEventListener("mousemove",X.mousedrag),X.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(O,"mousedown",(re=>{if(re.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(re))return Z(re),X.mouseup&&this._document.addEventListener("mouseup",X.mouseup),X.mousedrag&&this._document.addEventListener("mousemove",X.mousedrag),this.cancel(re)}))),this.register((0,g.addDisposableDomListener)(O,"wheel",(re=>{if(!X.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(re)===!1)return!1;if(!this.buffer.hasScrollback){const he=this.viewport.getLinesScrolled(re);if(he===0)return;const Te=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(re.deltaY<0?"A":"B");let Be="";for(let Ke=0;Ke<Math.abs(he);Ke++)Be+=Te;return this.coreService.triggerDataEvent(Be,!0),this.cancel(re,!0)}return this.viewport.handleWheel(re)?this.cancel(re):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(O,"touchstart",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(re),this.cancel(re)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(O,"touchmove",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(re)?void 0:this.cancel(re)}),{passive:!1}))}refresh(G,O){var Z;(Z=this._renderService)==null||Z.refreshRows(G,O)}updateCursorStyle(G){var O;(O=this._selectionService)!=null&&O.shouldColumnSelect(G)?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(G,O,Z=0){var X;Z===1?(super.scrollLines(G,O,Z),this.refresh(0,this.rows-1)):(X=this.viewport)==null||X.scrollLines(G)}paste(G){(0,h.paste)(G,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(G){this._customKeyEventHandler=G}attachCustomWheelEventHandler(G){this._customWheelEventHandler=G}registerLinkProvider(G){return this._linkProviderService.registerLinkProvider(G)}registerCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const O=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),O}deregisterCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(G)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(G){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)}registerDecoration(G){return this._decorationService.registerDecoration(G)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(G,O,Z){this._selectionService.setSelection(G,O,Z)}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 G;(G=this._selectionService)==null||G.clearSelection()}selectAll(){var G;(G=this._selectionService)==null||G.selectAll()}selectLines(G,O){var Z;(Z=this._selectionService)==null||Z.selectLines(G,O)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const O=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!O&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;O||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Z=(0,W.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),Z.type===3||Z.type===2){const X=this.rows-1;return this.scrollLines(Z.type===2?-X:X),this.cancel(G,!0)}return Z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(Z.cancel&&this.cancel(G,!0),!Z.key||!!(G.key&&!G.ctrlKey&&!G.altKey&&!G.metaKey&&G.key.length===1&&G.key.charCodeAt(0)>=65&&G.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Z.key!==J.C0.ETX&&Z.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Z.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(Z.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,O){const Z=G.isMac&&!this.options.macOptionIsMeta&&O.altKey&&!O.ctrlKey&&!O.metaKey||G.isWindows&&O.altKey&&O.ctrlKey&&!O.metaKey||G.isWindows&&O.getModifierState("AltGraph");return O.type==="keypress"?Z:Z&&(!O.keyCode||O.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(O){return O.keyCode===16||O.keyCode===17||O.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let O;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)O=G.charCode;else if(G.which===null||G.which===void 0)O=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;O=G.which}return!(!O||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(O=String.fromCharCode(O),this._onKey.fire({key:O,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(O,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(G){if(G.data&&G.inputType==="insertText"&&(!G.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const O=G.data;return this.coreService.triggerDataEvent(O,!0),this.cancel(G),!0}return!1}resize(G,O){G!==this.cols||O!==this.rows?super.resize(G,O):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,O){var Z,X;(Z=this._charSizeService)==null||Z.measure(),(X=this.viewport)==null||X.syncScrollArea(!0)}clear(){var G;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 O=1;O<this.rows;O++)this.buffer.lines.push(this.buffer.getBlankLine(K.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(G=this.viewport)==null||G.reset(),this.refresh(0,this.rows-1)}}reset(){var O,Z;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(O=this._selectionService)==null||O.reset(),this._decorationService.reset(),(Z=this.viewport)==null||Z.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var G;(G=this._renderService)==null||G.clearTextureAtlas()}_reportFocus(){var G;(G=this.element)!=null&&G.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const O=this._renderService.dimensions.css.canvas.width.toFixed(0),Z=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${Z};${O}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const X=this._renderService.dimensions.css.cell.width.toFixed(0),q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${q};${X}t`)}}cancel(G,O){if(this.options.cancelEvents||O)return G.preventDefault(),G.stopPropagation(),!1}}a.Terminal=ce},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h: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,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,S=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=c(3656),_=c(4725),S=c(8460),E=c(844),b=c(2585);let v=a.Viewport=class extends E.Disposable{constructor(y,p,x,k,P,T,R,j){super(),this._viewportElement=y,this._scrollArea=p,this._bufferService=x,this._optionsService=k,this._charSizeService=P,this._renderService=T,this._coreBrowserService=R,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(y){if(y)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(y,p){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&x<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const p=this._getPixelsScrolled(y);return p!==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+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(y,p))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let p=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(y,p){var j;let x,k="";const P=[],T=p??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let M=y;M<T;M++){const $=R.get(M);if(!$)continue;const F=(j=R.get(M+1))==null?void 0:j.isWrapped;if(k+=$.translateToString(!F),!F||M===R.length-1){const U=document.createElement("div");U.textContent=k,P.push(U),k.length>0&&(x=U),k=""}}return{bufferElements:P,cursorElement:x}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let p=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(y,p){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&p.altKey||x==="ctrl"&&p.ctrlKey||x==="shift"&&p.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const p=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(y,p))}};a.Viewport=v=h([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],v)},3107:function(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),S=c(2585);let E=a.BufferDecorationRenderer=class extends _.Disposable{constructor(b,v,y,p,x){super(),this._screenElement=b,this._bufferService=v,this._coreBrowserService=y,this._decorationService=p,this._renderService=x,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((k=>this._removeDecoration(k)))),this.register((0,_.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 b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var p;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((p=b==null?void 0:b.options)==null?void 0:p.layer)==="top"),v.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(b.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 y=b.options.x??0;return y&&y>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(b,v),v}_refreshStyle(b){const v=b.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let y=this._decorationElements.get(b);y||(y=this._createElement(b),b.element=y,this._decorationElements.set(b,y),this._container.appendChild(y),b.onDispose((()=>{this._decorationElements.delete(b),y.remove()}))),y.style.top=v*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(y)}}_refreshXPosition(b,v=b.element){if(!v)return;const y=b.options.x??0;(b.options.anchor||"left")==="right"?v.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var v;(v=this._decorationElements.get(b))==null||v.remove(),this._decorationElements.delete(b),b.dispose()}};a.BufferDecorationRenderer=E=h([g(1,S.IBufferService),g(2,d.ICoreBrowserService),g(3,S.IDecorationService),g(4,d.IRenderService)],E)},5871:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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 h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,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,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,g){return h>=c.startBufferLine-this._linePadding[g||"full"]&&h<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(x,k,P,T){var R,j=arguments.length,M=j<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,k,P,T);else for(var $=x.length-1;$>=0;$--)(R=x[$])&&(M=(j<3?R(M):j>3?R(k,P,M):R(k,P))||M);return j>3&&M&&Object.defineProperty(k,P,M),M},g=this&&this.__param||function(x,k){return function(P,T){k(P,T,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),S=c(844),E=c(2585),b={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let p=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,k,P,T,R,j,M){var F;super(),this._viewportElement=x,this._screenElement=k,this._bufferService=P,this._decorationService=T,this._renderService=R,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new d.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(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var U;(U=this._canvas)==null||U.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 x=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=x,v.center=k,v.right=x,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=v.left,y.right=v.left+v.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);b.left=k,b.center=k,b.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const k of x)k.position!=="full"&&this._renderColorZone(k);for(const k of x)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(y[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-b[x.position||"full"]/2),v[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[x.position||"full"]))}_queueRefresh(x,k){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=p=h([g(2,E.IBufferService),g(3,E.IDecorationService),g(4,_.IRenderService),g(5,E.IOptionsService),g(6,_.ICoreBrowserService)],p)},2950:function(f,a,c){var h=this&&this.__decorate||function(b,v,y,p){var x,k=arguments.length,P=k<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,y):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(b,v,y,p);else for(var T=b.length-1;T>=0;T--)(x=b[T])&&(P=(k<3?x(P):k>3?x(v,y,P):x(v,y))||P);return k>3&&P&&Object.defineProperty(v,y,P),P},g=this&&this.__param||function(b,v){return function(y,p){v(y,p,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=c(4725),_=c(2585),S=c(2584);let E=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,v,y,p,x,k){this._textarea=b,this._compositionView=v,this._bufferService=y,this._optionsService=p,this._coreService=x,this._renderService=k,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),y.length>0&&this._coreService.triggerDataEvent(y,!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 b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,y=v.replace(b,"");this._dataAlreadySent=y,v.length>b.length?this._coreService.triggerDataEvent(y,!0):v.length<b.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):v.length===b.length&&v!==b&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=p+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=E=h([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,d.IRenderService)],E)},9806:(f,a)=>{function c(h,g,d){const _=d.getBoundingClientRect(),S=h.getComputedStyle(d),E=parseInt(S.getPropertyValue("padding-left")),b=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-_.left-E,g.clientY-_.top-b]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,g,d,_,S,E,b,v,y){if(!E)return;const p=c(h,g,d);return p?(p[0]=Math.ceil((p[0]+(y?b/2:0))/b),p[1]=Math.ceil(p[1]/v),p[0]=Math.min(Math.max(p[0],1),_+(y?1:0)),p[1]=Math.min(Math.max(p[1],1),S),p):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function g(v,y,p,x){const k=v-d(v,p),P=y-d(y,p),T=Math.abs(k-P)-(function(R,j,M){let $=0;const F=R-d(R,M),U=j-d(j,M);for(let H=0;H<Math.abs(F-U);H++){const Q=_(R,j)==="A"?-1:1,V=M.buffer.lines.get(F+Q*H);V!=null&&V.isWrapped&&$++}return $})(v,y,p);return b(T,E(_(v,y),x))}function d(v,y){let p=0,x=y.buffer.lines.get(v),k=x==null?void 0:x.isWrapped;for(;k&&v>=0&&v<y.rows;)p++,x=y.buffer.lines.get(--v),k=x==null?void 0:x.isWrapped;return p}function _(v,y){return v>y?"A":"B"}function S(v,y,p,x,k,P){let T=v,R=y,j="";for(;T!==p||R!==x;)T+=k?1:-1,k&&T>P.cols-1?(j+=P.buffer.translateBufferLineToString(R,!1,v,T),T=0,v=0,R++):!k&&T<0&&(j+=P.buffer.translateBufferLineToString(R,!1,0,v+1),T=P.cols-1,v=T,R--);return j+P.buffer.translateBufferLineToString(R,!1,v,T)}function E(v,y){const p=y?"O":"[";return h.C0.ESC+p+v}function b(v,y){v=Math.floor(v);let p="";for(let x=0;x<v;x++)p+=y;return p}a.moveToCellSequence=function(v,y,p,x){const k=p.buffer.x,P=p.buffer.y;if(!p.buffer.hasScrollback)return(function(j,M,$,F,U,H){return g(M,F,U,H).length===0?"":b(S(j,M,j,M-d(M,U),!1,U).length,E("D",H))})(k,P,0,y,p,x)+g(P,y,p,x)+(function(j,M,$,F,U,H){let Q;Q=g(M,F,U,H).length>0?F-d(F,U):M;const V=F,K=(function(J,W,D,B,L,z){let ee;return ee=g(D,B,L,z).length>0?B-d(B,L):W,J<D&&ee<=B||J>=D&&ee<B?"C":"D"})(j,M,$,F,U,H);return b(S(j,Q,$,V,K==="C",U).length,E(K,H))})(k,P,v,y,p,x);let T;if(P===y)return T=k>v?"D":"C",b(Math.abs(k-v),E(T,x));T=P>y?"D":"C";const R=Math.abs(P-y);return b((function(j,M){return M.cols-j})(P>y?v:k,p)+(R-1)*p.cols+1+((P>y?k:v)-1),E(T,x))}},1296:function(f,a,c){var h=this&&this.__decorate||function(H,Q,V,K){var J,W=arguments.length,D=W<3?Q:K===null?K=Object.getOwnPropertyDescriptor(Q,V):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(H,Q,V,K);else for(var B=H.length-1;B>=0;B--)(J=H[B])&&(D=(W<3?J(D):W>3?J(Q,V,D):J(Q,V))||D);return W>3&&D&&Object.defineProperty(Q,V,D),D},g=this&&this.__param||function(H,Q){return function(V,K){Q(V,K,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=c(3787),_=c(2550),S=c(2223),E=c(6171),b=c(6052),v=c(4725),y=c(8055),p=c(8460),x=c(844),k=c(2585),P="xterm-dom-renderer-owner-",T="xterm-rows",R="xterm-fg-",j="xterm-bg-",M="xterm-focus",$="xterm-selection";let F=1,U=a.DomRenderer=class extends x.Disposable{constructor(H,Q,V,K,J,W,D,B,L,z,ee,ne,ce){super(),this._terminal=H,this._document=Q,this._element=V,this._screenElement=K,this._viewportElement=J,this._helperContainer=W,this._linkifier2=D,this._charSizeService=L,this._optionsService=z,this._bufferService=ee,this._coreBrowserService=ne,this._themeService=ce,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(T),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($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((de=>this._injectCss(de)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(P+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((de=>this._handleLinkHover(de)))),this.register(this._linkifier2.onHideLinkUnderline((de=>this._handleLinkLeave(de)))),this.register((0,x.toDisposable)((()=>{this._element.classList.remove(P+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.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 H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),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/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const V of this._rowElements)V.style.width=`${this.dimensions.css.canvas.width}px`,V.style.height=`${this.dimensions.css.cell.height}px`,V.style.lineHeight=`${this.dimensions.css.cell.height}px`,V.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${T} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${T} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${T} .xterm-dim { color: ${y.color.multiplyOpacity(H.foreground,.5).css};}`,Q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const V=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${V} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${K} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${J} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,Q+=`${this._terminalSelector} .${T}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${T}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${T}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${T} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[W,D]of H.ansi.entries())Q+=`${this._terminalSelector} .${R}${W} { color: ${D.css}; }${this._terminalSelector} .${R}${W}.xterm-dim { color: ${y.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${j}${W} { background-color: ${D.css}; }`;Q+=`${this._terminalSelector} .${R}${S.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(H.background).css}; }${this._terminalSelector} .${R}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${j}${S.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,Q){for(let V=this._rowElements.length;V<=Q;V++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,Q){this._refreshRowElements(H,Q),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(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,Q,V){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,Q,V),this.renderRows(0,this._bufferService.rows-1),!H||!Q)return;this._selectionRenderModel.update(this._terminal,H,Q,V);const K=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||D<0)return;const B=this._document.createDocumentFragment();if(V){const L=H[0]>Q[0];B.appendChild(this._createSelectionElement(W,L?Q[0]:H[0],L?H[0]:Q[0],D-W+1))}else{const L=K===W?H[0]:0,z=W===J?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(W,L,z));const ee=D-W-1;if(B.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,ee)),W!==D){const ne=J===D?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(D,0,ne))}}this._selectionContainer.appendChild(B)}_createSelectionElement(H,Q,V,K=1){const J=this._document.createElement("div"),W=Q*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(V-Q);return W+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-W),J.style.height=K*this.dimensions.css.cell.height+"px",J.style.top=H*this.dimensions.css.cell.height+"px",J.style.left=`${W}px`,J.style.width=`${D}px`,J}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 H of this._rowElements)H.replaceChildren()}renderRows(H,Q){const V=this._bufferService.buffer,K=V.ybase+V.y,J=Math.min(V.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=H;L<=Q;L++){const z=L+V.ydisp,ee=this._rowElements[L],ne=V.lines.get(z);if(!ee||!ne)break;ee.replaceChildren(...this._rowFactory.createRow(ne,z,z===K,D,B,J,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${P}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,Q,V,K,J,W){V<0&&(H=0),K<0&&(Q=0);const D=this._bufferService.rows-1;V=Math.max(Math.min(V,D),0),K=Math.max(Math.min(K,D),0),J=Math.min(J,this._bufferService.cols);const B=this._bufferService.buffer,L=B.ybase+B.y,z=Math.min(B.x,J-1),ee=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let de=V;de<=K;++de){const G=de+B.ydisp,O=this._rowElements[de],Z=B.lines.get(G);if(!O||!Z)break;O.replaceChildren(...this._rowFactory.createRow(Z,G,G===L,ne,ce,z,ee,this.dimensions.css.cell.width,this._widthCache,W?de===V?H:0:-1,W?(de===K?Q:J)-1:-1))}}};a.DomRenderer=U=h([g(7,k.IInstantiationService),g(8,v.ICharSizeService),g(9,k.IOptionsService),g(10,k.IBufferService),g(11,v.ICoreBrowserService),g(12,v.IThemeService)],U)},3787:function(f,a,c){var h=this&&this.__decorate||function(T,R,j,M){var $,F=arguments.length,U=F<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(T,R,j,M);else for(var H=T.length-1;H>=0;H--)($=T[H])&&(U=(F<3?$(U):F>3?$(R,j,U):$(R,j))||U);return F>3&&U&&Object.defineProperty(R,j,U),U},g=this&&this.__param||function(T,R){return function(j,M){R(j,M,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),S=c(511),E=c(2585),b=c(8055),v=c(4725),y=c(4269),p=c(6171),x=c(3734);let k=a.DomRendererRowFactory=class{constructor(T,R,j,M,$,F,U){this._document=T,this._characterJoinerService=R,this._optionsService=j,this._coreBrowserService=M,this._coreService=$,this._decorationService=F,this._themeService=U,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(T,R,j){this._selectionStart=T,this._selectionEnd=R,this._columnSelectMode=j}createRow(T,R,j,M,$,F,U,H,Q,V,K){const J=[],W=this._characterJoinerService.getJoinedCharacters(R),D=this._themeService.colors;let B,L=T.getNoBgTrimmedLength();j&&L<F+1&&(L=F+1);let z=0,ee="",ne=0,ce=0,de=0,G=!1,O=0,Z=!1,X=0;const q=[],re=V!==-1&&K!==-1;for(let he=0;he<L;he++){T.loadCell(he,this._workCell);let Te=this._workCell.getWidth();if(Te===0)continue;let Be=!1,Ke=he,je=this._workCell;if(W.length>0&&he===W[0][0]){Be=!0;const qe=W.shift();je=new y.JoinedCellData(this._workCell,T.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),Ke=qe[1]-1,Te=je.getWidth()}const zt=this._isCellInSelection(he,R),et=j&&he===F,Ae=re&&he>=V&&he<=K;let De=!1;this._decorationService.forEachDecorationAtCell(he,R,void 0,(qe=>{De=!0}));let Fe=je.getChars()||_.WHITESPACE_CELL_CHAR;if(Fe===" "&&(je.isUnderline()||je.isOverline())&&(Fe=" "),X=Te*H-Q.get(Fe,je.isBold(),je.isItalic()),B){if(z&&(zt&&Z||!zt&&!Z&&je.bg===ne)&&(zt&&Z&&D.selectionForeground||je.fg===ce)&&je.extended.ext===de&&Ae===G&&X===O&&!et&&!Be&&!De){je.isInvisible()?ee+=_.WHITESPACE_CELL_CHAR:ee+=Fe,z++;continue}z&&(B.textContent=ee),B=this._document.createElement("span"),z=0,ee=""}else B=this._document.createElement("span");if(ne=je.bg,ce=je.fg,de=je.extended.ext,G=Ae,O=X,Z=zt,Be&&F>=he&&F<=Ke&&(F=he),!this._coreService.isCursorHidden&&et&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&q.push("xterm-cursor-blink"),q.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline")}}if(je.isBold()&&q.push("xterm-bold"),je.isItalic()&&q.push("xterm-italic"),je.isDim()&&q.push("xterm-dim"),ee=je.isInvisible()?_.WHITESPACE_CELL_CHAR:je.getChars()||_.WHITESPACE_CELL_CHAR,je.isUnderline()&&(q.push(`xterm-underline-${je.extended.underlineStyle}`),ee===" "&&(ee=" "),!je.isUnderlineColorDefault()))if(je.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(je.getUnderlineColor()).join(",")})`;else{let qe=je.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&je.isBold()&&qe<8&&(qe+=8),B.style.textDecorationColor=D.ansi[qe].css}je.isOverline()&&(q.push("xterm-overline"),ee===" "&&(ee=" ")),je.isStrikethrough()&&q.push("xterm-strikethrough"),Ae&&(B.style.textDecoration="underline");let He=je.getFgColor(),Pt=je.getFgColorMode(),ut=je.getBgColor(),xr=je.getBgColorMode();const ys=!!je.isInverse();if(ys){const qe=He;He=ut,ut=qe;const li=Pt;Pt=xr,xr=li}let Wt,zr,pt,or=!1;switch(this._decorationService.forEachDecorationAtCell(he,R,void 0,(qe=>{qe.options.layer!=="top"&&or||(qe.backgroundColorRGB&&(xr=50331648,ut=qe.backgroundColorRGB.rgba>>8&16777215,Wt=qe.backgroundColorRGB),qe.foregroundColorRGB&&(Pt=50331648,He=qe.foregroundColorRGB.rgba>>8&16777215,zr=qe.foregroundColorRGB),or=qe.options.layer==="top")})),!or&&zt&&(Wt=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,ut=Wt.rgba>>8&16777215,xr=50331648,or=!0,D.selectionForeground&&(Pt=50331648,He=D.selectionForeground.rgba>>8&16777215,zr=D.selectionForeground)),or&&q.push("xterm-decoration-top"),xr){case 16777216:case 33554432:pt=D.ansi[ut],q.push(`xterm-bg-${ut}`);break;case 50331648:pt=b.channels.toColor(ut>>16,ut>>8&255,255&ut),this._addStyle(B,`background-color:#${P((ut>>>0).toString(16),"0",6)}`);break;default:ys?(pt=D.foreground,q.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):pt=D.background}switch(Wt||je.isDim()&&(Wt=b.color.multiplyOpacity(pt,.5)),Pt){case 16777216:case 33554432:je.isBold()&&He<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(He+=8),this._applyMinimumContrast(B,pt,D.ansi[He],je,Wt,void 0)||q.push(`xterm-fg-${He}`);break;case 50331648:const qe=b.channels.toColor(He>>16&255,He>>8&255,255&He);this._applyMinimumContrast(B,pt,qe,je,Wt,zr)||this._addStyle(B,`color:#${P(He.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,pt,D.foreground,je,Wt,zr)||ys&&q.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}q.length&&(B.className=q.join(" "),q.length=0),et||Be||De?B.textContent=ee:z++,X!==this.defaultSpacing&&(B.style.letterSpacing=`${X}px`),J.push(B),he=Ke}return B&&z&&(B.textContent=ee),J}_applyMinimumContrast(T,R,j,M,$,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let H;if($||F||(H=U.getColor(R.rgba,j.rgba)),H===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);H=b.color.ensureContrastRatio($||R,F||j,Q),U.setColor(($||R).rgba,(F||j).rgba,H??null)}return!!H&&(this._addStyle(T,`color:${H.css}`),!0)}_getContrastCache(T){return T.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(T,R){T.setAttribute("style",`${T.getAttribute("style")||""}${R};`)}_isCellInSelection(T,R){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?T>=j[0]&&R>=j[1]&&T<M[0]&&R<=M[1]:T<j[0]&&R>=j[1]&&T>=M[0]&&R<=M[1]:R>j[1]&&R<M[1]||j[1]===M[1]&&R===j[1]&&T>=j[0]&&T<M[0]||j[1]<M[1]&&R===M[1]&&T<M[0]||j[1]<M[1]&&R===j[1]&&T>=j[0])}};function P(T,R,j){for(;T.length<j;)T=R+T;return T}a.DomRendererRowFactory=k=h([g(1,v.ICharacterJoinerService),g(2,E.IOptionsService),g(3,v.ICoreBrowserService),g(4,E.ICoreService),g(5,E.IDecorationService),g(6,v.IThemeService)],k)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){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 g=c.createElement("span");g.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,d,_,S],this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(S),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,g,d){c===this._font&&h===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=h,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,h,g){let d=0;if(!h&&!g&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const E=this._measure(c,0);return E>0&&(this._flat[d]=E),E}let _=c;h&&(_+="B"),g&&(_+="I");let S=this._holey.get(_);if(S===void 0){let E=0;h&&(E|=1),g&&(E|=2),S=this._measure(c,E),S>0&&this._holey.set(_,S)}return S}_measure(c,h){const g=this._measureElements[h];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=h,a.allowRescaling=function(g,d,_,S){return d===1&&_>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(E){return 57344<=E&&E<=63743})(g)},a.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(d){return 9472<=d&&d<=9631})(g)},a.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}}}},a.computeNextVariantOffset=function(g,d,_=0){return(g-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.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(g,d,_,S=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const E=g.buffers.active.ydisp,b=d[1]-E,v=_[1]-E,y=Math.max(b,0),p=Math.min(v,g.rows-1);y>=g.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=b,this.viewportEndRow=v,this.viewportCappedStartRow=y,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=_[0])}isCellSelected(g,d,_){return!!this.hasSelection&&(_-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.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,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[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(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=c(2585),_=c(8460),S=c(844);let E=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,x,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new v(p,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};a.CharSizeService=E=h([g(2,d.IOptionsService)],E);class b extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,k){x!==void 0&&x>0&&k!==void 0&&k>0&&(this._result.width=x,this._result.height=k)}}class v extends b{constructor(x,k,P){super(),this._document=x,this._parentElement=k,this._optionsService=P,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class y extends b{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(f,a,c){var h=this&&this.__decorate||function(y,p,x,k){var P,T=arguments.length,R=T<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,x):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,p,x,k);else for(var j=y.length-1;j>=0;j--)(P=y[j])&&(R=(T<3?P(R):T>3?P(p,x,R):P(p,x))||R);return T>3&&R&&Object.defineProperty(p,x,R),R},g=this&&this.__param||function(y,p){return function(x,k){p(x,k,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=c(3734),_=c(643),S=c(511),E=c(2585);class b extends d.AttributeData{constructor(p,x,k){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=x,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=b;let v=a.CharacterJoinerService=class sC{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(p){const x={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(x),x.id}deregister(p){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===p)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(p);if(!x||x.length===0)return[];const k=[],P=x.translateToString(!0);let T=0,R=0,j=0,M=x.getFg(0),$=x.getBg(0);for(let F=0;F<x.getTrimmedLength();F++)if(x.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==$){if(F-T>1){const U=this._getJoinedRanges(P,j,R,x,T);for(let H=0;H<U.length;H++)k.push(U[H])}T=F,j=R,M=this._workCell.fg,$=this._workCell.bg}R+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-T>1){const F=this._getJoinedRanges(P,j,R,x,T);for(let U=0;U<F.length;U++)k.push(F[U])}return k}_getJoinedRanges(p,x,k,P,T){const R=p.substring(x,k);let j=[];try{j=this._characterJoiners[0].handler(R)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const $=this._characterJoiners[M].handler(R);for(let F=0;F<$.length;F++)sC._mergeRanges(j,$[F])}catch($){console.error($)}return this._stringRangesToCellRanges(j,P,T),j}_stringRangesToCellRanges(p,x,k){let P=0,T=!1,R=0,j=p[P];if(j){for(let M=k;M<this._bufferService.cols;M++){const $=x.getWidth(M),F=x.getString(M).length||_.WHITESPACE_CELL_CHAR.length;if($!==0){if(!T&&j[0]<=R&&(j[0]=M,T=!0),j[1]<=R){if(j[1]=M,j=p[++P],!j)break;j[0]<=R?(j[0]=M,T=!0):T=!1}R+=F}}j&&(j[1]=this._bufferService.cols)}}static _mergeRanges(p,x){let k=!1;for(let P=0;P<p.length;P++){const T=p[P];if(k){if(x[1]<=T[0])return p[P-1][1]=x[1],p;if(x[1]<=T[1])return p[P-1][1]=Math.max(x[1],T[1]),p.splice(P,1),p;p.splice(P,1),P--}else{if(x[1]<=T[0])return p.splice(P,0,x),p;if(x[1]<=T[1])return T[0]=Math.min(x[0],T[0]),p;x[0]<T[1]&&(T[0]=Math.min(x[0],T[0]),k=!0)}}return k?p[p.length-1][1]=x[1]:p.push(x),p}};a.CharacterJoinerService=v=h([g(0,E.IBufferService)],v)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),g=c(8460),d=c(3656);class _ extends h.Disposable{constructor(b,v,y){super(),this._textarea=b,this._window=v,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((p=>this._screenDprMonitor.setWindow(p)))),this.register((0,g.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(b){this._window!==b&&(this._window=b,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}}a.CoreBrowserService=_;class S extends h.Disposable{constructor(b){super(),this._parentWindow=b,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.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:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const S=this.linkProviders.indexOf(_);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=g},8934:function(f,a,c){var h=this&&this.__decorate||function(E,b,v,y){var p,x=arguments.length,k=x<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(E,b,v,y);else for(var P=E.length-1;P>=0;P--)(p=E[P])&&(k=(x<3?p(k):x>3?p(b,v,k):p(b,v))||k);return x>3&&k&&Object.defineProperty(b,v,k),k},g=this&&this.__param||function(E,b){return function(v,y){b(v,y,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=c(4725),_=c(9806);let S=a.MouseService=class{constructor(E,b){this._renderService=E,this._charSizeService=b}getCoords(E,b,v,y,p){return(0,_.getCoords)(window,E,b,v,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(E,b){const v=(0,_.getCoordsRelativeToElement)(window,E,b);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])}}};a.MouseService=S=h([g(0,d.IRenderService),g(1,d.ICharSizeService)],S)},3230:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=c(6193),_=c(4725),S=c(8460),E=c(844),b=c(7226),v=c(2585);let y=a.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,x,k,P,T,R,j,M){super(),this._rowCount=p,this._charSizeService=P,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((($,F)=>this._renderRows($,F)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(T.onDecorationRegistered((()=>this._fullRefresh()))),this.register(T.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,x),this.register(j.onWindowChange(($=>this._registerIntersectionObserver($,x))))}_registerIntersectionObserver(p,x){if("IntersectionObserver"in p){const k=new p.IntersectionObserver((P=>this._handleIntersectionChange(P[P.length-1])),{threshold:0});k.observe(x),this._observerDisposable.value=(0,E.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,x,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,x,this._rowCount))}_renderRows(p,x){this._renderer.value&&(p=Math.min(p,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(p,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:x}),this._onRender.fire({start:p,end:x}),this._isNextRenderRedrawOnly=!0)}resize(p,x){this._rowCount=x,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(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw((x=>this.refreshRows(x.start,x.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,x;this._renderer.value&&((x=(p=this._renderer.value).clearTextureAtlas)==null||x.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(p,x)})):this._renderer.value.handleResize(p,x),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)==null||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)==null||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)==null||p.handleFocus()}handleSelectionChanged(p,x,k){var P;this._selectionState.start=p,this._selectionState.end=x,this._selectionState.columnSelectMode=k,(P=this._renderer.value)==null||P.handleSelectionChanged(p,x,k)}handleCursorMove(){var p;(p=this._renderer.value)==null||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)==null||p.clear()}};a.RenderService=y=h([g(2,v.IOptionsService),g(3,_.ICharSizeService),g(4,v.IDecorationService),g(5,v.IBufferService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],y)},9312:function(f,a,c){var h=this&&this.__decorate||function(j,M,$,F){var U,H=arguments.length,Q=H<3?M:F===null?F=Object.getOwnPropertyDescriptor(M,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(j,M,$,F);else for(var V=j.length-1;V>=0;V--)(U=j[V])&&(Q=(H<3?U(Q):H>3?U(M,$,Q):U(M,$))||Q);return H>3&&Q&&Object.defineProperty(M,$,Q),Q},g=this&&this.__param||function(j,M){return function($,F){M($,F,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=c(9806),_=c(9504),S=c(456),E=c(4725),b=c(8460),v=c(844),y=c(6114),p=c(4841),x=c(511),k=c(2585),P=" ",T=new RegExp(P,"g");let R=a.SelectionService=class extends v.Disposable{constructor(j,M,$,F,U,H,Q,V,K){super(),this._element=j,this._screenElement=M,this._linkifier=$,this._bufferService=F,this._coreService=U,this._mouseService=H,this._optionsService=Q,this._renderService=V,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new S.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 j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const $=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const U=j[0]<M[0]?j[0]:M[0],H=j[0]<M[0]?M[0]:j[0];for(let Q=j[1];Q<=M[1];Q++){const V=$.translateBufferLineToString(Q,!0,U,H);F.push(V)}}else{const U=j[1]===M[1]?M[0]:void 0;F.push($.translateBufferLineToString(j[1],!0,j[0],U));for(let H=j[1]+1;H<=M[1]-1;H++){const Q=$.lines.get(H),V=$.translateBufferLineToString(H,!0);Q!=null&&Q.isWrapped?F[F.length-1]+=V:F.push(V)}if(j[1]!==M[1]){const H=$.lines.get(M[1]),Q=$.translateBufferLineToString(M[1],!0,0,M[0]);H&&H.isWrapped?F[F.length-1]+=Q:F.push(Q)}}return F.map((U=>U.replace(T," "))).join(y.isWindows?`\r
|
|
517
|
+
`:`
|
|
518
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&j&&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(j){const M=this._getMouseBufferCoords(j),$=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!($&&F&&M)&&this._areCoordsInSelection(M,$,F)}isCellInSelection(j,M){const $=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!$||!F)&&this._areCoordsInSelection([j,M],$,F)}_areCoordsInSelection(j,M,$){return j[1]>M[1]&&j[1]<$[1]||M[1]===$[1]&&j[1]===M[1]&&j[0]>=M[0]&&j[0]<$[0]||M[1]<$[1]&&j[1]===$[1]&&j[0]<$[0]||M[1]<$[1]&&j[1]===M[1]&&j[0]>=M[0]}_selectWordAtCursor(j,M){var U,H;const $=(H=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:H.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(j);return!!F&&(this._selectWordAt(F,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=$?0:(M>$&&(M-=$),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return y.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),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(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!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(j),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const F=$.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[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 j=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const F=(0,_.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,$=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);$?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,$)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,$)}_fireOnSelectionChange(j,M,$){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let $=M;for(let F=0;M>=F;F++){const U=j.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:U>1&&M!==F&&($+=U-1)}return $}setSelection(j,M,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,$=!0,F=!0){if(j[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,H=U.lines.get(j[1]);if(!H)return;const Q=U.translateBufferLineToString(j[1],!1);let V=this._convertViewportColToCharacterIndex(H,j[0]),K=V;const J=j[0]-V;let W=0,D=0,B=0,L=0;if(Q.charAt(V)===" "){for(;V>0&&Q.charAt(V-1)===" ";)V--;for(;K<Q.length&&Q.charAt(K+1)===" ";)K++}else{let ne=j[0],ce=j[0];H.getWidth(ne)===0&&(W++,ne--),H.getWidth(ce)===2&&(D++,ce++);const de=H.getString(ce).length;for(de>1&&(L+=de-1,K+=de-1);ne>0&&V>0&&!this._isCharWordSeparator(H.loadCell(ne-1,this._workCell));){H.loadCell(ne-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,ne--):G>1&&(B+=G-1,V-=G-1),V--,ne--}for(;ce<H.length&&K+1<Q.length&&!this._isCharWordSeparator(H.loadCell(ce+1,this._workCell));){H.loadCell(ce+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ce++):G>1&&(L+=G-1,K+=G-1),K++,ce++}}K++;let z=V+J-W+B,ee=Math.min(this._bufferService.cols,K-V+W+D-B-L);if(M||Q.slice(V,K).trim()!==""){if($&&z===0&&H.getCodePoint(0)!==32){const ne=U.lines.get(j[1]-1);if(ne&&H.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ce){const de=this._bufferService.cols-ce.start;z-=de,ee+=de}}}if(F&&z+ee===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const ne=U.lines.get(j[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ce=this._getWordAt([0,j[1]+1],!1,!1,!0);ce&&(ee+=ce.length)}}return{start:z,length:ee}}}_selectWordAt(j,M){const $=this._getWordAt(j,M);if($){for(;$.start<0;)$.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[$.start,j[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let $=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,$]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),$={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)($,this._bufferService.cols)}};a.SelectionService=R=h([g(3,k.IBufferService),g(4,k.ICoreService),g(5,E.IMouseService),g(6,k.IOptionsService),g(7,E.IRenderService),g(8,E.ICoreBrowserService)],R)},4725:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(R,j,M,$){var F,U=arguments.length,H=U<3?j:$===null?$=Object.getOwnPropertyDescriptor(j,M):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(R,j,M,$);else for(var Q=R.length-1;Q>=0;Q--)(F=R[Q])&&(H=(U<3?F(H):U>3?F(j,M,H):F(j,M))||H);return U>3&&H&&Object.defineProperty(j,M,H),H},g=this&&this.__param||function(R,j){return function(M,$){j(M,$,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),S=c(8460),E=c(844),b=c(2585),v=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),p=_.css.toColor("#ffffff"),x=_.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const $=j[M/36%6|0],F=j[M/6%6|0],U=j[M%6];R.push({css:_.channels.toCss($,F,U),rgba:_.channels.toRgba($,F,U)})}for(let M=0;M<24;M++){const $=8+10*M;R.push({css:_.channels.toCss($,$,$),rgba:_.channels.toRgba($,$,$)})}return R})());let P=a.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:y,cursor:p,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:_.color.blend(y,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:_.color.blend(y,k),ansi:a.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(R={}){const j=this._colors;if(j.foreground=T(R.foreground,v),j.background=T(R.background,y),j.cursor=T(R.cursor,p),j.cursorAccent=T(R.cursorAccent,x),j.selectionBackgroundTransparent=T(R.selectionBackground,k),j.selectionBackgroundOpaque=_.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=T(R.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=_.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=R.selectionForeground?T(R.selectionForeground,_.NULL_COLOR):void 0,j.selectionForeground===_.NULL_COLOR&&(j.selectionForeground=void 0),_.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=_.color.opacity(j.selectionBackgroundTransparent,.3)),_.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=_.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=a.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=T(R.black,a.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=T(R.red,a.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=T(R.green,a.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=T(R.yellow,a.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=T(R.blue,a.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=T(R.magenta,a.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=T(R.cyan,a.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=T(R.white,a.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=T(R.brightBlack,a.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=T(R.brightRed,a.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=T(R.brightGreen,a.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=T(R.brightYellow,a.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=T(R.brightBlue,a.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=T(R.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=T(R.brightCyan,a.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=T(R.brightWhite,a.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const M=Math.min(j.ansi.length-16,R.extendedAnsi.length);for(let $=0;$<M;$++)j.ansi[$+16]=T(R.extendedAnsi[$],a.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let j=0;j<this._restoreColors.ansi.length;++j)this._colors.ansi[j]=this._restoreColors.ansi[j]}modifyColors(R){R(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 T(R,j){if(R!==void 0)try{return _.css.toColor(R)}catch{}return j}a.ThemeService=P=h([g(0,b.IOptionsService)],P)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const E=new Array(S);for(let b=0;b<Math.min(S,this.length);b++)E[b]=this._array[this._getCyclicIndex(b)];this._array=E,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let E=this._length;E<S;E++)this._array[E]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,E){this._array[this._getCyclicIndex(S)]=E}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,E,...b){if(E){for(let v=S;v<this._length-E;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+E)];this._length-=E,this.onDeleteEmitter.fire({index:S,amount:E})}for(let v=this._length-1;v>=S;v--)this._array[this._getCyclicIndex(v+b.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<b.length;v++)this._array[this._getCyclicIndex(S+v)]=b[v];if(b.length&&this.onInsertEmitter.fire({index:S,amount:b.length}),this._length+b.length>this._maxLength){const v=this._length+b.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=b.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,E,b){if(!(E<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let y=E-1;y>=0;y--)this.set(S+y+b,this.get(S+y));const v=S+E+b-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<E;v++)this.set(S+v+b,this.get(S+v))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=d},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,g=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const _ in h)d[_]=g<=1?h[_]:h[_]&&c(h[_],g-1);return d}},8055:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,h=0,g=0,d=0;var _,S,E,b,v;function y(x){const k=x.toString(16);return k.length<2?"0"+k:k}function p(x,k){return x<k?(k+.05)/(x+.05):(x+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(k,P,T,R){return R!==void 0?`#${y(k)}${y(P)}${y(T)}${y(R)}`:`#${y(k)}${y(P)}${y(T)}`},x.toRgba=function(k,P,T,R=255){return(k<<24|P<<16|T<<8|R)>>>0},x.toColor=function(k,P,T,R){return{css:x.toCss(k,P,T,R),rgba:x.toRgba(k,P,T,R)}}})(_||(a.channels=_={})),(function(x){function k(P,T){return d=Math.round(255*T),[c,h,g]=v.toChannels(P.rgba),{css:_.toCss(c,h,g,d),rgba:_.toRgba(c,h,g,d)}}x.blend=function(P,T){if(d=(255&T.rgba)/255,d===1)return{css:T.css,rgba:T.rgba};const R=T.rgba>>24&255,j=T.rgba>>16&255,M=T.rgba>>8&255,$=P.rgba>>24&255,F=P.rgba>>16&255,U=P.rgba>>8&255;return c=$+Math.round((R-$)*d),h=F+Math.round((j-F)*d),g=U+Math.round((M-U)*d),{css:_.toCss(c,h,g),rgba:_.toRgba(c,h,g)}},x.isOpaque=function(P){return(255&P.rgba)==255},x.ensureContrastRatio=function(P,T,R){const j=v.ensureContrastRatio(P.rgba,T.rgba,R);if(j)return _.toColor(j>>24&255,j>>16&255,j>>8&255)},x.opaque=function(P){const T=(255|P.rgba)>>>0;return[c,h,g]=v.toChannels(T),{css:_.toCss(c,h,g),rgba:T}},x.opacity=k,x.multiplyOpacity=function(P,T){return d=255&P.rgba,k(P,d*T/255)},x.toColorRGB=function(P){return[P.rgba>>24&255,P.rgba>>16&255,P.rgba>>8&255]}})(S||(a.color=S={})),(function(x){let k,P;try{const T=document.createElement("canvas");T.width=1,T.height=1;const R=T.getContext("2d",{willReadFrequently:!0});R&&(k=R,k.globalCompositeOperation="copy",P=k.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return c=parseInt(T.slice(1,2).repeat(2),16),h=parseInt(T.slice(2,3).repeat(2),16),g=parseInt(T.slice(3,4).repeat(2),16),_.toColor(c,h,g);case 5:return c=parseInt(T.slice(1,2).repeat(2),16),h=parseInt(T.slice(2,3).repeat(2),16),g=parseInt(T.slice(3,4).repeat(2),16),d=parseInt(T.slice(4,5).repeat(2),16),_.toColor(c,h,g,d);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}const R=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return c=parseInt(R[1]),h=parseInt(R[2]),g=parseInt(R[3]),d=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),_.toColor(c,h,g,d);if(!k||!P)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=P,k.fillStyle=T,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,h,g,d]=k.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,h,g,d),css:T}}})(E||(a.css=E={})),(function(x){function k(P,T,R){const j=P/255,M=T/255,$=R/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}x.relativeLuminance=function(P){return k(P>>16&255,P>>8&255,255&P)},x.relativeLuminance2=k})(b||(a.rgb=b={})),(function(x){function k(T,R,j){const M=T>>24&255,$=T>>16&255,F=T>>8&255;let U=R>>24&255,H=R>>16&255,Q=R>>8&255,V=p(b.relativeLuminance2(U,H,Q),b.relativeLuminance2(M,$,F));for(;V<j&&(U>0||H>0||Q>0);)U-=Math.max(0,Math.ceil(.1*U)),H-=Math.max(0,Math.ceil(.1*H)),Q-=Math.max(0,Math.ceil(.1*Q)),V=p(b.relativeLuminance2(U,H,Q),b.relativeLuminance2(M,$,F));return(U<<24|H<<16|Q<<8|255)>>>0}function P(T,R,j){const M=T>>24&255,$=T>>16&255,F=T>>8&255;let U=R>>24&255,H=R>>16&255,Q=R>>8&255,V=p(b.relativeLuminance2(U,H,Q),b.relativeLuminance2(M,$,F));for(;V<j&&(U<255||H<255||Q<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),H=Math.min(255,H+Math.ceil(.1*(255-H))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),V=p(b.relativeLuminance2(U,H,Q),b.relativeLuminance2(M,$,F));return(U<<24|H<<16|Q<<8|255)>>>0}x.blend=function(T,R){if(d=(255&R)/255,d===1)return R;const j=R>>24&255,M=R>>16&255,$=R>>8&255,F=T>>24&255,U=T>>16&255,H=T>>8&255;return c=F+Math.round((j-F)*d),h=U+Math.round((M-U)*d),g=H+Math.round(($-H)*d),_.toRgba(c,h,g)},x.ensureContrastRatio=function(T,R,j){const M=b.relativeLuminance(T>>8),$=b.relativeLuminance(R>>8);if(p(M,$)<j){if($<M){const H=k(T,R,j),Q=p(M,b.relativeLuminance(H>>8));if(Q<j){const V=P(T,R,j);return Q>p(M,b.relativeLuminance(V>>8))?H:V}return H}const F=P(T,R,j),U=p(M,b.relativeLuminance(F>>8));if(U<j){const H=k(T,R,j);return U>p(M,b.relativeLuminance(H>>8))?F:H}return F}},x.reduceLuminance=k,x.increaseLuminance=P,x.toChannels=function(T){return[T>>24&255,T>>16&255,T>>8&255,255&T]}})(v||(a.rgba=v={})),a.toPaddedHex=y,a.contrastRatio=p},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),g=c(2585),d=c(4348),_=c(7866),S=c(744),E=c(7302),b=c(6975),v=c(8460),y=c(1753),p=c(1480),x=c(7994),k=c(9282),P=c(5435),T=c(5981),R=c(2660);let j=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((F=>{var U;(U=this._onScrollApi)==null||U.fire(F.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(F){for(const U in F)this.optionsService.options[U]=F[U]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new h.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 d.InstantiationService,this.optionsService=this.register(new E.OptionsService(F)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new P.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((U=>{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((U=>{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 T.WriteBuffer(((U,H)=>this._inputHandler.parse(U,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,U){this._writeBuffer.write(F,U)}writeSync(F,U){this._logService.logLevel<=g.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(F,U)}input(F,U=!0){this.coreService.triggerDataEvent(F,U)}resize(F,U){isNaN(F)||isNaN(U)||(F=Math.max(F,S.MINIMUM_COLS),U=Math.max(U,S.MINIMUM_ROWS),this._bufferService.resize(F,U))}scroll(F,U=!1){this._bufferService.scroll(F,U)}scrollLines(F,U,H){this._bufferService.scrollLines(F,U,H)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const U=F-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(F,U){return this._inputHandler.registerEscHandler(F,U)}registerDcsHandler(F,U){return this._inputHandler.registerDcsHandler(F,U)}registerCsiHandler(F,U){return this._inputHandler.registerCsiHandler(F,U)}registerOscHandler(F,U){return this._inputHandler.registerOscHandler(F,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?F=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of F)U.dispose()}))}}}a.CoreTerminal=M},8460:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.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 h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((g=>h.fire(g)))},a.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(W,D,B,L){var z,ee=arguments.length,ne=ee<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,B):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(W,D,B,L);else for(var ce=W.length-1;ce>=0;ce--)(z=W[ce])&&(ne=(ee<3?z(ne):ee>3?z(D,B,ne):z(D,B))||ne);return ee>3&&ne&&Object.defineProperty(D,B,ne),ne},g=this&&this.__param||function(W,D){return function(B,L){D(B,L,W)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),S=c(2015),E=c(844),b=c(482),v=c(8437),y=c(8460),p=c(643),x=c(511),k=c(3734),P=c(2585),T=c(1480),R=c(6242),j=c(6351),M=c(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function U(W,D){if(W>24)return D.setWinLines||!1;switch(W){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var H;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(a.WindowsOptionsReportType=H={}));let Q=0;class V extends E.Disposable{getAttrData(){return this._curAttrData}constructor(D,B,L,z,ee,ne,ce,de,G=new S.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=B,this._coreService=L,this._logService=z,this._optionsService=ee,this._oscLinkService=ne,this._coreMouseService=ce,this._unicodeService=de,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new x.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 y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._parser.setCsiHandlerFallback(((O,Z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(O),params:Z.toArray()})})),this._parser.setEscHandlerFallback((O=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(O)})})),this._parser.setExecuteHandlerFallback((O=>{this._logService.debug("Unknown EXECUTE code: ",{code:O})})),this._parser.setOscHandlerFallback(((O,Z,X)=>{this._logService.debug("Unknown OSC code: ",{identifier:O,action:Z,data:X})})),this._parser.setDcsHandlerFallback(((O,Z,X)=>{Z==="HOOK"&&(X=X.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(O),action:Z,payload:X})})),this._parser.setPrintHandler(((O,Z,X)=>this.print(O,Z,X))),this._parser.registerCsiHandler({final:"@"},(O=>this.insertChars(O))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(O=>this.scrollLeft(O))),this._parser.registerCsiHandler({final:"A"},(O=>this.cursorUp(O))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(O=>this.scrollRight(O))),this._parser.registerCsiHandler({final:"B"},(O=>this.cursorDown(O))),this._parser.registerCsiHandler({final:"C"},(O=>this.cursorForward(O))),this._parser.registerCsiHandler({final:"D"},(O=>this.cursorBackward(O))),this._parser.registerCsiHandler({final:"E"},(O=>this.cursorNextLine(O))),this._parser.registerCsiHandler({final:"F"},(O=>this.cursorPrecedingLine(O))),this._parser.registerCsiHandler({final:"G"},(O=>this.cursorCharAbsolute(O))),this._parser.registerCsiHandler({final:"H"},(O=>this.cursorPosition(O))),this._parser.registerCsiHandler({final:"I"},(O=>this.cursorForwardTab(O))),this._parser.registerCsiHandler({final:"J"},(O=>this.eraseInDisplay(O,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(O=>this.eraseInDisplay(O,!0))),this._parser.registerCsiHandler({final:"K"},(O=>this.eraseInLine(O,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(O=>this.eraseInLine(O,!0))),this._parser.registerCsiHandler({final:"L"},(O=>this.insertLines(O))),this._parser.registerCsiHandler({final:"M"},(O=>this.deleteLines(O))),this._parser.registerCsiHandler({final:"P"},(O=>this.deleteChars(O))),this._parser.registerCsiHandler({final:"S"},(O=>this.scrollUp(O))),this._parser.registerCsiHandler({final:"T"},(O=>this.scrollDown(O))),this._parser.registerCsiHandler({final:"X"},(O=>this.eraseChars(O))),this._parser.registerCsiHandler({final:"Z"},(O=>this.cursorBackwardTab(O))),this._parser.registerCsiHandler({final:"`"},(O=>this.charPosAbsolute(O))),this._parser.registerCsiHandler({final:"a"},(O=>this.hPositionRelative(O))),this._parser.registerCsiHandler({final:"b"},(O=>this.repeatPrecedingCharacter(O))),this._parser.registerCsiHandler({final:"c"},(O=>this.sendDeviceAttributesPrimary(O))),this._parser.registerCsiHandler({prefix:">",final:"c"},(O=>this.sendDeviceAttributesSecondary(O))),this._parser.registerCsiHandler({final:"d"},(O=>this.linePosAbsolute(O))),this._parser.registerCsiHandler({final:"e"},(O=>this.vPositionRelative(O))),this._parser.registerCsiHandler({final:"f"},(O=>this.hVPosition(O))),this._parser.registerCsiHandler({final:"g"},(O=>this.tabClear(O))),this._parser.registerCsiHandler({final:"h"},(O=>this.setMode(O))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(O=>this.setModePrivate(O))),this._parser.registerCsiHandler({final:"l"},(O=>this.resetMode(O))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(O=>this.resetModePrivate(O))),this._parser.registerCsiHandler({final:"m"},(O=>this.charAttributes(O))),this._parser.registerCsiHandler({final:"n"},(O=>this.deviceStatus(O))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(O=>this.deviceStatusPrivate(O))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(O=>this.softReset(O))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(O=>this.setCursorStyle(O))),this._parser.registerCsiHandler({final:"r"},(O=>this.setScrollRegion(O))),this._parser.registerCsiHandler({final:"s"},(O=>this.saveCursor(O))),this._parser.registerCsiHandler({final:"t"},(O=>this.windowOptions(O))),this._parser.registerCsiHandler({final:"u"},(O=>this.restoreCursor(O))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(O=>this.insertColumns(O))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(O=>this.deleteColumns(O))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(O=>this.selectProtected(O))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(O=>this.requestMode(O,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(O=>this.requestMode(O,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((O=>(this.setTitle(O),this.setIconName(O),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((O=>this.setIconName(O)))),this._parser.registerOscHandler(2,new R.OscHandler((O=>this.setTitle(O)))),this._parser.registerOscHandler(4,new R.OscHandler((O=>this.setOrReportIndexedColor(O)))),this._parser.registerOscHandler(8,new R.OscHandler((O=>this.setHyperlink(O)))),this._parser.registerOscHandler(10,new R.OscHandler((O=>this.setOrReportFgColor(O)))),this._parser.registerOscHandler(11,new R.OscHandler((O=>this.setOrReportBgColor(O)))),this._parser.registerOscHandler(12,new R.OscHandler((O=>this.setOrReportCursorColor(O)))),this._parser.registerOscHandler(104,new R.OscHandler((O=>this.restoreIndexedColor(O)))),this._parser.registerOscHandler(110,new R.OscHandler((O=>this.restoreFgColor(O)))),this._parser.registerOscHandler(111,new R.OscHandler((O=>this.restoreBgColor(O)))),this._parser.registerOscHandler(112,new R.OscHandler((O=>this.restoreCursorColor(O)))),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 O in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:O},(()=>this.selectCharset("("+O))),this._parser.registerEscHandler({intermediates:")",final:O},(()=>this.selectCharset(")"+O))),this._parser.registerEscHandler({intermediates:"*",final:O},(()=>this.selectCharset("*"+O))),this._parser.registerEscHandler({intermediates:"+",final:O},(()=>this.selectCharset("+"+O))),this._parser.registerEscHandler({intermediates:"-",final:O},(()=>this.selectCharset("-"+O))),this._parser.registerEscHandler({intermediates:".",final:O},(()=>this.selectCharset("."+O))),this._parser.registerEscHandler({intermediates:"/",final:O},(()=>this.selectCharset("/"+O)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((O=>(this._logService.error("Parsing error: ",O),O))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((O,Z)=>this.requestStatusString(O,Z))))}_preserveStack(D,B,L,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=L,this._parseStack.position=z}_logSlowResolvingAsync(D){this._logService.logLevel<=P.LogLevelEnum.WARN&&Promise.race([D,new Promise(((B,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,B){let L,z=this._activeBuffer.x,ee=this._activeBuffer.y,ne=0;const ce=this._parseStack.paused;if(ce){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(L),L;z=this._parseStack.cursorStartX,ee=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>F&&(ne=this._parseStack.position+F)}if(this._logService.logLevel<=P.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(O=>String.fromCharCode(O))).join("")}"`),typeof D=="string"?D.split("").map((O=>O.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(D.length,F))),ce||this._dirtyRowTracker.clearRange(),D.length>F)for(let O=ne;O<D.length;O+=F){const Z=O+F<D.length?O+F:D.length,X=typeof D=="string"?this._stringDecoder.decode(D.substring(O,Z),this._parseBuffer):this._utf8Decoder.decode(D.subarray(O,Z),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,X))return this._preserveStack(z,ee,X,O),this._logSlowResolvingAsync(L),L}else if(!ce){const O=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,O))return this._preserveStack(z,ee,O,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===z&&this._activeBuffer.y===ee||this._onCursorMove.fire();const de=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),G=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);G<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(G,this._bufferService.rows-1),Math.min(de,this._bufferService.rows-1))}print(D,B,L){let z,ee;const ne=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,de=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,O=this._coreService.modes.insertMode,Z=this._curAttrData;let X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-B>0&&X.getWidth(this._activeBuffer.x-1)===2&&X.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Z);let q=this._parser.precedingJoinState;for(let re=B;re<L;++re){if(z=D[re],z<127&&ne){const Ke=ne[String.fromCharCode(z)];Ke&&(z=Ke.charCodeAt(0))}const he=this._unicodeService.charProperties(z,q);ee=T.UnicodeService.extractWidth(he);const Te=T.UnicodeService.extractShouldJoin(he),Be=Te?T.UnicodeService.extractWidth(q):0;if(q=he,ce&&this._onA11yChar.fire((0,b.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ee-Be>de){if(G){const Ke=X;let je=this._activeBuffer.x-Be;for(this._activeBuffer.x=Be,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),X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Be>0&&X instanceof v.BufferLine&&X.copyCellsFrom(Ke,je,0,Be,!1);je<de;)Ke.setCellFromCodepoint(je++,0,1,Z)}else if(this._activeBuffer.x=de-1,ee===2)continue}if(Te&&this._activeBuffer.x){const Ke=X.getWidth(this._activeBuffer.x-1)?1:2;X.addCodepointToCell(this._activeBuffer.x-Ke,z,ee);for(let je=ee-Be;--je>=0;)X.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}else if(O&&(X.insertCells(this._activeBuffer.x,ee-Be,this._activeBuffer.getNullCell(Z)),X.getWidth(de-1)===2&&X.setCellFromCodepoint(de-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,Z)),X.setCellFromCodepoint(this._activeBuffer.x++,z,ee,Z),ee>0)for(;--ee;)X.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}this._parser.precedingJoinState=q,this._activeBuffer.x<de&&L-B>0&&X.getWidth(this._activeBuffer.x)===0&&!X.hasContent(this._activeBuffer.x)&&X.setCellFromCodepoint(this._activeBuffer.x,0,1,Z),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,B){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,B):this._parser.registerCsiHandler(D,(L=>!U(L.params[0],this._optionsService.rawOptions.windowOptions)||B(L)))}registerDcsHandler(D,B){return this._parser.registerDcsHandler(D,new j.DcsHandler(B))}registerEscHandler(D,B){return this._parser.registerEscHandler(D,B)}registerOscHandler(D,B){return this._parser.registerOscHandler(D,new R.OscHandler(B))}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 D;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&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=D,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+B)}cursorUp(D){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const B=D.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const B=D.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,B,L,z=!1,ee=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);ne.replaceCells(B,L,this._activeBuffer.getNullCell(this._eraseAttrData()),ee),z&&(ne.isWrapped=!1)}_resetBufferLine(D,B=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),L.isWrapped=!1)}eraseInDisplay(D,B=!1){let L;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);L<this._bufferService.rows;L++)this._resetBufferLine(L,B);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,B);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(D,B=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let B=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ee=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;B--;)this._activeBuffer.lines.splice(ee-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let B=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;B--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let B=D.params[0]||1;for(;B--;)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(D){let B=D.params[0]||1;for(;B--;)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(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const B=this._parser.precedingJoinState;if(!B)return!0;const L=D.params[0]||1,z=T.UnicodeService.extractWidth(B),ee=this._activeBuffer.x-z,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ee),ce=new Uint32Array(ne.length*L);let de=0;for(let O=0;O<ne.length;){const Z=ne.codePointAt(O)||0;ce[de++]=Z,O+=Z>65535?2:1}let G=de;for(let O=1;O<L;++O)ce.copyWithin(G,0,de),G+=de;return this.print(ce,0,G),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){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(),D.params[B]===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(D,B){const L=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:ee}=this._coreMouseService,ne=this._coreService,{buffers:ce,cols:de}=this._bufferService,{active:G,alt:O}=ce,Z=this._optionsService.rawOptions,X=Te=>Te?1:2,q=D.params[0];return re=q,he=B?q===2?4:q===4?X(ne.modes.insertMode):q===12?3:q===20?X(Z.convertEol):0:q===1?X(L.applicationCursorKeys):q===3?Z.windowOptions.setWinLines?de===80?2:de===132?1:0:0:q===6?X(L.origin):q===7?X(L.wraparound):q===8?3:q===9?X(z==="X10"):q===12?X(Z.cursorBlink):q===25?X(!ne.isCursorHidden):q===45?X(L.reverseWraparound):q===66?X(L.applicationKeypad):q===67?4:q===1e3?X(z==="VT200"):q===1002?X(z==="DRAG"):q===1003?X(z==="ANY"):q===1004?X(L.sendFocus):q===1005?4:q===1006?X(ee==="SGR"):q===1015?4:q===1016?X(ee==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?X(G===O):q===2004?X(L.bracketedPasteMode):0,ne.triggerDataEvent(`${d.C0.ESC}[${B?"":"?"}${re};${he}$y`),!0;var re,he}_updateAttrColor(D,B,L,z,ee){return B===2?(D|=50331648,D&=-16777216,D|=k.AttributeData.fromColorRGB([L,z,ee])):B===5&&(D&=-50331904,D|=33554432|255&L),D}_extractColor(D,B,L){const z=[0,0,-1,0,0,0];let ee=0,ne=0;do{if(z[ne+ee]=D.params[B+ne],D.hasSubParams(B+ne)){const ce=D.getSubParams(B+ne);let de=0;do z[1]===5&&(ee=1),z[ne+de+1+ee]=ce[de];while(++de<ce.length&&de+ne+1+ee<z.length);break}if(z[1]===5&&ne+ee>=2||z[1]===2&&ne+ee>=5)break;z[1]&&(ee=1)}while(++ne+B<D.length&&ne+ee<z.length);for(let ce=2;ce<z.length;++ce)z[ce]===-1&&(z[ce]=0);switch(z[0]){case 38:L.fg=this._updateAttrColor(L.fg,z[1],z[3],z[4],z[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,z[1],z[3],z[4],z[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,z[1],z[3],z[4],z[5])}return ne}_processUnderline(D,B){B.extended=B.extended.clone(),(!~D||D>5)&&(D=1),B.extended.underlineStyle=D,B.fg|=268435456,D===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(D){D.fg=v.DEFAULT_ATTR_DATA.fg,D.bg=v.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=D.length;let L;const z=this._curAttrData;for(let ee=0;ee<B;ee++)L=D.params[ee],L>=30&&L<=37?(z.fg&=-50331904,z.fg|=16777216|L-30):L>=40&&L<=47?(z.bg&=-50331904,z.bg|=16777216|L-40):L>=90&&L<=97?(z.fg&=-50331904,z.fg|=16777224|L-90):L>=100&&L<=107?(z.bg&=-50331904,z.bg|=16777224|L-100):L===0?this._processSGR0(z):L===1?z.fg|=134217728:L===3?z.bg|=67108864:L===4?(z.fg|=268435456,this._processUnderline(D.hasSubParams(ee)?D.getSubParams(ee)[0]:1,z)):L===5?z.fg|=536870912:L===7?z.fg|=67108864:L===8?z.fg|=1073741824:L===9?z.fg|=2147483648:L===2?z.bg|=134217728:L===21?this._processUnderline(2,z):L===22?(z.fg&=-134217729,z.bg&=-134217729):L===23?z.bg&=-67108865:L===24?(z.fg&=-268435457,this._processUnderline(0,z)):L===25?z.fg&=-536870913:L===27?z.fg&=-67108865:L===28?z.fg&=-1073741825:L===29?z.fg&=2147483647:L===39?(z.fg&=-67108864,z.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):L===49?(z.bg&=-67108864,z.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?ee+=this._extractColor(D,ee,z):L===53?z.bg|=1073741824:L===55?z.bg&=-1073741825:L===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):L===100?(z.fg&=-67108864,z.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${B};${L}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const B=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${B};${L}R`)}return!0}softReset(D){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(D){const B=D.params[0]||1;switch(B){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 L=B%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(D){const B=D.params[0]||1;let L;return(D.length<2||(L=D.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(D){if(!U(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const B=[],L=D.split(";");for(;L.length>1;){const z=L.shift(),ee=L.shift();if(/^\d+$/.exec(z)){const ne=parseInt(z);if(J(ne))if(ee==="?")B.push({type:0,index:ne});else{const ce=(0,M.parseColor)(ee);ce&&B.push({type:1,index:ne,color:ce})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(D){const B=D.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(D,B){this._getCurrentLinkId()&&this._finishHyperlink();const L=D.split(":");let z;const ee=L.findIndex((ne=>ne.startsWith("id=")));return ee!==-1&&(z=L[ee].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,B){const L=D.split(";");for(let z=0;z<L.length&&!(B>=this._specialColors.length);++z,++B)if(L[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const ee=(0,M.parseColor)(L[z]);ee&&this._onColor.fire([{type:1,index:this._specialColors[B],color:ee}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const B=[],L=D.split(";");for(let z=0;z<L.length;++z)if(/^\d+$/.exec(L[z])){const ee=parseInt(L[z]);J(ee)&&B.push({type:2,index:ee})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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,_.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset($[D[0]],_.CHARSETS[D[1]]||_.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 D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new x.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const L=this._activeBuffer.ybase+this._activeBuffer.y+B,z=this._activeBuffer.lines.get(L);z&&(z.fill(D),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,B){const L=this._bufferService.buffer,z=this._optionsService.rawOptions;return(ee=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${ee}${d.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,B){this._dirtyRowTracker.markRangeDirty(D,B)}}a.InputHandler=V;let K=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,D){W>D&&(Q=W,W=D,D=Q),W<this.start&&(this.start=W),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(W){return 0<=W&&W<256}K=h([g(0,P.IBufferService)],K)},844:(f,a)=>{function c(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,_){this._data[g]||(this._data[g]={}),this._data[g][d]=_}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,g,d,_,S){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(d,_,S)}get(h,g,d,_){var S;return(S=this._data.get(h,g))==null?void 0:S.get(d,_)}clear(){this._data.clear()}}},6114:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,g){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let g=0,d=this._array.length-1;for(;d>=g;){let _=g+d>>1;const S=this._getKey(this._array[_]);if(S>h)d=_-1;else{if(!(S<h)){for(;_>0&&this._getKey(this._array[_-1])===h;)_--;return _}g=_+1}}return g}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let E=0,b=0,v=S.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),b=Math.max(E,b),y=S.timeRemaining(),1.5*b>y)return v-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-E))}ms`),void this._start();v=y}this.clear()}}class d extends g{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const E=Date.now()+S;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=d==null?void 0:d.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&_&&(S.isWrapped=_[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&_[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}a.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),g=c(7226),d=c(3734),_=c(8437),S=c(4634),E=c(511),b=c(643),v=c(4863),y=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(p,x,k){this._hasScrollback=p,this._optionsService=x,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,x){return new _.BufferLine(this._bufferService.cols,this.getNullCell(p),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const x=p+this._optionsService.rawOptions.scrollback;return x>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:x}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=_.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,x){const k=this.getNullCell(_.DEFAULT_ATTR_DATA);let P=0;const T=this._getCorrectBufferLength(x);if(T>this.lines.maxLength&&(this.lines.maxLength=T),this.lines.length>0){if(this._cols<p)for(let j=0;j<this.lines.length;j++)P+=+this.lines.get(j).resize(p,k);let R=0;if(this._rows<x)for(let j=this._rows;j<x;j++)this.lines.length<x+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(p,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(p,k)));else for(let j=this._rows;j>x;j--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(T<this.lines.maxLength){const j=this.lines.length-T;j>0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=T}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,x-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(p,x),this._cols>p))for(let R=0;R<this.lines.length;R++)P+=+this.lines.get(R).resize(p,k);this._cols=p,this._rows=x,this._memoryCleanupQueue.clear(),P>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,x){this._cols!==p&&(p>this._cols?this._reflowLarger(p,x):this._reflowSmaller(p,x))}_reflowLarger(p,x){const k=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(k.length>0){const P=(0,S.reflowLargerCreateNewLayout)(this.lines,k);(0,S.reflowLargerApplyNewLayout)(this.lines,P.layout),this._reflowLargerAdjustViewport(p,x,P.countRemoved)}}_reflowLargerAdjustViewport(p,x,k){const P=this.getNullCell(_.DEFAULT_ATTR_DATA);let T=k;for(;T-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new _.BufferLine(p,P))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(p,x){const k=this.getNullCell(_.DEFAULT_ATTR_DATA),P=[];let T=0;for(let R=this.lines.length-1;R>=0;R--){let j=this.lines.get(R);if(!j||!j.isWrapped&&j.getTrimmedLength()<=p)continue;const M=[j];for(;j.isWrapped&&R>0;)j=this.lines.get(--R),M.unshift(j);const $=this.ybase+this.y;if($>=R&&$<R+M.length)continue;const F=M[M.length-1].getTrimmedLength(),U=(0,S.reflowSmallerGetNewLineLengths)(M,this._cols,p),H=U.length-M.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const V=[];for(let L=0;L<H;L++){const z=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);V.push(z)}V.length>0&&(P.push({start:R+M.length+T,newLines:V}),T+=V.length),M.push(...V);let K=U.length-1,J=U[K];J===0&&(K--,J=U[K]);let W=M.length-H-1,D=F;for(;W>=0;){const L=Math.min(D,J);if(M[K]===void 0)break;if(M[K].copyCellsFrom(M[W],D-L,J-L,L,!0),J-=L,J===0&&(K--,J=U[K]),D-=L,D===0){W--;const z=Math.max(W,0);D=(0,S.getWrappedLineTrimmedLength)(M,z,this._cols)}}for(let L=0;L<M.length;L++)U[L]<p&&M[L].setCell(U[L],k);let B=H-Q;for(;B-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+T)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+x-1)}if(P.length>0){const R=[],j=[];for(let K=0;K<this.lines.length;K++)j.push(this.lines.get(K));const M=this.lines.length;let $=M-1,F=0,U=P[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+T);let H=0;for(let K=Math.min(this.lines.maxLength-1,M+T-1);K>=0;K--)if(U&&U.start>$+H){for(let J=U.newLines.length-1;J>=0;J--)this.lines.set(K--,U.newLines[J]);K++,R.push({index:$+1,amount:U.newLines.length}),H+=U.newLines.length,U=P[++F]}else this.lines.set(K,j[$--]);let Q=0;for(let K=R.length-1;K>=0;K--)R[K].index+=Q,this.lines.onInsertEmitter.fire(R[K]),Q+=R[K].amount;const V=Math.max(0,M+T-this.lines.maxLength);V>0&&this.lines.onTrimEmitter.fire(V)}}translateBufferLineToString(p,x,k=0,P){const T=this.lines.get(p);return T?T.translateToString(x,k,P):""}getWrappedRangeForLine(p){let x=p,k=p;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:x,last:k}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].line===p&&(this.markers[x].dispose(),this.markers.splice(x--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const x=new v.Marker(p);return this.markers.push(x),x.register(this.lines.onTrim((k=>{x.line-=k,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((k=>{x.line>=k.index&&(x.line+=k.amount)}))),x.register(this.lines.onDelete((k=>{x.line>=k.index&&x.line<k.index+k.amount&&x.dispose(),x.line>k.index&&(x.line-=k.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),g=c(511),d=c(643),_=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let S=0;class E{constructor(v,y,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const x=y||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let k=0;k<v;++k)this.setCell(k,x);this.length=v}get(v){const y=this._data[3*v+0],p=2097151&y;return[this._data[3*v+1],2097152&y?this._combined[v]:p?(0,_.stringFromCodePoint)(p):"",y>>22,2097152&y?this._combined[v].charCodeAt(this._combined[v].length-1):p]}set(v,y){this._data[3*v+1]=y[d.CHAR_DATA_ATTR_INDEX],y[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=y[1],this._data[3*v+0]=2097152|v|y[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=y[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[d.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 y=this._data[3*v+0];return 2097152&y?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&y}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const y=this._data[3*v+0];return 2097152&y?this._combined[v]:2097151&y?(0,_.stringFromCodePoint)(2097151&y):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,y){return S=3*v,y.content=this._data[S+0],y.fg=this._data[S+1],y.bg=this._data[S+2],2097152&y.content&&(y.combinedData=this._combined[v]),268435456&y.bg&&(y.extended=this._extendedAttrs[v]),y}setCell(v,y){2097152&y.content&&(this._combined[v]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=y.content,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}setCellFromCodepoint(v,y,p,x){268435456&x.bg&&(this._extendedAttrs[v]=x.extended),this._data[3*v+0]=y|p<<22,this._data[3*v+1]=x.fg,this._data[3*v+2]=x.bg}addCodepointToCell(v,y,p){let x=this._data[3*v+0];2097152&x?this._combined[v]+=(0,_.stringFromCodePoint)(y):2097151&x?(this._combined[v]=(0,_.stringFromCodePoint)(2097151&x)+(0,_.stringFromCodePoint)(y),x&=-2097152,x|=2097152):x=y|4194304,p&&(x&=-12582913,x|=p<<22),this._data[3*v+0]=x}insertCells(v,y,p){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),y<this.length-v){const x=new g.CellData;for(let k=this.length-v-y-1;k>=0;--k)this.setCell(v+y+k,this.loadCell(v+k,x));for(let k=0;k<y;++k)this.setCell(v+k,p)}else for(let x=v;x<this.length;++x)this.setCell(x,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(v,y,p){if(v%=this.length,y<this.length-v){const x=new g.CellData;for(let k=0;k<this.length-v-y;++k)this.setCell(v+k,this.loadCell(v+y+k,x));for(let k=this.length-y;k<this.length;++k)this.setCell(k,p)}else for(let x=v;x<this.length;++x)this.setCell(x,p);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,p)}replaceCells(v,y,p,x=!1){if(x)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,p),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,p);v<y&&v<this.length;)this.isProtected(v)||this.setCell(v,p),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,p);v<y&&v<this.length;)this.setCell(v++,p)}resize(v,y){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const x=new Uint32Array(p);x.set(this._data),this._data=x}for(let x=this.length;x<v;++x)this.setCell(x,y)}else{this._data=this._data.subarray(0,p);const x=Object.keys(this._combined);for(let P=0;P<x.length;P++){const T=parseInt(x[P],10);T>=v&&delete this._combined[T]}const k=Object.keys(this._extendedAttrs);for(let P=0;P<k.length;P++){const T=parseInt(k[P],10);T>=v&&delete this._extendedAttrs[T]}}return this.length=v,4*p*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,y=!1){if(y)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,v);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,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 y in v._combined)this._combined[y]=v._combined[y];this._extendedAttrs={};for(const y in v._extendedAttrs)this._extendedAttrs[y]=v._extendedAttrs[y];this.isWrapped=v.isWrapped}clone(){const v=new E(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const y in this._combined)v._combined[y]=this._combined[y];for(const y in this._extendedAttrs)v._extendedAttrs[y]=this._extendedAttrs[y];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,y,p,x,k){const P=v._data;if(k)for(let R=x-1;R>=0;R--){for(let j=0;j<3;j++)this._data[3*(p+R)+j]=P[3*(y+R)+j];268435456&P[3*(y+R)+2]&&(this._extendedAttrs[p+R]=v._extendedAttrs[y+R])}else for(let R=0;R<x;R++){for(let j=0;j<3;j++)this._data[3*(p+R)+j]=P[3*(y+R)+j];268435456&P[3*(y+R)+2]&&(this._extendedAttrs[p+R]=v._extendedAttrs[y+R])}const T=Object.keys(v._combined);for(let R=0;R<T.length;R++){const j=parseInt(T[R],10);j>=y&&(this._combined[j-y+p]=v._combined[j])}}translateToString(v,y,p,x){y=y??0,p=p??this.length,v&&(p=Math.min(p,this.getTrimmedLength())),x&&(x.length=0);let k="";for(;y<p;){const P=this._data[3*y+0],T=2097151&P,R=2097152&P?this._combined[y]:T?(0,_.stringFromCodePoint)(T):d.WHITESPACE_CELL_CHAR;if(k+=R,x)for(let j=0;j<R.length;++j)x.push(y);y+=P>>22||1}return x&&x.push(y),k}}a.BufferLine=E},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){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 h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,g,d){if(g===h.length-1)return h[g].getTrimmedLength();const _=!h[g].hasContent(d-1)&&h[g].getWidth(d-1)===1,S=h[g+1].getWidth(0)===2;return _&&S?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,g,d,_,S){const E=[];for(let b=0;b<h.length-1;b++){let v=b,y=h.get(++v);if(!y.isWrapped)continue;const p=[h.get(b)];for(;v<h.length&&y.isWrapped;)p.push(y),y=h.get(++v);if(_>=b&&_<v){b+=p.length-1;continue}let x=0,k=c(p,x,g),P=1,T=0;for(;P<p.length;){const j=c(p,P,g),M=j-T,$=d-k,F=Math.min(M,$);p[x].copyCellsFrom(p[P],T,k,F,!1),k+=F,k===d&&(x++,k=0),T+=F,T===j&&(P++,T=0),k===0&&x!==0&&p[x-1].getWidth(d-1)===2&&(p[x].copyCellsFrom(p[x-1],d-1,k++,1,!1),p[x-1].setCell(d-1,S))}p[x].replaceCells(k,d,S);let R=0;for(let j=p.length-1;j>0&&(j>x||p[j].getTrimmedLength()===0);j--)R++;R>0&&(E.push(b+p.length-R),E.push(R)),b+=p.length-1}return E},a.reflowLargerCreateNewLayout=function(h,g){const d=[];let _=0,S=g[_],E=0;for(let b=0;b<h.length;b++)if(S===b){const v=g[++_];h.onDeleteEmitter.fire({index:b-E,amount:v}),b+=v-1,E+=v,S=g[++_]}else d.push(b);return{layout:d,countRemoved:E}},a.reflowLargerApplyNewLayout=function(h,g){const d=[];for(let _=0;_<g.length;_++)d.push(h.get(g[_]));for(let _=0;_<d.length;_++)h.set(_,d[_]);h.length=g.length},a.reflowSmallerGetNewLineLengths=function(h,g,d){const _=[],S=h.map(((y,p)=>c(h,p,g))).reduce(((y,p)=>y+p));let E=0,b=0,v=0;for(;v<S;){if(S-v<d){_.push(S-v);break}E+=d;const y=c(h,b,g);E>y&&(E-=y,b++);const p=h[b].getWidth(E-1)===2;p&&E--;const x=p?d-1:d;_.push(x),v+=x}return _},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),g=c(844),d=c(9092);class _ extends g.Disposable{constructor(E,b){super(),this._optionsService=E,this._bufferService=b,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,b){this._normal.resize(E,b),this._alt.resize(E,b),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}a.BufferSet=_},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),g=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const b=new _;return b.setFromCharData(E),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(E[g.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(E[g.CHAR_DATA_CHAR_INDEX].length===2){const v=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const y=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(v-55296)+y-56320+65536|E[g.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[g.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=E[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},643:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),g=c(844);class d{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=d,d._nextId=1},7116:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,a)=>{var c,h,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
519
|
+
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(a.C0=c={})),(function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""})(h||(a.C1=h={})),(function(d){d.ST=`${c.ESC}\\`})(g||(a.C1_ESCAPED=g={}))},7399:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const h=c(2584),g={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:["'",'"']};a.evaluateKeyboardEvent=function(d,_,S,E){const b={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?b.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?b.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?b.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(b.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:b.key=d.ctrlKey?"\b":h.C0.DEL,d.altKey&&(b.key=h.C0.ESC+b.key);break;case 9:if(d.shiftKey){b.key=h.C0.ESC+"[Z";break}b.key=h.C0.HT,b.cancel=!0;break;case 13:b.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,b.cancel=!0;break;case 27:b.key=h.C0.ESC,d.altKey&&(b.key=h.C0.ESC+h.C0.ESC),b.cancel=!0;break;case 37:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"D",b.key===h.C0.ESC+"[1;3D"&&(b.key=h.C0.ESC+(S?"b":"[1;5D"))):b.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"C",b.key===h.C0.ESC+"[1;3C"&&(b.key=h.C0.ESC+(S?"f":"[1;5C"))):b.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"A",S||b.key!==h.C0.ESC+"[1;3A"||(b.key=h.C0.ESC+"[1;5A")):b.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(b.key=h.C0.ESC+"[1;"+(v+1)+"B",S||b.key!==h.C0.ESC+"[1;3B"||(b.key=h.C0.ESC+"[1;5B")):b.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(b.key=h.C0.ESC+"[2~");break;case 46:b.key=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:b.key=v?h.C0.ESC+"[1;"+(v+1)+"H":_?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:b.key=v?h.C0.ESC+"[1;"+(v+1)+"F":_?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?b.type=2:d.ctrlKey?b.key=h.C0.ESC+"[5;"+(v+1)+"~":b.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?b.type=3:d.ctrlKey?b.key=h.C0.ESC+"[6;"+(v+1)+"~":b.key=h.C0.ESC+"[6~";break;case 112:b.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:b.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:b.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:b.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:b.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:b.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:b.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:b.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:b.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:b.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:b.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:b.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(S&&!E||!d.altKey||d.metaKey)!S||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?b.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(b.key=h.C0.US),d.key==="@"&&(b.key=h.C0.NUL)):d.keyCode===65&&(b.type=1);else{const y=g[d.keyCode],p=y==null?void 0:y[d.shiftKey?1:0];if(p)b.key=h.C0.ESC+p;else if(d.keyCode>=65&&d.keyCode<=90){const x=d.ctrlKey?d.keyCode-64:d.keyCode+32;let k=String.fromCharCode(x);d.shiftKey&&(k=k.toUpperCase()),b.key=h.C0.ESC+k}else if(d.keyCode===32)b.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let x=d.code.slice(3,4);d.shiftKey||(x=x.toLowerCase()),b.key=h.C0.ESC+x,b.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?b.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?b.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?b.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?b.key=h.C0.DEL:d.keyCode===219?b.key=h.C0.ESC:d.keyCode===220?b.key=h.C0.FS:d.keyCode===221&&(b.key=h.C0.GS)}return b}},482:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,h=0,g=c.length){let d="";for(let _=h;_<g;++_){let S=c[_];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const g=c.length;if(!g)return 0;let d=0,_=0;if(this._interim){const S=c.charCodeAt(_++);56320<=S&&S<=57343?h[d++]=1024*(this._interim-55296)+S-56320+65536:(h[d++]=this._interim,h[d++]=S),this._interim=0}for(let S=_;S<g;++S){const E=c.charCodeAt(S);if(55296<=E&&E<=56319){if(++S>=g)return this._interim=E,d;const b=c.charCodeAt(S);56320<=b&&b<=57343?h[d++]=1024*(E-55296)+b-56320+65536:(h[d++]=E,h[d++]=b)}else E!==65279&&(h[d++]=E)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const g=c.length;if(!g)return 0;let d,_,S,E,b=0,v=0,y=0;if(this.interim[0]){let k=!1,P=this.interim[0];P&=(224&P)==192?31:(240&P)==224?15:7;let T,R=0;for(;(T=63&this.interim[++R])&&R<4;)P<<=6,P|=T;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-R;for(;y<M;){if(y>=g)return 0;if(T=c[y++],(192&T)!=128){y--,k=!0;break}this.interim[R++]=T,P<<=6,P|=63&T}k||(j===2?P<128?y--:h[b++]=P:j===3?P<2048||P>=55296&&P<=57343||P===65279||(h[b++]=P):P<65536||P>1114111||(h[b++]=P)),this.interim.fill(0)}const p=g-4;let x=y;for(;x<g;){for(;!(!(x<p)||128&(d=c[x])||128&(_=c[x+1])||128&(S=c[x+2])||128&(E=c[x+3]));)h[b++]=d,h[b++]=_,h[b++]=S,h[b++]=E,x+=4;if(d=c[x++],d<128)h[b++]=d;else if((224&d)==192){if(x>=g)return this.interim[0]=d,b;if(_=c[x++],(192&_)!=128){x--;continue}if(v=(31&d)<<6|63&_,v<128){x--;continue}h[b++]=v}else if((240&d)==224){if(x>=g)return this.interim[0]=d,b;if(_=c[x++],(192&_)!=128){x--;continue}if(x>=g)return this.interim[0]=d,this.interim[1]=_,b;if(S=c[x++],(192&S)!=128){x--;continue}if(v=(15&d)<<12|(63&_)<<6|63&S,v<2048||v>=55296&&v<=57343||v===65279)continue;h[b++]=v}else if((248&d)==240){if(x>=g)return this.interim[0]=d,b;if(_=c[x++],(192&_)!=128){x--;continue}if(x>=g)return this.interim[0]=d,this.interim[1]=_,b;if(S=c[x++],(192&S)!=128){x--;continue}if(x>=g)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=S,b;if(E=c[x++],(192&E)!=128){x--;continue}if(v=(7&d)<<18|(63&_)<<12|(63&S)<<6|63&E,v<65536||v>1114111)continue;h[b++]=v}}return b}}},225:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const h=c(1480),g=[[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]],d=[[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 _;a.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let S=0;S<g.length;++S)_.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?_[S]:(function(E,b){let v,y=0,p=b.length-1;if(E<b[0][0]||E>b[p][1])return!1;for(;p>=y;)if(v=y+p>>1,E>b[v][1])y=v+1;else{if(!(E<b[v][0]))return!0;p=v-1}return!1})(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,E){let b=this.wcwidth(S),v=b===0&&E!==0;if(v){const y=h.UnicodeService.extractWidth(E);y===0?v=!1:y>b&&(b=y)}return h.UnicodeService.createPropertyValue(0,b,v)}}},5981:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const h=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,E){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E)}_innerWrite(S=0,E=!0){const b=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],y=this._action(v,E);if(y){const x=k=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(b,k);return void y.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(x)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-b>=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()}}a.WriteBuffer=d},5941:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.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})$/,h=/^[\da-f]+$/;function g(d,_){const S=d.toString(16),E=S.length<2?"0"+S:S;switch(_){case 4:return S[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}a.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const S=c.exec(_);if(S){const E=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/E*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/E*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/E*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),h.exec(_)&&[3,6,9,12].includes(_.length))){const S=_.length/3,E=[0,0,0];for(let b=0;b<3;++b){const v=parseInt(_.slice(S*b,S*b+S),16);E[b]=S===1?v<<4:S===2?v:S===3?v>>4:v>>8}return E}},a.toRgbString=function(d,_=16){const[S,E,b]=d;return`rgb:${g(S,_)}/${g(E,_)}/${g(b,_)}`}},5770:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const h=c(482),g=c(8742),d=c(5770),_=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(E,b){this._handlers[E]===void 0&&(this._handlers[E]=[]);const v=this._handlers[E];return v.push(b),{dispose:()=>{const y=v.indexOf(b);y!==-1&&v.splice(y,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(E,b){if(this.reset(),this._ident=E,this._active=this._handlers[E]||_,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(E,b,v){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(E,b,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(E,b,v))}unhook(E,b=!0){if(this._active.length){let v=!1,y=this._active.length-1,p=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,v=b,p=this._stack.fallThrough,this._stack.paused=!1),!p&&v===!1){for(;y>=0&&(v=this._active[y].unhook(E),v!==!0);y--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,v;y--}for(;y>=0;y--)if(v=this._active[y].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",E);this._active=_,this._ident=0}};const S=new g.Params;S.addParam(0),a.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=S,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():S,this._data="",this._hitLimit=!1}put(E,b,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(E,b,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let b=!1;if(this._hitLimit)b=!1;else if(E&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((v=>(this._params=S,this._data="",this._hitLimit=!1,v)));return this._params=S,this._data="",this._hitLimit=!1,b}}},2015:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const h=c(844),g=c(8742),d=c(6242),_=c(6351);class S{constructor(y){this.table=new Uint8Array(y)}setDefault(y,p){this.table.fill(y<<4|p)}add(y,p,x,k){this.table[p<<8|y]=x<<4|k}addMany(y,p,x,k){for(let P=0;P<y.length;P++)this.table[p<<8|y[P]]=x<<4|k}}a.TransitionTable=S;const E=160;a.VT500_TRANSITION_TABLE=(function(){const v=new S(4095),y=Array.apply(null,Array(256)).map(((R,j)=>j)),p=(R,j)=>y.slice(R,j),x=p(32,127),k=p(0,24);k.push(25),k.push.apply(k,p(28,32));const P=p(0,14);let T;for(T in v.setDefault(1,0),v.addMany(x,0,2,0),P)v.addMany([24,26,153,154],T,3,0),v.addMany(p(128,144),T,3,0),v.addMany(p(144,152),T,3,0),v.add(156,T,0,0),v.add(27,T,11,1),v.add(157,T,4,8),v.addMany([152,158,159],T,0,7),v.add(155,T,11,3),v.add(144,T,11,9);return v.addMany(k,0,3,0),v.addMany(k,1,3,1),v.add(127,1,0,1),v.addMany(k,8,0,8),v.addMany(k,3,3,3),v.add(127,3,0,3),v.addMany(k,4,3,4),v.add(127,4,0,4),v.addMany(k,6,3,6),v.addMany(k,5,3,5),v.add(127,5,0,5),v.addMany(k,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(x,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(p(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(x,7,0,7),v.addMany(k,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(p(64,127),3,7,0),v.addMany(p(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(p(48,60),4,8,4),v.addMany(p(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(p(32,64),6,0,6),v.add(127,6,0,6),v.addMany(p(64,127),6,0,0),v.addMany(p(32,48),3,9,5),v.addMany(p(32,48),5,9,5),v.addMany(p(48,64),5,0,6),v.addMany(p(64,127),5,7,0),v.addMany(p(32,48),4,9,5),v.addMany(p(32,48),1,9,2),v.addMany(p(32,48),2,9,2),v.addMany(p(48,127),2,10,0),v.addMany(p(48,80),1,10,0),v.addMany(p(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(p(96,127),1,10,0),v.add(80,1,11,9),v.addMany(k,9,0,9),v.add(127,9,0,9),v.addMany(p(28,32),9,0,9),v.addMany(p(32,48),9,9,12),v.addMany(p(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(k,11,0,11),v.addMany(p(32,128),11,0,11),v.addMany(p(28,32),11,0,11),v.addMany(k,10,0,10),v.add(127,10,0,10),v.addMany(p(28,32),10,0,10),v.addMany(p(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(p(32,48),10,9,12),v.addMany(k,12,0,12),v.add(127,12,0,12),v.addMany(p(28,32),12,0,12),v.addMany(p(32,48),12,9,12),v.addMany(p(48,64),12,0,11),v.addMany(p(64,127),12,12,13),v.addMany(p(64,127),10,12,13),v.addMany(p(64,127),9,12,13),v.addMany(k,13,13,13),v.addMany(x,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(E,0,2,0),v.add(E,8,5,8),v.add(E,6,0,6),v.add(E,11,0,11),v.add(E,13,13,13),v})();class b extends h.Disposable{constructor(y=a.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,x,k)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,x)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,p=[64,126]){let x=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=y.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let P=0;P<y.intermediates.length;++P){const T=y.intermediates.charCodeAt(P);if(32>T||T>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=T}}if(y.final.length!==1)throw new Error("final must be a single byte");const k=y.final.charCodeAt(0);if(p[0]>k||k>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return x<<=8,x|=k,x}identToString(y){const p=[];for(;y;)p.push(String.fromCharCode(255&y)),y>>=8;return p.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,p){const x=this._identifier(y,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const k=this._escHandlers[x];return k.push(p),{dispose:()=>{const P=k.indexOf(p);P!==-1&&k.splice(P,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,p){this._executeHandlers[y.charCodeAt(0)]=p}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,p){const x=this._identifier(y);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const k=this._csiHandlers[x];return k.push(p),{dispose:()=>{const P=k.indexOf(p);P!==-1&&k.splice(P,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,p){return this._dcsParser.registerHandler(this._identifier(y),p)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,p){return this._oscParser.registerHandler(y,p)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(y,p,x,k,P){this._parseStack.state=y,this._parseStack.handlers=p,this._parseStack.handlerPos=x,this._parseStack.transition=k,this._parseStack.chunkPos=P}parse(y,p,x){let k,P=0,T=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&M>-1){for(;M>=0&&(k=j[M](this._params),k!==!0);M--)if(k instanceof Promise)return this._parseStack.handlerPos=M,k}this._parseStack.handlers=[];break;case 4:if(x===!1&&M>-1){for(;M>=0&&(k=j[M](),k!==!0);M--)if(k instanceof Promise)return this._parseStack.handlerPos=M,k}this._parseStack.handlers=[];break;case 6:if(P=y[this._parseStack.chunkPos],k=this._dcsParser.unhook(P!==24&&P!==26,x),k)return k;P===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(P=y[this._parseStack.chunkPos],k=this._oscParser.end(P!==24&&P!==26,x),k)return k;P===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=R;j<p;++j){switch(P=y[j],T=this._transitions.table[this.currentState<<8|(P<160?P:E)],T>>4){case 2:for(let H=j+1;;++H){if(H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}if(++H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}if(++H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}if(++H>=p||(P=y[H])<32||P>126&&P<E){this._printHandler(y,j,H),j=H-1;break}}break;case 3:this._executeHandlers[P]?this._executeHandlers[P]():this._executeHandlerFb(P),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:j,code:P,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|P];let $=M?M.length-1:-1;for(;$>=0&&(k=M[$](this._params),k!==!0);$--)if(k instanceof Promise)return this._preserveStack(3,M,$,T,j),k;$<0&&this._csiHandlerFb(this._collect<<8|P,this._params),this.precedingJoinState=0;break;case 8:do switch(P){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(P-48)}while(++j<p&&(P=y[j])>47&&P<60);j--;break;case 9:this._collect<<=8,this._collect|=P;break;case 10:const F=this._escHandlers[this._collect<<8|P];let U=F?F.length-1:-1;for(;U>=0&&(k=F[U](),k!==!0);U--)if(k instanceof Promise)return this._preserveStack(4,F,U,T,j),k;U<0&&this._escHandlerFb(this._collect<<8|P),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|P,this._params);break;case 13:for(let H=j+1;;++H)if(H>=p||(P=y[H])===24||P===26||P===27||P>127&&P<E){this._dcsParser.put(y,j,H),j=H-1;break}break;case 14:if(k=this._dcsParser.unhook(P!==24&&P!==26),k)return this._preserveStack(6,[],0,T,j),k;P===27&&(T|=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 H=j+1;;H++)if(H>=p||(P=y[H])<32||P>127&&P<E){this._oscParser.put(y,j,H),j=H-1;break}break;case 6:if(k=this._oscParser.end(P!==24&&P!==26),k)return this._preserveStack(5,[],0,T,j),k;P===27&&(T|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&T}}}a.EscapeSequenceParser=b},6242:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const h=c(5770),g=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,S){this._handlers[_]===void 0&&(this._handlers[_]=[]);const E=this._handlers[_];return E.push(S),{dispose:()=>{const b=E.indexOf(S);b!==-1&&E.splice(b,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,S,E){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(_,S,E);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,S,E))}start(){this.reset(),this._state=1}put(_,S,E){if(this._state!==3){if(this._state===1)for(;S<E;){const b=_[S++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&E-S>0&&this._put(_,S,E)}}end(_,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,b=this._active.length-1,v=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,E=S,v=this._stack.fallThrough,this._stack.paused=!1),!v&&E===!1){for(;b>=0&&(E=this._active[b].end(_),E!==!0);b--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,E;b--}for(;b>=0;b--)if(E=this._active[b].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,S,E){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,S,E),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let S=!1;if(this._hitLimit)S=!1;else if(_&&(S=this._handler(this._data),S instanceof Promise))return S.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,S}}},8742:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class h{static fromArray(d){const _=new h;if(!d.length)return _;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const E=d[S];if(Array.isArray(E))for(let b=0;b<E.length;++b)_.addSubParam(E[b]);else _.addParam(E)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const S=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];E-S>0&&d.push(Array.prototype.slice.call(this._subParams,S,E))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-_>0?this._subParams.subarray(_,S):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const S=this._subParamsIdx[_]>>8,E=255&this._subParamsIdx[_];E-S>0&&(d[_]=this._subParams.slice(S,E))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,E=S[_-1];S[_-1]=~E?Math.min(10*E+d,c):d}}a.Params=h},5741:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){h=g;break}if(h===-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(h,1)}}},8771:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const h=c(3785),g=c(511);a.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new h.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const h=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new h.CellData)}translateToString(g,d,_){return this._line.translateToString(g,d,_)}}},8285:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const h=c(8771),g=c(8460),d=c(844);class _ extends d.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=_},7975:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(g=>h(g.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((g,d)=>h(g,d.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.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(f,a,c){var h=this&&this.__decorate||function(v,y,p,x){var k,P=arguments.length,T=P<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,y,p,x);else for(var R=v.length-1;R>=0;R--)(k=v[R])&&(T=(P<3?k(T):P>3?k(y,p,T):k(y,p))||T);return P>3&&T&&Object.defineProperty(y,p,T),T},g=this&&this.__param||function(v,y){return function(p,x){y(p,x,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),S=c(5295),E=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let b=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(v,this))}resize(v,y){this.cols=v,this.rows=y,this.buffers.resize(v,y),this._onResize.fire({cols:v,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,y=!1){const p=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===v.fg&&x.getBg(0)===v.bg||(x=p.getBlankLine(v,y),this._cachedBlankLine=x),x.isWrapped=y;const k=p.ybase+p.scrollTop,P=p.ybase+p.scrollBottom;if(p.scrollTop===0){const T=p.lines.isFull;P===p.lines.length-1?T?p.lines.recycle().copyFrom(x):p.lines.push(x.clone()):p.lines.splice(P+1,0,x.clone()),T?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const T=P-k+1;p.lines.shiftElements(k+1,T-1,-1),p.lines.set(P,x.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(v,y,p){const x=this.buffer;if(v<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else v+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const k=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+v,x.ybase),0),k!==x.ydisp&&(y||this._onScroll.fire(x.ydisp))}};a.BufferService=b=h([g(0,E.IOptionsService)],b)},7994:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.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,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,a,c){var h=this&&this.__decorate||function(x,k,P,T){var R,j=arguments.length,M=j<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,k,P,T);else for(var $=x.length-1;$>=0;$--)(R=x[$])&&(M=(j<3?R(M):j>3?R(k,P,M):R(k,P))||M);return j>3&&M&&Object.defineProperty(k,P,M),M},g=this&&this.__param||function(x,k){return function(P,T){k(P,T,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),_=c(8460),S=c(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function b(x,k){let P=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(P|=64,P|=x.action):(P|=3&x.button,4&x.button&&(P|=64),8&x.button&&(P|=128),x.action===32?P|=32:x.action!==0||k||(P|=3)),P}const v=String.fromCharCode,y={DEFAULT:x=>{const k=[b(x,!1)+32,x.col+32,x.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${v(k[0])}${v(k[1])}${v(k[2])}`},SGR:x=>{const k=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${b(x,!0)};${x.col};${x.row}${k}`},SGR_PIXELS:x=>{const k=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${b(x,!0)};${x.x};${x.y}${k}`}};let p=a.CoreMouseService=class extends S.Disposable{constructor(x,k){super(),this._bufferService=x,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const P of Object.keys(E))this.addProtocol(P,E[P]);for(const P of Object.keys(y))this.addEncoding(P,y[P]);this.reset()}addProtocol(x,k){this._protocols[x]=k}addEncoding(x,k){this._encodings[x]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const k=this._encodings[this._activeEncoding](x);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,k,P){if(P){if(x.x!==k.x||x.y!==k.y)return!1}else if(x.col!==k.col||x.row!==k.row)return!1;return x.button===k.button&&x.action===k.action&&x.ctrl===k.ctrl&&x.alt===k.alt&&x.shift===k.shift}};a.CoreMouseService=p=h([g(0,d.IBufferService),g(1,d.ICoreService)],p)},6975:function(f,a,c){var h=this&&this.__decorate||function(p,x,k,P){var T,R=arguments.length,j=R<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,x,k,P);else for(var M=p.length-1;M>=0;M--)(T=p[M])&&(j=(R<3?T(j):R>3?T(x,k,j):T(x,k))||j);return R>3&&j&&Object.defineProperty(x,k,j),j},g=this&&this.__param||function(p,x){return function(k,P){x(k,P,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),_=c(8460),S=c(844),E=c(2585),b=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=a.CoreService=class extends S.Disposable{constructor(p,x,k){super(),this._bufferService=p,this._logService=x,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(p,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,(()=>p.split("").map((P=>P.charCodeAt(0))))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,(()=>p.split("").map((x=>x.charCodeAt(0))))),this._onBinary.fire(p))}};a.CoreService=y=h([g(0,E.IBufferService),g(1,E.ILogService),g(2,E.IOptionsService)],y)},9074:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const h=c(8055),g=c(8460),d=c(844),_=c(6106);let S=0,E=0;class b extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((p=>p==null?void 0:p.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(p){if(p.marker.isDisposed)return;const x=new v(p);if(x){const k=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),k.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,x,k){let P=0,T=0;for(const R of this._decorations.getKeyIterator(x))P=R.options.x??0,T=P+(R.options.width??1),p>=P&&p<T&&(!k||(R.options.layer??"bottom")===k)&&(yield R)}forEachDecorationAtCell(p,x,k,P){this._decorations.forEachByKey(x,(T=>{S=T.options.x??0,E=S+(T.options.width??1),p>=S&&p<E&&(!k||(T.options.layer??"bottom")===k)&&P(T)}))}}a.DecorationService=b;class v extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(p){super(),this.options=p,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const h=c(2585),g=c(8343);class d{constructor(...S){this._entries=new Map;for(const[E,b]of S)this.set(E,b)}set(S,E){const b=this._entries.get(S);return this._entries.set(S,E),b}forEach(S){for(const[E,b]of this._entries.entries())S(E,b)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(_,S){this._services.set(_,S)}getService(_){return this._services.get(_)}createInstance(_,...S){const E=(0,g.getServiceDependencies)(_).sort(((y,p)=>y.index-p.index)),b=[];for(const y of E){const p=this._services.get(y.id);if(!p)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${y.id}.`);b.push(p)}const v=E.length>0?E[0].index:S.length;if(S.length!==v)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${v+1} conflicts with ${S.length} static arguments`);return new _(...S,...b)}}},7866:function(f,a,c){var h=this&&this.__decorate||function(v,y,p,x){var k,P=arguments.length,T=P<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,y,p,x);else for(var R=v.length-1;R>=0;R--)(k=v[R])&&(T=(P<3?k(T):P>3?k(y,p,T):k(y,p))||T);return P>3&&T&&Object.defineProperty(y,p,T),T},g=this&&this.__param||function(v,y){return function(p,x){y(p,x,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),_=c(2585),S={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let E,b=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let y=0;y<v.length;y++)typeof v[y]=="function"&&(v[y]=v[y]())}_log(v,y,p){this._evalLazyOptionalParams(p),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...p)}trace(v,...y){var p;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,v,y)}debug(v,...y){var p;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,v,y)}info(v,...y){var p;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,v,y)}warn(v,...y){var p;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,v,y)}error(v,...y){var p;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,v,y)}};a.LogService=b=h([g(0,_.IOptionsService)],b),a.setTraceLogger=function(v){E=v},a.traceCall=function(v,y,p){if(typeof p.value!="function")throw new Error("not supported");const x=p.value;p.value=function(...k){if(E.logLevel!==_.LogLevelEnum.TRACE)return x.apply(this,k);E.trace(`GlyphRenderer#${x.name}(${k.map((T=>JSON.stringify(T))).join(", ")})`);const P=x.apply(this,k);return E.trace(`GlyphRenderer#${x.name} return`,P),P}}},7302:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const h=c(8460),g=c(844),d=c(6114);a.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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(b){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...a.DEFAULT_OPTIONS};for(const y in b)if(y in v)try{const p=b[y];v[y]=this._sanitizeAndValidateOption(y,p)}catch(p){console.error(p)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,v){return this.onOptionChange((y=>{y===b&&v(this.rawOptions[b])}))}onMultipleOptionChange(b,v){return this.onOptionChange((y=>{b.indexOf(y)!==-1&&v()}))}_setupOptions(){const b=y=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},v=(y,p)=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);p=this._sanitizeAndValidateOption(y,p),this.rawOptions[y]!==p&&(this.rawOptions[y]=p,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const p={get:b.bind(this,y),set:v.bind(this,y)};Object.defineProperty(this.options,y,p)}}_sanitizeAndValidateOption(b,v){switch(b){case"cursorStyle":if(v||(v=a.DEFAULT_OPTIONS[b]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${b}`);break;case"wordSeparator":v||(v=a.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=_.includes(v)?v:a.DEFAULT_OPTIONS[b];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${b} 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(`${b} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${b} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}a.OptionsService=S},2660:function(f,a,c){var h=this&&this.__decorate||function(S,E,b,v){var y,p=arguments.length,x=p<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(S,E,b,v);else for(var k=S.length-1;k>=0;k--)(y=S[k])&&(x=(p<3?y(x):p>3?y(E,b,x):y(E,b))||x);return p>3&&x&&Object.defineProperty(E,b,x),x},g=this&&this.__param||function(S,E){return function(b,v){E(b,v,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let _=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const E=this._bufferService.buffer;if(S.id===void 0){const k=E.addMarker(E.ybase+E.y),P={data:S,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(P,k))),this._dataByLinkId.set(P.id,P),P.id}const b=S,v=this._getEntryIdKey(b),y=this._entriesWithId.get(v);if(y)return this.addLineToLink(y.id,E.ybase+E.y),y.id;const p=E.addMarker(E.ybase+E.y),x={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(x,p))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(S,E){const b=this._dataByLinkId.get(S);if(b&&b.lines.every((v=>v.line!==E))){const v=this._bufferService.buffer.addMarker(E);b.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(b,v)))}}getLinkData(S){var E;return(E=this._dataByLinkId.get(S))==null?void 0:E.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,E){const b=S.lines.indexOf(E);b!==-1&&(S.lines.splice(b,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=_=h([g(0,d.IBufferService)],_)},8343:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",h="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[h]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(_,S,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,v,y){v[c]===v?v[h].push({id:b,index:y}):(v[h]=[{id:b,index:y}],v[c]=v)})(d,_,E)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const h=c(8343);var g;a.IBufferService=(0,h.createDecorator)("BufferService"),a.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),a.ICoreService=(0,h.createDecorator)("CoreService"),a.ICharsetService=(0,h.createDecorator)("CharsetService"),a.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(g||(a.LogLevelEnum=g={})),a.ILogService=(0,h.createDecorator)("LogService"),a.IOptionsService=(0,h.createDecorator)("OptionsService"),a.IOscLinkService=(0,h.createDecorator)("OscLinkService"),a.IUnicodeService=(0,h.createDecorator)("UnicodeService"),a.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const h=c(8460),g=c(225);class d{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,E,b=!1){return(16777215&S)<<3|(3&E)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let E=0,b=0;const v=S.length;for(let y=0;y<v;++y){let p=S.charCodeAt(y);if(55296<=p&&p<=56319){if(++y>=v)return E+this.wcwidth(p);const P=S.charCodeAt(y);56320<=P&&P<=57343?p=1024*(p-55296)+P-56320+65536:E+=this.wcwidth(P)}const x=this.charProperties(p,b);let k=d.extractWidth(x);d.extractShouldJoin(x)&&(k-=d.extractWidth(b)),E+=k,b=x}return E}charProperties(S,E){return this._activeProvider.charProperties(S,E)}}a.UnicodeService=d}},o={};function l(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,l),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const a=l(9042),c=l(3236),h=l(844),g=l(5741),d=l(8285),_=l(7975),S=l(7090),E=["cols","rows"];class b extends h.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const p=k=>this._core.options[k],x=(k,P)=>{this._checkReadonlyOptions(k),this._core.options[k]=P};for(const k in this._core.options){const P={get:p.bind(this,k),set:x.bind(this,k)};Object.defineProperty(this._publicOptions,k,P)}}_checkReadonlyOptions(y){if(E.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const p in y)this._publicOptions[p]=y[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,p=!0){this._core.input(y,p)}resize(y,p){this._verifyIntegers(y,p),this._core.resize(y,p)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,p,x){this._verifyIntegers(y,p,x),this._core.select(y,p,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,p){this._verifyIntegers(y,p),this._core.selectLines(y,p)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,p){this._core.write(y,p)}writeln(y,p){this._core.write(y),this._core.write(`\r
|
|
520
|
+
`,p)}paste(y){this._core.paste(y)}refresh(y,p){this._verifyIntegers(y,p),this._core.refresh(y,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return a}_verifyIntegers(...y){for(const p of y)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const p of y)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}f.Terminal=b})(),m})()))})(Ph)),Ph.exports}var gI=mI(),Rh={exports:{}},qy;function vI(){return qy||(qy=1,(function(e,t){(function(s,o){e.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const m=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(m._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,m=l._renderService.dimensions;if(m.css.cell.width===0||m.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(_/m.css.cell.width)),rows:Math.max(1,Math.floor(d/m.css.cell.height))}}}})(),s})()))})(Rh)),Rh.exports}var yI=vI(),Th={exports:{}},Yy;function xI(){return Yy||(Yy=1,(function(e,t){(function(s,o){e.exports=o()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(g){try{const d=new URL(g),_=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,d,_,S={}){this._terminal=g,this._regex=d,this._handler=_,this._options=S}provideLinks(g,d){const _=h.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(_))}_addCallbacks(g){return g.map((d=>(d.leave=this._options.leave,d.hover=(_,S)=>{if(this._options.hover){const{range:E}=d;this._options.hover(_,S,E)}},d)))}};class h{static computeLink(d,_,S,E){const b=new RegExp(_.source,(_.flags||"")+"g"),[v,y]=h._getWindowedLineStrings(d-1,S),p=v.join("");let x;const k=[];for(;x=b.exec(p);){const P=x[0];if(!c(P))continue;const[T,R]=h._mapStrIdx(S,y,0,x.index),[j,M]=h._mapStrIdx(S,T,R,P.length);if(T===-1||R===-1||j===-1||M===-1)continue;const $={start:{x:R+1,y:T+1},end:{x:M,y:j+1}};k.push({range:$,text:P,activate:E})}return k}static _getWindowedLineStrings(d,_){let S,E=d,b=d,v=0,y="";const p=[];if(S=_.buffer.active.getLine(d)){const x=S.translateToString(!0);if(S.isWrapped&&x[0]!==" "){for(v=0;(S=_.buffer.active.getLine(--E))&&v<2048&&(y=S.translateToString(!0),v+=y.length,p.push(y),S.isWrapped&&y.indexOf(" ")===-1););p.reverse()}for(p.push(x),v=0;(S=_.buffer.active.getLine(++b))&&S.isWrapped&&v<2048&&(y=S.translateToString(!0),v+=y.length,p.push(y),y.indexOf(" ")===-1););}return[p,E]}static _mapStrIdx(d,_,S,E){const b=d.buffer.active,v=b.getNullCell();let y=S;for(;E;){const p=b.getLine(_);if(!p)return[-1,-1];for(let x=y;x<p.length;++x){p.getCell(x,v);const k=v.getChars();if(v.getWidth()&&(E-=k.length||1,x===p.length-1&&k==="")){const P=b.getLine(_+1);P&&P.isWrapped&&(P.getCell(0,v),v.getWidth()===2&&(E+=1))}if(E<0)return[_,x]}_++,y=0}return[_,y]}}a.LinkComputer=h}},o={};function l(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,l),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=l(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(g,d){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(g=h,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,_=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),m})()))})(Th)),Th.exports}var _I=xI();function sm({cwd:e,initialCommand:t,onExit:s,onReady:o,className:l="",height:m="400px"}){const f=C.useRef(null),a=C.useRef(null),c=C.useRef(null),h=C.useRef(null),[g,d]=C.useState(!1),[_,S]=C.useState(null);C.useEffect(()=>{if(!f.current||a.current)return;const y=new gI.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}),p=new yI.FitAddon;y.loadAddon(p),c.current=p;const x=new _I.WebLinksAddon;return y.loadAddon(x),y.open(f.current),a.current=y,setTimeout(()=>{p.fit()},0),E(y),()=>{h.current&&h.current.close(),y.dispose(),a.current=null}},[]);const E=C.useCallback(y=>{const p=window.location.protocol==="https:"?"wss:":"ws:",x=window.location.hostname,k=3333,P=new URLSearchParams;e&&P.set("cwd",e),t&&P.set("cmd",t);const T=`${p}//${x}:${k}/ws/terminal?${P.toString()}`;console.log("Connecting to terminal WebSocket:",T);const R=new WebSocket(T);h.current=R,R.onopen=()=>{console.log("Terminal WebSocket connected"),d(!0)},R.onmessage=j=>{try{const M=JSON.parse(j.data);switch(M.type){case"session":S(M.sessionId),o&&o(M.sessionId);break;case"output":y.write(M.data);break;case"exit":y.write(`\r
|
|
521
|
+
\x1B[33m[Process exited]\x1B[0m\r
|
|
522
|
+
`),s&&s(M.exitCode,M.signal);break;case"error":y.write(`\r
|
|
523
|
+
\x1B[31m[Error: ${M.message}]\x1B[0m\r
|
|
524
|
+
`),y.write(`\x1B[33mTip: The terminal requires a working shell. Try running the command manually.\x1B[0m\r
|
|
525
|
+
`);break}}catch{y.write(j.data)}},R.onclose=()=>{console.log("Terminal WebSocket closed"),d(!1),y.write(`\r
|
|
526
|
+
\x1B[31m[Disconnected]\x1B[0m\r
|
|
527
|
+
`)},R.onerror=j=>{console.error("Terminal WebSocket error:",j),y.write(`\r
|
|
528
|
+
\x1B[31m[Connection error]\x1B[0m\r
|
|
529
|
+
`)},y.onData(j=>{R.readyState===WebSocket.OPEN&&R.send(JSON.stringify({type:"input",data:j}))}),y.onResize(({cols:j,rows:M})=>{R.readyState===WebSocket.OPEN&&R.send(JSON.stringify({type:"resize",cols:j,rows:M}))})},[e,t,o,s]);C.useEffect(()=>{const y=()=>{c.current&&a.current&&c.current.fit()};window.addEventListener("resize",y);const p=new ResizeObserver(y);return f.current&&p.observe(f.current),()=>{window.removeEventListener("resize",y),p.disconnect()}},[]),C.useCallback(y=>{h.current&&h.current.readyState===WebSocket.OPEN&&h.current.send(JSON.stringify({type:"input",data:y+"\r"}))},[]),C.useCallback(()=>{h.current&&h.current.readyState===WebSocket.OPEN&&h.current.send(JSON.stringify({type:"kill"}))},[]);const b=C.useCallback(()=>{a.current&&a.current.focus()},[]);C.useCallback(()=>{a.current&&a.current.clear()},[]);const v=C.useCallback(()=>{if(a.current){const p=a.current.buffer.active;let x="";for(let k=0;k<p.length;k++){const P=p.getLine(k);P&&(x+=P.translateToString(!0)+`
|
|
530
|
+
`)}navigator.clipboard.writeText(x.trim()).then(()=>{const k=document.getElementById("terminal-copy-btn");k&&(k.classList.add("bg-green-600"),setTimeout(()=>k.classList.remove("bg-green-600"),500))})}},[]);return i.jsxs("div",{className:`relative ${l}`,style:{height:m},children:[i.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-2",children:[i.jsx("button",{id:"terminal-copy-btn",onClick:v,className:"px-2 py-1 text-xs bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",title:"Copy terminal output",children:"Copy"}),i.jsx("div",{className:`w-2 h-2 rounded-full ${g?"bg-green-500":"bg-red-500"}`}),i.jsx("span",{className:"text-xs text-gray-400",children:g?"Connected":"Disconnected"})]}),i.jsx("div",{ref:f,className:"w-full h-full rounded-lg overflow-hidden",style:{backgroundColor:"#1e1e1e"},onClick:b})]})}sm.sendCommand=(e,t)=>{e&&e.sendCommand&&e.sendCommand(t)};const wI="~/reg/tools",Xy={claude:{name:"Claude Code",command:"claude",color:"orange"},gemini:{name:"Gemini CLI",command:"gemini",color:"blue"}};function bI({project:e}){const[t,s]=C.useState(""),[o,l]=C.useState(""),[m,f]=C.useState(wI),[a,c]=C.useState(!1),[h,g]=C.useState(null),[d,_]=C.useState(!1),[S,E]=C.useState("claude");C.useEffect(()=>{b()},[]);const b=async()=>{var P;try{const T=await Se.getConfig();E(((P=T.config)==null?void 0:P.aiAssistant)||"claude")}catch(T){console.error("Failed to load preferences:",T)}},v=Xy[S]||Xy.claude,y=()=>{if(!t.trim()){le.error("Please enter an MCP name");return}const P=`Create a new MCP server project called "${t}" with the following:
|
|
531
|
+
- Use Python with uv for package management
|
|
532
|
+
- Use FastMCP framework
|
|
533
|
+
- Description: ${o||"A custom MCP server"}
|
|
534
|
+
- Create a single mcp_server.py file with basic structure
|
|
535
|
+
- Include a pyproject.toml configured for uv
|
|
536
|
+
- Add a README.md with usage instructions`;g(`cd "${m}" && ${v.command} "${P}"`),c(!0),_(!0)},p=P=>{console.log("Terminal session ready:",P)},x=(P,T)=>{console.log("Terminal exited:",P,T),_(!1),P===0&&le.success("MCP project created successfully!")},k=()=>{c(!1),g(null),_(!1),s(""),l("")};return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"flex-none p-6 border-b border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-950",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(Ps,{className:"w-7 h-7 text-purple-600"}),"Create MCP Server"]}),i.jsxs("p",{className:"text-gray-500 dark:text-slate-400 mt-1",children:["Generate a new MCP server project with ",v.name," assistance"]})]}),a&&i.jsxs(ue,{variant:"outline",onClick:k,className:"text-gray-600 dark:text-slate-300",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"New Project"]})]})}),i.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[i.jsx("div",{className:`${a?"w-1/3 border-r border-gray-200 dark:border-slate-700":"w-full max-w-2xl mx-auto"} p-6 overflow-auto`,children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"MCP Name *"}),i.jsx(Xe,{value:t,onChange:P=>s(P.target.value),placeholder:"my-awesome-mcp",disabled:d}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:"This will be the project folder name"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Description"}),i.jsx(Ze,{value:o,onChange:P=>l(P.target.value),placeholder:"Describe what your MCP server will do...",className:"min-h-[100px]",disabled:d})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Output Directory"}),i.jsx(Xe,{value:m,onChange:P=>f(P.target.value),placeholder:"/path/to/projects",className:"font-mono text-sm",disabled:d}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:"Where to create the new MCP project"})]}),i.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/30 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[i.jsx("h3",{className:"text-sm font-medium text-purple-900 dark:text-purple-300 mb-2",children:"What will be created:"}),i.jsxs("ul",{className:"text-sm text-purple-700 dark:text-purple-400 space-y-1",children:[i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(D_,{className:"w-4 h-4"}),"Python project with uv package manager"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(gc,{className:"w-4 h-4"}),"FastMCP framework setup"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(mr,{className:"w-4 h-4"}),"mcp_server.py with basic structure"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(da,{className:"w-4 h-4"}),"pyproject.toml configured for uv"]})]})]}),!a&&i.jsxs(ue,{onClick:y,className:"w-full bg-purple-600 hover:bg-purple-700 text-white",disabled:!t.trim(),children:[i.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Create & Launch ",v.name]})]})}),a&&i.jsxs("div",{className:"flex-1 flex flex-col bg-gray-900",children:[i.jsxs("div",{className:"flex-none px-4 py-2 border-b border-gray-700 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(St,{className:"w-4 h-4 text-gray-400"}),i.jsxs("span",{className:"text-sm text-gray-300",children:[v.name," Terminal"]})]}),i.jsx("div",{className:"flex items-center gap-2",children:d&&i.jsxs(st,{variant:"outline",className:"bg-green-900/50 text-green-400 border-green-700",children:[i.jsx(dt,{className:"w-3 h-3 mr-1 animate-spin"}),"Running"]})})]}),i.jsx("div",{className:"flex-1",children:i.jsx(sm,{cwd:m,initialCommand:h,onReady:p,onExit:x,height:"100%"})})]})]})]})}function SI({project:e,configs:t}){const[s,o]=C.useState({}),[l,m]=C.useState(""),[f,a]=C.useState({}),[c,h]=C.useState(!1);C.useEffect(()=>{g()},[e.dir]);const g=async()=>{try{const E=await Se.getEnv(e.dir);m(E.content||"");const b={};(E.content||"").split(`
|
|
537
|
+
`).forEach(v=>{const y=v.match(/^([^=]+)=(.*)$/);y&&(b[y[1]]=y[2])}),a(b)}catch{}},d=E=>{o(b=>({...b,[E]:!b[E]}))},_=async()=>{h(!0);try{await Se.saveEnv(e.dir,l),le.success("Environment saved!")}catch{le.error("Failed to save environment")}finally{h(!1)}},S=E=>{navigator.clipboard.writeText(E),le.success("Copied to clipboard!")};return i.jsx("div",{className:"space-y-6",children:i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsx("div",{className:"p-5 border-b border-gray-200 dark:border-slate-800 flex items-center justify-between",children:i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(I_,{className:"w-5 h-5 text-rose-600"}),"Environment Variables"]})}),i.jsxs("div",{className:"p-4",children:[i.jsxs("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:["Environment variables are stored in ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1 rounded",children:".claude/.env"})," and used for MCP server configuration."]}),Object.keys(f).length>0?i.jsx("div",{className:"space-y-3 mb-4",children:Object.entries(f).map(([E,b],v)=>i.jsxs(Ds.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:v*.05},className:"bg-gray-50 dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-4 flex items-center gap-4",children:[i.jsx("code",{className:"text-indigo-600 dark:text-indigo-400 font-semibold min-w-[200px]",children:E}),i.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[i.jsx(Xe,{type:s[E]?"text":"password",value:b,className:"bg-white dark:bg-slate-950 border-gray-300 dark:border-slate-700 text-gray-900 dark:text-white font-mono",readOnly:!0}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>d(E),className:"text-gray-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white",children:i.jsx(A_,{className:"w-4 h-4"})}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>S(b),className:"text-gray-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white",children:i.jsx(Gi,{className:"w-4 h-4"})})]})]},E))}):i.jsx("div",{className:"text-center py-4 text-gray-500 dark:text-slate-400 mb-4",children:"No environment variables defined."}),i.jsxs("div",{className:"border-t border-gray-200 dark:border-slate-700 pt-4",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Edit .env file"}),i.jsx(Ze,{value:l,onChange:E=>m(E.target.value),placeholder:`KEY=value
|
|
538
|
+
ANOTHER_KEY=another_value`,className:"min-h-[200px] font-mono text-sm bg-gray-50 dark:bg-slate-900 border-gray-300 dark:border-slate-700 text-gray-900 dark:text-white mb-4"}),i.jsxs(ue,{onClick:_,disabled:c,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[c?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(oi,{className:"w-4 h-4 mr-2"}),"Save Environment"]})]})]})]})})}function CI({templates:e,project:t,onApply:s}){const[o,l]=C.useState(null),m=async f=>{l(f);try{await Se.applyTemplate(f,t.dir),le.success(`Template "${f}" applied!`),s()}catch(a){le.error("Failed to apply template: "+a.message)}finally{l(null)}};return i.jsx("div",{className:"space-y-6",children:i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsx("div",{className:"p-5 border-b border-gray-200 dark:border-slate-800 flex items-center justify-between",children:i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx($c,{className:"w-5 h-5 text-cyan-600"}),"Templates"]})}),i.jsxs("div",{className:"p-4",children:[i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Apply a template to quickly set up rules, commands, and MCP configurations for your project."}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.map((f,a)=>{var c;return i.jsxs(Ds.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:a*.05},className:"bg-white dark:bg-slate-900 rounded-lg border border-gray-200 dark:border-slate-700 p-5 hover:border-cyan-300 dark:hover:border-cyan-700 hover:shadow-lg transition-all group",children:[i.jsx(st,{variant:"outline",className:"bg-cyan-50 dark:bg-cyan-950/30 text-cyan-700 dark:text-cyan-400 border-cyan-200 dark:border-cyan-800 mb-3 text-[10px] uppercase tracking-wider",children:f.category}),i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white mb-2",children:f.name}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:f.description||"Project template"}),((c=f.mcpDefaults)==null?void 0:c.length)>0&&i.jsxs("div",{className:"mb-4",children:[i.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:"MCPs: "}),i.jsx("span",{className:"text-xs text-gray-700 dark:text-slate-300",children:f.mcpDefaults.join(", ")})]}),i.jsxs(ue,{size:"sm",onClick:()=>m(f.fullName||`${f.category}/${f.name}`),disabled:o===(f.fullName||f.name),className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white",children:[o===(f.fullName||f.name)?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Apply Template"]})]},f.fullName||f.name)}),e.length===0&&i.jsx("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:"No templates available."})]})]})]})})}var kI=Symbol("radix.slottable");function EI(e){const t=({children:s})=>i.jsx(i.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=kI,t}var nC="AlertDialog",[jI]=yr(nC,[uS]),Fs=uS(),iC=e=>{const{__scopeAlertDialog:t,...s}=e,o=Fs(t);return i.jsx(jS,{...o,...s,modal:!0})};iC.displayName=nC;var NI="AlertDialogTrigger",PI=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...o}=e,l=Fs(s);return i.jsx(Y3,{...l,...o,ref:t})});PI.displayName=NI;var RI="AlertDialogPortal",oC=e=>{const{__scopeAlertDialog:t,...s}=e,o=Fs(t);return i.jsx(NS,{...o,...s})};oC.displayName=RI;var TI="AlertDialogOverlay",aC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...o}=e,l=Fs(s);return i.jsx(Op,{...l,...o,ref:t})});aC.displayName=TI;var zi="AlertDialogContent",[AI,DI]=jI(zi),MI=EI("AlertDialogContent"),lC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,children:o,...l}=e,m=Fs(s),f=C.useRef(null),a=ze(t,f),c=C.useRef(null);return i.jsx(U3,{contentName:zi,titleName:cC,docsSlug:"alert-dialog",children:i.jsx(AI,{scope:s,cancelRef:c,children:i.jsxs(Ip,{role:"alertdialog",...m,...l,ref:a,onOpenAutoFocus:ye(l.onOpenAutoFocus,h=>{var g;h.preventDefault(),(g=c.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[i.jsx(MI,{children:o}),i.jsx(OI,{contentRef:f})]})})})});lC.displayName=zi;var cC="AlertDialogTitle",dC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...o}=e,l=Fs(s);return i.jsx(Bp,{...l,...o,ref:t})});dC.displayName=cC;var uC="AlertDialogDescription",hC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...o}=e,l=Fs(s);return i.jsx(Fp,{...l,...o,ref:t})});hC.displayName=uC;var LI="AlertDialogAction",fC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...o}=e,l=Fs(s);return i.jsx($p,{...l,...o,ref:t})});fC.displayName=LI;var pC="AlertDialogCancel",mC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:s,...o}=e,{cancelRef:l}=DI(pC,s),m=Fs(s),f=ze(t,l);return i.jsx($p,{...m,...o,ref:f})});mC.displayName=pC;var OI=({contentRef:e})=>{const t=`\`${zi}\` requires a description for the component to be accessible for screen reader users.
|
|
539
|
+
|
|
540
|
+
You can add a description to the \`${zi}\` by passing a \`${uC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
541
|
+
|
|
542
|
+
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 \`${zi}\`. 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.
|
|
543
|
+
|
|
544
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var o;document.getElementById((o=e.current)==null?void 0:o.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},II=iC,BI=oC,gC=aC,vC=lC,yC=fC,xC=mC,_C=dC,wC=hC;const FI=II,$I=BI,bC=C.forwardRef(({className:e,...t},s)=>i.jsx(gC,{className:xe("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:s}));bC.displayName=gC.displayName;const SC=C.forwardRef(({className:e,...t},s)=>i.jsxs($I,{children:[i.jsx(bC,{}),i.jsx(vC,{ref:s,className:xe("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})]}));SC.displayName=vC.displayName;const CC=({className:e,...t})=>i.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});CC.displayName="AlertDialogHeader";const kC=({className:e,...t})=>i.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kC.displayName="AlertDialogFooter";const EC=C.forwardRef(({className:e,...t},s)=>i.jsx(_C,{ref:s,className:xe("text-lg font-semibold",e),...t}));EC.displayName=_C.displayName;const jC=C.forwardRef(({className:e,...t},s)=>i.jsx(wC,{ref:s,className:xe("text-sm text-muted-foreground",e),...t}));jC.displayName=wC.displayName;const NC=C.forwardRef(({className:e,...t},s)=>i.jsx(yC,{ref:s,className:xe(cp(),e),...t}));NC.displayName=yC.displayName;const PC=C.forwardRef(({className:e,...t},s)=>i.jsx(xC,{ref:s,className:xe(cp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));PC.displayName=xC.displayName;function HI({project:e,rootProject:t,onRefresh:s}){var Q;const[o,l]=C.useState({open:!1,proj:null}),[m,f]=C.useState(new Set),[a,c]=C.useState([]),[h,g]=C.useState(!1);C.useEffect(()=>{Se.getTemplates().then(c).catch(()=>{})},[]);const d=(t==null?void 0:t.subprojects)||e.subprojects||[],_=t&&e.dir!==t.dir,S=V=>m.has(V),E=V=>{f(K=>{const J=new Set(K);return J.has(V)?J.delete(V):J.add(V),J})},b=()=>{f(new Set(d.map(V=>V.dir)))},v=()=>{f(new Set)},y=d.length>0&&m.size===d.length,p=m.size>0,x=async V=>{try{const K=await Se.initClaudeFolderBatch(V);K.success?(le.success(`Created .claude folders in ${K.count} project${K.count!==1?"s":""}`),v(),s()):le.error(K.error||"Failed to init projects")}catch(K){le.error("Failed to init projects: "+K.message)}},k=async()=>{const V=d.filter(K=>!K.hasConfig).map(K=>K.dir);if(V.length===0){le.info("All sub-projects already have .claude folders");return}await x(V)},P=async()=>{const V=Array.from(m);V.length!==0&&await x(V)},T=async(V,K)=>{g(!0);try{const J=await Se.applyTemplateToProjects(V,K);J.success?(le.success(`Applied template to ${J.count} project${J.count!==1?"s":""}`),v(),s()):le.error(J.error||"Failed to apply template")}catch(J){le.error("Failed to apply template: "+J.message)}finally{g(!1)}},R=async V=>{const K=Array.from(m);K.length!==0&&await T(V,K)},j=async(V,K)=>{await T(V,[K])},M=async V=>{try{await Se.switchProject(V),window.location.reload()}catch(K){le.error("Failed to switch project: "+K.message)}},$=async()=>{t!=null&&t.dir&&await M(t.dir)},F=async(V,K)=>{try{const J=await Se.initClaudeFolder(V.dir);J.success?(le.success(`Created .claude folder in ${V.name}`),s()):le.error(J.error||"Failed to create .claude folder")}catch(J){le.error("Failed to create .claude folder: "+J.message)}},U=async()=>{const V=o.proj;if(V){try{const K=await Se.deleteClaudeFolder(V.dir);K.success?(le.success(`Deleted .claude folder from ${V.name}`),s()):le.error(K.error||"Failed to delete .claude folder")}catch(K){le.error("Failed to delete .claude folder: "+K.message)}l({open:!1,proj:null})}},H=(V,K)=>{l({open:!0,proj:V})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"p-5 border-b border-border flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[i.jsx(Nt,{className:"w-5 h-5 text-amber-500"}),"Sub-Projects"]}),d.length>0&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pc,{checked:y,onCheckedChange:V=>V?b():v(),className:"data-[state=checked]:bg-primary"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:p?`${m.size} selected`:"Select all"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[d.some(V=>!V.hasConfig)&&i.jsxs(ue,{variant:"outline",size:"sm",onClick:k,children:[i.jsx(sc,{className:"w-4 h-4 mr-2"}),"Init All Unconfigured"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:s,children:[i.jsx(gr,{className:"w-4 h-4 mr-2"}),"Refresh"]})]})]}),i.jsxs("div",{className:`p-4 mx-4 mb-4 mt-4 rounded-lg border-l-4 ${_?"bg-blue-500/10 border-blue-500":"bg-amber-500/10 border-amber-500"}`,children:[_&&i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("p",{className:"text-sm font-medium text-blue-600 dark:text-blue-400",children:"Currently in sub-project"}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:$,className:"h-7",children:[i.jsx(BR,{className:"w-3 h-3 mr-1"}),"Back to Root"]})]}),i.jsxs("p",{className:"text-sm text-foreground",children:[i.jsx("span",{className:"font-semibold",children:"Current Directory:"})," ",i.jsx("code",{className:"text-muted-foreground bg-muted px-2 py-0.5 rounded",children:e.dir})]}),t&&t.dir!==e.dir&&i.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[i.jsx("span",{className:"font-semibold",children:"Root Project:"})," ",i.jsx("code",{className:"bg-muted px-2 py-0.5 rounded",children:t.dir})]}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Found ",d.length," sub-project",d.length!==1?"s":""," with .git directories."]})]}),i.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[d.map((V,K)=>{var D,B,L,z;const J=V.dir===e.dir,W=S(V.dir);return i.jsxs(Ds.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:K*.05},className:`bg-card rounded-lg border p-4 transition-all group relative ${J?"border-primary bg-primary/5 ring-2 ring-primary/20":W?"border-primary/50 bg-primary/5":"border-border hover:border-primary/50 hover:shadow-md"}`,children:[i.jsx("div",{className:"absolute top-3 left-3 z-10",children:i.jsx(Pc,{checked:W,onCheckedChange:()=>E(V.dir),className:"data-[state=checked]:bg-primary",onClick:ee=>ee.stopPropagation()})}),i.jsx("div",{className:"absolute top-3 right-3 z-10",children:i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsx(ue,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",onClick:ee=>ee.stopPropagation(),children:i.jsx(ep,{className:"w-4 h-4"})})}),i.jsxs(wn,{align:"end",className:"w-48",children:[a.length>0&&i.jsxs(k1,{children:[i.jsxs(Yp,{children:[i.jsx(ay,{className:"w-4 h-4 mr-2"}),"Apply Template"]}),i.jsx(Xp,{children:a.map(ee=>i.jsx(lt,{onClick:()=>j(ee.id,V.dir),children:ee.name},ee.id))})]}),!V.hasConfig&&i.jsxs(lt,{onClick:()=>F(V),children:[i.jsx(sc,{className:"w-4 h-4 mr-2"}),"Init .claude folder"]}),i.jsxs(lt,{onClick:()=>M(V.dir),children:[i.jsx(yn,{className:"w-4 h-4 mr-2"}),"Switch to project"]}),V.hasConfig&&i.jsxs(i.Fragment,{children:[i.jsx(si,{}),i.jsxs(lt,{className:"text-destructive focus:text-destructive",onClick:()=>H(V),children:[i.jsx(qn,{className:"w-4 h-4 mr-2"}),"Delete .claude folder"]})]})]})]})}),i.jsxs("div",{className:"cursor-pointer pl-8",onClick:()=>!J&&M(V.dir),children:[i.jsxs("div",{className:"flex items-start justify-between mb-3 pr-8",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:V.name}),J&&i.jsx(st,{variant:"default",className:"text-xs",children:"Current"})]}),i.jsxs("div",{className:"flex gap-1",children:[((D=V.markers)==null?void 0:D.git)&&i.jsx("span",{title:"Git",children:"🔀"}),((B=V.markers)==null?void 0:B.npm)&&i.jsx("span",{title:"NPM",children:"📦"}),((L=V.markers)==null?void 0:L.python)&&i.jsx("span",{title:"Python",children:"🐍"}),((z=V.markers)==null?void 0:z.claude)&&i.jsx("span",{title:"Claude Config",children:"⚙️"})]})]}),i.jsx("code",{className:"text-xs text-muted-foreground block mb-3",children:V.relativePath||V.name}),i.jsx("div",{className:"flex items-center justify-between",children:i.jsx(st,{variant:"outline",className:V.hasConfig?"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/30":"bg-muted text-muted-foreground border-border",children:V.hasConfig?`✓ ${V.mcpCount||0} MCPs`:"No config"})})]})]},V.name)}),d.length===0&&i.jsx("div",{className:"col-span-full text-center py-8 text-muted-foreground",children:"No sub-projects found in this directory."})]}),i.jsx(bf,{children:p&&i.jsx(Ds.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:i.jsxs("div",{className:"bg-card border border-border rounded-lg shadow-xl px-4 py-3 flex items-center gap-3",children:[i.jsxs("span",{className:"text-sm font-medium text-foreground",children:[m.size," selected"]}),i.jsx("div",{className:"h-4 w-px bg-border"}),a.length>0&&i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsxs(ue,{size:"sm",variant:"default",disabled:h,children:[i.jsx(ay,{className:"w-4 h-4 mr-2"}),"Apply Template",i.jsx(to,{className:"w-3 h-3 ml-1"})]})}),i.jsx(wn,{children:a.map(V=>i.jsx(lt,{onClick:()=>R(V.id),children:V.name},V.id))})]}),i.jsxs(ue,{size:"sm",variant:"outline",onClick:P,children:[i.jsx(sc,{className:"w-4 h-4 mr-2"}),"Init .claude"]}),i.jsx(ue,{size:"sm",variant:"ghost",onClick:v,children:i.jsx(op,{className:"w-4 h-4"})})]})})})]}),i.jsx(FI,{open:o.open,onOpenChange:V=>l({open:V,proj:o.proj}),children:i.jsxs(SC,{children:[i.jsxs(CC,{children:[i.jsx(EC,{children:"Delete .claude folder?"}),i.jsxs(jC,{children:["This will permanently delete the .claude folder from ",i.jsx("strong",{children:(Q=o.proj)==null?void 0:Q.name}),", including all rules, commands, and configuration. This action cannot be undone."]})]}),i.jsxs(kC,{children:[i.jsx(PC,{children:"Cancel"}),i.jsx(NC,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}const VI=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},zI=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}},Jy={claude:{name:"Claude Code",command:"claude",color:"orange"},gemini:{name:"Gemini CLI",command:"gemini",color:"blue"}};function WI({registry:e,searchQuery:t,setSearchQuery:s,onUpdate:o}){var X;const[l,m]=C.useState(()=>VI("registrySearchMode","local")),f=q=>{m(q),zI("registrySearchMode",q)},[a,c]=C.useState([]),[h,g]=C.useState(!1),[d,_]=C.useState({open:!1,name:"",mcp:null,isNew:!1}),[S,E]=C.useState({name:"",command:"npx",args:"",env:"",description:""}),[b,v]=C.useState(!1),[y,p]=C.useState([]),[x,k]=C.useState(""),[P,T]=C.useState({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),[R,j]=C.useState(""),[M,$]=C.useState("claude");C.useEffect(()=>{(async()=>{var re;try{const he=await Se.getConfig();$(((re=he.config)==null?void 0:re.aiAssistant)||"claude")}catch(he){console.error("Failed to load preferences:",he)}})()},[]);const F=Jy[M]||Jy.claude,U=Object.entries(e.mcpServers||{}),H=U.filter(([q])=>q.toLowerCase().includes(t.toLowerCase()));C.useEffect(()=>{(async()=>{try{const re=await Se.getMcpTools();p(re.tools||[]),k(re.dir||"")}catch(re){console.error("Failed to load MCP tools:",re)}})()},[]);const Q=y.filter(q=>{var re;return!((re=e.mcpServers)!=null&&re[q.name])&&q.name.toLowerCase().includes(t.toLowerCase())}),V=(q,re)=>{E({name:q,command:re.command||"npx",args:JSON.stringify(re.args||[],null,2),env:JSON.stringify(re.env||{},null,2),description:re.description||""}),_({open:!0,name:q,mcp:re,isNew:!1})},[K,J]=C.useState({open:!1,json:""}),W=()=>{J({open:!0,json:""})},D=async()=>{if(!K.json.trim()){le.error("Please paste the MCP JSON configuration");return}try{let q;try{q=JSON.parse(K.json)}catch{le.error("Invalid JSON format");return}let re={};if(q.mcpServers&&typeof q.mcpServers=="object")re=q.mcpServers;else if(typeof q=="object"&&!Array.isArray(q)){if(Object.keys(q).includes("command")){le.error('JSON is missing the MCP name. Expected: { "name": { "command": "...", "args": [...] } }');return}re=q}if(Object.keys(re).length===0){le.error("No MCP configurations found in the JSON");return}for(const[Be,Ke]of Object.entries(re))if(!Ke.command){le.error(`MCP "${Be}" is missing required "command" field`);return}const he={...e};he.mcpServers||(he.mcpServers={});for(const[Be,Ke]of Object.entries(re))he.mcpServers[Be]=Ke;await Se.updateRegistry(he);const Te=Object.keys(re).length;le.success(`Added ${Te} MCP${Te>1?"s":""} to registry!`),J({open:!1,json:""}),o()}catch(q){le.error("Failed to add: "+q.message)}},B=q=>{const he={[q.name.replace("@modelcontextprotocol/server-","").replace("mcp-server-","").replace("mcp-","").replace(/-/g,"_")]:{command:q.suggestedCommand||"npx",args:q.suggestedArgs||["-y",q.name],...q.description&&{description:q.description}}};J({open:!0,json:JSON.stringify(he,null,2)})},L=q=>{let re,he;q.type==="python"?(re="uv",he=["run","--directory",q.path,"python",q.entryPoint||"mcp_server.py"]):(re="node",he=[q.path+"/index.js"]);const Te={[q.name]:{command:re,args:he,...q.description&&{description:q.description}}};J({open:!0,json:JSON.stringify(Te,null,2)})},z=()=>{if(!P.url.trim()){le.error("Please enter a URL");return}T(q=>({...q,showTerminal:!0}))},ee=()=>{if(P.localTool){const he=P.localTool,Te=`Analyze the MCP server at ${he.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 '${he.path}' && ${F.command} '${Te}'`}const re=`Clone ${P.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 && ${F.command} '${re}'`},ne=q=>{T({open:!0,url:"",showTerminal:!0,localTool:q,pastedConfig:""})},ce=q=>{q===0&&(le.success("Import completed! Paste the JSON config below to add it to the registry."),Se.getMcpTools().then(re=>{p(re.tools||[])}))},de=async()=>{if(!P.pastedConfig.trim()){le.error("Please paste the JSON config first");return}try{let q;try{q=JSON.parse(P.pastedConfig)}catch{le.error("Invalid JSON format");return}let re={};if(q.mcpServers&&typeof q.mcpServers=="object")re=q.mcpServers;else if(typeof q=="object"&&!Array.isArray(q))if(Object.keys(q).includes("command")){le.error('JSON is missing the MCP name. Expected format: { "name": { "command": "...", "args": [...] } }');return}else re=q;if(Object.keys(re).length===0){le.error("No MCP configurations found in the pasted JSON");return}for(const[Be,Ke]of Object.entries(re))if(!Ke.command){le.error(`MCP "${Be}" is missing required "command" field`);return}const he={...e};he.mcpServers||(he.mcpServers={});for(const[Be,Ke]of Object.entries(re))he.mcpServers[Be]=Ke;await Se.updateRegistry(he);const Te=Object.keys(re).length;le.success(`Added ${Te} MCP${Te>1?"s":""} to registry!`),T({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),o()}catch(q){le.error("Failed to add config: "+q.message)}},G=async()=>{v(!0);try{let q,re;try{q=JSON.parse(S.args),re=JSON.parse(S.env)}catch{le.error("Invalid JSON in args or env"),v(!1);return}const he={...e};he.mcpServers||(he.mcpServers={});const Te={command:S.command,args:q,...Object.keys(re).length>0&&{env:re},...S.description&&{description:S.description}};he.mcpServers[d.name]=Te,await Se.updateRegistry(he),le.success("MCP updated"),_({open:!1,name:"",mcp:null,isNew:!1}),o()}catch(q){le.error("Failed to save: "+q.message)}finally{v(!1)}},O=async q=>{try{const re={...e};delete re.mcpServers[q],await Se.updateRegistry(re),le.success(`Removed ${q} from registry`),o()}catch(re){le.error("Failed to delete: "+re.message)}},Z=async()=>{if(t.trim()){g(!0);try{const q=l==="github"?await Se.searchGithub(t):await Se.searchNpm(t);c(q.results||[])}catch(q){le.error("Search failed: "+q.message),c([])}finally{g(!1)}}};return C.useEffect(()=>{l!=="local"&&c([])},[l]),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white dark:text-white flex items-center gap-2",children:[i.jsx(da,{className:"w-5 h-5 text-blue-600"}),"MCP Registry"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>T({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:[i.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Import Folder"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>T({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:[i.jsx(fh,{className:"w-4 h-4 mr-2"}),"Import URL"]}),i.jsxs(ue,{variant:"outline",size:"sm",onClick:W,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:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]}),i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsxs(ue,{variant:l==="local"?"default":"outline",size:"sm",onClick:()=>f("local"),className:l==="local"?"bg-blue-600":"",children:[i.jsx(da,{className:"w-4 h-4 mr-2"}),"Registry (",U.length,")"]}),i.jsxs(ue,{variant:l==="tools"?"default":"outline",size:"sm",onClick:()=>f("tools"),className:l==="tools"?"bg-purple-600":"",children:[i.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Tools (",y.length,")"]}),i.jsxs(ue,{variant:l==="github"?"default":"outline",size:"sm",onClick:()=>f("github"),className:l==="github"?"bg-gray-800":"",children:[i.jsx(wT,{className:"w-4 h-4 mr-2"}),"GitHub"]}),i.jsxs(ue,{variant:l==="npm"?"default":"outline",size:"sm",onClick:()=>f("npm"),className:l==="npm"?"bg-red-600":"",children:[i.jsx(L_,{className:"w-4 h-4 mr-2"}),"npm"]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(np,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),i.jsx(Xe,{value:t,onChange:q=>s(q.target.value),onKeyDown:q=>q.key==="Enter"&&!["local","tools"].includes(l)&&Z(),placeholder:l==="local"?"Filter registry...":l==="tools"?"Filter discovered tools...":`Search ${l} for MCPs...`,className:"pl-9 bg-white border-gray-300"})]}),!["local","tools"].includes(l)&&i.jsx(ue,{onClick:Z,disabled:h,children:h?i.jsx(dt,{className:"w-4 h-4 animate-spin"}):"Search"})]})]}),l==="local"&&i.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[H.map(([q,re],he)=>{var Te;return i.jsxs(Ds.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:he*.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:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:q}),i.jsxs(ti,{children:[i.jsx(ri,{asChild:!0,children:i.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(ep,{className:"w-4 h-4 text-gray-400"})})}),i.jsxs(wn,{children:[i.jsxs(lt,{onClick:()=>V(q,re),children:[i.jsx(sp,{className:"w-4 h-4 mr-2"}),"Edit"]}),i.jsxs(lt,{className:"text-red-600",onClick:()=>O(q),children:[i.jsx(qn,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3",children:re.description||"MCP server"}),i.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:[re.command," ",(Te=re.args)==null?void 0:Te.join(" ")]}),re.env&&Object.keys(re.env).length>0&&i.jsxs("div",{className:"mt-2 text-xs text-amber-600",children:["Requires: ",Object.keys(re.env).join(", ")]})]},q)}),H.length===0&&i.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."})]}),l==="tools"&&i.jsxs("div",{className:"p-4",children:[x&&i.jsxs("div",{className:"mb-4 text-sm text-gray-500 dark:text-slate-400 flex items-center gap-2",children:[i.jsx(Nt,{className:"w-4 h-4"}),"Scanning: ",x]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[Q.map((q,re)=>i.jsxs(Ds.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:re*.03},className:"bg-purple-50 rounded-lg border border-purple-200 p-4 hover:border-purple-400 hover:shadow-md transition-all",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-purple-900",children:q.name}),i.jsx(st,{variant:"outline",className:"text-purple-600 border-purple-300",children:q.type==="python"?"Python":"Node"})]}),i.jsx("p",{className:"text-sm text-purple-700 mb-3",children:q.description||"MCP tool"}),i.jsx("code",{className:"text-xs text-purple-600 block truncate bg-purple-100 px-2 py-1 rounded mb-3",children:q.path}),q.framework&&i.jsxs("div",{className:"text-xs text-purple-500 mb-3",children:["Framework: ",q.framework]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{size:"sm",variant:"outline",onClick:()=>L(q),className:"flex-1 border-purple-300 text-purple-700 hover:bg-purple-100",children:[i.jsx(Ht,{className:"w-4 h-4 mr-1"}),"Quick"]}),i.jsxs(ue,{size:"sm",onClick:()=>ne(q),className:"flex-1 bg-purple-600 hover:bg-purple-700 text-white",children:[i.jsx(Ps,{className:"w-4 h-4 mr-1"}),"Smart"]})]})]},q.name)),Q.length===0&&y.length>0&&i.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."}),y.length===0&&i.jsxs("div",{className:"col-span-full text-center py-8 text-gray-500 dark:text-slate-400",children:["No MCP tools found in ",x,". Create one using the Developer > Create MCP view."]})]})]}),!["local","tools"].includes(l)&&i.jsx("div",{className:"p-4",children:h?i.jsxs("div",{className:"text-center py-8",children:[i.jsx(dt,{className:"w-8 h-8 animate-spin mx-auto text-gray-400"}),i.jsxs("p",{className:"text-gray-500 dark:text-slate-400 mt-2",children:["Searching ",l,"..."]})]}):a.length>0?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map((q,re)=>{var he;return i.jsxs(Ds.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:re*.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:[i.jsxs("div",{className:"flex items-start justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:q.name}),q.stars!==void 0&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600",children:[i.jsx(eA,{className:"w-3 h-3"}),q.stars]})]}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:q.description||"No description"}),i.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:[q.suggestedCommand," ",(he=q.suggestedArgs)==null?void 0:he.join(" ")]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{size:"sm",onClick:()=>B(q),className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white",children:[i.jsx(Ht,{className:"w-3 h-3 mr-1"}),"Add to Registry"]}),q.url&&i.jsx(ue,{size:"sm",variant:"outline",onClick:()=>window.open(q.url,"_blank"),children:i.jsx(fh,{className:"w-3 h-3"})})]})]},q.name||re)})}):i.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 ${l}.`})})]}),i.jsx(ir,{open:K.open,onOpenChange:q=>J({...K,open:q}),children:i.jsxs(Qt,{className:" max-w-2xl",children:[i.jsxs(Zt,{children:[i.jsx(tr,{children:"Add MCP to Registry"}),i.jsx(Nr,{children:"Paste the MCP JSON configuration block to add to your registry."})]}),i.jsxs("div",{className:"py-4",children:[i.jsx(Ze,{value:K.json,onChange:q=>J({...K,json:q.target.value}),placeholder:`{
|
|
545
|
+
"my-mcp": {
|
|
546
|
+
"command": "npx",
|
|
547
|
+
"args": ["-y", "@example/mcp-server"],
|
|
548
|
+
"env": {
|
|
549
|
+
"API_KEY": "\${API_KEY}"
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}`,className:"font-mono text-sm bg-gray-50 dark:bg-slate-800",rows:12}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:["Accepts formats: ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "name": { "command": "...", "args": [...] } }'})," or ",i.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:'{ "mcpServers": { ... } }'})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>J({open:!1,json:""}),children:"Cancel"}),i.jsxs(ue,{onClick:D,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]})}),i.jsx(ir,{open:d.open,onOpenChange:q=>_({...d,open:q}),children:i.jsxs(Qt,{className:" max-w-2xl",children:[i.jsxs(Zt,{children:[i.jsxs(tr,{children:["Edit MCP: ",d.name]}),i.jsx(Nr,{children:"Edit the MCP server configuration."})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),i.jsx(Xe,{value:S.description,onChange:q=>E({...S,description:q.target.value}),placeholder:"What does this MCP do?",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Command"}),i.jsx(Xe,{value:S.command,onChange:q=>E({...S,command:q.target.value}),placeholder:"npx",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Args (JSON array)"}),i.jsx(Ze,{value:S.args,onChange:q=>E({...S,args:q.target.value}),placeholder:'["-y", "@modelcontextprotocol/server-xxx"]',className:"mt-1 font-mono text-sm",rows:3})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Environment Variables (JSON object)"}),i.jsx(Ze,{value:S.env,onChange:q=>E({...S,env:q.target.value}),placeholder:'{"API_KEY": "${API_KEY}"}',className:"mt-1 font-mono text-sm",rows:3}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:["Use $","{VAR_NAME}"," syntax for variables from .env file"]})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>_({...d,open:!1}),children:"Cancel"}),i.jsxs(ue,{onClick:G,disabled:b,className:"bg-blue-600 hover:bg-blue-700 text-white",children:[b?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(oi,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]})]})}),i.jsx(ir,{open:P.open,onOpenChange:q=>T({open:q,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:i.jsxs(Qt,{className:`bg-white ${P.showTerminal?"max-w-4xl h-[80vh] max-h-[800px]":"max-w-lg"}`,children:[i.jsxs(Zt,{children:[i.jsx(tr,{className:"flex items-center gap-2",children:P.localTool?i.jsxs(i.Fragment,{children:[i.jsx(Ps,{className:"w-5 h-5 text-purple-600"})," Configure ",P.localTool.name]}):P.mode==="folder"?i.jsxs(i.Fragment,{children:[i.jsx(Nt,{className:"w-5 h-5 text-green-600"})," Import MCP from Folder"]}):i.jsxs(i.Fragment,{children:[i.jsx(fh,{className:"w-5 h-5 text-purple-600"})," Import MCP from URL"]})}),i.jsx(Nr,{children:P.localTool?`${F.name} will analyze ${P.localTool.name} and generate the correct configuration.`:P.mode==="folder"?`Enter the path to a local MCP server folder. ${F.name} will analyze it and generate the configuration.`:`Enter a GitHub repository URL. ${F.name} will clone it, read the README, and help configure it.`})]}),!P.showTerminal&&!P.localTool?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"py-4",children:P.mode==="folder"?i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Folder Path"}),i.jsx(Xe,{value:R,onChange:q=>j(q.target.value),placeholder:"/path/to/mcp-server or ~/projects/my-mcp",className:"mt-1 font-mono",onKeyDown:q=>q.key==="Enter"&&R.trim()&&T({...P,showTerminal:!0,localTool:{name:R.split("/").pop(),path:R}})}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:"Enter the full path to an existing MCP server project"})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL"}),i.jsx(Xe,{value:P.url,onChange:q=>T({...P,url:q.target.value}),placeholder:"https://github.com/user/mcp-server-example",className:"mt-1",onKeyDown:q=>q.key==="Enter"&&z()}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:["The repository will be cloned to ",x||"~/mcp-tools"]})]})}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>T({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:"Cancel"}),P.mode==="folder"?i.jsxs(ue,{onClick:()=>R.trim()&&T({...P,showTerminal:!0,localTool:{name:R.split("/").pop(),path:R}}),disabled:!R.trim(),className:"bg-green-600 hover:bg-green-700 text-white",children:[i.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Analyze with ",F.name]}):i.jsxs(ue,{onClick:z,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[i.jsx(Ps,{className:"w-4 h-4 mr-2"}),"Import with ",F.name]})]})]}):i.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[P.localTool&&i.jsx("div",{className:"mb-3 p-3 bg-purple-50 rounded-lg border border-purple-200",children:i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(Nt,{className:"w-4 h-4 text-purple-600"}),i.jsx("code",{className:"text-purple-700",children:P.localTool.path})]})}),i.jsx("div",{className:"flex-1 bg-gray-900 rounded-lg overflow-hidden",style:{minHeight:"200px"},children:i.jsx(sm,{cwd:((X=P.localTool)==null?void 0:X.path)||x||"~/reg/tools",initialCommand:ee(),onExit:ce,height:"100%"})}),i.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-slate-800 rounded-lg border border-gray-200",children:[i.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 flex items-center gap-2",children:[i.jsx(eT,{className:"w-4 h-4"}),"Paste MCP Config JSON"]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 mb-2",children:"Copy the JSON config from the terminal output above and paste it here to add to your registry."}),i.jsx(Ze,{value:P.pastedConfig,onChange:q=>T({...P,pastedConfig:q.target.value}),placeholder:`{
|
|
553
|
+
"mcpServers": {
|
|
554
|
+
"example": {
|
|
555
|
+
"command": "npx",
|
|
556
|
+
"args": ["-y", "@example/mcp-server"]
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}`,className:"font-mono text-sm bg-white",rows:6})]}),i.jsxs("div",{className:"mt-4 flex justify-between",children:[i.jsx(ue,{variant:"outline",onClick:()=>T({open:!1,url:"",showTerminal:!1,localTool:null,pastedConfig:"",mode:"url"}),children:"Close"}),i.jsxs(ue,{onClick:de,disabled:!P.pastedConfig.trim(),className:"bg-green-600 hover:bg-green-700 text-white",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]})]})})]})}function UI({project:e,onUpdate:t}){var F,U,H,Q;const[s,o]=C.useState(null),[l,m]=C.useState(!0),[f,a]=C.useState(null),[c,h]=C.useState(""),[g,d]=C.useState(!1),[_,S]=C.useState("global"),[E,b]=C.useState(""),[v,y]=C.useState([]),[p,x]=C.useState({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""});C.useEffect(()=>{k()},[]);const k=async()=>{try{m(!0);const V=await Se.getMemory();o(V)}catch{le.error("Failed to load memory")}finally{m(!1)}};C.useEffect(()=>{f&&P(f.path)},[f]);const P=async V=>{try{const K=await Se.getMemoryFile(V);h(K.content||"")}catch{le.error("Failed to load file")}},T=async()=>{if(f){d(!0);try{await Se.saveMemoryFile(f.path,c),le.success("Saved!"),k()}catch{le.error("Failed to save")}finally{d(!1)}}},R=async()=>{if(!E.trim()){y([]);return}try{const V=await Se.searchMemory(E);y(V.results||[])}catch{le.error("Search failed")}},j=async()=>{let V="";const{type:K}=p;switch(K){case"preference":if(!p.name.trim()){le.error("Name required");return}V=`**${p.name}**: ${p.description}`;break;case"correction":if(!p.wrong.trim()||!p.right.trim()){le.error('Both "wrong" and "right" are required');return}V=`**Wrong**: ${p.wrong}
|
|
560
|
+
**Right**: ${p.right}`;break;case"fact":if(!p.category.trim()){le.error("Category required");return}V=`**${p.category}**: ${p.details}`;break;case"pattern":if(!p.name.trim()){le.error("Name required");return}V=`**${p.name}**
|
|
561
|
+
${p.description}`;break;case"decision":if(!p.title.trim()){le.error("Title required");return}V=`**${p.title}**
|
|
562
|
+
|
|
563
|
+
**Context**: ${p.context}
|
|
564
|
+
|
|
565
|
+
**Decision**: ${p.decision}
|
|
566
|
+
|
|
567
|
+
**Rationale**: ${p.rationale}`;break;case"issue":if(!p.title.trim()){le.error("Title required");return}V=`**${p.title}**
|
|
568
|
+
|
|
569
|
+
${p.description}`;break;case"history":case"context":default:if(!p.content.trim()){le.error("Content required");return}V=p.content;break}try{const J=["pattern","decision","issue","history","context"].includes(K)?"project":"global";await Se.addMemoryEntry(K,V,J),le.success(`Added ${K} entry`),x({open:!1,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),k()}catch{le.error("Failed to add entry")}},M=async()=>{try{await Se.initProjectMemory(e.dir),le.success("Project memory initialized!"),k()}catch(V){le.error(V.message||"Failed to initialize")}};if(l)return i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(dt,{className:"w-8 h-8 animate-spin text-indigo-600"})});const $={global:[{id:"preference",label:"Preference",icon:yn,desc:"User preferences (tools, style, etc.)"},{id:"correction",label:"Correction",icon:ca,desc:"Mistakes to avoid"},{id:"fact",label:"Fact",icon:Kn,desc:"Facts about your environment"}],project:[{id:"context",label:"Context",icon:mr,desc:"Project overview and conventions"},{id:"pattern",label:"Pattern",icon:D_,desc:"Code patterns in this project"},{id:"decision",label:"Decision",icon:V_,desc:"Architecture decisions"},{id:"issue",label:"Issue",icon:ca,desc:"Known issues and workarounds"},{id:"history",label:"History",icon:hh,desc:"Session work log"}]};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 p-5 shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(mc,{className:"w-5 h-5 text-purple-600"}),"Memory System"]}),i.jsx("div",{className:"flex gap-2",children:i.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>x({open:!0,type:"preference",name:"",description:"",wrong:"",right:"",category:"",details:"",title:"",context:"",decision:"",rationale:"",content:""}),children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add Entry"]})})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Xe,{placeholder:"Search memory...",value:E,onChange:V=>b(V.target.value),onKeyDown:V=>V.key==="Enter"&&R(),className:"flex-1"}),i.jsx(ue,{variant:"outline",onClick:R,children:i.jsx(np,{className:"w-4 h-4"})})]}),v.length>0&&i.jsxs("div",{className:"mt-4 p-3 bg-gray-50 dark:bg-slate-900 rounded-lg",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Search Results"}),i.jsx("div",{className:"space-y-2",children:v.map((V,K)=>i.jsxs("div",{className:"text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(st,{variant:V.scope==="global"?"default":"secondary",children:V.scope}),i.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:V.file})]}),V.matches.map((J,W)=>i.jsxs("div",{className:"ml-4 text-gray-600 dark:text-slate-400 text-xs mt-1",children:["Line ",J.line,": ",J.text]},W))]},K))})]})]}),i.jsx("div",{className:"flex gap-2 border-b border-gray-200 dark:border-slate-700 pb-2",children:["global","project","sync"].map(V=>i.jsxs("button",{onClick:()=>S(V),className:`px-4 py-2 text-sm font-medium rounded-t-lg transition-colors ${_===V?"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:[V.charAt(0).toUpperCase()+V.slice(1)," Memory"]},V))}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:[i.jsxs("h3",{className:"font-medium text-gray-900 dark:text-white",children:[_==="global"&&"Global Memory Files",_==="project"&&"Project Memory Files",_==="sync"&&"Sync State"]}),i.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:[_==="global"&&"~/.claude/memory/",_==="project"&&`${e.dir}/.claude/memory/`,_==="sync"&&"~/.claude/sync/"]})]}),i.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:[_==="global"&&((F=s==null?void 0:s.global)==null?void 0:F.files.map(V=>i.jsxs("button",{onClick:()=>V.exists&&a(V),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 ${(f==null?void 0:f.path)===V.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${V.exists?"":"opacity-50"}`,children:[i.jsx(mr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:V.name}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:V.type})]}),V.exists?i.jsx(Rr,{className:"w-4 h-4 text-green-500"}):i.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},V.name))),_==="project"&&i.jsx(i.Fragment,{children:(U=s==null?void 0:s.project)!=null&&U.initialized?(H=s==null?void 0:s.project)==null?void 0:H.files.map(V=>i.jsxs("button",{onClick:()=>V.exists&&a(V),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 ${(f==null?void 0:f.path)===V.path?"bg-indigo-50 dark:bg-indigo-950/30":""} ${V.exists?"":"opacity-50"}`,children:[i.jsx(mr,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:V.name}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:V.type})]}),V.exists?i.jsx(Rr,{className:"w-4 h-4 text-green-500"}):i.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:"Not created"})]},V.name)):i.jsxs("div",{className:"p-6 text-center",children:[i.jsx(mc,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-4",children:"Project memory not initialized"}),i.jsxs(ue,{onClick:M,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Initialize Project Memory"]})]})}),_==="sync"&&i.jsx("div",{className:"p-4",children:(Q=s==null?void 0:s.sync)!=null&&Q.state?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Current State"}),i.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(s.sync.state,null,2)})]}),s.sync.history.length>0&&i.jsxs("div",{children:[i.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:["History (",s.sync.history.length,")"]}),i.jsx("div",{className:"space-y-1",children:s.sync.history.map((V,K)=>i.jsxs("div",{className:"text-xs text-gray-600 dark:text-slate-400 flex items-center gap-2",children:[i.jsx(hh,{className:"w-3 h-3"}),V.name]},K))})]})]}):i.jsxs("div",{className:"text-center py-6",children:[i.jsx(hh,{className:"w-12 h-12 text-gray-300 dark:text-slate-600 mx-auto mb-3"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"No sync state"}),i.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:"State is created by session hooks"})]})})]})]}),i.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[i.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:f?f.name:"Select a file"}),f&&i.jsxs(ue,{size:"sm",onClick:T,disabled:g,className:"bg-indigo-600 hover:bg-indigo-700 text-white",children:[g?i.jsx(dt,{className:"w-4 h-4 mr-2 animate-spin"}):i.jsx(oi,{className:"w-4 h-4 mr-2"}),"Save"]})]}),i.jsx("div",{className:"p-4",children:f?i.jsx(Ze,{value:c,onChange:V=>h(V.target.value),className:"font-mono text-sm min-h-[400px]",placeholder:"File content..."}):i.jsx("div",{className:"flex items-center justify-center h-[400px] text-gray-400 dark:text-slate-500",children:i.jsxs("div",{className:"text-center",children:[i.jsx(mr,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),i.jsx("p",{children:"Select a file to edit"})]})})})]})]}),i.jsx(ir,{open:p.open,onOpenChange:V=>x({...p,open:V}),children:i.jsxs(Qt,{className:"max-w-lg",children:[i.jsxs(Zt,{children:[i.jsx(tr,{children:"Add Memory Entry"}),i.jsx(Nr,{children:"Add a new entry to the appropriate memory file."})]}),i.jsxs("div",{className:"py-4 space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Entry Type"}),i.jsx("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[...$.global,...$.project].map(V=>{const K=V.icon,J=$.global.some(W=>W.id===V.id);return i.jsxs("button",{onClick:()=>x({...p,type:V.id}),className:`p-2 rounded-lg border text-left transition-colors ${p.type===V.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:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(K,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),i.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:V.label})]}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:J?"Global":"Project"})]},V.id)})})]}),p.type==="preference"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Name"}),i.jsx(Xe,{value:p.name,onChange:V=>x({...p,name:V.target.value}),placeholder:"e.g., package-manager",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),i.jsx(Xe,{value:p.description,onChange:V=>x({...p,description:V.target.value}),placeholder:"e.g., Always use pnpm instead of npm",className:"mt-1"})]})]}),p.type==="correction"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Wrong (what to avoid)"}),i.jsx(Ze,{value:p.wrong,onChange:V=>x({...p,wrong:V.target.value}),placeholder:"e.g., Using npm install",className:"mt-1",rows:2})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Right (what to do instead)"}),i.jsx(Ze,{value:p.right,onChange:V=>x({...p,right:V.target.value}),placeholder:"e.g., Use pnpm install",className:"mt-1",rows:2})]})]}),p.type==="fact"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Category"}),i.jsx(Xe,{value:p.category,onChange:V=>x({...p,category:V.target.value}),placeholder:"e.g., shell, editor, system",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Details"}),i.jsx(Ze,{value:p.details,onChange:V=>x({...p,details:V.target.value}),placeholder:"e.g., Using zsh with oh-my-zsh",className:"mt-1",rows:2})]})]}),p.type==="pattern"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Pattern Name"}),i.jsx(Xe,{value:p.name,onChange:V=>x({...p,name:V.target.value}),placeholder:"e.g., API Response Format",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description"}),i.jsx(Ze,{value:p.description,onChange:V=>x({...p,description:V.target.value}),placeholder:"Describe the pattern and when to use it...",className:"mt-1",rows:3})]})]}),p.type==="decision"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Title"}),i.jsx(Xe,{value:p.title,onChange:V=>x({...p,title:V.target.value}),placeholder:"e.g., Use React Query for data fetching",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Context"}),i.jsx(Ze,{value:p.context,onChange:V=>x({...p,context:V.target.value}),placeholder:"What problem were we solving?",className:"mt-1",rows:2})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Decision"}),i.jsx(Ze,{value:p.decision,onChange:V=>x({...p,decision:V.target.value}),placeholder:"What did we decide?",className:"mt-1",rows:2})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Rationale"}),i.jsx(Ze,{value:p.rationale,onChange:V=>x({...p,rationale:V.target.value}),placeholder:"Why this choice over alternatives?",className:"mt-1",rows:2})]})]}),p.type==="issue"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Issue Title"}),i.jsx(Xe,{value:p.title,onChange:V=>x({...p,title:V.target.value}),placeholder:"e.g., Memory leak in useEffect",className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Description / Workaround"}),i.jsx(Ze,{value:p.description,onChange:V=>x({...p,description:V.target.value}),placeholder:"Describe the issue and any workarounds...",className:"mt-1",rows:3})]})]}),(p.type==="history"||p.type==="context")&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Content"}),i.jsx(Ze,{value:p.content,onChange:V=>x({...p,content:V.target.value}),placeholder:p.type==="history"?"What work was done this session?":"Project context and overview...",className:"mt-1",rows:4})]})]}),i.jsxs(er,{children:[i.jsx(ue,{variant:"ghost",onClick:()=>x({...p,open:!1}),children:"Cancel"}),i.jsxs(ue,{onClick:j,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add Entry"]})]})]})})]})}function KI({onProjectSwitch:e}){const[t,s]=C.useState([]),[o,l]=C.useState(null),[m,f]=C.useState(!0),[a,c]=C.useState(null),[h,g]=C.useState(!1);C.useEffect(()=>{d()},[]);const d=async()=>{try{f(!0);const b=await Se.getProjects();s(b.projects||[]),l(b.activeProjectId)}catch{le.error("Failed to load projects")}finally{f(!1)}},_=async b=>{c(b);try{const v=await Se.setActiveProject(b);v.success?(l(b),s(y=>y.map(p=>({...p,isActive:p.id===b}))),le.success(`Switched to ${v.project.name}`),e==null||e(v)):le.error(v.error||"Failed to switch project")}catch(v){le.error("Failed to switch project: "+v.message)}finally{c(null)}},S=async b=>{if(confirm(`Remove "${b.name}" from the registry?
|
|
570
|
+
|
|
571
|
+
This won't delete any files.`))try{const v=await Se.removeProject(b.id);v.success?(s(y=>y.filter(p=>p.id!==b.id)),le.success(`Removed project: ${b.name}`)):le.error(v.error||"Failed to remove project")}catch(v){le.error("Failed to remove project: "+v.message)}},E=b=>{s(v=>[...v,{...b,exists:!0,hasClaudeConfig:!1}])};return m?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx(dt,{className:"w-8 h-8 animate-spin text-indigo-600"})}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-900/30 flex items-center justify-center",children:i.jsx(Gn,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Projects"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Registered projects for quick switching"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ue,{variant:"outline",onClick:d,size:"sm",children:[i.jsx(gr,{className:"w-4 h-4 mr-2"}),"Refresh"]}),i.jsxs(ue,{onClick:()=>g(!0),className:"bg-indigo-600 hover:bg-indigo-700",children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add Project"]})]})]}),i.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:i.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."})}),i.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?i.jsxs("div",{className:"p-12 text-center",children:[i.jsx(Nt,{className:"w-12 h-12 mx-auto mb-4 text-gray-300 dark:text-slate-600"}),i.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"No Projects Yet"}),i.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."}),i.jsxs(ue,{onClick:()=>g(!0),children:[i.jsx(Ht,{className:"w-4 h-4 mr-2"}),"Add Your First Project"]})]}):i.jsx("div",{className:"divide-y divide-gray-100 dark:divide-slate-800",children:t.map(b=>i.jsxs("div",{className:`p-4 flex items-center gap-4 transition-colors ${b.isActive?"bg-indigo-50 dark:bg-indigo-950/30":"hover:bg-gray-50 dark:hover:bg-slate-900"}`,children:[i.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${b.isActive?"bg-indigo-100 dark:bg-indigo-900/50":b.exists?"bg-gray-100 dark:bg-slate-800":"bg-amber-100 dark:bg-amber-900/30"}`,children:b.isActive?i.jsx(Rr,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400"}):b.exists?i.jsx(Nt,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"}):i.jsx(Hc,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:`font-medium truncate ${b.isActive?"text-indigo-700 dark:text-indigo-400":"text-gray-900 dark:text-white"}`,children:b.name}),b.hasClaudeConfig&&i.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"}),b.isActive&&i.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"})]}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 font-mono truncate",children:b.path.replace(/^\/Users\/[^/]+/,"~")}),!b.exists&&i.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"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[!b.isActive&&b.exists&&i.jsx(ue,{size:"sm",onClick:()=>_(b.id),disabled:a===b.id,children:a===b.id?i.jsx(dt,{className:"w-4 h-4 animate-spin"}):"Switch"}),i.jsx(ue,{size:"sm",variant:"ghost",onClick:()=>S(b),className:"text-gray-500 dark:text-slate-400 hover:text-red-600 dark:hover:text-red-400",title:"Remove from registry",children:i.jsx(qn,{className:"w-4 h-4"})})]})]},b.id))})}),i.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[i.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands"}),i.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[i.jsx("p",{children:"claude-config project add [path] # Add project"}),i.jsx("p",{children:"claude-config project remove <name> # Remove project"}),i.jsx("p",{children:"claude-config project # List projects"})]})]}),i.jsx(Q1,{open:h,onOpenChange:g,onAdded:E})]})}const GI=[{id:"getting-started",title:"Getting Started",icon:Kn,subsections:[{id:"installation",title:"Installation"},{id:"quick-start",title:"Quick Start"},{id:"updating",title:"Updating"}]},{id:"projects",title:"Project Management",icon:O_,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:Nt,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:"mcp-registry",title:"MCP Registry",icon:da,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:mc,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:ba,subsections:[{id:"permissions",title:"Permissions"},{id:"model-selection",title:"Model Selection"},{id:"behavior",title:"Behavior Settings"},{id:"hooks",title:"Hooks"}]},{id:"templates",title:"Templates",icon:$c,subsections:[{id:"using-templates",title:"Using Templates"},{id:"available-templates",title:"Available Templates"},{id:"custom-templates",title:"Custom Templates"}]},{id:"cli",title:"CLI Reference",icon:St,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:$t,subsections:[{id:"antigravity",title:"Antigravity Support"},{id:"tool-differences",title:"Tool Differences"},{id:"enabling-tools",title:"Enabling Tools"},{id:"syncing-rules",title:"Syncing Rules"}]},{id:"keyboard",title:"Keyboard Shortcuts",icon:jT,subsections:[]},{id:"troubleshooting",title:"Troubleshooting",icon:Zf,subsections:[{id:"common-issues",title:"Common Issues"},{id:"getting-help",title:"Getting Help"}]}],qI={installation:{title:"Installation",content:`
|
|
572
|
+
## Installation
|
|
573
|
+
|
|
574
|
+
Install claude-config globally via npm:
|
|
575
|
+
|
|
576
|
+
\`\`\`bash
|
|
577
|
+
npm install -g @regression-io/claude-config
|
|
578
|
+
\`\`\`
|
|
579
|
+
|
|
580
|
+
Or install from GitHub directly:
|
|
581
|
+
|
|
582
|
+
\`\`\`bash
|
|
583
|
+
npm install -g github:regression-io/claude-config
|
|
584
|
+
\`\`\`
|
|
585
|
+
|
|
586
|
+
### Requirements
|
|
587
|
+
|
|
588
|
+
- **Node.js 18+** is required
|
|
589
|
+
- Works on macOS, Linux, and Windows (with some limitations)
|
|
590
|
+
|
|
591
|
+
### Verify Installation
|
|
592
|
+
|
|
593
|
+
After installation, verify it's working:
|
|
594
|
+
|
|
595
|
+
\`\`\`bash
|
|
596
|
+
claude-config --version
|
|
597
|
+
\`\`\`
|
|
598
|
+
|
|
599
|
+
This should display the version number and installation paths.
|
|
600
|
+
`},"quick-start":{title:"Quick Start",content:`
|
|
601
|
+
## Quick Start
|
|
602
|
+
|
|
603
|
+
### 1. Start the UI
|
|
604
|
+
|
|
605
|
+
\`\`\`bash
|
|
606
|
+
claude-config ui
|
|
607
|
+
\`\`\`
|
|
608
|
+
|
|
609
|
+
This starts the web UI as a background daemon on port 3333.
|
|
610
|
+
|
|
611
|
+
### 2. Open in Browser
|
|
612
|
+
|
|
613
|
+
Navigate to **http://localhost:3333**
|
|
614
|
+
|
|
615
|
+
### 3. Add a Project
|
|
616
|
+
|
|
617
|
+
Click "Add Project" in the header or go to All Projects view to register your project directories.
|
|
618
|
+
|
|
619
|
+
### 4. Initialize Configuration
|
|
620
|
+
|
|
621
|
+
For each project, you can:
|
|
622
|
+
- Create a \`.claude\` folder with configuration
|
|
623
|
+
- Add rules (guidelines for Claude)
|
|
624
|
+
- Add commands (reusable prompts)
|
|
625
|
+
- Configure MCPs (Model Context Protocol servers)
|
|
626
|
+
|
|
627
|
+
### 5. Apply Templates
|
|
628
|
+
|
|
629
|
+
Use pre-built templates to quickly set up rules for your project type:
|
|
630
|
+
- **fastapi** - Python FastAPI projects
|
|
631
|
+
- **react-ts** - React with TypeScript
|
|
632
|
+
- **python-cli** - Python CLI tools
|
|
633
|
+
- And more...
|
|
634
|
+
|
|
635
|
+
### 6. Install as App (Optional)
|
|
636
|
+
|
|
637
|
+
Claude Config is a PWA (Progressive Web App). Install it to your taskbar:
|
|
638
|
+
|
|
639
|
+
**Chrome/Edge:** Click the install icon in the address bar
|
|
640
|
+
**Safari:** Share → Add to Dock
|
|
641
|
+
|
|
642
|
+
### 7. Theme
|
|
643
|
+
|
|
644
|
+
Use the theme toggle in the header to switch between:
|
|
645
|
+
- **Light** - Light mode
|
|
646
|
+
- **Dark** - Dark mode
|
|
647
|
+
- **Auto** - Follow system preference
|
|
648
|
+
`},updating:{title:"Updating",content:`
|
|
649
|
+
## Updating
|
|
650
|
+
|
|
651
|
+
### Automatic Update Detection
|
|
652
|
+
|
|
653
|
+
The UI automatically checks npm for new versions. When an update is available, you'll see a notification in the Preferences page.
|
|
654
|
+
|
|
655
|
+
### Manual Update
|
|
656
|
+
|
|
657
|
+
\`\`\`bash
|
|
658
|
+
npm update -g @regression-io/claude-config
|
|
659
|
+
\`\`\`
|
|
660
|
+
|
|
661
|
+
Or for a clean reinstall:
|
|
662
|
+
|
|
663
|
+
\`\`\`bash
|
|
664
|
+
npm uninstall -g @regression-io/claude-config
|
|
665
|
+
npm install -g @regression-io/claude-config
|
|
666
|
+
\`\`\`
|
|
667
|
+
|
|
668
|
+
### After Updating
|
|
669
|
+
|
|
670
|
+
If you have the UI running as a daemon, restart it:
|
|
671
|
+
|
|
672
|
+
\`\`\`bash
|
|
673
|
+
claude-config ui stop
|
|
674
|
+
claude-config ui
|
|
675
|
+
\`\`\`
|
|
676
|
+
`},"project-registry":{title:"Project Registry",content:`
|
|
677
|
+
## Project Registry
|
|
678
|
+
|
|
679
|
+
The project registry keeps track of all your Claude-enabled projects. It's stored in \`~/.claude-config/projects.json\`.
|
|
680
|
+
|
|
681
|
+
### Adding Projects
|
|
682
|
+
|
|
683
|
+
**Via UI:**
|
|
684
|
+
1. Click "Add Project" in the header
|
|
685
|
+
2. Select a directory
|
|
686
|
+
|
|
687
|
+
**Via CLI:**
|
|
688
|
+
\`\`\`bash
|
|
689
|
+
claude-config project add /path/to/project
|
|
690
|
+
claude-config project add /path/to/project --name "My Project"
|
|
691
|
+
\`\`\`
|
|
692
|
+
|
|
693
|
+
### Listing Projects
|
|
694
|
+
|
|
695
|
+
\`\`\`bash
|
|
696
|
+
claude-config project
|
|
697
|
+
\`\`\`
|
|
698
|
+
|
|
699
|
+
### Removing Projects
|
|
700
|
+
|
|
701
|
+
\`\`\`bash
|
|
702
|
+
claude-config project remove "My Project"
|
|
703
|
+
claude-config project remove /path/to/project
|
|
704
|
+
\`\`\`
|
|
705
|
+
|
|
706
|
+
Note: Removing a project from the registry does not delete the project files.
|
|
707
|
+
`},"project-switching":{title:"Switching Projects",content:`
|
|
708
|
+
## Switching Projects
|
|
709
|
+
|
|
710
|
+
### Via UI
|
|
711
|
+
|
|
712
|
+
Use the project dropdown in the header to quickly switch between registered projects. The UI will reload to show the new project's configuration.
|
|
713
|
+
|
|
714
|
+
### Via CLI
|
|
715
|
+
|
|
716
|
+
\`\`\`bash
|
|
717
|
+
claude-config ui --dir /path/to/project
|
|
718
|
+
\`\`\`
|
|
719
|
+
|
|
720
|
+
### Active Project
|
|
721
|
+
|
|
722
|
+
The active project is remembered between sessions. When you start the UI, it automatically loads the last active project.
|
|
723
|
+
`},"project-structure":{title:"Project Structure",content:`
|
|
724
|
+
## Project Structure
|
|
725
|
+
|
|
726
|
+
A Claude-enabled project has a \`.claude\` folder with this structure:
|
|
727
|
+
|
|
728
|
+
\`\`\`
|
|
729
|
+
your-project/
|
|
730
|
+
├── .claude/
|
|
731
|
+
│ ├── mcps.json # MCP configuration
|
|
732
|
+
│ ├── settings.json # Project-specific settings
|
|
733
|
+
│ ├── CLAUDE.md # Project instructions
|
|
734
|
+
│ ├── rules/ # Rule files (*.md)
|
|
735
|
+
│ │ ├── style.md
|
|
736
|
+
│ │ └── patterns.md
|
|
737
|
+
│ ├── commands/ # Command files (*.md)
|
|
738
|
+
│ │ ├── review.md
|
|
739
|
+
│ │ └── test.md
|
|
740
|
+
│ ├── workflows/ # Workflow files (*.md)
|
|
741
|
+
│ │ └── deploy.md
|
|
742
|
+
│ └── memory/ # Project memory (optional)
|
|
743
|
+
│ ├── context.md
|
|
744
|
+
│ └── patterns.md
|
|
745
|
+
└── .mcp.json # Generated - Claude Code reads this
|
|
746
|
+
\`\`\`
|
|
747
|
+
|
|
748
|
+
### Generated Files
|
|
749
|
+
|
|
750
|
+
The \`.mcp.json\` file in your project root is generated by running \`claude-config apply\`. Claude Code reads this file to configure MCPs.
|
|
751
|
+
`},"claude-folders":{title:".claude Folders",content:`
|
|
752
|
+
## .claude Folders
|
|
753
|
+
|
|
754
|
+
The \`.claude\` folder contains all Claude Code configuration for a directory.
|
|
755
|
+
|
|
756
|
+
### Creating .claude Folders
|
|
757
|
+
|
|
758
|
+
In the Project Explorer, click "+ .claude" on any directory in the hierarchy to create a new configuration folder.
|
|
759
|
+
|
|
760
|
+
### Hierarchy
|
|
761
|
+
|
|
762
|
+
Configuration is inherited from parent directories:
|
|
763
|
+
|
|
764
|
+
\`\`\`
|
|
765
|
+
~/.claude/ # Global - applies everywhere
|
|
766
|
+
~/projects/.claude/ # Workspace - applies to all projects here
|
|
767
|
+
~/projects/my-app/ # Project - specific to this project
|
|
768
|
+
\`\`\`
|
|
769
|
+
|
|
770
|
+
Settings merge from global to project, with more specific settings taking precedence.
|
|
771
|
+
`},rules:{title:"Rules",content:`
|
|
772
|
+
## Rules
|
|
773
|
+
|
|
774
|
+
Rules are markdown files that provide guidelines and instructions for Claude.
|
|
775
|
+
|
|
776
|
+
### Creating Rules
|
|
777
|
+
|
|
778
|
+
1. Navigate to a \`.claude\` folder in the Project Explorer
|
|
779
|
+
2. Click the "+" button next to "rules"
|
|
780
|
+
3. Enter a name (e.g., "coding-style")
|
|
781
|
+
|
|
782
|
+
### Rule Content
|
|
783
|
+
|
|
784
|
+
Rules should be written in markdown and contain:
|
|
785
|
+
- Guidelines for code style
|
|
786
|
+
- Project-specific patterns
|
|
787
|
+
- Do's and don'ts
|
|
788
|
+
- Architecture decisions
|
|
789
|
+
|
|
790
|
+
### Example Rule
|
|
791
|
+
|
|
792
|
+
\`\`\`markdown
|
|
793
|
+
# Coding Style
|
|
794
|
+
|
|
795
|
+
## TypeScript
|
|
796
|
+
- Use strict mode
|
|
797
|
+
- Prefer interfaces over types
|
|
798
|
+
- Use named exports
|
|
799
|
+
|
|
800
|
+
## React
|
|
801
|
+
- Use functional components
|
|
802
|
+
- Prefer hooks over HOCs
|
|
803
|
+
- Keep components small and focused
|
|
804
|
+
\`\`\`
|
|
805
|
+
|
|
806
|
+
### Rule Priority
|
|
807
|
+
|
|
808
|
+
Rules are loaded in order from global to project. Project rules can override global rules.
|
|
809
|
+
`},commands:{title:"Commands",content:`
|
|
810
|
+
## Commands
|
|
811
|
+
|
|
812
|
+
Commands are reusable prompts that can be invoked in Claude Code.
|
|
813
|
+
|
|
814
|
+
### Creating Commands
|
|
815
|
+
|
|
816
|
+
1. Navigate to a \`.claude\` folder in the Project Explorer
|
|
817
|
+
2. Click the "+" button next to "commands"
|
|
818
|
+
3. Enter a name (e.g., "review")
|
|
819
|
+
|
|
820
|
+
### Command Content
|
|
821
|
+
|
|
822
|
+
Commands are markdown files containing a prompt template. They can include:
|
|
823
|
+
- Instructions for Claude
|
|
824
|
+
- Templates with placeholders
|
|
825
|
+
- Multi-step workflows
|
|
826
|
+
|
|
827
|
+
### Example Command
|
|
828
|
+
|
|
829
|
+
\`\`\`markdown
|
|
830
|
+
# Code Review
|
|
831
|
+
|
|
832
|
+
Review the selected code for:
|
|
833
|
+
|
|
834
|
+
1. **Bugs** - Logic errors, edge cases
|
|
835
|
+
2. **Security** - Vulnerabilities, input validation
|
|
836
|
+
3. **Performance** - Inefficiencies, memory leaks
|
|
837
|
+
4. **Style** - Consistency, readability
|
|
838
|
+
|
|
839
|
+
Provide specific suggestions with code examples.
|
|
840
|
+
\`\`\`
|
|
841
|
+
|
|
842
|
+
### Using Commands
|
|
843
|
+
|
|
844
|
+
In Claude Code, use \`/command-name\` to invoke a command.
|
|
845
|
+
`},workflows:{title:"Workflows",content:`
|
|
846
|
+
## Workflows
|
|
847
|
+
|
|
848
|
+
Workflows are markdown files that define multi-step processes or cross-repository operations.
|
|
849
|
+
|
|
850
|
+
### Location
|
|
851
|
+
|
|
852
|
+
Workflows are stored in \`.claude/workflows/\` in your project root.
|
|
853
|
+
|
|
854
|
+
### Creating Workflows
|
|
855
|
+
|
|
856
|
+
1. Navigate to a \`.claude\` folder in the Project Explorer
|
|
857
|
+
2. Click the "+" button and select "New Workflow"
|
|
858
|
+
3. Enter a name (e.g., "deploy-all")
|
|
859
|
+
|
|
860
|
+
### Workflow Content
|
|
861
|
+
|
|
862
|
+
Workflows typically include:
|
|
863
|
+
- Step-by-step instructions
|
|
864
|
+
- Cross-repository coordination
|
|
865
|
+
- Environment setup
|
|
866
|
+
- Deployment processes
|
|
867
|
+
|
|
868
|
+
### Example Workflow
|
|
869
|
+
|
|
870
|
+
\`\`\`markdown
|
|
871
|
+
# Deploy All Services
|
|
872
|
+
|
|
873
|
+
## Steps
|
|
874
|
+
|
|
875
|
+
1. Build auth-service first
|
|
876
|
+
2. Then build api-gateway
|
|
877
|
+
3. Run integration tests
|
|
878
|
+
4. Deploy to staging
|
|
879
|
+
5. Deploy to production
|
|
880
|
+
\`\`\`
|
|
881
|
+
|
|
882
|
+
### Use Cases
|
|
883
|
+
|
|
884
|
+
- Multi-repo deployments
|
|
885
|
+
- Complex build processes
|
|
886
|
+
- Onboarding procedures
|
|
887
|
+
- Release workflows
|
|
888
|
+
`},subprojects:{title:"Sub-Projects",content:`
|
|
889
|
+
## Sub-Projects
|
|
890
|
+
|
|
891
|
+
Sub-projects are nested git repositories within your main project (monorepos, workspaces).
|
|
892
|
+
|
|
893
|
+
### Detection
|
|
894
|
+
|
|
895
|
+
Sub-projects are automatically detected by scanning for \`.git\` directories within your project.
|
|
896
|
+
|
|
897
|
+
### Sub-Projects View
|
|
898
|
+
|
|
899
|
+
Access via **Sub-Projects** in the sidebar (only appears if sub-projects exist).
|
|
900
|
+
|
|
901
|
+
The view shows:
|
|
902
|
+
- All detected sub-projects
|
|
903
|
+
- Which have \`.claude\` folders configured
|
|
904
|
+
- MCP count per sub-project
|
|
905
|
+
|
|
906
|
+
### Managing Sub-Projects
|
|
907
|
+
|
|
908
|
+
**Initialize .claude folder:**
|
|
909
|
+
Click the folder+ icon on a sub-project without configuration.
|
|
910
|
+
|
|
911
|
+
**Delete .claude folder:**
|
|
912
|
+
Click the trash icon (with confirmation) to remove configuration.
|
|
913
|
+
|
|
914
|
+
**Switch to sub-project:**
|
|
915
|
+
Click a sub-project card to switch context and manage it in Project Explorer.
|
|
916
|
+
|
|
917
|
+
### Sticky Navigation
|
|
918
|
+
|
|
919
|
+
When inside a sub-project, the Sub-Projects menu remains visible showing all sub-projects from the root project. Use "Back to Root" to return.
|
|
920
|
+
|
|
921
|
+
### Configuration Inheritance
|
|
922
|
+
|
|
923
|
+
Sub-projects inherit configuration from parent directories. Each sub-project can have its own \`.claude\` folder that extends the parent configuration.
|
|
924
|
+
`},hierarchy:{title:"Configuration Hierarchy",content:`
|
|
925
|
+
## Configuration Hierarchy
|
|
926
|
+
|
|
927
|
+
Claude Config uses a hierarchical configuration system where settings cascade from global to local.
|
|
928
|
+
|
|
929
|
+
### Levels
|
|
930
|
+
|
|
931
|
+
1. **Global** (\`~/.claude/\`) - Applies to all projects
|
|
932
|
+
2. **Workspace** (intermediate directories) - Applies to projects in that directory
|
|
933
|
+
3. **Project** (your project's \`.claude/\`) - Specific to one project
|
|
934
|
+
|
|
935
|
+
### Merging Behavior
|
|
936
|
+
|
|
937
|
+
- **MCPs**: Merged, with local configs overriding global
|
|
938
|
+
- **Rules**: All rules are loaded, local rules can override
|
|
939
|
+
- **Commands**: All commands are available, local takes precedence
|
|
940
|
+
- **Settings**: Deep merged, local values override
|
|
941
|
+
|
|
942
|
+
### Viewing the Hierarchy
|
|
943
|
+
|
|
944
|
+
In the Project Explorer, you'll see all \`.claude\` folders in the hierarchy from your project up to home. You can manage configuration at each level.
|
|
945
|
+
`},"mcp-overview":{title:"MCP Overview",content:`
|
|
946
|
+
## MCP Overview
|
|
947
|
+
|
|
948
|
+
MCPs (Model Context Protocol servers) extend Claude's capabilities by providing additional tools and context.
|
|
949
|
+
|
|
950
|
+
### What are MCPs?
|
|
951
|
+
|
|
952
|
+
MCPs are servers that implement the Model Context Protocol, providing:
|
|
953
|
+
- **Tools** - Additional commands Claude can execute
|
|
954
|
+
- **Resources** - Data and context Claude can access
|
|
955
|
+
- **Prompts** - Pre-defined prompt templates
|
|
956
|
+
|
|
957
|
+
### Common MCPs
|
|
958
|
+
|
|
959
|
+
- **filesystem** - File system access
|
|
960
|
+
- **github** - GitHub integration
|
|
961
|
+
- **postgres** - PostgreSQL database access
|
|
962
|
+
- **memory** - Persistent memory storage
|
|
963
|
+
|
|
964
|
+
### Configuration
|
|
965
|
+
|
|
966
|
+
MCPs are configured in \`.claude/mcps.json\`:
|
|
967
|
+
|
|
968
|
+
\`\`\`json
|
|
969
|
+
{
|
|
970
|
+
"mcpServers": {
|
|
971
|
+
"filesystem": {
|
|
972
|
+
"command": "npx",
|
|
973
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
\`\`\`
|
|
978
|
+
`},"adding-mcps":{title:"Adding MCPs",content:`
|
|
979
|
+
## Adding MCPs
|
|
980
|
+
|
|
981
|
+
### Via UI - Registry
|
|
982
|
+
|
|
983
|
+
1. Go to **MCP Registry** in the sidebar
|
|
984
|
+
2. Click **Add MCP** button
|
|
985
|
+
3. Paste JSON configuration:
|
|
986
|
+
|
|
987
|
+
\`\`\`json
|
|
988
|
+
{
|
|
989
|
+
"my-mcp": {
|
|
990
|
+
"command": "npx",
|
|
991
|
+
"args": ["-y", "@example/mcp-server"],
|
|
992
|
+
"env": {
|
|
993
|
+
"API_KEY": "\${API_KEY}"
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
\`\`\`
|
|
998
|
+
|
|
999
|
+
4. Click "Add to Registry"
|
|
1000
|
+
|
|
1001
|
+
### Via UI - Config Editor
|
|
1002
|
+
|
|
1003
|
+
1. Go to **Project Explorer**
|
|
1004
|
+
2. Select an \`mcps.json\` file
|
|
1005
|
+
3. Click **Add MCP** in the editor header
|
|
1006
|
+
4. Paste JSON to add inline MCP to that config level
|
|
1007
|
+
|
|
1008
|
+
### Accepted JSON Formats
|
|
1009
|
+
|
|
1010
|
+
Both formats work:
|
|
1011
|
+
|
|
1012
|
+
**Simple format:**
|
|
1013
|
+
\`\`\`json
|
|
1014
|
+
{ "name": { "command": "...", "args": [...] } }
|
|
1015
|
+
\`\`\`
|
|
1016
|
+
|
|
1017
|
+
**Full format:**
|
|
1018
|
+
\`\`\`json
|
|
1019
|
+
{ "mcpServers": { "name": { "command": "...", "args": [...] } } }
|
|
1020
|
+
\`\`\`
|
|
1021
|
+
|
|
1022
|
+
### Via CLI
|
|
1023
|
+
|
|
1024
|
+
\`\`\`bash
|
|
1025
|
+
claude-config add filesystem github postgres
|
|
1026
|
+
\`\`\`
|
|
1027
|
+
|
|
1028
|
+
### From Search Results
|
|
1029
|
+
|
|
1030
|
+
Search GitHub or npm in the Registry view. Click "Add" to pre-fill the JSON with suggested configuration.
|
|
1031
|
+
`},"configuring-mcps":{title:"Configuring MCPs",content:`
|
|
1032
|
+
## Configuring MCPs
|
|
1033
|
+
|
|
1034
|
+
### Required Fields
|
|
1035
|
+
|
|
1036
|
+
- **command** - The executable to run (e.g., "npx", "node", "python")
|
|
1037
|
+
- **args** - Array of command-line arguments
|
|
1038
|
+
|
|
1039
|
+
### Optional Fields
|
|
1040
|
+
|
|
1041
|
+
- **env** - Environment variables for the MCP
|
|
1042
|
+
- **cwd** - Working directory
|
|
1043
|
+
|
|
1044
|
+
### Example Configuration
|
|
1045
|
+
|
|
1046
|
+
\`\`\`json
|
|
1047
|
+
{
|
|
1048
|
+
"mcpServers": {
|
|
1049
|
+
"github": {
|
|
1050
|
+
"command": "npx",
|
|
1051
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
1052
|
+
"env": {
|
|
1053
|
+
"GITHUB_TOKEN": "\${GITHUB_TOKEN}"
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
1056
|
+
"postgres": {
|
|
1057
|
+
"command": "npx",
|
|
1058
|
+
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
|
1059
|
+
"env": {
|
|
1060
|
+
"DATABASE_URL": "\${DATABASE_URL}"
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
\`\`\`
|
|
1066
|
+
|
|
1067
|
+
### Per-Level Configuration
|
|
1068
|
+
|
|
1069
|
+
You can enable/disable MCPs at different hierarchy levels. An MCP enabled globally can be disabled for a specific project.
|
|
1070
|
+
`},"environment-vars":{title:"Environment Variables",content:`
|
|
1071
|
+
## Environment Variables
|
|
1072
|
+
|
|
1073
|
+
### Syntax
|
|
1074
|
+
|
|
1075
|
+
Use \`\${VAR_NAME}\` syntax in your MCP configuration:
|
|
1076
|
+
|
|
1077
|
+
\`\`\`json
|
|
1078
|
+
{
|
|
1079
|
+
"env": {
|
|
1080
|
+
"API_KEY": "\${MY_API_KEY}"
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
\`\`\`
|
|
1084
|
+
|
|
1085
|
+
### .env Files
|
|
1086
|
+
|
|
1087
|
+
Create a \`.claude/.env\` file in your project:
|
|
1088
|
+
|
|
1089
|
+
\`\`\`
|
|
1090
|
+
GITHUB_TOKEN=ghp_xxxxx
|
|
1091
|
+
DATABASE_URL=postgresql://localhost/mydb
|
|
1092
|
+
\`\`\`
|
|
1093
|
+
|
|
1094
|
+
### Environment View
|
|
1095
|
+
|
|
1096
|
+
Use the **Environment** view in the sidebar to manage environment variables for your project.
|
|
1097
|
+
|
|
1098
|
+
### Security
|
|
1099
|
+
|
|
1100
|
+
- Never commit \`.claude/.env\` to version control
|
|
1101
|
+
- Add it to your \`.gitignore\`
|
|
1102
|
+
- Use different values for development and production
|
|
1103
|
+
`},"memory-overview":{title:"Memory Overview",content:`
|
|
1104
|
+
## Memory System
|
|
1105
|
+
|
|
1106
|
+
The memory system allows Claude to retain knowledge across sessions.
|
|
1107
|
+
|
|
1108
|
+
### Types of Memory
|
|
1109
|
+
|
|
1110
|
+
1. **Global Memory** (\`~/.claude/memory/\`)
|
|
1111
|
+
- Preferences - Your personal preferences
|
|
1112
|
+
- Corrections - Mistakes to avoid
|
|
1113
|
+
- Facts - Facts about your environment
|
|
1114
|
+
|
|
1115
|
+
2. **Project Memory** (\`project/.claude/memory/\`)
|
|
1116
|
+
- Context - Project overview
|
|
1117
|
+
- Patterns - Code patterns
|
|
1118
|
+
- Decisions - Architecture decisions
|
|
1119
|
+
- Issues - Known issues
|
|
1120
|
+
- History - Session history
|
|
1121
|
+
|
|
1122
|
+
### How It Works
|
|
1123
|
+
|
|
1124
|
+
Memory files are markdown documents that Claude reads at the start of each session, providing context and learned knowledge.
|
|
1125
|
+
`},"global-memory":{title:"Global Memory",content:`
|
|
1126
|
+
## Global Memory
|
|
1127
|
+
|
|
1128
|
+
Global memory applies to all your Claude interactions.
|
|
1129
|
+
|
|
1130
|
+
### Location
|
|
1131
|
+
|
|
1132
|
+
\`~/.claude/memory/\`
|
|
1133
|
+
|
|
1134
|
+
### Files
|
|
1135
|
+
|
|
1136
|
+
- **preferences.md** - Your coding preferences, tool choices, style preferences
|
|
1137
|
+
- **corrections.md** - Things Claude got wrong that it should remember
|
|
1138
|
+
- **facts.md** - Facts about your environment, setup, tools
|
|
1139
|
+
|
|
1140
|
+
### Example: preferences.md
|
|
1141
|
+
|
|
1142
|
+
\`\`\`markdown
|
|
1143
|
+
# Preferences
|
|
1144
|
+
|
|
1145
|
+
## Code Style
|
|
1146
|
+
- Use 2 spaces for indentation
|
|
1147
|
+
- Prefer functional programming patterns
|
|
1148
|
+
- Always add TypeScript types
|
|
1149
|
+
|
|
1150
|
+
## Tools
|
|
1151
|
+
- Use pnpm instead of npm
|
|
1152
|
+
- Prefer Vite over webpack
|
|
1153
|
+
\`\`\`
|
|
1154
|
+
`},"project-memory":{title:"Project Memory",content:`
|
|
1155
|
+
## Project Memory
|
|
1156
|
+
|
|
1157
|
+
Project memory is specific to a single project.
|
|
1158
|
+
|
|
1159
|
+
### Location
|
|
1160
|
+
|
|
1161
|
+
\`project/.claude/memory/\`
|
|
1162
|
+
|
|
1163
|
+
### Files
|
|
1164
|
+
|
|
1165
|
+
- **context.md** - Project overview, tech stack, architecture
|
|
1166
|
+
- **patterns.md** - Code patterns specific to this project
|
|
1167
|
+
- **decisions.md** - Architectural decisions and rationale
|
|
1168
|
+
- **issues.md** - Known issues and workarounds
|
|
1169
|
+
- **history.md** - Log of work done in sessions
|
|
1170
|
+
|
|
1171
|
+
### Initializing Project Memory
|
|
1172
|
+
|
|
1173
|
+
In the Memory view, click "Initialize" to create memory files from templates.
|
|
1174
|
+
|
|
1175
|
+
### Example: context.md
|
|
1176
|
+
|
|
1177
|
+
\`\`\`markdown
|
|
1178
|
+
# Project Context
|
|
1179
|
+
|
|
1180
|
+
## Overview
|
|
1181
|
+
E-commerce platform built with Next.js and Prisma.
|
|
1182
|
+
|
|
1183
|
+
## Tech Stack
|
|
1184
|
+
- Frontend: Next.js 14, React 18, Tailwind CSS
|
|
1185
|
+
- Backend: Next.js API routes, Prisma ORM
|
|
1186
|
+
- Database: PostgreSQL
|
|
1187
|
+
- Auth: NextAuth.js
|
|
1188
|
+
|
|
1189
|
+
## Key Directories
|
|
1190
|
+
- /app - Next.js app router pages
|
|
1191
|
+
- /components - React components
|
|
1192
|
+
- /lib - Utilities and helpers
|
|
1193
|
+
\`\`\`
|
|
1194
|
+
`},"memory-entries":{title:"Memory Entry Types",content:`
|
|
1195
|
+
## Memory Entry Types
|
|
1196
|
+
|
|
1197
|
+
### Preference
|
|
1198
|
+
|
|
1199
|
+
User preferences for tools, style, and workflow.
|
|
1200
|
+
|
|
1201
|
+
\`\`\`markdown
|
|
1202
|
+
## [Category]
|
|
1203
|
+
- Preference description
|
|
1204
|
+
- Another preference
|
|
1205
|
+
\`\`\`
|
|
1206
|
+
|
|
1207
|
+
### Correction
|
|
1208
|
+
|
|
1209
|
+
Something Claude got wrong that should be remembered.
|
|
1210
|
+
|
|
1211
|
+
\`\`\`markdown
|
|
1212
|
+
## [Topic]
|
|
1213
|
+
- **Wrong**: What Claude did wrong
|
|
1214
|
+
- **Right**: What to do instead
|
|
1215
|
+
\`\`\`
|
|
1216
|
+
|
|
1217
|
+
### Pattern
|
|
1218
|
+
|
|
1219
|
+
A code pattern specific to the project.
|
|
1220
|
+
|
|
1221
|
+
\`\`\`markdown
|
|
1222
|
+
## Pattern Name
|
|
1223
|
+
Description of when to use this pattern.
|
|
1224
|
+
|
|
1225
|
+
\\\`\\\`\\\`typescript
|
|
1226
|
+
// Code example
|
|
1227
|
+
\\\`\\\`\\\`
|
|
1228
|
+
\`\`\`
|
|
1229
|
+
|
|
1230
|
+
### Decision
|
|
1231
|
+
|
|
1232
|
+
An architectural decision with context.
|
|
1233
|
+
|
|
1234
|
+
\`\`\`markdown
|
|
1235
|
+
## Decision Title
|
|
1236
|
+
**Context**: Why this decision was needed
|
|
1237
|
+
**Decision**: What was decided
|
|
1238
|
+
**Rationale**: Why this was chosen
|
|
1239
|
+
\`\`\`
|
|
1240
|
+
|
|
1241
|
+
### Issue
|
|
1242
|
+
|
|
1243
|
+
A known issue with workaround.
|
|
1244
|
+
|
|
1245
|
+
\`\`\`markdown
|
|
1246
|
+
## Issue Title
|
|
1247
|
+
**Problem**: Description of the issue
|
|
1248
|
+
**Workaround**: How to work around it
|
|
1249
|
+
\`\`\`
|
|
1250
|
+
`},permissions:{title:"Permissions",content:`
|
|
1251
|
+
## Permissions
|
|
1252
|
+
|
|
1253
|
+
Control what Claude Code can do automatically.
|
|
1254
|
+
|
|
1255
|
+
### Permission Levels
|
|
1256
|
+
|
|
1257
|
+
- **Allow** - Tools that run without asking
|
|
1258
|
+
- **Ask** - Tools that require confirmation
|
|
1259
|
+
- **Deny** - Tools that are blocked
|
|
1260
|
+
|
|
1261
|
+
### Pattern Syntax
|
|
1262
|
+
|
|
1263
|
+
\`\`\`
|
|
1264
|
+
Tool(pattern)
|
|
1265
|
+
\`\`\`
|
|
1266
|
+
|
|
1267
|
+
Examples:
|
|
1268
|
+
- \`Bash(npm run build)\` - Specific command
|
|
1269
|
+
- \`Bash(npm:*)\` - Prefix match (npm anything)
|
|
1270
|
+
- \`Read(**)\` - All file reads
|
|
1271
|
+
- \`Edit(src/**)\` - Edit files in src/
|
|
1272
|
+
- \`mcp__github__*\` - All GitHub MCP tools
|
|
1273
|
+
|
|
1274
|
+
### Managing Permissions
|
|
1275
|
+
|
|
1276
|
+
In the **Claude Code** settings view:
|
|
1277
|
+
1. Navigate to the Permissions tab
|
|
1278
|
+
2. Add patterns to Allow, Ask, or Deny lists
|
|
1279
|
+
3. Click Save to apply
|
|
1280
|
+
|
|
1281
|
+
### Best Practices
|
|
1282
|
+
|
|
1283
|
+
- Start restrictive, allow more as needed
|
|
1284
|
+
- Use specific patterns over wildcards
|
|
1285
|
+
- Review deny list for security-sensitive operations
|
|
1286
|
+
`},"model-selection":{title:"Model Selection",content:`
|
|
1287
|
+
## Model Selection
|
|
1288
|
+
|
|
1289
|
+
Choose which Claude model to use.
|
|
1290
|
+
|
|
1291
|
+
### Available Models
|
|
1292
|
+
|
|
1293
|
+
- **Claude Sonnet 4** - Fast, capable, good for most tasks
|
|
1294
|
+
- **Claude Opus 4** - Most capable, best for complex tasks
|
|
1295
|
+
- **Claude Haiku** - Fastest, good for simple tasks
|
|
1296
|
+
|
|
1297
|
+
### Setting the Model
|
|
1298
|
+
|
|
1299
|
+
In **Claude Code** settings, use the Model dropdown to select your preferred model.
|
|
1300
|
+
|
|
1301
|
+
### Per-Task Model
|
|
1302
|
+
|
|
1303
|
+
Some tasks may benefit from different models:
|
|
1304
|
+
- Use Haiku for quick edits
|
|
1305
|
+
- Use Opus for complex refactoring
|
|
1306
|
+
- Use Sonnet as a balanced default
|
|
1307
|
+
`},behavior:{title:"Behavior Settings",content:`
|
|
1308
|
+
## Behavior Settings
|
|
1309
|
+
|
|
1310
|
+
Configure how Claude Code behaves.
|
|
1311
|
+
|
|
1312
|
+
### Available Settings
|
|
1313
|
+
|
|
1314
|
+
- **Auto-accept edits** - Automatically accept file changes
|
|
1315
|
+
- **Verbose mode** - Show more detailed output
|
|
1316
|
+
- **Enable MCPs** - Toggle MCP servers on/off
|
|
1317
|
+
|
|
1318
|
+
### Configuration
|
|
1319
|
+
|
|
1320
|
+
These settings are stored in \`~/.claude/settings.json\` and can be edited in the Claude Code settings view.
|
|
1321
|
+
`},hooks:{title:"Hooks",content:`
|
|
1322
|
+
## Hooks
|
|
1323
|
+
|
|
1324
|
+
Hooks allow you to run custom commands at specific points.
|
|
1325
|
+
|
|
1326
|
+
### Available Hooks
|
|
1327
|
+
|
|
1328
|
+
- **preToolUse** - Before a tool is used
|
|
1329
|
+
- **postToolUse** - After a tool is used
|
|
1330
|
+
- **notification** - When Claude sends a notification
|
|
1331
|
+
|
|
1332
|
+
### Configuration
|
|
1333
|
+
|
|
1334
|
+
\`\`\`json
|
|
1335
|
+
{
|
|
1336
|
+
"hooks": {
|
|
1337
|
+
"postToolUse": "echo 'Tool used'"
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
\`\`\`
|
|
1341
|
+
|
|
1342
|
+
### Use Cases
|
|
1343
|
+
|
|
1344
|
+
- Run linters after file edits
|
|
1345
|
+
- Log tool usage
|
|
1346
|
+
- Custom notifications
|
|
1347
|
+
`},"using-templates":{title:"Using Templates",content:`
|
|
1348
|
+
## Using Templates
|
|
1349
|
+
|
|
1350
|
+
Templates provide pre-configured rules and settings for different project types.
|
|
1351
|
+
|
|
1352
|
+
### Applying Templates
|
|
1353
|
+
|
|
1354
|
+
**Via UI:**
|
|
1355
|
+
1. Go to **Templates** in the sidebar
|
|
1356
|
+
2. Select a template
|
|
1357
|
+
3. Click "Apply to Project"
|
|
1358
|
+
|
|
1359
|
+
**Via CLI:**
|
|
1360
|
+
\`\`\`bash
|
|
1361
|
+
claude-config init --template fastapi
|
|
1362
|
+
claude-config apply-template react-ts
|
|
1363
|
+
\`\`\`
|
|
1364
|
+
|
|
1365
|
+
### What Templates Include
|
|
1366
|
+
|
|
1367
|
+
- Rules for the technology/framework
|
|
1368
|
+
- Best practices
|
|
1369
|
+
- Common patterns
|
|
1370
|
+
- Style guidelines
|
|
1371
|
+
`},"available-templates":{title:"Available Templates",content:`
|
|
1372
|
+
## Available Templates
|
|
1373
|
+
|
|
1374
|
+
### Languages
|
|
1375
|
+
|
|
1376
|
+
- **python** - Python general
|
|
1377
|
+
- **typescript** - TypeScript general
|
|
1378
|
+
- **javascript** - JavaScript general
|
|
1379
|
+
|
|
1380
|
+
### Frameworks
|
|
1381
|
+
|
|
1382
|
+
- **fastapi** - Python FastAPI
|
|
1383
|
+
- **react-ts** - React with TypeScript
|
|
1384
|
+
- **react-js** - React with JavaScript
|
|
1385
|
+
- **python-cli** - Python CLI apps
|
|
1386
|
+
- **mcp-python** - MCP server in Python
|
|
1387
|
+
|
|
1388
|
+
### Composites
|
|
1389
|
+
|
|
1390
|
+
- **fastapi-react-ts** - Full-stack FastAPI + React TypeScript
|
|
1391
|
+
- **fastapi-react-js** - Full-stack FastAPI + React JavaScript
|
|
1392
|
+
|
|
1393
|
+
### Universal
|
|
1394
|
+
|
|
1395
|
+
- **universal** - Common rules for any project
|
|
1396
|
+
`},"custom-templates":{title:"Custom Templates",content:`
|
|
1397
|
+
## Custom Templates
|
|
1398
|
+
|
|
1399
|
+
### Creating Custom Templates
|
|
1400
|
+
|
|
1401
|
+
Templates are stored in the templates directory. To create a custom template:
|
|
1402
|
+
|
|
1403
|
+
1. Create a directory in \`~/.claude-config/templates/\`
|
|
1404
|
+
2. Add a \`template.json\` manifest
|
|
1405
|
+
3. Add rules in a \`rules/\` subdirectory
|
|
1406
|
+
|
|
1407
|
+
### Template Structure
|
|
1408
|
+
|
|
1409
|
+
\`\`\`
|
|
1410
|
+
my-template/
|
|
1411
|
+
├── template.json
|
|
1412
|
+
└── rules/
|
|
1413
|
+
├── style.md
|
|
1414
|
+
└── patterns.md
|
|
1415
|
+
\`\`\`
|
|
1416
|
+
|
|
1417
|
+
### template.json
|
|
1418
|
+
|
|
1419
|
+
\`\`\`json
|
|
1420
|
+
{
|
|
1421
|
+
"name": "My Template",
|
|
1422
|
+
"description": "Custom template for my projects",
|
|
1423
|
+
"category": "custom"
|
|
1424
|
+
}
|
|
1425
|
+
\`\`\`
|
|
1426
|
+
`},"cli-overview":{title:"CLI Overview",content:`
|
|
1427
|
+
## CLI Overview
|
|
1428
|
+
|
|
1429
|
+
The \`claude-config\` CLI provides command-line access to all features.
|
|
1430
|
+
|
|
1431
|
+
### Basic Usage
|
|
1432
|
+
|
|
1433
|
+
\`\`\`bash
|
|
1434
|
+
claude-config [command] [options]
|
|
1435
|
+
\`\`\`
|
|
1436
|
+
|
|
1437
|
+
### Getting Help
|
|
1438
|
+
|
|
1439
|
+
\`\`\`bash
|
|
1440
|
+
claude-config --help
|
|
1441
|
+
claude-config <command> --help
|
|
1442
|
+
\`\`\`
|
|
1443
|
+
|
|
1444
|
+
### Global Options
|
|
1445
|
+
|
|
1446
|
+
- \`--version, -v\` - Show version
|
|
1447
|
+
- \`--help, -h\` - Show help
|
|
1448
|
+
`},"cli-commands":{title:"All Commands",content:`
|
|
1449
|
+
## All CLI Commands
|
|
1450
|
+
|
|
1451
|
+
### UI Commands
|
|
1452
|
+
|
|
1453
|
+
\`\`\`bash
|
|
1454
|
+
claude-config ui # Start UI (daemon mode)
|
|
1455
|
+
claude-config ui --foreground # Run in foreground
|
|
1456
|
+
claude-config ui --port 8080 # Custom port
|
|
1457
|
+
claude-config ui status # Check daemon status
|
|
1458
|
+
claude-config ui stop # Stop daemon
|
|
1459
|
+
\`\`\`
|
|
1460
|
+
|
|
1461
|
+
### Project Commands
|
|
1462
|
+
|
|
1463
|
+
\`\`\`bash
|
|
1464
|
+
claude-config init # Initialize project
|
|
1465
|
+
claude-config init --template X # Initialize with template
|
|
1466
|
+
claude-config apply # Generate .mcp.json
|
|
1467
|
+
claude-config show # Show configuration
|
|
1468
|
+
\`\`\`
|
|
1469
|
+
|
|
1470
|
+
### MCP Commands
|
|
1471
|
+
|
|
1472
|
+
\`\`\`bash
|
|
1473
|
+
claude-config list # List available MCPs
|
|
1474
|
+
claude-config add <mcp> # Add MCP to project
|
|
1475
|
+
claude-config remove <mcp> # Remove MCP
|
|
1476
|
+
claude-config registry-add # Add to registry
|
|
1477
|
+
claude-config registry-remove # Remove from registry
|
|
1478
|
+
\`\`\`
|
|
1479
|
+
|
|
1480
|
+
### Project Registry
|
|
1481
|
+
|
|
1482
|
+
\`\`\`bash
|
|
1483
|
+
claude-config project # List projects
|
|
1484
|
+
claude-config project add # Add project
|
|
1485
|
+
claude-config project remove # Remove project
|
|
1486
|
+
\`\`\`
|
|
1487
|
+
|
|
1488
|
+
### Memory Commands
|
|
1489
|
+
|
|
1490
|
+
\`\`\`bash
|
|
1491
|
+
claude-config memory # Show memory status
|
|
1492
|
+
claude-config memory init # Initialize memory
|
|
1493
|
+
claude-config memory add # Add entry
|
|
1494
|
+
claude-config memory search # Search memory
|
|
1495
|
+
\`\`\`
|
|
1496
|
+
|
|
1497
|
+
### Environment
|
|
1498
|
+
|
|
1499
|
+
\`\`\`bash
|
|
1500
|
+
claude-config env # List variables
|
|
1501
|
+
claude-config env set KEY value # Set variable
|
|
1502
|
+
claude-config env unset KEY # Remove variable
|
|
1503
|
+
\`\`\`
|
|
1504
|
+
|
|
1505
|
+
### Templates
|
|
1506
|
+
|
|
1507
|
+
\`\`\`bash
|
|
1508
|
+
claude-config templates # List templates
|
|
1509
|
+
claude-config apply-template X # Apply template
|
|
1510
|
+
\`\`\`
|
|
1511
|
+
`},"daemon-mode":{title:"Daemon Mode",content:`
|
|
1512
|
+
## Daemon Mode
|
|
1513
|
+
|
|
1514
|
+
By default, \`claude-config ui\` runs as a background daemon.
|
|
1515
|
+
|
|
1516
|
+
### Starting the Daemon
|
|
1517
|
+
|
|
1518
|
+
\`\`\`bash
|
|
1519
|
+
claude-config ui
|
|
1520
|
+
\`\`\`
|
|
1521
|
+
|
|
1522
|
+
The UI starts in the background and you can continue using your terminal.
|
|
1523
|
+
|
|
1524
|
+
### Checking Status
|
|
1525
|
+
|
|
1526
|
+
\`\`\`bash
|
|
1527
|
+
claude-config ui status
|
|
1528
|
+
\`\`\`
|
|
1529
|
+
|
|
1530
|
+
### Stopping the Daemon
|
|
1531
|
+
|
|
1532
|
+
\`\`\`bash
|
|
1533
|
+
claude-config ui stop
|
|
1534
|
+
\`\`\`
|
|
1535
|
+
|
|
1536
|
+
### Foreground Mode
|
|
1537
|
+
|
|
1538
|
+
To run in the foreground (blocking):
|
|
1539
|
+
|
|
1540
|
+
\`\`\`bash
|
|
1541
|
+
claude-config ui --foreground
|
|
1542
|
+
# or
|
|
1543
|
+
claude-config ui -f
|
|
1544
|
+
\`\`\`
|
|
1545
|
+
|
|
1546
|
+
### Logs
|
|
1547
|
+
|
|
1548
|
+
Daemon logs are stored in \`~/.claude-config/ui.log\`
|
|
1549
|
+
`},antigravity:{title:"Antigravity Support",content:`
|
|
1550
|
+
## Antigravity Support
|
|
1551
|
+
|
|
1552
|
+
claude-config now supports **Antigravity** (Google's AI coding assistant) in addition to Claude Code.
|
|
1553
|
+
|
|
1554
|
+
### How It Works
|
|
1555
|
+
|
|
1556
|
+
Both tools use the **MCP (Model Context Protocol)** for server configurations. claude-config manages a shared registry and generates tool-specific output files:
|
|
1557
|
+
|
|
1558
|
+
| Tool | Output Location |
|
|
1559
|
+
|------|-----------------|
|
|
1560
|
+
| Claude Code | \`.mcp.json\` (project root) |
|
|
1561
|
+
| Antigravity | \`~/.gemini/antigravity/mcp_config.json\` |
|
|
1562
|
+
|
|
1563
|
+
### Key Difference
|
|
1564
|
+
|
|
1565
|
+
**Environment Variables:**
|
|
1566
|
+
- **Claude Code** supports \`\${VAR}\` interpolation in configs
|
|
1567
|
+
- **Antigravity** requires resolved paths (no \`\${VAR}\` syntax)
|
|
1568
|
+
|
|
1569
|
+
When generating Antigravity configs, claude-config automatically resolves all environment variables to their actual values.
|
|
1570
|
+
|
|
1571
|
+
### Project Files
|
|
1572
|
+
|
|
1573
|
+
| Purpose | Claude Code | Antigravity |
|
|
1574
|
+
|---------|-------------|-------------|
|
|
1575
|
+
| Config folder | \`.claude/\` | \`.agent/\` |
|
|
1576
|
+
| Rules | \`.claude/rules/*.md\` | \`.agent/rules/*.md\` |
|
|
1577
|
+
| Instructions | \`CLAUDE.md\` | \`GEMINI.md\` |
|
|
1578
|
+
`},"tool-differences":{title:"Tool Differences",content:`
|
|
1579
|
+
## Tool Differences
|
|
1580
|
+
|
|
1581
|
+
### Configuration Formats
|
|
1582
|
+
|
|
1583
|
+
Both tools use identical JSON format for MCP server definitions:
|
|
1584
|
+
|
|
1585
|
+
\`\`\`json
|
|
1586
|
+
{
|
|
1587
|
+
"mcpServers": {
|
|
1588
|
+
"server-name": {
|
|
1589
|
+
"command": "npx",
|
|
1590
|
+
"args": ["-y", "@some/server"],
|
|
1591
|
+
"env": { "API_KEY": "..." }
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
\`\`\`
|
|
1596
|
+
|
|
1597
|
+
### Feature Comparison
|
|
1598
|
+
|
|
1599
|
+
| Feature | Claude Code | Antigravity |
|
|
1600
|
+
|---------|-------------|-------------|
|
|
1601
|
+
| MCP Config | \`.mcp.json\` | Global config |
|
|
1602
|
+
| Env Interpolation | Yes (\`\${VAR}\`) | No |
|
|
1603
|
+
| Commands | \`.claude/commands/\` | Not supported |
|
|
1604
|
+
| Workflows | \`.claude/workflows/\` | Not supported |
|
|
1605
|
+
| Rules | \`.claude/rules/\` | \`.agent/rules/\` |
|
|
1606
|
+
|
|
1607
|
+
### What This Means
|
|
1608
|
+
|
|
1609
|
+
- Your MCP registry is shared between tools
|
|
1610
|
+
- When you click "Apply Config", both tools get updated
|
|
1611
|
+
- Rules need to be managed separately (sync feature coming soon)
|
|
1612
|
+
`},"enabling-tools":{title:"Enabling Tools",content:`
|
|
1613
|
+
## Enabling Tools
|
|
1614
|
+
|
|
1615
|
+
Control which tools receive configuration updates.
|
|
1616
|
+
|
|
1617
|
+
### Via Preferences UI
|
|
1618
|
+
|
|
1619
|
+
1. Go to **Preferences** in the sidebar
|
|
1620
|
+
2. Find the **Enabled AI Tools** section
|
|
1621
|
+
3. Toggle tools on/off:
|
|
1622
|
+
- **Claude Code** - Writes to \`.mcp.json\`
|
|
1623
|
+
- **Antigravity** - Writes to \`~/.gemini/antigravity/mcp_config.json\`
|
|
1624
|
+
|
|
1625
|
+
### Apply Behavior
|
|
1626
|
+
|
|
1627
|
+
When you click **Apply Config**:
|
|
1628
|
+
- Config is generated for ALL enabled tools
|
|
1629
|
+
- Toast notification shows which tools were updated
|
|
1630
|
+
- Each tool receives its format-specific output
|
|
1631
|
+
|
|
1632
|
+
### Config File
|
|
1633
|
+
|
|
1634
|
+
Tool preferences are stored in \`~/.claude/config.json\`:
|
|
1635
|
+
|
|
1636
|
+
\`\`\`json
|
|
1637
|
+
{
|
|
1638
|
+
"enabledTools": ["claude", "antigravity"]
|
|
1639
|
+
}
|
|
1640
|
+
\`\`\`
|
|
1641
|
+
`},"syncing-rules":{title:"Syncing Rules",content:`
|
|
1642
|
+
## Syncing Rules Between Tools
|
|
1643
|
+
|
|
1644
|
+
When both Claude Code and Antigravity are enabled, you can sync rules between them.
|
|
1645
|
+
|
|
1646
|
+
### Accessing Sync
|
|
1647
|
+
|
|
1648
|
+
1. Enable **both tools** in Preferences
|
|
1649
|
+
2. Go to **Project Explorer**
|
|
1650
|
+
3. Click the **Sync** button in the toolbar
|
|
1651
|
+
|
|
1652
|
+
### Sync Dialog
|
|
1653
|
+
|
|
1654
|
+
The sync dialog allows you to:
|
|
1655
|
+
|
|
1656
|
+
- **Choose direction**: Claude Code → Antigravity or vice versa
|
|
1657
|
+
- **Preview changes**: See which files will be copied
|
|
1658
|
+
- **Selective sync**: Choose specific files to sync
|
|
1659
|
+
- **Status indicators**:
|
|
1660
|
+
- **New**: File doesn't exist in target
|
|
1661
|
+
- **Modified**: File differs from target
|
|
1662
|
+
- **Same**: Files are identical
|
|
1663
|
+
|
|
1664
|
+
### What Gets Synced
|
|
1665
|
+
|
|
1666
|
+
| From | To |
|
|
1667
|
+
|------|-----|
|
|
1668
|
+
| \`.claude/rules/*.md\` | \`.agent/rules/*.md\` |
|
|
1669
|
+
| \`.agent/rules/*.md\` | \`.claude/rules/*.md\` |
|
|
1670
|
+
|
|
1671
|
+
### Notes
|
|
1672
|
+
|
|
1673
|
+
- Syncing **copies** files (doesn't move them)
|
|
1674
|
+
- Target files are **overwritten** if they exist
|
|
1675
|
+
- Instructions files (CLAUDE.md / GEMINI.md) are not synced
|
|
1676
|
+
- Commands and workflows are Claude-specific (not synced)
|
|
1677
|
+
`},keyboard:{title:"Keyboard Shortcuts",content:`
|
|
1678
|
+
## Keyboard Shortcuts
|
|
1679
|
+
|
|
1680
|
+
### File Explorer
|
|
1681
|
+
|
|
1682
|
+
| Shortcut | Action |
|
|
1683
|
+
|----------|--------|
|
|
1684
|
+
| \`Ctrl/Cmd + S\` | Save current file |
|
|
1685
|
+
| \`Delete\` | Delete selected item |
|
|
1686
|
+
| \`Enter\` | Open selected item |
|
|
1687
|
+
|
|
1688
|
+
### Editor
|
|
1689
|
+
|
|
1690
|
+
| Shortcut | Action |
|
|
1691
|
+
|----------|--------|
|
|
1692
|
+
| \`Ctrl/Cmd + S\` | Save file |
|
|
1693
|
+
| \`Ctrl/Cmd + Z\` | Undo |
|
|
1694
|
+
| \`Ctrl/Cmd + Shift + Z\` | Redo |
|
|
1695
|
+
|
|
1696
|
+
### Navigation
|
|
1697
|
+
|
|
1698
|
+
| Shortcut | Action |
|
|
1699
|
+
|----------|--------|
|
|
1700
|
+
| \`Ctrl/Cmd + 1-9\` | Switch sidebar sections |
|
|
1701
|
+
`},"common-issues":{title:"Common Issues",content:`
|
|
1702
|
+
## Common Issues
|
|
1703
|
+
|
|
1704
|
+
### UI won't start
|
|
1705
|
+
|
|
1706
|
+
**Symptom**: \`claude-config ui\` shows "Started daemon" but the UI doesn't open.
|
|
1707
|
+
|
|
1708
|
+
**Solution**:
|
|
1709
|
+
\`\`\`bash
|
|
1710
|
+
claude-config ui stop
|
|
1711
|
+
claude-config ui --foreground
|
|
1712
|
+
\`\`\`
|
|
1713
|
+
|
|
1714
|
+
Check for errors in the output.
|
|
1715
|
+
|
|
1716
|
+
### Port already in use
|
|
1717
|
+
|
|
1718
|
+
**Symptom**: Error about port 3333 being in use.
|
|
1719
|
+
|
|
1720
|
+
**Solution**:
|
|
1721
|
+
\`\`\`bash
|
|
1722
|
+
claude-config ui --port 3334
|
|
1723
|
+
\`\`\`
|
|
1724
|
+
|
|
1725
|
+
Or find and stop the process using port 3333.
|
|
1726
|
+
|
|
1727
|
+
### MCPs not loading
|
|
1728
|
+
|
|
1729
|
+
**Symptom**: MCPs show in config but aren't available in Claude Code.
|
|
1730
|
+
|
|
1731
|
+
**Solution**:
|
|
1732
|
+
1. Run \`claude-config apply\` to regenerate .mcp.json
|
|
1733
|
+
2. Restart Claude Code
|
|
1734
|
+
3. Check environment variables are set
|
|
1735
|
+
|
|
1736
|
+
### npm install fails
|
|
1737
|
+
|
|
1738
|
+
**Symptom**: Errors during \`npm install -g\`
|
|
1739
|
+
|
|
1740
|
+
**Solution**:
|
|
1741
|
+
\`\`\`bash
|
|
1742
|
+
npm cache clean --force
|
|
1743
|
+
npm install -g @regression-io/claude-config
|
|
1744
|
+
\`\`\`
|
|
1745
|
+
`},"getting-help":{title:"Getting Help",content:`
|
|
1746
|
+
## Getting Help
|
|
1747
|
+
|
|
1748
|
+
### Documentation
|
|
1749
|
+
|
|
1750
|
+
This documentation is available in the app under **Docs & Help**.
|
|
1751
|
+
|
|
1752
|
+
### GitHub Issues
|
|
1753
|
+
|
|
1754
|
+
Report bugs and request features:
|
|
1755
|
+
https://github.com/regression-io/claude-config/issues
|
|
1756
|
+
|
|
1757
|
+
### Version Info
|
|
1758
|
+
|
|
1759
|
+
\`\`\`bash
|
|
1760
|
+
claude-config --version
|
|
1761
|
+
\`\`\`
|
|
1762
|
+
|
|
1763
|
+
### Debug Info
|
|
1764
|
+
|
|
1765
|
+
When reporting issues, include:
|
|
1766
|
+
- claude-config version
|
|
1767
|
+
- Node.js version (\`node --version\`)
|
|
1768
|
+
- Operating system
|
|
1769
|
+
- Error messages or logs
|
|
1770
|
+
`}};function YI(){const[e,t]=C.useState("installation"),[s,o]=C.useState({"getting-started":!0}),l=f=>{o(a=>({...a,[f]:!a[f]}))},m=qI[e];return i.jsxs("div",{className:"flex h-full",children:[i.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[i.jsx("div",{className:"p-4 border-b border-border",children:i.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[i.jsx(Kn,{className:"w-5 h-5"}),"Documentation"]})}),i.jsx(ni,{className:"flex-1",children:i.jsx("div",{className:"p-2",children:GI.map(f=>i.jsxs("div",{className:"mb-1",children:[i.jsxs("button",{className:xe("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===f.id||f.subsections.some(a=>a.id===e))&&"bg-accent"),onClick:()=>{f.subsections.length>0?(l(f.id),s[f.id]||t(f.subsections[0].id)):t(f.id)},children:[i.jsx(f.icon,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"flex-1",children:f.title}),f.subsections.length>0&&i.jsx(Bc,{className:xe("w-4 h-4 text-muted-foreground transition-transform",s[f.id]&&"rotate-90")})]}),f.subsections.length>0&&s[f.id]&&i.jsx("div",{className:"ml-6 mt-1 space-y-1",children:f.subsections.map(a=>i.jsx("button",{className:xe("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===a.id&&"bg-accent text-primary font-medium"),onClick:()=>t(a.id),children:a.title},a.id))})]},f.id))})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(ni,{className:"h-full",children:i.jsx("div",{className:"max-w-3xl mx-auto p-8",children:m?i.jsx("div",{className:"prose prose-sm max-w-none",children:i.jsx("div",{dangerouslySetInnerHTML:{__html:XI(m.content)}})}):i.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[i.jsx(Kn,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),i.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}function XI(e){let t=e.replace(/```(\w*)\n([\s\S]*?)```/g,(s,o,l)=>`<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-lg overflow-x-auto my-4"><code class="text-sm">${l.replace(/</g,"<").replace(/>/g,">").trim()}</code></pre>`);return t=t.replace(/(\|[^\n]+\|\n\|[-| :]+\|\n(?:\|[^\n]+\|\n?)+)/g,s=>{const o=s.trim().split(`
|
|
1771
|
+
`);if(o.length<2)return s;const l=o[0].split("|").filter(f=>f.trim()).map(f=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${f.trim()}</th>`).join(""),m=o.slice(2).map(f=>`<tr>${f.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>${l}</tr></thead><tbody>${m}</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,"<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/>")}const JI=[{id:"projects",label:"All Projects",icon:O_,section:"Projects"},{id:"explorer",label:"Project Explorer",icon:Gn,section:"Projects"},{id:"subprojects",label:"Sub-Projects",icon:Nt,section:"Projects",badge:"subprojects"},{id:"registry",label:"MCP Registry",icon:da,section:"Configuration"},{id:"memory",label:"Memory",icon:mc,section:"Configuration"},{id:"claude-settings",label:"Claude Code",icon:ba,section:"Configuration"},{id:"gemini-settings",label:"Gemini CLI",icon:St,section:"Configuration"},{id:"templates",label:"Templates",icon:$c,section:"Tools"},{id:"env",label:"Environment",icon:I_,section:"Tools"},{id:"create-mcp",label:"Create MCP",icon:Ps,section:"Developer"},{id:"preferences",label:"Preferences",icon:H_,section:"System"},{id:"docs",label:"Docs & Help",icon:Kn,section:"Help"}],Qy=(e,t)=>{try{const s=localStorage.getItem(`claude-config-${e}`);return s?JSON.parse(s):t}catch{return t}},QI=(e,t)=>{try{localStorage.setItem(`claude-config-${e}`,JSON.stringify(t))}catch{}};function ZI(){var zt,et;const[e,t]=C.useState(()=>Qy("currentView","explorer")),[s,o]=C.useState(!0),[l,m]=C.useState({dir:"",subprojects:[],hierarchy:[]}),[f,a]=C.useState([]),[c,h]=C.useState({mcpServers:{}}),[g,d]=C.useState([]),[_,S]=C.useState([]),[E,b]=C.useState([]),[v,y]=C.useState(null),[p,x]=C.useState(null),[k,P]=C.useState(!1),[T,R]=C.useState({title:"",type:""}),[j,M]=C.useState(""),[$,F]=C.useState(""),[U,H]=C.useState({}),[Q,V]=C.useState(null),[K,J]=C.useState(null),[W,D]=C.useState(!1),[B,L]=C.useState([]),[z,ee]=C.useState(null),[ne,ce]=C.useState(!1),[de,G]=C.useState(null);C.useEffect(()=>{QI("currentView",e)},[e]);const O=C.useCallback(async()=>{try{const[Ae,De,Fe,He,Pt,ut]=await Promise.all([Se.getProject(),Se.getConfigs(),Se.getRegistry(),Se.getRules(),Se.getCommands(),Se.getTemplates()]);m(Ae),a(De),h(Fe),d(He),S(Pt),b(ut),De.length>0&&!v&&y(De[De.length-1])}catch(Ae){le.error("Failed to load data: "+Ae.message)}finally{o(!1)}},[v]),Z=C.useCallback(async(Ae=!1)=>{var De;try{const Fe=await Se.getProjects();L(Fe.projects||[]);const He=(De=Fe.projects)==null?void 0:De.find(Pt=>Pt.isActive);if(ee(He||null),Ae&&He){const Pt=await Se.getSubprojects(He.path);G({dir:He.path,subprojects:Pt.subprojects||[]})}Ae&&!He&&(Qy("currentView",null)||t("projects"))}catch{console.log("Projects API not available")}},[]),X=async Ae=>{try{const De=await Se.setActiveProject(Ae);De.success?(m({dir:De.dir,hierarchy:De.hierarchy,subprojects:De.subprojects}),G({dir:De.dir,subprojects:De.subprojects}),ee(De.project),L(Fe=>Fe.map(He=>({...He,isActive:He.id===Ae}))),await O(),le.success(`Switched to ${De.project.name}`)):le.error(De.error||"Failed to switch project")}catch(De){le.error("Failed to switch project: "+De.message)}},q=Ae=>{L(De=>[...De,{...Ae,exists:!0,hasClaudeConfig:!1}])};C.useEffect(()=>{O(),Z(!0),Se.checkVersion().then(Ae=>{V(Ae==null?void 0:Ae.installedVersion),Ae!=null&&Ae.updateAvailable&&J(Ae)}).catch(()=>{})},[]);const re=async()=>{if(K!=null&&K.updateAvailable){D(!0);try{const Ae=await Se.performUpdate({updateMethod:K.updateMethod,sourcePath:K.sourcePath});Ae.success?(le.success(`Updated to v${Ae.newVersion}! Reloading...`),setTimeout(()=>window.location.reload(),1500)):(le.error("Update failed: "+Ae.error),D(!1))}catch(Ae){le.error("Update failed: "+Ae.message),D(!1)}}};C.useEffect(()=>{const Ae=async()=>{try{const{hashes:Fe}=await Se.getFileHashes(),He=U;(Object.keys(Fe).some(ut=>He[ut]!==Fe[ut])||Object.keys(He).some(ut=>!Fe[ut]))&&Object.keys(He).length>0&&(le.info("Files changed externally, reloading..."),await O()),H(Fe)}catch{}},De=setInterval(Ae,2e3);return Ae(),()=>clearInterval(De)},[U,O]);const he=new Set;f.forEach(Ae=>{var De,Fe;(((De=Ae.config)==null?void 0:De.include)||[]).forEach(He=>he.add(He)),Object.keys(((Fe=Ae.config)==null?void 0:Fe.mcpServers)||{}).forEach(He=>he.add(He))});const Te={subprojects:((zt=de==null?void 0:de.subprojects)==null?void 0:zt.length)||((et=l.subprojects)==null?void 0:et.length)||0,mcps:he.size,rules:g.length,commands:_.length},Be=async()=>{try{const Ae=await Se.applyConfig(l.dir);if(Ae.tools){const De=Object.entries(Ae.tools).filter(([,Fe])=>Fe).map(([Fe])=>Fe==="claude"?"Claude Code":"Antigravity");De.length>0?le.success(`Config applied to: ${De.join(", ")}`):le.warning("No tools were updated")}else le.success("Configuration applied successfully!")}catch(Ae){le.error("Failed to apply config: "+Ae.message)}},Ke=async()=>{o(!0),await O(),le.success("Data refreshed")};if(s)return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsxs("div",{className:"flex flex-col items-center gap-4",children:[i.jsx(dt,{className:"w-8 h-8 animate-spin text-primary"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading configuration..."})]})});const je=()=>{switch(e){case"explorer":return i.jsx(rI,{project:l,onRefresh:O});case"subprojects":return i.jsx(HI,{project:l,rootProject:de,onRefresh:Ke});case"registry":return i.jsx(WI,{registry:c,searchQuery:j,setSearchQuery:M,onUpdate:O});case"memory":return i.jsx(UI,{project:l,onUpdate:O});case"templates":return i.jsx(CI,{templates:E,project:l,onApply:O});case"env":return i.jsx(SI,{project:l,configs:f});case"create-mcp":return i.jsx(bI,{project:l});case"claude-settings":return i.jsx(fI,{});case"gemini-settings":return i.jsx(pI,{});case"preferences":return i.jsx(hI,{});case"projects":return i.jsx(KI,{onProjectSwitch:Ae=>{m({dir:Ae.dir,hierarchy:Ae.hierarchy,subprojects:Ae.subprojects}),G({dir:Ae.dir,subprojects:Ae.subprojects}),O(),Z()}});case"docs":return i.jsx(YI,{});default:return null}};return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"h-16 bg-card border-b border-border sticky top-0 z-50 shadow-sm",children:i.jsxs("div",{className:"h-full px-6 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.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:i.jsx(yn,{className:"w-5 h-5 text-white"})}),i.jsx("div",{children:i.jsxs("h1",{className:"text-xl font-bold text-foreground",children:["Claude ",i.jsx("span",{className:"text-primary",children:"Config"}),Q&&i.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-2",children:["v",Q]})]})}),K&&i.jsxs("button",{onClick:re,disabled:W,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:[W?i.jsx(dt,{className:"w-3 h-3 animate-spin"}):i.jsx(Fc,{className:"w-3 h-3"}),W?"Updating...":`Update to v${K.sourceVersion}`]})]}),i.jsx(rC,{orientation:"vertical",className:"h-6"}),i.jsx(sI,{projects:B,activeProject:z,onSwitch:X,onAddClick:()=>ce(!0),onManageClick:()=>t("projects")})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(oI,{}),i.jsx(ue,{variant:"ghost",size:"sm",onClick:Ke,children:i.jsx(gr,{className:"w-4 h-4"})}),i.jsxs(ue,{onClick:Be,className:"bg-indigo-600 hover:bg-indigo-700 text-white gap-2 shadow-md",children:[i.jsx(WT,{className:"w-4 h-4"}),"Apply Config"]})]})]})}),i.jsxs("div",{className:"flex",children:[i.jsx("aside",{className:"w-64 h-[calc(100vh-64px)] border-r border-border bg-card sticky top-16",children:i.jsx(ni,{className:"h-full py-4",children:["Projects","Configuration","Tools","Developer","System","Help"].map(Ae=>i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"px-4 mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:Ae}),i.jsx("div",{className:"space-y-0.5",children:JI.filter(De=>De.section===Ae).filter(De=>{const Fe=(de==null?void 0:de.subprojects)||l.subprojects;return!(De.id==="subprojects"&&(!Fe||Fe.length===0))}).map(De=>{const Fe=De.icon,He=e===De.id;return i.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 ${He?"bg-accent border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:[i.jsx(Fe,{className:"w-4 h-4"}),i.jsx("span",{className:"flex-1 text-left",children:De.label}),De.badge&&i.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${He?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:Te[De.badge]})]},De.id)})})]},Ae))})}),i.jsx("main",{className:xe("flex-1 overflow-auto",e==="explorer"||e==="docs"?"h-[calc(100vh-64px)]":"p-6"),children:i.jsx(bf,{mode:"wait",children:i.jsx(Ds.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:e==="explorer"||e==="docs"?"h-full":"",children:je()},e)})})]}),i.jsx(Q1,{open:ne,onOpenChange:ce,onAdded:q})]})}function e6(){return i.jsx(nI,{children:i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(ZI,{}),i.jsx(iE,{position:"bottom-right",richColors:!0})]})})}A2.createRoot(document.getElementById("root")).render(i.jsx(e6,{}));
|