@agi-cli/web-ui 0.1.106 → 0.1.107
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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
`+Y[m].replace(" at new "," at ");return r.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",r.displayName)),de}while(1<=m&&0<=w);break}}}finally{He=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?ze(c):""}function Ee(r,a){switch(r.tag){case 26:case 27:case 5:return ze(r.type);case 16:return ze("Lazy");case 13:return r.child!==a&&a!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return De(r.type,!1);case 11:return De(r.type.render,!1);case 1:return De(r.type,!0);case 31:return ze("Activity");default:return""}}function wt(r){try{var a="",c=null;do a+=Ee(r,c),c=r,r=r.return;while(r);return a}catch(m){return`
|
|
7
7
|
Error generating stack: `+m.message+`
|
|
8
8
|
`+m.stack}}var Mt=Object.prototype.hasOwnProperty,ft=e.unstable_scheduleCallback,Vt=e.unstable_cancelCallback,Bt=e.unstable_shouldYield,Ne=e.unstable_requestPaint,Oe=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,ve=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,pt=e.log,Fe=e.unstable_setDisableYieldValue,mt=null,at=null;function dt(r){if(typeof pt=="function"&&Fe(r),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(mt,r)}catch{}}var Je=Math.clz32?Math.clz32:On,nn=Math.log,Wt=Math.LN2;function On(r){return r>>>=0,r===0?32:31-(nn(r)/Wt|0)|0}var gt=256,Qn=262144,ra=4194304;function Jn(r){var a=r&42;if(a!==0)return a;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function _i(r,a,c){var m=r.pendingLanes;if(m===0)return 0;var w=0,k=r.suspendedLanes,M=r.pingedLanes;r=r.warmLanes;var q=m&134217727;return q!==0?(m=q&~k,m!==0?w=Jn(m):(M&=q,M!==0?w=Jn(M):c||(c=q&~r,c!==0&&(w=Jn(c))))):(q=m&~k,q!==0?w=Jn(q):M!==0?w=Jn(M):c||(c=m&~r,c!==0&&(w=Jn(c)))),w===0?0:a!==0&&a!==w&&(a&k)===0&&(k=w&-w,c=a&-a,k>=c||k===32&&(c&4194048)!==0)?a:w}function Br(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function ss(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function M_(){var r=ra;return ra<<=1,(ra&62914560)===0&&(ra=4194304),r}function su(r){for(var a=[],c=0;31>c;c++)a.push(r);return a}function os(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function qL(r,a,c,m,w,k){var M=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var q=r.entanglements,Y=r.expirationTimes,re=r.hiddenUpdates;for(c=M&~c;0<c;){var de=31-Je(c),pe=1<<de;q[de]=0,Y[de]=-1;var ae=re[de];if(ae!==null)for(re[de]=null,de=0;de<ae.length;de++){var oe=ae[de];oe!==null&&(oe.lane&=-536870913)}c&=~pe}m!==0&&B_(r,m,0),k!==0&&w===0&&r.tag!==0&&(r.suspendedLanes|=k&~(M&~a))}function B_(r,a,c){r.pendingLanes|=a,r.suspendedLanes&=~a;var m=31-Je(a);r.entangledLanes|=a,r.entanglements[m]=r.entanglements[m]|1073741824|c&261930}function F_(r,a){var c=r.entangledLanes|=a;for(r=r.entanglements;c;){var m=31-Je(c),w=1<<m;w&a|r[m]&a&&(r[m]|=a),c&=~w}}function P_(r,a){var c=a&-a;return c=(c&42)!==0?1:ou(c),(c&(r.suspendedLanes|a))!==0?0:c}function ou(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function lu(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function U_(){var r=Z.p;return r!==0?r:(r=window.event,r===void 0?32:wx(r.type))}function j_(r,a){var c=Z.p;try{return Z.p=r,a()}finally{Z.p=c}}var Fr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Fr,rn="__reactProps$"+Fr,ia="__reactContainer$"+Fr,cu="__reactEvents$"+Fr,$L="__reactListeners$"+Fr,GL="__reactHandles$"+Fr,z_="__reactResources$"+Fr,ls="__reactMarker$"+Fr;function uu(r){delete r[Ut],delete r[rn],delete r[cu],delete r[$L],delete r[GL]}function aa(r){var a=r[Ut];if(a)return a;for(var c=r.parentNode;c;){if(a=c[ia]||c[Ut]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(r=lx(r);r!==null;){if(c=r[Ut])return c;r=lx(r)}return a}r=c,c=r.parentNode}return null}function sa(r){if(r=r[Ut]||r[ia]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function cs(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function oa(r){var a=r[z_];return a||(a=r[z_]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ft(r){r[ls]=!0}var H_=new Set,q_={};function Si(r,a){la(r,a),la(r+"Capture",a)}function la(r,a){for(q_[r]=a,r=0;r<a.length;r++)H_.add(a[r])}var VL=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$_={},G_={};function WL(r){return Mt.call(G_,r)?!0:Mt.call($_,r)?!1:VL.test(r)?G_[r]=!0:($_[r]=!0,!1)}function Do(r,a,c){if(WL(a))if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var m=a.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+c)}}function Mo(r,a,c){if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+c)}}function fr(r,a,c,m){if(m===null)r.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(a,c,""+m)}}function In(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function V_(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function KL(r,a,c){var m=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var w=m.get,k=m.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return w.call(this)},set:function(M){c=""+M,k.call(this,M)}}),Object.defineProperty(r,a,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(M){c=""+M},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function du(r){if(!r._valueTracker){var a=V_(r)?"checked":"value";r._valueTracker=KL(r,a,""+r[a])}}function W_(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var c=a.getValue(),m="";return r&&(m=V_(r)?r.checked?"true":"false":r.value),r=m,r!==c?(a.setValue(r),!0):!1}function Bo(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}}var YL=/[\n"\\]/g;function Ln(r){return r.replace(YL,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function hu(r,a,c,m,w,k,M,q){r.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?r.type=M:r.removeAttribute("type"),a!=null?M==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+In(a)):r.value!==""+In(a)&&(r.value=""+In(a)):M!=="submit"&&M!=="reset"||r.removeAttribute("value"),a!=null?fu(r,M,In(a)):c!=null?fu(r,M,In(c)):m!=null&&r.removeAttribute("value"),w==null&&k!=null&&(r.defaultChecked=!!k),w!=null&&(r.checked=w&&typeof w!="function"&&typeof w!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?r.name=""+In(q):r.removeAttribute("name")}function K_(r,a,c,m,w,k,M,q){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.type=k),a!=null||c!=null){if(!(k!=="submit"&&k!=="reset"||a!=null)){du(r);return}c=c!=null?""+In(c):"",a=a!=null?""+In(a):c,q||a===r.value||(r.value=a),r.defaultValue=a}m=m??w,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=q?r.checked:!!m,r.defaultChecked=!!m,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(r.name=M),du(r)}function fu(r,a,c){a==="number"&&Bo(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function ca(r,a,c,m){if(r=r.options,a){a={};for(var w=0;w<c.length;w++)a["$"+c[w]]=!0;for(c=0;c<r.length;c++)w=a.hasOwnProperty("$"+r[c].value),r[c].selected!==w&&(r[c].selected=w),w&&m&&(r[c].defaultSelected=!0)}else{for(c=""+In(c),a=null,w=0;w<r.length;w++){if(r[w].value===c){r[w].selected=!0,m&&(r[w].defaultSelected=!0);return}a!==null||r[w].disabled||(a=r[w])}a!==null&&(a.selected=!0)}}function Y_(r,a,c){if(a!=null&&(a=""+In(a),a!==r.value&&(r.value=a),c==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=c!=null?""+In(c):""}function X_(r,a,c,m){if(a==null){if(m!=null){if(c!=null)throw Error(i(92));if(V(m)){if(1<m.length)throw Error(i(93));m=m[0]}c=m}c==null&&(c=""),a=c}c=In(a),r.defaultValue=c,m=r.textContent,m===c&&m!==""&&m!==null&&(r.value=m),du(r)}function ua(r,a){if(a){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=a;return}}r.textContent=a}var XL=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Z_(r,a,c){var m=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":m?r.setProperty(a,c):typeof c!="number"||c===0||XL.has(a)?a==="float"?r.cssFloat=c:r[a]=(""+c).trim():r[a]=c+"px"}function Q_(r,a,c){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||a!=null&&a.hasOwnProperty(m)||(m.indexOf("--")===0?r.setProperty(m,""):m==="float"?r.cssFloat="":r[m]="");for(var w in a)m=a[w],a.hasOwnProperty(w)&&c[w]!==m&&Z_(r,w,m)}else for(var k in a)a.hasOwnProperty(k)&&Z_(r,k,a[k])}function pu(r){if(r.indexOf("-")===-1)return!1;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 ZL=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),QL=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Fo(r){return QL.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function pr(){}var mu=null;function gu(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var da=null,ha=null;function J_(r){var a=sa(r);if(a&&(r=a.stateNode)){var c=r[rn]||null;e:switch(r=a.stateNode,a.type){case"input":if(hu(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ln(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var m=c[a];if(m!==r&&m.form===r.form){var w=m[rn]||null;if(!w)throw Error(i(90));hu(m,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(a=0;a<c.length;a++)m=c[a],m.form===r.form&&W_(m)}break e;case"textarea":Y_(r,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&ca(r,!!c.multiple,a,!1)}}}var bu=!1;function eS(r,a,c){if(bu)return r(a,c);bu=!0;try{var m=r(a);return m}finally{if(bu=!1,(da!==null||ha!==null)&&(wl(),da&&(a=da,r=ha,ha=da=null,J_(a),r)))for(a=0;a<r.length;a++)J_(r[a])}}function us(r,a){var c=r.stateNode;if(c===null)return null;var m=c[rn]||null;if(m===null)return null;c=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(i(231,a,typeof c));return c}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=!1;if(mr)try{var ds={};Object.defineProperty(ds,"passive",{get:function(){yu=!0}}),window.addEventListener("test",ds,ds),window.removeEventListener("test",ds,ds)}catch{yu=!1}var Pr=null,vu=null,Po=null;function tS(){if(Po)return Po;var r,a=vu,c=a.length,m,w="value"in Pr?Pr.value:Pr.textContent,k=w.length;for(r=0;r<c&&a[r]===w[r];r++);var M=c-r;for(m=1;m<=M&&a[c-m]===w[k-m];m++);return Po=w.slice(r,1<m?1-m:void 0)}function Uo(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function jo(){return!0}function nS(){return!1}function an(r){function a(c,m,w,k,M){this._reactName=c,this._targetInst=w,this.type=m,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var q in r)r.hasOwnProperty(q)&&(c=r[q],this[q]=c?c(k):k[q]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?jo:nS,this.isPropagationStopped=nS,this}return f(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=jo)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=jo)},persist:function(){},isPersistent:jo}),a}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zo=an(Ei),hs=f({},Ei,{view:0,detail:0}),JL=an(hs),_u,Su,fs,Ho=f({},hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xu,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!==fs&&(fs&&r.type==="mousemove"?(_u=r.screenX-fs.screenX,Su=r.screenY-fs.screenY):Su=_u=0,fs=r),_u)},movementY:function(r){return"movementY"in r?r.movementY:Su}}),rS=an(Ho),eD=f({},Ho,{dataTransfer:0}),tD=an(eD),nD=f({},hs,{relatedTarget:0}),Eu=an(nD),rD=f({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),iD=an(rD),aD=f({},Ei,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),sD=an(aD),oD=f({},Ei,{data:0}),iS=an(oD),lD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cD={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"},uD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dD(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=uD[r])?!!a[r]:!1}function xu(){return dD}var hD=f({},hs,{key:function(r){if(r.key){var a=lD[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Uo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?cD[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xu,charCode:function(r){return r.type==="keypress"?Uo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Uo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),fD=an(hD),pD=f({},Ho,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aS=an(pD),mD=f({},hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xu}),gD=an(mD),bD=f({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),yD=an(bD),vD=f({},Ho,{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}),_D=an(vD),SD=f({},Ei,{newState:0,oldState:0}),ED=an(SD),xD=[9,13,27,32],wu=mr&&"CompositionEvent"in window,ps=null;mr&&"documentMode"in document&&(ps=document.documentMode);var wD=mr&&"TextEvent"in window&&!ps,sS=mr&&(!wu||ps&&8<ps&&11>=ps),oS=" ",lS=!1;function cS(r,a){switch(r){case"keyup":return xD.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uS(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var fa=!1;function CD(r,a){switch(r){case"compositionend":return uS(a);case"keypress":return a.which!==32?null:(lS=!0,oS);case"textInput":return r=a.data,r===oS&&lS?null:r;default:return null}}function TD(r,a){if(fa)return r==="compositionend"||!wu&&cS(r,a)?(r=tS(),Po=vu=Pr=null,fa=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return sS&&a.locale!=="ko"?null:a.data;default:return null}}var AD={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 dS(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!AD[r.type]:a==="textarea"}function hS(r,a,c,m){da?ha?ha.push(m):ha=[m]:da=m,a=Ol(a,"onChange"),0<a.length&&(c=new zo("onChange","change",null,c,m),r.push({event:c,listeners:a}))}var ms=null,gs=null;function kD(r){K0(r,0)}function qo(r){var a=cs(r);if(W_(a))return r}function fS(r,a){if(r==="change")return a}var pS=!1;if(mr){var Cu;if(mr){var Tu="oninput"in document;if(!Tu){var mS=document.createElement("div");mS.setAttribute("oninput","return;"),Tu=typeof mS.oninput=="function"}Cu=Tu}else Cu=!1;pS=Cu&&(!document.documentMode||9<document.documentMode)}function gS(){ms&&(ms.detachEvent("onpropertychange",bS),gs=ms=null)}function bS(r){if(r.propertyName==="value"&&qo(gs)){var a=[];hS(a,gs,r,gu(r)),eS(kD,a)}}function RD(r,a,c){r==="focusin"?(gS(),ms=a,gs=c,ms.attachEvent("onpropertychange",bS)):r==="focusout"&&gS()}function ND(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return qo(gs)}function OD(r,a){if(r==="click")return qo(a)}function ID(r,a){if(r==="input"||r==="change")return qo(a)}function LD(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var yn=typeof Object.is=="function"?Object.is:LD;function bs(r,a){if(yn(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var c=Object.keys(r),m=Object.keys(a);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var w=c[m];if(!Mt.call(a,w)||!yn(r[w],a[w]))return!1}return!0}function yS(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function vS(r,a){var c=yS(r);r=0;for(var m;c;){if(c.nodeType===3){if(m=r+c.textContent.length,r<=a&&m>=a)return{node:c,offset:a-r};r=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=yS(c)}}function _S(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?_S(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function SS(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Bo(r.document);a instanceof r.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)r=a.contentWindow;else break;a=Bo(r.document)}return a}function Au(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var DD=mr&&"documentMode"in document&&11>=document.documentMode,pa=null,ku=null,ys=null,Ru=!1;function ES(r,a,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ru||pa==null||pa!==Bo(m)||(m=pa,"selectionStart"in m&&Au(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),ys&&bs(ys,m)||(ys=m,m=Ol(ku,"onSelect"),0<m.length&&(a=new zo("onSelect","select",null,a,c),r.push({event:a,listeners:m}),a.target=pa)))}function xi(r,a){var c={};return c[r.toLowerCase()]=a.toLowerCase(),c["Webkit"+r]="webkit"+a,c["Moz"+r]="moz"+a,c}var ma={animationend:xi("Animation","AnimationEnd"),animationiteration:xi("Animation","AnimationIteration"),animationstart:xi("Animation","AnimationStart"),transitionrun:xi("Transition","TransitionRun"),transitionstart:xi("Transition","TransitionStart"),transitioncancel:xi("Transition","TransitionCancel"),transitionend:xi("Transition","TransitionEnd")},Nu={},xS={};mr&&(xS=document.createElement("div").style,"AnimationEvent"in window||(delete ma.animationend.animation,delete ma.animationiteration.animation,delete ma.animationstart.animation),"TransitionEvent"in window||delete ma.transitionend.transition);function wi(r){if(Nu[r])return Nu[r];if(!ma[r])return r;var a=ma[r],c;for(c in a)if(a.hasOwnProperty(c)&&c in xS)return Nu[r]=a[c];return r}var wS=wi("animationend"),CS=wi("animationiteration"),TS=wi("animationstart"),MD=wi("transitionrun"),BD=wi("transitionstart"),FD=wi("transitioncancel"),AS=wi("transitionend"),kS=new Map,Ou="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ou.push("scrollEnd");function Vn(r,a){kS.set(r,a),Si(a,[r])}var $o=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Dn=[],ga=0,Iu=0;function Go(){for(var r=ga,a=Iu=ga=0;a<r;){var c=Dn[a];Dn[a++]=null;var m=Dn[a];Dn[a++]=null;var w=Dn[a];Dn[a++]=null;var k=Dn[a];if(Dn[a++]=null,m!==null&&w!==null){var M=m.pending;M===null?w.next=w:(w.next=M.next,M.next=w),m.pending=w}k!==0&&RS(c,w,k)}}function Vo(r,a,c,m){Dn[ga++]=r,Dn[ga++]=a,Dn[ga++]=c,Dn[ga++]=m,Iu|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function Lu(r,a,c,m){return Vo(r,a,c,m),Wo(r)}function Ci(r,a){return Vo(r,null,null,a),Wo(r)}function RS(r,a,c){r.lanes|=c;var m=r.alternate;m!==null&&(m.lanes|=c);for(var w=!1,k=r.return;k!==null;)k.childLanes|=c,m=k.alternate,m!==null&&(m.childLanes|=c),k.tag===22&&(r=k.stateNode,r===null||r._visibility&1||(w=!0)),r=k,k=k.return;return r.tag===3?(k=r.stateNode,w&&a!==null&&(w=31-Je(c),r=k.hiddenUpdates,m=r[w],m===null?r[w]=[a]:m.push(a),a.lane=c|536870912),k):null}function Wo(r){if(50<js)throw js=0,Hd=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var ba={};function PD(r,a,c,m){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(r,a,c,m){return new PD(r,a,c,m)}function Du(r){return r=r.prototype,!(!r||!r.isReactComponent)}function gr(r,a){var c=r.alternate;return c===null?(c=vn(r.tag,a,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=a,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,a=r.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function NS(r,a){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,a=c.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Ko(r,a,c,m,w,k){var M=0;if(m=r,typeof r=="function")Du(r)&&(M=1);else if(typeof r=="string")M=q2(r,c,ee.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case I:return r=vn(31,c,a,w),r.elementType=I,r.lanes=k,r;case E:return Ti(c.children,w,k,a);case y:M=8,w|=24;break;case S:return r=vn(12,c,a,w|2),r.elementType=S,r.lanes=k,r;case N:return r=vn(13,c,a,w),r.elementType=N,r.lanes=k,r;case A:return r=vn(19,c,a,w),r.elementType=A,r.lanes=k,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _:M=10;break e;case v:M=9;break e;case C:M=11;break e;case O:M=14;break e;case R:M=16,m=null;break e}M=29,c=Error(i(130,r===null?"null":typeof r,"")),m=null}return a=vn(M,c,a,w),a.elementType=r,a.type=m,a.lanes=k,a}function Ti(r,a,c,m){return r=vn(7,r,m,a),r.lanes=c,r}function Mu(r,a,c){return r=vn(6,r,null,a),r.lanes=c,r}function OS(r){var a=vn(18,null,null,0);return a.stateNode=r,a}function Bu(r,a,c){return a=vn(4,r.children!==null?r.children:[],r.key,a),a.lanes=c,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var IS=new WeakMap;function Mn(r,a){if(typeof r=="object"&&r!==null){var c=IS.get(r);return c!==void 0?c:(a={value:r,source:a,stack:wt(a)},IS.set(r,a),a)}return{value:r,source:a,stack:wt(a)}}var ya=[],va=0,Yo=null,vs=0,Bn=[],Fn=0,Ur=null,er=1,tr="";function br(r,a){ya[va++]=vs,ya[va++]=Yo,Yo=r,vs=a}function LS(r,a,c){Bn[Fn++]=er,Bn[Fn++]=tr,Bn[Fn++]=Ur,Ur=r;var m=er;r=tr;var w=32-Je(m)-1;m&=~(1<<w),c+=1;var k=32-Je(a)+w;if(30<k){var M=w-w%5;k=(m&(1<<M)-1).toString(32),m>>=M,w-=M,er=1<<32-Je(a)+w|c<<w|m,tr=k+r}else er=1<<k|c<<w|m,tr=r}function Fu(r){r.return!==null&&(br(r,1),LS(r,1,0))}function Pu(r){for(;r===Yo;)Yo=ya[--va],ya[va]=null,vs=ya[--va],ya[va]=null;for(;r===Ur;)Ur=Bn[--Fn],Bn[Fn]=null,tr=Bn[--Fn],Bn[Fn]=null,er=Bn[--Fn],Bn[Fn]=null}function DS(r,a){Bn[Fn++]=er,Bn[Fn++]=tr,Bn[Fn++]=Ur,er=a.id,tr=a.overflow,Ur=r}var jt=null,ct=null,Ke=!1,jr=null,Pn=!1,Uu=Error(i(519));function zr(r){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _s(Mn(a,r)),Uu}function MS(r){var a=r.stateNode,c=r.type,m=r.memoizedProps;switch(a[Ut]=r,a[rn]=m,c){case"dialog":$e("cancel",a),$e("close",a);break;case"iframe":case"object":case"embed":$e("load",a);break;case"video":case"audio":for(c=0;c<Hs.length;c++)$e(Hs[c],a);break;case"source":$e("error",a);break;case"img":case"image":case"link":$e("error",a),$e("load",a);break;case"details":$e("toggle",a);break;case"input":$e("invalid",a),K_(a,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":$e("invalid",a);break;case"textarea":$e("invalid",a),X_(a,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||m.suppressHydrationWarning===!0||Q0(a.textContent,c)?(m.popover!=null&&($e("beforetoggle",a),$e("toggle",a)),m.onScroll!=null&&$e("scroll",a),m.onScrollEnd!=null&&$e("scrollend",a),m.onClick!=null&&(a.onclick=pr),a=!0):a=!1,a||zr(r,!0)}function BS(r){for(jt=r.return;jt;)switch(jt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:jt=jt.return}}function _a(r){if(r!==jt)return!1;if(!Ke)return BS(r),Ke=!0,!1;var a=r.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||rh(r.type,r.memoizedProps)),c=!c),c&&ct&&zr(r),BS(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));ct=ox(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));ct=ox(r)}else a===27?(a=ct,ti(r.type)?(r=lh,lh=null,ct=r):ct=a):ct=jt?jn(r.stateNode.nextSibling):null;return!0}function Ai(){ct=jt=null,Ke=!1}function ju(){var r=jr;return r!==null&&(cn===null?cn=r:cn.push.apply(cn,r),jr=null),r}function _s(r){jr===null?jr=[r]:jr.push(r)}var zu=B(null),ki=null,yr=null;function Hr(r,a,c){U(zu,a._currentValue),a._currentValue=c}function vr(r){r._currentValue=zu.current,H(zu)}function Hu(r,a,c){for(;r!==null;){var m=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),r===c)break;r=r.return}}function qu(r,a,c,m){var w=r.child;for(w!==null&&(w.return=r);w!==null;){var k=w.dependencies;if(k!==null){var M=w.child;k=k.firstContext;e:for(;k!==null;){var q=k;k=w;for(var Y=0;Y<a.length;Y++)if(q.context===a[Y]){k.lanes|=c,q=k.alternate,q!==null&&(q.lanes|=c),Hu(k.return,c,r),m||(M=null);break e}k=q.next}}else if(w.tag===18){if(M=w.return,M===null)throw Error(i(341));M.lanes|=c,k=M.alternate,k!==null&&(k.lanes|=c),Hu(M,c,r),M=null}else M=w.child;if(M!==null)M.return=w;else for(M=w;M!==null;){if(M===r){M=null;break}if(w=M.sibling,w!==null){w.return=M.return,M=w;break}M=M.return}w=M}}function Sa(r,a,c,m){r=null;for(var w=a,k=!1;w!==null;){if(!k){if((w.flags&524288)!==0)k=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var M=w.alternate;if(M===null)throw Error(i(387));if(M=M.memoizedProps,M!==null){var q=w.type;yn(w.pendingProps.value,M.value)||(r!==null?r.push(q):r=[q])}}else if(w===X.current){if(M=w.alternate,M===null)throw Error(i(387));M.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(r!==null?r.push(Ws):r=[Ws])}w=w.return}r!==null&&qu(a,r,c,m),a.flags|=262144}function Xo(r){for(r=r.firstContext;r!==null;){if(!yn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ri(r){ki=r,yr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function zt(r){return FS(ki,r)}function Zo(r,a){return ki===null&&Ri(r),FS(r,a)}function FS(r,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},yr===null){if(r===null)throw Error(i(308));yr=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else yr=yr.next=a;return c}var UD=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(c,m){r.push(m)}};this.abort=function(){a.aborted=!0,r.forEach(function(c){return c()})}},jD=e.unstable_scheduleCallback,zD=e.unstable_NormalPriority,Ct={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $u(){return{controller:new UD,data:new Map,refCount:0}}function Ss(r){r.refCount--,r.refCount===0&&jD(zD,function(){r.controller.abort()})}var Es=null,Gu=0,Ea=0,xa=null;function HD(r,a){if(Es===null){var c=Es=[];Gu=0,Ea=Kd(),xa={status:"pending",value:void 0,then:function(m){c.push(m)}}}return Gu++,a.then(PS,PS),a}function PS(){if(--Gu===0&&Es!==null){xa!==null&&(xa.status="fulfilled");var r=Es;Es=null,Ea=0,xa=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function qD(r,a){var c=[],m={status:"pending",value:null,reason:null,then:function(w){c.push(w)}};return r.then(function(){m.status="fulfilled",m.value=a;for(var w=0;w<c.length;w++)(0,c[w])(a)},function(w){for(m.status="rejected",m.reason=w,w=0;w<c.length;w++)(0,c[w])(void 0)}),m}var US=W.S;W.S=function(r,a){E0=Oe(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&HD(r,a),US!==null&&US(r,a)};var Ni=B(null);function Vu(){var r=Ni.current;return r!==null?r:st.pooledCache}function Qo(r,a){a===null?U(Ni,Ni.current):U(Ni,a.pool)}function jS(){var r=Vu();return r===null?null:{parent:Ct._currentValue,pool:r}}var wa=Error(i(460)),Wu=Error(i(474)),Jo=Error(i(542)),el={then:function(){}};function zS(r){return r=r.status,r==="fulfilled"||r==="rejected"}function HS(r,a,c){switch(c=r[c],c===void 0?r.push(a):c!==a&&(a.then(pr,pr),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,$S(r),r;default:if(typeof a.status=="string")a.then(pr,pr);else{if(r=st,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=a,r.status="pending",r.then(function(m){if(a.status==="pending"){var w=a;w.status="fulfilled",w.value=m}},function(m){if(a.status==="pending"){var w=a;w.status="rejected",w.reason=m}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,$S(r),r}throw Ii=a,wa}}function Oi(r){try{var a=r._init;return a(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ii=c,wa):c}}var Ii=null;function qS(){if(Ii===null)throw Error(i(459));var r=Ii;return Ii=null,r}function $S(r){if(r===wa||r===Jo)throw Error(i(483))}var Ca=null,xs=0;function tl(r){var a=xs;return xs+=1,Ca===null&&(Ca=[]),HS(Ca,r,a)}function ws(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function nl(r,a){throw a.$$typeof===g?Error(i(525)):(r=Object.prototype.toString.call(a),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function GS(r){function a(te,Q){if(r){var ne=te.deletions;ne===null?(te.deletions=[Q],te.flags|=16):ne.push(Q)}}function c(te,Q){if(!r)return null;for(;Q!==null;)a(te,Q),Q=Q.sibling;return null}function m(te){for(var Q=new Map;te!==null;)te.key!==null?Q.set(te.key,te):Q.set(te.index,te),te=te.sibling;return Q}function w(te,Q){return te=gr(te,Q),te.index=0,te.sibling=null,te}function k(te,Q,ne){return te.index=ne,r?(ne=te.alternate,ne!==null?(ne=ne.index,ne<Q?(te.flags|=67108866,Q):ne):(te.flags|=67108866,Q)):(te.flags|=1048576,Q)}function M(te){return r&&te.alternate===null&&(te.flags|=67108866),te}function q(te,Q,ne,fe){return Q===null||Q.tag!==6?(Q=Mu(ne,te.mode,fe),Q.return=te,Q):(Q=w(Q,ne),Q.return=te,Q)}function Y(te,Q,ne,fe){var we=ne.type;return we===E?de(te,Q,ne.props.children,fe,ne.key):Q!==null&&(Q.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===R&&Oi(we)===Q.type)?(Q=w(Q,ne.props),ws(Q,ne),Q.return=te,Q):(Q=Ko(ne.type,ne.key,ne.props,null,te.mode,fe),ws(Q,ne),Q.return=te,Q)}function re(te,Q,ne,fe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=Bu(ne,te.mode,fe),Q.return=te,Q):(Q=w(Q,ne.children||[]),Q.return=te,Q)}function de(te,Q,ne,fe,we){return Q===null||Q.tag!==7?(Q=Ti(ne,te.mode,fe,we),Q.return=te,Q):(Q=w(Q,ne),Q.return=te,Q)}function pe(te,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Mu(""+Q,te.mode,ne),Q.return=te,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return ne=Ko(Q.type,Q.key,Q.props,null,te.mode,ne),ws(ne,Q),ne.return=te,ne;case x:return Q=Bu(Q,te.mode,ne),Q.return=te,Q;case R:return Q=Oi(Q),pe(te,Q,ne)}if(V(Q)||j(Q))return Q=Ti(Q,te.mode,ne,null),Q.return=te,Q;if(typeof Q.then=="function")return pe(te,tl(Q),ne);if(Q.$$typeof===_)return pe(te,Zo(te,Q),ne);nl(te,Q)}return null}function ae(te,Q,ne,fe){var we=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return we!==null?null:q(te,Q,""+ne,fe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return ne.key===we?Y(te,Q,ne,fe):null;case x:return ne.key===we?re(te,Q,ne,fe):null;case R:return ne=Oi(ne),ae(te,Q,ne,fe)}if(V(ne)||j(ne))return we!==null?null:de(te,Q,ne,fe,null);if(typeof ne.then=="function")return ae(te,Q,tl(ne),fe);if(ne.$$typeof===_)return ae(te,Q,Zo(te,ne),fe);nl(te,ne)}return null}function oe(te,Q,ne,fe,we){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return te=te.get(ne)||null,q(Q,te,""+fe,we);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case b:return te=te.get(fe.key===null?ne:fe.key)||null,Y(Q,te,fe,we);case x:return te=te.get(fe.key===null?ne:fe.key)||null,re(Q,te,fe,we);case R:return fe=Oi(fe),oe(te,Q,ne,fe,we)}if(V(fe)||j(fe))return te=te.get(ne)||null,de(Q,te,fe,we,null);if(typeof fe.then=="function")return oe(te,Q,ne,tl(fe),we);if(fe.$$typeof===_)return oe(te,Q,ne,Zo(Q,fe),we);nl(Q,fe)}return null}function _e(te,Q,ne,fe){for(var we=null,Xe=null,Se=Q,Pe=Q=0,We=null;Se!==null&&Pe<ne.length;Pe++){Se.index>Pe?(We=Se,Se=null):We=Se.sibling;var Ze=ae(te,Se,ne[Pe],fe);if(Ze===null){Se===null&&(Se=We);break}r&&Se&&Ze.alternate===null&&a(te,Se),Q=k(Ze,Q,Pe),Xe===null?we=Ze:Xe.sibling=Ze,Xe=Ze,Se=We}if(Pe===ne.length)return c(te,Se),Ke&&br(te,Pe),we;if(Se===null){for(;Pe<ne.length;Pe++)Se=pe(te,ne[Pe],fe),Se!==null&&(Q=k(Se,Q,Pe),Xe===null?we=Se:Xe.sibling=Se,Xe=Se);return Ke&&br(te,Pe),we}for(Se=m(Se);Pe<ne.length;Pe++)We=oe(Se,te,Pe,ne[Pe],fe),We!==null&&(r&&We.alternate!==null&&Se.delete(We.key===null?Pe:We.key),Q=k(We,Q,Pe),Xe===null?we=We:Xe.sibling=We,Xe=We);return r&&Se.forEach(function(si){return a(te,si)}),Ke&&br(te,Pe),we}function ke(te,Q,ne,fe){if(ne==null)throw Error(i(151));for(var we=null,Xe=null,Se=Q,Pe=Q=0,We=null,Ze=ne.next();Se!==null&&!Ze.done;Pe++,Ze=ne.next()){Se.index>Pe?(We=Se,Se=null):We=Se.sibling;var si=ae(te,Se,Ze.value,fe);if(si===null){Se===null&&(Se=We);break}r&&Se&&si.alternate===null&&a(te,Se),Q=k(si,Q,Pe),Xe===null?we=si:Xe.sibling=si,Xe=si,Se=We}if(Ze.done)return c(te,Se),Ke&&br(te,Pe),we;if(Se===null){for(;!Ze.done;Pe++,Ze=ne.next())Ze=pe(te,Ze.value,fe),Ze!==null&&(Q=k(Ze,Q,Pe),Xe===null?we=Ze:Xe.sibling=Ze,Xe=Ze);return Ke&&br(te,Pe),we}for(Se=m(Se);!Ze.done;Pe++,Ze=ne.next())Ze=oe(Se,te,Pe,Ze.value,fe),Ze!==null&&(r&&Ze.alternate!==null&&Se.delete(Ze.key===null?Pe:Ze.key),Q=k(Ze,Q,Pe),Xe===null?we=Ze:Xe.sibling=Ze,Xe=Ze);return r&&Se.forEach(function(eM){return a(te,eM)}),Ke&&br(te,Pe),we}function it(te,Q,ne,fe){if(typeof ne=="object"&&ne!==null&&ne.type===E&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:e:{for(var we=ne.key;Q!==null;){if(Q.key===we){if(we=ne.type,we===E){if(Q.tag===7){c(te,Q.sibling),fe=w(Q,ne.props.children),fe.return=te,te=fe;break e}}else if(Q.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===R&&Oi(we)===Q.type){c(te,Q.sibling),fe=w(Q,ne.props),ws(fe,ne),fe.return=te,te=fe;break e}c(te,Q);break}else a(te,Q);Q=Q.sibling}ne.type===E?(fe=Ti(ne.props.children,te.mode,fe,ne.key),fe.return=te,te=fe):(fe=Ko(ne.type,ne.key,ne.props,null,te.mode,fe),ws(fe,ne),fe.return=te,te=fe)}return M(te);case x:e:{for(we=ne.key;Q!==null;){if(Q.key===we)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){c(te,Q.sibling),fe=w(Q,ne.children||[]),fe.return=te,te=fe;break e}else{c(te,Q);break}else a(te,Q);Q=Q.sibling}fe=Bu(ne,te.mode,fe),fe.return=te,te=fe}return M(te);case R:return ne=Oi(ne),it(te,Q,ne,fe)}if(V(ne))return _e(te,Q,ne,fe);if(j(ne)){if(we=j(ne),typeof we!="function")throw Error(i(150));return ne=we.call(ne),ke(te,Q,ne,fe)}if(typeof ne.then=="function")return it(te,Q,tl(ne),fe);if(ne.$$typeof===_)return it(te,Q,Zo(te,ne),fe);nl(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Q!==null&&Q.tag===6?(c(te,Q.sibling),fe=w(Q,ne),fe.return=te,te=fe):(c(te,Q),fe=Mu(ne,te.mode,fe),fe.return=te,te=fe),M(te)):c(te,Q)}return function(te,Q,ne,fe){try{xs=0;var we=it(te,Q,ne,fe);return Ca=null,we}catch(Se){if(Se===wa||Se===Jo)throw Se;var Xe=vn(29,Se,null,te.mode);return Xe.lanes=fe,Xe.return=te,Xe}}}var Li=GS(!0),VS=GS(!1),qr=!1;function Ku(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yu(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function $r(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Gr(r,a,c){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(Qe&2)!==0){var w=m.pending;return w===null?a.next=a:(a.next=w.next,w.next=a),m.pending=a,a=Wo(r),RS(r,null,c),a}return Vo(r,m,a,c),Wo(r)}function Cs(r,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var m=a.lanes;m&=r.pendingLanes,c|=m,a.lanes=c,F_(r,c)}}function Xu(r,a){var c=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var w=null,k=null;if(c=c.firstBaseUpdate,c!==null){do{var M={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};k===null?w=k=M:k=k.next=M,c=c.next}while(c!==null);k===null?w=k=a:k=k.next=a}else w=k=a;c={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:k,shared:m.shared,callbacks:m.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=a:r.next=a,c.lastBaseUpdate=a}var Zu=!1;function Ts(){if(Zu){var r=xa;if(r!==null)throw r}}function As(r,a,c,m){Zu=!1;var w=r.updateQueue;qr=!1;var k=w.firstBaseUpdate,M=w.lastBaseUpdate,q=w.shared.pending;if(q!==null){w.shared.pending=null;var Y=q,re=Y.next;Y.next=null,M===null?k=re:M.next=re,M=Y;var de=r.alternate;de!==null&&(de=de.updateQueue,q=de.lastBaseUpdate,q!==M&&(q===null?de.firstBaseUpdate=re:q.next=re,de.lastBaseUpdate=Y))}if(k!==null){var pe=w.baseState;M=0,de=re=Y=null,q=k;do{var ae=q.lane&-536870913,oe=ae!==q.lane;if(oe?(Ve&ae)===ae:(m&ae)===ae){ae!==0&&ae===Ea&&(Zu=!0),de!==null&&(de=de.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var _e=r,ke=q;ae=a;var it=c;switch(ke.tag){case 1:if(_e=ke.payload,typeof _e=="function"){pe=_e.call(it,pe,ae);break e}pe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=ke.payload,ae=typeof _e=="function"?_e.call(it,pe,ae):_e,ae==null)break e;pe=f({},pe,ae);break e;case 2:qr=!0}}ae=q.callback,ae!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=w.callbacks,oe===null?w.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:q.tag,payload:q.payload,callback:q.callback,next:null},de===null?(re=de=oe,Y=pe):de=de.next=oe,M|=ae;if(q=q.next,q===null){if(q=w.shared.pending,q===null)break;oe=q,q=oe.next,oe.next=null,w.lastBaseUpdate=oe,w.shared.pending=null}}while(!0);de===null&&(Y=pe),w.baseState=Y,w.firstBaseUpdate=re,w.lastBaseUpdate=de,k===null&&(w.shared.lanes=0),Xr|=M,r.lanes=M,r.memoizedState=pe}}function WS(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function KS(r,a){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)WS(c[r],a)}var Ta=B(null),rl=B(0);function YS(r,a){r=kr,U(rl,r),U(Ta,a),kr=r|a.baseLanes}function Qu(){U(rl,kr),U(Ta,Ta.current)}function Ju(){kr=rl.current,H(Ta),H(rl)}var _n=B(null),Un=null;function Vr(r){var a=r.alternate;U(St,St.current&1),U(_n,r),Un===null&&(a===null||Ta.current!==null||a.memoizedState!==null)&&(Un=r)}function ed(r){U(St,St.current),U(_n,r),Un===null&&(Un=r)}function XS(r){r.tag===22?(U(St,St.current),U(_n,r),Un===null&&(Un=r)):Wr()}function Wr(){U(St,St.current),U(_n,_n.current)}function Sn(r){H(_n),Un===r&&(Un=null),H(St)}var St=B(0);function il(r){for(var a=r;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||sh(c)||oh(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var _r=0,Me=null,nt=null,Tt=null,al=!1,Aa=!1,Di=!1,sl=0,ks=0,ka=null,$D=0;function yt(){throw Error(i(321))}function td(r,a){if(a===null)return!1;for(var c=0;c<a.length&&c<r.length;c++)if(!yn(r[c],a[c]))return!1;return!0}function nd(r,a,c,m,w,k){return _r=k,Me=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,W.H=r===null||r.memoizedState===null?LE:bd,Di=!1,k=c(m,w),Di=!1,Aa&&(k=QS(a,c,m,w)),ZS(r),k}function ZS(r){W.H=Os;var a=nt!==null&&nt.next!==null;if(_r=0,Tt=nt=Me=null,al=!1,ks=0,ka=null,a)throw Error(i(300));r===null||At||(r=r.dependencies,r!==null&&Xo(r)&&(At=!0))}function QS(r,a,c,m){Me=r;var w=0;do{if(Aa&&(ka=null),ks=0,Aa=!1,25<=w)throw Error(i(301));if(w+=1,Tt=nt=null,r.updateQueue!=null){var k=r.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}W.H=DE,k=a(c,m)}while(Aa);return k}function GD(){var r=W.H,a=r.useState()[0];return a=typeof a.then=="function"?Rs(a):a,r=r.useState()[0],(nt!==null?nt.memoizedState:null)!==r&&(Me.flags|=1024),a}function rd(){var r=sl!==0;return sl=0,r}function id(r,a,c){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~c}function ad(r){if(al){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}al=!1}_r=0,Tt=nt=Me=null,Aa=!1,ks=sl=0,ka=null}function Qt(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Me.memoizedState=Tt=r:Tt=Tt.next=r,Tt}function Et(){if(nt===null){var r=Me.alternate;r=r!==null?r.memoizedState:null}else r=nt.next;var a=Tt===null?Me.memoizedState:Tt.next;if(a!==null)Tt=a,nt=r;else{if(r===null)throw Me.alternate===null?Error(i(467)):Error(i(310));nt=r,r={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},Tt===null?Me.memoizedState=Tt=r:Tt=Tt.next=r}return Tt}function ol(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rs(r){var a=ks;return ks+=1,ka===null&&(ka=[]),r=HS(ka,r,a),a=Me,(Tt===null?a.memoizedState:Tt.next)===null&&(a=a.alternate,W.H=a===null||a.memoizedState===null?LE:bd),r}function ll(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Rs(r);if(r.$$typeof===_)return zt(r)}throw Error(i(438,String(r)))}function sd(r){var a=null,c=Me.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var m=Me.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(a={data:m.data.map(function(w){return w.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=ol(),Me.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(r),m=0;m<r;m++)c[m]=L;return a.index++,c}function Sr(r,a){return typeof a=="function"?a(r):a}function cl(r){var a=Et();return od(a,nt,r)}function od(r,a,c){var m=r.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=c;var w=r.baseQueue,k=m.pending;if(k!==null){if(w!==null){var M=w.next;w.next=k.next,k.next=M}a.baseQueue=w=k,m.pending=null}if(k=r.baseState,w===null)r.memoizedState=k;else{a=w.next;var q=M=null,Y=null,re=a,de=!1;do{var pe=re.lane&-536870913;if(pe!==re.lane?(Ve&pe)===pe:(_r&pe)===pe){var ae=re.revertLane;if(ae===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),pe===Ea&&(de=!0);else if((_r&ae)===ae){re=re.next,ae===Ea&&(de=!0);continue}else pe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Y===null?(q=Y=pe,M=k):Y=Y.next=pe,Me.lanes|=ae,Xr|=ae;pe=re.action,Di&&c(k,pe),k=re.hasEagerState?re.eagerState:c(k,pe)}else ae={lane:pe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Y===null?(q=Y=ae,M=k):Y=Y.next=ae,Me.lanes|=pe,Xr|=pe;re=re.next}while(re!==null&&re!==a);if(Y===null?M=k:Y.next=q,!yn(k,r.memoizedState)&&(At=!0,de&&(c=xa,c!==null)))throw c;r.memoizedState=k,r.baseState=M,r.baseQueue=Y,m.lastRenderedState=k}return w===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function ld(r){var a=Et(),c=a.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=r;var m=c.dispatch,w=c.pending,k=a.memoizedState;if(w!==null){c.pending=null;var M=w=w.next;do k=r(k,M.action),M=M.next;while(M!==w);yn(k,a.memoizedState)||(At=!0),a.memoizedState=k,a.baseQueue===null&&(a.baseState=k),c.lastRenderedState=k}return[k,m]}function JS(r,a,c){var m=Me,w=Et(),k=Ke;if(k){if(c===void 0)throw Error(i(407));c=c()}else c=a();var M=!yn((nt||w).memoizedState,c);if(M&&(w.memoizedState=c,At=!0),w=w.queue,dd(nE.bind(null,m,w,r),[r]),w.getSnapshot!==a||M||Tt!==null&&Tt.memoizedState.tag&1){if(m.flags|=2048,Ra(9,{destroy:void 0},tE.bind(null,m,w,c,a),null),st===null)throw Error(i(349));k||(_r&127)!==0||eE(m,a,c)}return c}function eE(r,a,c){r.flags|=16384,r={getSnapshot:a,value:c},a=Me.updateQueue,a===null?(a=ol(),Me.updateQueue=a,a.stores=[r]):(c=a.stores,c===null?a.stores=[r]:c.push(r))}function tE(r,a,c,m){a.value=c,a.getSnapshot=m,rE(a)&&iE(r)}function nE(r,a,c){return c(function(){rE(a)&&iE(r)})}function rE(r){var a=r.getSnapshot;r=r.value;try{var c=a();return!yn(r,c)}catch{return!0}}function iE(r){var a=Ci(r,2);a!==null&&un(a,r,2)}function cd(r){var a=Qt();if(typeof r=="function"){var c=r;if(r=c(),Di){dt(!0);try{c()}finally{dt(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:r},a}function aE(r,a,c,m){return r.baseState=c,od(r,nt,typeof m=="function"?m:Sr)}function VD(r,a,c,m,w){if(hl(r))throw Error(i(485));if(r=a.action,r!==null){var k={payload:w,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){k.listeners.push(M)}};W.T!==null?c(!0):k.isTransition=!1,m(k),c=a.pending,c===null?(k.next=a.pending=k,sE(a,k)):(k.next=c.next,a.pending=c.next=k)}}function sE(r,a){var c=a.action,m=a.payload,w=r.state;if(a.isTransition){var k=W.T,M={};W.T=M;try{var q=c(w,m),Y=W.S;Y!==null&&Y(M,q),oE(r,a,q)}catch(re){ud(r,a,re)}finally{k!==null&&M.types!==null&&(k.types=M.types),W.T=k}}else try{k=c(w,m),oE(r,a,k)}catch(re){ud(r,a,re)}}function oE(r,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){lE(r,a,m)},function(m){return ud(r,a,m)}):lE(r,a,c)}function lE(r,a,c){a.status="fulfilled",a.value=c,cE(a),r.state=c,a=r.pending,a!==null&&(c=a.next,c===a?r.pending=null:(c=c.next,a.next=c,sE(r,c)))}function ud(r,a,c){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do a.status="rejected",a.reason=c,cE(a),a=a.next;while(a!==m)}r.action=null}function cE(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function uE(r,a){return a}function dE(r,a){if(Ke){var c=st.formState;if(c!==null){e:{var m=Me;if(Ke){if(ct){t:{for(var w=ct,k=Pn;w.nodeType!==8;){if(!k){w=null;break t}if(w=jn(w.nextSibling),w===null){w=null;break t}}k=w.data,w=k==="F!"||k==="F"?w:null}if(w){ct=jn(w.nextSibling),m=w.data==="F!";break e}}zr(m)}m=!1}m&&(a=c[0])}}return c=Qt(),c.memoizedState=c.baseState=a,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uE,lastRenderedState:a},c.queue=m,c=NE.bind(null,Me,m),m.dispatch=c,m=cd(!1),k=gd.bind(null,Me,!1,m.queue),m=Qt(),w={state:a,dispatch:null,action:r,pending:null},m.queue=w,c=VD.bind(null,Me,w,k,c),w.dispatch=c,m.memoizedState=r,[a,c,!1]}function hE(r){var a=Et();return fE(a,nt,r)}function fE(r,a,c){if(a=od(r,a,uE)[0],r=cl(Sr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var m=Rs(a)}catch(M){throw M===wa?Jo:M}else m=a;a=Et();var w=a.queue,k=w.dispatch;return c!==a.memoizedState&&(Me.flags|=2048,Ra(9,{destroy:void 0},WD.bind(null,w,c),null)),[m,k,r]}function WD(r,a){r.action=a}function pE(r){var a=Et(),c=nt;if(c!==null)return fE(a,c,r);Et(),a=a.memoizedState,c=Et();var m=c.queue.dispatch;return c.memoizedState=r,[a,m,!1]}function Ra(r,a,c,m){return r={tag:r,create:c,deps:m,inst:a,next:null},a=Me.updateQueue,a===null&&(a=ol(),Me.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=r.next=r:(m=c.next,c.next=r,r.next=m,a.lastEffect=r),r}function mE(){return Et().memoizedState}function ul(r,a,c,m){var w=Qt();Me.flags|=r,w.memoizedState=Ra(1|a,{destroy:void 0},c,m===void 0?null:m)}function dl(r,a,c,m){var w=Et();m=m===void 0?null:m;var k=w.memoizedState.inst;nt!==null&&m!==null&&td(m,nt.memoizedState.deps)?w.memoizedState=Ra(a,k,c,m):(Me.flags|=r,w.memoizedState=Ra(1|a,k,c,m))}function gE(r,a){ul(8390656,8,r,a)}function dd(r,a){dl(2048,8,r,a)}function KD(r){Me.flags|=4;var a=Me.updateQueue;if(a===null)a=ol(),Me.updateQueue=a,a.events=[r];else{var c=a.events;c===null?a.events=[r]:c.push(r)}}function bE(r){var a=Et().memoizedState;return KD({ref:a,nextImpl:r}),function(){if((Qe&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function yE(r,a){return dl(4,2,r,a)}function vE(r,a){return dl(4,4,r,a)}function _E(r,a){if(typeof a=="function"){r=r();var c=a(r);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function SE(r,a,c){c=c!=null?c.concat([r]):null,dl(4,4,_E.bind(null,a,r),c)}function hd(){}function EE(r,a){var c=Et();a=a===void 0?null:a;var m=c.memoizedState;return a!==null&&td(a,m[1])?m[0]:(c.memoizedState=[r,a],r)}function xE(r,a){var c=Et();a=a===void 0?null:a;var m=c.memoizedState;if(a!==null&&td(a,m[1]))return m[0];if(m=r(),Di){dt(!0);try{r()}finally{dt(!1)}}return c.memoizedState=[m,a],m}function fd(r,a,c){return c===void 0||(_r&1073741824)!==0&&(Ve&261930)===0?r.memoizedState=a:(r.memoizedState=c,r=w0(),Me.lanes|=r,Xr|=r,c)}function wE(r,a,c,m){return yn(c,a)?c:Ta.current!==null?(r=fd(r,c,m),yn(r,a)||(At=!0),r):(_r&42)===0||(_r&1073741824)!==0&&(Ve&261930)===0?(At=!0,r.memoizedState=c):(r=w0(),Me.lanes|=r,Xr|=r,a)}function CE(r,a,c,m,w){var k=Z.p;Z.p=k!==0&&8>k?k:8;var M=W.T,q={};W.T=q,gd(r,!1,a,c);try{var Y=w(),re=W.S;if(re!==null&&re(q,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var de=qD(Y,m);Ns(r,a,de,wn(r))}else Ns(r,a,m,wn(r))}catch(pe){Ns(r,a,{then:function(){},status:"rejected",reason:pe},wn())}finally{Z.p=k,M!==null&&q.types!==null&&(M.types=q.types),W.T=M}}function YD(){}function pd(r,a,c,m){if(r.tag!==5)throw Error(i(476));var w=TE(r).queue;CE(r,w,a,J,c===null?YD:function(){return AE(r),c(m)})}function TE(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:J},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:c},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function AE(r){var a=TE(r);a.next===null&&(a=r.alternate.memoizedState),Ns(r,a.next.queue,{},wn())}function md(){return zt(Ws)}function kE(){return Et().memoizedState}function RE(){return Et().memoizedState}function XD(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var c=wn();r=$r(c);var m=Gr(a,r,c);m!==null&&(un(m,a,c),Cs(m,a,c)),a={cache:$u()},r.payload=a;return}a=a.return}}function ZD(r,a,c){var m=wn();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},hl(r)?OE(a,c):(c=Lu(r,a,c,m),c!==null&&(un(c,r,m),IE(c,a,m)))}function NE(r,a,c){var m=wn();Ns(r,a,c,m)}function Ns(r,a,c,m){var w={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(hl(r))OE(a,w);else{var k=r.alternate;if(r.lanes===0&&(k===null||k.lanes===0)&&(k=a.lastRenderedReducer,k!==null))try{var M=a.lastRenderedState,q=k(M,c);if(w.hasEagerState=!0,w.eagerState=q,yn(q,M))return Vo(r,a,w,0),st===null&&Go(),!1}catch{}if(c=Lu(r,a,w,m),c!==null)return un(c,r,m),IE(c,a,m),!0}return!1}function gd(r,a,c,m){if(m={lane:2,revertLane:Kd(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},hl(r)){if(a)throw Error(i(479))}else a=Lu(r,c,m,2),a!==null&&un(a,r,2)}function hl(r){var a=r.alternate;return r===Me||a!==null&&a===Me}function OE(r,a){Aa=al=!0;var c=r.pending;c===null?a.next=a:(a.next=c.next,c.next=a),r.pending=a}function IE(r,a,c){if((c&4194048)!==0){var m=a.lanes;m&=r.pendingLanes,c|=m,a.lanes=c,F_(r,c)}}var Os={readContext:zt,use:ll,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Os.useEffectEvent=yt;var LE={readContext:zt,use:ll,useCallback:function(r,a){return Qt().memoizedState=[r,a===void 0?null:a],r},useContext:zt,useEffect:gE,useImperativeHandle:function(r,a,c){c=c!=null?c.concat([r]):null,ul(4194308,4,_E.bind(null,a,r),c)},useLayoutEffect:function(r,a){return ul(4194308,4,r,a)},useInsertionEffect:function(r,a){ul(4,2,r,a)},useMemo:function(r,a){var c=Qt();a=a===void 0?null:a;var m=r();if(Di){dt(!0);try{r()}finally{dt(!1)}}return c.memoizedState=[m,a],m},useReducer:function(r,a,c){var m=Qt();if(c!==void 0){var w=c(a);if(Di){dt(!0);try{c(a)}finally{dt(!1)}}}else w=a;return m.memoizedState=m.baseState=w,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:w},m.queue=r,r=r.dispatch=ZD.bind(null,Me,r),[m.memoizedState,r]},useRef:function(r){var a=Qt();return r={current:r},a.memoizedState=r},useState:function(r){r=cd(r);var a=r.queue,c=NE.bind(null,Me,a);return a.dispatch=c,[r.memoizedState,c]},useDebugValue:hd,useDeferredValue:function(r,a){var c=Qt();return fd(c,r,a)},useTransition:function(){var r=cd(!1);return r=CE.bind(null,Me,r.queue,!0,!1),Qt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,c){var m=Me,w=Qt();if(Ke){if(c===void 0)throw Error(i(407));c=c()}else{if(c=a(),st===null)throw Error(i(349));(Ve&127)!==0||eE(m,a,c)}w.memoizedState=c;var k={value:c,getSnapshot:a};return w.queue=k,gE(nE.bind(null,m,k,r),[r]),m.flags|=2048,Ra(9,{destroy:void 0},tE.bind(null,m,k,c,a),null),c},useId:function(){var r=Qt(),a=st.identifierPrefix;if(Ke){var c=tr,m=er;c=(m&~(1<<32-Je(m)-1)).toString(32)+c,a="_"+a+"R_"+c,c=sl++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=$D++,a="_"+a+"r_"+c.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:md,useFormState:dE,useActionState:dE,useOptimistic:function(r){var a=Qt();a.memoizedState=a.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=gd.bind(null,Me,!0,c),c.dispatch=a,[r,a]},useMemoCache:sd,useCacheRefresh:function(){return Qt().memoizedState=XD.bind(null,Me)},useEffectEvent:function(r){var a=Qt(),c={impl:r};return a.memoizedState=c,function(){if((Qe&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},bd={readContext:zt,use:ll,useCallback:EE,useContext:zt,useEffect:dd,useImperativeHandle:SE,useInsertionEffect:yE,useLayoutEffect:vE,useMemo:xE,useReducer:cl,useRef:mE,useState:function(){return cl(Sr)},useDebugValue:hd,useDeferredValue:function(r,a){var c=Et();return wE(c,nt.memoizedState,r,a)},useTransition:function(){var r=cl(Sr)[0],a=Et().memoizedState;return[typeof r=="boolean"?r:Rs(r),a]},useSyncExternalStore:JS,useId:kE,useHostTransitionStatus:md,useFormState:hE,useActionState:hE,useOptimistic:function(r,a){var c=Et();return aE(c,nt,r,a)},useMemoCache:sd,useCacheRefresh:RE};bd.useEffectEvent=bE;var DE={readContext:zt,use:ll,useCallback:EE,useContext:zt,useEffect:dd,useImperativeHandle:SE,useInsertionEffect:yE,useLayoutEffect:vE,useMemo:xE,useReducer:ld,useRef:mE,useState:function(){return ld(Sr)},useDebugValue:hd,useDeferredValue:function(r,a){var c=Et();return nt===null?fd(c,r,a):wE(c,nt.memoizedState,r,a)},useTransition:function(){var r=ld(Sr)[0],a=Et().memoizedState;return[typeof r=="boolean"?r:Rs(r),a]},useSyncExternalStore:JS,useId:kE,useHostTransitionStatus:md,useFormState:pE,useActionState:pE,useOptimistic:function(r,a){var c=Et();return nt!==null?aE(c,nt,r,a):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:sd,useCacheRefresh:RE};DE.useEffectEvent=bE;function yd(r,a,c,m){a=r.memoizedState,c=c(m,a),c=c==null?a:f({},a,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var vd={enqueueSetState:function(r,a,c){r=r._reactInternals;var m=wn(),w=$r(m);w.payload=a,c!=null&&(w.callback=c),a=Gr(r,w,m),a!==null&&(un(a,r,m),Cs(a,r,m))},enqueueReplaceState:function(r,a,c){r=r._reactInternals;var m=wn(),w=$r(m);w.tag=1,w.payload=a,c!=null&&(w.callback=c),a=Gr(r,w,m),a!==null&&(un(a,r,m),Cs(a,r,m))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var c=wn(),m=$r(c);m.tag=2,a!=null&&(m.callback=a),a=Gr(r,m,c),a!==null&&(un(a,r,c),Cs(a,r,c))}};function ME(r,a,c,m,w,k,M){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,k,M):a.prototype&&a.prototype.isPureReactComponent?!bs(c,m)||!bs(w,k):!0}function BE(r,a,c,m){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,m),a.state!==r&&vd.enqueueReplaceState(a,a.state,null)}function Mi(r,a){var c=a;if("ref"in a){c={};for(var m in a)m!=="ref"&&(c[m]=a[m])}if(r=r.defaultProps){c===a&&(c=f({},c));for(var w in r)c[w]===void 0&&(c[w]=r[w])}return c}function FE(r){$o(r)}function PE(r){console.error(r)}function UE(r){$o(r)}function fl(r,a){try{var c=r.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(m){setTimeout(function(){throw m})}}function jE(r,a,c){try{var m=r.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function _d(r,a,c){return c=$r(c),c.tag=3,c.payload={element:null},c.callback=function(){fl(r,a)},c}function zE(r){return r=$r(r),r.tag=3,r}function HE(r,a,c,m){var w=c.type.getDerivedStateFromError;if(typeof w=="function"){var k=m.value;r.payload=function(){return w(k)},r.callback=function(){jE(a,c,m)}}var M=c.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(r.callback=function(){jE(a,c,m),typeof w!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var q=m.stack;this.componentDidCatch(m.value,{componentStack:q!==null?q:""})})}function QD(r,a,c,m,w){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(a=c.alternate,a!==null&&Sa(a,c,w,!0),c=_n.current,c!==null){switch(c.tag){case 31:case 13:return Un===null?Cl():c.alternate===null&&vt===0&&(vt=3),c.flags&=-257,c.flags|=65536,c.lanes=w,m===el?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([m]):a.add(m),Gd(r,m,w)),!1;case 22:return c.flags|=65536,m===el?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([m]):c.add(m)),Gd(r,m,w)),!1}throw Error(i(435,c.tag))}return Gd(r,m,w),Cl(),!1}if(Ke)return a=_n.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=w,m!==Uu&&(r=Error(i(422),{cause:m}),_s(Mn(r,c)))):(m!==Uu&&(a=Error(i(423),{cause:m}),_s(Mn(a,c))),r=r.current.alternate,r.flags|=65536,w&=-w,r.lanes|=w,m=Mn(m,c),w=_d(r.stateNode,m,w),Xu(r,w),vt!==4&&(vt=2)),!1;var k=Error(i(520),{cause:m});if(k=Mn(k,c),Us===null?Us=[k]:Us.push(k),vt!==4&&(vt=2),a===null)return!0;m=Mn(m,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,r=w&-w,c.lanes|=r,r=_d(c.stateNode,m,r),Xu(c,r),!1;case 1:if(a=c.type,k=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Zr===null||!Zr.has(k))))return c.flags|=65536,w&=-w,c.lanes|=w,w=zE(w),HE(w,r,c,m),Xu(c,w),!1}c=c.return}while(c!==null);return!1}var Sd=Error(i(461)),At=!1;function Ht(r,a,c,m){a.child=r===null?VS(a,null,c,m):Li(a,r.child,c,m)}function qE(r,a,c,m,w){c=c.render;var k=a.ref;if("ref"in m){var M={};for(var q in m)q!=="ref"&&(M[q]=m[q])}else M=m;return Ri(a),m=nd(r,a,c,M,k,w),q=rd(),r!==null&&!At?(id(r,a,w),Er(r,a,w)):(Ke&&q&&Fu(a),a.flags|=1,Ht(r,a,m,w),a.child)}function $E(r,a,c,m,w){if(r===null){var k=c.type;return typeof k=="function"&&!Du(k)&&k.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=k,GE(r,a,k,m,w)):(r=Ko(c.type,null,m,a,a.mode,w),r.ref=a.ref,r.return=a,a.child=r)}if(k=r.child,!Rd(r,w)){var M=k.memoizedProps;if(c=c.compare,c=c!==null?c:bs,c(M,m)&&r.ref===a.ref)return Er(r,a,w)}return a.flags|=1,r=gr(k,m),r.ref=a.ref,r.return=a,a.child=r}function GE(r,a,c,m,w){if(r!==null){var k=r.memoizedProps;if(bs(k,m)&&r.ref===a.ref)if(At=!1,a.pendingProps=m=k,Rd(r,w))(r.flags&131072)!==0&&(At=!0);else return a.lanes=r.lanes,Er(r,a,w)}return Ed(r,a,c,m,w)}function VE(r,a,c,m){var w=m.children,k=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((a.flags&128)!==0){if(k=k!==null?k.baseLanes|c:c,r!==null){for(m=a.child=r.child,w=0;m!==null;)w=w|m.lanes|m.childLanes,m=m.sibling;m=w&~k}else m=0,a.child=null;return WE(r,a,k,c,m)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Qo(a,k!==null?k.cachePool:null),k!==null?YS(a,k):Qu(),XS(a);else return m=a.lanes=536870912,WE(r,a,k!==null?k.baseLanes|c:c,c,m)}else k!==null?(Qo(a,k.cachePool),YS(a,k),Wr(),a.memoizedState=null):(r!==null&&Qo(a,null),Qu(),Wr());return Ht(r,a,w,c),a.child}function Is(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function WE(r,a,c,m,w){var k=Vu();return k=k===null?null:{parent:Ct._currentValue,pool:k},a.memoizedState={baseLanes:c,cachePool:k},r!==null&&Qo(a,null),Qu(),XS(a),r!==null&&Sa(r,a,m,!0),a.childLanes=w,null}function pl(r,a){return a=gl({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function KE(r,a,c){return Li(a,r.child,null,c),r=pl(a,a.pendingProps),r.flags|=2,Sn(a),a.memoizedState=null,r}function JD(r,a,c){var m=a.pendingProps,w=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(Ke){if(m.mode==="hidden")return r=pl(a,m),a.lanes=536870912,Is(null,r);if(ed(a),(r=ct)?(r=sx(r,Pn),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Ur!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},c=OS(r),c.return=a,a.child=c,jt=a,ct=null)):r=null,r===null)throw zr(a);return a.lanes=536870912,null}return pl(a,m)}var k=r.memoizedState;if(k!==null){var M=k.dehydrated;if(ed(a),w)if(a.flags&256)a.flags&=-257,a=KE(r,a,c);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(i(558));else if(At||Sa(r,a,c,!1),w=(c&r.childLanes)!==0,At||w){if(m=st,m!==null&&(M=P_(m,c),M!==0&&M!==k.retryLane))throw k.retryLane=M,Ci(r,M),un(m,r,M),Sd;Cl(),a=KE(r,a,c)}else r=k.treeContext,ct=jn(M.nextSibling),jt=a,Ke=!0,jr=null,Pn=!1,r!==null&&DS(a,r),a=pl(a,m),a.flags|=4096;return a}return r=gr(r.child,{mode:m.mode,children:m.children}),r.ref=a.ref,a.child=r,r.return=a,r}function ml(r,a){var c=a.ref;if(c===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(r===null||r.ref!==c)&&(a.flags|=4194816)}}function Ed(r,a,c,m,w){return Ri(a),c=nd(r,a,c,m,void 0,w),m=rd(),r!==null&&!At?(id(r,a,w),Er(r,a,w)):(Ke&&m&&Fu(a),a.flags|=1,Ht(r,a,c,w),a.child)}function YE(r,a,c,m,w,k){return Ri(a),a.updateQueue=null,c=QS(a,m,c,w),ZS(r),m=rd(),r!==null&&!At?(id(r,a,k),Er(r,a,k)):(Ke&&m&&Fu(a),a.flags|=1,Ht(r,a,c,k),a.child)}function XE(r,a,c,m,w){if(Ri(a),a.stateNode===null){var k=ba,M=c.contextType;typeof M=="object"&&M!==null&&(k=zt(M)),k=new c(m,k),a.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=vd,a.stateNode=k,k._reactInternals=a,k=a.stateNode,k.props=m,k.state=a.memoizedState,k.refs={},Ku(a),M=c.contextType,k.context=typeof M=="object"&&M!==null?zt(M):ba,k.state=a.memoizedState,M=c.getDerivedStateFromProps,typeof M=="function"&&(yd(a,c,M,m),k.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(M=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),M!==k.state&&vd.enqueueReplaceState(k,k.state,null),As(a,m,k,w),Ts(),k.state=a.memoizedState),typeof k.componentDidMount=="function"&&(a.flags|=4194308),m=!0}else if(r===null){k=a.stateNode;var q=a.memoizedProps,Y=Mi(c,q);k.props=Y;var re=k.context,de=c.contextType;M=ba,typeof de=="object"&&de!==null&&(M=zt(de));var pe=c.getDerivedStateFromProps;de=typeof pe=="function"||typeof k.getSnapshotBeforeUpdate=="function",q=a.pendingProps!==q,de||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(q||re!==M)&&BE(a,k,m,M),qr=!1;var ae=a.memoizedState;k.state=ae,As(a,m,k,w),Ts(),re=a.memoizedState,q||ae!==re||qr?(typeof pe=="function"&&(yd(a,c,pe,m),re=a.memoizedState),(Y=qr||ME(a,c,Y,m,ae,re,M))?(de||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(a.flags|=4194308)):(typeof k.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=re),k.props=m,k.state=re,k.context=M,m=Y):(typeof k.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{k=a.stateNode,Yu(r,a),M=a.memoizedProps,de=Mi(c,M),k.props=de,pe=a.pendingProps,ae=k.context,re=c.contextType,Y=ba,typeof re=="object"&&re!==null&&(Y=zt(re)),q=c.getDerivedStateFromProps,(re=typeof q=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(M!==pe||ae!==Y)&&BE(a,k,m,Y),qr=!1,ae=a.memoizedState,k.state=ae,As(a,m,k,w),Ts();var oe=a.memoizedState;M!==pe||ae!==oe||qr||r!==null&&r.dependencies!==null&&Xo(r.dependencies)?(typeof q=="function"&&(yd(a,c,q,m),oe=a.memoizedState),(de=qr||ME(a,c,de,m,ae,oe,Y)||r!==null&&r.dependencies!==null&&Xo(r.dependencies))?(re||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(m,oe,Y),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(m,oe,Y)),typeof k.componentDidUpdate=="function"&&(a.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof k.componentDidUpdate!="function"||M===r.memoizedProps&&ae===r.memoizedState||(a.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||M===r.memoizedProps&&ae===r.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=oe),k.props=m,k.state=oe,k.context=Y,m=de):(typeof k.componentDidUpdate!="function"||M===r.memoizedProps&&ae===r.memoizedState||(a.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||M===r.memoizedProps&&ae===r.memoizedState||(a.flags|=1024),m=!1)}return k=m,ml(r,a),m=(a.flags&128)!==0,k||m?(k=a.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:k.render(),a.flags|=1,r!==null&&m?(a.child=Li(a,r.child,null,w),a.child=Li(a,null,c,w)):Ht(r,a,c,w),a.memoizedState=k.state,r=a.child):r=Er(r,a,w),r}function ZE(r,a,c,m){return Ai(),a.flags|=256,Ht(r,a,c,m),a.child}var xd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wd(r){return{baseLanes:r,cachePool:jS()}}function Cd(r,a,c){return r=r!==null?r.childLanes&~c:0,a&&(r|=xn),r}function QE(r,a,c){var m=a.pendingProps,w=!1,k=(a.flags&128)!==0,M;if((M=k)||(M=r!==null&&r.memoizedState===null?!1:(St.current&2)!==0),M&&(w=!0,a.flags&=-129),M=(a.flags&32)!==0,a.flags&=-33,r===null){if(Ke){if(w?Vr(a):Wr(),(r=ct)?(r=sx(r,Pn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Ur!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},c=OS(r),c.return=a,a.child=c,jt=a,ct=null)):r=null,r===null)throw zr(a);return oh(r)?a.lanes=32:a.lanes=536870912,null}var q=m.children;return m=m.fallback,w?(Wr(),w=a.mode,q=gl({mode:"hidden",children:q},w),m=Ti(m,w,c,null),q.return=a,m.return=a,q.sibling=m,a.child=q,m=a.child,m.memoizedState=wd(c),m.childLanes=Cd(r,M,c),a.memoizedState=xd,Is(null,m)):(Vr(a),Td(a,q))}var Y=r.memoizedState;if(Y!==null&&(q=Y.dehydrated,q!==null)){if(k)a.flags&256?(Vr(a),a.flags&=-257,a=Ad(r,a,c)):a.memoizedState!==null?(Wr(),a.child=r.child,a.flags|=128,a=null):(Wr(),q=m.fallback,w=a.mode,m=gl({mode:"visible",children:m.children},w),q=Ti(q,w,c,null),q.flags|=2,m.return=a,q.return=a,m.sibling=q,a.child=m,Li(a,r.child,null,c),m=a.child,m.memoizedState=wd(c),m.childLanes=Cd(r,M,c),a.memoizedState=xd,a=Is(null,m));else if(Vr(a),oh(q)){if(M=q.nextSibling&&q.nextSibling.dataset,M)var re=M.dgst;M=re,m=Error(i(419)),m.stack="",m.digest=M,_s({value:m,source:null,stack:null}),a=Ad(r,a,c)}else if(At||Sa(r,a,c,!1),M=(c&r.childLanes)!==0,At||M){if(M=st,M!==null&&(m=P_(M,c),m!==0&&m!==Y.retryLane))throw Y.retryLane=m,Ci(r,m),un(M,r,m),Sd;sh(q)||Cl(),a=Ad(r,a,c)}else sh(q)?(a.flags|=192,a.child=r.child,a=null):(r=Y.treeContext,ct=jn(q.nextSibling),jt=a,Ke=!0,jr=null,Pn=!1,r!==null&&DS(a,r),a=Td(a,m.children),a.flags|=4096);return a}return w?(Wr(),q=m.fallback,w=a.mode,Y=r.child,re=Y.sibling,m=gr(Y,{mode:"hidden",children:m.children}),m.subtreeFlags=Y.subtreeFlags&65011712,re!==null?q=gr(re,q):(q=Ti(q,w,c,null),q.flags|=2),q.return=a,m.return=a,m.sibling=q,a.child=m,Is(null,m),m=a.child,q=r.child.memoizedState,q===null?q=wd(c):(w=q.cachePool,w!==null?(Y=Ct._currentValue,w=w.parent!==Y?{parent:Y,pool:Y}:w):w=jS(),q={baseLanes:q.baseLanes|c,cachePool:w}),m.memoizedState=q,m.childLanes=Cd(r,M,c),a.memoizedState=xd,Is(r.child,m)):(Vr(a),c=r.child,r=c.sibling,c=gr(c,{mode:"visible",children:m.children}),c.return=a,c.sibling=null,r!==null&&(M=a.deletions,M===null?(a.deletions=[r],a.flags|=16):M.push(r)),a.child=c,a.memoizedState=null,c)}function Td(r,a){return a=gl({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function gl(r,a){return r=vn(22,r,null,a),r.lanes=0,r}function Ad(r,a,c){return Li(a,r.child,null,c),r=Td(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function JE(r,a,c){r.lanes|=a;var m=r.alternate;m!==null&&(m.lanes|=a),Hu(r.return,a,c)}function kd(r,a,c,m,w,k){var M=r.memoizedState;M===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:w,treeForkCount:k}:(M.isBackwards=a,M.rendering=null,M.renderingStartTime=0,M.last=m,M.tail=c,M.tailMode=w,M.treeForkCount=k)}function e0(r,a,c){var m=a.pendingProps,w=m.revealOrder,k=m.tail;m=m.children;var M=St.current,q=(M&2)!==0;if(q?(M=M&1|2,a.flags|=128):M&=1,U(St,M),Ht(r,a,m,c),m=Ke?vs:0,!q&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&JE(r,c,a);else if(r.tag===19)JE(r,c,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(w){case"forwards":for(c=a.child,w=null;c!==null;)r=c.alternate,r!==null&&il(r)===null&&(w=c),c=c.sibling;c=w,c===null?(w=a.child,a.child=null):(w=c.sibling,c.sibling=null),kd(a,!1,w,c,k,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,w=a.child,a.child=null;w!==null;){if(r=w.alternate,r!==null&&il(r)===null){a.child=w;break}r=w.sibling,w.sibling=c,c=w,w=r}kd(a,!0,c,null,k,m);break;case"together":kd(a,!1,null,null,void 0,m);break;default:a.memoizedState=null}return a.child}function Er(r,a,c){if(r!==null&&(a.dependencies=r.dependencies),Xr|=a.lanes,(c&a.childLanes)===0)if(r!==null){if(Sa(r,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(i(153));if(a.child!==null){for(r=a.child,c=gr(r,r.pendingProps),a.child=c,c.return=a;r.sibling!==null;)r=r.sibling,c=c.sibling=gr(r,r.pendingProps),c.return=a;c.sibling=null}return a.child}function Rd(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Xo(r)))}function e2(r,a,c){switch(a.tag){case 3:$(a,a.stateNode.containerInfo),Hr(a,Ct,r.memoizedState.cache),Ai();break;case 27:case 5:he(a);break;case 4:$(a,a.stateNode.containerInfo);break;case 10:Hr(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,ed(a),null;break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(Vr(a),a.flags|=128,null):(c&a.child.childLanes)!==0?QE(r,a,c):(Vr(a),r=Er(r,a,c),r!==null?r.sibling:null);Vr(a);break;case 19:var w=(r.flags&128)!==0;if(m=(c&a.childLanes)!==0,m||(Sa(r,a,c,!1),m=(c&a.childLanes)!==0),w){if(m)return e0(r,a,c);a.flags|=128}if(w=a.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),U(St,St.current),m)break;return null;case 22:return a.lanes=0,VE(r,a,c,a.pendingProps);case 24:Hr(a,Ct,r.memoizedState.cache)}return Er(r,a,c)}function t0(r,a,c){if(r!==null)if(r.memoizedProps!==a.pendingProps)At=!0;else{if(!Rd(r,c)&&(a.flags&128)===0)return At=!1,e2(r,a,c);At=(r.flags&131072)!==0}else At=!1,Ke&&(a.flags&1048576)!==0&&LS(a,vs,a.index);switch(a.lanes=0,a.tag){case 16:e:{var m=a.pendingProps;if(r=Oi(a.elementType),a.type=r,typeof r=="function")Du(r)?(m=Mi(r,m),a.tag=1,a=XE(null,a,r,m,c)):(a.tag=0,a=Ed(null,a,r,m,c));else{if(r!=null){var w=r.$$typeof;if(w===C){a.tag=11,a=qE(null,a,r,m,c);break e}else if(w===O){a.tag=14,a=$E(null,a,r,m,c);break e}}throw a=G(r)||r,Error(i(306,a,""))}}return a;case 0:return Ed(r,a,a.type,a.pendingProps,c);case 1:return m=a.type,w=Mi(m,a.pendingProps),XE(r,a,m,w,c);case 3:e:{if($(a,a.stateNode.containerInfo),r===null)throw Error(i(387));m=a.pendingProps;var k=a.memoizedState;w=k.element,Yu(r,a),As(a,m,null,c);var M=a.memoizedState;if(m=M.cache,Hr(a,Ct,m),m!==k.cache&&qu(a,[Ct],c,!0),Ts(),m=M.element,k.isDehydrated)if(k={element:m,isDehydrated:!1,cache:M.cache},a.updateQueue.baseState=k,a.memoizedState=k,a.flags&256){a=ZE(r,a,m,c);break e}else if(m!==w){w=Mn(Error(i(424)),a),_s(w),a=ZE(r,a,m,c);break e}else for(r=a.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,ct=jn(r.firstChild),jt=a,Ke=!0,jr=null,Pn=!0,c=VS(a,null,m,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ai(),m===w){a=Er(r,a,c);break e}Ht(r,a,m,c)}a=a.child}return a;case 26:return ml(r,a),r===null?(c=hx(a.type,null,a.pendingProps,null))?a.memoizedState=c:Ke||(c=a.type,r=a.pendingProps,m=Il(ue.current).createElement(c),m[Ut]=a,m[rn]=r,qt(m,c,r),Ft(m),a.stateNode=m):a.memoizedState=hx(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return he(a),r===null&&Ke&&(m=a.stateNode=cx(a.type,a.pendingProps,ue.current),jt=a,Pn=!0,w=ct,ti(a.type)?(lh=w,ct=jn(m.firstChild)):ct=w),Ht(r,a,a.pendingProps.children,c),ml(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Ke&&((w=m=ct)&&(m=N2(m,a.type,a.pendingProps,Pn),m!==null?(a.stateNode=m,jt=a,ct=jn(m.firstChild),Pn=!1,w=!0):w=!1),w||zr(a)),he(a),w=a.type,k=a.pendingProps,M=r!==null?r.memoizedProps:null,m=k.children,rh(w,k)?m=null:M!==null&&rh(w,M)&&(a.flags|=32),a.memoizedState!==null&&(w=nd(r,a,GD,null,null,c),Ws._currentValue=w),ml(r,a),Ht(r,a,m,c),a.child;case 6:return r===null&&Ke&&((r=c=ct)&&(c=O2(c,a.pendingProps,Pn),c!==null?(a.stateNode=c,jt=a,ct=null,r=!0):r=!1),r||zr(a)),null;case 13:return QE(r,a,c);case 4:return $(a,a.stateNode.containerInfo),m=a.pendingProps,r===null?a.child=Li(a,null,m,c):Ht(r,a,m,c),a.child;case 11:return qE(r,a,a.type,a.pendingProps,c);case 7:return Ht(r,a,a.pendingProps,c),a.child;case 8:return Ht(r,a,a.pendingProps.children,c),a.child;case 12:return Ht(r,a,a.pendingProps.children,c),a.child;case 10:return m=a.pendingProps,Hr(a,a.type,m.value),Ht(r,a,m.children,c),a.child;case 9:return w=a.type._context,m=a.pendingProps.children,Ri(a),w=zt(w),m=m(w),a.flags|=1,Ht(r,a,m,c),a.child;case 14:return $E(r,a,a.type,a.pendingProps,c);case 15:return GE(r,a,a.type,a.pendingProps,c);case 19:return e0(r,a,c);case 31:return JD(r,a,c);case 22:return VE(r,a,c,a.pendingProps);case 24:return Ri(a),m=zt(Ct),r===null?(w=Vu(),w===null&&(w=st,k=$u(),w.pooledCache=k,k.refCount++,k!==null&&(w.pooledCacheLanes|=c),w=k),a.memoizedState={parent:m,cache:w},Ku(a),Hr(a,Ct,w)):((r.lanes&c)!==0&&(Yu(r,a),As(a,null,null,c),Ts()),w=r.memoizedState,k=a.memoizedState,w.parent!==m?(w={parent:m,cache:m},a.memoizedState=w,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=w),Hr(a,Ct,m)):(m=k.cache,Hr(a,Ct,m),m!==w.cache&&qu(a,[Ct],c,!0))),Ht(r,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function xr(r){r.flags|=4}function Nd(r,a,c,m,w){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(w&335544128)===w)if(r.stateNode.complete)r.flags|=8192;else if(k0())r.flags|=8192;else throw Ii=el,Wu}else r.flags&=-16777217}function n0(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!bx(a))if(k0())r.flags|=8192;else throw Ii=el,Wu}function bl(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?M_():536870912,r.lanes|=a,La|=a)}function Ls(r,a){if(!Ke)switch(r.tailMode){case"hidden":a=r.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function ut(r){var a=r.alternate!==null&&r.alternate.child===r.child,c=0,m=0;if(a)for(var w=r.child;w!==null;)c|=w.lanes|w.childLanes,m|=w.subtreeFlags&65011712,m|=w.flags&65011712,w.return=r,w=w.sibling;else for(w=r.child;w!==null;)c|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=r,w=w.sibling;return r.subtreeFlags|=m,r.childLanes=c,a}function t2(r,a,c){var m=a.pendingProps;switch(Pu(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(a),null;case 1:return ut(a),null;case 3:return c=a.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),a.memoizedState.cache!==m&&(a.flags|=2048),vr(Ct),ie(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(_a(a)?xr(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,ju())),ut(a),null;case 26:var w=a.type,k=a.memoizedState;return r===null?(xr(a),k!==null?(ut(a),n0(a,k)):(ut(a),Nd(a,w,null,m,c))):k?k!==r.memoizedState?(xr(a),ut(a),n0(a,k)):(ut(a),a.flags&=-16777217):(r=r.memoizedProps,r!==m&&xr(a),ut(a),Nd(a,w,r,m,c)),null;case 27:if(be(a),c=ue.current,w=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==m&&xr(a);else{if(!m){if(a.stateNode===null)throw Error(i(166));return ut(a),null}r=ee.current,_a(a)?MS(a):(r=cx(w,m,c),a.stateNode=r,xr(a))}return ut(a),null;case 5:if(be(a),w=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==m&&xr(a);else{if(!m){if(a.stateNode===null)throw Error(i(166));return ut(a),null}if(k=ee.current,_a(a))MS(a);else{var M=Il(ue.current);switch(k){case 1:k=M.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:k=M.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":k=M.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":k=M.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":k=M.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof m.is=="string"?M.createElement("select",{is:m.is}):M.createElement("select"),m.multiple?k.multiple=!0:m.size&&(k.size=m.size);break;default:k=typeof m.is=="string"?M.createElement(w,{is:m.is}):M.createElement(w)}}k[Ut]=a,k[rn]=m;e:for(M=a.child;M!==null;){if(M.tag===5||M.tag===6)k.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===a)break e;for(;M.sibling===null;){if(M.return===null||M.return===a)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}a.stateNode=k;e:switch(qt(k,w,m),w){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&xr(a)}}return ut(a),Nd(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,c),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==m&&xr(a);else{if(typeof m!="string"&&a.stateNode===null)throw Error(i(166));if(r=ue.current,_a(a)){if(r=a.stateNode,c=a.memoizedProps,m=null,w=jt,w!==null)switch(w.tag){case 27:case 5:m=w.memoizedProps}r[Ut]=a,r=!!(r.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||Q0(r.nodeValue,c)),r||zr(a,!0)}else r=Il(r).createTextNode(m),r[Ut]=a,a.stateNode=r}return ut(a),null;case 31:if(c=a.memoizedState,r===null||r.memoizedState!==null){if(m=_a(a),c!==null){if(r===null){if(!m)throw Error(i(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[Ut]=a}else Ai(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ut(a),r=!1}else c=ju(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return a.flags&256?(Sn(a),a):(Sn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return ut(a),null;case 13:if(m=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(w=_a(a),m!==null&&m.dehydrated!==null){if(r===null){if(!w)throw Error(i(318));if(w=a.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(i(317));w[Ut]=a}else Ai(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ut(a),w=!1}else w=ju(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=w),w=!0;if(!w)return a.flags&256?(Sn(a),a):(Sn(a),null)}return Sn(a),(a.flags&128)!==0?(a.lanes=c,a):(c=m!==null,r=r!==null&&r.memoizedState!==null,c&&(m=a.child,w=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(w=m.alternate.memoizedState.cachePool.pool),k=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(k=m.memoizedState.cachePool.pool),k!==w&&(m.flags|=2048)),c!==r&&c&&(a.child.flags|=8192),bl(a,a.updateQueue),ut(a),null);case 4:return ie(),r===null&&Qd(a.stateNode.containerInfo),ut(a),null;case 10:return vr(a.type),ut(a),null;case 19:if(H(St),m=a.memoizedState,m===null)return ut(a),null;if(w=(a.flags&128)!==0,k=m.rendering,k===null)if(w)Ls(m,!1);else{if(vt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(k=il(r),k!==null){for(a.flags|=128,Ls(m,!1),r=k.updateQueue,a.updateQueue=r,bl(a,r),a.subtreeFlags=0,r=c,c=a.child;c!==null;)NS(c,r),c=c.sibling;return U(St,St.current&1|2),Ke&&br(a,m.treeForkCount),a.child}r=r.sibling}m.tail!==null&&Oe()>El&&(a.flags|=128,w=!0,Ls(m,!1),a.lanes=4194304)}else{if(!w)if(r=il(k),r!==null){if(a.flags|=128,w=!0,r=r.updateQueue,a.updateQueue=r,bl(a,r),Ls(m,!0),m.tail===null&&m.tailMode==="hidden"&&!k.alternate&&!Ke)return ut(a),null}else 2*Oe()-m.renderingStartTime>El&&c!==536870912&&(a.flags|=128,w=!0,Ls(m,!1),a.lanes=4194304);m.isBackwards?(k.sibling=a.child,a.child=k):(r=m.last,r!==null?r.sibling=k:a.child=k,m.last=k)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=Oe(),r.sibling=null,c=St.current,U(St,w?c&1|2:c&1),Ke&&br(a,m.treeForkCount),r):(ut(a),null);case 22:case 23:return Sn(a),Ju(),m=a.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(a.flags|=8192):m&&(a.flags|=8192),m?(c&536870912)!==0&&(a.flags&128)===0&&(ut(a),a.subtreeFlags&6&&(a.flags|=8192)):ut(a),c=a.updateQueue,c!==null&&bl(a,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),m=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(m=a.memoizedState.cachePool.pool),m!==c&&(a.flags|=2048),r!==null&&H(Ni),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),vr(Ct),ut(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function n2(r,a){switch(Pu(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return vr(Ct),ie(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return be(a),null;case 31:if(a.memoizedState!==null){if(Sn(a),a.alternate===null)throw Error(i(340));Ai()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(Sn(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));Ai()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return H(St),null;case 4:return ie(),null;case 10:return vr(a.type),null;case 22:case 23:return Sn(a),Ju(),r!==null&&H(Ni),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return vr(Ct),null;case 25:return null;default:return null}}function r0(r,a){switch(Pu(a),a.tag){case 3:vr(Ct),ie();break;case 26:case 27:case 5:be(a);break;case 4:ie();break;case 31:a.memoizedState!==null&&Sn(a);break;case 13:Sn(a);break;case 19:H(St);break;case 10:vr(a.type);break;case 22:case 23:Sn(a),Ju(),r!==null&&H(Ni);break;case 24:vr(Ct)}}function Ds(r,a){try{var c=a.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var w=m.next;c=w;do{if((c.tag&r)===r){m=void 0;var k=c.create,M=c.inst;m=k(),M.destroy=m}c=c.next}while(c!==w)}}catch(q){tt(a,a.return,q)}}function Kr(r,a,c){try{var m=a.updateQueue,w=m!==null?m.lastEffect:null;if(w!==null){var k=w.next;m=k;do{if((m.tag&r)===r){var M=m.inst,q=M.destroy;if(q!==void 0){M.destroy=void 0,w=a;var Y=c,re=q;try{re()}catch(de){tt(w,Y,de)}}}m=m.next}while(m!==k)}}catch(de){tt(a,a.return,de)}}function i0(r){var a=r.updateQueue;if(a!==null){var c=r.stateNode;try{KS(a,c)}catch(m){tt(r,r.return,m)}}}function a0(r,a,c){c.props=Mi(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(m){tt(r,a,m)}}function Ms(r,a){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var m=r.stateNode;break;case 30:m=r.stateNode;break;default:m=r.stateNode}typeof c=="function"?r.refCleanup=c(m):c.current=m}}catch(w){tt(r,a,w)}}function nr(r,a){var c=r.ref,m=r.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(w){tt(r,a,w)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(w){tt(r,a,w)}else c.current=null}function s0(r){var a=r.type,c=r.memoizedProps,m=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(w){tt(r,r.return,w)}}function Od(r,a,c){try{var m=r.stateNode;w2(m,r.type,c,a),m[rn]=a}catch(w){tt(r,r.return,w)}}function o0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ti(r.type)||r.tag===4}function Id(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||o0(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.tag===27&&ti(r.type)||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 Ld(r,a,c){var m=r.tag;if(m===5||m===6)r=r.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(r),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=pr));else if(m!==4&&(m===27&&ti(r.type)&&(c=r.stateNode,a=null),r=r.child,r!==null))for(Ld(r,a,c),r=r.sibling;r!==null;)Ld(r,a,c),r=r.sibling}function yl(r,a,c){var m=r.tag;if(m===5||m===6)r=r.stateNode,a?c.insertBefore(r,a):c.appendChild(r);else if(m!==4&&(m===27&&ti(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(yl(r,a,c),r=r.sibling;r!==null;)yl(r,a,c),r=r.sibling}function l0(r){var a=r.stateNode,c=r.memoizedProps;try{for(var m=r.type,w=a.attributes;w.length;)a.removeAttributeNode(w[0]);qt(a,m,c),a[Ut]=r,a[rn]=c}catch(k){tt(r,r.return,k)}}var wr=!1,kt=!1,Dd=!1,c0=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function r2(r,a){if(r=r.containerInfo,th=Ul,r=SS(r),Au(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var w=m.anchorOffset,k=m.focusNode;m=m.focusOffset;try{c.nodeType,k.nodeType}catch{c=null;break e}var M=0,q=-1,Y=-1,re=0,de=0,pe=r,ae=null;t:for(;;){for(var oe;pe!==c||w!==0&&pe.nodeType!==3||(q=M+w),pe!==k||m!==0&&pe.nodeType!==3||(Y=M+m),pe.nodeType===3&&(M+=pe.nodeValue.length),(oe=pe.firstChild)!==null;)ae=pe,pe=oe;for(;;){if(pe===r)break t;if(ae===c&&++re===w&&(q=M),ae===k&&++de===m&&(Y=M),(oe=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=oe}c=q===-1||Y===-1?null:{start:q,end:Y}}else c=null}c=c||{start:0,end:0}}else c=null;for(nh={focusedElem:r,selectionRange:c},Ul=!1,Pt=a;Pt!==null;)if(a=Pt,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,Pt=r;else for(;Pt!==null;){switch(a=Pt,k=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)w=r[c],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&k!==null){r=void 0,c=a,w=k.memoizedProps,k=k.memoizedState,m=c.stateNode;try{var _e=Mi(c.type,w);r=m.getSnapshotBeforeUpdate(_e,k),m.__reactInternalSnapshotBeforeUpdate=r}catch(ke){tt(c,c.return,ke)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,c=r.nodeType,c===9)ah(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":ah(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=a.sibling,r!==null){r.return=a.return,Pt=r;break}Pt=a.return}}function u0(r,a,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Tr(r,c),m&4&&Ds(5,c);break;case 1:if(Tr(r,c),m&4)if(r=c.stateNode,a===null)try{r.componentDidMount()}catch(M){tt(c,c.return,M)}else{var w=Mi(c.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(w,a,r.__reactInternalSnapshotBeforeUpdate)}catch(M){tt(c,c.return,M)}}m&64&&i0(c),m&512&&Ms(c,c.return);break;case 3:if(Tr(r,c),m&64&&(r=c.updateQueue,r!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{KS(r,a)}catch(M){tt(c,c.return,M)}}break;case 27:a===null&&m&4&&l0(c);case 26:case 5:Tr(r,c),a===null&&m&4&&s0(c),m&512&&Ms(c,c.return);break;case 12:Tr(r,c);break;case 31:Tr(r,c),m&4&&f0(r,c);break;case 13:Tr(r,c),m&4&&p0(r,c),m&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=h2.bind(null,c),I2(r,c))));break;case 22:if(m=c.memoizedState!==null||wr,!m){a=a!==null&&a.memoizedState!==null||kt,w=wr;var k=kt;wr=m,(kt=a)&&!k?Ar(r,c,(c.subtreeFlags&8772)!==0):Tr(r,c),wr=w,kt=k}break;case 30:break;default:Tr(r,c)}}function d0(r){var a=r.alternate;a!==null&&(r.alternate=null,d0(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&uu(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var ht=null,sn=!1;function Cr(r,a,c){for(c=c.child;c!==null;)h0(r,a,c),c=c.sibling}function h0(r,a,c){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(mt,c)}catch{}switch(c.tag){case 26:kt||nr(c,a),Cr(r,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:kt||nr(c,a);var m=ht,w=sn;ti(c.type)&&(ht=c.stateNode,sn=!1),Cr(r,a,c),$s(c.stateNode),ht=m,sn=w;break;case 5:kt||nr(c,a);case 6:if(m=ht,w=sn,ht=null,Cr(r,a,c),ht=m,sn=w,ht!==null)if(sn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(c.stateNode)}catch(k){tt(c,a,k)}else try{ht.removeChild(c.stateNode)}catch(k){tt(c,a,k)}break;case 18:ht!==null&&(sn?(r=ht,ix(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),za(r)):ix(ht,c.stateNode));break;case 4:m=ht,w=sn,ht=c.stateNode.containerInfo,sn=!0,Cr(r,a,c),ht=m,sn=w;break;case 0:case 11:case 14:case 15:Kr(2,c,a),kt||Kr(4,c,a),Cr(r,a,c);break;case 1:kt||(nr(c,a),m=c.stateNode,typeof m.componentWillUnmount=="function"&&a0(c,a,m)),Cr(r,a,c);break;case 21:Cr(r,a,c);break;case 22:kt=(m=kt)||c.memoizedState!==null,Cr(r,a,c),kt=m;break;default:Cr(r,a,c)}}function f0(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{za(r)}catch(c){tt(a,a.return,c)}}}function p0(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{za(r)}catch(c){tt(a,a.return,c)}}function i2(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new c0),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new c0),a;default:throw Error(i(435,r.tag))}}function vl(r,a){var c=i2(r);a.forEach(function(m){if(!c.has(m)){c.add(m);var w=f2.bind(null,r,m);m.then(w,w)}})}function on(r,a){var c=a.deletions;if(c!==null)for(var m=0;m<c.length;m++){var w=c[m],k=r,M=a,q=M;e:for(;q!==null;){switch(q.tag){case 27:if(ti(q.type)){ht=q.stateNode,sn=!1;break e}break;case 5:ht=q.stateNode,sn=!1;break e;case 3:case 4:ht=q.stateNode.containerInfo,sn=!0;break e}q=q.return}if(ht===null)throw Error(i(160));h0(k,M,w),ht=null,sn=!1,k=w.alternate,k!==null&&(k.return=null),w.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)m0(a,r),a=a.sibling}var Wn=null;function m0(r,a){var c=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:on(a,r),ln(r),m&4&&(Kr(3,r,r.return),Ds(3,r),Kr(5,r,r.return));break;case 1:on(a,r),ln(r),m&512&&(kt||c===null||nr(c,c.return)),m&64&&wr&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var w=Wn;if(on(a,r),ln(r),m&512&&(kt||c===null||nr(c,c.return)),m&4){var k=c!==null?c.memoizedState:null;if(m=r.memoizedState,c===null)if(m===null)if(r.stateNode===null){e:{m=r.type,c=r.memoizedProps,w=w.ownerDocument||w;t:switch(m){case"title":k=w.getElementsByTagName("title")[0],(!k||k[ls]||k[Ut]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=w.createElement(m),w.head.insertBefore(k,w.querySelector("head > title"))),qt(k,m,c),k[Ut]=r,Ft(k),m=k;break e;case"link":var M=mx("link","href",w).get(m+(c.href||""));if(M){for(var q=0;q<M.length;q++)if(k=M[q],k.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&k.getAttribute("rel")===(c.rel==null?null:c.rel)&&k.getAttribute("title")===(c.title==null?null:c.title)&&k.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){M.splice(q,1);break t}}k=w.createElement(m),qt(k,m,c),w.head.appendChild(k);break;case"meta":if(M=mx("meta","content",w).get(m+(c.content||""))){for(q=0;q<M.length;q++)if(k=M[q],k.getAttribute("content")===(c.content==null?null:""+c.content)&&k.getAttribute("name")===(c.name==null?null:c.name)&&k.getAttribute("property")===(c.property==null?null:c.property)&&k.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&k.getAttribute("charset")===(c.charSet==null?null:c.charSet)){M.splice(q,1);break t}}k=w.createElement(m),qt(k,m,c),w.head.appendChild(k);break;default:throw Error(i(468,m))}k[Ut]=r,Ft(k),m=k}r.stateNode=m}else gx(w,r.type,r.stateNode);else r.stateNode=px(w,m,r.memoizedProps);else k!==m?(k===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):k.count--,m===null?gx(w,r.type,r.stateNode):px(w,m,r.memoizedProps)):m===null&&r.stateNode!==null&&Od(r,r.memoizedProps,c.memoizedProps)}break;case 27:on(a,r),ln(r),m&512&&(kt||c===null||nr(c,c.return)),c!==null&&m&4&&Od(r,r.memoizedProps,c.memoizedProps);break;case 5:if(on(a,r),ln(r),m&512&&(kt||c===null||nr(c,c.return)),r.flags&32){w=r.stateNode;try{ua(w,"")}catch(_e){tt(r,r.return,_e)}}m&4&&r.stateNode!=null&&(w=r.memoizedProps,Od(r,w,c!==null?c.memoizedProps:w)),m&1024&&(Dd=!0);break;case 6:if(on(a,r),ln(r),m&4){if(r.stateNode===null)throw Error(i(162));m=r.memoizedProps,c=r.stateNode;try{c.nodeValue=m}catch(_e){tt(r,r.return,_e)}}break;case 3:if(Ml=null,w=Wn,Wn=Ll(a.containerInfo),on(a,r),Wn=w,ln(r),m&4&&c!==null&&c.memoizedState.isDehydrated)try{za(a.containerInfo)}catch(_e){tt(r,r.return,_e)}Dd&&(Dd=!1,g0(r));break;case 4:m=Wn,Wn=Ll(r.stateNode.containerInfo),on(a,r),ln(r),Wn=m;break;case 12:on(a,r),ln(r);break;case 31:on(a,r),ln(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,vl(r,m)));break;case 13:on(a,r),ln(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Sl=Oe()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,vl(r,m)));break;case 22:w=r.memoizedState!==null;var Y=c!==null&&c.memoizedState!==null,re=wr,de=kt;if(wr=re||w,kt=de||Y,on(a,r),kt=de,wr=re,ln(r),m&8192)e:for(a=r.stateNode,a._visibility=w?a._visibility&-2:a._visibility|1,w&&(c===null||Y||wr||kt||Bi(r)),c=null,a=r;;){if(a.tag===5||a.tag===26){if(c===null){Y=c=a;try{if(k=Y.stateNode,w)M=k.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{q=Y.stateNode;var pe=Y.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;q.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(_e){tt(Y,Y.return,_e)}}}else if(a.tag===6){if(c===null){Y=a;try{Y.stateNode.nodeValue=w?"":Y.memoizedProps}catch(_e){tt(Y,Y.return,_e)}}}else if(a.tag===18){if(c===null){Y=a;try{var oe=Y.stateNode;w?ax(oe,!0):ax(Y.stateNode,!1)}catch(_e){tt(Y,Y.return,_e)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}m&4&&(m=r.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,vl(r,c))));break;case 19:on(a,r),ln(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,vl(r,m)));break;case 30:break;case 21:break;default:on(a,r),ln(r)}}function ln(r){var a=r.flags;if(a&2){try{for(var c,m=r.return;m!==null;){if(o0(m)){c=m;break}m=m.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var w=c.stateNode,k=Id(r);yl(r,k,w);break;case 5:var M=c.stateNode;c.flags&32&&(ua(M,""),c.flags&=-33);var q=Id(r);yl(r,q,M);break;case 3:case 4:var Y=c.stateNode.containerInfo,re=Id(r);Ld(r,re,Y);break;default:throw Error(i(161))}}catch(de){tt(r,r.return,de)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function g0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;g0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Tr(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)u0(r,a.alternate,a),a=a.sibling}function Bi(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Kr(4,a,a.return),Bi(a);break;case 1:nr(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&a0(a,a.return,c),Bi(a);break;case 27:$s(a.stateNode);case 26:case 5:nr(a,a.return),Bi(a);break;case 22:a.memoizedState===null&&Bi(a);break;case 30:Bi(a);break;default:Bi(a)}r=r.sibling}}function Ar(r,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var m=a.alternate,w=r,k=a,M=k.flags;switch(k.tag){case 0:case 11:case 15:Ar(w,k,c),Ds(4,k);break;case 1:if(Ar(w,k,c),m=k,w=m.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(re){tt(m,m.return,re)}if(m=k,w=m.updateQueue,w!==null){var q=m.stateNode;try{var Y=w.shared.hiddenCallbacks;if(Y!==null)for(w.shared.hiddenCallbacks=null,w=0;w<Y.length;w++)WS(Y[w],q)}catch(re){tt(m,m.return,re)}}c&&M&64&&i0(k),Ms(k,k.return);break;case 27:l0(k);case 26:case 5:Ar(w,k,c),c&&m===null&&M&4&&s0(k),Ms(k,k.return);break;case 12:Ar(w,k,c);break;case 31:Ar(w,k,c),c&&M&4&&f0(w,k);break;case 13:Ar(w,k,c),c&&M&4&&p0(w,k);break;case 22:k.memoizedState===null&&Ar(w,k,c),Ms(k,k.return);break;case 30:break;default:Ar(w,k,c)}a=a.sibling}}function Md(r,a){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&Ss(c))}function Bd(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ss(r))}function Kn(r,a,c,m){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)b0(r,a,c,m),a=a.sibling}function b0(r,a,c,m){var w=a.flags;switch(a.tag){case 0:case 11:case 15:Kn(r,a,c,m),w&2048&&Ds(9,a);break;case 1:Kn(r,a,c,m);break;case 3:Kn(r,a,c,m),w&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ss(r)));break;case 12:if(w&2048){Kn(r,a,c,m),r=a.stateNode;try{var k=a.memoizedProps,M=k.id,q=k.onPostCommit;typeof q=="function"&&q(M,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(Y){tt(a,a.return,Y)}}else Kn(r,a,c,m);break;case 31:Kn(r,a,c,m);break;case 13:Kn(r,a,c,m);break;case 23:break;case 22:k=a.stateNode,M=a.alternate,a.memoizedState!==null?k._visibility&2?Kn(r,a,c,m):Bs(r,a):k._visibility&2?Kn(r,a,c,m):(k._visibility|=2,Na(r,a,c,m,(a.subtreeFlags&10256)!==0||!1)),w&2048&&Md(M,a);break;case 24:Kn(r,a,c,m),w&2048&&Bd(a.alternate,a);break;default:Kn(r,a,c,m)}}function Na(r,a,c,m,w){for(w=w&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var k=r,M=a,q=c,Y=m,re=M.flags;switch(M.tag){case 0:case 11:case 15:Na(k,M,q,Y,w),Ds(8,M);break;case 23:break;case 22:var de=M.stateNode;M.memoizedState!==null?de._visibility&2?Na(k,M,q,Y,w):Bs(k,M):(de._visibility|=2,Na(k,M,q,Y,w)),w&&re&2048&&Md(M.alternate,M);break;case 24:Na(k,M,q,Y,w),w&&re&2048&&Bd(M.alternate,M);break;default:Na(k,M,q,Y,w)}a=a.sibling}}function Bs(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=r,m=a,w=m.flags;switch(m.tag){case 22:Bs(c,m),w&2048&&Md(m.alternate,m);break;case 24:Bs(c,m),w&2048&&Bd(m.alternate,m);break;default:Bs(c,m)}a=a.sibling}}var Fs=8192;function Oa(r,a,c){if(r.subtreeFlags&Fs)for(r=r.child;r!==null;)y0(r,a,c),r=r.sibling}function y0(r,a,c){switch(r.tag){case 26:Oa(r,a,c),r.flags&Fs&&r.memoizedState!==null&&$2(c,Wn,r.memoizedState,r.memoizedProps);break;case 5:Oa(r,a,c);break;case 3:case 4:var m=Wn;Wn=Ll(r.stateNode.containerInfo),Oa(r,a,c),Wn=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=Fs,Fs=16777216,Oa(r,a,c),Fs=m):Oa(r,a,c));break;default:Oa(r,a,c)}}function v0(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Ps(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];Pt=m,S0(m,r)}v0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)_0(r),r=r.sibling}function _0(r){switch(r.tag){case 0:case 11:case 15:Ps(r),r.flags&2048&&Kr(9,r,r.return);break;case 3:Ps(r);break;case 12:Ps(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,_l(r)):Ps(r);break;default:Ps(r)}}function _l(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];Pt=m,S0(m,r)}v0(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Kr(8,a,a.return),_l(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,_l(a));break;default:_l(a)}r=r.sibling}}function S0(r,a){for(;Pt!==null;){var c=Pt;switch(c.tag){case 0:case 11:case 15:Kr(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Ss(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Pt=m;else e:for(c=r;Pt!==null;){m=Pt;var w=m.sibling,k=m.return;if(d0(m),m===c){Pt=null;break e}if(w!==null){w.return=k,Pt=w;break e}Pt=k}}}var a2={getCacheForType:function(r){var a=zt(Ct),c=a.data.get(r);return c===void 0&&(c=r(),a.data.set(r,c)),c},cacheSignal:function(){return zt(Ct).controller.signal}},s2=typeof WeakMap=="function"?WeakMap:Map,Qe=0,st=null,qe=null,Ve=0,et=0,En=null,Yr=!1,Ia=!1,Fd=!1,kr=0,vt=0,Xr=0,Fi=0,Pd=0,xn=0,La=0,Us=null,cn=null,Ud=!1,Sl=0,E0=0,El=1/0,xl=null,Zr=null,It=0,Qr=null,Da=null,Rr=0,jd=0,zd=null,x0=null,js=0,Hd=null;function wn(){return(Qe&2)!==0&&Ve!==0?Ve&-Ve:W.T!==null?Kd():U_()}function w0(){if(xn===0)if((Ve&536870912)===0||Ke){var r=Qn;Qn<<=1,(Qn&3932160)===0&&(Qn=262144),xn=r}else xn=536870912;return r=_n.current,r!==null&&(r.flags|=32),xn}function un(r,a,c){(r===st&&(et===2||et===9)||r.cancelPendingCommit!==null)&&(Ma(r,0),Jr(r,Ve,xn,!1)),os(r,c),((Qe&2)===0||r!==st)&&(r===st&&((Qe&2)===0&&(Fi|=c),vt===4&&Jr(r,Ve,xn,!1)),rr(r))}function C0(r,a,c){if((Qe&6)!==0)throw Error(i(327));var m=!c&&(a&127)===0&&(a&r.expiredLanes)===0||Br(r,a),w=m?c2(r,a):$d(r,a,!0),k=m;do{if(w===0){Ia&&!m&&Jr(r,a,0,!1);break}else{if(c=r.current.alternate,k&&!o2(c)){w=$d(r,a,!1),k=!1;continue}if(w===2){if(k=a,r.errorRecoveryDisabledLanes&k)var M=0;else M=r.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){a=M;e:{var q=r;w=Us;var Y=q.current.memoizedState.isDehydrated;if(Y&&(Ma(q,M).flags|=256),M=$d(q,M,!1),M!==2){if(Fd&&!Y){q.errorRecoveryDisabledLanes|=k,Fi|=k,w=4;break e}k=cn,cn=w,k!==null&&(cn===null?cn=k:cn.push.apply(cn,k))}w=M}if(k=!1,w!==2)continue}}if(w===1){Ma(r,0),Jr(r,a,0,!0);break}e:{switch(m=r,k=w,k){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Jr(m,a,xn,!Yr);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(w=Sl+300-Oe(),10<w)){if(Jr(m,a,xn,!Yr),_i(m,0,!0)!==0)break e;Rr=a,m.timeoutHandle=nx(T0.bind(null,m,c,cn,xl,Ud,a,xn,Fi,La,Yr,k,"Throttled",-0,0),w);break e}T0(m,c,cn,xl,Ud,a,xn,Fi,La,Yr,k,null,-0,0)}}break}while(!0);rr(r)}function T0(r,a,c,m,w,k,M,q,Y,re,de,pe,ae,oe){if(r.timeoutHandle=-1,pe=a.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pr},y0(a,k,pe);var _e=(k&62914560)===k?Sl-Oe():(k&4194048)===k?E0-Oe():0;if(_e=G2(pe,_e),_e!==null){Rr=k,r.cancelPendingCommit=_e(D0.bind(null,r,a,k,c,m,w,M,q,Y,de,pe,null,ae,oe)),Jr(r,k,M,!re);return}}D0(r,a,k,c,m,w,M,q,Y)}function o2(r){for(var a=r;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var w=c[m],k=w.getSnapshot;w=w.value;try{if(!yn(k(),w))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Jr(r,a,c,m){a&=~Pd,a&=~Fi,r.suspendedLanes|=a,r.pingedLanes&=~a,m&&(r.warmLanes|=a),m=r.expirationTimes;for(var w=a;0<w;){var k=31-Je(w),M=1<<k;m[k]=-1,w&=~M}c!==0&&B_(r,c,a)}function wl(){return(Qe&6)===0?(zs(0),!1):!0}function qd(){if(qe!==null){if(et===0)var r=qe.return;else r=qe,yr=ki=null,ad(r),Ca=null,xs=0,r=qe;for(;r!==null;)r0(r.alternate,r),r=r.return;qe=null}}function Ma(r,a){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,A2(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Rr=0,qd(),st=r,qe=c=gr(r.current,null),Ve=a,et=0,En=null,Yr=!1,Ia=Br(r,a),Fd=!1,La=xn=Pd=Fi=Xr=vt=0,cn=Us=null,Ud=!1,(a&8)!==0&&(a|=a&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=a;0<m;){var w=31-Je(m),k=1<<w;a|=r[w],m&=~k}return kr=a,Go(),c}function A0(r,a){Me=null,W.H=Os,a===wa||a===Jo?(a=qS(),et=3):a===Wu?(a=qS(),et=4):et=a===Sd?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,En=a,qe===null&&(vt=1,fl(r,Mn(a,r.current)))}function k0(){var r=_n.current;return r===null?!0:(Ve&4194048)===Ve?Un===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?r===Un:!1}function R0(){var r=W.H;return W.H=Os,r===null?Os:r}function N0(){var r=W.A;return W.A=a2,r}function Cl(){vt=4,Yr||(Ve&4194048)!==Ve&&_n.current!==null||(Ia=!0),(Xr&134217727)===0&&(Fi&134217727)===0||st===null||Jr(st,Ve,xn,!1)}function $d(r,a,c){var m=Qe;Qe|=2;var w=R0(),k=N0();(st!==r||Ve!==a)&&(xl=null,Ma(r,a)),a=!1;var M=vt;e:do try{if(et!==0&&qe!==null){var q=qe,Y=En;switch(et){case 8:qd(),M=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(a=!0);var re=et;if(et=0,En=null,Ba(r,q,Y,re),c&&Ia){M=0;break e}break;default:re=et,et=0,En=null,Ba(r,q,Y,re)}}l2(),M=vt;break}catch(de){A0(r,de)}while(!0);return a&&r.shellSuspendCounter++,yr=ki=null,Qe=m,W.H=w,W.A=k,qe===null&&(st=null,Ve=0,Go()),M}function l2(){for(;qe!==null;)O0(qe)}function c2(r,a){var c=Qe;Qe|=2;var m=R0(),w=N0();st!==r||Ve!==a?(xl=null,El=Oe()+500,Ma(r,a)):Ia=Br(r,a);e:do try{if(et!==0&&qe!==null){a=qe;var k=En;t:switch(et){case 1:et=0,En=null,Ba(r,a,k,1);break;case 2:case 9:if(zS(k)){et=0,En=null,I0(a);break}a=function(){et!==2&&et!==9||st!==r||(et=7),rr(r)},k.then(a,a);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:zS(k)?(et=0,En=null,I0(a)):(et=0,En=null,Ba(r,a,k,7));break;case 5:var M=null;switch(qe.tag){case 26:M=qe.memoizedState;case 5:case 27:var q=qe;if(M?bx(M):q.stateNode.complete){et=0,En=null;var Y=q.sibling;if(Y!==null)qe=Y;else{var re=q.return;re!==null?(qe=re,Tl(re)):qe=null}break t}}et=0,En=null,Ba(r,a,k,5);break;case 6:et=0,En=null,Ba(r,a,k,6);break;case 8:qd(),vt=6;break e;default:throw Error(i(462))}}u2();break}catch(de){A0(r,de)}while(!0);return yr=ki=null,W.H=m,W.A=w,Qe=c,qe!==null?0:(st=null,Ve=0,Go(),vt)}function u2(){for(;qe!==null&&!Bt();)O0(qe)}function O0(r){var a=t0(r.alternate,r,kr);r.memoizedProps=r.pendingProps,a===null?Tl(r):qe=a}function I0(r){var a=r,c=a.alternate;switch(a.tag){case 15:case 0:a=YE(c,a,a.pendingProps,a.type,void 0,Ve);break;case 11:a=YE(c,a,a.pendingProps,a.type.render,a.ref,Ve);break;case 5:ad(a);default:r0(c,a),a=qe=NS(a,kr),a=t0(c,a,kr)}r.memoizedProps=r.pendingProps,a===null?Tl(r):qe=a}function Ba(r,a,c,m){yr=ki=null,ad(a),Ca=null,xs=0;var w=a.return;try{if(QD(r,w,a,c,Ve)){vt=1,fl(r,Mn(c,r.current)),qe=null;return}}catch(k){if(w!==null)throw qe=w,k;vt=1,fl(r,Mn(c,r.current)),qe=null;return}a.flags&32768?(Ke||m===1?r=!0:Ia||(Ve&536870912)!==0?r=!1:(Yr=r=!0,(m===2||m===9||m===3||m===6)&&(m=_n.current,m!==null&&m.tag===13&&(m.flags|=16384))),L0(a,r)):Tl(a)}function Tl(r){var a=r;do{if((a.flags&32768)!==0){L0(a,Yr);return}r=a.return;var c=t2(a.alternate,a,kr);if(c!==null){qe=c;return}if(a=a.sibling,a!==null){qe=a;return}qe=a=r}while(a!==null);vt===0&&(vt=5)}function L0(r,a){do{var c=n2(r.alternate,r);if(c!==null){c.flags&=32767,qe=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(r=r.sibling,r!==null)){qe=r;return}qe=r=c}while(r!==null);vt=6,qe=null}function D0(r,a,c,m,w,k,M,q,Y){r.cancelPendingCommit=null;do Al();while(It!==0);if((Qe&6)!==0)throw Error(i(327));if(a!==null){if(a===r.current)throw Error(i(177));if(k=a.lanes|a.childLanes,k|=Iu,qL(r,c,k,M,q,Y),r===st&&(qe=st=null,Ve=0),Da=a,Qr=r,Rr=c,jd=k,zd=w,x0=m,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,p2(ve,function(){return U0(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||m){m=W.T,W.T=null,w=Z.p,Z.p=2,M=Qe,Qe|=4;try{r2(r,a,c)}finally{Qe=M,Z.p=w,W.T=m}}It=1,M0(),B0(),F0()}}function M0(){if(It===1){It=0;var r=Qr,a=Da,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=W.T,W.T=null;var m=Z.p;Z.p=2;var w=Qe;Qe|=4;try{m0(a,r);var k=nh,M=SS(r.containerInfo),q=k.focusedElem,Y=k.selectionRange;if(M!==q&&q&&q.ownerDocument&&_S(q.ownerDocument.documentElement,q)){if(Y!==null&&Au(q)){var re=Y.start,de=Y.end;if(de===void 0&&(de=re),"selectionStart"in q)q.selectionStart=re,q.selectionEnd=Math.min(de,q.value.length);else{var pe=q.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),_e=q.textContent.length,ke=Math.min(Y.start,_e),it=Y.end===void 0?ke:Math.min(Y.end,_e);!oe.extend&&ke>it&&(M=it,it=ke,ke=M);var te=vS(q,ke),Q=vS(q,it);if(te&&Q&&(oe.rangeCount!==1||oe.anchorNode!==te.node||oe.anchorOffset!==te.offset||oe.focusNode!==Q.node||oe.focusOffset!==Q.offset)){var ne=pe.createRange();ne.setStart(te.node,te.offset),oe.removeAllRanges(),ke>it?(oe.addRange(ne),oe.extend(Q.node,Q.offset)):(ne.setEnd(Q.node,Q.offset),oe.addRange(ne))}}}}for(pe=[],oe=q;oe=oe.parentNode;)oe.nodeType===1&&pe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<pe.length;q++){var fe=pe[q];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Ul=!!th,nh=th=null}finally{Qe=w,Z.p=m,W.T=c}}r.current=a,It=2}}function B0(){if(It===2){It=0;var r=Qr,a=Da,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=W.T,W.T=null;var m=Z.p;Z.p=2;var w=Qe;Qe|=4;try{u0(r,a.alternate,a)}finally{Qe=w,Z.p=m,W.T=c}}It=3}}function F0(){if(It===4||It===3){It=0,Ne();var r=Qr,a=Da,c=Rr,m=x0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?It=5:(It=0,Da=Qr=null,P0(r,r.pendingLanes));var w=r.pendingLanes;if(w===0&&(Zr=null),lu(c),a=a.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(mt,a,void 0,(a.current.flags&128)===128)}catch{}if(m!==null){a=W.T,w=Z.p,Z.p=2,W.T=null;try{for(var k=r.onRecoverableError,M=0;M<m.length;M++){var q=m[M];k(q.value,{componentStack:q.stack})}}finally{W.T=a,Z.p=w}}(Rr&3)!==0&&Al(),rr(r),w=r.pendingLanes,(c&261930)!==0&&(w&42)!==0?r===Hd?js++:(js=0,Hd=r):js=0,zs(0)}}function P0(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Ss(a)))}function Al(){return M0(),B0(),F0(),U0()}function U0(){if(It!==5)return!1;var r=Qr,a=jd;jd=0;var c=lu(Rr),m=W.T,w=Z.p;try{Z.p=32>c?32:c,W.T=null,c=zd,zd=null;var k=Qr,M=Rr;if(It=0,Da=Qr=null,Rr=0,(Qe&6)!==0)throw Error(i(331));var q=Qe;if(Qe|=4,_0(k.current),b0(k,k.current,M,c),Qe=q,zs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(mt,k)}catch{}return!0}finally{Z.p=w,W.T=m,P0(r,a)}}function j0(r,a,c){a=Mn(c,a),a=_d(r.stateNode,a,2),r=Gr(r,a,2),r!==null&&(os(r,2),rr(r))}function tt(r,a,c){if(r.tag===3)j0(r,r,c);else for(;a!==null;){if(a.tag===3){j0(a,r,c);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Zr===null||!Zr.has(m))){r=Mn(c,r),c=zE(2),m=Gr(a,c,2),m!==null&&(HE(c,m,a,r),os(m,2),rr(m));break}}a=a.return}}function Gd(r,a,c){var m=r.pingCache;if(m===null){m=r.pingCache=new s2;var w=new Set;m.set(a,w)}else w=m.get(a),w===void 0&&(w=new Set,m.set(a,w));w.has(c)||(Fd=!0,w.add(c),r=d2.bind(null,r,a,c),a.then(r,r))}function d2(r,a,c){var m=r.pingCache;m!==null&&m.delete(a),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,st===r&&(Ve&c)===c&&(vt===4||vt===3&&(Ve&62914560)===Ve&&300>Oe()-Sl?(Qe&2)===0&&Ma(r,0):Pd|=c,La===Ve&&(La=0)),rr(r)}function z0(r,a){a===0&&(a=M_()),r=Ci(r,a),r!==null&&(os(r,a),rr(r))}function h2(r){var a=r.memoizedState,c=0;a!==null&&(c=a.retryLane),z0(r,c)}function f2(r,a){var c=0;switch(r.tag){case 31:case 13:var m=r.stateNode,w=r.memoizedState;w!==null&&(c=w.retryLane);break;case 19:m=r.stateNode;break;case 22:m=r.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(a),z0(r,c)}function p2(r,a){return ft(r,a)}var kl=null,Fa=null,Vd=!1,Rl=!1,Wd=!1,ei=0;function rr(r){r!==Fa&&r.next===null&&(Fa===null?kl=Fa=r:Fa=Fa.next=r),Rl=!0,Vd||(Vd=!0,g2())}function zs(r,a){if(!Wd&&Rl){Wd=!0;do for(var c=!1,m=kl;m!==null;){if(r!==0){var w=m.pendingLanes;if(w===0)var k=0;else{var M=m.suspendedLanes,q=m.pingedLanes;k=(1<<31-Je(42|r)+1)-1,k&=w&~(M&~q),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(c=!0,G0(m,k))}else k=Ve,k=_i(m,m===st?k:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(k&3)===0||Br(m,k)||(c=!0,G0(m,k));m=m.next}while(c);Wd=!1}}function m2(){H0()}function H0(){Rl=Vd=!1;var r=0;ei!==0&&T2()&&(r=ei);for(var a=Oe(),c=null,m=kl;m!==null;){var w=m.next,k=q0(m,a);k===0?(m.next=null,c===null?kl=w:c.next=w,w===null&&(Fa=c)):(c=m,(r!==0||(k&3)!==0)&&(Rl=!0)),m=w}It!==0&&It!==5||zs(r),ei!==0&&(ei=0)}function q0(r,a){for(var c=r.suspendedLanes,m=r.pingedLanes,w=r.expirationTimes,k=r.pendingLanes&-62914561;0<k;){var M=31-Je(k),q=1<<M,Y=w[M];Y===-1?((q&c)===0||(q&m)!==0)&&(w[M]=ss(q,a)):Y<=a&&(r.expiredLanes|=q),k&=~q}if(a=st,c=Ve,c=_i(r,r===a?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,c===0||r===a&&(et===2||et===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&Vt(m),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||Br(r,c)){if(a=c&-c,a===r.callbackPriority)return a;switch(m!==null&&Vt(m),lu(c)){case 2:case 8:c=me;break;case 32:c=ve;break;case 268435456:c=Ie;break;default:c=ve}return m=$0.bind(null,r),c=ft(c,m),r.callbackPriority=a,r.callbackNode=c,a}return m!==null&&m!==null&&Vt(m),r.callbackPriority=2,r.callbackNode=null,2}function $0(r,a){if(It!==0&&It!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(Al()&&r.callbackNode!==c)return null;var m=Ve;return m=_i(r,r===st?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(C0(r,m,a),q0(r,Oe()),r.callbackNode!=null&&r.callbackNode===c?$0.bind(null,r):null)}function G0(r,a){if(Al())return null;C0(r,a,!0)}function g2(){k2(function(){(Qe&6)!==0?ft(ce,m2):H0()})}function Kd(){if(ei===0){var r=Ea;r===0&&(r=gt,gt<<=1,(gt&261888)===0&&(gt=256)),ei=r}return ei}function V0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Fo(""+r)}function W0(r,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,r.id&&c.setAttribute("form",r.id),a.parentNode.insertBefore(c,a),r=new FormData(r),c.parentNode.removeChild(c),r}function b2(r,a,c,m,w){if(a==="submit"&&c&&c.stateNode===w){var k=V0((w[rn]||null).action),M=m.submitter;M&&(a=(a=M[rn]||null)?V0(a.formAction):M.getAttribute("formAction"),a!==null&&(k=a,M=null));var q=new zo("action","action",null,m,w);r.push({event:q,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(ei!==0){var Y=M?W0(w,M):new FormData(w);pd(c,{pending:!0,data:Y,method:w.method,action:k},null,Y)}}else typeof k=="function"&&(q.preventDefault(),Y=M?W0(w,M):new FormData(w),pd(c,{pending:!0,data:Y,method:w.method,action:k},k,Y))},currentTarget:w}]})}}for(var Yd=0;Yd<Ou.length;Yd++){var Xd=Ou[Yd],y2=Xd.toLowerCase(),v2=Xd[0].toUpperCase()+Xd.slice(1);Vn(y2,"on"+v2)}Vn(wS,"onAnimationEnd"),Vn(CS,"onAnimationIteration"),Vn(TS,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(MD,"onTransitionRun"),Vn(BD,"onTransitionStart"),Vn(FD,"onTransitionCancel"),Vn(AS,"onTransitionEnd"),la("onMouseEnter",["mouseout","mouseover"]),la("onMouseLeave",["mouseout","mouseover"]),la("onPointerEnter",["pointerout","pointerover"]),la("onPointerLeave",["pointerout","pointerover"]),Si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Si("onBeforeInput",["compositionend","keypress","textInput","paste"]),Si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hs="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(" "),_2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hs));function K0(r,a){a=(a&4)!==0;for(var c=0;c<r.length;c++){var m=r[c],w=m.event;m=m.listeners;e:{var k=void 0;if(a)for(var M=m.length-1;0<=M;M--){var q=m[M],Y=q.instance,re=q.currentTarget;if(q=q.listener,Y!==k&&w.isPropagationStopped())break e;k=q,w.currentTarget=re;try{k(w)}catch(de){$o(de)}w.currentTarget=null,k=Y}else for(M=0;M<m.length;M++){if(q=m[M],Y=q.instance,re=q.currentTarget,q=q.listener,Y!==k&&w.isPropagationStopped())break e;k=q,w.currentTarget=re;try{k(w)}catch(de){$o(de)}w.currentTarget=null,k=Y}}}}function $e(r,a){var c=a[cu];c===void 0&&(c=a[cu]=new Set);var m=r+"__bubble";c.has(m)||(Y0(a,r,2,!1),c.add(m))}function Zd(r,a,c){var m=0;a&&(m|=4),Y0(c,r,m,a)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Qd(r){if(!r[Nl]){r[Nl]=!0,H_.forEach(function(c){c!=="selectionchange"&&(_2.has(c)||Zd(c,!1,r),Zd(c,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Nl]||(a[Nl]=!0,Zd("selectionchange",!1,a))}}function Y0(r,a,c,m){switch(wx(a)){case 2:var w=K2;break;case 8:w=Y2;break;default:w=fh}c=w.bind(null,a,c,r),w=void 0,!yu||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(w=!0),m?w!==void 0?r.addEventListener(a,c,{capture:!0,passive:w}):r.addEventListener(a,c,!0):w!==void 0?r.addEventListener(a,c,{passive:w}):r.addEventListener(a,c,!1)}function Jd(r,a,c,m,w){var k=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var M=m.tag;if(M===3||M===4){var q=m.stateNode.containerInfo;if(q===w)break;if(M===4)for(M=m.return;M!==null;){var Y=M.tag;if((Y===3||Y===4)&&M.stateNode.containerInfo===w)return;M=M.return}for(;q!==null;){if(M=aa(q),M===null)return;if(Y=M.tag,Y===5||Y===6||Y===26||Y===27){m=k=M;continue e}q=q.parentNode}}m=m.return}eS(function(){var re=k,de=gu(c),pe=[];e:{var ae=kS.get(r);if(ae!==void 0){var oe=zo,_e=r;switch(r){case"keypress":if(Uo(c)===0)break e;case"keydown":case"keyup":oe=fD;break;case"focusin":_e="focus",oe=Eu;break;case"focusout":_e="blur",oe=Eu;break;case"beforeblur":case"afterblur":oe=Eu;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=rS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=tD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=gD;break;case wS:case CS:case TS:oe=iD;break;case AS:oe=yD;break;case"scroll":case"scrollend":oe=JL;break;case"wheel":oe=_D;break;case"copy":case"cut":case"paste":oe=sD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=aS;break;case"toggle":case"beforetoggle":oe=ED}var ke=(a&4)!==0,it=!ke&&(r==="scroll"||r==="scrollend"),te=ke?ae!==null?ae+"Capture":null:ae;ke=[];for(var Q=re,ne;Q!==null;){var fe=Q;if(ne=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ne===null||te===null||(fe=us(Q,te),fe!=null&&ke.push(qs(Q,fe,ne))),it)break;Q=Q.return}0<ke.length&&(ae=new oe(ae,_e,null,c,de),pe.push({event:ae,listeners:ke}))}}if((a&7)===0){e:{if(ae=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",ae&&c!==mu&&(_e=c.relatedTarget||c.fromElement)&&(aa(_e)||_e[ia]))break e;if((oe||ae)&&(ae=de.window===de?de:(ae=de.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(_e=c.relatedTarget||c.toElement,oe=re,_e=_e?aa(_e):null,_e!==null&&(it=l(_e),ke=_e.tag,_e!==it||ke!==5&&ke!==27&&ke!==6)&&(_e=null)):(oe=null,_e=re),oe!==_e)){if(ke=rS,fe="onMouseLeave",te="onMouseEnter",Q="mouse",(r==="pointerout"||r==="pointerover")&&(ke=aS,fe="onPointerLeave",te="onPointerEnter",Q="pointer"),it=oe==null?ae:cs(oe),ne=_e==null?ae:cs(_e),ae=new ke(fe,Q+"leave",oe,c,de),ae.target=it,ae.relatedTarget=ne,fe=null,aa(de)===re&&(ke=new ke(te,Q+"enter",_e,c,de),ke.target=ne,ke.relatedTarget=it,fe=ke),it=fe,oe&&_e)t:{for(ke=S2,te=oe,Q=_e,ne=0,fe=te;fe;fe=ke(fe))ne++;fe=0;for(var we=Q;we;we=ke(we))fe++;for(;0<ne-fe;)te=ke(te),ne--;for(;0<fe-ne;)Q=ke(Q),fe--;for(;ne--;){if(te===Q||Q!==null&&te===Q.alternate){ke=te;break t}te=ke(te),Q=ke(Q)}ke=null}else ke=null;oe!==null&&X0(pe,ae,oe,ke,!1),_e!==null&&it!==null&&X0(pe,it,_e,ke,!0)}}e:{if(ae=re?cs(re):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var Xe=fS;else if(dS(ae))if(pS)Xe=ID;else{Xe=ND;var Se=RD}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&pu(re.elementType)&&(Xe=fS):Xe=OD;if(Xe&&(Xe=Xe(r,re))){hS(pe,Xe,c,de);break e}Se&&Se(r,ae,re),r==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&fu(ae,"number",ae.value)}switch(Se=re?cs(re):window,r){case"focusin":(dS(Se)||Se.contentEditable==="true")&&(pa=Se,ku=re,ys=null);break;case"focusout":ys=ku=pa=null;break;case"mousedown":Ru=!0;break;case"contextmenu":case"mouseup":case"dragend":Ru=!1,ES(pe,c,de);break;case"selectionchange":if(DD)break;case"keydown":case"keyup":ES(pe,c,de)}var Pe;if(wu)e:{switch(r){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else fa?cS(r,c)&&(We="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(We="onCompositionStart");We&&(sS&&c.locale!=="ko"&&(fa||We!=="onCompositionStart"?We==="onCompositionEnd"&&fa&&(Pe=tS()):(Pr=de,vu="value"in Pr?Pr.value:Pr.textContent,fa=!0)),Se=Ol(re,We),0<Se.length&&(We=new iS(We,r,null,c,de),pe.push({event:We,listeners:Se}),Pe?We.data=Pe:(Pe=uS(c),Pe!==null&&(We.data=Pe)))),(Pe=wD?CD(r,c):TD(r,c))&&(We=Ol(re,"onBeforeInput"),0<We.length&&(Se=new iS("onBeforeInput","beforeinput",null,c,de),pe.push({event:Se,listeners:We}),Se.data=Pe)),b2(pe,r,re,c,de)}K0(pe,a)})}function qs(r,a,c){return{instance:r,listener:a,currentTarget:c}}function Ol(r,a){for(var c=a+"Capture",m=[];r!==null;){var w=r,k=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||k===null||(w=us(r,c),w!=null&&m.unshift(qs(r,w,k)),w=us(r,a),w!=null&&m.push(qs(r,w,k))),r.tag===3)return m;r=r.return}return[]}function S2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function X0(r,a,c,m,w){for(var k=a._reactName,M=[];c!==null&&c!==m;){var q=c,Y=q.alternate,re=q.stateNode;if(q=q.tag,Y!==null&&Y===m)break;q!==5&&q!==26&&q!==27||re===null||(Y=re,w?(re=us(c,k),re!=null&&M.unshift(qs(c,re,Y))):w||(re=us(c,k),re!=null&&M.push(qs(c,re,Y)))),c=c.return}M.length!==0&&r.push({event:a,listeners:M})}var E2=/\r\n?/g,x2=/\u0000|\uFFFD/g;function Z0(r){return(typeof r=="string"?r:""+r).replace(E2,`
|
|
9
|
-
`).replace(x2,"")}function Q0(r,a){return a=Z0(a),Z0(r)===a}function rt(r,a,c,m,w,k){switch(c){case"children":typeof m=="string"?a==="body"||a==="textarea"&&m===""||ua(r,m):(typeof m=="number"||typeof m=="bigint")&&a!=="body"&&ua(r,""+m);break;case"className":Mo(r,"class",m);break;case"tabIndex":Mo(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Mo(r,c,m);break;case"style":Q_(r,m,k);break;case"data":if(a!=="object"){Mo(r,"data",m);break}case"src":case"href":if(m===""&&(a!=="a"||c!=="href")){r.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=Fo(""+m),r.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(c==="formAction"?(a!=="input"&&rt(r,a,"name",w.name,w,null),rt(r,a,"formEncType",w.formEncType,w,null),rt(r,a,"formMethod",w.formMethod,w,null),rt(r,a,"formTarget",w.formTarget,w,null)):(rt(r,a,"encType",w.encType,w,null),rt(r,a,"method",w.method,w,null),rt(r,a,"target",w.target,w,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=Fo(""+m),r.setAttribute(c,m);break;case"onClick":m!=null&&(r.onclick=pr);break;case"onScroll":m!=null&&$e("scroll",r);break;case"onScrollEnd":m!=null&&$e("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(c=m.__html,c!=null){if(w.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}c=Fo(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""+m):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":m===!0?r.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,m):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(c,m):r.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(c):r.setAttribute(c,m);break;case"popover":$e("beforetoggle",r),$e("toggle",r),Do(r,"popover",m);break;case"xlinkActuate":fr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":fr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":fr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":fr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":fr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":fr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":fr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":fr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":fr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Do(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=ZL.get(c)||c,Do(r,c,m))}}function eh(r,a,c,m,w,k){switch(c){case"style":Q_(r,m,k);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(c=m.__html,c!=null){if(w.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"children":typeof m=="string"?ua(r,m):(typeof m=="number"||typeof m=="bigint")&&ua(r,""+m);break;case"onScroll":m!=null&&$e("scroll",r);break;case"onScrollEnd":m!=null&&$e("scrollend",r);break;case"onClick":m!=null&&(r.onclick=pr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!q_.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(w=c.endsWith("Capture"),a=c.slice(2,w?c.length-7:void 0),k=r[rn]||null,k=k!=null?k[c]:null,typeof k=="function"&&r.removeEventListener(a,k,w),typeof m=="function")){typeof k!="function"&&k!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(a,m,w);break e}c in r?r[c]=m:m===!0?r.setAttribute(c,""):Do(r,c,m)}}}function qt(r,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",r),$e("load",r);var m=!1,w=!1,k;for(k in c)if(c.hasOwnProperty(k)){var M=c[k];if(M!=null)switch(k){case"src":m=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:rt(r,a,k,M,c,null)}}w&&rt(r,a,"srcSet",c.srcSet,c,null),m&&rt(r,a,"src",c.src,c,null);return;case"input":$e("invalid",r);var q=k=M=w=null,Y=null,re=null;for(m in c)if(c.hasOwnProperty(m)){var de=c[m];if(de!=null)switch(m){case"name":w=de;break;case"type":M=de;break;case"checked":Y=de;break;case"defaultChecked":re=de;break;case"value":k=de;break;case"defaultValue":q=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,a));break;default:rt(r,a,m,de,c,null)}}K_(r,k,q,Y,re,M,w,!1);return;case"select":$e("invalid",r),m=M=k=null;for(w in c)if(c.hasOwnProperty(w)&&(q=c[w],q!=null))switch(w){case"value":k=q;break;case"defaultValue":M=q;break;case"multiple":m=q;default:rt(r,a,w,q,c,null)}a=k,c=M,r.multiple=!!m,a!=null?ca(r,!!m,a,!1):c!=null&&ca(r,!!m,c,!0);return;case"textarea":$e("invalid",r),k=w=m=null;for(M in c)if(c.hasOwnProperty(M)&&(q=c[M],q!=null))switch(M){case"value":m=q;break;case"defaultValue":w=q;break;case"children":k=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(91));break;default:rt(r,a,M,q,c,null)}X_(r,m,w,k);return;case"option":for(Y in c)c.hasOwnProperty(Y)&&(m=c[Y],m!=null)&&(Y==="selected"?r.selected=m&&typeof m!="function"&&typeof m!="symbol":rt(r,a,Y,m,c,null));return;case"dialog":$e("beforetoggle",r),$e("toggle",r),$e("cancel",r),$e("close",r);break;case"iframe":case"object":$e("load",r);break;case"video":case"audio":for(m=0;m<Hs.length;m++)$e(Hs[m],r);break;case"image":$e("error",r),$e("load",r);break;case"details":$e("toggle",r);break;case"embed":case"source":case"link":$e("error",r),$e("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in c)if(c.hasOwnProperty(re)&&(m=c[re],m!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:rt(r,a,re,m,c,null)}return;default:if(pu(a)){for(de in c)c.hasOwnProperty(de)&&(m=c[de],m!==void 0&&eh(r,a,de,m,c,void 0));return}}for(q in c)c.hasOwnProperty(q)&&(m=c[q],m!=null&&rt(r,a,q,m,c,null))}function w2(r,a,c,m){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,k=null,M=null,q=null,Y=null,re=null,de=null;for(oe in c){var pe=c[oe];if(c.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":Y=pe;default:m.hasOwnProperty(oe)||rt(r,a,oe,null,m,pe)}}for(var ae in m){var oe=m[ae];if(pe=c[ae],m.hasOwnProperty(ae)&&(oe!=null||pe!=null))switch(ae){case"type":k=oe;break;case"name":w=oe;break;case"checked":re=oe;break;case"defaultChecked":de=oe;break;case"value":M=oe;break;case"defaultValue":q=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,a));break;default:oe!==pe&&rt(r,a,ae,oe,m,pe)}}hu(r,M,q,Y,re,de,k,w);return;case"select":oe=M=q=ae=null;for(k in c)if(Y=c[k],c.hasOwnProperty(k)&&Y!=null)switch(k){case"value":break;case"multiple":oe=Y;default:m.hasOwnProperty(k)||rt(r,a,k,null,m,Y)}for(w in m)if(k=m[w],Y=c[w],m.hasOwnProperty(w)&&(k!=null||Y!=null))switch(w){case"value":ae=k;break;case"defaultValue":q=k;break;case"multiple":M=k;default:k!==Y&&rt(r,a,w,k,m,Y)}a=q,c=M,m=oe,ae!=null?ca(r,!!c,ae,!1):!!m!=!!c&&(a!=null?ca(r,!!c,a,!0):ca(r,!!c,c?[]:"",!1));return;case"textarea":oe=ae=null;for(q in c)if(w=c[q],c.hasOwnProperty(q)&&w!=null&&!m.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:rt(r,a,q,null,m,w)}for(M in m)if(w=m[M],k=c[M],m.hasOwnProperty(M)&&(w!=null||k!=null))switch(M){case"value":ae=w;break;case"defaultValue":oe=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:w!==k&&rt(r,a,M,w,m,k)}Y_(r,ae,oe);return;case"option":for(var _e in c)ae=c[_e],c.hasOwnProperty(_e)&&ae!=null&&!m.hasOwnProperty(_e)&&(_e==="selected"?r.selected=!1:rt(r,a,_e,null,m,ae));for(Y in m)ae=m[Y],oe=c[Y],m.hasOwnProperty(Y)&&ae!==oe&&(ae!=null||oe!=null)&&(Y==="selected"?r.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":rt(r,a,Y,ae,m,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in c)ae=c[ke],c.hasOwnProperty(ke)&&ae!=null&&!m.hasOwnProperty(ke)&&rt(r,a,ke,null,m,ae);for(re in m)if(ae=m[re],oe=c[re],m.hasOwnProperty(re)&&ae!==oe&&(ae!=null||oe!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,a));break;default:rt(r,a,re,ae,m,oe)}return;default:if(pu(a)){for(var it in c)ae=c[it],c.hasOwnProperty(it)&&ae!==void 0&&!m.hasOwnProperty(it)&&eh(r,a,it,void 0,m,ae);for(de in m)ae=m[de],oe=c[de],!m.hasOwnProperty(de)||ae===oe||ae===void 0&&oe===void 0||eh(r,a,de,ae,m,oe);return}}for(var te in c)ae=c[te],c.hasOwnProperty(te)&&ae!=null&&!m.hasOwnProperty(te)&&rt(r,a,te,null,m,ae);for(pe in m)ae=m[pe],oe=c[pe],!m.hasOwnProperty(pe)||ae===oe||ae==null&&oe==null||rt(r,a,pe,ae,m,oe)}function J0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var w=c[m],k=w.transferSize,M=w.initiatorType,q=w.duration;if(k&&q&&J0(M)){for(M=0,q=w.responseEnd,m+=1;m<c.length;m++){var Y=c[m],re=Y.startTime;if(re>q)break;var de=Y.transferSize,pe=Y.initiatorType;de&&J0(pe)&&(Y=Y.responseEnd,M+=de*(Y<q?1:(q-re)/(Y-re)))}if(--m,a+=8*(k+M)/(w.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var th=null,nh=null;function Il(r){return r.nodeType===9?r:r.ownerDocument}function ex(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function tx(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function rh(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var ih=null;function T2(){var r=window.event;return r&&r.type==="popstate"?r===ih?!1:(ih=r,!0):(ih=null,!1)}var nx=typeof setTimeout=="function"?setTimeout:void 0,A2=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,k2=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(r){return rx.resolve(null).then(r).catch(R2)}:nx;function R2(r){setTimeout(function(){throw r})}function ti(r){return r==="head"}function ix(r,a){var c=a,m=0;do{var w=c.nextSibling;if(r.removeChild(c),w&&w.nodeType===8)if(c=w.data,c==="/$"||c==="/&"){if(m===0){r.removeChild(w),za(a);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")$s(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,$s(c);for(var k=c.firstChild;k;){var M=k.nextSibling,q=k.nodeName;k[ls]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&k.rel.toLowerCase()==="stylesheet"||c.removeChild(k),k=M}}else c==="body"&&$s(r.ownerDocument.body);c=w}while(c);za(a)}function ax(r,a){var c=r;r=0;do{var m=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=m}while(c)}function ah(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":ah(c),uu(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function N2(r,a,c,m){for(;r.nodeType===1;){var w=c;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[ls])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(k=r.getAttribute("rel"),k==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(k!==w.rel||r.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||r.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||r.getAttribute("title")!==(w.title==null?null:w.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(k=r.getAttribute("src"),(k!==(w.src==null?null:w.src)||r.getAttribute("type")!==(w.type==null?null:w.type)||r.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&k&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var k=w.name==null?null:""+w.name;if(w.type==="hidden"&&r.getAttribute("name")===k)return r}else return r;if(r=jn(r.nextSibling),r===null)break}return null}function O2(r,a,c){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=jn(r.nextSibling),r===null))return null;return r}function sx(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=jn(r.nextSibling),r===null))return null;return r}function sh(r){return r.data==="$?"||r.data==="$~"}function oh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function I2(r,a){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||c.readyState!=="loading")a();else{var m=function(){a(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function jn(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var lh=null;function ox(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(a===0)return jn(r.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}r=r.nextSibling}return null}function lx(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return r;a--}else c!=="/$"&&c!=="/&"||a++}r=r.previousSibling}return null}function cx(r,a,c){switch(a=Il(c),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function $s(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);uu(r)}var zn=new Map,ux=new Set;function Ll(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Nr=Z.d;Z.d={f:L2,r:D2,D:M2,C:B2,L:F2,m:P2,X:j2,S:U2,M:z2};function L2(){var r=Nr.f(),a=wl();return r||a}function D2(r){var a=sa(r);a!==null&&a.tag===5&&a.type==="form"?AE(a):Nr.r(r)}var Pa=typeof document>"u"?null:document;function dx(r,a,c){var m=Pa;if(m&&typeof a=="string"&&a){var w=Ln(a);w='link[rel="'+r+'"][href="'+w+'"]',typeof c=="string"&&(w+='[crossorigin="'+c+'"]'),ux.has(w)||(ux.add(w),r={rel:r,crossOrigin:c,href:a},m.querySelector(w)===null&&(a=m.createElement("link"),qt(a,"link",r),Ft(a),m.head.appendChild(a)))}}function M2(r){Nr.D(r),dx("dns-prefetch",r,null)}function B2(r,a){Nr.C(r,a),dx("preconnect",r,a)}function F2(r,a,c){Nr.L(r,a,c);var m=Pa;if(m&&r&&a){var w='link[rel="preload"][as="'+Ln(a)+'"]';a==="image"&&c&&c.imageSrcSet?(w+='[imagesrcset="'+Ln(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(w+='[imagesizes="'+Ln(c.imageSizes)+'"]')):w+='[href="'+Ln(r)+'"]';var k=w;switch(a){case"style":k=Ua(r);break;case"script":k=ja(r)}zn.has(k)||(r=f({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:r,as:a},c),zn.set(k,r),m.querySelector(w)!==null||a==="style"&&m.querySelector(Gs(k))||a==="script"&&m.querySelector(Vs(k))||(a=m.createElement("link"),qt(a,"link",r),Ft(a),m.head.appendChild(a)))}}function P2(r,a){Nr.m(r,a);var c=Pa;if(c&&r){var m=a&&typeof a.as=="string"?a.as:"script",w='link[rel="modulepreload"][as="'+Ln(m)+'"][href="'+Ln(r)+'"]',k=w;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ja(r)}if(!zn.has(k)&&(r=f({rel:"modulepreload",href:r},a),zn.set(k,r),c.querySelector(w)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Vs(k)))return}m=c.createElement("link"),qt(m,"link",r),Ft(m),c.head.appendChild(m)}}}function U2(r,a,c){Nr.S(r,a,c);var m=Pa;if(m&&r){var w=oa(m).hoistableStyles,k=Ua(r);a=a||"default";var M=w.get(k);if(!M){var q={loading:0,preload:null};if(M=m.querySelector(Gs(k)))q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":a},c),(c=zn.get(k))&&ch(r,c);var Y=M=m.createElement("link");Ft(Y),qt(Y,"link",r),Y._p=new Promise(function(re,de){Y.onload=re,Y.onerror=de}),Y.addEventListener("load",function(){q.loading|=1}),Y.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Dl(M,a,m)}M={type:"stylesheet",instance:M,count:1,state:q},w.set(k,M)}}}function j2(r,a){Nr.X(r,a);var c=Pa;if(c&&r){var m=oa(c).hoistableScripts,w=ja(r),k=m.get(w);k||(k=c.querySelector(Vs(w)),k||(r=f({src:r,async:!0},a),(a=zn.get(w))&&uh(r,a),k=c.createElement("script"),Ft(k),qt(k,"link",r),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},m.set(w,k))}}function z2(r,a){Nr.M(r,a);var c=Pa;if(c&&r){var m=oa(c).hoistableScripts,w=ja(r),k=m.get(w);k||(k=c.querySelector(Vs(w)),k||(r=f({src:r,async:!0,type:"module"},a),(a=zn.get(w))&&uh(r,a),k=c.createElement("script"),Ft(k),qt(k,"link",r),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},m.set(w,k))}}function hx(r,a,c,m){var w=(w=ue.current)?Ll(w):null;if(!w)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=Ua(c.href),c=oa(w).hoistableStyles,m=c.get(a),m||(m={type:"style",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=Ua(c.href);var k=oa(w).hoistableStyles,M=k.get(r);if(M||(w=w.ownerDocument||w,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(r,M),(k=w.querySelector(Gs(r)))&&!k._p&&(M.instance=k,M.state.loading=5),zn.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},zn.set(r,c),k||H2(w,r,c,M.state))),a&&m===null)throw Error(i(528,""));return M}if(a&&m!==null)throw Error(i(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ja(c),c=oa(w).hoistableScripts,m=c.get(a),m||(m={type:"script",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Ua(r){return'href="'+Ln(r)+'"'}function Gs(r){return'link[rel="stylesheet"]['+r+"]"}function fx(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function H2(r,a,c,m){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?m.loading=1:(a=r.createElement("link"),m.preload=a,a.addEventListener("load",function(){return m.loading|=1}),a.addEventListener("error",function(){return m.loading|=2}),qt(a,"link",c),Ft(a),r.head.appendChild(a))}function ja(r){return'[src="'+Ln(r)+'"]'}function Vs(r){return"script[async]"+r}function px(r,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var m=r.querySelector('style[data-href~="'+Ln(c.href)+'"]');if(m)return a.instance=m,Ft(m),m;var w=f({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),Ft(m),qt(m,"style",w),Dl(m,c.precedence,r),a.instance=m;case"stylesheet":w=Ua(c.href);var k=r.querySelector(Gs(w));if(k)return a.state.loading|=4,a.instance=k,Ft(k),k;m=fx(c),(w=zn.get(w))&&ch(m,w),k=(r.ownerDocument||r).createElement("link"),Ft(k);var M=k;return M._p=new Promise(function(q,Y){M.onload=q,M.onerror=Y}),qt(k,"link",m),a.state.loading|=4,Dl(k,c.precedence,r),a.instance=k;case"script":return k=ja(c.src),(w=r.querySelector(Vs(k)))?(a.instance=w,Ft(w),w):(m=c,(w=zn.get(k))&&(m=f({},c),uh(m,w)),r=r.ownerDocument||r,w=r.createElement("script"),Ft(w),qt(w,"link",m),r.head.appendChild(w),a.instance=w);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(m=a.instance,a.state.loading|=4,Dl(m,c.precedence,r));return a.instance}function Dl(r,a,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=m.length?m[m.length-1]:null,k=w,M=0;M<m.length;M++){var q=m[M];if(q.dataset.precedence===a)k=q;else if(k!==w)break}k?k.parentNode.insertBefore(r,k.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(r,a.firstChild))}function ch(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function uh(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var Ml=null;function mx(r,a,c){if(Ml===null){var m=new Map,w=Ml=new Map;w.set(c,m)}else w=Ml,m=w.get(c),m||(m=new Map,w.set(c,m));if(m.has(r))return m;for(m.set(r,null),c=c.getElementsByTagName(r),w=0;w<c.length;w++){var k=c[w];if(!(k[ls]||k[Ut]||r==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var M=k.getAttribute(a)||"";M=r+M;var q=m.get(M);q?q.push(k):m.set(M,[k])}}return m}function gx(r,a,c){r=r.ownerDocument||r,r.head.insertBefore(c,a==="title"?r.querySelector("head > title"):null)}function q2(r,a,c){if(c===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function bx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function $2(r,a,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var w=Ua(m.href),k=a.querySelector(Gs(w));if(k){a=k._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=Bl.bind(r),a.then(r,r)),c.state.loading|=4,c.instance=k,Ft(k);return}k=a.ownerDocument||a,m=fx(m),(w=zn.get(w))&&ch(m,w),k=k.createElement("link"),Ft(k);var M=k;M._p=new Promise(function(q,Y){M.onload=q,M.onerror=Y}),qt(k,"link",m),c.instance=k}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=Bl.bind(r),a.addEventListener("load",c),a.addEventListener("error",c))}}var dh=0;function G2(r,a){return r.stylesheets&&r.count===0&&Pl(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var m=setTimeout(function(){if(r.stylesheets&&Pl(r,r.stylesheets),r.unsuspend){var k=r.unsuspend;r.unsuspend=null,k()}},6e4+a);0<r.imgBytes&&dh===0&&(dh=62500*C2());var w=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Pl(r,r.stylesheets),r.unsuspend)){var k=r.unsuspend;r.unsuspend=null,k()}},(r.imgBytes>dh?50:800)+a);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(w)}}:null}function Bl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pl(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Fl=null;function Pl(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Fl=new Map,a.forEach(V2,r),Fl=null,Bl.call(r))}function V2(r,a){if(!(a.state.loading&4)){var c=Fl.get(r);if(c)var m=c.get(null);else{c=new Map,Fl.set(r,c);for(var w=r.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<w.length;k++){var M=w[k];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(c.set(M.dataset.precedence,M),m=M)}m&&c.set(null,m)}w=a.instance,M=w.getAttribute("data-precedence"),k=c.get(M)||m,k===m&&c.set(null,w),c.set(M,w),this.count++,m=Bl.bind(this),w.addEventListener("load",m),w.addEventListener("error",m),k?k.parentNode.insertBefore(w,k.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(w,r.firstChild)),a.state.loading|=4}}var Ws={$$typeof:_,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function W2(r,a,c,m,w,k,M,q,Y){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=m,this.onUncaughtError=w,this.onCaughtError=k,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function yx(r,a,c,m,w,k,M,q,Y,re,de,pe){return r=new W2(r,a,c,M,Y,re,de,pe,q),a=1,k===!0&&(a|=24),k=vn(3,null,null,a),r.current=k,k.stateNode=r,a=$u(),a.refCount++,r.pooledCache=a,a.refCount++,k.memoizedState={element:m,isDehydrated:c,cache:a},Ku(k),r}function vx(r){return r?(r=ba,r):ba}function _x(r,a,c,m,w,k){w=vx(w),m.context===null?m.context=w:m.pendingContext=w,m=$r(a),m.payload={element:c},k=k===void 0?null:k,k!==null&&(m.callback=k),c=Gr(r,m,a),c!==null&&(un(c,r,a),Cs(c,r,a))}function Sx(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<a?c:a}}function hh(r,a){Sx(r,a),(r=r.alternate)&&Sx(r,a)}function Ex(r){if(r.tag===13||r.tag===31){var a=Ci(r,67108864);a!==null&&un(a,r,67108864),hh(r,67108864)}}function xx(r){if(r.tag===13||r.tag===31){var a=wn();a=ou(a);var c=Ci(r,a);c!==null&&un(c,r,a),hh(r,a)}}var Ul=!0;function K2(r,a,c,m){var w=W.T;W.T=null;var k=Z.p;try{Z.p=2,fh(r,a,c,m)}finally{Z.p=k,W.T=w}}function Y2(r,a,c,m){var w=W.T;W.T=null;var k=Z.p;try{Z.p=8,fh(r,a,c,m)}finally{Z.p=k,W.T=w}}function fh(r,a,c,m){if(Ul){var w=ph(m);if(w===null)Jd(r,a,m,jl,c),Cx(r,m);else if(Z2(w,r,a,c,m))m.stopPropagation();else if(Cx(r,m),a&4&&-1<X2.indexOf(r)){for(;w!==null;){var k=sa(w);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var M=Jn(k.pendingLanes);if(M!==0){var q=k;for(q.pendingLanes|=2,q.entangledLanes|=2;M;){var Y=1<<31-Je(M);q.entanglements[1]|=Y,M&=~Y}rr(k),(Qe&6)===0&&(El=Oe()+500,zs(0))}}break;case 31:case 13:q=Ci(k,2),q!==null&&un(q,k,2),wl(),hh(k,2)}if(k=ph(m),k===null&&Jd(r,a,m,jl,c),k===w)break;w=k}w!==null&&m.stopPropagation()}else Jd(r,a,m,null,c)}}function ph(r){return r=gu(r),mh(r)}var jl=null;function mh(r){if(jl=null,r=aa(r),r!==null){var a=l(r);if(a===null)r=null;else{var c=a.tag;if(c===13){if(r=u(a),r!==null)return r;r=null}else if(c===31){if(r=o(a),r!==null)return r;r=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return jl=r,null}function wx(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(je()){case ce:return 2;case me:return 8;case ve:case Ce:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var gh=!1,ni=null,ri=null,ii=null,Ks=new Map,Ys=new Map,ai=[],X2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Cx(r,a){switch(r){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ks.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(a.pointerId)}}function Xs(r,a,c,m,w,k){return r===null||r.nativeEvent!==k?(r={blockedOn:a,domEventName:c,eventSystemFlags:m,nativeEvent:k,targetContainers:[w]},a!==null&&(a=sa(a),a!==null&&Ex(a)),r):(r.eventSystemFlags|=m,a=r.targetContainers,w!==null&&a.indexOf(w)===-1&&a.push(w),r)}function Z2(r,a,c,m,w){switch(a){case"focusin":return ni=Xs(ni,r,a,c,m,w),!0;case"dragenter":return ri=Xs(ri,r,a,c,m,w),!0;case"mouseover":return ii=Xs(ii,r,a,c,m,w),!0;case"pointerover":var k=w.pointerId;return Ks.set(k,Xs(Ks.get(k)||null,r,a,c,m,w)),!0;case"gotpointercapture":return k=w.pointerId,Ys.set(k,Xs(Ys.get(k)||null,r,a,c,m,w)),!0}return!1}function Tx(r){var a=aa(r.target);if(a!==null){var c=l(a);if(c!==null){if(a=c.tag,a===13){if(a=u(c),a!==null){r.blockedOn=a,j_(r.priority,function(){xx(c)});return}}else if(a===31){if(a=o(c),a!==null){r.blockedOn=a,j_(r.priority,function(){xx(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function zl(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var c=ph(r.nativeEvent);if(c===null){c=r.nativeEvent;var m=new c.constructor(c.type,c);mu=m,c.target.dispatchEvent(m),mu=null}else return a=sa(c),a!==null&&Ex(a),r.blockedOn=c,!1;a.shift()}return!0}function Ax(r,a,c){zl(r)&&c.delete(a)}function Q2(){gh=!1,ni!==null&&zl(ni)&&(ni=null),ri!==null&&zl(ri)&&(ri=null),ii!==null&&zl(ii)&&(ii=null),Ks.forEach(Ax),Ys.forEach(Ax)}function Hl(r,a){r.blockedOn===a&&(r.blockedOn=null,gh||(gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Q2)))}var ql=null;function kx(r){ql!==r&&(ql=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ql===r&&(ql=null);for(var a=0;a<r.length;a+=3){var c=r[a],m=r[a+1],w=r[a+2];if(typeof m!="function"){if(mh(m||c)===null)continue;break}var k=sa(c);k!==null&&(r.splice(a,3),a-=3,pd(k,{pending:!0,data:w,method:c.method,action:m},m,w))}}))}function za(r){function a(Y){return Hl(Y,r)}ni!==null&&Hl(ni,r),ri!==null&&Hl(ri,r),ii!==null&&Hl(ii,r),Ks.forEach(a),Ys.forEach(a);for(var c=0;c<ai.length;c++){var m=ai[c];m.blockedOn===r&&(m.blockedOn=null)}for(;0<ai.length&&(c=ai[0],c.blockedOn===null);)Tx(c),c.blockedOn===null&&ai.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var w=c[m],k=c[m+1],M=w[rn]||null;if(typeof k=="function")M||kx(c);else if(M){var q=null;if(k&&k.hasAttribute("formAction")){if(w=k,M=k[rn]||null)q=M.formAction;else if(mh(w)!==null)continue}else q=M.action;typeof q=="function"?c[m+1]=q:(c.splice(m,3),m-=3),kx(c)}}}function Rx(){function r(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(M){return w=M})},focusReset:"manual",scroll:"manual"})}function a(){w!==null&&(w(),w=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,w=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),w!==null&&(w(),w=null)}}}function bh(r){this._internalRoot=r}$l.prototype.render=bh.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var c=a.current,m=wn();_x(c,m,r,a,null,null)},$l.prototype.unmount=bh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;_x(r.current,2,null,r,null,null),wl(),a[ia]=null}};function $l(r){this._internalRoot=r}$l.prototype.unstable_scheduleHydration=function(r){if(r){var a=U_();r={blockedOn:null,target:r,priority:a};for(var c=0;c<ai.length&&a!==0&&a<ai[c].priority;c++);ai.splice(c,0,r),c===0&&Tx(r)}};var Nx=t.version;if(Nx!=="19.2.3")throw Error(i(527,Nx,"19.2.3"));Z.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(a),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var J2={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gl.isDisabled&&Gl.supportsFiber)try{mt=Gl.inject(J2),at=Gl}catch{}}return Qs.createRoot=function(r,a){if(!s(r))throw Error(i(299));var c=!1,m="",w=FE,k=PE,M=UE;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(w=a.onUncaughtError),a.onCaughtError!==void 0&&(k=a.onCaughtError),a.onRecoverableError!==void 0&&(M=a.onRecoverableError)),a=yx(r,1,!1,null,null,c,m,null,w,k,M,Rx),r[ia]=a.current,Qd(r),new bh(a)},Qs.hydrateRoot=function(r,a,c){if(!s(r))throw Error(i(299));var m=!1,w="",k=FE,M=PE,q=UE,Y=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(w=c.identifierPrefix),c.onUncaughtError!==void 0&&(k=c.onUncaughtError),c.onCaughtError!==void 0&&(M=c.onCaughtError),c.onRecoverableError!==void 0&&(q=c.onRecoverableError),c.formState!==void 0&&(Y=c.formState)),a=yx(r,1,!0,a,c??null,m,w,Y,k,M,q,Rx),a.context=vx(null),c=a.current,m=wn(),m=ou(m),w=$r(m),w.callback=null,Gr(c,w,m),c=m,a.current.lanes=c,os(a,c),rr(a),r[ia]=a.current,Qd(r),new $l(a)},Qs.version="19.2.3",Qs}var jx;function lM(){if(jx)return _h.exports;jx=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(),_h.exports=oM(),_h.exports}var cM=lM(),es=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},dM=class{#e=uM;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},ji=new dM;function hM(e){setTimeout(e,0)}var Wi=typeof window>"u"||"Deno"in globalThis;function Jt(){}function fM(e,t){return typeof e=="function"?e(t):e}function Ky(e){return typeof e=="number"&&e>=0&&e!==1/0}function UN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hi(e,t){return typeof e=="function"?e(t):e}function qn(e,t){return typeof e=="function"?e(t):e}function zx(e,t){const{type:n="all",exact:i,fetchStatus:s,predicate:l,queryKey:u,stale:o}=e;if(u){if(i){if(t.queryHash!==Ov(u,t.options))return!1}else if(!go(t.queryKey,u))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||l&&!l(t))}function Hx(e,t){const{exact:n,status:i,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Ki(t.options.mutationKey)!==Ki(l))return!1}else if(!go(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function Ov(e,t){return(t?.queryKeyHashFn||Ki)(e)}function Ki(e){return JSON.stringify(e,(t,n)=>Yy(n)?Object.keys(n).sort().reduce((i,s)=>(i[s]=n[s],i),{}):n)}function go(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>go(e[n],t[n])):!1}var pM=Object.prototype.hasOwnProperty;function jN(e,t){if(e===t)return e;const n=qx(e)&&qx(t);if(!n&&!(Yy(e)&&Yy(t)))return t;const s=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),u=l.length,o=n?new Array(u):{};let d=0;for(let h=0;h<u;h++){const p=n?h:l[h],f=e[p],g=t[p];if(f===g){o[p]=f,(n?h<s:pM.call(e,p))&&d++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){o[p]=g;continue}const b=jN(f,g);o[p]=b,b===f&&d++}return s===u&&d===s?e:o}function pc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function qx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yy(e){if(!$x(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$x(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $x(e){return Object.prototype.toString.call(e)==="[object Object]"}function mM(e){return new Promise(t=>{ji.setTimeout(t,e)})}function Xy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jN(e,t):t}function gM(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function bM(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Iv=Symbol();function zN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Iv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Lv(e,t){return typeof e=="function"?e(...t):!!e}function yM(e,t,n){let i=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),i||(i=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var vM=class extends es{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Wi&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Dv=new vM;function Zy(){let e,t;const n=new Promise((s,l)=>{e=s,t=l});n.status="pending",n.catch(()=>{});function i(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},n.reject=s=>{i({status:"rejected",reason:s}),t(s)},n}var _M=hM;function SM(){let e=[],t=0,n=o=>{o()},i=o=>{o()},s=_M;const l=o=>{t?e.push(o):s(()=>{n(o)})},u=()=>{const o=e;e=[],o.length&&s(()=>{i(()=>{o.forEach(d=>{n(d)})})})};return{batch:o=>{let d;t++;try{d=o()}finally{t--,t||u()}return d},batchCalls:o=>(...d)=>{l(()=>{o(...d)})},schedule:l,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{i=o},setScheduler:o=>{s=o}}}var Lt=SM(),EM=class extends es{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Wi&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},mc=new EM;function xM(e){return Math.min(1e3*2**e,3e4)}function HN(e){return(e??"online")==="online"?mc.isOnline():!0}var Qy=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function qN(e){let t=!1,n=0,i;const s=Zy(),l=()=>s.status!=="pending",u=E=>{if(!l()){const y=new Qy(E);g(y),e.onCancel?.(y)}},o=()=>{t=!0},d=()=>{t=!1},h=()=>Dv.isFocused()&&(e.networkMode==="always"||mc.isOnline())&&e.canRun(),p=()=>HN(e.networkMode)&&e.canRun(),f=E=>{l()||(i?.(),s.resolve(E))},g=E=>{l()||(i?.(),s.reject(E))},b=()=>new Promise(E=>{i=y=>{(l()||h())&&E(y)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),x=()=>{if(l())return;let E;const y=n===0?e.initialPromise:void 0;try{E=y??e.fn()}catch(S){E=Promise.reject(S)}Promise.resolve(E).then(f).catch(S=>{if(l())return;const v=e.retry??(Wi?0:3),_=e.retryDelay??xM,C=typeof _=="function"?_(n,S):_,N=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,S);if(t||!N){g(S);return}n++,e.onFail?.(n,S),mM(C).then(()=>h()?void 0:b()).then(()=>{t?g(S):x()})})};return{promise:s,status:()=>s.status,cancel:u,continue:()=>(i?.(),s),cancelRetry:o,continueRetry:d,canStart:p,start:()=>(p()?x():b().then(x),s)}}var $N=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ky(this.gcTime)&&(this.#e=ji.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wi?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ji.clearTimeout(this.#e),this.#e=void 0)}},wM=class extends $N{#e;#t;#n;#i;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Vx(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Vx(this.options);t.data!==void 0&&(this.setState(Gx(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Xy(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Iv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!UN(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const o=this.observers.find(d=>d.options.queryFn);o&&this.setOptions(o.options)}const n=new AbortController,i=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const o=zN(this.options,t),h=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(p),p})();return this.#o=!1,this.options.persister?this.options.persister(o,h,this):o(h)},u=(()=>{const o={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return i(o),o})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#a({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=qN({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:o=>{o instanceof Qy&&o.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(o,d)=>{this.#a({type:"failed",failureCount:o,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const o=await this.#r.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#n.config.onSuccess?.(o,this),this.#n.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof Qy){if(o.silent)return this.#r.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#a({type:"error",error:o}),this.#n.config.onError?.(o,this),this.#n.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...GN(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...Gx(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Lt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function GN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var CM=class extends es{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#o=Zy(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#s;#o;#a;#m;#h;#f;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Wx(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!pc(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Kx(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),i&&(this.#t!==n||qn(this.options.enabled,this.#t)!==qn(t.enabled,this.#t)||hi(this.options.staleTime,this.#t)!==hi(t.staleTime,this.#t))&&this.#g();const s=this.#b();i&&(this.#t!==n||qn(this.options.enabled,this.#t)!==qn(t.enabled,this.#t)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return AM(this,n)&&(this.#i=n,this.#s=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Jt)),t}#g(){this.#_();const e=hi(this.options.staleTime,this.#t);if(Wi||this.#i.isStale||!Ky(e))return;const n=UN(this.#i.dataUpdatedAt,e)+1;this.#c=ji.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#S(),this.#l=e,!(Wi||qn(this.options.enabled,this.#t)===!1||!Ky(this.#l)||this.#l===0)&&(this.#u=ji.setInterval(()=>{(this.options.refetchIntervalInBackground||Dv.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#b())}#_(){this.#c&&(ji.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ji.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,i=this.options,s=this.#i,l=this.#r,u=this.#s,d=e!==n?e.state:this.#n,{state:h}=e;let p={...h},f=!1,g;if(t._optimisticResults){const R=this.hasListeners(),I=!R&&Wx(e,t),L=R&&Kx(e,n,t,i);(I||L)&&(p={...p,...GN(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:x,status:E}=p;g=p.data;let y=!1;if(t.placeholderData!==void 0&&g===void 0&&E==="pending"){let R;s?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(R=s.data,y=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(E="success",g=Xy(s?.data,R,t),f=!0)}if(t.select&&g!==void 0&&!y)if(s&&g===l?.data&&t.select===this.#m)g=this.#h;else try{this.#m=t.select,g=t.select(g),g=Xy(s?.data,g,t),this.#h=g,this.#a=null}catch(R){this.#a=R}this.#a&&(b=this.#a,g=this.#h,x=Date.now(),E="error");const S=p.fetchStatus==="fetching",v=E==="pending",_=E==="error",C=v&&S,N=g!==void 0,O={status:E,fetchStatus:p.fetchStatus,isPending:v,isSuccess:E==="success",isError:_,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!v,isLoadingError:_&&!N,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:_&&N,isStale:Mv(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=F=>{O.status==="error"?F.reject(O.error):O.data!==void 0&&F.resolve(O.data)},I=()=>{const F=this.#o=O.promise=Zy();R(F)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&R(L);break;case"fulfilled":(O.status==="error"||O.data!==L.value)&&I();break;case"rejected":(O.status!=="error"||O.error!==L.reason)&&I();break}}return O}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#f=this.#t),pc(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#p.size)return!0;const l=new Set(s??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const o=u;return this.#i[o]!==e[o]&&l.has(o)})};this.#x({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#x(e){Lt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function TM(e,t){return qn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wx(e,t){return TM(e,t)||e.state.data!==void 0&&Jy(e,t,t.refetchOnMount)}function Jy(e,t,n){if(qn(t.enabled,e)!==!1&&hi(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&Mv(e,t)}return!1}function Kx(e,t,n,i){return(e!==t||qn(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Mv(e,n)}function Mv(e,t){return qn(t.enabled,e)!==!1&&e.isStaleByTime(hi(t.staleTime,e))}function AM(e,t){return!pc(e.getCurrentResult(),t)}function Yx(e){return{onFetch:(t,n)=>{const i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},d=0;const h=async()=>{let p=!1;const f=x=>{yM(x,()=>t.signal,()=>p=!0)},g=zN(t.options,t.fetchOptions),b=async(x,E,y)=>{if(p)return Promise.reject();if(E==null&&x.pages.length)return Promise.resolve(x);const v=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:E,direction:y?"backward":"forward",meta:t.options.meta};return f(A),A})(),_=await g(v),{maxPages:C}=t.options,N=y?bM:gM;return{pages:N(x.pages,_,C),pageParams:N(x.pageParams,E,C)}};if(s&&l.length){const x=s==="backward",E=x?kM:Xx,y={pages:l,pageParams:u},S=E(i,y);o=await b(y,S,x)}else{const x=e??l.length;do{const E=d===0?u[0]??i.initialPageParam:Xx(i,o);if(d>0&&E==null)break;o=await b(o,E),d++}while(d<x)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function Xx(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function kM(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var RM=class extends $N{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||VN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=qN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",s=!this.#i.canStart();try{if(i)t();else{this.#r({type:"pending",variables:e,isPaused:s}),await this.#n.config.onMutate?.(e,this,n);const u=await this.options.onMutate?.(e,n);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:s})}const l=await this.#i.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,n),await this.options.onSuccess?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,e,this.state.context,n),this.#r({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,n)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,n)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Lt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function VN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var NM=class extends es{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const i=new RM({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){this.#e.add(e);const t=Vl(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Vl(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Vl(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Vl(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Lt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Hx(t,n))}findAll(e={}){return this.getAll().filter(t=>Hx(e,t))}notify(e){Lt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Lt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jt))))}};function Vl(e){return e.options.scope?.id}var OM=class extends es{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),pc(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ki(n.mutationKey)!==Ki(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??VN();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){Lt.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,i=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,i,s)}catch(l){Promise.reject(l)}try{this.#i.onSettled?.(t.data,null,n,i,s)}catch(l){Promise.reject(l)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,i,s)}catch(l){Promise.reject(l)}try{this.#i.onSettled?.(void 0,t.error,n,i,s)}catch(l){Promise.reject(l)}}}this.listeners.forEach(n=>{n(this.#t)})})}},IM=class extends es{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const i=t.queryKey,s=t.queryHash??Ov(i,t);let l=this.get(s);return l||(l=new wM({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Lt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>zx(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>zx(e,n)):t}notify(e){Lt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Lt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Lt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},LM=class{#e;#t;#n;#i;#r;#s;#o;#a;constructor(e={}){this.#e=e.queryCache||new IM,this.#t=e.mutationCache||new NM,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Dv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=mc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(hi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=fM(t,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Lt.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Lt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Lt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=Lt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(i).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return Lt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=Lt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,n);return n.throwOnError||(l=l.catch(Jt)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(hi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Yx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Yx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(i=>{go(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(i=>{go(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ov(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Iv&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},WN=K.createContext(void 0),mn=e=>{const t=K.useContext(WN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DM=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(WN.Provider,{value:e,children:t})),KN=K.createContext(!1),MM=()=>K.useContext(KN);KN.Provider;function BM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var FM=K.createContext(BM()),PM=()=>K.useContext(FM),UM=(e,t,n)=>{const i=n?.state.error&&typeof e.throwOnError=="function"?Lv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},jM=e=>{K.useEffect(()=>{e.clearReset()},[e])},zM=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||Lv(n,[e.error,i])),HM=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>n(i(...s)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qM=(e,t)=>e.isLoading&&e.isFetching&&!t,$M=(e,t)=>e?.suspense&&t.isPending,Zx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function GM(e,t,n){const i=MM(),s=PM(),l=mn(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const o=l.getQueryCache().get(u.queryHash);u._optimisticResults=i?"isRestoring":"optimistic",HM(u),UM(u,s,o),jM(s);const d=!l.getQueryCache().get(u.queryHash),[h]=K.useState(()=>new t(l,u)),p=h.getOptimisticResult(u),f=!i&&e.subscribed!==!1;if(K.useSyncExternalStore(K.useCallback(g=>{const b=f?h.subscribe(Lt.batchCalls(g)):Jt;return h.updateResult(),b},[h,f]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),K.useEffect(()=>{h.setOptions(u)},[u,h]),$M(u,p))throw Zx(u,h,s);if(zM({result:p,errorResetBoundary:s,throwOnError:u.throwOnError,query:o,suspense:u.suspense}))throw p.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,p),u.experimental_prefetchInRender&&!Wi&&qM(p,i)&&(d?Zx(u,h,s):o?.promise)?.catch(Jt).finally(()=>{h.updateResult()}),u.notifyOnChangeProps?p:h.trackResult(p)}function mi(e,t){return GM(e,CM)}function Xn(e,t){const n=mn(),[i]=K.useState(()=>new OM(n,e));K.useEffect(()=>{i.setOptions(e)},[i,e]);const s=K.useSyncExternalStore(K.useCallback(u=>i.subscribe(Lt.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=K.useCallback((u,o)=>{i.mutate(u,o).catch(Jt)},[i]);if(s.error&&Lv(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}const ev=new WeakMap,VM=new WeakMap,gc={current:[]};let wh=!1,co=0;const lo=new Set,Wl=new Map;function YN(e){for(const t of e){if(gc.current.includes(t))continue;gc.current.push(t),t.recompute();const n=VM.get(t);if(n)for(const i of n){const s=ev.get(i);s?.length&&YN(s)}}}function WM(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function KM(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function XN(e){if(co>0&&!Wl.has(e)&&Wl.set(e,e.prevState),lo.add(e),!(co>0)&&!wh)try{for(wh=!0;lo.size>0;){const t=Array.from(lo);lo.clear();for(const n of t){const i=Wl.get(n)??n.prevState;n.prevState=i,WM(n)}for(const n of t){const i=ev.get(n);i&&(gc.current.push(n),YN(i))}for(const n of t){const i=ev.get(n);if(i)for(const s of i)KM(s)}}}finally{wh=!1,gc.current=[],Wl.clear()}}function uo(e){co++;try{e()}finally{if(co--,co===0){const t=lo.values().next().value;t&&XN(t)}}}function YM(e){return typeof e=="function"}class XM{constructor(t,n){this.listeners=new Set,this.subscribe=i=>{var s,l;this.listeners.add(i);const u=(l=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:l.call(s,i,this);return()=>{this.listeners.delete(i),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,i,s;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):YM(t)?this.state=t(this.prevState):this.state=t,(s=(i=this.options)==null?void 0:i.onUpdate)==null||s.call(i),XN(this)}}const fi="__TSR_index",Qx="popstate",Jx="beforeunload";function ZM(e){let t=e.getLocation();const n=new Set,i=u=>{t=e.getLocation(),n.forEach(o=>o({location:t,action:u}))},s=u=>{e.notifyOnIndexChange??!0?i(u):t=e.getLocation()},l=async({task:u,navigateOpts:o,...d})=>{if(o?.ignoreBlocker??!1){u();return}const p=e.getBlockers?.()??[],f=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const g of p){const b=bc(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:b,action:d.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,o,d)=>{const h=t.state[fi];o=ew(h+1,o),l({task:()=>{e.pushState(u,o),i({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:u,state:o})},replace:(u,o,d)=>{const h=t.state[fi];o=ew(h,o),l({task:()=>{e.replaceState(u,o),i({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:u,state:o})},go:(u,o)=>{l({task:()=>{e.go(u),s({type:"GO",index:u})},navigateOpts:o,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[fi]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const o=e.getBlockers?.()??[];return e.setBlockers([...o,u]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:i}}function ew(e,t){t||(t={});const n=Bv();return{...t,key:n,__TSR_key:n,[fi]:e}}function QM(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,i=t.history.replaceState;let s=[];const l=()=>s,u=R=>s=R,o=(R=>R),d=(()=>bc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=Bv();t.history.replaceState({[fi]:0,key:R,__TSR_key:R},"")}let h=d(),p,f=!1,g=!1,b=!1,x=!1;const E=()=>h;let y,S;const v=()=>{y&&(O._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),O._ignoreSubscribers=!1,y=void 0,S=void 0,p=void 0)},_=(R,I,L)=>{const F=o(I);S||(p=h),h=bc(I,L),y={href:F,state:L,isPush:y?.isPush||R==="push"},S||(S=Promise.resolve().then(()=>v()))},C=R=>{h=d(),O.notify({type:R})},N=async()=>{if(g){g=!1;return}const R=d(),I=R.state[fi]-h.state[fi],L=I===1,F=I===-1,j=!L&&!F||f;f=!1;const z=j?"GO":F?"BACK":"FORWARD",G=j?{type:"GO",index:I}:{type:F?"BACK":"FORWARD"};if(b)b=!1;else{const V=l();if(typeof document<"u"&&V.length){for(const W of V)if(await W.blockerFn({currentLocation:h,nextLocation:R,action:z})){g=!0,t.history.go(1),O.notify(G);return}}}h=d(),O.notify(G)},A=R=>{if(x){x=!1;return}let I=!1;const L=l();if(typeof document<"u"&&L.length)for(const F of L){const j=F.enableBeforeUnload??!0;if(j===!0){I=!0;break}if(typeof j=="function"&&j()===!0){I=!0;break}}if(I)return R.preventDefault(),R.returnValue=""},O=ZM({getLocation:E,getLength:()=>t.history.length,pushState:(R,I)=>_("push",R,I),replaceState:(R,I)=>_("replace",R,I),back:R=>(R&&(b=!0),x=!0,t.history.back()),forward:R=>{R&&(b=!0),x=!0,t.history.forward()},go:R=>{f=!0,t.history.go(R)},createHref:R=>o(R),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=i,t.removeEventListener(Jx,A,{capture:!0}),t.removeEventListener(Qx,N)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(Jx,A,{capture:!0}),t.addEventListener(Qx,N),t.history.pushState=function(...R){const I=n.apply(t.history,R);return O._ignoreSubscribers||C("PUSH"),I},t.history.replaceState=function(...R){const I=i.apply(t.history,R);return O._ignoreSubscribers||C("REPLACE"),I},O}function JM(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function bc(e,t){const n=JM(e),i=n.indexOf("#"),s=n.indexOf("?"),l=Bv();return{href:n,pathname:n.substring(0,i>0?s>0?Math.min(i,s):i:s>0?s:n.length),hash:i>-1?n.substring(i):"",search:s>-1?n.slice(s,i===-1?void 0:i):"",state:t||{[fi]:0,key:l,__TSR_key:l}}}function Bv(){return(Math.random()+1).toString(36).substring(7)}function yc(e){return e[e.length-1]}function eB(e){return typeof e=="function"}function ci(e,t){return eB(e)?e(t):e}const tB=Object.prototype.hasOwnProperty;function Hn(e,t){if(e===t)return e;const n=t,i=rw(e)&&rw(n);if(!i&&!(vc(e)&&vc(n)))return n;const s=i?e:tw(e);if(!s)return n;const l=i?n:tw(n);if(!l)return n;const u=s.length,o=l.length,d=i?new Array(o):{};let h=0;for(let p=0;p<o;p++){const f=i?p:l[p],g=e[f],b=n[f];if(g===b){d[f]=g,(i?p<u:tB.call(e,f))&&h++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){d[f]=b;continue}const x=Hn(g,b);d[f]=x,x===g&&h++}return u===o&&h===u?e:d}function tw(e){const t=[],n=Object.getOwnPropertyNames(e);for(const s of n){if(!Object.prototype.propertyIsEnumerable.call(e,s))return!1;t.push(s)}const i=Object.getOwnPropertySymbols(e);for(const s of i){if(!Object.prototype.propertyIsEnumerable.call(e,s))return!1;t.push(s)}return t}function vc(e){if(!nw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!nw(n)||!n.hasOwnProperty("isPrototypeOf"))}function nw(e){return Object.prototype.toString.call(e)==="[object Object]"}function rw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qi(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(!qi(e[i],t[i],n))return!1;return!0}if(vc(e)&&vc(t)){const i=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!i||t[u]!==void 0)&&!qi(e[u],t[u],n))return!1;return!0}let s=0;if(!i)s=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&s++;let l=0;for(const u in t)if((!i||t[u]!==void 0)&&(l++,l>s||!qi(e[u],t[u],n)))return!1;return s===l}return!1}function Ya(e){let t,n;const i=new Promise((s,l)=>{t=s,n=l});return i.status="pending",i.resolve=s=>{i.status="resolved",i.value=s,t(s),e?.(s)},i.reject=s=>{i.status="rejected",n(s)},i}function pi(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function nB(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function iw(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return nB(t)}const ZN=["http:","https:","mailto:","tel:"];function _c(e){if(!e)return!1;try{const t=new URL(e);return!ZN.includes(t.protocol)}catch{return!1}}const rB={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},iB=/[&><\u2028\u2029]/g;function aB(e){return e.replace(iB,t=>rB[t])}function aw(e,t){if(!e)return e;const n=/%25|%5C/gi;let i=0,s="",l;for(;(l=n.exec(e))!==null;)s+=iw(e.slice(i,l.index))+l[0],i=n.lastIndex;return s=s+iw(i?e.slice(i):e),s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}var sB="Invariant failed";function Lr(e,t){if(!e)throw new Error(sB)}function Sc(e){const t=new Map;let n,i;const s=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,i&&(i.next=l,l.prev=i)):(l.next.prev=void 0,n=l.next,l.next=void 0,i&&(l.prev=i,i.next=l)),i=l)};return{get(l){const u=t.get(l);if(u)return s(u),u.value},set(l,u){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===i&&(i=void 0)}const o=t.get(l);if(o)o.value=u,s(o);else{const d={key:l,value:u,prev:i};i&&(i.next=d),i=d,n||(n=d),t.set(l,d)}},clear(){t.clear(),n=void 0,i=void 0}}}const Xa=0,Yi=1,Xi=2,bo=3,Va=4,oB=5,lB=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,cB=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,uB=/^([^{]*)\{\$\}([^}]*)$/;function Fv(e,t,n=new Uint16Array(6)){const i=e.indexOf("/",t),s=i===-1?e.length:i,l=e.substring(t,s);if(!l||!l.includes("$"))return n[0]=Xa,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(l==="$"){const h=e.length;return n[0]=Xi,n[1]=t,n[2]=t,n[3]=h,n[4]=h,n[5]=h,n}if(l.charCodeAt(0)===36)return n[0]=Yi,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const u=l.match(uB);if(u){const p=u[1].length;return n[0]=Xi,n[1]=t+p,n[2]=t+p+1,n[3]=t+p+2,n[4]=t+p+3,n[5]=e.length,n}const o=l.match(cB);if(o){const h=o[1],p=o[2],f=o[3],g=h.length;return n[0]=bo,n[1]=t+g,n[2]=t+g+3,n[3]=t+g+3+p.length,n[4]=s-f.length,n[5]=s,n}const d=l.match(lB);if(d){const h=d[1],p=d[2],f=d[3],g=h.length;return n[0]=Yi,n[1]=t+g,n[2]=t+g+2,n[3]=t+g+2+p.length,n[4]=s-f.length,n[5]=s,n}return n[0]=Xa,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function Fc(e,t,n,i,s,l,u){u?.(n);let o=i;{const d=n.fullPath??n.from,h=d.length,p=n.options?.caseSensitive??e,f=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;o<h;){const b=Fv(d,o,t);let x;const E=o,y=b[5];switch(o=y+1,l++,b[0]){case Xa:{const v=d.substring(b[2],b[3]);if(p){const _=s.static?.get(v);if(_)x=_;else{s.static??=new Map;const C=zi(n.fullPath??n.from);C.parent=s,C.depth=l,x=C,s.static.set(v,C)}}else{const _=v.toLowerCase(),C=s.staticInsensitive?.get(_);if(C)x=C;else{s.staticInsensitive??=new Map;const N=zi(n.fullPath??n.from);N.parent=s,N.depth=l,x=N,s.staticInsensitive.set(_,N)}}break}case Yi:{const v=d.substring(E,b[1]),_=d.substring(b[4],y),C=p&&!!(v||_),N=v?C?v:v.toLowerCase():void 0,A=_?C?_:_.toLowerCase():void 0,O=!f&&s.dynamic?.find(R=>!R.skipOnParamError&&R.caseSensitive===C&&R.prefix===N&&R.suffix===A);if(O)x=O;else{const R=Th(Yi,n.fullPath??n.from,C,N,A);x=R,R.depth=l,R.parent=s,s.dynamic??=[],s.dynamic.push(R)}break}case bo:{const v=d.substring(E,b[1]),_=d.substring(b[4],y),C=p&&!!(v||_),N=v?C?v:v.toLowerCase():void 0,A=_?C?_:_.toLowerCase():void 0,O=!f&&s.optional?.find(R=>!R.skipOnParamError&&R.caseSensitive===C&&R.prefix===N&&R.suffix===A);if(O)x=O;else{const R=Th(bo,n.fullPath??n.from,C,N,A);x=R,R.parent=s,R.depth=l,s.optional??=[],s.optional.push(R)}break}case Xi:{const v=d.substring(E,b[1]),_=d.substring(b[4],y),C=p&&!!(v||_),N=v?C?v:v.toLowerCase():void 0,A=_?C?_:_.toLowerCase():void 0,O=Th(Xi,n.fullPath??n.from,C,N,A);x=O,O.parent=s,O.depth=l,s.wildcard??=[],s.wildcard.push(O)}}s=x}if(f&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const b=zi(n.fullPath??n.from);b.kind=oB,b.parent=s,l++,b.depth=l,s.pathless??=[],s.pathless.push(b),s=b}const g=(n.path||!n.children)&&!n.isRoot;if(g&&d.endsWith("/")){const b=zi(n.fullPath??n.from);b.kind=Va,b.parent=s,l++,b.depth=l,s.index=b,s=b}s.parse=n.options?.params?.parse??null,s.skipOnParamError=f,s.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,g&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Fc(e,t,d,o,s,l,u)}function Ch(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function li(e){if(e.pathless)for(const t of e.pathless)li(t);if(e.static)for(const t of e.static.values())li(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())li(t);if(e.dynamic?.length){e.dynamic.sort(Ch);for(const t of e.dynamic)li(t)}if(e.optional?.length){e.optional.sort(Ch);for(const t of e.optional)li(t)}if(e.wildcard?.length){e.wildcard.sort(Ch);for(const t of e.wildcard)li(t)}}function zi(e){return{kind:Xa,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Th(e,t,n,i,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:i,suffix:s}}function dB(e,t){const n=zi("/"),i=new Uint16Array(6);for(const s of e)Fc(!1,i,s,1,n,0);li(n),t.masksTree=n,t.flatCache=Sc(1e3)}function hB(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const i=Pv(e,t.masksTree);return t.flatCache.set(e,i),i}function fB(e,t,n,i,s){e||="/",i||="/";const l=t?`case\0${e}`:e;let u=s.singleCache.get(l);if(!u){u=zi("/");const o=new Uint16Array(6);Fc(t,o,{from:e},1,u,0),s.singleCache.set(l,u)}return Pv(i,u,n)}function pB(e,t,n=!1){const i=n?e:`nofuzz\0${e}`,s=t.matchCache.get(i);if(s!==void 0)return s;e||="/";const l=Pv(e,t.segmentTree,n);return l&&(l.branch=bB(l.route)),t.matchCache.set(i,l),l}function mB(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function gB(e,t=!1,n){const i=zi(e.fullPath),s=new Uint16Array(6),l={},u={};let o=0;return Fc(t,s,e,1,i,0,h=>{if(n?.(h,o),Lr(!(h.id in l),`Duplicate routes found with id: ${String(h.id)}`),l[h.id]=h,o!==0&&h.path){const p=mB(h.fullPath);(!u[p]||h.fullPath.endsWith("/"))&&(u[p]=h)}o++}),li(i),{processedTree:{segmentTree:i,singleCache:Sc(1e3),matchCache:Sc(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Pv(e,t,n=!1){const i=e.split("/"),s=vB(e,i,t,n);if(!s)return null;const[l]=QN(e,i,s);return{route:s.node.route,rawParams:l,parsedParams:s.parsedParams}}function QN(e,t,n){const i=yB(n.node);let s=null;const l={};let u=n.extract?.part??0,o=n.extract?.node??0,d=n.extract?.path??0;for(;o<i.length;u++,o++,d++){const h=i[o],p=t[u],f=d;if(p&&(d+=p.length),h.kind===Yi){s??=n.node.fullPath.split("/");const g=s[o],b=h.prefix?.length??0;if(g.charCodeAt(b)===123){const E=h.suffix?.length??0,y=g.substring(b+2,g.length-E-1),S=p.substring(b,p.length-E);l[y]=decodeURIComponent(S)}else{const E=g.substring(1);l[E]=decodeURIComponent(p)}}else if(h.kind===bo){if(n.skipped&1<<o){u--;continue}s??=n.node.fullPath.split("/");const g=s[o],b=h.prefix?.length??0,x=h.suffix?.length??0,E=g.substring(b+3,g.length-x-1),y=h.suffix||h.prefix?p.substring(b,p.length-x):p;y&&(l[E]=decodeURIComponent(y))}else if(h.kind===Xi){const g=h,b=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),x=decodeURIComponent(b);l["*"]=x,l._splat=x;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:o,path:d}]}function bB(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function yB(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function vB(e,t,n,i){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!yc(t),l=s&&e!=="/",u=t.length-(s?1:0),o=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,h=null,p=null;for(;o.length;){const f=o.pop(),{node:g,index:b,skipped:x,depth:E,statics:y,dynamics:S,optionals:v}=f;let{extract:_,rawParams:C,parsedParams:N}=f;if(g.skipOnParamError){if(!Ah(e,t,f))continue;C=f.rawParams,_=f.extract,N=f.parsedParams}i&&g.route&&g.kind!==Va&&Js(h,f)&&(h=f);const A=b===u;if(A&&(g.route&&!l&&Js(p,f)&&(p=f),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const O=A?void 0:t[b];let R;if(A&&g.index){const I={node:g.index,index:b,skipped:x,depth:E+1,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N};if(g.index.skipOnParamError&&!Ah(e,t,I))continue;if(y===u&&!S&&!v&&!x)return I;Js(p,I)&&(p=I)}if(g.wildcard&&Js(d,f))for(const I of g.wildcard){const{prefix:L,suffix:F}=I;if(L&&(A||!(I.caseSensitive?O:R??=O.toLowerCase()).startsWith(L)))continue;if(F){if(A)continue;const z=t.slice(b).join("/").slice(-F.length);if((I.caseSensitive?z:z.toLowerCase())!==F)continue}const j={node:I,index:u,skipped:x,depth:E,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N};if(!(I.skipOnParamError&&!Ah(e,t,j))){d=j;break}}if(g.optional){const I=x|1<<E,L=E+1;for(let F=g.optional.length-1;F>=0;F--){const j=g.optional[F];o.push({node:j,index:b,skipped:I,depth:L,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(!A)for(let F=g.optional.length-1;F>=0;F--){const j=g.optional[F],{prefix:z,suffix:G}=j;if(z||G){const V=j.caseSensitive?O:R??=O.toLowerCase();if(z&&!V.startsWith(z)||G&&!V.endsWith(G))continue}o.push({node:j,index:b+1,skipped:x,depth:L,statics:y,dynamics:S,optionals:v+1,extract:_,rawParams:C,parsedParams:N})}}if(!A&&g.dynamic&&O)for(let I=g.dynamic.length-1;I>=0;I--){const L=g.dynamic[I],{prefix:F,suffix:j}=L;if(F||j){const z=L.caseSensitive?O:R??=O.toLowerCase();if(F&&!z.startsWith(F)||j&&!z.endsWith(j))continue}o.push({node:L,index:b+1,skipped:x,depth:E+1,statics:y,dynamics:S+1,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(!A&&g.staticInsensitive){const I=g.staticInsensitive.get(R??=O.toLowerCase());I&&o.push({node:I,index:b+1,skipped:x,depth:E+1,statics:y+1,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(!A&&g.static){const I=g.static.get(O);I&&o.push({node:I,index:b+1,skipped:x,depth:E+1,statics:y+1,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(g.pathless){const I=E+1;for(let L=g.pathless.length-1;L>=0;L--){const F=g.pathless[L];o.push({node:F,index:b,skipped:x,depth:I,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}}}if(p&&d)return Js(d,p)?p:d;if(p)return p;if(d)return d;if(i&&h){let f=h.index;for(let b=0;b<h.index;b++)f+=t[b].length;const g=f===e.length?"/":e.slice(f);return h.rawParams??={},h.rawParams["**"]=decodeURIComponent(g),h}return null}function Ah(e,t,n){try{const[i,s]=QN(e,t,n);n.rawParams=i,n.extract=s;const l=n.node.parse(i);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function Js(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Va)>(e.node.kind===Va)||t.node.kind===Va==(e.node.kind===Va)&&t.depth>e.depth))):!0}function ac(e){return Uv(e.filter(t=>t!==void 0).join("/"))}function Uv(e){return e.replace(/\/{2,}/g,"/")}function JN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $i(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function eO(e){return $i(JN(e))}function Ec(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function _B(e,t,n){return Ec(e,n)===Ec(t,n)}function SB({base:e,to:t,trailingSlash:n="never",cache:i}){const s=t.startsWith("/"),l=!s&&t===".";let u;if(i){u=s?t:l?e:e+"\0"+t;const f=i.get(u);if(f)return f}let o;if(l)o=e.split("/");else if(s)o=t.split("/");else{for(o=e.split("/");o.length>1&&yc(o)==="";)o.pop();const f=t.split("/");for(let g=0,b=f.length;g<b;g++){const x=f[g];x===""?g?g===b-1&&o.push(x):o=[x]:x===".."?o.pop():x==="."||o.push(x)}}o.length>1&&(yc(o)===""?n==="never"&&o.pop():n==="always"&&o.push(""));let d,h="";for(let f=0;f<o.length;f++){f>0&&(h+="/");const g=o[f];if(!g)continue;d=Fv(g,0,d);const b=d[0];if(b===Xa){h+=g;continue}const x=d[5],E=g.substring(0,d[1]),y=g.substring(d[4],x),S=g.substring(d[2],d[3]);b===Yi?h+=E||y?`${E}{$${S}}${y}`:`$${S}`:b===Xi?h+=E||y?`${E}{$}${y}`:"$":h+=`${E}{-$${S}}${y}`}h=Uv(h);const p=h||"/";return u&&i&&i.set(u,p),p}function kh(e,t,n){const i=t[e];return typeof i!="string"?i:e==="_splat"?encodeURI(i):EB(i,n)}function Rh({path:e,params:t,decodeCharMap:n}){let i=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const l=e.length;let u=0,o,d="";for(;u<l;){const p=u;o=Fv(e,p,o);const f=o[5];if(u=f+1,p===f)continue;const g=o[0];if(g===Xa){d+="/"+e.substring(p,f);continue}if(g===Xi){const b=t._splat;s._splat=b,s["*"]=b;const x=e.substring(p,o[1]),E=e.substring(o[4],f);if(!b){i=!0,(x||E)&&(d+="/"+x+E);continue}const y=kh("_splat",t,n);d+="/"+x+y+E;continue}if(g===Yi){const b=e.substring(o[2],o[3]);!i&&!(b in t)&&(i=!0),s[b]=t[b];const x=e.substring(p,o[1]),E=e.substring(o[4],f),y=kh(b,t,n)??"undefined";d+="/"+x+y+E;continue}if(g===bo){const b=e.substring(o[2],o[3]),x=t[b];if(x==null)continue;s[b]=x;const E=e.substring(p,o[1]),y=e.substring(o[4],f),S=kh(b,t,n)??"";d+="/"+E+S+y;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:s,interpolatedPath:d||"/",isMissingParams:i}}function EB(e,t){let n=encodeURIComponent(e);if(t)for(const[i,s]of t)n=n.replaceAll(i,s);return n}function kn(e){return!!e?.isNotFound}function xB(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const xc="tsr-scroll-restoration-v1_3",wB=(e,t)=>{let n;return(...i)=>{n||(n=setTimeout(()=>{e(...i),n=null},t))}};function CB(){const e=xB();if(!e)return null;const t=e.getItem(xc);let n=t?JSON.parse(t):{};return{state:n,set:i=>{n=ci(i,n)||n;try{e.setItem(xc,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Kl=CB(),tv=e=>e.state.__TSR_key||e.href;function TB(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let wc=!1;function tO({storageKey:e,key:t,behavior:n,shouldScrollRestoration:i,scrollToTopSelectors:s,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const o=t||window.history.state?.__TSR_key,d=u[o];wc=!0;e:{if(i&&d&&Object.keys(d).length>0){for(const f in d){const g=d[f];if(f==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(f){const b=document.querySelector(f);b&&(b.scrollLeft=g.scrollX,b.scrollTop=g.scrollY)}}break e}const h=(l??window.location).hash.split("#",2)[1];if(h){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const g=document.getElementById(h);g&&g.scrollIntoView(f)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),s)for(const f of s){if(f==="window")continue;const g=typeof f=="function"?f():document.querySelector(f);g&&g.scrollTo(p)}}wc=!1}function AB(e,t){if(!Kl&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Kl))return;e.isScrollRestorationSetup=!0,wc=!1;const i=e.options.getScrollRestorationKey||tv;window.history.scrollRestoration="manual";const s=l=>{if(wc||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const d=l.target.getAttribute("data-scroll-restoration-id");d?u=`[data-scroll-restoration-id="${d}"]`:u=TB(l.target)}const o=i(e.state.location);Kl.set(d=>{const h=d[o]||={},p=h[u]||={};if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const f=document.querySelector(u);f&&(p.scrollX=f.scrollLeft||0,p.scrollY=f.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",wB(s,100),!0),e.subscribe("onRendered",l=>{const u=i(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(tO({storageKey:xc,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Kl.set(o=>(o[u]||={},o)))})}function kB(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function RB(e,t=String){const n=new URLSearchParams;for(const i in e){const s=e[i];s!==void 0&&n.set(i,t(s))}return n.toString()}function Nh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function NB(e){const t=new URLSearchParams(e),n={};for(const[i,s]of t.entries()){const l=n[i];l==null?n[i]=Nh(s):Array.isArray(l)?l.push(Nh(s)):n[i]=[l,Nh(s)]}return n}const OB=LB(JSON.parse),IB=DB(JSON.stringify,JSON.parse);function LB(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=NB(t);for(const i in n){const s=n[i];if(typeof s=="string")try{n[i]=e(s)}catch{}}return n}}function DB(e,t){const n=typeof t=="function";function i(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const l=RB(s,i);return l?`?${l}`:""}}const Tn="__root__";function nO(e){if(e.statusCode=e.statusCode||e.code||307,typeof e.href=="string"&&_c(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${ZN.join(", ")} protocols are allowed.`);if(!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Gn(e){return e instanceof Response&&!!e.options}const sc=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Pc=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),jv=(e,t,n=!0)=>{const i={...e.router.options.context??{}},s=n?t:t-1;for(let l=0;l<=s;l++){const u=e.matches[l];if(!u)continue;const o=e.router.getMatch(u.id);o&&Object.assign(i,o.__routeContext,o.__beforeLoadContext)}return i},rO=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Lr(n.options.notFoundComponent);const i=e.matches.find(s=>s.routeId===n.id);Lr(i,"Could not find match for route: "+n.id),e.updateMatch(i.id,s=>({...s,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,rO(e,t))},ui=(e,t,n)=>{if(!(!Gn(n)&&!kn(n))){if(Gn(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const i=Gn(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,s=>({...s,status:i,isFetching:!1,error:n})),kn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Gn(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(rO(e,n),n)}},iO=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},eo=(e,t,n,i)=>{const{id:s,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=i,e.firstBadMatchIndex??=t,ui(e,e.router.getMatch(s),n);try{u.options.onError?.(n)}catch(o){n=o,ui(e,e.router.getMatch(s),n)}e.updateMatch(s,o=>(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loadPromise?.resolve(),{...o,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},MB=(e,t,n,i)=>{const s=e.router.getMatch(t),l=e.matches[n-1]?.id,u=l?e.router.getMatch(l):void 0;if(e.router.isShell()){s.ssr=i.id===Tn;return}if(u?.ssr===!1){s.ssr=!1;return}const o=b=>b===!0&&u?.ssr==="data-only"?"data-only":b,d=e.router.options.defaultSsr??!0;if(i.options.ssr===void 0){s.ssr=o(d);return}if(typeof i.options.ssr!="function"){s.ssr=o(i.options.ssr);return}const{search:h,params:p}=s,f={search:Yl(h,s.searchError),params:Yl(p,s.paramsError),location:e.location,matches:e.matches.map(b=>({index:b.index,pathname:b.pathname,fullPath:b.fullPath,staticData:b.staticData,id:b.id,routeId:b.routeId,search:Yl(b.search,b.searchError),params:Yl(b.params,b.paramsError),ssr:b.ssr}))},g=i.options.ssr(f);if(pi(g))return g.then(b=>{s.ssr=o(b??d)});s.ssr=o(g??d)},aO=(e,t,n,i)=>{if(i._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Pc(e,t)&&(n.options.loader||n.options.beforeLoad||lO(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{sc(e)},s);i._nonReactive.pendingTimeout=u}},BB=(e,t,n)=>{const i=e.router.getMatch(t);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;aO(e,t,n,i);const s=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&ui(e,l,l.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(s):s()},FB=(e,t,n,i)=>{const s=e.router.getMatch(t),l=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ya(()=>{l?.resolve()});const{paramsError:u,searchError:o}=s;u&&eo(e,n,u,"PARSE_PARAMS"),o&&eo(e,n,o,"VALIDATE_SEARCH"),aO(e,t,i,s);const d=new AbortController,h=e.matches[n-1]?.id;(h?e.router.getMatch(h):void 0)?.context??e.router.options.context;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},b=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!i.options.beforeLoad){uo(()=>{g(),b()});return}s._nonReactive.beforeLoadPromise=Ya();const x={...jv(e,n,!1),...s.__routeContext},{search:E,params:y,cause:S}=s,v=Pc(e,t),_={search:E,abortController:d,params:y,preload:v,context:x,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":S,matches:e.matches,...e.router.options.additionalContext},C=A=>{if(A===void 0){uo(()=>{g(),b()});return}(Gn(A)||kn(A))&&(g(),eo(e,n,A,"BEFORE_LOAD")),uo(()=>{g(),e.updateMatch(t,O=>({...O,__beforeLoadContext:A})),b()})};let N;try{if(N=i.options.beforeLoad(_),pi(N))return g(),N.catch(A=>{eo(e,n,A,"BEFORE_LOAD")}).then(C)}catch(A){g(),eo(e,n,A,"BEFORE_LOAD")}C(N)},PB=(e,t)=>{const{id:n,routeId:i}=e.matches[t],s=e.router.looseRoutesById[i],l=()=>{if(e.router.isServer){const d=MB(e,n,t,s);if(pi(d))return d.then(o)}return o()},u=()=>FB(e,n,t,s),o=()=>{if(iO(e,n))return;const d=BB(e,n,s);return pi(d)?d.then(u):u()};return l()},UB=(e,t,n)=>{const i=e.router.getMatch(t);if(!i||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={matches:e.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([l,u,o])=>{const d=l?.meta,h=l?.links,p=l?.scripts,f=l?.styles;return{meta:d,links:h,headScripts:p,headers:o,scripts:u,styles:f}})},sO=(e,t,n,i)=>{const s=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:o,cause:d}=e.router.getMatch(t),h=jv(e,n),p=Pc(e,t);return{params:l,deps:u,preload:!!p,parentMatchPromise:s,abortController:o,context:h,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:p?"preload":d,route:i,...e.router.options.additionalContext}},sw=async(e,t,n,i)=>{try{const s=e.router.getMatch(t);try{(!e.router.isServer||s.ssr===!0)&&oO(i);const l=i.options.loader?.(sO(e,t,n,i)),u=i.options.loader&&pi(l);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),i.options.loader){const h=u?await l:l;ui(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,p=>({...p,loaderData:h}))}i._lazyPromise&&await i._lazyPromise;const d=s._nonReactive.minPendingPromise;d&&await d,i._componentsPromise&&await i._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1}));return}const o=s._nonReactive.minPendingPromise;o&&await o,kn(l)&&await i.options.notFoundComponent?.preload?.(),ui(e,e.router.getMatch(t),l);try{i.options.onError?.(l)}catch(d){u=d,ui(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:u,status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),ui(e,l,s)}},jB=async(e,t)=>{const{id:n,routeId:i}=e.matches[t];let s=!1,l=!1;const u=e.router.looseRoutesById[i],o=()=>{e.updateMatch(n,p=>({...p,context:jv(e,t)}))};if(iO(e,n)){if(e.router.isServer)return e.router.getMatch(n)}else{const p=e.router.getMatch(n);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const f=e.router.getMatch(n),g=f._nonReactive.error||f.error;g&&ui(e,f,g)}else{const f=Date.now()-p.updatedAt,g=Pc(e,n),b=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,x=u.options.shouldReload,E=typeof x=="function"?x(sO(e,n,t,u)):x,y=!!g&&!e.router.state.matches.some(C=>C.id===n),S=e.router.getMatch(n);S._nonReactive.loaderPromise=Ya(),y!==S.preload&&e.updateMatch(n,C=>({...C,preload:y}));const{status:v,invalid:_}=S;s=v==="success"&&(_||(E??f>b)),g&&u.options.preload===!1||(s&&!e.sync?(l=!0,(async()=>{try{await sw(e,n,t,u),o();const C=e.router.getMatch(n);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){Gn(C)&&await e.router.navigate(C.options)}})()):(v!=="success"||s&&e.sync)&&await sw(e,n,t,u))}}const d=e.router.getMatch(n);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0,l||o();const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:h,invalid:!1})),e.router.getMatch(n)):d};async function ow(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&sc(t);try{for(let o=0;o<t.matches.length;o++){const d=PB(t,o);pi(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(jB(t,o));const s=(await Promise.allSettled(t.matchPromises)).filter(o=>o.status==="rejected").map(o=>o.reason);let l;for(const o of s){if(Gn(o))throw o;!l&&kn(o)&&(l=o)}for(const o of t.matches){const{id:d,routeId:h}=o,p=t.router.looseRoutesById[h];try{const f=UB(t,d,p);if(f){const g=await f;t.updateMatch(d,b=>({...b,...g}))}}catch(f){console.error(`Error executing head for route ${h}:`,f)}}if(l)throw l;const u=sc(t);pi(u)&&await u}catch(n){if(kn(n)&&!t.preload){const i=sc(t);throw pi(i)&&await i,n}if(Gn(n))throw n}return t.matches}async function oO(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...i}=t.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const i of cO){const s=e.options[i]?.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Yl(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function lO(e){for(const t of cO)if(e.options[t]?.preload)return!0;return!1}const cO=["component","errorComponent","pendingComponent","notFoundComponent"];function zB(e){return{input:({url:t})=>{for(const n of e)t=nv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=uO(e[n],t);return t}}}function HB(e){const t=eO(e.basepath),n=`/${t}`,i=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?i:i.toLowerCase();return{input:({url:u})=>{const o=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return o===s?u.pathname="/":o.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=ac(["/",t,u.pathname]),u)}}function nv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function uO(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Gi(e){const t=e.resolvedLocation,n=e.location,i=t?.pathname!==n.pathname,s=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:i,hrefChanged:s,hashChanged:l}}class qB{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const i=this.options,s=this.basepath??i?.basepath??"/",l=this.basepath===void 0,u=i?.rewrite;this.options={...i,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=QM())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new XM(GB(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),AB(this));let o=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(l||s!==d||u!==h){this.basepath=d;const g=[];eO(d)!==""&&g.push(HB({basepath:d})),h&&g.push(h),this.rewrite=g.length===0?void 0:g.length===1?g[0]:zB(g),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:i,processedTree:s}=gB(this.routeTree,this.options.caseSensitive,(u,o)=>{u.init({originalIndex:o})});this.options.routeMasks&&dB(this.options.routeMasks,s),this.routesById=n,this.routesByPath=i,this.processedTree=s;const l=this.options.notFoundRoute;l&&(l.init({originalIndex:99999999999}),this.routesById[l.id]=l)},this.subscribe=(n,i)=>{const s={eventType:n,fn:i};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(i=>{i.eventType===n.type&&i.fn(n)})},this.parseLocation=(n,i)=>{const s=({href:d,state:h})=>{const p=new URL(d,this.origin),f=nv(this.rewrite,p),g=this.options.parseSearch(f.search),b=this.options.stringifySearch(g);return f.search=b,{href:f.href.replace(f.origin,""),publicHref:d,url:f,pathname:aw(f.pathname),searchStr:b,search:Hn(i?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:Hn(i?.state,h)}},l=s(n),{__tempLocation:u,__tempKey:o}=l.state;if(u&&(!o||o===this.tempLocationKey)){const d=s(u);return d.state.key=l.state.key,d.state.__TSR_key=l.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:l}}return l},this.resolvePathCache=Sc(1e3),this.resolvePathWithBase=(n,i)=>SB({base:n,to:Uv(i),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,i,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:i},s):this.matchRoutesInternal(n,i),this.getMatchedRoutes=n=>VB({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const i=this.getMatch(n);i&&(i.abortController.abort(),clearTimeout(i._nonReactive.pendingTimeout),i._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),i=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...i]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const i=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutes(u,{_buildLocation:!0}),d=yc(o);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??d.fullPath,p=this.resolvePathWithBase(h,"."),f=d.search,g={...d.params},b=l.to?this.resolvePathWithBase(p,`${l.to}`):this.resolvePathWithBase(p,"."),x=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,ci(l.params,g)),E=Rh({path:b,params:x}).interpolatedPath,y=this.matchRoutes(E,void 0,{_buildLocation:!0}).map(L=>this.looseRoutesById[L.routeId]);if(Object.keys(x).length>0)for(const L of y){const F=L.options.params?.stringify??L.options.stringifyParams;F&&Object.assign(x,F(x))}const S=n.leaveParams?b:aw(Rh({path:b,params:x,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const L={};y.forEach(F=>{if(F.options.validateSearch)try{Object.assign(L,rv(F.options.validateSearch,{...L,...v}))}catch{}}),v=L}v=WB({search:v,dest:l,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),v=Hn(f,v);const _=this.options.stringifySearch(v),C=l.hash===!0?u.hash:l.hash?ci(l.hash,u.hash):void 0,N=C?`#${C}`:"";let A=l.state===!0?u.state:l.state?ci(l.state,u.state):{};A=Hn(u.state,A);const O=`${S}${_}${N}`,R=new URL(O,this.origin),I=uO(this.rewrite,R);return{publicHref:I.pathname+I.search+I.hash,href:O,url:I,pathname:S,search:v,searchStr:_,state:A,hash:C??"",unmaskOnReload:l.unmaskOnReload}},s=(l={},u)=>{const o=i(l);let d=u?i(u):void 0;if(!d){const h={};if(this.options.routeMasks){const p=hB(o.pathname,this.processedTree);if(p){Object.assign(h,p.rawParams);const{from:f,params:g,...b}=p.route,x=g===!1||g===null?{}:(g??!0)===!0?h:Object.assign(h,ci(g,h));u={from:n.from,...b,params:x},d=i(u)}}}return d&&(o.maskedLocation=d),o};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:i,...s})=>{const l=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(p=>{s.state[p]=this.latestLocation.state[p]});const h=qi(s.state,this.latestLocation.state);return d.forEach(p=>{delete s.state[p]}),h},u=$i(this.latestLocation.href)===$i(s.href),o=this.commitLocationPromise;if(this.commitLocationPromise=Ya(()=>{o?.resolve()}),u&&l())this.load();else{let{maskedLocation:d,hashScrollIntoView:h,url:p,...f}=s;d&&(f={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:i})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:i,hashScrollIntoView:s,viewTransition:l,ignoreBlocker:u,href:o,...d}={})=>{if(o){const f=this.history.location.state.__TSR_index,g=bc(o,{__TSR_index:n?f:f+1}),b=new URL(g.pathname,this.origin),x=nv(this.rewrite,b);d.to=x.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const p=this.commitLocation({...h,viewTransition:l,replace:n,resetScroll:i,hashScrollIntoView:s,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:i,href:s,publicHref:l,...u})=>{let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!i&&(i=!0),i){if(n!==void 0||!s){const h=this.buildLocation({to:n,...u});s=s??h.url.href,l=l??h.url.href}const d=!o&&l?l:s;if(_c(d))return Promise.resolve();if(!u.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const f of p)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...u,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const i=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==i.publicHref||i.url.origin!==this.origin){const s=this.getParsedLocationHref(i);throw nO({href:s})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(i=>({...i,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:i.cachedMatches.filter(s=>!n.some(l=>l.id===s.id))}))},this.load=async n=>{let i,s,l;for(l=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Gi({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...Gi({resolvedLocation:h,location:d})}),await ow({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],f=[],g=[];uo(()=>{this.__store.setState(b=>{const x=b.matches,E=b.pendingMatches||b.matches;return p=x.filter(y=>!E.some(S=>S.id===y.id)),f=E.filter(y=>!x.some(S=>S.id===y.id)),g=E.filter(y=>x.some(S=>S.id===y.id)),{...b,isLoading:!1,loadedAt:Date.now(),matches:E,pendingMatches:void 0,cachedMatches:[...b.cachedMatches,...p.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([b,x])=>{b.forEach(E=>{this.looseRoutesById[E.routeId].options[x]?.(E)})})})})}})}catch(d){Gn(d)?(i=d,this.isServer||this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):kn(d)&&(s=d),this.__store.setState(h=>({...h,statusCode:i?i.status:s?404:h.matches.some(p=>p.status==="error")?500:200,redirect:i}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(o=>o.status==="error")&&(u=500),u!==void 0&&this.__store.setState(o=>({...o,statusCode:u}))},this.startViewTransition=n=>{const i=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,i&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof i=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,o=typeof i.types=="function"?i.types(Gi({resolvedLocation:u,location:l})):i.types;if(o===!1){n();return}s={update:n,types:o}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,i)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";s&&this.__store.setState(l=>({...l,[s]:l[s]?.map(u=>u.id===n?i(u):u)}))})},this.getMatch=n=>{const i=s=>s.id===n;return this.state.cachedMatches.find(i)??this.state.pendingMatches?.find(i)??this.state.matches.find(i)},this.invalidate=n=>{const i=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(i),cachedMatches:s.cachedMatches.map(i),pendingMatches:s.pendingMatches?.map(i)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>{let i=n.url.href;return this.origin&&n.url.origin===this.origin&&(i=i.replace(this.origin,"")||"/"),i},this.resolveRedirect=n=>{const i=n.headers.get("Location");if(n.options.href){if(i)try{const s=new URL(i);if(this.origin&&s.origin===this.origin){const l=s.pathname+s.search+s.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}}else{const s=this.buildLocation(n.options),l=this.getParsedLocationHref(s);n.options.href=l,n.headers.set("Location",l)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const i=n?.filter;i!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(l=>!i(l))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=i=>{const s=this.looseRoutesById[i.routeId];if(!s.options.loader)return!0;const l=(i.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:Date.now()-i.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=oO,this.preloadRoute=async n=>{const i=this.buildLocation(n);let s=this.matchRoutes(i,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),u=new Set([...l,...this.state.cachedMatches.map(o=>o.id)]);uo(()=>{s.forEach(o=>{u.has(o.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,o]}))})});try{return s=await ow({router:this,matches:s,location:i,preload:!0,updateMatch:(o,d)=>{l.has(o)?s=s.map(h=>h.id===o?d(h):h):this.updateMatch(o,d)}}),s}catch(o){if(Gn(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:i});kn(o)||console.error(o);return}},this.matchRoute=(n,i)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(s);if(i?.pending&&this.state.status!=="pending")return!1;const o=(i?.pending===void 0?!this.state.isLoading:i.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=fB(l.pathname,i?.caseSensitive??!1,i?.fuzzy??!1,o.pathname,this.processedTree);return!d||n.params&&!qi(d.rawParams,n.params,{partial:!0})?!1:i?.includeSearch??!0?qi(o.search,l.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??IB,parseSearch:t.parseSearch??OB}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const i=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:l,parsedParams:u}=i;let{matchedRoutes:o}=i,d=!1;(s?s.path!=="/"&&l["**"]:$i(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:d=!0);const h=(()=>{if(d){if(this.options.notFoundMode!=="root")for(let g=o.length-1;g>=0;g--){const b=o[g];if(b.children)return b.id}return Tn}})(),p=[],f=g=>g?.id?g.context??this.options.context??void 0:this.options.context??void 0;return o.forEach((g,b)=>{const x=p[b-1],[E,y,S]=(()=>{const G=x?.search??t.search,V=x?._strictSearch??void 0;try{const W=rv(g.options.validateSearch,{...G})??void 0;return[{...G,...W},{...V,...W},void 0]}catch(W){let Z=W;if(W instanceof Cc||(Z=new Cc(W.message,{cause:W})),n?.throwOnError)throw Z;return[G,{},Z]}})(),v=g.options.loaderDeps?.({search:E})??"",_=v?JSON.stringify(v):"",{interpolatedPath:C,usedParams:N}=Rh({path:g.fullPath,params:l,decodeCharMap:this.pathParamsDecodeCharMap}),A=g.id+C+_,O=this.getMatch(A),R=this.state.matches.find(G=>G.routeId===g.id),I=O?._strictParams??N;let L;if(!O)if(g.options.skipRouteOnParseError)for(const G in N)G in u&&(I[G]=u[G]);else{const G=g.options.params?.parse??g.options.parseParams;if(G)try{Object.assign(I,G(I))}catch(V){if(kn(V)||Gn(V)?L=V:L=new $B(V.message,{cause:V}),n?.throwOnError)throw L}}Object.assign(l,I);const F=R?"stay":"enter";let j;if(O)j={...O,cause:F,params:R?Hn(R.params,l):l,_strictParams:I,search:Hn(R?R.search:O.search,E),_strictSearch:y};else{const G=g.options.loader||g.options.beforeLoad||g.lazyFn||lO(g)?"pending":"success";j={id:A,ssr:this.isServer?void 0:g.options.ssr,index:b,routeId:g.id,params:R?Hn(R.params,l):l,_strictParams:I,pathname:C,updatedAt:Date.now(),search:R?Hn(R.search,E):E,_strictSearch:y,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:L,__routeContext:void 0,_nonReactive:{loadPromise:Ya()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:R?Hn(R.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}n?.preload||(j.globalNotFound=h===g.id),j.searchError=S;const z=f(x);j.context={...z,...j.__routeContext,...j.__beforeLoadContext},p.push(j)}),p.forEach((g,b)=>{const x=this.looseRoutesById[g.routeId];if(!this.getMatch(g.id)&&n?._buildLocation!==!0){const y=p[b-1],S=f(y);if(x.options.context){const v={deps:g.loaderDeps,params:g.params,context:S??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:p};g.__routeContext=x.options.context(v)??void 0}g.context={...S,...g.__routeContext,...g.__beforeLoadContext}}}),p}}class Cc extends Error{}class $B extends Error{}function GB(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function rv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Cc("Async validation not supported");if(n.issues)throw new Cc(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function VB({pathname:e,routesById:t,processedTree:n}){const i={},s=$i(e);let l,u;const o=pB(s,n,!0);return o&&(l=o.route,Object.assign(i,o.rawParams),u=Object.assign({},o.parsedParams)),{matchedRoutes:o?.branch||[t[Tn]],routeParams:i,foundRoute:l,parsedParams:u}}function WB({search:e,dest:t,destRoutes:n,_includeValidateSearch:i}){const s=n.reduce((o,d)=>{const h=[];if("search"in d.options)d.options.search?.middlewares&&h.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const p=({search:f,next:g})=>{let b=f;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(b=d.options.preSearchFilters.reduce((E,y)=>y(E),f));const x=g(b);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((E,y)=>y(E),x):x};h.push(p)}if(i&&d.options.validateSearch){const p=({search:f,next:g})=>{const b=g(f);try{return{...b,...rv(d.options.validateSearch,b)??void 0}}catch{return b}};h.push(p)}return o.concat(h)},[])??[],l=({search:o})=>t.search?t.search===!0?o:ci(t.search,o):{};s.push(l);const u=(o,d)=>{if(o>=s.length)return d;const h=s[o];return h({search:d,next:f=>u(o+1,f)})};return u(0,e)}const KB="Error preloading route! ☝️";class dO{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const i=this.options,s=!i?.path&&!i?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Tn:this.parentRoute||Lr(!1);let l=s?Tn:i?.path;l&&l!=="/"&&(l=JN(l));const u=i?.id||l;let o=s?Tn:ac([this.parentRoute.id===Tn?"":this.parentRoute.id,u]);l===Tn&&(l="/"),o!==Tn&&(o=ac(["/",o]));const d=o===Tn?"/":ac([this.parentRoute.fullPath,l]);this._path=l,this._id=o,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class YB extends dO{constructor(t){super(t)}}const Xl=typeof window<"u"?K.useLayoutEffect:K.useEffect;function Oh(e){const t=K.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function XB(e,t,n={},i={}){K.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([l])=>{t(l)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,i.disabled,e])}function ZB(e){const t=K.useRef(null);return K.useImperativeHandle(e,()=>t.current,[]),t}function zv(e){const t=e.errorComponent??Uc;return T.jsx(QB,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:i})=>n?K.createElement(t,{error:n,reset:i}):e.children})}class QB extends K.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Uc({error:e}){const[t,n]=K.useState(!1);return T.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[T.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),T.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(i=>!i),children:t?"Hide Error":"Show Error"})]}),T.jsx("div",{style:{height:".25rem"}}),t?T.jsx("div",{children:T.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?T.jsx("code",{children:e.message}):null})}):null]})}function JB({children:e,fallback:t=null}){return e3()?T.jsx($t.Fragment,{children:e}):T.jsx($t.Fragment,{children:t})}function e3(){return $t.useSyncExternalStore(t3,()=>!0,()=>!1)}function t3(){return()=>{}}var Ih={exports:{}},Lh={},Dh={exports:{}},Mh={};var lw;function n3(){if(lw)return Mh;lw=1;var e=wo();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(f,g){var b=g(),x=i({inst:{value:b,getSnapshot:g}}),E=x[0].inst,y=x[1];return l(function(){E.value=b,E.getSnapshot=g,d(E)&&y({inst:E})},[f,b,g]),s(function(){return d(E)&&y({inst:E}),f(function(){d(E)&&y({inst:E})})},[f]),u(b),b}function d(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function h(f,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:o;return Mh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Mh}var cw;function r3(){return cw||(cw=1,Dh.exports=n3()),Dh.exports}var uw;function i3(){if(uw)return Lh;uw=1;var e=wo(),t=r3();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var i=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,d=e.useDebugValue;return Lh.useSyncExternalStoreWithSelector=function(h,p,f,g,b){var x=l(null);if(x.current===null){var E={hasValue:!1,value:null};x.current=E}else E=x.current;x=o(function(){function S(A){if(!v){if(v=!0,_=A,A=g(A),b!==void 0&&E.hasValue){var O=E.value;if(b(O,A))return C=O}return C=A}if(O=C,i(_,A))return O;var R=g(A);return b!==void 0&&b(O,R)?(_=A,O):(_=A,C=R)}var v=!1,_,C,N=f===void 0?null:f;return[function(){return S(p())},N===null?void 0:function(){return S(N())}]},[p,f,g,b]);var y=s(h,x[0],x[1]);return u(function(){E.hasValue=!0,E.value=y},[y]),d(y),y},Lh}var dw;function a3(){return dw||(dw=1,Ih.exports=i3()),Ih.exports}var s3=a3();function o3(e,t=i=>i,n={}){const i=n.equal??l3;return s3.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,i)}function l3(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,s]of e)if(!t.has(i)||!Object.is(s,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=hw(e);if(n.length!==hw(t).length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Object.is(e[n[i]],t[n[i]]))return!1;return!0}function hw(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Bh=K.createContext(null);function hO(){return typeof document>"u"?Bh:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Bh,Bh)}function Nn(e){const t=K.useContext(hO());return e?.warn,t}function hn(e){const t=Nn({warn:e?.router===void 0}),n=e?.router||t,i=K.useRef(void 0);return o3(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=Hn(i.current,e.select(s));return i.current=l,l}return e.select(s)}return s})}const jc=K.createContext(void 0),c3=K.createContext(void 0);function lr(e){const t=K.useContext(e.from?c3:jc);return hn({select:i=>{const s=i.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(Lr(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function Hv(e){return lr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function qv(e){const{select:t,...n}=e;return lr({...n,select:i=>t?t(i.loaderDeps):i.loaderDeps})}function $v(e){return lr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Gv(e){return lr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function zc(e){const t=Nn();return K.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var u3=PN();function d3(e,t){const n=Nn(),[i,s]=K.useState(!1),l=K.useRef(!1),u=ZB(t),{activeProps:o,inactiveProps:d,activeOptions:h,to:p,preload:f,preloadDelay:g,hashScrollIntoView:b,replace:x,startTransition:E,resetScroll:y,viewTransition:S,children:v,target:_,disabled:C,style:N,className:A,onClick:O,onFocus:R,onMouseEnter:I,onMouseLeave:L,onTouchStart:F,ignoreBlocker:j,params:z,search:G,hash:V,state:W,mask:Z,reloadDocument:J,unsafeRelative:P,from:D,_fromLocation:B,...H}=e,U=hn({select:Ne=>Ne.location.search,structuralSharing:!0}),ee=e.from,le=K.useMemo(()=>({...e,from:ee}),[n,U,ee,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=K.useMemo(()=>n.buildLocation({...le}),[n,le]),X=K.useMemo(()=>{if(C)return;let Ne=ue.maskedLocation?ue.maskedLocation.url.href:ue.url.href,Oe=!1;return n.origin&&(Ne.startsWith(n.origin)?Ne=n.history.createHref(Ne.replace(n.origin,""))||"/":Oe=!0),{href:Ne,external:Oe}},[C,ue.maskedLocation,ue.url,n.origin,n.history]),$=K.useMemo(()=>{if(X?.external)return _c(X.href)?void 0:X.href;try{return new URL(p),_c(p)?void 0:p}catch{}},[p,X]),ie=e.reloadDocument||$?!1:f??n.options.defaultPreload,he=g??n.options.defaultPreloadDelay??0,be=hn({select:Ne=>{if($)return!1;if(h?.exact){if(!_B(Ne.location.pathname,ue.pathname,n.basepath))return!1}else{const Oe=Ec(Ne.location.pathname,n.basepath),je=Ec(ue.pathname,n.basepath);if(!(Oe.startsWith(je)&&(Oe.length===je.length||Oe[je.length]==="/")))return!1}return(h?.includeSearch??!0)&&!qi(Ne.location.search,ue.search,{partial:!h?.exact,ignoreUndefined:!h?.explicitUndefined})?!1:h?.includeHash?Ne.location.hash===ue.hash:!0}}),ge=K.useCallback(()=>{n.preloadRoute({...le}).catch(Ne=>{console.warn(Ne),console.warn(KB)})},[n,le]),xe=K.useCallback(Ne=>{Ne?.isIntersecting&&ge()},[ge]);XB(u,xe,g3,{disabled:!!C||ie!=="viewport"}),K.useEffect(()=>{l.current||!C&&ie==="render"&&(ge(),l.current=!0)},[C,ge,ie]);const ze=Ne=>{const Oe=Ne.currentTarget.getAttribute("target"),je=_!==void 0?_:Oe;if(!C&&!b3(Ne)&&!Ne.defaultPrevented&&(!je||je==="_self")&&Ne.button===0){Ne.preventDefault(),u3.flushSync(()=>{s(!0)});const ce=n.subscribe("onResolved",()=>{ce(),s(!1)});n.navigate({...le,replace:x,resetScroll:y,hashScrollIntoView:b,startTransition:E,viewTransition:S,ignoreBlocker:j})}};if($)return{...H,ref:u,href:$,...v&&{children:v},..._&&{target:_},...C&&{disabled:C},...N&&{style:N},...A&&{className:A},...O&&{onClick:O},...R&&{onFocus:R},...I&&{onMouseEnter:I},...L&&{onMouseLeave:L},...F&&{onTouchStart:F}};const He=Ne=>{C||ie&&ge()},De=He,Ee=Ne=>{if(!(C||!ie))if(!he)ge();else{const Oe=Ne.target;if(to.has(Oe))return;const je=setTimeout(()=>{to.delete(Oe),ge()},he);to.set(Oe,je)}},wt=Ne=>{if(C||!ie||!he)return;const Oe=Ne.target,je=to.get(Oe);je&&(clearTimeout(je),to.delete(Oe))},Mt=be?ci(o,{})??h3:Fh,ft=be?Fh:ci(d,{})??Fh,Vt=[A,Mt.className,ft.className].filter(Boolean).join(" "),Bt=(N||Mt.style||ft.style)&&{...N,...Mt.style,...ft.style};return{...H,...Mt,...ft,href:X?.href,ref:u,onClick:no([O,ze]),onFocus:no([R,He]),onMouseEnter:no([I,Ee]),onMouseLeave:no([L,wt]),onTouchStart:no([F,De]),disabled:!!C,target:_,...Bt&&{style:Bt},...Vt&&{className:Vt},...C&&f3,...be&&p3,...i&&m3}}const Fh={},h3={className:"active"},f3={role:"link","aria-disabled":!0},p3={"data-status":"active","aria-current":"page"},m3={"data-transitioning":"transitioning"},to=new WeakMap,g3={rootMargin:"100px"},no=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},fO=K.forwardRef((e,t)=>{const{_asChild:n,...i}=e,{type:s,ref:l,...u}=d3(i,t),o=typeof i.children=="function"?i.children({isActive:u["data-status"]==="active"}):i.children;return n===void 0&&delete u.disabled,K.createElement(n||"a",{...u,ref:l},o)});function b3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let y3=class extends dO{constructor(t){super(t),this.useMatch=n=>lr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>lr({...n,from:this.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Gv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>$v({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qv({...n,from:this.id}),this.useLoaderData=n=>Hv({...n,from:this.id}),this.useNavigate=()=>zc({from:this.fullPath}),this.Link=$t.forwardRef((n,i)=>T.jsx(fO,{ref:i,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function v3(e){return new y3(e)}class _3 extends YB{constructor(t){super(t),this.useMatch=n=>lr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>lr({...n,from:this.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Gv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>$v({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qv({...n,from:this.id}),this.useLoaderData=n=>Hv({...n,from:this.id}),this.useNavigate=()=>zc({from:this.fullPath}),this.Link=$t.forwardRef((n,i)=>T.jsx(fO,{ref:i,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function S3(e){return new _3(e)}function yo(e){return typeof e=="object"?new fw(e,{silent:!0}).createRoute(e):new fw(e,{silent:!0}).createRoute}class fw{constructor(t,n){this.path=t,this.createRoute=i=>{this.silent;const s=v3(i);return s.isRoot=!1,s},this.silent=n?.silent}}class pw{constructor(t){this.useMatch=n=>lr({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>lr({from:this.options.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Gv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>$v({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>qv({...n,from:this.options.id}),this.useLoaderData=n=>Hv({...n,from:this.options.id}),this.useNavigate=()=>{const n=Nn();return zc({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function mw(e){return typeof e=="object"?new pw(e):t=>new pw({id:e,...t})}function E3(){const e=Nn(),t=K.useRef({router:e,mounted:!1}),[n,i]=K.useState(!1),{hasPendingMatches:s,isLoading:l}=hn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),u=Oh(l),o=l||n||s,d=Oh(o),h=l||s,p=Oh(h);return e.startTransition=f=>{i(!0),K.startTransition(()=>{f(),i(!1)})},K.useEffect(()=>{const f=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $i(e.latestLocation.publicHref)!==$i(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),Xl(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),Xl(()=>{u&&!l&&e.emit({type:"onLoad",...Gi(e.state)})},[u,e,l]),Xl(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...Gi(e.state)})},[h,p,e]),Xl(()=>{if(d&&!o){const f=Gi(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&kB(e)}},[o,d,e]),null}function x3(e){const t=hn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return T.jsx(zv,{getResetKey:()=>t,onCatch:(n,i)=>{if(kn(n))e.onCatch?.(n,i);else throw n},errorComponent:({error:n})=>{if(kn(n))return e.fallback?.(n);throw n},children:e.children})}function w3(){return T.jsx("p",{children:"Not Found"})}function $a(e){return T.jsx(T.Fragment,{children:e.children})}function pO(e,t,n){return t.options.notFoundComponent?T.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?T.jsx(e.options.defaultNotFoundComponent,{...n}):T.jsx(w3,{})}function C3({children:e}){const t=Nn();return t.isServer?T.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function T3(){const e=Nn();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||tv)(e.latestLocation),i=n!==tv(e.latestLocation)?n:void 0,s={storageKey:xc,shouldScrollRestoration:!0};return i&&(s.key=i),T.jsx(C3,{children:`(${tO.toString()})(${aB(JSON.stringify(s))})`})}const mO=K.memo(function({matchId:t}){const n=Nn(),i=hn({select:S=>{const v=S.matches.find(_=>_.id===t);return Lr(v),{routeId:v.routeId,ssr:v.ssr,_displayPending:v._displayPending}},structuralSharing:!0}),s=n.routesById[i.routeId],l=s.options.pendingComponent??n.options.defaultPendingComponent,u=l?T.jsx(l,{}):null,o=s.options.errorComponent??n.options.defaultErrorComponent,d=s.options.onCatch??n.options.defaultOnCatch,h=s.isRoot?s.options.notFoundComponent??n.options.notFoundRoute?.options.component:s.options.notFoundComponent,p=i.ssr===!1||i.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||p)&&(s.options.wrapInSuspense??l??(s.options.errorComponent?.preload||p))?K.Suspense:$a,g=o?zv:$a,b=h?x3:$a,x=hn({select:S=>S.loadedAt}),E=hn({select:S=>{const v=S.matches.findIndex(_=>_.id===t);return S.matches[v-1]?.routeId}}),y=s.isRoot?s.options.shellComponent??$a:$a;return T.jsxs(y,{children:[T.jsx(jc.Provider,{value:t,children:T.jsx(f,{fallback:u,children:T.jsx(g,{getResetKey:()=>x,errorComponent:o||Uc,onCatch:(S,v)=>{if(kn(S))throw S;d?.(S,v)},children:T.jsx(b,{fallback:S=>{if(!h||S.routeId&&S.routeId!==i.routeId||!S.routeId&&!s.isRoot)throw S;return K.createElement(h,S)},children:p||i._displayPending?T.jsx(JB,{fallback:u,children:T.jsx(gw,{matchId:t})}):T.jsx(gw,{matchId:t})})})})}),E===Tn&&n.options.scrollRestoration?T.jsxs(T.Fragment,{children:[T.jsx(A3,{}),T.jsx(T3,{})]}):null]})});function A3(){const e=Nn(),t=K.useRef(void 0);return T.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Gi(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gw=K.memo(function({matchId:t}){const n=Nn(),{match:i,key:s,routeId:l}=hn({select:d=>{const h=d.matches.find(x=>x.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),u=n.routesById[l],o=K.useMemo(()=>{const d=u.options.component??n.options.defaultComponent;return d?T.jsx(d,{},s):T.jsx(gO,{})},[s,u.options.component,n.options.defaultComponent]);if(i._displayPending)throw n.getMatch(i.id)?._nonReactive.displayPendingPromise;if(i._forcePending)throw n.getMatch(i.id)?._nonReactive.minPendingPromise;if(i.status==="pending"){const d=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const h=n.getMatch(i.id);if(h&&!h._nonReactive.minPendingPromise&&!n.isServer){const p=Ya();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(i.id)?._nonReactive.loadPromise}if(i.status==="notFound")return Lr(kn(i.error)),pO(n,u,i.error);if(i.status==="redirected")throw Lr(Gn(i.error)),n.getMatch(i.id)?._nonReactive.loadPromise;if(i.status==="error"){if(n.isServer){const d=(u.options.errorComponent??n.options.defaultErrorComponent)||Uc;return T.jsx(d,{error:i.error,reset:void 0,info:{componentStack:""}})}throw i.error}return o}),gO=K.memo(function(){const t=Nn(),n=K.useContext(jc),i=hn({select:h=>h.matches.find(p=>p.id===n)?.routeId}),s=t.routesById[i],l=hn({select:h=>{const f=h.matches.find(g=>g.id===n);return Lr(f),f.globalNotFound}}),u=hn({select:h=>{const p=h.matches,f=p.findIndex(g=>g.id===n);return p[f+1]?.id}}),o=t.options.defaultPendingComponent?T.jsx(t.options.defaultPendingComponent,{}):null;if(l)return pO(t,s,void 0);if(!u)return null;const d=T.jsx(mO,{matchId:u});return i===Tn?T.jsx(K.Suspense,{fallback:o,children:d}):d});function k3(){const e=Nn(),n=e.routesById[Tn].options.pendingComponent??e.options.defaultPendingComponent,i=n?T.jsx(n,{}):null,s=e.isServer||typeof document<"u"&&e.ssr?$a:K.Suspense,l=T.jsxs(s,{fallback:i,children:[!e.isServer&&T.jsx(E3,{}),T.jsx(R3,{})]});return e.options.InnerWrap?T.jsx(e.options.InnerWrap,{children:l}):l}function R3(){const e=Nn(),t=hn({select:s=>s.matches[0]?.id}),n=hn({select:s=>s.loadedAt}),i=t?T.jsx(mO,{matchId:t}):null;return T.jsx(jc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?i:T.jsx(zv,{getResetKey:()=>n,errorComponent:Uc,onCatch:s=>{s.message||s.toString()},children:i})})}const N3=e=>new O3(e);class O3 extends qB{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=yo,globalThis.createLazyFileRoute=mw):typeof window<"u"&&(window.createFileRoute=yo,window.createLazyFileRoute=mw);function I3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const i=hO(),s=T.jsx(i.Provider,{value:e,children:t});return e.options.Wrap?T.jsx(e.options.Wrap,{children:s}):s}function L3({router:e,...t}){return T.jsx(I3,{router:e,...t,children:T.jsx(k3,{})})}const Hc=S3({component:D3});function D3(){return T.jsxs(T.Fragment,{children:[T.jsx(gO,{}),null]})}const M3=yo("/")({beforeLoad:()=>{throw nO({to:"/sessions"})},component:()=>null}),bt=K.forwardRef(({className:e="",variant:t="primary",size:n="md",...i},s)=>{const l="inline-flex items-center justify-center rounded font-medium transition-colors focus-visible:outline-none disabled:opacity-50 disabled:cursor-not-allowed",u={primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-muted text-foreground hover:bg-muted/80 border border-border",ghost:"text-muted-foreground hover:text-foreground hover:bg-muted/50"},o={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base",icon:"w-10 h-10 p-0"};return T.jsx("button",{ref:s,className:`${l} ${u[t]} ${o[n]} ${e}`,...i})});bt.displayName="Button";const B3=K.forwardRef(({className:e="",children:t,...n},i)=>T.jsx("div",{ref:i,className:`bg-card text-card-foreground border border-border rounded-lg ${e}`,...n,children:t}));B3.displayName="Card";const F3=K.forwardRef(({className:e="",...t},n)=>T.jsx("input",{ref:n,className:`w-full px-3 py-2 bg-muted border border-border rounded text-foreground placeholder-muted-foreground outline-none ${e}`,...t}));F3.displayName="Input";const Vv=K.forwardRef(({className:e="",...t},n)=>T.jsx("textarea",{ref:n,className:`w-full px-3 py-2 bg-muted border border-border rounded text-foreground placeholder-muted-foreground outline-none resize-none ${e}`,...t}));Vv.displayName="Textarea";const bw=e=>{let t;const n=new Set,i=(h,p)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const g=t;t=p??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(b=>b(t,g))}},s=()=>t,o={setState:i,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(i,s,o);return o},P3=(e=>e?bw(e):bw),U3=e=>e;function j3(e,t=U3){const n=$t.useSyncExternalStore(e.subscribe,$t.useCallback(()=>t(e.getState()),[e,t]),$t.useCallback(()=>t(e.getInitialState()),[e,t]));return $t.useDebugValue(n),n}const yw=e=>{const t=P3(e),n=i=>j3(t,i);return Object.assign(n,t),n},Co=(e=>e?yw(e):yw),Wv=Co(e=>({isOpen:!1,title:"Confirm Action",message:"",confirmLabel:"Confirm",cancelLabel:"Cancel",variant:"default",onConfirm:()=>{},onCancel:void 0,openConfirmation:t=>e({isOpen:!0,title:t.title||"Confirm Action",message:t.message,confirmLabel:t.confirmLabel||"Confirm",cancelLabel:t.cancelLabel||"Cancel",variant:t.variant||"default",onConfirm:t.onConfirm,onCancel:t.onCancel}),closeConfirmation:()=>e({isOpen:!1,onConfirm:()=>{},onCancel:void 0})}));const z3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),vw=e=>{const t=H3(e);return t.charAt(0).toUpperCase()+t.slice(1)},bO=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),q3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var $3={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"};const G3=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:u,...o},d)=>K.createElement("svg",{ref:d,...$3,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:bO("lucide",s),...!l&&!q3(o)&&{"aria-hidden":"true"},...o},[...u.map(([h,p])=>K.createElement(h,p)),...Array.isArray(l)?l:[l]]));const Ae=(e,t)=>{const n=K.forwardRef(({className:i,...s},l)=>K.createElement(G3,{ref:l,iconNode:t,className:bO(`lucide-${z3(vw(e))}`,`lucide-${e}`,i),...s}));return n.displayName=vw(e),n};const V3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],W3=Ae("arrow-down",V3);const K3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Y3=Ae("arrow-left",K3);const X3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Z3=Ae("arrow-right",X3);const Q3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],J3=Ae("arrow-up",Q3);const eF=[["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"}]],yO=Ae("bot",eF);const tF=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],nF=Ae("braces",tF);const rF=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],iF=Ae("brain",rF);const aF=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vO=Ae("check",aF);const sF=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cr=Ae("chevron-down",sF);const oF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ot=Ae("chevron-right",oF);const lF=[["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"}]],dr=Ae("circle-alert",lF);const cF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],uF=Ae("circle-check",cF);const dF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],hF=Ae("circle-stop",dF);const fF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pF=Ae("circle",fF);const mF=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gF=Ae("clock",mF);const bF=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],yF=Ae("code",bF);const vF=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],_w=Ae("command",vF);const _F=[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]],Sw=Ae("diff",_F);const SF=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],_O=Ae("dollar-sign",SF);const EF=[["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"}]],xF=Ae("ellipsis-vertical",EF);const wF=[["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"}]],CF=Ae("external-link",wF);const TF=[["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"}]],AF=Ae("file-code",TF);const kF=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],RF=Ae("file-json",kF);const NF=[["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"}]],Ew=Ae("file-pen",NF);const OF=[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],IF=Ae("file-plus",OF);const LF=[["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"}]],SO=Ae("file-text",LF);const DF=[["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:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]],MF=Ae("file-type",DF);const BF=[["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:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]],FF=Ae("file-x",BF);const PF=[["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"}]],ho=Ae("file",PF);const UF=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],jF=Ae("folder-tree",UF);const zF=[["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"}]],HF=Ae("folder",zF);const qF=[["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"}]],Tc=Ae("git-branch",qF);const $F=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Ac=Ae("git-commit-horizontal",$F);const GF=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],EO=Ae("hash",GF);const VF=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],WF=Ae("image",VF);const KF=[["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"}]],xO=Ae("keyboard",KF);const YF=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],XF=Ae("list",YF);const ZF=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wO=Ae("loader-circle",ZF);const QF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],JF=Ae("message-square",QF);const e4=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],t4=Ae("octagon-x",e4);const n4=[["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"}]],xw=Ae("pencil",n4);const r4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kc=Ae("plus",r4);const i4=[["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"}]],a4=Ae("refresh-cw",i4);const s4=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],o4=Ae("rotate-ccw",s4);const l4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Kv=Ae("search",l4);const c4=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],vo=Ae("sparkles",c4);const u4=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],d4=Ae("square-check-big",u4);const h4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Za=Ae("terminal",h4);const f4=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],p4=Ae("trash-2",f4);const m4=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],g4=Ae("upload",m4);const b4=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],CO=Ae("user",b4);const y4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qc=Ae("x",y4);function v4(){const{isOpen:e,title:t,message:n,confirmLabel:i,cancelLabel:s,variant:l,onConfirm:u,onCancel:o,closeConfirmation:d}=Wv(),[h,p]=K.useState(!1);K.useEffect(()=>{e||p(!1)},[e]);const f=K.useCallback(async()=>{p(!0);try{await u(),d()}catch(x){console.error("Confirmation action failed:",x),p(!1)}},[u,d]),g=K.useCallback(()=>{o?.(),d()},[o,d]),b=x=>{x.target===x.currentTarget&&!h&&g()};return K.useEffect(()=>{const x=E=>{e&&!h&&(E.key==="Escape"&&(E.preventDefault(),g()),E.key==="Enter"&&(E.preventDefault(),f()))};if(e)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,h,f,g]),e?T.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:b,onKeyDown:x=>{x.key==="Escape"&&!h&&(x.preventDefault(),g())},children:T.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-lg max-w-md w-full mx-4",children:[T.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[l==="destructive"&&T.jsx(dr,{className:"w-5 h-5 text-destructive"}),T.jsx("h2",{className:"text-lg font-semibold",children:t})]}),T.jsx("button",{type:"button",onClick:g,disabled:h,className:"p-1 hover:bg-muted rounded transition-colors disabled:opacity-50","aria-label":"Close",children:T.jsx(qc,{className:"w-5 h-5"})})]}),T.jsx("div",{className:"p-4",children:T.jsx("p",{className:"text-muted-foreground",children:n})}),T.jsxs("div",{className:"flex items-center justify-end gap-3 p-4 border-t border-border",children:[T.jsx("button",{type:"button",onClick:g,disabled:h,className:"px-4 py-2 text-sm font-medium rounded transition-colors hover:bg-muted disabled:opacity-50",children:s}),T.jsx("button",{type:"button",onClick:f,disabled:h,className:`px-4 py-2 text-sm font-medium rounded transition-colors disabled:opacity-50 ${l==="destructive"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:h?"Processing...":i})]})]})}):null}function Dr(e){return Array.isArray?Array.isArray(e):kO(e)==="[object Array]"}function _4(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function S4(e){return e==null?"":_4(e)}function or(e){return typeof e=="string"}function TO(e){return typeof e=="number"}function E4(e){return e===!0||e===!1||x4(e)&&kO(e)=="[object Boolean]"}function AO(e){return typeof e=="object"}function x4(e){return AO(e)&&e!==null}function An(e){return e!=null}function Ph(e){return!e.trim().length}function kO(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const w4="Incorrect 'index' type",C4=e=>`Invalid value for key ${e}`,T4=e=>`Pattern length exceeds max of ${e}.`,A4=e=>`Missing ${e} property in key`,k4=e=>`Property 'weight' in key '${e}' must be a positive integer`,ww=Object.prototype.hasOwnProperty;class R4{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(i=>{let s=RO(i);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(i=>{i.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function RO(e){let t=null,n=null,i=null,s=1,l=null;if(or(e)||Dr(e))i=e,t=Cw(e),n=iv(e);else{if(!ww.call(e,"name"))throw new Error(A4("name"));const u=e.name;if(i=u,ww.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(k4(u));t=Cw(u),n=iv(u),l=e.getFn}return{path:t,id:n,weight:s,src:i,getFn:l}}function Cw(e){return Dr(e)?e:e.split(".")}function iv(e){return Dr(e)?e.join("."):e}function N4(e,t){let n=[],i=!1;const s=(l,u,o)=>{if(An(l))if(!u[o])n.push(l);else{let d=u[o];const h=l[d];if(!An(h))return;if(o===u.length-1&&(or(h)||TO(h)||E4(h)))n.push(S4(h));else if(Dr(h)){i=!0;for(let p=0,f=h.length;p<f;p+=1)s(h[p],u,o+1)}else u.length&&s(h,u,o+1)}};return s(e,or(t)?t.split("."):t,0),i?n:n[0]}const O4={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},I4={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},L4={location:0,threshold:.6,distance:100},D4={useExtendedSearch:!1,getFn:N4,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Re={...I4,...O4,...L4,...D4};const M4=/[^ ]+/g;function B4(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(s){const l=s.match(M4).length;if(n.has(l))return n.get(l);const u=1/Math.pow(l,.5*e),o=parseFloat(Math.round(u*i)/i);return n.set(l,o),o},clear(){n.clear()}}}class Yv{constructor({getFn:t=Re.getFn,fieldNormWeight:n=Re.fieldNormWeight}={}){this.norm=B4(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,i)=>{this._keysMap[n.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,or(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();or(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,i=this.size();n<i;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!An(t)||Ph(t))return;let i={v:t,i:n,n:this.norm.get(t)};this.records.push(i)}_addObject(t,n){let i={i:n,$:{}};this.keys.forEach((s,l)=>{let u=s.getFn?s.getFn(t):this.getFn(t,s.path);if(An(u)){if(Dr(u)){let o=[];const d=[{nestedArrIndex:-1,value:u}];for(;d.length;){const{nestedArrIndex:h,value:p}=d.pop();if(An(p))if(or(p)&&!Ph(p)){let f={v:p,i:h,n:this.norm.get(p)};o.push(f)}else Dr(p)&&p.forEach((f,g)=>{d.push({nestedArrIndex:g,value:f})})}i.$[l]=o}else if(or(u)&&!Ph(u)){let o={v:u,n:this.norm.get(u)};i.$[l]=o}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function NO(e,t,{getFn:n=Re.getFn,fieldNormWeight:i=Re.fieldNormWeight}={}){const s=new Yv({getFn:n,fieldNormWeight:i});return s.setKeys(e.map(RO)),s.setSources(t),s.create(),s}function F4(e,{getFn:t=Re.getFn,fieldNormWeight:n=Re.fieldNormWeight}={}){const{keys:i,records:s}=e,l=new Yv({getFn:t,fieldNormWeight:n});return l.setKeys(i),l.setIndexRecords(s),l}function Zl(e,{errors:t=0,currentLocation:n=0,expectedLocation:i=0,distance:s=Re.distance,ignoreLocation:l=Re.ignoreLocation}={}){const u=t/e.length;if(l)return u;const o=Math.abs(i-n);return s?u+o/s:o?1:u}function P4(e=[],t=Re.minMatchCharLength){let n=[],i=-1,s=-1,l=0;for(let u=e.length;l<u;l+=1){let o=e[l];o&&i===-1?i=l:!o&&i!==-1&&(s=l-1,s-i+1>=t&&n.push([i,s]),i=-1)}return e[l-1]&&l-i>=t&&n.push([i,l-1]),n}const Ui=32;function U4(e,t,n,{location:i=Re.location,distance:s=Re.distance,threshold:l=Re.threshold,findAllMatches:u=Re.findAllMatches,minMatchCharLength:o=Re.minMatchCharLength,includeMatches:d=Re.includeMatches,ignoreLocation:h=Re.ignoreLocation}={}){if(t.length>Ui)throw new Error(T4(Ui));const p=t.length,f=e.length,g=Math.max(0,Math.min(i,f));let b=l,x=g;const E=o>1||d,y=E?Array(f):[];let S;for(;(S=e.indexOf(t,x))>-1;){let O=Zl(t,{currentLocation:S,expectedLocation:g,distance:s,ignoreLocation:h});if(b=Math.min(O,b),x=S+p,E){let R=0;for(;R<p;)y[S+R]=1,R+=1}}x=-1;let v=[],_=1,C=p+f;const N=1<<p-1;for(let O=0;O<p;O+=1){let R=0,I=C;for(;R<I;)Zl(t,{errors:O,currentLocation:g+I,expectedLocation:g,distance:s,ignoreLocation:h})<=b?R=I:C=I,I=Math.floor((C-R)/2+R);C=I;let L=Math.max(1,g-I+1),F=u?f:Math.min(g+I,f)+p,j=Array(F+2);j[F+1]=(1<<O)-1;for(let G=F;G>=L;G-=1){let V=G-1,W=n[e.charAt(V)];if(E&&(y[V]=+!!W),j[G]=(j[G+1]<<1|1)&W,O&&(j[G]|=(v[G+1]|v[G])<<1|1|v[G+1]),j[G]&N&&(_=Zl(t,{errors:O,currentLocation:V,expectedLocation:g,distance:s,ignoreLocation:h}),_<=b)){if(b=_,x=V,x<=g)break;L=Math.max(1,2*g-x)}}if(Zl(t,{errors:O+1,currentLocation:g,expectedLocation:g,distance:s,ignoreLocation:h})>b)break;v=j}const A={isMatch:x>=0,score:Math.max(.001,_)};if(E){const O=P4(y,o);O.length?d&&(A.indices=O):A.isMatch=!1}return A}function j4(e){let t={};for(let n=0,i=e.length;n<i;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<i-n-1}return t}const Rc=String.prototype.normalize?(e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(e=>e);class OO{constructor(t,{location:n=Re.location,threshold:i=Re.threshold,distance:s=Re.distance,includeMatches:l=Re.includeMatches,findAllMatches:u=Re.findAllMatches,minMatchCharLength:o=Re.minMatchCharLength,isCaseSensitive:d=Re.isCaseSensitive,ignoreDiacritics:h=Re.ignoreDiacritics,ignoreLocation:p=Re.ignoreLocation}={}){if(this.options={location:n,threshold:i,distance:s,includeMatches:l,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:d,ignoreDiacritics:h,ignoreLocation:p},t=d?t:t.toLowerCase(),t=h?Rc(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(b,x)=>{this.chunks.push({pattern:b,alphabet:j4(b),startIndex:x})},g=this.pattern.length;if(g>Ui){let b=0;const x=g%Ui,E=g-x;for(;b<E;)f(this.pattern.substr(b,Ui),b),b+=Ui;if(x){const y=g-Ui;f(this.pattern.substr(y),y)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:i,includeMatches:s}=this.options;if(t=n?t:t.toLowerCase(),t=i?Rc(t):t,this.pattern===t){let E={isMatch:!0,score:0};return s&&(E.indices=[[0,t.length-1]]),E}const{location:l,distance:u,threshold:o,findAllMatches:d,minMatchCharLength:h,ignoreLocation:p}=this.options;let f=[],g=0,b=!1;this.chunks.forEach(({pattern:E,alphabet:y,startIndex:S})=>{const{isMatch:v,score:_,indices:C}=U4(t,E,y,{location:l+S,distance:u,threshold:o,findAllMatches:d,minMatchCharLength:h,includeMatches:s,ignoreLocation:p});v&&(b=!0),g+=_,v&&C&&(f=[...f,...C])});let x={isMatch:b,score:b?g/this.chunks.length:1};return b&&s&&(x.indices=f),x}}class gi{constructor(t){this.pattern=t}static isMultiMatch(t){return Tw(t,this.multiRegex)}static isSingleMatch(t){return Tw(t,this.singleRegex)}search(){}}function Tw(e,t){const n=e.match(t);return n?n[1]:null}class z4 extends gi{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class H4 extends gi{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const i=t.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class q4 extends gi{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class $4 extends gi{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class G4 extends gi{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class V4 extends gi{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class IO extends gi{constructor(t,{location:n=Re.location,threshold:i=Re.threshold,distance:s=Re.distance,includeMatches:l=Re.includeMatches,findAllMatches:u=Re.findAllMatches,minMatchCharLength:o=Re.minMatchCharLength,isCaseSensitive:d=Re.isCaseSensitive,ignoreDiacritics:h=Re.ignoreDiacritics,ignoreLocation:p=Re.ignoreLocation}={}){super(t),this._bitapSearch=new OO(t,{location:n,threshold:i,distance:s,includeMatches:l,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:d,ignoreDiacritics:h,ignoreLocation:p})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class LO extends gi{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,i;const s=[],l=this.pattern.length;for(;(i=t.indexOf(this.pattern,n))>-1;)n=i+l,s.push([i,n-1]);const u=!!s.length;return{isMatch:u,score:u?0:1,indices:s}}}const av=[z4,LO,q4,$4,V4,G4,H4,IO],Aw=av.length,W4=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,K4="|";function Y4(e,t={}){return e.split(K4).map(n=>{let i=n.trim().split(W4).filter(l=>l&&!!l.trim()),s=[];for(let l=0,u=i.length;l<u;l+=1){const o=i[l];let d=!1,h=-1;for(;!d&&++h<Aw;){const p=av[h];let f=p.isMultiMatch(o);f&&(s.push(new p(f,t)),d=!0)}if(!d)for(h=-1;++h<Aw;){const p=av[h];let f=p.isSingleMatch(o);if(f){s.push(new p(f,t));break}}}return s})}const X4=new Set([IO.type,LO.type]);class Z4{constructor(t,{isCaseSensitive:n=Re.isCaseSensitive,ignoreDiacritics:i=Re.ignoreDiacritics,includeMatches:s=Re.includeMatches,minMatchCharLength:l=Re.minMatchCharLength,ignoreLocation:u=Re.ignoreLocation,findAllMatches:o=Re.findAllMatches,location:d=Re.location,threshold:h=Re.threshold,distance:p=Re.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:i,includeMatches:s,minMatchCharLength:l,findAllMatches:o,ignoreLocation:u,location:d,threshold:h,distance:p},t=n?t:t.toLowerCase(),t=i?Rc(t):t,this.pattern=t,this.query=Y4(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:s,ignoreDiacritics:l}=this.options;t=s?t:t.toLowerCase(),t=l?Rc(t):t;let u=0,o=[],d=0;for(let h=0,p=n.length;h<p;h+=1){const f=n[h];o.length=0,u=0;for(let g=0,b=f.length;g<b;g+=1){const x=f[g],{isMatch:E,indices:y,score:S}=x.search(t);if(E){if(u+=1,d+=S,i){const v=x.constructor.type;X4.has(v)?o=[...o,...y]:o.push(y)}}else{d=0,u=0,o.length=0;break}}if(u){let g={isMatch:!0,score:d/u};return i&&(g.indices=o),g}}return{isMatch:!1,score:1}}}const sv=[];function Q4(...e){sv.push(...e)}function ov(e,t){for(let n=0,i=sv.length;n<i;n+=1){let s=sv[n];if(s.condition(e,t))return new s(e,t)}return new OO(e,t)}const Nc={AND:"$and",OR:"$or"},lv={PATH:"$path",PATTERN:"$val"},cv=e=>!!(e[Nc.AND]||e[Nc.OR]),J4=e=>!!e[lv.PATH],eP=e=>!Dr(e)&&AO(e)&&!cv(e),kw=e=>({[Nc.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function DO(e,t,{auto:n=!0}={}){const i=s=>{let l=Object.keys(s);const u=J4(s);if(!u&&l.length>1&&!cv(s))return i(kw(s));if(eP(s)){const d=u?s[lv.PATH]:l[0],h=u?s[lv.PATTERN]:s[d];if(!or(h))throw new Error(C4(d));const p={keyId:iv(d),pattern:h};return n&&(p.searcher=ov(h,t)),p}let o={children:[],operator:l[0]};return l.forEach(d=>{const h=s[d];Dr(h)&&h.forEach(p=>{o.children.push(i(p))})}),o};return cv(e)||(e=kw(e)),i(e)}function tP(e,{ignoreFieldNorm:t=Re.ignoreFieldNorm}){e.forEach(n=>{let i=1;n.matches.forEach(({key:s,norm:l,score:u})=>{const o=s?s.weight:null;i*=Math.pow(u===0&&o?Number.EPSILON:u,(o||1)*(t?1:l))}),n.score=i})}function nP(e,t){const n=e.matches;t.matches=[],An(n)&&n.forEach(i=>{if(!An(i.indices)||!i.indices.length)return;const{indices:s,value:l}=i;let u={indices:s,value:l};i.key&&(u.key=i.key.src),i.idx>-1&&(u.refIndex=i.idx),t.matches.push(u)})}function rP(e,t){t.score=e.score}function iP(e,t,{includeMatches:n=Re.includeMatches,includeScore:i=Re.includeScore}={}){const s=[];return n&&s.push(nP),i&&s.push(rP),e.map(l=>{const{idx:u}=l,o={item:t[u],refIndex:u};return s.length&&s.forEach(d=>{d(l,o)}),o})}class bi{constructor(t,n={},i){this.options={...Re,...n},this.options.useExtendedSearch,this._keyStore=new R4(this.options.keys),this.setCollection(t,i)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Yv))throw new Error(w4);this._myIndex=n||NO(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){An(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let i=0,s=this._docs.length;i<s;i+=1){const l=this._docs[i];t(l,i)&&(this.removeAt(i),i-=1,s-=1,n.push(l))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:i,includeScore:s,shouldSort:l,sortFn:u,ignoreFieldNorm:o}=this.options;let d=or(t)?or(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return tP(d,{ignoreFieldNorm:o}),l&&d.sort(u),TO(n)&&n>-1&&(d=d.slice(0,n)),iP(d,this._docs,{includeMatches:i,includeScore:s})}_searchStringList(t){const n=ov(t,this.options),{records:i}=this._myIndex,s=[];return i.forEach(({v:l,i:u,n:o})=>{if(!An(l))return;const{isMatch:d,score:h,indices:p}=n.searchIn(l);d&&s.push({item:l,idx:u,matches:[{score:h,value:l,norm:o,indices:p}]})}),s}_searchLogical(t){const n=DO(t,this.options),i=(o,d,h)=>{if(!o.children){const{keyId:f,searcher:g}=o,b=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(d,f),searcher:g});return b&&b.length?[{idx:h,item:d,matches:b}]:[]}const p=[];for(let f=0,g=o.children.length;f<g;f+=1){const b=o.children[f],x=i(b,d,h);if(x.length)p.push(...x);else if(o.operator===Nc.AND)return[]}return p},s=this._myIndex.records,l={},u=[];return s.forEach(({$:o,i:d})=>{if(An(o)){let h=i(n,o,d);h.length&&(l[d]||(l[d]={idx:d,item:o,matches:[]},u.push(l[d])),h.forEach(({matches:p})=>{l[d].matches.push(...p)}))}}),u}_searchObjectList(t){const n=ov(t,this.options),{keys:i,records:s}=this._myIndex,l=[];return s.forEach(({$:u,i:o})=>{if(!An(u))return;let d=[];i.forEach((h,p)=>{d.push(...this._findMatches({key:h,value:u[p],searcher:n}))}),d.length&&l.push({idx:o,item:u,matches:d})}),l}_findMatches({key:t,value:n,searcher:i}){if(!An(n))return[];let s=[];if(Dr(n))n.forEach(({v:l,i:u,n:o})=>{if(!An(l))return;const{isMatch:d,score:h,indices:p}=i.searchIn(l);d&&s.push({score:h,key:t,value:l,idx:u,norm:o,indices:p})});else{const{v:l,n:u}=n,{isMatch:o,score:d,indices:h}=i.searchIn(l);o&&s.push({score:d,key:t,value:l,norm:u,indices:h})}return s}}bi.version="7.1.0";bi.createIndex=NO;bi.parseIndex=F4;bi.config=Re;bi.parseQuery=DO;Q4(Z4);function aP(e){switch(e.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"cjs":case"py":case"rb":case"go":case"rs":case"java":case"c":case"cpp":case"h":case"hpp":return AF;case"json":case"yaml":case"yml":case"toml":return RF;case"md":case"txt":case"log":return SO;case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return WF;case"css":case"scss":case"sass":case"less":return nF;case"html":case"xml":return MF;default:return ho}}function sP(e,t){const n=t.get(e);return n?{added:{icon:kc,label:"Added",className:"text-green-500"},modified:{icon:xw,label:"Modified",className:"text-yellow-500"},untracked:{icon:kc,label:"Untracked",className:"text-blue-500"}}[n]||{icon:xw,label:"Modified",className:"text-yellow-500"}:null}function oP({files:e,changedFiles:t=[],query:n,selectedIndex:i,onSelect:s,onEnterSelect:l,onClose:u}){const o=K.useMemo(()=>new Map(t?.map(p=>[p.path,p.status])||[]),[t]),d=K.useMemo(()=>new bi(e,{threshold:.4,distance:100,ignoreLocation:!0,includeMatches:!0}),[e]),h=K.useMemo(()=>{if(!n)return e.slice(0,20);const p=d.search(n).map(f=>f.item);return p.sort((f,g)=>{const b=o.has(f),x=o.has(g);return b&&!x?-1:!b&&x?1:0}),p.slice(0,20)},[d,n,e,o]);return K.useEffect(()=>{document.getElementById(`file-item-${i}`)?.scrollIntoView({block:"nearest"})},[i]),K.useEffect(()=>{l(h[i])},[h,i,l]),K.useEffect(()=>{const p=f=>{f.target.closest("[data-file-mention-popup]")||u()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[u]),h.length===0?T.jsx("div",{"data-file-mention-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg z-50 p-3",children:T.jsx("span",{className:"text-muted-foreground text-sm",children:"No files found"})}):T.jsx("div",{"data-file-mention-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg max-h-[300px] overflow-y-auto z-50",children:h.map((p,f)=>T.jsx("button",{type:"button",id:`file-item-${f}`,onMouseDown:g=>{g.preventDefault(),s(p)},className:`w-full text-left px-3 py-2 hover:bg-accent ${f===i?"bg-accent":""}`,children:T.jsxs("div",{className:"flex items-center gap-2 w-full",children:[(()=>{const g=aP(p);return T.jsx(g,{className:"w-4 h-4 flex-shrink-0 text-muted-foreground"})})(),T.jsx("span",{className:"font-mono text-sm flex-1 truncate",children:p}),(()=>{const g=sP(p,o);return g&&T.jsx(g.icon,{className:`w-3.5 h-3.5 flex-shrink-0 ${g.className}`,title:g.label})})()]})},p))})}const Rw=[{id:"models",label:"/models",description:"Open model selector",icon:vo},{id:"agents",label:"/agents",description:"Open agent selector",icon:Za},{id:"new",label:"/new",description:"Create new session",icon:kc},{id:"help",label:"/help",description:"Show keyboard shortcuts and help",icon:xO},{id:"vim",label:"/vim",description:"Toggle Vim mode keybindings",icon:yF}];function lP(e){if(!e)return Rw;const t=e.toLowerCase(),n=[];for(const i of Rw){const s=i.label.toLowerCase().includes(t),l=i.description.toLowerCase().includes(t);if(s||l){const u=s?10:5;n.push({...i,matchScore:u})}}return n.sort((i,s)=>{const l=(s.matchScore||0)-(i.matchScore||0);return l!==0?l:i.label.localeCompare(s.label)})}function cP({query:e,selectedIndex:t,onSelect:n,onEnterSelect:i,onClose:s}){const l=K.useMemo(()=>lP(e),[e]);return K.useEffect(()=>{document.getElementById(`command-item-${t}`)?.scrollIntoView({block:"nearest"})},[t]),K.useEffect(()=>{i(l[t]?.id)},[l,t,i]),K.useEffect(()=>{const u=o=>{o.target.closest("[data-command-popup]")||s()};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]),l.length===0?T.jsx("div",{"data-command-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg z-50 p-3",children:T.jsx("span",{className:"text-muted-foreground text-sm",children:"No commands found"})}):T.jsx("div",{"data-command-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg max-h-[300px] overflow-y-auto z-50",children:l.map((u,o)=>{const d=u.icon;return T.jsx("button",{type:"button",id:`command-item-${o}`,onMouseDown:h=>{h.preventDefault(),n(u.id)},className:`w-full text-left px-3 py-2 hover:bg-accent ${o===t?"bg-accent":""}`,children:T.jsxs("div",{className:"flex items-center gap-3 w-full",children:[T.jsx(d,{className:"w-4 h-4 flex-shrink-0 text-primary"}),T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx("div",{className:"font-mono text-sm font-medium text-foreground",children:u.label}),T.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.description})]})]})},u.id)})})}const uP={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function Xv({isOpen:e,onClose:t,title:n,children:i,showCloseButton:s=!0,closeOnBackdropClick:l=!0,closeOnEscape:u=!0,maxWidth:o="md"}){if(K.useEffect(()=>{if(!e||!u)return;const h=p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),t())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,u,t]),K.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const d=h=>{l&&h.target===h.currentTarget&&t()};return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[9999] cursor-default",onClick:d,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&d(h)},"aria-label":"Close modal"}),T.jsx("div",{className:`fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[9999] w-full ${uP[o]} px-4`,children:T.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-lg",children:[(n||s)&&T.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[n&&T.jsx("div",{className:"text-lg font-semibold text-foreground",children:n}),s&&T.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground hover:text-foreground transition-colors ml-auto","aria-label":"Close",children:T.jsx(qc,{className:"h-5 w-5"})})]}),T.jsx("div",{className:"p-4",children:i})]})})]})}const dP=[{keys:["Ctrl","H"],description:"Navigate to left sidebar (sessions)",category:"Navigation"},{keys:["Ctrl","L"],description:"Navigate to right sidebar (git)",category:"Navigation"},{keys:["Ctrl","/"],description:"Toggle left sidebar collapse/expand",category:"Navigation"},{keys:["Ctrl","\\"],description:"Toggle right sidebar collapse/expand",category:"Navigation"},{keys:["Ctrl","N"],description:"Create new session",category:"Navigation"},{keys:["ESC"],description:"Close sidebar and return to center",category:"Navigation"},{keys:["J"],description:"Navigate to next item (in focused list)",category:"List Navigation"},{keys:["K"],description:"Navigate to previous item (in focused list)",category:"List Navigation"},{keys:["Enter"],description:"Select focused item and return to input",category:"List Navigation"},{keys:["Space"],description:"Toggle stage/unstage for focused file (git panel)",category:"Git Operations"},{keys:["A"],description:"Stage all unstaged files",category:"Git Operations"},{keys:["U"],description:"Unstage all staged files",category:"Git Operations"},{keys:["C"],description:"Open commit modal (if files are staged)",category:"Git Operations"},{keys:["Tab"],description:"Toggle plan mode",category:"Chat"},{keys:["Enter"],description:"Send message",category:"Chat"},{keys:["Shift","Enter"],description:"New line in message",category:"Chat"},{keys:["@"],description:"Mention file (opens file picker)",category:"Chat"},{keys:["/"],description:"Slash command (opens command menu)",category:"Chat"}],hP=[{keys:["i"],description:"Enter insert mode at cursor (vim mode)",category:"Vim Mode"},{keys:["a"],description:"Enter insert mode after cursor (vim mode)",category:"Vim Mode"},{keys:["I"],description:"Enter insert mode at line start (vim mode)",category:"Vim Mode"},{keys:["A"],description:"Enter insert mode at line end (vim mode)",category:"Vim Mode"},{keys:["o"],description:"New line below and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["O"],description:"New line above and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["ESC"],description:"Return to normal mode (vim mode)",category:"Vim Mode"},{keys:["Enter"],description:"Send message in normal mode (vim mode)",category:"Vim Mode"},{keys:["w"],description:"Jump to next word start (vim mode)",category:"Vim Mode"},{keys:["e"],description:"Jump to next word end (vim mode)",category:"Vim Mode"},{keys:["b"],description:"Jump to previous word start (vim mode)",category:"Vim Mode"},{keys:["x"],description:"Delete character under cursor (vim mode)",category:"Vim Mode"},{keys:["s"],description:"Delete character and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["S"],description:"Delete line and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["f","{char}"],description:"Find and jump to next character on line (vim mode)",category:"Vim Mode"},{keys:["d","d"],description:"Delete current line (vim mode)",category:"Vim Mode"},{keys:["0"],description:"Jump to line start (vim mode)",category:"Vim Mode"},{keys:["$"],description:"Jump to line end (vim mode)",category:"Vim Mode"}],fP=[{command:"/models",description:"Open model selector"},{command:"/agents",description:"Open agent selector"},{command:"/new",description:"Create new session"},{command:"/help",description:"Show keyboard shortcuts and help (this modal)"}];function pP(e){const t={};for(const n of e)t[n.category]||(t[n.category]=[]),t[n.category].push(n);return t}function mP({isOpen:e,onClose:t}){const n=[...dP,...hP],i=pP(n),s=K.useRef(null),l=K.useRef(null);return K.useEffect(()=>{e?(l.current=document.activeElement,l.current&&l.current.blur()):l.current&&(l.current.focus(),l.current=null)},[e]),K.useEffect(()=>{if(!e)return;const u=o=>{const d=o.target;if(!(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable))if(o.key==="j"){o.preventDefault();const p=s.current;p&&p.scrollBy({top:100,behavior:"smooth"})}else if(o.key==="k"){o.preventDefault();const p=s.current;p&&p.scrollBy({top:-100,behavior:"smooth"})}else o.key==="Enter"&&(o.preventDefault(),t())};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,t]),T.jsx(Xv,{isOpen:e,onClose:t,title:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(xO,{className:"w-5 h-5"}),T.jsx("span",{children:"Keyboard Shortcuts & Help"})]}),maxWidth:"2xl",closeOnEscape:!0,closeOnBackdropClick:!0,children:T.jsxs("div",{ref:s,className:"space-y-6 max-h-[70vh] overflow-y-auto",children:[Object.entries(i).map(([u,o])=>T.jsxs("div",{children:[T.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[T.jsx(_w,{className:"w-4 h-4"}),u]}),T.jsx("div",{className:"space-y-2",children:o.map((d,h)=>T.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-accent/50 hover:bg-accent transition-colors",children:[T.jsx("span",{className:"text-sm text-foreground",children:d.description}),T.jsx("div",{className:"flex items-center gap-1",children:d.keys.map(p=>T.jsxs("span",{className:"flex items-center gap-1",children:[T.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-background border border-border rounded shadow-sm",children:p}),d.keys.indexOf(p)<d.keys.length-1&&T.jsx("span",{className:"text-muted-foreground",children:"+"})]},p))})]},`${u}-${d.description}`))})]},u)),T.jsxs("div",{children:[T.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[T.jsx(_w,{className:"w-4 h-4"}),"Slash Commands"]}),T.jsx("div",{className:"space-y-2",children:fP.map((u,o)=>T.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-accent/50 hover:bg-accent transition-colors",children:[T.jsx("span",{className:"text-sm text-foreground",children:u.description}),T.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-background border border-border rounded shadow-sm",children:u.command})]},u.command))})]}),T.jsx("div",{className:"pt-4 border-t border-border",children:T.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.jsx("strong",{children:"Tip:"})," Shortcuts are disabled when typing in input fields. Press ",T.jsx("kbd",{className:"text-xs",children:"ESC"})," to close popups and return focus to chat input."]})})]})})}var Nw;(function(e){e.OPENAI="openai",e.ANTHROPIC="anthropic",e.GOOGLE="google",e.OPENROUTER="openrouter",e.OPENCODE="opencode",e.ZAI="zai",e.SOLFORGE="solforge"})(Nw||(Nw={}));function MO(e,t){return function(){return e.apply(t,arguments)}}const{toString:gP}=Object.prototype,{getPrototypeOf:Zv}=Object,{iterator:$c,toStringTag:BO}=Symbol,Gc=(e=>t=>{const n=gP.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zn=e=>(e=e.toLowerCase(),t=>Gc(t)===e),Vc=e=>t=>typeof t===e,{isArray:ts}=Array,Qa=Vc("undefined");function To(e){return e!==null&&!Qa(e)&&e.constructor!==null&&!Qa(e.constructor)&&fn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const FO=Zn("ArrayBuffer");function bP(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&FO(e.buffer),t}const yP=Vc("string"),fn=Vc("function"),PO=Vc("number"),Ao=e=>e!==null&&typeof e=="object",vP=e=>e===!0||e===!1,oc=e=>{if(Gc(e)!=="object")return!1;const t=Zv(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(BO in e)&&!($c in e)},_P=e=>{if(!Ao(e)||To(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},SP=Zn("Date"),EP=Zn("File"),xP=Zn("Blob"),wP=Zn("FileList"),CP=e=>Ao(e)&&fn(e.pipe),TP=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fn(e.append)&&((t=Gc(e))==="formdata"||t==="object"&&fn(e.toString)&&e.toString()==="[object FormData]"))},AP=Zn("URLSearchParams"),[kP,RP,NP,OP]=["ReadableStream","Request","Response","Headers"].map(Zn),IP=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ko(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),ts(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{if(To(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),u=l.length;let o;for(i=0;i<u;i++)o=l[i],t.call(null,e[o],o,e)}}function UO(e,t){if(To(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,s;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const Hi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jO=e=>!Qa(e)&&e!==Hi;function uv(){const{caseless:e,skipUndefined:t}=jO(this)&&this||{},n={},i=(s,l)=>{const u=e&&UO(n,l)||l;oc(n[u])&&oc(s)?n[u]=uv(n[u],s):oc(s)?n[u]=uv({},s):ts(s)?n[u]=s.slice():(!t||!Qa(s))&&(n[u]=s)};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&ko(arguments[s],i);return n}const LP=(e,t,n,{allOwnKeys:i}={})=>(ko(t,(s,l)=>{n&&fn(s)?e[l]=MO(s,n):e[l]=s},{allOwnKeys:i}),e),DP=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),MP=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},BP=(e,t,n,i)=>{let s,l,u;const o={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)u=s[l],(!i||i(u,e,t))&&!o[u]&&(t[u]=e[u],o[u]=!0);e=n!==!1&&Zv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},FP=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},PP=e=>{if(!e)return null;if(ts(e))return e;let t=e.length;if(!PO(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},UP=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zv(Uint8Array)),jP=(e,t)=>{const i=(e&&e[$c]).call(e);let s;for(;(s=i.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},zP=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},HP=Zn("HTMLFormElement"),qP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),Ow=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),$P=Zn("RegExp"),zO=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};ko(n,(s,l)=>{let u;(u=t(s,l,e))!==!1&&(i[l]=u||s)}),Object.defineProperties(e,i)},GP=e=>{zO(e,(t,n)=>{if(fn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(fn(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},VP=(e,t)=>{const n={},i=s=>{s.forEach(l=>{n[l]=!0})};return ts(e)?i(e):i(String(e).split(t)),n},WP=()=>{},KP=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function YP(e){return!!(e&&fn(e.append)&&e[BO]==="FormData"&&e[$c])}const XP=e=>{const t=new Array(10),n=(i,s)=>{if(Ao(i)){if(t.indexOf(i)>=0)return;if(To(i))return i;if(!("toJSON"in i)){t[s]=i;const l=ts(i)?[]:{};return ko(i,(u,o)=>{const d=n(u,s+1);!Qa(d)&&(l[o]=d)}),t[s]=void 0,l}}return i};return n(e,0)},ZP=Zn("AsyncFunction"),QP=e=>e&&(Ao(e)||fn(e))&&fn(e.then)&&fn(e.catch),HO=((e,t)=>e?setImmediate:t?((n,i)=>(Hi.addEventListener("message",({source:s,data:l})=>{s===Hi&&l===n&&i.length&&i.shift()()},!1),s=>{i.push(s),Hi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",fn(Hi.postMessage)),JP=typeof queueMicrotask<"u"?queueMicrotask.bind(Hi):typeof process<"u"&&process.nextTick||HO,eU=e=>e!=null&&fn(e[$c]),se={isArray:ts,isArrayBuffer:FO,isBuffer:To,isFormData:TP,isArrayBufferView:bP,isString:yP,isNumber:PO,isBoolean:vP,isObject:Ao,isPlainObject:oc,isEmptyObject:_P,isReadableStream:kP,isRequest:RP,isResponse:NP,isHeaders:OP,isUndefined:Qa,isDate:SP,isFile:EP,isBlob:xP,isRegExp:$P,isFunction:fn,isStream:CP,isURLSearchParams:AP,isTypedArray:UP,isFileList:wP,forEach:ko,merge:uv,extend:LP,trim:IP,stripBOM:DP,inherits:MP,toFlatObject:BP,kindOf:Gc,kindOfTest:Zn,endsWith:FP,toArray:PP,forEachEntry:jP,matchAll:zP,isHTMLForm:HP,hasOwnProperty:Ow,hasOwnProp:Ow,reduceDescriptors:zO,freezeMethods:GP,toObjectSet:VP,toCamelCase:qP,noop:WP,toFiniteNumber:KP,findKey:UO,global:Hi,isContextDefined:jO,isSpecCompliantForm:YP,toJSONObject:XP,isAsyncFn:ZP,isThenable:QP,setImmediate:HO,asap:JP,isIterable:eU};function Be(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}se.inherits(Be,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:se.toJSONObject(this.config),code:this.code,status:this.status}}});const qO=Be.prototype,$O={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{$O[e]={value:e}});Object.defineProperties(Be,$O);Object.defineProperty(qO,"isAxiosError",{value:!0});Be.from=(e,t,n,i,s,l)=>{const u=Object.create(qO);se.toFlatObject(e,u,function(p){return p!==Error.prototype},h=>h!=="isAxiosError");const o=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Be.call(u,o,d,n,i,s),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",l&&Object.assign(u,l),u};const tU=null;function dv(e){return se.isPlainObject(e)||se.isArray(e)}function GO(e){return se.endsWith(e,"[]")?e.slice(0,-2):e}function Iw(e,t,n){return e?e.concat(t).map(function(s,l){return s=GO(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function nU(e){return se.isArray(e)&&!e.some(dv)}const rU=se.toFlatObject(se,{},null,function(t){return/^is[A-Z]/.test(t)});function Wc(e,t,n){if(!se.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=se.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,y){return!se.isUndefined(y[E])});const i=n.metaTokens,s=n.visitor||p,l=n.dots,u=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&se.isSpecCompliantForm(t);if(!se.isFunction(s))throw new TypeError("visitor must be a function");function h(x){if(x===null)return"";if(se.isDate(x))return x.toISOString();if(se.isBoolean(x))return x.toString();if(!d&&se.isBlob(x))throw new Be("Blob is not supported. Use a Buffer instead.");return se.isArrayBuffer(x)||se.isTypedArray(x)?d&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function p(x,E,y){let S=x;if(x&&!y&&typeof x=="object"){if(se.endsWith(E,"{}"))E=i?E:E.slice(0,-2),x=JSON.stringify(x);else if(se.isArray(x)&&nU(x)||(se.isFileList(x)||se.endsWith(E,"[]"))&&(S=se.toArray(x)))return E=GO(E),S.forEach(function(_,C){!(se.isUndefined(_)||_===null)&&t.append(u===!0?Iw([E],C,l):u===null?E:E+"[]",h(_))}),!1}return dv(x)?!0:(t.append(Iw(y,E,l),h(x)),!1)}const f=[],g=Object.assign(rU,{defaultVisitor:p,convertValue:h,isVisitable:dv});function b(x,E){if(!se.isUndefined(x)){if(f.indexOf(x)!==-1)throw Error("Circular reference detected in "+E.join("."));f.push(x),se.forEach(x,function(S,v){(!(se.isUndefined(S)||S===null)&&s.call(t,S,se.isString(v)?v.trim():v,E,g))===!0&&b(S,E?E.concat(v):[v])}),f.pop()}}if(!se.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Lw(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Qv(e,t){this._pairs=[],e&&Wc(e,this,t)}const VO=Qv.prototype;VO.append=function(t,n){this._pairs.push([t,n])};VO.toString=function(t){const n=t?function(i){return t.call(this,i,Lw)}:Lw;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function iU(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function WO(e,t,n){if(!t)return e;const i=n&&n.encode||iU;se.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=se.isURLSearchParams(t)?t.toString():new Qv(t,n).toString(i),l){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class Dw{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){se.forEach(this.handlers,function(i){i!==null&&t(i)})}}const KO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},aU=typeof URLSearchParams<"u"?URLSearchParams:Qv,sU=typeof FormData<"u"?FormData:null,oU=typeof Blob<"u"?Blob:null,lU={isBrowser:!0,classes:{URLSearchParams:aU,FormData:sU,Blob:oU},protocols:["http","https","file","blob","url","data"]},Jv=typeof window<"u"&&typeof document<"u",hv=typeof navigator=="object"&&navigator||void 0,cU=Jv&&(!hv||["ReactNative","NativeScript","NS"].indexOf(hv.product)<0),uU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dU=Jv&&window.location.href||"http://localhost",hU=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jv,hasStandardBrowserEnv:cU,hasStandardBrowserWebWorkerEnv:uU,navigator:hv,origin:dU},Symbol.toStringTag,{value:"Module"})),Yt={...hU,...lU};function fU(e,t){return Wc(e,new Yt.classes.URLSearchParams,{visitor:function(n,i,s,l){return Yt.isNode&&se.isBuffer(n)?(this.append(i,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function pU(e){return se.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function mU(e){const t={},n=Object.keys(e);let i;const s=n.length;let l;for(i=0;i<s;i++)l=n[i],t[l]=e[l];return t}function YO(e){function t(n,i,s,l){let u=n[l++];if(u==="__proto__")return!0;const o=Number.isFinite(+u),d=l>=n.length;return u=!u&&se.isArray(s)?s.length:u,d?(se.hasOwnProp(s,u)?s[u]=[s[u],i]:s[u]=i,!o):((!s[u]||!se.isObject(s[u]))&&(s[u]=[]),t(n,i,s[u],l)&&se.isArray(s[u])&&(s[u]=mU(s[u])),!o)}if(se.isFormData(e)&&se.isFunction(e.entries)){const n={};return se.forEachEntry(e,(i,s)=>{t(pU(i),s,n,0)}),n}return null}function gU(e,t,n){if(se.isString(e))try{return(t||JSON.parse)(e),se.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Ro={transitional:KO,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,l=se.isObject(t);if(l&&se.isHTMLForm(t)&&(t=new FormData(t)),se.isFormData(t))return s?JSON.stringify(YO(t)):t;if(se.isArrayBuffer(t)||se.isBuffer(t)||se.isStream(t)||se.isFile(t)||se.isBlob(t)||se.isReadableStream(t))return t;if(se.isArrayBufferView(t))return t.buffer;if(se.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(l){if(i.indexOf("application/x-www-form-urlencoded")>-1)return fU(t,this.formSerializer).toString();if((o=se.isFileList(t))||i.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Wc(o?{"files[]":t}:t,d&&new d,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),gU(t)):t}],transformResponse:[function(t){const n=this.transitional||Ro.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(se.isResponse(t)||se.isReadableStream(t))return t;if(t&&se.isString(t)&&(i&&!this.responseType||s)){const u=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(o){if(u)throw o.name==="SyntaxError"?Be.from(o,Be.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};se.forEach(["delete","get","head","post","put","patch"],e=>{Ro.headers[e]={}});const bU=se.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),yU=e=>{const t={};let n,i,s;return e&&e.split(`
|
|
9
|
+
`).replace(x2,"")}function Q0(r,a){return a=Z0(a),Z0(r)===a}function rt(r,a,c,m,w,k){switch(c){case"children":typeof m=="string"?a==="body"||a==="textarea"&&m===""||ua(r,m):(typeof m=="number"||typeof m=="bigint")&&a!=="body"&&ua(r,""+m);break;case"className":Mo(r,"class",m);break;case"tabIndex":Mo(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Mo(r,c,m);break;case"style":Q_(r,m,k);break;case"data":if(a!=="object"){Mo(r,"data",m);break}case"src":case"href":if(m===""&&(a!=="a"||c!=="href")){r.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=Fo(""+m),r.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(c==="formAction"?(a!=="input"&&rt(r,a,"name",w.name,w,null),rt(r,a,"formEncType",w.formEncType,w,null),rt(r,a,"formMethod",w.formMethod,w,null),rt(r,a,"formTarget",w.formTarget,w,null)):(rt(r,a,"encType",w.encType,w,null),rt(r,a,"method",w.method,w,null),rt(r,a,"target",w.target,w,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=Fo(""+m),r.setAttribute(c,m);break;case"onClick":m!=null&&(r.onclick=pr);break;case"onScroll":m!=null&&$e("scroll",r);break;case"onScrollEnd":m!=null&&$e("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(c=m.__html,c!=null){if(w.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}c=Fo(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""+m):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":m===!0?r.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,m):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(c,m):r.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(c):r.setAttribute(c,m);break;case"popover":$e("beforetoggle",r),$e("toggle",r),Do(r,"popover",m);break;case"xlinkActuate":fr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":fr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":fr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":fr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":fr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":fr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":fr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":fr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":fr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Do(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=ZL.get(c)||c,Do(r,c,m))}}function eh(r,a,c,m,w,k){switch(c){case"style":Q_(r,m,k);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(c=m.__html,c!=null){if(w.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"children":typeof m=="string"?ua(r,m):(typeof m=="number"||typeof m=="bigint")&&ua(r,""+m);break;case"onScroll":m!=null&&$e("scroll",r);break;case"onScrollEnd":m!=null&&$e("scrollend",r);break;case"onClick":m!=null&&(r.onclick=pr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!q_.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(w=c.endsWith("Capture"),a=c.slice(2,w?c.length-7:void 0),k=r[rn]||null,k=k!=null?k[c]:null,typeof k=="function"&&r.removeEventListener(a,k,w),typeof m=="function")){typeof k!="function"&&k!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(a,m,w);break e}c in r?r[c]=m:m===!0?r.setAttribute(c,""):Do(r,c,m)}}}function qt(r,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",r),$e("load",r);var m=!1,w=!1,k;for(k in c)if(c.hasOwnProperty(k)){var M=c[k];if(M!=null)switch(k){case"src":m=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:rt(r,a,k,M,c,null)}}w&&rt(r,a,"srcSet",c.srcSet,c,null),m&&rt(r,a,"src",c.src,c,null);return;case"input":$e("invalid",r);var q=k=M=w=null,Y=null,re=null;for(m in c)if(c.hasOwnProperty(m)){var de=c[m];if(de!=null)switch(m){case"name":w=de;break;case"type":M=de;break;case"checked":Y=de;break;case"defaultChecked":re=de;break;case"value":k=de;break;case"defaultValue":q=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,a));break;default:rt(r,a,m,de,c,null)}}K_(r,k,q,Y,re,M,w,!1);return;case"select":$e("invalid",r),m=M=k=null;for(w in c)if(c.hasOwnProperty(w)&&(q=c[w],q!=null))switch(w){case"value":k=q;break;case"defaultValue":M=q;break;case"multiple":m=q;default:rt(r,a,w,q,c,null)}a=k,c=M,r.multiple=!!m,a!=null?ca(r,!!m,a,!1):c!=null&&ca(r,!!m,c,!0);return;case"textarea":$e("invalid",r),k=w=m=null;for(M in c)if(c.hasOwnProperty(M)&&(q=c[M],q!=null))switch(M){case"value":m=q;break;case"defaultValue":w=q;break;case"children":k=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(91));break;default:rt(r,a,M,q,c,null)}X_(r,m,w,k);return;case"option":for(Y in c)c.hasOwnProperty(Y)&&(m=c[Y],m!=null)&&(Y==="selected"?r.selected=m&&typeof m!="function"&&typeof m!="symbol":rt(r,a,Y,m,c,null));return;case"dialog":$e("beforetoggle",r),$e("toggle",r),$e("cancel",r),$e("close",r);break;case"iframe":case"object":$e("load",r);break;case"video":case"audio":for(m=0;m<Hs.length;m++)$e(Hs[m],r);break;case"image":$e("error",r),$e("load",r);break;case"details":$e("toggle",r);break;case"embed":case"source":case"link":$e("error",r),$e("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in c)if(c.hasOwnProperty(re)&&(m=c[re],m!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:rt(r,a,re,m,c,null)}return;default:if(pu(a)){for(de in c)c.hasOwnProperty(de)&&(m=c[de],m!==void 0&&eh(r,a,de,m,c,void 0));return}}for(q in c)c.hasOwnProperty(q)&&(m=c[q],m!=null&&rt(r,a,q,m,c,null))}function w2(r,a,c,m){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,k=null,M=null,q=null,Y=null,re=null,de=null;for(oe in c){var pe=c[oe];if(c.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":Y=pe;default:m.hasOwnProperty(oe)||rt(r,a,oe,null,m,pe)}}for(var ae in m){var oe=m[ae];if(pe=c[ae],m.hasOwnProperty(ae)&&(oe!=null||pe!=null))switch(ae){case"type":k=oe;break;case"name":w=oe;break;case"checked":re=oe;break;case"defaultChecked":de=oe;break;case"value":M=oe;break;case"defaultValue":q=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,a));break;default:oe!==pe&&rt(r,a,ae,oe,m,pe)}}hu(r,M,q,Y,re,de,k,w);return;case"select":oe=M=q=ae=null;for(k in c)if(Y=c[k],c.hasOwnProperty(k)&&Y!=null)switch(k){case"value":break;case"multiple":oe=Y;default:m.hasOwnProperty(k)||rt(r,a,k,null,m,Y)}for(w in m)if(k=m[w],Y=c[w],m.hasOwnProperty(w)&&(k!=null||Y!=null))switch(w){case"value":ae=k;break;case"defaultValue":q=k;break;case"multiple":M=k;default:k!==Y&&rt(r,a,w,k,m,Y)}a=q,c=M,m=oe,ae!=null?ca(r,!!c,ae,!1):!!m!=!!c&&(a!=null?ca(r,!!c,a,!0):ca(r,!!c,c?[]:"",!1));return;case"textarea":oe=ae=null;for(q in c)if(w=c[q],c.hasOwnProperty(q)&&w!=null&&!m.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:rt(r,a,q,null,m,w)}for(M in m)if(w=m[M],k=c[M],m.hasOwnProperty(M)&&(w!=null||k!=null))switch(M){case"value":ae=w;break;case"defaultValue":oe=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:w!==k&&rt(r,a,M,w,m,k)}Y_(r,ae,oe);return;case"option":for(var _e in c)ae=c[_e],c.hasOwnProperty(_e)&&ae!=null&&!m.hasOwnProperty(_e)&&(_e==="selected"?r.selected=!1:rt(r,a,_e,null,m,ae));for(Y in m)ae=m[Y],oe=c[Y],m.hasOwnProperty(Y)&&ae!==oe&&(ae!=null||oe!=null)&&(Y==="selected"?r.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":rt(r,a,Y,ae,m,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in c)ae=c[ke],c.hasOwnProperty(ke)&&ae!=null&&!m.hasOwnProperty(ke)&&rt(r,a,ke,null,m,ae);for(re in m)if(ae=m[re],oe=c[re],m.hasOwnProperty(re)&&ae!==oe&&(ae!=null||oe!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,a));break;default:rt(r,a,re,ae,m,oe)}return;default:if(pu(a)){for(var it in c)ae=c[it],c.hasOwnProperty(it)&&ae!==void 0&&!m.hasOwnProperty(it)&&eh(r,a,it,void 0,m,ae);for(de in m)ae=m[de],oe=c[de],!m.hasOwnProperty(de)||ae===oe||ae===void 0&&oe===void 0||eh(r,a,de,ae,m,oe);return}}for(var te in c)ae=c[te],c.hasOwnProperty(te)&&ae!=null&&!m.hasOwnProperty(te)&&rt(r,a,te,null,m,ae);for(pe in m)ae=m[pe],oe=c[pe],!m.hasOwnProperty(pe)||ae===oe||ae==null&&oe==null||rt(r,a,pe,ae,m,oe)}function J0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var w=c[m],k=w.transferSize,M=w.initiatorType,q=w.duration;if(k&&q&&J0(M)){for(M=0,q=w.responseEnd,m+=1;m<c.length;m++){var Y=c[m],re=Y.startTime;if(re>q)break;var de=Y.transferSize,pe=Y.initiatorType;de&&J0(pe)&&(Y=Y.responseEnd,M+=de*(Y<q?1:(q-re)/(Y-re)))}if(--m,a+=8*(k+M)/(w.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var th=null,nh=null;function Il(r){return r.nodeType===9?r:r.ownerDocument}function ex(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function tx(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function rh(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var ih=null;function T2(){var r=window.event;return r&&r.type==="popstate"?r===ih?!1:(ih=r,!0):(ih=null,!1)}var nx=typeof setTimeout=="function"?setTimeout:void 0,A2=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,k2=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(r){return rx.resolve(null).then(r).catch(R2)}:nx;function R2(r){setTimeout(function(){throw r})}function ti(r){return r==="head"}function ix(r,a){var c=a,m=0;do{var w=c.nextSibling;if(r.removeChild(c),w&&w.nodeType===8)if(c=w.data,c==="/$"||c==="/&"){if(m===0){r.removeChild(w),za(a);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")$s(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,$s(c);for(var k=c.firstChild;k;){var M=k.nextSibling,q=k.nodeName;k[ls]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&k.rel.toLowerCase()==="stylesheet"||c.removeChild(k),k=M}}else c==="body"&&$s(r.ownerDocument.body);c=w}while(c);za(a)}function ax(r,a){var c=r;r=0;do{var m=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=m}while(c)}function ah(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":ah(c),uu(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function N2(r,a,c,m){for(;r.nodeType===1;){var w=c;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[ls])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(k=r.getAttribute("rel"),k==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(k!==w.rel||r.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||r.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||r.getAttribute("title")!==(w.title==null?null:w.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(k=r.getAttribute("src"),(k!==(w.src==null?null:w.src)||r.getAttribute("type")!==(w.type==null?null:w.type)||r.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&k&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var k=w.name==null?null:""+w.name;if(w.type==="hidden"&&r.getAttribute("name")===k)return r}else return r;if(r=jn(r.nextSibling),r===null)break}return null}function O2(r,a,c){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=jn(r.nextSibling),r===null))return null;return r}function sx(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=jn(r.nextSibling),r===null))return null;return r}function sh(r){return r.data==="$?"||r.data==="$~"}function oh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function I2(r,a){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||c.readyState!=="loading")a();else{var m=function(){a(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function jn(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var lh=null;function ox(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(a===0)return jn(r.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}r=r.nextSibling}return null}function lx(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return r;a--}else c!=="/$"&&c!=="/&"||a++}r=r.previousSibling}return null}function cx(r,a,c){switch(a=Il(c),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function $s(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);uu(r)}var zn=new Map,ux=new Set;function Ll(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Nr=Z.d;Z.d={f:L2,r:D2,D:M2,C:B2,L:F2,m:P2,X:j2,S:U2,M:z2};function L2(){var r=Nr.f(),a=wl();return r||a}function D2(r){var a=sa(r);a!==null&&a.tag===5&&a.type==="form"?AE(a):Nr.r(r)}var Pa=typeof document>"u"?null:document;function dx(r,a,c){var m=Pa;if(m&&typeof a=="string"&&a){var w=Ln(a);w='link[rel="'+r+'"][href="'+w+'"]',typeof c=="string"&&(w+='[crossorigin="'+c+'"]'),ux.has(w)||(ux.add(w),r={rel:r,crossOrigin:c,href:a},m.querySelector(w)===null&&(a=m.createElement("link"),qt(a,"link",r),Ft(a),m.head.appendChild(a)))}}function M2(r){Nr.D(r),dx("dns-prefetch",r,null)}function B2(r,a){Nr.C(r,a),dx("preconnect",r,a)}function F2(r,a,c){Nr.L(r,a,c);var m=Pa;if(m&&r&&a){var w='link[rel="preload"][as="'+Ln(a)+'"]';a==="image"&&c&&c.imageSrcSet?(w+='[imagesrcset="'+Ln(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(w+='[imagesizes="'+Ln(c.imageSizes)+'"]')):w+='[href="'+Ln(r)+'"]';var k=w;switch(a){case"style":k=Ua(r);break;case"script":k=ja(r)}zn.has(k)||(r=f({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:r,as:a},c),zn.set(k,r),m.querySelector(w)!==null||a==="style"&&m.querySelector(Gs(k))||a==="script"&&m.querySelector(Vs(k))||(a=m.createElement("link"),qt(a,"link",r),Ft(a),m.head.appendChild(a)))}}function P2(r,a){Nr.m(r,a);var c=Pa;if(c&&r){var m=a&&typeof a.as=="string"?a.as:"script",w='link[rel="modulepreload"][as="'+Ln(m)+'"][href="'+Ln(r)+'"]',k=w;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ja(r)}if(!zn.has(k)&&(r=f({rel:"modulepreload",href:r},a),zn.set(k,r),c.querySelector(w)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Vs(k)))return}m=c.createElement("link"),qt(m,"link",r),Ft(m),c.head.appendChild(m)}}}function U2(r,a,c){Nr.S(r,a,c);var m=Pa;if(m&&r){var w=oa(m).hoistableStyles,k=Ua(r);a=a||"default";var M=w.get(k);if(!M){var q={loading:0,preload:null};if(M=m.querySelector(Gs(k)))q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":a},c),(c=zn.get(k))&&ch(r,c);var Y=M=m.createElement("link");Ft(Y),qt(Y,"link",r),Y._p=new Promise(function(re,de){Y.onload=re,Y.onerror=de}),Y.addEventListener("load",function(){q.loading|=1}),Y.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Dl(M,a,m)}M={type:"stylesheet",instance:M,count:1,state:q},w.set(k,M)}}}function j2(r,a){Nr.X(r,a);var c=Pa;if(c&&r){var m=oa(c).hoistableScripts,w=ja(r),k=m.get(w);k||(k=c.querySelector(Vs(w)),k||(r=f({src:r,async:!0},a),(a=zn.get(w))&&uh(r,a),k=c.createElement("script"),Ft(k),qt(k,"link",r),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},m.set(w,k))}}function z2(r,a){Nr.M(r,a);var c=Pa;if(c&&r){var m=oa(c).hoistableScripts,w=ja(r),k=m.get(w);k||(k=c.querySelector(Vs(w)),k||(r=f({src:r,async:!0,type:"module"},a),(a=zn.get(w))&&uh(r,a),k=c.createElement("script"),Ft(k),qt(k,"link",r),c.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},m.set(w,k))}}function hx(r,a,c,m){var w=(w=ue.current)?Ll(w):null;if(!w)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=Ua(c.href),c=oa(w).hoistableStyles,m=c.get(a),m||(m={type:"style",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=Ua(c.href);var k=oa(w).hoistableStyles,M=k.get(r);if(M||(w=w.ownerDocument||w,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(r,M),(k=w.querySelector(Gs(r)))&&!k._p&&(M.instance=k,M.state.loading=5),zn.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},zn.set(r,c),k||H2(w,r,c,M.state))),a&&m===null)throw Error(i(528,""));return M}if(a&&m!==null)throw Error(i(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ja(c),c=oa(w).hoistableScripts,m=c.get(a),m||(m={type:"script",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Ua(r){return'href="'+Ln(r)+'"'}function Gs(r){return'link[rel="stylesheet"]['+r+"]"}function fx(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function H2(r,a,c,m){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?m.loading=1:(a=r.createElement("link"),m.preload=a,a.addEventListener("load",function(){return m.loading|=1}),a.addEventListener("error",function(){return m.loading|=2}),qt(a,"link",c),Ft(a),r.head.appendChild(a))}function ja(r){return'[src="'+Ln(r)+'"]'}function Vs(r){return"script[async]"+r}function px(r,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var m=r.querySelector('style[data-href~="'+Ln(c.href)+'"]');if(m)return a.instance=m,Ft(m),m;var w=f({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),Ft(m),qt(m,"style",w),Dl(m,c.precedence,r),a.instance=m;case"stylesheet":w=Ua(c.href);var k=r.querySelector(Gs(w));if(k)return a.state.loading|=4,a.instance=k,Ft(k),k;m=fx(c),(w=zn.get(w))&&ch(m,w),k=(r.ownerDocument||r).createElement("link"),Ft(k);var M=k;return M._p=new Promise(function(q,Y){M.onload=q,M.onerror=Y}),qt(k,"link",m),a.state.loading|=4,Dl(k,c.precedence,r),a.instance=k;case"script":return k=ja(c.src),(w=r.querySelector(Vs(k)))?(a.instance=w,Ft(w),w):(m=c,(w=zn.get(k))&&(m=f({},c),uh(m,w)),r=r.ownerDocument||r,w=r.createElement("script"),Ft(w),qt(w,"link",m),r.head.appendChild(w),a.instance=w);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(m=a.instance,a.state.loading|=4,Dl(m,c.precedence,r));return a.instance}function Dl(r,a,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=m.length?m[m.length-1]:null,k=w,M=0;M<m.length;M++){var q=m[M];if(q.dataset.precedence===a)k=q;else if(k!==w)break}k?k.parentNode.insertBefore(r,k.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(r,a.firstChild))}function ch(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function uh(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var Ml=null;function mx(r,a,c){if(Ml===null){var m=new Map,w=Ml=new Map;w.set(c,m)}else w=Ml,m=w.get(c),m||(m=new Map,w.set(c,m));if(m.has(r))return m;for(m.set(r,null),c=c.getElementsByTagName(r),w=0;w<c.length;w++){var k=c[w];if(!(k[ls]||k[Ut]||r==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var M=k.getAttribute(a)||"";M=r+M;var q=m.get(M);q?q.push(k):m.set(M,[k])}}return m}function gx(r,a,c){r=r.ownerDocument||r,r.head.insertBefore(c,a==="title"?r.querySelector("head > title"):null)}function q2(r,a,c){if(c===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function bx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function $2(r,a,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var w=Ua(m.href),k=a.querySelector(Gs(w));if(k){a=k._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=Bl.bind(r),a.then(r,r)),c.state.loading|=4,c.instance=k,Ft(k);return}k=a.ownerDocument||a,m=fx(m),(w=zn.get(w))&&ch(m,w),k=k.createElement("link"),Ft(k);var M=k;M._p=new Promise(function(q,Y){M.onload=q,M.onerror=Y}),qt(k,"link",m),c.instance=k}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=Bl.bind(r),a.addEventListener("load",c),a.addEventListener("error",c))}}var dh=0;function G2(r,a){return r.stylesheets&&r.count===0&&Pl(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var m=setTimeout(function(){if(r.stylesheets&&Pl(r,r.stylesheets),r.unsuspend){var k=r.unsuspend;r.unsuspend=null,k()}},6e4+a);0<r.imgBytes&&dh===0&&(dh=62500*C2());var w=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Pl(r,r.stylesheets),r.unsuspend)){var k=r.unsuspend;r.unsuspend=null,k()}},(r.imgBytes>dh?50:800)+a);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(w)}}:null}function Bl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pl(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Fl=null;function Pl(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Fl=new Map,a.forEach(V2,r),Fl=null,Bl.call(r))}function V2(r,a){if(!(a.state.loading&4)){var c=Fl.get(r);if(c)var m=c.get(null);else{c=new Map,Fl.set(r,c);for(var w=r.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<w.length;k++){var M=w[k];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(c.set(M.dataset.precedence,M),m=M)}m&&c.set(null,m)}w=a.instance,M=w.getAttribute("data-precedence"),k=c.get(M)||m,k===m&&c.set(null,w),c.set(M,w),this.count++,m=Bl.bind(this),w.addEventListener("load",m),w.addEventListener("error",m),k?k.parentNode.insertBefore(w,k.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(w,r.firstChild)),a.state.loading|=4}}var Ws={$$typeof:_,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function W2(r,a,c,m,w,k,M,q,Y){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=m,this.onUncaughtError=w,this.onCaughtError=k,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function yx(r,a,c,m,w,k,M,q,Y,re,de,pe){return r=new W2(r,a,c,M,Y,re,de,pe,q),a=1,k===!0&&(a|=24),k=vn(3,null,null,a),r.current=k,k.stateNode=r,a=$u(),a.refCount++,r.pooledCache=a,a.refCount++,k.memoizedState={element:m,isDehydrated:c,cache:a},Ku(k),r}function vx(r){return r?(r=ba,r):ba}function _x(r,a,c,m,w,k){w=vx(w),m.context===null?m.context=w:m.pendingContext=w,m=$r(a),m.payload={element:c},k=k===void 0?null:k,k!==null&&(m.callback=k),c=Gr(r,m,a),c!==null&&(un(c,r,a),Cs(c,r,a))}function Sx(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<a?c:a}}function hh(r,a){Sx(r,a),(r=r.alternate)&&Sx(r,a)}function Ex(r){if(r.tag===13||r.tag===31){var a=Ci(r,67108864);a!==null&&un(a,r,67108864),hh(r,67108864)}}function xx(r){if(r.tag===13||r.tag===31){var a=wn();a=ou(a);var c=Ci(r,a);c!==null&&un(c,r,a),hh(r,a)}}var Ul=!0;function K2(r,a,c,m){var w=W.T;W.T=null;var k=Z.p;try{Z.p=2,fh(r,a,c,m)}finally{Z.p=k,W.T=w}}function Y2(r,a,c,m){var w=W.T;W.T=null;var k=Z.p;try{Z.p=8,fh(r,a,c,m)}finally{Z.p=k,W.T=w}}function fh(r,a,c,m){if(Ul){var w=ph(m);if(w===null)Jd(r,a,m,jl,c),Cx(r,m);else if(Z2(w,r,a,c,m))m.stopPropagation();else if(Cx(r,m),a&4&&-1<X2.indexOf(r)){for(;w!==null;){var k=sa(w);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var M=Jn(k.pendingLanes);if(M!==0){var q=k;for(q.pendingLanes|=2,q.entangledLanes|=2;M;){var Y=1<<31-Je(M);q.entanglements[1]|=Y,M&=~Y}rr(k),(Qe&6)===0&&(El=Oe()+500,zs(0))}}break;case 31:case 13:q=Ci(k,2),q!==null&&un(q,k,2),wl(),hh(k,2)}if(k=ph(m),k===null&&Jd(r,a,m,jl,c),k===w)break;w=k}w!==null&&m.stopPropagation()}else Jd(r,a,m,null,c)}}function ph(r){return r=gu(r),mh(r)}var jl=null;function mh(r){if(jl=null,r=aa(r),r!==null){var a=l(r);if(a===null)r=null;else{var c=a.tag;if(c===13){if(r=u(a),r!==null)return r;r=null}else if(c===31){if(r=o(a),r!==null)return r;r=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return jl=r,null}function wx(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(je()){case ce:return 2;case me:return 8;case ve:case Ce:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var gh=!1,ni=null,ri=null,ii=null,Ks=new Map,Ys=new Map,ai=[],X2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Cx(r,a){switch(r){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ks.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(a.pointerId)}}function Xs(r,a,c,m,w,k){return r===null||r.nativeEvent!==k?(r={blockedOn:a,domEventName:c,eventSystemFlags:m,nativeEvent:k,targetContainers:[w]},a!==null&&(a=sa(a),a!==null&&Ex(a)),r):(r.eventSystemFlags|=m,a=r.targetContainers,w!==null&&a.indexOf(w)===-1&&a.push(w),r)}function Z2(r,a,c,m,w){switch(a){case"focusin":return ni=Xs(ni,r,a,c,m,w),!0;case"dragenter":return ri=Xs(ri,r,a,c,m,w),!0;case"mouseover":return ii=Xs(ii,r,a,c,m,w),!0;case"pointerover":var k=w.pointerId;return Ks.set(k,Xs(Ks.get(k)||null,r,a,c,m,w)),!0;case"gotpointercapture":return k=w.pointerId,Ys.set(k,Xs(Ys.get(k)||null,r,a,c,m,w)),!0}return!1}function Tx(r){var a=aa(r.target);if(a!==null){var c=l(a);if(c!==null){if(a=c.tag,a===13){if(a=u(c),a!==null){r.blockedOn=a,j_(r.priority,function(){xx(c)});return}}else if(a===31){if(a=o(c),a!==null){r.blockedOn=a,j_(r.priority,function(){xx(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function zl(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var c=ph(r.nativeEvent);if(c===null){c=r.nativeEvent;var m=new c.constructor(c.type,c);mu=m,c.target.dispatchEvent(m),mu=null}else return a=sa(c),a!==null&&Ex(a),r.blockedOn=c,!1;a.shift()}return!0}function Ax(r,a,c){zl(r)&&c.delete(a)}function Q2(){gh=!1,ni!==null&&zl(ni)&&(ni=null),ri!==null&&zl(ri)&&(ri=null),ii!==null&&zl(ii)&&(ii=null),Ks.forEach(Ax),Ys.forEach(Ax)}function Hl(r,a){r.blockedOn===a&&(r.blockedOn=null,gh||(gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Q2)))}var ql=null;function kx(r){ql!==r&&(ql=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ql===r&&(ql=null);for(var a=0;a<r.length;a+=3){var c=r[a],m=r[a+1],w=r[a+2];if(typeof m!="function"){if(mh(m||c)===null)continue;break}var k=sa(c);k!==null&&(r.splice(a,3),a-=3,pd(k,{pending:!0,data:w,method:c.method,action:m},m,w))}}))}function za(r){function a(Y){return Hl(Y,r)}ni!==null&&Hl(ni,r),ri!==null&&Hl(ri,r),ii!==null&&Hl(ii,r),Ks.forEach(a),Ys.forEach(a);for(var c=0;c<ai.length;c++){var m=ai[c];m.blockedOn===r&&(m.blockedOn=null)}for(;0<ai.length&&(c=ai[0],c.blockedOn===null);)Tx(c),c.blockedOn===null&&ai.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var w=c[m],k=c[m+1],M=w[rn]||null;if(typeof k=="function")M||kx(c);else if(M){var q=null;if(k&&k.hasAttribute("formAction")){if(w=k,M=k[rn]||null)q=M.formAction;else if(mh(w)!==null)continue}else q=M.action;typeof q=="function"?c[m+1]=q:(c.splice(m,3),m-=3),kx(c)}}}function Rx(){function r(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(M){return w=M})},focusReset:"manual",scroll:"manual"})}function a(){w!==null&&(w(),w=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,w=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),w!==null&&(w(),w=null)}}}function bh(r){this._internalRoot=r}$l.prototype.render=bh.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var c=a.current,m=wn();_x(c,m,r,a,null,null)},$l.prototype.unmount=bh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;_x(r.current,2,null,r,null,null),wl(),a[ia]=null}};function $l(r){this._internalRoot=r}$l.prototype.unstable_scheduleHydration=function(r){if(r){var a=U_();r={blockedOn:null,target:r,priority:a};for(var c=0;c<ai.length&&a!==0&&a<ai[c].priority;c++);ai.splice(c,0,r),c===0&&Tx(r)}};var Nx=t.version;if(Nx!=="19.2.3")throw Error(i(527,Nx,"19.2.3"));Z.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(a),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var J2={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gl.isDisabled&&Gl.supportsFiber)try{mt=Gl.inject(J2),at=Gl}catch{}}return Qs.createRoot=function(r,a){if(!s(r))throw Error(i(299));var c=!1,m="",w=FE,k=PE,M=UE;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(w=a.onUncaughtError),a.onCaughtError!==void 0&&(k=a.onCaughtError),a.onRecoverableError!==void 0&&(M=a.onRecoverableError)),a=yx(r,1,!1,null,null,c,m,null,w,k,M,Rx),r[ia]=a.current,Qd(r),new bh(a)},Qs.hydrateRoot=function(r,a,c){if(!s(r))throw Error(i(299));var m=!1,w="",k=FE,M=PE,q=UE,Y=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(w=c.identifierPrefix),c.onUncaughtError!==void 0&&(k=c.onUncaughtError),c.onCaughtError!==void 0&&(M=c.onCaughtError),c.onRecoverableError!==void 0&&(q=c.onRecoverableError),c.formState!==void 0&&(Y=c.formState)),a=yx(r,1,!0,a,c??null,m,w,Y,k,M,q,Rx),a.context=vx(null),c=a.current,m=wn(),m=ou(m),w=$r(m),w.callback=null,Gr(c,w,m),c=m,a.current.lanes=c,os(a,c),rr(a),r[ia]=a.current,Qd(r),new $l(a)},Qs.version="19.2.3",Qs}var jx;function lM(){if(jx)return _h.exports;jx=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(),_h.exports=oM(),_h.exports}var cM=lM(),es=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},dM=class{#e=uM;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},ji=new dM;function hM(e){setTimeout(e,0)}var Wi=typeof window>"u"||"Deno"in globalThis;function Jt(){}function fM(e,t){return typeof e=="function"?e(t):e}function Ky(e){return typeof e=="number"&&e>=0&&e!==1/0}function UN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hi(e,t){return typeof e=="function"?e(t):e}function qn(e,t){return typeof e=="function"?e(t):e}function zx(e,t){const{type:n="all",exact:i,fetchStatus:s,predicate:l,queryKey:u,stale:o}=e;if(u){if(i){if(t.queryHash!==Ov(u,t.options))return!1}else if(!go(t.queryKey,u))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||l&&!l(t))}function Hx(e,t){const{exact:n,status:i,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Ki(t.options.mutationKey)!==Ki(l))return!1}else if(!go(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function Ov(e,t){return(t?.queryKeyHashFn||Ki)(e)}function Ki(e){return JSON.stringify(e,(t,n)=>Yy(n)?Object.keys(n).sort().reduce((i,s)=>(i[s]=n[s],i),{}):n)}function go(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>go(e[n],t[n])):!1}var pM=Object.prototype.hasOwnProperty;function jN(e,t){if(e===t)return e;const n=qx(e)&&qx(t);if(!n&&!(Yy(e)&&Yy(t)))return t;const s=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),u=l.length,o=n?new Array(u):{};let d=0;for(let h=0;h<u;h++){const p=n?h:l[h],f=e[p],g=t[p];if(f===g){o[p]=f,(n?h<s:pM.call(e,p))&&d++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){o[p]=g;continue}const b=jN(f,g);o[p]=b,b===f&&d++}return s===u&&d===s?e:o}function pc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function qx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yy(e){if(!$x(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$x(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $x(e){return Object.prototype.toString.call(e)==="[object Object]"}function mM(e){return new Promise(t=>{ji.setTimeout(t,e)})}function Xy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jN(e,t):t}function gM(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function bM(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Iv=Symbol();function zN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Iv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Lv(e,t){return typeof e=="function"?e(...t):!!e}function yM(e,t,n){let i=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),i||(i=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var vM=class extends es{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Wi&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Dv=new vM;function Zy(){let e,t;const n=new Promise((s,l)=>{e=s,t=l});n.status="pending",n.catch(()=>{});function i(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},n.reject=s=>{i({status:"rejected",reason:s}),t(s)},n}var _M=hM;function SM(){let e=[],t=0,n=o=>{o()},i=o=>{o()},s=_M;const l=o=>{t?e.push(o):s(()=>{n(o)})},u=()=>{const o=e;e=[],o.length&&s(()=>{i(()=>{o.forEach(d=>{n(d)})})})};return{batch:o=>{let d;t++;try{d=o()}finally{t--,t||u()}return d},batchCalls:o=>(...d)=>{l(()=>{o(...d)})},schedule:l,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{i=o},setScheduler:o=>{s=o}}}var Lt=SM(),EM=class extends es{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Wi&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},mc=new EM;function xM(e){return Math.min(1e3*2**e,3e4)}function HN(e){return(e??"online")==="online"?mc.isOnline():!0}var Qy=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function qN(e){let t=!1,n=0,i;const s=Zy(),l=()=>s.status!=="pending",u=E=>{if(!l()){const y=new Qy(E);g(y),e.onCancel?.(y)}},o=()=>{t=!0},d=()=>{t=!1},h=()=>Dv.isFocused()&&(e.networkMode==="always"||mc.isOnline())&&e.canRun(),p=()=>HN(e.networkMode)&&e.canRun(),f=E=>{l()||(i?.(),s.resolve(E))},g=E=>{l()||(i?.(),s.reject(E))},b=()=>new Promise(E=>{i=y=>{(l()||h())&&E(y)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),x=()=>{if(l())return;let E;const y=n===0?e.initialPromise:void 0;try{E=y??e.fn()}catch(S){E=Promise.reject(S)}Promise.resolve(E).then(f).catch(S=>{if(l())return;const v=e.retry??(Wi?0:3),_=e.retryDelay??xM,C=typeof _=="function"?_(n,S):_,N=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,S);if(t||!N){g(S);return}n++,e.onFail?.(n,S),mM(C).then(()=>h()?void 0:b()).then(()=>{t?g(S):x()})})};return{promise:s,status:()=>s.status,cancel:u,continue:()=>(i?.(),s),cancelRetry:o,continueRetry:d,canStart:p,start:()=>(p()?x():b().then(x),s)}}var $N=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ky(this.gcTime)&&(this.#e=ji.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wi?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ji.clearTimeout(this.#e),this.#e=void 0)}},wM=class extends $N{#e;#t;#n;#i;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Vx(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Vx(this.options);t.data!==void 0&&(this.setState(Gx(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Xy(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Iv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!UN(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const o=this.observers.find(d=>d.options.queryFn);o&&this.setOptions(o.options)}const n=new AbortController,i=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const o=zN(this.options,t),h=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(p),p})();return this.#o=!1,this.options.persister?this.options.persister(o,h,this):o(h)},u=(()=>{const o={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return i(o),o})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#a({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=qN({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:o=>{o instanceof Qy&&o.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(o,d)=>{this.#a({type:"failed",failureCount:o,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const o=await this.#r.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#n.config.onSuccess?.(o,this),this.#n.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof Qy){if(o.silent)return this.#r.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#a({type:"error",error:o}),this.#n.config.onError?.(o,this),this.#n.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...GN(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...Gx(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Lt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function GN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var CM=class extends es{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#o=Zy(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#s;#o;#a;#m;#h;#f;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Wx(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!pc(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Kx(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),i&&(this.#t!==n||qn(this.options.enabled,this.#t)!==qn(t.enabled,this.#t)||hi(this.options.staleTime,this.#t)!==hi(t.staleTime,this.#t))&&this.#g();const s=this.#b();i&&(this.#t!==n||qn(this.options.enabled,this.#t)!==qn(t.enabled,this.#t)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return AM(this,n)&&(this.#i=n,this.#s=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Jt)),t}#g(){this.#_();const e=hi(this.options.staleTime,this.#t);if(Wi||this.#i.isStale||!Ky(e))return;const n=UN(this.#i.dataUpdatedAt,e)+1;this.#c=ji.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#S(),this.#l=e,!(Wi||qn(this.options.enabled,this.#t)===!1||!Ky(this.#l)||this.#l===0)&&(this.#u=ji.setInterval(()=>{(this.options.refetchIntervalInBackground||Dv.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#b())}#_(){this.#c&&(ji.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ji.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,i=this.options,s=this.#i,l=this.#r,u=this.#s,d=e!==n?e.state:this.#n,{state:h}=e;let p={...h},f=!1,g;if(t._optimisticResults){const R=this.hasListeners(),I=!R&&Wx(e,t),L=R&&Kx(e,n,t,i);(I||L)&&(p={...p,...GN(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:x,status:E}=p;g=p.data;let y=!1;if(t.placeholderData!==void 0&&g===void 0&&E==="pending"){let R;s?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(R=s.data,y=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(E="success",g=Xy(s?.data,R,t),f=!0)}if(t.select&&g!==void 0&&!y)if(s&&g===l?.data&&t.select===this.#m)g=this.#h;else try{this.#m=t.select,g=t.select(g),g=Xy(s?.data,g,t),this.#h=g,this.#a=null}catch(R){this.#a=R}this.#a&&(b=this.#a,g=this.#h,x=Date.now(),E="error");const S=p.fetchStatus==="fetching",v=E==="pending",_=E==="error",C=v&&S,N=g!==void 0,O={status:E,fetchStatus:p.fetchStatus,isPending:v,isSuccess:E==="success",isError:_,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!v,isLoadingError:_&&!N,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:_&&N,isStale:Mv(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=F=>{O.status==="error"?F.reject(O.error):O.data!==void 0&&F.resolve(O.data)},I=()=>{const F=this.#o=O.promise=Zy();R(F)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&R(L);break;case"fulfilled":(O.status==="error"||O.data!==L.value)&&I();break;case"rejected":(O.status!=="error"||O.error!==L.reason)&&I();break}}return O}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#f=this.#t),pc(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#p.size)return!0;const l=new Set(s??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const o=u;return this.#i[o]!==e[o]&&l.has(o)})};this.#x({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#x(e){Lt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function TM(e,t){return qn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wx(e,t){return TM(e,t)||e.state.data!==void 0&&Jy(e,t,t.refetchOnMount)}function Jy(e,t,n){if(qn(t.enabled,e)!==!1&&hi(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&Mv(e,t)}return!1}function Kx(e,t,n,i){return(e!==t||qn(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Mv(e,n)}function Mv(e,t){return qn(t.enabled,e)!==!1&&e.isStaleByTime(hi(t.staleTime,e))}function AM(e,t){return!pc(e.getCurrentResult(),t)}function Yx(e){return{onFetch:(t,n)=>{const i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},d=0;const h=async()=>{let p=!1;const f=x=>{yM(x,()=>t.signal,()=>p=!0)},g=zN(t.options,t.fetchOptions),b=async(x,E,y)=>{if(p)return Promise.reject();if(E==null&&x.pages.length)return Promise.resolve(x);const v=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:E,direction:y?"backward":"forward",meta:t.options.meta};return f(A),A})(),_=await g(v),{maxPages:C}=t.options,N=y?bM:gM;return{pages:N(x.pages,_,C),pageParams:N(x.pageParams,E,C)}};if(s&&l.length){const x=s==="backward",E=x?kM:Xx,y={pages:l,pageParams:u},S=E(i,y);o=await b(y,S,x)}else{const x=e??l.length;do{const E=d===0?u[0]??i.initialPageParam:Xx(i,o);if(d>0&&E==null)break;o=await b(o,E),d++}while(d<x)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function Xx(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function kM(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var RM=class extends $N{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||VN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=qN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",s=!this.#i.canStart();try{if(i)t();else{this.#r({type:"pending",variables:e,isPaused:s}),await this.#n.config.onMutate?.(e,this,n);const u=await this.options.onMutate?.(e,n);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:s})}const l=await this.#i.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,n),await this.options.onSuccess?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,e,this.state.context,n),this.#r({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,n)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,n)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Lt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function VN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var NM=class extends es{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const i=new RM({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){this.#e.add(e);const t=Vl(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Vl(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Vl(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Vl(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Lt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Hx(t,n))}findAll(e={}){return this.getAll().filter(t=>Hx(e,t))}notify(e){Lt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Lt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jt))))}};function Vl(e){return e.options.scope?.id}var OM=class extends es{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),pc(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ki(n.mutationKey)!==Ki(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??VN();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){Lt.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,i=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,i,s)}catch(l){Promise.reject(l)}try{this.#i.onSettled?.(t.data,null,n,i,s)}catch(l){Promise.reject(l)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,i,s)}catch(l){Promise.reject(l)}try{this.#i.onSettled?.(void 0,t.error,n,i,s)}catch(l){Promise.reject(l)}}}this.listeners.forEach(n=>{n(this.#t)})})}},IM=class extends es{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const i=t.queryKey,s=t.queryHash??Ov(i,t);let l=this.get(s);return l||(l=new wM({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Lt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>zx(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>zx(e,n)):t}notify(e){Lt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Lt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Lt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},LM=class{#e;#t;#n;#i;#r;#s;#o;#a;constructor(e={}){this.#e=e.queryCache||new IM,this.#t=e.mutationCache||new NM,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=Dv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=mc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(hi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=fM(t,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Lt.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Lt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Lt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=Lt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(i).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return Lt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=Lt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,n);return n.throwOnError||(l=l.catch(Jt)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(hi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Yx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Yx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(i=>{go(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(i=>{go(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ov(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Iv&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},WN=K.createContext(void 0),mn=e=>{const t=K.useContext(WN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DM=({client:e,children:t})=>(K.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(WN.Provider,{value:e,children:t})),KN=K.createContext(!1),MM=()=>K.useContext(KN);KN.Provider;function BM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var FM=K.createContext(BM()),PM=()=>K.useContext(FM),UM=(e,t,n)=>{const i=n?.state.error&&typeof e.throwOnError=="function"?Lv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},jM=e=>{K.useEffect(()=>{e.clearReset()},[e])},zM=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||Lv(n,[e.error,i])),HM=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>n(i(...s)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qM=(e,t)=>e.isLoading&&e.isFetching&&!t,$M=(e,t)=>e?.suspense&&t.isPending,Zx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function GM(e,t,n){const i=MM(),s=PM(),l=mn(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const o=l.getQueryCache().get(u.queryHash);u._optimisticResults=i?"isRestoring":"optimistic",HM(u),UM(u,s,o),jM(s);const d=!l.getQueryCache().get(u.queryHash),[h]=K.useState(()=>new t(l,u)),p=h.getOptimisticResult(u),f=!i&&e.subscribed!==!1;if(K.useSyncExternalStore(K.useCallback(g=>{const b=f?h.subscribe(Lt.batchCalls(g)):Jt;return h.updateResult(),b},[h,f]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),K.useEffect(()=>{h.setOptions(u)},[u,h]),$M(u,p))throw Zx(u,h,s);if(zM({result:p,errorResetBoundary:s,throwOnError:u.throwOnError,query:o,suspense:u.suspense}))throw p.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,p),u.experimental_prefetchInRender&&!Wi&&qM(p,i)&&(d?Zx(u,h,s):o?.promise)?.catch(Jt).finally(()=>{h.updateResult()}),u.notifyOnChangeProps?p:h.trackResult(p)}function mi(e,t){return GM(e,CM)}function Xn(e,t){const n=mn(),[i]=K.useState(()=>new OM(n,e));K.useEffect(()=>{i.setOptions(e)},[i,e]);const s=K.useSyncExternalStore(K.useCallback(u=>i.subscribe(Lt.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=K.useCallback((u,o)=>{i.mutate(u,o).catch(Jt)},[i]);if(s.error&&Lv(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}const ev=new WeakMap,VM=new WeakMap,gc={current:[]};let wh=!1,co=0;const lo=new Set,Wl=new Map;function YN(e){for(const t of e){if(gc.current.includes(t))continue;gc.current.push(t),t.recompute();const n=VM.get(t);if(n)for(const i of n){const s=ev.get(i);s?.length&&YN(s)}}}function WM(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function KM(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function XN(e){if(co>0&&!Wl.has(e)&&Wl.set(e,e.prevState),lo.add(e),!(co>0)&&!wh)try{for(wh=!0;lo.size>0;){const t=Array.from(lo);lo.clear();for(const n of t){const i=Wl.get(n)??n.prevState;n.prevState=i,WM(n)}for(const n of t){const i=ev.get(n);i&&(gc.current.push(n),YN(i))}for(const n of t){const i=ev.get(n);if(i)for(const s of i)KM(s)}}}finally{wh=!1,gc.current=[],Wl.clear()}}function uo(e){co++;try{e()}finally{if(co--,co===0){const t=lo.values().next().value;t&&XN(t)}}}function YM(e){return typeof e=="function"}class XM{constructor(t,n){this.listeners=new Set,this.subscribe=i=>{var s,l;this.listeners.add(i);const u=(l=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:l.call(s,i,this);return()=>{this.listeners.delete(i),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,i,s;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):YM(t)?this.state=t(this.prevState):this.state=t,(s=(i=this.options)==null?void 0:i.onUpdate)==null||s.call(i),XN(this)}}const fi="__TSR_index",Qx="popstate",Jx="beforeunload";function ZM(e){let t=e.getLocation();const n=new Set,i=u=>{t=e.getLocation(),n.forEach(o=>o({location:t,action:u}))},s=u=>{e.notifyOnIndexChange??!0?i(u):t=e.getLocation()},l=async({task:u,navigateOpts:o,...d})=>{if(o?.ignoreBlocker??!1){u();return}const p=e.getBlockers?.()??[],f=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const g of p){const b=bc(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:b,action:d.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,o,d)=>{const h=t.state[fi];o=ew(h+1,o),l({task:()=>{e.pushState(u,o),i({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:u,state:o})},replace:(u,o,d)=>{const h=t.state[fi];o=ew(h,o),l({task:()=>{e.replaceState(u,o),i({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:u,state:o})},go:(u,o)=>{l({task:()=>{e.go(u),s({type:"GO",index:u})},navigateOpts:o,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[fi]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const o=e.getBlockers?.()??[];return e.setBlockers([...o,u]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:i}}function ew(e,t){t||(t={});const n=Bv();return{...t,key:n,__TSR_key:n,[fi]:e}}function QM(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,i=t.history.replaceState;let s=[];const l=()=>s,u=R=>s=R,o=(R=>R),d=(()=>bc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=Bv();t.history.replaceState({[fi]:0,key:R,__TSR_key:R},"")}let h=d(),p,f=!1,g=!1,b=!1,x=!1;const E=()=>h;let y,S;const v=()=>{y&&(O._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),O._ignoreSubscribers=!1,y=void 0,S=void 0,p=void 0)},_=(R,I,L)=>{const F=o(I);S||(p=h),h=bc(I,L),y={href:F,state:L,isPush:y?.isPush||R==="push"},S||(S=Promise.resolve().then(()=>v()))},C=R=>{h=d(),O.notify({type:R})},N=async()=>{if(g){g=!1;return}const R=d(),I=R.state[fi]-h.state[fi],L=I===1,F=I===-1,j=!L&&!F||f;f=!1;const z=j?"GO":F?"BACK":"FORWARD",G=j?{type:"GO",index:I}:{type:F?"BACK":"FORWARD"};if(b)b=!1;else{const V=l();if(typeof document<"u"&&V.length){for(const W of V)if(await W.blockerFn({currentLocation:h,nextLocation:R,action:z})){g=!0,t.history.go(1),O.notify(G);return}}}h=d(),O.notify(G)},A=R=>{if(x){x=!1;return}let I=!1;const L=l();if(typeof document<"u"&&L.length)for(const F of L){const j=F.enableBeforeUnload??!0;if(j===!0){I=!0;break}if(typeof j=="function"&&j()===!0){I=!0;break}}if(I)return R.preventDefault(),R.returnValue=""},O=ZM({getLocation:E,getLength:()=>t.history.length,pushState:(R,I)=>_("push",R,I),replaceState:(R,I)=>_("replace",R,I),back:R=>(R&&(b=!0),x=!0,t.history.back()),forward:R=>{R&&(b=!0),x=!0,t.history.forward()},go:R=>{f=!0,t.history.go(R)},createHref:R=>o(R),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=i,t.removeEventListener(Jx,A,{capture:!0}),t.removeEventListener(Qx,N)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(Jx,A,{capture:!0}),t.addEventListener(Qx,N),t.history.pushState=function(...R){const I=n.apply(t.history,R);return O._ignoreSubscribers||C("PUSH"),I},t.history.replaceState=function(...R){const I=i.apply(t.history,R);return O._ignoreSubscribers||C("REPLACE"),I},O}function JM(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function bc(e,t){const n=JM(e),i=n.indexOf("#"),s=n.indexOf("?"),l=Bv();return{href:n,pathname:n.substring(0,i>0?s>0?Math.min(i,s):i:s>0?s:n.length),hash:i>-1?n.substring(i):"",search:s>-1?n.slice(s,i===-1?void 0:i):"",state:t||{[fi]:0,key:l,__TSR_key:l}}}function Bv(){return(Math.random()+1).toString(36).substring(7)}function yc(e){return e[e.length-1]}function eB(e){return typeof e=="function"}function ci(e,t){return eB(e)?e(t):e}const tB=Object.prototype.hasOwnProperty;function Hn(e,t){if(e===t)return e;const n=t,i=rw(e)&&rw(n);if(!i&&!(vc(e)&&vc(n)))return n;const s=i?e:tw(e);if(!s)return n;const l=i?n:tw(n);if(!l)return n;const u=s.length,o=l.length,d=i?new Array(o):{};let h=0;for(let p=0;p<o;p++){const f=i?p:l[p],g=e[f],b=n[f];if(g===b){d[f]=g,(i?p<u:tB.call(e,f))&&h++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){d[f]=b;continue}const x=Hn(g,b);d[f]=x,x===g&&h++}return u===o&&h===u?e:d}function tw(e){const t=[],n=Object.getOwnPropertyNames(e);for(const s of n){if(!Object.prototype.propertyIsEnumerable.call(e,s))return!1;t.push(s)}const i=Object.getOwnPropertySymbols(e);for(const s of i){if(!Object.prototype.propertyIsEnumerable.call(e,s))return!1;t.push(s)}return t}function vc(e){if(!nw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!nw(n)||!n.hasOwnProperty("isPrototypeOf"))}function nw(e){return Object.prototype.toString.call(e)==="[object Object]"}function rw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qi(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(!qi(e[i],t[i],n))return!1;return!0}if(vc(e)&&vc(t)){const i=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!i||t[u]!==void 0)&&!qi(e[u],t[u],n))return!1;return!0}let s=0;if(!i)s=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&s++;let l=0;for(const u in t)if((!i||t[u]!==void 0)&&(l++,l>s||!qi(e[u],t[u],n)))return!1;return s===l}return!1}function Ya(e){let t,n;const i=new Promise((s,l)=>{t=s,n=l});return i.status="pending",i.resolve=s=>{i.status="resolved",i.value=s,t(s),e?.(s)},i.reject=s=>{i.status="rejected",n(s)},i}function pi(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function nB(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function iw(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return nB(t)}const ZN=["http:","https:","mailto:","tel:"];function _c(e){if(!e)return!1;try{const t=new URL(e);return!ZN.includes(t.protocol)}catch{return!1}}const rB={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},iB=/[&><\u2028\u2029]/g;function aB(e){return e.replace(iB,t=>rB[t])}function aw(e,t){if(!e)return e;const n=/%25|%5C/gi;let i=0,s="",l;for(;(l=n.exec(e))!==null;)s+=iw(e.slice(i,l.index))+l[0],i=n.lastIndex;return s=s+iw(i?e.slice(i):e),s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}var sB="Invariant failed";function Lr(e,t){if(!e)throw new Error(sB)}function Sc(e){const t=new Map;let n,i;const s=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,i&&(i.next=l,l.prev=i)):(l.next.prev=void 0,n=l.next,l.next=void 0,i&&(l.prev=i,i.next=l)),i=l)};return{get(l){const u=t.get(l);if(u)return s(u),u.value},set(l,u){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===i&&(i=void 0)}const o=t.get(l);if(o)o.value=u,s(o);else{const d={key:l,value:u,prev:i};i&&(i.next=d),i=d,n||(n=d),t.set(l,d)}},clear(){t.clear(),n=void 0,i=void 0}}}const Xa=0,Yi=1,Xi=2,bo=3,Va=4,oB=5,lB=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,cB=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,uB=/^([^{]*)\{\$\}([^}]*)$/;function Fv(e,t,n=new Uint16Array(6)){const i=e.indexOf("/",t),s=i===-1?e.length:i,l=e.substring(t,s);if(!l||!l.includes("$"))return n[0]=Xa,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(l==="$"){const h=e.length;return n[0]=Xi,n[1]=t,n[2]=t,n[3]=h,n[4]=h,n[5]=h,n}if(l.charCodeAt(0)===36)return n[0]=Yi,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const u=l.match(uB);if(u){const p=u[1].length;return n[0]=Xi,n[1]=t+p,n[2]=t+p+1,n[3]=t+p+2,n[4]=t+p+3,n[5]=e.length,n}const o=l.match(cB);if(o){const h=o[1],p=o[2],f=o[3],g=h.length;return n[0]=bo,n[1]=t+g,n[2]=t+g+3,n[3]=t+g+3+p.length,n[4]=s-f.length,n[5]=s,n}const d=l.match(lB);if(d){const h=d[1],p=d[2],f=d[3],g=h.length;return n[0]=Yi,n[1]=t+g,n[2]=t+g+2,n[3]=t+g+2+p.length,n[4]=s-f.length,n[5]=s,n}return n[0]=Xa,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function Fc(e,t,n,i,s,l,u){u?.(n);let o=i;{const d=n.fullPath??n.from,h=d.length,p=n.options?.caseSensitive??e,f=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;o<h;){const b=Fv(d,o,t);let x;const E=o,y=b[5];switch(o=y+1,l++,b[0]){case Xa:{const v=d.substring(b[2],b[3]);if(p){const _=s.static?.get(v);if(_)x=_;else{s.static??=new Map;const C=zi(n.fullPath??n.from);C.parent=s,C.depth=l,x=C,s.static.set(v,C)}}else{const _=v.toLowerCase(),C=s.staticInsensitive?.get(_);if(C)x=C;else{s.staticInsensitive??=new Map;const N=zi(n.fullPath??n.from);N.parent=s,N.depth=l,x=N,s.staticInsensitive.set(_,N)}}break}case Yi:{const v=d.substring(E,b[1]),_=d.substring(b[4],y),C=p&&!!(v||_),N=v?C?v:v.toLowerCase():void 0,A=_?C?_:_.toLowerCase():void 0,O=!f&&s.dynamic?.find(R=>!R.skipOnParamError&&R.caseSensitive===C&&R.prefix===N&&R.suffix===A);if(O)x=O;else{const R=Th(Yi,n.fullPath??n.from,C,N,A);x=R,R.depth=l,R.parent=s,s.dynamic??=[],s.dynamic.push(R)}break}case bo:{const v=d.substring(E,b[1]),_=d.substring(b[4],y),C=p&&!!(v||_),N=v?C?v:v.toLowerCase():void 0,A=_?C?_:_.toLowerCase():void 0,O=!f&&s.optional?.find(R=>!R.skipOnParamError&&R.caseSensitive===C&&R.prefix===N&&R.suffix===A);if(O)x=O;else{const R=Th(bo,n.fullPath??n.from,C,N,A);x=R,R.parent=s,R.depth=l,s.optional??=[],s.optional.push(R)}break}case Xi:{const v=d.substring(E,b[1]),_=d.substring(b[4],y),C=p&&!!(v||_),N=v?C?v:v.toLowerCase():void 0,A=_?C?_:_.toLowerCase():void 0,O=Th(Xi,n.fullPath??n.from,C,N,A);x=O,O.parent=s,O.depth=l,s.wildcard??=[],s.wildcard.push(O)}}s=x}if(f&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const b=zi(n.fullPath??n.from);b.kind=oB,b.parent=s,l++,b.depth=l,s.pathless??=[],s.pathless.push(b),s=b}const g=(n.path||!n.children)&&!n.isRoot;if(g&&d.endsWith("/")){const b=zi(n.fullPath??n.from);b.kind=Va,b.parent=s,l++,b.depth=l,s.index=b,s=b}s.parse=n.options?.params?.parse??null,s.skipOnParamError=f,s.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,g&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Fc(e,t,d,o,s,l,u)}function Ch(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function li(e){if(e.pathless)for(const t of e.pathless)li(t);if(e.static)for(const t of e.static.values())li(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())li(t);if(e.dynamic?.length){e.dynamic.sort(Ch);for(const t of e.dynamic)li(t)}if(e.optional?.length){e.optional.sort(Ch);for(const t of e.optional)li(t)}if(e.wildcard?.length){e.wildcard.sort(Ch);for(const t of e.wildcard)li(t)}}function zi(e){return{kind:Xa,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Th(e,t,n,i,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:i,suffix:s}}function dB(e,t){const n=zi("/"),i=new Uint16Array(6);for(const s of e)Fc(!1,i,s,1,n,0);li(n),t.masksTree=n,t.flatCache=Sc(1e3)}function hB(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const i=Pv(e,t.masksTree);return t.flatCache.set(e,i),i}function fB(e,t,n,i,s){e||="/",i||="/";const l=t?`case\0${e}`:e;let u=s.singleCache.get(l);if(!u){u=zi("/");const o=new Uint16Array(6);Fc(t,o,{from:e},1,u,0),s.singleCache.set(l,u)}return Pv(i,u,n)}function pB(e,t,n=!1){const i=n?e:`nofuzz\0${e}`,s=t.matchCache.get(i);if(s!==void 0)return s;e||="/";const l=Pv(e,t.segmentTree,n);return l&&(l.branch=bB(l.route)),t.matchCache.set(i,l),l}function mB(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function gB(e,t=!1,n){const i=zi(e.fullPath),s=new Uint16Array(6),l={},u={};let o=0;return Fc(t,s,e,1,i,0,h=>{if(n?.(h,o),Lr(!(h.id in l),`Duplicate routes found with id: ${String(h.id)}`),l[h.id]=h,o!==0&&h.path){const p=mB(h.fullPath);(!u[p]||h.fullPath.endsWith("/"))&&(u[p]=h)}o++}),li(i),{processedTree:{segmentTree:i,singleCache:Sc(1e3),matchCache:Sc(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Pv(e,t,n=!1){const i=e.split("/"),s=vB(e,i,t,n);if(!s)return null;const[l]=QN(e,i,s);return{route:s.node.route,rawParams:l,parsedParams:s.parsedParams}}function QN(e,t,n){const i=yB(n.node);let s=null;const l={};let u=n.extract?.part??0,o=n.extract?.node??0,d=n.extract?.path??0;for(;o<i.length;u++,o++,d++){const h=i[o],p=t[u],f=d;if(p&&(d+=p.length),h.kind===Yi){s??=n.node.fullPath.split("/");const g=s[o],b=h.prefix?.length??0;if(g.charCodeAt(b)===123){const E=h.suffix?.length??0,y=g.substring(b+2,g.length-E-1),S=p.substring(b,p.length-E);l[y]=decodeURIComponent(S)}else{const E=g.substring(1);l[E]=decodeURIComponent(p)}}else if(h.kind===bo){if(n.skipped&1<<o){u--;continue}s??=n.node.fullPath.split("/");const g=s[o],b=h.prefix?.length??0,x=h.suffix?.length??0,E=g.substring(b+3,g.length-x-1),y=h.suffix||h.prefix?p.substring(b,p.length-x):p;y&&(l[E]=decodeURIComponent(y))}else if(h.kind===Xi){const g=h,b=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),x=decodeURIComponent(b);l["*"]=x,l._splat=x;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:o,path:d}]}function bB(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function yB(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function vB(e,t,n,i){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!yc(t),l=s&&e!=="/",u=t.length-(s?1:0),o=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,h=null,p=null;for(;o.length;){const f=o.pop(),{node:g,index:b,skipped:x,depth:E,statics:y,dynamics:S,optionals:v}=f;let{extract:_,rawParams:C,parsedParams:N}=f;if(g.skipOnParamError){if(!Ah(e,t,f))continue;C=f.rawParams,_=f.extract,N=f.parsedParams}i&&g.route&&g.kind!==Va&&Js(h,f)&&(h=f);const A=b===u;if(A&&(g.route&&!l&&Js(p,f)&&(p=f),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const O=A?void 0:t[b];let R;if(A&&g.index){const I={node:g.index,index:b,skipped:x,depth:E+1,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N};if(g.index.skipOnParamError&&!Ah(e,t,I))continue;if(y===u&&!S&&!v&&!x)return I;Js(p,I)&&(p=I)}if(g.wildcard&&Js(d,f))for(const I of g.wildcard){const{prefix:L,suffix:F}=I;if(L&&(A||!(I.caseSensitive?O:R??=O.toLowerCase()).startsWith(L)))continue;if(F){if(A)continue;const z=t.slice(b).join("/").slice(-F.length);if((I.caseSensitive?z:z.toLowerCase())!==F)continue}const j={node:I,index:u,skipped:x,depth:E,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N};if(!(I.skipOnParamError&&!Ah(e,t,j))){d=j;break}}if(g.optional){const I=x|1<<E,L=E+1;for(let F=g.optional.length-1;F>=0;F--){const j=g.optional[F];o.push({node:j,index:b,skipped:I,depth:L,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(!A)for(let F=g.optional.length-1;F>=0;F--){const j=g.optional[F],{prefix:z,suffix:G}=j;if(z||G){const V=j.caseSensitive?O:R??=O.toLowerCase();if(z&&!V.startsWith(z)||G&&!V.endsWith(G))continue}o.push({node:j,index:b+1,skipped:x,depth:L,statics:y,dynamics:S,optionals:v+1,extract:_,rawParams:C,parsedParams:N})}}if(!A&&g.dynamic&&O)for(let I=g.dynamic.length-1;I>=0;I--){const L=g.dynamic[I],{prefix:F,suffix:j}=L;if(F||j){const z=L.caseSensitive?O:R??=O.toLowerCase();if(F&&!z.startsWith(F)||j&&!z.endsWith(j))continue}o.push({node:L,index:b+1,skipped:x,depth:E+1,statics:y,dynamics:S+1,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(!A&&g.staticInsensitive){const I=g.staticInsensitive.get(R??=O.toLowerCase());I&&o.push({node:I,index:b+1,skipped:x,depth:E+1,statics:y+1,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(!A&&g.static){const I=g.static.get(O);I&&o.push({node:I,index:b+1,skipped:x,depth:E+1,statics:y+1,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}if(g.pathless){const I=E+1;for(let L=g.pathless.length-1;L>=0;L--){const F=g.pathless[L];o.push({node:F,index:b,skipped:x,depth:I,statics:y,dynamics:S,optionals:v,extract:_,rawParams:C,parsedParams:N})}}}if(p&&d)return Js(d,p)?p:d;if(p)return p;if(d)return d;if(i&&h){let f=h.index;for(let b=0;b<h.index;b++)f+=t[b].length;const g=f===e.length?"/":e.slice(f);return h.rawParams??={},h.rawParams["**"]=decodeURIComponent(g),h}return null}function Ah(e,t,n){try{const[i,s]=QN(e,t,n);n.rawParams=i,n.extract=s;const l=n.node.parse(i);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function Js(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Va)>(e.node.kind===Va)||t.node.kind===Va==(e.node.kind===Va)&&t.depth>e.depth))):!0}function ac(e){return Uv(e.filter(t=>t!==void 0).join("/"))}function Uv(e){return e.replace(/\/{2,}/g,"/")}function JN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $i(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function eO(e){return $i(JN(e))}function Ec(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function _B(e,t,n){return Ec(e,n)===Ec(t,n)}function SB({base:e,to:t,trailingSlash:n="never",cache:i}){const s=t.startsWith("/"),l=!s&&t===".";let u;if(i){u=s?t:l?e:e+"\0"+t;const f=i.get(u);if(f)return f}let o;if(l)o=e.split("/");else if(s)o=t.split("/");else{for(o=e.split("/");o.length>1&&yc(o)==="";)o.pop();const f=t.split("/");for(let g=0,b=f.length;g<b;g++){const x=f[g];x===""?g?g===b-1&&o.push(x):o=[x]:x===".."?o.pop():x==="."||o.push(x)}}o.length>1&&(yc(o)===""?n==="never"&&o.pop():n==="always"&&o.push(""));let d,h="";for(let f=0;f<o.length;f++){f>0&&(h+="/");const g=o[f];if(!g)continue;d=Fv(g,0,d);const b=d[0];if(b===Xa){h+=g;continue}const x=d[5],E=g.substring(0,d[1]),y=g.substring(d[4],x),S=g.substring(d[2],d[3]);b===Yi?h+=E||y?`${E}{$${S}}${y}`:`$${S}`:b===Xi?h+=E||y?`${E}{$}${y}`:"$":h+=`${E}{-$${S}}${y}`}h=Uv(h);const p=h||"/";return u&&i&&i.set(u,p),p}function kh(e,t,n){const i=t[e];return typeof i!="string"?i:e==="_splat"?encodeURI(i):EB(i,n)}function Rh({path:e,params:t,decodeCharMap:n}){let i=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const l=e.length;let u=0,o,d="";for(;u<l;){const p=u;o=Fv(e,p,o);const f=o[5];if(u=f+1,p===f)continue;const g=o[0];if(g===Xa){d+="/"+e.substring(p,f);continue}if(g===Xi){const b=t._splat;s._splat=b,s["*"]=b;const x=e.substring(p,o[1]),E=e.substring(o[4],f);if(!b){i=!0,(x||E)&&(d+="/"+x+E);continue}const y=kh("_splat",t,n);d+="/"+x+y+E;continue}if(g===Yi){const b=e.substring(o[2],o[3]);!i&&!(b in t)&&(i=!0),s[b]=t[b];const x=e.substring(p,o[1]),E=e.substring(o[4],f),y=kh(b,t,n)??"undefined";d+="/"+x+y+E;continue}if(g===bo){const b=e.substring(o[2],o[3]),x=t[b];if(x==null)continue;s[b]=x;const E=e.substring(p,o[1]),y=e.substring(o[4],f),S=kh(b,t,n)??"";d+="/"+E+S+y;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:s,interpolatedPath:d||"/",isMissingParams:i}}function EB(e,t){let n=encodeURIComponent(e);if(t)for(const[i,s]of t)n=n.replaceAll(i,s);return n}function kn(e){return!!e?.isNotFound}function xB(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const xc="tsr-scroll-restoration-v1_3",wB=(e,t)=>{let n;return(...i)=>{n||(n=setTimeout(()=>{e(...i),n=null},t))}};function CB(){const e=xB();if(!e)return null;const t=e.getItem(xc);let n=t?JSON.parse(t):{};return{state:n,set:i=>{n=ci(i,n)||n;try{e.setItem(xc,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Kl=CB(),tv=e=>e.state.__TSR_key||e.href;function TB(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let wc=!1;function tO({storageKey:e,key:t,behavior:n,shouldScrollRestoration:i,scrollToTopSelectors:s,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const o=t||window.history.state?.__TSR_key,d=u[o];wc=!0;e:{if(i&&d&&Object.keys(d).length>0){for(const f in d){const g=d[f];if(f==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(f){const b=document.querySelector(f);b&&(b.scrollLeft=g.scrollX,b.scrollTop=g.scrollY)}}break e}const h=(l??window.location).hash.split("#",2)[1];if(h){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const g=document.getElementById(h);g&&g.scrollIntoView(f)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),s)for(const f of s){if(f==="window")continue;const g=typeof f=="function"?f():document.querySelector(f);g&&g.scrollTo(p)}}wc=!1}function AB(e,t){if(!Kl&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Kl))return;e.isScrollRestorationSetup=!0,wc=!1;const i=e.options.getScrollRestorationKey||tv;window.history.scrollRestoration="manual";const s=l=>{if(wc||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const d=l.target.getAttribute("data-scroll-restoration-id");d?u=`[data-scroll-restoration-id="${d}"]`:u=TB(l.target)}const o=i(e.state.location);Kl.set(d=>{const h=d[o]||={},p=h[u]||={};if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const f=document.querySelector(u);f&&(p.scrollX=f.scrollLeft||0,p.scrollY=f.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",wB(s,100),!0),e.subscribe("onRendered",l=>{const u=i(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(tO({storageKey:xc,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Kl.set(o=>(o[u]||={},o)))})}function kB(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function RB(e,t=String){const n=new URLSearchParams;for(const i in e){const s=e[i];s!==void 0&&n.set(i,t(s))}return n.toString()}function Nh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function NB(e){const t=new URLSearchParams(e),n={};for(const[i,s]of t.entries()){const l=n[i];l==null?n[i]=Nh(s):Array.isArray(l)?l.push(Nh(s)):n[i]=[l,Nh(s)]}return n}const OB=LB(JSON.parse),IB=DB(JSON.stringify,JSON.parse);function LB(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=NB(t);for(const i in n){const s=n[i];if(typeof s=="string")try{n[i]=e(s)}catch{}}return n}}function DB(e,t){const n=typeof t=="function";function i(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const l=RB(s,i);return l?`?${l}`:""}}const Tn="__root__";function nO(e){if(e.statusCode=e.statusCode||e.code||307,typeof e.href=="string"&&_c(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${ZN.join(", ")} protocols are allowed.`);if(!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Gn(e){return e instanceof Response&&!!e.options}const sc=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Pc=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),jv=(e,t,n=!0)=>{const i={...e.router.options.context??{}},s=n?t:t-1;for(let l=0;l<=s;l++){const u=e.matches[l];if(!u)continue;const o=e.router.getMatch(u.id);o&&Object.assign(i,o.__routeContext,o.__beforeLoadContext)}return i},rO=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Lr(n.options.notFoundComponent);const i=e.matches.find(s=>s.routeId===n.id);Lr(i,"Could not find match for route: "+n.id),e.updateMatch(i.id,s=>({...s,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,rO(e,t))},ui=(e,t,n)=>{if(!(!Gn(n)&&!kn(n))){if(Gn(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const i=Gn(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,s=>({...s,status:i,isFetching:!1,error:n})),kn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Gn(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(rO(e,n),n)}},iO=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},eo=(e,t,n,i)=>{const{id:s,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=i,e.firstBadMatchIndex??=t,ui(e,e.router.getMatch(s),n);try{u.options.onError?.(n)}catch(o){n=o,ui(e,e.router.getMatch(s),n)}e.updateMatch(s,o=>(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loadPromise?.resolve(),{...o,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},MB=(e,t,n,i)=>{const s=e.router.getMatch(t),l=e.matches[n-1]?.id,u=l?e.router.getMatch(l):void 0;if(e.router.isShell()){s.ssr=i.id===Tn;return}if(u?.ssr===!1){s.ssr=!1;return}const o=b=>b===!0&&u?.ssr==="data-only"?"data-only":b,d=e.router.options.defaultSsr??!0;if(i.options.ssr===void 0){s.ssr=o(d);return}if(typeof i.options.ssr!="function"){s.ssr=o(i.options.ssr);return}const{search:h,params:p}=s,f={search:Yl(h,s.searchError),params:Yl(p,s.paramsError),location:e.location,matches:e.matches.map(b=>({index:b.index,pathname:b.pathname,fullPath:b.fullPath,staticData:b.staticData,id:b.id,routeId:b.routeId,search:Yl(b.search,b.searchError),params:Yl(b.params,b.paramsError),ssr:b.ssr}))},g=i.options.ssr(f);if(pi(g))return g.then(b=>{s.ssr=o(b??d)});s.ssr=o(g??d)},aO=(e,t,n,i)=>{if(i._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Pc(e,t)&&(n.options.loader||n.options.beforeLoad||lO(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{sc(e)},s);i._nonReactive.pendingTimeout=u}},BB=(e,t,n)=>{const i=e.router.getMatch(t);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;aO(e,t,n,i);const s=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&ui(e,l,l.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(s):s()},FB=(e,t,n,i)=>{const s=e.router.getMatch(t),l=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ya(()=>{l?.resolve()});const{paramsError:u,searchError:o}=s;u&&eo(e,n,u,"PARSE_PARAMS"),o&&eo(e,n,o,"VALIDATE_SEARCH"),aO(e,t,i,s);const d=new AbortController,h=e.matches[n-1]?.id;(h?e.router.getMatch(h):void 0)?.context??e.router.options.context;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},b=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!i.options.beforeLoad){uo(()=>{g(),b()});return}s._nonReactive.beforeLoadPromise=Ya();const x={...jv(e,n,!1),...s.__routeContext},{search:E,params:y,cause:S}=s,v=Pc(e,t),_={search:E,abortController:d,params:y,preload:v,context:x,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":S,matches:e.matches,...e.router.options.additionalContext},C=A=>{if(A===void 0){uo(()=>{g(),b()});return}(Gn(A)||kn(A))&&(g(),eo(e,n,A,"BEFORE_LOAD")),uo(()=>{g(),e.updateMatch(t,O=>({...O,__beforeLoadContext:A})),b()})};let N;try{if(N=i.options.beforeLoad(_),pi(N))return g(),N.catch(A=>{eo(e,n,A,"BEFORE_LOAD")}).then(C)}catch(A){g(),eo(e,n,A,"BEFORE_LOAD")}C(N)},PB=(e,t)=>{const{id:n,routeId:i}=e.matches[t],s=e.router.looseRoutesById[i],l=()=>{if(e.router.isServer){const d=MB(e,n,t,s);if(pi(d))return d.then(o)}return o()},u=()=>FB(e,n,t,s),o=()=>{if(iO(e,n))return;const d=BB(e,n,s);return pi(d)?d.then(u):u()};return l()},UB=(e,t,n)=>{const i=e.router.getMatch(t);if(!i||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={matches:e.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([l,u,o])=>{const d=l?.meta,h=l?.links,p=l?.scripts,f=l?.styles;return{meta:d,links:h,headScripts:p,headers:o,scripts:u,styles:f}})},sO=(e,t,n,i)=>{const s=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:o,cause:d}=e.router.getMatch(t),h=jv(e,n),p=Pc(e,t);return{params:l,deps:u,preload:!!p,parentMatchPromise:s,abortController:o,context:h,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:p?"preload":d,route:i,...e.router.options.additionalContext}},sw=async(e,t,n,i)=>{try{const s=e.router.getMatch(t);try{(!e.router.isServer||s.ssr===!0)&&oO(i);const l=i.options.loader?.(sO(e,t,n,i)),u=i.options.loader&&pi(l);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),i.options.loader){const h=u?await l:l;ui(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,p=>({...p,loaderData:h}))}i._lazyPromise&&await i._lazyPromise;const d=s._nonReactive.minPendingPromise;d&&await d,i._componentsPromise&&await i._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1}));return}const o=s._nonReactive.minPendingPromise;o&&await o,kn(l)&&await i.options.notFoundComponent?.preload?.(),ui(e,e.router.getMatch(t),l);try{i.options.onError?.(l)}catch(d){u=d,ui(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:u,status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),ui(e,l,s)}},jB=async(e,t)=>{const{id:n,routeId:i}=e.matches[t];let s=!1,l=!1;const u=e.router.looseRoutesById[i],o=()=>{e.updateMatch(n,p=>({...p,context:jv(e,t)}))};if(iO(e,n)){if(e.router.isServer)return e.router.getMatch(n)}else{const p=e.router.getMatch(n);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const f=e.router.getMatch(n),g=f._nonReactive.error||f.error;g&&ui(e,f,g)}else{const f=Date.now()-p.updatedAt,g=Pc(e,n),b=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,x=u.options.shouldReload,E=typeof x=="function"?x(sO(e,n,t,u)):x,y=!!g&&!e.router.state.matches.some(C=>C.id===n),S=e.router.getMatch(n);S._nonReactive.loaderPromise=Ya(),y!==S.preload&&e.updateMatch(n,C=>({...C,preload:y}));const{status:v,invalid:_}=S;s=v==="success"&&(_||(E??f>b)),g&&u.options.preload===!1||(s&&!e.sync?(l=!0,(async()=>{try{await sw(e,n,t,u),o();const C=e.router.getMatch(n);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){Gn(C)&&await e.router.navigate(C.options)}})()):(v!=="success"||s&&e.sync)&&await sw(e,n,t,u))}}const d=e.router.getMatch(n);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0,l||o();const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:h,invalid:!1})),e.router.getMatch(n)):d};async function ow(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&sc(t);try{for(let o=0;o<t.matches.length;o++){const d=PB(t,o);pi(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(jB(t,o));const s=(await Promise.allSettled(t.matchPromises)).filter(o=>o.status==="rejected").map(o=>o.reason);let l;for(const o of s){if(Gn(o))throw o;!l&&kn(o)&&(l=o)}for(const o of t.matches){const{id:d,routeId:h}=o,p=t.router.looseRoutesById[h];try{const f=UB(t,d,p);if(f){const g=await f;t.updateMatch(d,b=>({...b,...g}))}}catch(f){console.error(`Error executing head for route ${h}:`,f)}}if(l)throw l;const u=sc(t);pi(u)&&await u}catch(n){if(kn(n)&&!t.preload){const i=sc(t);throw pi(i)&&await i,n}if(Gn(n))throw n}return t.matches}async function oO(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...i}=t.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const i of cO){const s=e.options[i]?.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Yl(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function lO(e){for(const t of cO)if(e.options[t]?.preload)return!0;return!1}const cO=["component","errorComponent","pendingComponent","notFoundComponent"];function zB(e){return{input:({url:t})=>{for(const n of e)t=nv(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=uO(e[n],t);return t}}}function HB(e){const t=eO(e.basepath),n=`/${t}`,i=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?i:i.toLowerCase();return{input:({url:u})=>{const o=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return o===s?u.pathname="/":o.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=ac(["/",t,u.pathname]),u)}}function nv(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function uO(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Gi(e){const t=e.resolvedLocation,n=e.location,i=t?.pathname!==n.pathname,s=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:i,hrefChanged:s,hashChanged:l}}class qB{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const i=this.options,s=this.basepath??i?.basepath??"/",l=this.basepath===void 0,u=i?.rewrite;this.options={...i,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=QM())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new XM(GB(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),AB(this));let o=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(l||s!==d||u!==h){this.basepath=d;const g=[];eO(d)!==""&&g.push(HB({basepath:d})),h&&g.push(h),this.rewrite=g.length===0?void 0:g.length===1?g[0]:zB(g),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:i,processedTree:s}=gB(this.routeTree,this.options.caseSensitive,(u,o)=>{u.init({originalIndex:o})});this.options.routeMasks&&dB(this.options.routeMasks,s),this.routesById=n,this.routesByPath=i,this.processedTree=s;const l=this.options.notFoundRoute;l&&(l.init({originalIndex:99999999999}),this.routesById[l.id]=l)},this.subscribe=(n,i)=>{const s={eventType:n,fn:i};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(i=>{i.eventType===n.type&&i.fn(n)})},this.parseLocation=(n,i)=>{const s=({href:d,state:h})=>{const p=new URL(d,this.origin),f=nv(this.rewrite,p),g=this.options.parseSearch(f.search),b=this.options.stringifySearch(g);return f.search=b,{href:f.href.replace(f.origin,""),publicHref:d,url:f,pathname:aw(f.pathname),searchStr:b,search:Hn(i?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:Hn(i?.state,h)}},l=s(n),{__tempLocation:u,__tempKey:o}=l.state;if(u&&(!o||o===this.tempLocationKey)){const d=s(u);return d.state.key=l.state.key,d.state.__TSR_key=l.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:l}}return l},this.resolvePathCache=Sc(1e3),this.resolvePathWithBase=(n,i)=>SB({base:n,to:Uv(i),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,i,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:i},s):this.matchRoutesInternal(n,i),this.getMatchedRoutes=n=>VB({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const i=this.getMatch(n);i&&(i.abortController.abort(),clearTimeout(i._nonReactive.pendingTimeout),i._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),i=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...i]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const i=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutes(u,{_buildLocation:!0}),d=yc(o);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??d.fullPath,p=this.resolvePathWithBase(h,"."),f=d.search,g={...d.params},b=l.to?this.resolvePathWithBase(p,`${l.to}`):this.resolvePathWithBase(p,"."),x=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,ci(l.params,g)),E=Rh({path:b,params:x}).interpolatedPath,y=this.matchRoutes(E,void 0,{_buildLocation:!0}).map(L=>this.looseRoutesById[L.routeId]);if(Object.keys(x).length>0)for(const L of y){const F=L.options.params?.stringify??L.options.stringifyParams;F&&Object.assign(x,F(x))}const S=n.leaveParams?b:aw(Rh({path:b,params:x,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const L={};y.forEach(F=>{if(F.options.validateSearch)try{Object.assign(L,rv(F.options.validateSearch,{...L,...v}))}catch{}}),v=L}v=WB({search:v,dest:l,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),v=Hn(f,v);const _=this.options.stringifySearch(v),C=l.hash===!0?u.hash:l.hash?ci(l.hash,u.hash):void 0,N=C?`#${C}`:"";let A=l.state===!0?u.state:l.state?ci(l.state,u.state):{};A=Hn(u.state,A);const O=`${S}${_}${N}`,R=new URL(O,this.origin),I=uO(this.rewrite,R);return{publicHref:I.pathname+I.search+I.hash,href:O,url:I,pathname:S,search:v,searchStr:_,state:A,hash:C??"",unmaskOnReload:l.unmaskOnReload}},s=(l={},u)=>{const o=i(l);let d=u?i(u):void 0;if(!d){const h={};if(this.options.routeMasks){const p=hB(o.pathname,this.processedTree);if(p){Object.assign(h,p.rawParams);const{from:f,params:g,...b}=p.route,x=g===!1||g===null?{}:(g??!0)===!0?h:Object.assign(h,ci(g,h));u={from:n.from,...b,params:x},d=i(u)}}}return d&&(o.maskedLocation=d),o};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:i,...s})=>{const l=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(p=>{s.state[p]=this.latestLocation.state[p]});const h=qi(s.state,this.latestLocation.state);return d.forEach(p=>{delete s.state[p]}),h},u=$i(this.latestLocation.href)===$i(s.href),o=this.commitLocationPromise;if(this.commitLocationPromise=Ya(()=>{o?.resolve()}),u&&l())this.load();else{let{maskedLocation:d,hashScrollIntoView:h,url:p,...f}=s;d&&(f={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:i})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:i,hashScrollIntoView:s,viewTransition:l,ignoreBlocker:u,href:o,...d}={})=>{if(o){const f=this.history.location.state.__TSR_index,g=bc(o,{__TSR_index:n?f:f+1}),b=new URL(g.pathname,this.origin),x=nv(this.rewrite,b);d.to=x.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const p=this.commitLocation({...h,viewTransition:l,replace:n,resetScroll:i,hashScrollIntoView:s,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:i,href:s,publicHref:l,...u})=>{let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!i&&(i=!0),i){if(n!==void 0||!s){const h=this.buildLocation({to:n,...u});s=s??h.url.href,l=l??h.url.href}const d=!o&&l?l:s;if(_c(d))return Promise.resolve();if(!u.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const f of p)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...u,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const i=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==i.publicHref||i.url.origin!==this.origin){const s=this.getParsedLocationHref(i);throw nO({href:s})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(i=>({...i,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:i.cachedMatches.filter(s=>!n.some(l=>l.id===s.id))}))},this.load=async n=>{let i,s,l;for(l=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Gi({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...Gi({resolvedLocation:h,location:d})}),await ow({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],f=[],g=[];uo(()=>{this.__store.setState(b=>{const x=b.matches,E=b.pendingMatches||b.matches;return p=x.filter(y=>!E.some(S=>S.id===y.id)),f=E.filter(y=>!x.some(S=>S.id===y.id)),g=E.filter(y=>x.some(S=>S.id===y.id)),{...b,isLoading:!1,loadedAt:Date.now(),matches:E,pendingMatches:void 0,cachedMatches:[...b.cachedMatches,...p.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([b,x])=>{b.forEach(E=>{this.looseRoutesById[E.routeId].options[x]?.(E)})})})})}})}catch(d){Gn(d)?(i=d,this.isServer||this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):kn(d)&&(s=d),this.__store.setState(h=>({...h,statusCode:i?i.status:s?404:h.matches.some(p=>p.status==="error")?500:200,redirect:i}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(o=>o.status==="error")&&(u=500),u!==void 0&&this.__store.setState(o=>({...o,statusCode:u}))},this.startViewTransition=n=>{const i=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,i&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof i=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,o=typeof i.types=="function"?i.types(Gi({resolvedLocation:u,location:l})):i.types;if(o===!1){n();return}s={update:n,types:o}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,i)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";s&&this.__store.setState(l=>({...l,[s]:l[s]?.map(u=>u.id===n?i(u):u)}))})},this.getMatch=n=>{const i=s=>s.id===n;return this.state.cachedMatches.find(i)??this.state.pendingMatches?.find(i)??this.state.matches.find(i)},this.invalidate=n=>{const i=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(i),cachedMatches:s.cachedMatches.map(i),pendingMatches:s.pendingMatches?.map(i)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>{let i=n.url.href;return this.origin&&n.url.origin===this.origin&&(i=i.replace(this.origin,"")||"/"),i},this.resolveRedirect=n=>{const i=n.headers.get("Location");if(n.options.href){if(i)try{const s=new URL(i);if(this.origin&&s.origin===this.origin){const l=s.pathname+s.search+s.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}}else{const s=this.buildLocation(n.options),l=this.getParsedLocationHref(s);n.options.href=l,n.headers.set("Location",l)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const i=n?.filter;i!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(l=>!i(l))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=i=>{const s=this.looseRoutesById[i.routeId];if(!s.options.loader)return!0;const l=(i.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:Date.now()-i.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=oO,this.preloadRoute=async n=>{const i=this.buildLocation(n);let s=this.matchRoutes(i,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),u=new Set([...l,...this.state.cachedMatches.map(o=>o.id)]);uo(()=>{s.forEach(o=>{u.has(o.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,o]}))})});try{return s=await ow({router:this,matches:s,location:i,preload:!0,updateMatch:(o,d)=>{l.has(o)?s=s.map(h=>h.id===o?d(h):h):this.updateMatch(o,d)}}),s}catch(o){if(Gn(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:i});kn(o)||console.error(o);return}},this.matchRoute=(n,i)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(s);if(i?.pending&&this.state.status!=="pending")return!1;const o=(i?.pending===void 0?!this.state.isLoading:i.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=fB(l.pathname,i?.caseSensitive??!1,i?.fuzzy??!1,o.pathname,this.processedTree);return!d||n.params&&!qi(d.rawParams,n.params,{partial:!0})?!1:i?.includeSearch??!0?qi(o.search,l.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??IB,parseSearch:t.parseSearch??OB}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const i=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:l,parsedParams:u}=i;let{matchedRoutes:o}=i,d=!1;(s?s.path!=="/"&&l["**"]:$i(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:d=!0);const h=(()=>{if(d){if(this.options.notFoundMode!=="root")for(let g=o.length-1;g>=0;g--){const b=o[g];if(b.children)return b.id}return Tn}})(),p=[],f=g=>g?.id?g.context??this.options.context??void 0:this.options.context??void 0;return o.forEach((g,b)=>{const x=p[b-1],[E,y,S]=(()=>{const G=x?.search??t.search,V=x?._strictSearch??void 0;try{const W=rv(g.options.validateSearch,{...G})??void 0;return[{...G,...W},{...V,...W},void 0]}catch(W){let Z=W;if(W instanceof Cc||(Z=new Cc(W.message,{cause:W})),n?.throwOnError)throw Z;return[G,{},Z]}})(),v=g.options.loaderDeps?.({search:E})??"",_=v?JSON.stringify(v):"",{interpolatedPath:C,usedParams:N}=Rh({path:g.fullPath,params:l,decodeCharMap:this.pathParamsDecodeCharMap}),A=g.id+C+_,O=this.getMatch(A),R=this.state.matches.find(G=>G.routeId===g.id),I=O?._strictParams??N;let L;if(!O)if(g.options.skipRouteOnParseError)for(const G in N)G in u&&(I[G]=u[G]);else{const G=g.options.params?.parse??g.options.parseParams;if(G)try{Object.assign(I,G(I))}catch(V){if(kn(V)||Gn(V)?L=V:L=new $B(V.message,{cause:V}),n?.throwOnError)throw L}}Object.assign(l,I);const F=R?"stay":"enter";let j;if(O)j={...O,cause:F,params:R?Hn(R.params,l):l,_strictParams:I,search:Hn(R?R.search:O.search,E),_strictSearch:y};else{const G=g.options.loader||g.options.beforeLoad||g.lazyFn||lO(g)?"pending":"success";j={id:A,ssr:this.isServer?void 0:g.options.ssr,index:b,routeId:g.id,params:R?Hn(R.params,l):l,_strictParams:I,pathname:C,updatedAt:Date.now(),search:R?Hn(R.search,E):E,_strictSearch:y,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:L,__routeContext:void 0,_nonReactive:{loadPromise:Ya()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:R?Hn(R.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}n?.preload||(j.globalNotFound=h===g.id),j.searchError=S;const z=f(x);j.context={...z,...j.__routeContext,...j.__beforeLoadContext},p.push(j)}),p.forEach((g,b)=>{const x=this.looseRoutesById[g.routeId];if(!this.getMatch(g.id)&&n?._buildLocation!==!0){const y=p[b-1],S=f(y);if(x.options.context){const v={deps:g.loaderDeps,params:g.params,context:S??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:p};g.__routeContext=x.options.context(v)??void 0}g.context={...S,...g.__routeContext,...g.__beforeLoadContext}}}),p}}class Cc extends Error{}class $B extends Error{}function GB(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function rv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Cc("Async validation not supported");if(n.issues)throw new Cc(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function VB({pathname:e,routesById:t,processedTree:n}){const i={},s=$i(e);let l,u;const o=pB(s,n,!0);return o&&(l=o.route,Object.assign(i,o.rawParams),u=Object.assign({},o.parsedParams)),{matchedRoutes:o?.branch||[t[Tn]],routeParams:i,foundRoute:l,parsedParams:u}}function WB({search:e,dest:t,destRoutes:n,_includeValidateSearch:i}){const s=n.reduce((o,d)=>{const h=[];if("search"in d.options)d.options.search?.middlewares&&h.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const p=({search:f,next:g})=>{let b=f;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(b=d.options.preSearchFilters.reduce((E,y)=>y(E),f));const x=g(b);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((E,y)=>y(E),x):x};h.push(p)}if(i&&d.options.validateSearch){const p=({search:f,next:g})=>{const b=g(f);try{return{...b,...rv(d.options.validateSearch,b)??void 0}}catch{return b}};h.push(p)}return o.concat(h)},[])??[],l=({search:o})=>t.search?t.search===!0?o:ci(t.search,o):{};s.push(l);const u=(o,d)=>{if(o>=s.length)return d;const h=s[o];return h({search:d,next:f=>u(o+1,f)})};return u(0,e)}const KB="Error preloading route! ☝️";class dO{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const i=this.options,s=!i?.path&&!i?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Tn:this.parentRoute||Lr(!1);let l=s?Tn:i?.path;l&&l!=="/"&&(l=JN(l));const u=i?.id||l;let o=s?Tn:ac([this.parentRoute.id===Tn?"":this.parentRoute.id,u]);l===Tn&&(l="/"),o!==Tn&&(o=ac(["/",o]));const d=o===Tn?"/":ac([this.parentRoute.fullPath,l]);this._path=l,this._id=o,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class YB extends dO{constructor(t){super(t)}}const Xl=typeof window<"u"?K.useLayoutEffect:K.useEffect;function Oh(e){const t=K.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function XB(e,t,n={},i={}){K.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([l])=>{t(l)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,i.disabled,e])}function ZB(e){const t=K.useRef(null);return K.useImperativeHandle(e,()=>t.current,[]),t}function zv(e){const t=e.errorComponent??Uc;return T.jsx(QB,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:i})=>n?K.createElement(t,{error:n,reset:i}):e.children})}class QB extends K.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Uc({error:e}){const[t,n]=K.useState(!1);return T.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[T.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),T.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(i=>!i),children:t?"Hide Error":"Show Error"})]}),T.jsx("div",{style:{height:".25rem"}}),t?T.jsx("div",{children:T.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?T.jsx("code",{children:e.message}):null})}):null]})}function JB({children:e,fallback:t=null}){return e3()?T.jsx($t.Fragment,{children:e}):T.jsx($t.Fragment,{children:t})}function e3(){return $t.useSyncExternalStore(t3,()=>!0,()=>!1)}function t3(){return()=>{}}var Ih={exports:{}},Lh={},Dh={exports:{}},Mh={};var lw;function n3(){if(lw)return Mh;lw=1;var e=wo();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(f,g){var b=g(),x=i({inst:{value:b,getSnapshot:g}}),E=x[0].inst,y=x[1];return l(function(){E.value=b,E.getSnapshot=g,d(E)&&y({inst:E})},[f,b,g]),s(function(){return d(E)&&y({inst:E}),f(function(){d(E)&&y({inst:E})})},[f]),u(b),b}function d(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function h(f,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:o;return Mh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Mh}var cw;function r3(){return cw||(cw=1,Dh.exports=n3()),Dh.exports}var uw;function i3(){if(uw)return Lh;uw=1;var e=wo(),t=r3();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var i=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,d=e.useDebugValue;return Lh.useSyncExternalStoreWithSelector=function(h,p,f,g,b){var x=l(null);if(x.current===null){var E={hasValue:!1,value:null};x.current=E}else E=x.current;x=o(function(){function S(A){if(!v){if(v=!0,_=A,A=g(A),b!==void 0&&E.hasValue){var O=E.value;if(b(O,A))return C=O}return C=A}if(O=C,i(_,A))return O;var R=g(A);return b!==void 0&&b(O,R)?(_=A,O):(_=A,C=R)}var v=!1,_,C,N=f===void 0?null:f;return[function(){return S(p())},N===null?void 0:function(){return S(N())}]},[p,f,g,b]);var y=s(h,x[0],x[1]);return u(function(){E.hasValue=!0,E.value=y},[y]),d(y),y},Lh}var dw;function a3(){return dw||(dw=1,Ih.exports=i3()),Ih.exports}var s3=a3();function o3(e,t=i=>i,n={}){const i=n.equal??l3;return s3.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,i)}function l3(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,s]of e)if(!t.has(i)||!Object.is(s,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=hw(e);if(n.length!==hw(t).length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Object.is(e[n[i]],t[n[i]]))return!1;return!0}function hw(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Bh=K.createContext(null);function hO(){return typeof document>"u"?Bh:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Bh,Bh)}function Nn(e){const t=K.useContext(hO());return e?.warn,t}function hn(e){const t=Nn({warn:e?.router===void 0}),n=e?.router||t,i=K.useRef(void 0);return o3(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=Hn(i.current,e.select(s));return i.current=l,l}return e.select(s)}return s})}const jc=K.createContext(void 0),c3=K.createContext(void 0);function lr(e){const t=K.useContext(e.from?c3:jc);return hn({select:i=>{const s=i.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(Lr(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function Hv(e){return lr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function qv(e){const{select:t,...n}=e;return lr({...n,select:i=>t?t(i.loaderDeps):i.loaderDeps})}function $v(e){return lr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Gv(e){return lr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function zc(e){const t=Nn();return K.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var u3=PN();function d3(e,t){const n=Nn(),[i,s]=K.useState(!1),l=K.useRef(!1),u=ZB(t),{activeProps:o,inactiveProps:d,activeOptions:h,to:p,preload:f,preloadDelay:g,hashScrollIntoView:b,replace:x,startTransition:E,resetScroll:y,viewTransition:S,children:v,target:_,disabled:C,style:N,className:A,onClick:O,onFocus:R,onMouseEnter:I,onMouseLeave:L,onTouchStart:F,ignoreBlocker:j,params:z,search:G,hash:V,state:W,mask:Z,reloadDocument:J,unsafeRelative:P,from:D,_fromLocation:B,...H}=e,U=hn({select:Ne=>Ne.location.search,structuralSharing:!0}),ee=e.from,le=K.useMemo(()=>({...e,from:ee}),[n,U,ee,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=K.useMemo(()=>n.buildLocation({...le}),[n,le]),X=K.useMemo(()=>{if(C)return;let Ne=ue.maskedLocation?ue.maskedLocation.url.href:ue.url.href,Oe=!1;return n.origin&&(Ne.startsWith(n.origin)?Ne=n.history.createHref(Ne.replace(n.origin,""))||"/":Oe=!0),{href:Ne,external:Oe}},[C,ue.maskedLocation,ue.url,n.origin,n.history]),$=K.useMemo(()=>{if(X?.external)return _c(X.href)?void 0:X.href;try{return new URL(p),_c(p)?void 0:p}catch{}},[p,X]),ie=e.reloadDocument||$?!1:f??n.options.defaultPreload,he=g??n.options.defaultPreloadDelay??0,be=hn({select:Ne=>{if($)return!1;if(h?.exact){if(!_B(Ne.location.pathname,ue.pathname,n.basepath))return!1}else{const Oe=Ec(Ne.location.pathname,n.basepath),je=Ec(ue.pathname,n.basepath);if(!(Oe.startsWith(je)&&(Oe.length===je.length||Oe[je.length]==="/")))return!1}return(h?.includeSearch??!0)&&!qi(Ne.location.search,ue.search,{partial:!h?.exact,ignoreUndefined:!h?.explicitUndefined})?!1:h?.includeHash?Ne.location.hash===ue.hash:!0}}),ge=K.useCallback(()=>{n.preloadRoute({...le}).catch(Ne=>{console.warn(Ne),console.warn(KB)})},[n,le]),xe=K.useCallback(Ne=>{Ne?.isIntersecting&&ge()},[ge]);XB(u,xe,g3,{disabled:!!C||ie!=="viewport"}),K.useEffect(()=>{l.current||!C&&ie==="render"&&(ge(),l.current=!0)},[C,ge,ie]);const ze=Ne=>{const Oe=Ne.currentTarget.getAttribute("target"),je=_!==void 0?_:Oe;if(!C&&!b3(Ne)&&!Ne.defaultPrevented&&(!je||je==="_self")&&Ne.button===0){Ne.preventDefault(),u3.flushSync(()=>{s(!0)});const ce=n.subscribe("onResolved",()=>{ce(),s(!1)});n.navigate({...le,replace:x,resetScroll:y,hashScrollIntoView:b,startTransition:E,viewTransition:S,ignoreBlocker:j})}};if($)return{...H,ref:u,href:$,...v&&{children:v},..._&&{target:_},...C&&{disabled:C},...N&&{style:N},...A&&{className:A},...O&&{onClick:O},...R&&{onFocus:R},...I&&{onMouseEnter:I},...L&&{onMouseLeave:L},...F&&{onTouchStart:F}};const He=Ne=>{C||ie&&ge()},De=He,Ee=Ne=>{if(!(C||!ie))if(!he)ge();else{const Oe=Ne.target;if(to.has(Oe))return;const je=setTimeout(()=>{to.delete(Oe),ge()},he);to.set(Oe,je)}},wt=Ne=>{if(C||!ie||!he)return;const Oe=Ne.target,je=to.get(Oe);je&&(clearTimeout(je),to.delete(Oe))},Mt=be?ci(o,{})??h3:Fh,ft=be?Fh:ci(d,{})??Fh,Vt=[A,Mt.className,ft.className].filter(Boolean).join(" "),Bt=(N||Mt.style||ft.style)&&{...N,...Mt.style,...ft.style};return{...H,...Mt,...ft,href:X?.href,ref:u,onClick:no([O,ze]),onFocus:no([R,He]),onMouseEnter:no([I,Ee]),onMouseLeave:no([L,wt]),onTouchStart:no([F,De]),disabled:!!C,target:_,...Bt&&{style:Bt},...Vt&&{className:Vt},...C&&f3,...be&&p3,...i&&m3}}const Fh={},h3={className:"active"},f3={role:"link","aria-disabled":!0},p3={"data-status":"active","aria-current":"page"},m3={"data-transitioning":"transitioning"},to=new WeakMap,g3={rootMargin:"100px"},no=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},fO=K.forwardRef((e,t)=>{const{_asChild:n,...i}=e,{type:s,ref:l,...u}=d3(i,t),o=typeof i.children=="function"?i.children({isActive:u["data-status"]==="active"}):i.children;return n===void 0&&delete u.disabled,K.createElement(n||"a",{...u,ref:l},o)});function b3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let y3=class extends dO{constructor(t){super(t),this.useMatch=n=>lr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>lr({...n,from:this.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Gv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>$v({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qv({...n,from:this.id}),this.useLoaderData=n=>Hv({...n,from:this.id}),this.useNavigate=()=>zc({from:this.fullPath}),this.Link=$t.forwardRef((n,i)=>T.jsx(fO,{ref:i,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function v3(e){return new y3(e)}class _3 extends YB{constructor(t){super(t),this.useMatch=n=>lr({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>lr({...n,from:this.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Gv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>$v({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>qv({...n,from:this.id}),this.useLoaderData=n=>Hv({...n,from:this.id}),this.useNavigate=()=>zc({from:this.fullPath}),this.Link=$t.forwardRef((n,i)=>T.jsx(fO,{ref:i,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function S3(e){return new _3(e)}function yo(e){return typeof e=="object"?new fw(e,{silent:!0}).createRoute(e):new fw(e,{silent:!0}).createRoute}class fw{constructor(t,n){this.path=t,this.createRoute=i=>{this.silent;const s=v3(i);return s.isRoot=!1,s},this.silent=n?.silent}}class pw{constructor(t){this.useMatch=n=>lr({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>lr({from:this.options.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Gv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>$v({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>qv({...n,from:this.options.id}),this.useLoaderData=n=>Hv({...n,from:this.options.id}),this.useNavigate=()=>{const n=Nn();return zc({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function mw(e){return typeof e=="object"?new pw(e):t=>new pw({id:e,...t})}function E3(){const e=Nn(),t=K.useRef({router:e,mounted:!1}),[n,i]=K.useState(!1),{hasPendingMatches:s,isLoading:l}=hn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),u=Oh(l),o=l||n||s,d=Oh(o),h=l||s,p=Oh(h);return e.startTransition=f=>{i(!0),K.startTransition(()=>{f(),i(!1)})},K.useEffect(()=>{const f=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $i(e.latestLocation.publicHref)!==$i(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),Xl(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),Xl(()=>{u&&!l&&e.emit({type:"onLoad",...Gi(e.state)})},[u,e,l]),Xl(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...Gi(e.state)})},[h,p,e]),Xl(()=>{if(d&&!o){const f=Gi(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&kB(e)}},[o,d,e]),null}function x3(e){const t=hn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return T.jsx(zv,{getResetKey:()=>t,onCatch:(n,i)=>{if(kn(n))e.onCatch?.(n,i);else throw n},errorComponent:({error:n})=>{if(kn(n))return e.fallback?.(n);throw n},children:e.children})}function w3(){return T.jsx("p",{children:"Not Found"})}function $a(e){return T.jsx(T.Fragment,{children:e.children})}function pO(e,t,n){return t.options.notFoundComponent?T.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?T.jsx(e.options.defaultNotFoundComponent,{...n}):T.jsx(w3,{})}function C3({children:e}){const t=Nn();return t.isServer?T.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function T3(){const e=Nn();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||tv)(e.latestLocation),i=n!==tv(e.latestLocation)?n:void 0,s={storageKey:xc,shouldScrollRestoration:!0};return i&&(s.key=i),T.jsx(C3,{children:`(${tO.toString()})(${aB(JSON.stringify(s))})`})}const mO=K.memo(function({matchId:t}){const n=Nn(),i=hn({select:S=>{const v=S.matches.find(_=>_.id===t);return Lr(v),{routeId:v.routeId,ssr:v.ssr,_displayPending:v._displayPending}},structuralSharing:!0}),s=n.routesById[i.routeId],l=s.options.pendingComponent??n.options.defaultPendingComponent,u=l?T.jsx(l,{}):null,o=s.options.errorComponent??n.options.defaultErrorComponent,d=s.options.onCatch??n.options.defaultOnCatch,h=s.isRoot?s.options.notFoundComponent??n.options.notFoundRoute?.options.component:s.options.notFoundComponent,p=i.ssr===!1||i.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||p)&&(s.options.wrapInSuspense??l??(s.options.errorComponent?.preload||p))?K.Suspense:$a,g=o?zv:$a,b=h?x3:$a,x=hn({select:S=>S.loadedAt}),E=hn({select:S=>{const v=S.matches.findIndex(_=>_.id===t);return S.matches[v-1]?.routeId}}),y=s.isRoot?s.options.shellComponent??$a:$a;return T.jsxs(y,{children:[T.jsx(jc.Provider,{value:t,children:T.jsx(f,{fallback:u,children:T.jsx(g,{getResetKey:()=>x,errorComponent:o||Uc,onCatch:(S,v)=>{if(kn(S))throw S;d?.(S,v)},children:T.jsx(b,{fallback:S=>{if(!h||S.routeId&&S.routeId!==i.routeId||!S.routeId&&!s.isRoot)throw S;return K.createElement(h,S)},children:p||i._displayPending?T.jsx(JB,{fallback:u,children:T.jsx(gw,{matchId:t})}):T.jsx(gw,{matchId:t})})})})}),E===Tn&&n.options.scrollRestoration?T.jsxs(T.Fragment,{children:[T.jsx(A3,{}),T.jsx(T3,{})]}):null]})});function A3(){const e=Nn(),t=K.useRef(void 0);return T.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Gi(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gw=K.memo(function({matchId:t}){const n=Nn(),{match:i,key:s,routeId:l}=hn({select:d=>{const h=d.matches.find(x=>x.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),u=n.routesById[l],o=K.useMemo(()=>{const d=u.options.component??n.options.defaultComponent;return d?T.jsx(d,{},s):T.jsx(gO,{})},[s,u.options.component,n.options.defaultComponent]);if(i._displayPending)throw n.getMatch(i.id)?._nonReactive.displayPendingPromise;if(i._forcePending)throw n.getMatch(i.id)?._nonReactive.minPendingPromise;if(i.status==="pending"){const d=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const h=n.getMatch(i.id);if(h&&!h._nonReactive.minPendingPromise&&!n.isServer){const p=Ya();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(i.id)?._nonReactive.loadPromise}if(i.status==="notFound")return Lr(kn(i.error)),pO(n,u,i.error);if(i.status==="redirected")throw Lr(Gn(i.error)),n.getMatch(i.id)?._nonReactive.loadPromise;if(i.status==="error"){if(n.isServer){const d=(u.options.errorComponent??n.options.defaultErrorComponent)||Uc;return T.jsx(d,{error:i.error,reset:void 0,info:{componentStack:""}})}throw i.error}return o}),gO=K.memo(function(){const t=Nn(),n=K.useContext(jc),i=hn({select:h=>h.matches.find(p=>p.id===n)?.routeId}),s=t.routesById[i],l=hn({select:h=>{const f=h.matches.find(g=>g.id===n);return Lr(f),f.globalNotFound}}),u=hn({select:h=>{const p=h.matches,f=p.findIndex(g=>g.id===n);return p[f+1]?.id}}),o=t.options.defaultPendingComponent?T.jsx(t.options.defaultPendingComponent,{}):null;if(l)return pO(t,s,void 0);if(!u)return null;const d=T.jsx(mO,{matchId:u});return i===Tn?T.jsx(K.Suspense,{fallback:o,children:d}):d});function k3(){const e=Nn(),n=e.routesById[Tn].options.pendingComponent??e.options.defaultPendingComponent,i=n?T.jsx(n,{}):null,s=e.isServer||typeof document<"u"&&e.ssr?$a:K.Suspense,l=T.jsxs(s,{fallback:i,children:[!e.isServer&&T.jsx(E3,{}),T.jsx(R3,{})]});return e.options.InnerWrap?T.jsx(e.options.InnerWrap,{children:l}):l}function R3(){const e=Nn(),t=hn({select:s=>s.matches[0]?.id}),n=hn({select:s=>s.loadedAt}),i=t?T.jsx(mO,{matchId:t}):null;return T.jsx(jc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?i:T.jsx(zv,{getResetKey:()=>n,errorComponent:Uc,onCatch:s=>{s.message||s.toString()},children:i})})}const N3=e=>new O3(e);class O3 extends qB{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=yo,globalThis.createLazyFileRoute=mw):typeof window<"u"&&(window.createFileRoute=yo,window.createLazyFileRoute=mw);function I3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const i=hO(),s=T.jsx(i.Provider,{value:e,children:t});return e.options.Wrap?T.jsx(e.options.Wrap,{children:s}):s}function L3({router:e,...t}){return T.jsx(I3,{router:e,...t,children:T.jsx(k3,{})})}const Hc=S3({component:D3});function D3(){return T.jsxs(T.Fragment,{children:[T.jsx(gO,{}),null]})}const M3=yo("/")({beforeLoad:()=>{throw nO({to:"/sessions"})},component:()=>null}),bt=K.forwardRef(({className:e="",variant:t="primary",size:n="md",...i},s)=>{const l="inline-flex items-center justify-center rounded font-medium transition-colors focus-visible:outline-none disabled:opacity-50 disabled:cursor-not-allowed",u={primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-muted text-foreground hover:bg-muted/80 border border-border",ghost:"text-muted-foreground hover:text-foreground hover:bg-muted/50"},o={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base",icon:"w-10 h-10 p-0"};return T.jsx("button",{ref:s,className:`${l} ${u[t]} ${o[n]} ${e}`,...i})});bt.displayName="Button";const B3=K.forwardRef(({className:e="",children:t,...n},i)=>T.jsx("div",{ref:i,className:`bg-card text-card-foreground border border-border rounded-lg ${e}`,...n,children:t}));B3.displayName="Card";const F3=K.forwardRef(({className:e="",...t},n)=>T.jsx("input",{ref:n,className:`w-full px-3 py-2 bg-muted border border-border rounded text-foreground placeholder-muted-foreground outline-none ${e}`,...t}));F3.displayName="Input";const Vv=K.forwardRef(({className:e="",...t},n)=>T.jsx("textarea",{ref:n,className:`w-full px-3 py-2 bg-muted border border-border rounded text-foreground placeholder-muted-foreground outline-none resize-none ${e}`,...t}));Vv.displayName="Textarea";const bw=e=>{let t;const n=new Set,i=(h,p)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const g=t;t=p??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(b=>b(t,g))}},s=()=>t,o={setState:i,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(i,s,o);return o},P3=(e=>e?bw(e):bw),U3=e=>e;function j3(e,t=U3){const n=$t.useSyncExternalStore(e.subscribe,$t.useCallback(()=>t(e.getState()),[e,t]),$t.useCallback(()=>t(e.getInitialState()),[e,t]));return $t.useDebugValue(n),n}const yw=e=>{const t=P3(e),n=i=>j3(t,i);return Object.assign(n,t),n},Co=(e=>e?yw(e):yw),Wv=Co(e=>({isOpen:!1,title:"Confirm Action",message:"",confirmLabel:"Confirm",cancelLabel:"Cancel",variant:"default",onConfirm:()=>{},onCancel:void 0,openConfirmation:t=>e({isOpen:!0,title:t.title||"Confirm Action",message:t.message,confirmLabel:t.confirmLabel||"Confirm",cancelLabel:t.cancelLabel||"Cancel",variant:t.variant||"default",onConfirm:t.onConfirm,onCancel:t.onCancel}),closeConfirmation:()=>e({isOpen:!1,onConfirm:()=>{},onCancel:void 0})}));const z3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),vw=e=>{const t=H3(e);return t.charAt(0).toUpperCase()+t.slice(1)},bO=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),q3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var $3={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"};const G3=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:u,...o},d)=>K.createElement("svg",{ref:d,...$3,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:bO("lucide",s),...!l&&!q3(o)&&{"aria-hidden":"true"},...o},[...u.map(([h,p])=>K.createElement(h,p)),...Array.isArray(l)?l:[l]]));const Ae=(e,t)=>{const n=K.forwardRef(({className:i,...s},l)=>K.createElement(G3,{ref:l,iconNode:t,className:bO(`lucide-${z3(vw(e))}`,`lucide-${e}`,i),...s}));return n.displayName=vw(e),n};const V3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],W3=Ae("arrow-down",V3);const K3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Y3=Ae("arrow-left",K3);const X3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Z3=Ae("arrow-right",X3);const Q3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],J3=Ae("arrow-up",Q3);const eF=[["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"}]],yO=Ae("bot",eF);const tF=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],nF=Ae("braces",tF);const rF=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],iF=Ae("brain",rF);const aF=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vO=Ae("check",aF);const sF=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cr=Ae("chevron-down",sF);const oF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ot=Ae("chevron-right",oF);const lF=[["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"}]],dr=Ae("circle-alert",lF);const cF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],uF=Ae("circle-check",cF);const dF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],hF=Ae("circle-stop",dF);const fF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pF=Ae("circle",fF);const mF=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gF=Ae("clock",mF);const bF=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],yF=Ae("code",bF);const vF=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],_w=Ae("command",vF);const _F=[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]],Sw=Ae("diff",_F);const SF=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],_O=Ae("dollar-sign",SF);const EF=[["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"}]],xF=Ae("ellipsis-vertical",EF);const wF=[["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"}]],CF=Ae("external-link",wF);const TF=[["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"}]],AF=Ae("file-code",TF);const kF=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],RF=Ae("file-json",kF);const NF=[["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"}]],Ew=Ae("file-pen",NF);const OF=[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],IF=Ae("file-plus",OF);const LF=[["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"}]],SO=Ae("file-text",LF);const DF=[["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:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]],MF=Ae("file-type",DF);const BF=[["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:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]],FF=Ae("file-x",BF);const PF=[["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"}]],ho=Ae("file",PF);const UF=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],jF=Ae("folder-tree",UF);const zF=[["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"}]],HF=Ae("folder",zF);const qF=[["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"}]],Tc=Ae("git-branch",qF);const $F=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Ac=Ae("git-commit-horizontal",$F);const GF=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],EO=Ae("hash",GF);const VF=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],WF=Ae("image",VF);const KF=[["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"}]],xO=Ae("keyboard",KF);const YF=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],XF=Ae("list",YF);const ZF=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wO=Ae("loader-circle",ZF);const QF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],JF=Ae("message-square",QF);const e4=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],t4=Ae("octagon-x",e4);const n4=[["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"}]],xw=Ae("pencil",n4);const r4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kc=Ae("plus",r4);const i4=[["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"}]],a4=Ae("refresh-cw",i4);const s4=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],o4=Ae("rotate-ccw",s4);const l4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Kv=Ae("search",l4);const c4=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],vo=Ae("sparkles",c4);const u4=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],d4=Ae("square-check-big",u4);const h4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Za=Ae("terminal",h4);const f4=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],p4=Ae("trash-2",f4);const m4=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],g4=Ae("upload",m4);const b4=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],CO=Ae("user",b4);const y4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qc=Ae("x",y4);function v4(){const{isOpen:e,title:t,message:n,confirmLabel:i,cancelLabel:s,variant:l,onConfirm:u,onCancel:o,closeConfirmation:d}=Wv(),[h,p]=K.useState(!1);K.useEffect(()=>{e||p(!1)},[e]);const f=K.useCallback(async()=>{p(!0);try{await u(),d()}catch(x){console.error("Confirmation action failed:",x),p(!1)}},[u,d]),g=K.useCallback(()=>{o?.(),d()},[o,d]),b=x=>{x.target===x.currentTarget&&!h&&g()};return K.useEffect(()=>{const x=E=>{e&&!h&&((E.key==="Escape"||E.key==="q")&&(E.preventDefault(),g()),E.key==="Enter"&&(E.preventDefault(),f()))};if(e)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,h,f,g]),e?T.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:b,onKeyDown:x=>{(x.key==="Escape"||x.key==="q")&&!h&&(x.preventDefault(),g())},children:T.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-lg max-w-md w-full mx-4",children:[T.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[l==="destructive"&&T.jsx(dr,{className:"w-5 h-5 text-destructive"}),T.jsx("h2",{className:"text-lg font-semibold",children:t})]}),T.jsx("button",{type:"button",onClick:g,disabled:h,className:"p-1 hover:bg-muted rounded transition-colors disabled:opacity-50","aria-label":"Close",children:T.jsx(qc,{className:"w-5 h-5"})})]}),T.jsx("div",{className:"p-4",children:T.jsx("p",{className:"text-muted-foreground",children:n})}),T.jsxs("div",{className:"flex items-center justify-end gap-3 p-4 border-t border-border",children:[T.jsx("button",{type:"button",onClick:g,disabled:h,className:"px-4 py-2 text-sm font-medium rounded transition-colors hover:bg-muted disabled:opacity-50",children:s}),T.jsx("button",{type:"button",onClick:f,disabled:h,className:`px-4 py-2 text-sm font-medium rounded transition-colors disabled:opacity-50 ${l==="destructive"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:h?"Processing...":i})]})]})}):null}function Dr(e){return Array.isArray?Array.isArray(e):kO(e)==="[object Array]"}function _4(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function S4(e){return e==null?"":_4(e)}function or(e){return typeof e=="string"}function TO(e){return typeof e=="number"}function E4(e){return e===!0||e===!1||x4(e)&&kO(e)=="[object Boolean]"}function AO(e){return typeof e=="object"}function x4(e){return AO(e)&&e!==null}function An(e){return e!=null}function Ph(e){return!e.trim().length}function kO(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const w4="Incorrect 'index' type",C4=e=>`Invalid value for key ${e}`,T4=e=>`Pattern length exceeds max of ${e}.`,A4=e=>`Missing ${e} property in key`,k4=e=>`Property 'weight' in key '${e}' must be a positive integer`,ww=Object.prototype.hasOwnProperty;class R4{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(i=>{let s=RO(i);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(i=>{i.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function RO(e){let t=null,n=null,i=null,s=1,l=null;if(or(e)||Dr(e))i=e,t=Cw(e),n=iv(e);else{if(!ww.call(e,"name"))throw new Error(A4("name"));const u=e.name;if(i=u,ww.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(k4(u));t=Cw(u),n=iv(u),l=e.getFn}return{path:t,id:n,weight:s,src:i,getFn:l}}function Cw(e){return Dr(e)?e:e.split(".")}function iv(e){return Dr(e)?e.join("."):e}function N4(e,t){let n=[],i=!1;const s=(l,u,o)=>{if(An(l))if(!u[o])n.push(l);else{let d=u[o];const h=l[d];if(!An(h))return;if(o===u.length-1&&(or(h)||TO(h)||E4(h)))n.push(S4(h));else if(Dr(h)){i=!0;for(let p=0,f=h.length;p<f;p+=1)s(h[p],u,o+1)}else u.length&&s(h,u,o+1)}};return s(e,or(t)?t.split("."):t,0),i?n:n[0]}const O4={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},I4={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},L4={location:0,threshold:.6,distance:100},D4={useExtendedSearch:!1,getFn:N4,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Re={...I4,...O4,...L4,...D4};const M4=/[^ ]+/g;function B4(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(s){const l=s.match(M4).length;if(n.has(l))return n.get(l);const u=1/Math.pow(l,.5*e),o=parseFloat(Math.round(u*i)/i);return n.set(l,o),o},clear(){n.clear()}}}class Yv{constructor({getFn:t=Re.getFn,fieldNormWeight:n=Re.fieldNormWeight}={}){this.norm=B4(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,i)=>{this._keysMap[n.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,or(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();or(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,i=this.size();n<i;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!An(t)||Ph(t))return;let i={v:t,i:n,n:this.norm.get(t)};this.records.push(i)}_addObject(t,n){let i={i:n,$:{}};this.keys.forEach((s,l)=>{let u=s.getFn?s.getFn(t):this.getFn(t,s.path);if(An(u)){if(Dr(u)){let o=[];const d=[{nestedArrIndex:-1,value:u}];for(;d.length;){const{nestedArrIndex:h,value:p}=d.pop();if(An(p))if(or(p)&&!Ph(p)){let f={v:p,i:h,n:this.norm.get(p)};o.push(f)}else Dr(p)&&p.forEach((f,g)=>{d.push({nestedArrIndex:g,value:f})})}i.$[l]=o}else if(or(u)&&!Ph(u)){let o={v:u,n:this.norm.get(u)};i.$[l]=o}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function NO(e,t,{getFn:n=Re.getFn,fieldNormWeight:i=Re.fieldNormWeight}={}){const s=new Yv({getFn:n,fieldNormWeight:i});return s.setKeys(e.map(RO)),s.setSources(t),s.create(),s}function F4(e,{getFn:t=Re.getFn,fieldNormWeight:n=Re.fieldNormWeight}={}){const{keys:i,records:s}=e,l=new Yv({getFn:t,fieldNormWeight:n});return l.setKeys(i),l.setIndexRecords(s),l}function Zl(e,{errors:t=0,currentLocation:n=0,expectedLocation:i=0,distance:s=Re.distance,ignoreLocation:l=Re.ignoreLocation}={}){const u=t/e.length;if(l)return u;const o=Math.abs(i-n);return s?u+o/s:o?1:u}function P4(e=[],t=Re.minMatchCharLength){let n=[],i=-1,s=-1,l=0;for(let u=e.length;l<u;l+=1){let o=e[l];o&&i===-1?i=l:!o&&i!==-1&&(s=l-1,s-i+1>=t&&n.push([i,s]),i=-1)}return e[l-1]&&l-i>=t&&n.push([i,l-1]),n}const Ui=32;function U4(e,t,n,{location:i=Re.location,distance:s=Re.distance,threshold:l=Re.threshold,findAllMatches:u=Re.findAllMatches,minMatchCharLength:o=Re.minMatchCharLength,includeMatches:d=Re.includeMatches,ignoreLocation:h=Re.ignoreLocation}={}){if(t.length>Ui)throw new Error(T4(Ui));const p=t.length,f=e.length,g=Math.max(0,Math.min(i,f));let b=l,x=g;const E=o>1||d,y=E?Array(f):[];let S;for(;(S=e.indexOf(t,x))>-1;){let O=Zl(t,{currentLocation:S,expectedLocation:g,distance:s,ignoreLocation:h});if(b=Math.min(O,b),x=S+p,E){let R=0;for(;R<p;)y[S+R]=1,R+=1}}x=-1;let v=[],_=1,C=p+f;const N=1<<p-1;for(let O=0;O<p;O+=1){let R=0,I=C;for(;R<I;)Zl(t,{errors:O,currentLocation:g+I,expectedLocation:g,distance:s,ignoreLocation:h})<=b?R=I:C=I,I=Math.floor((C-R)/2+R);C=I;let L=Math.max(1,g-I+1),F=u?f:Math.min(g+I,f)+p,j=Array(F+2);j[F+1]=(1<<O)-1;for(let G=F;G>=L;G-=1){let V=G-1,W=n[e.charAt(V)];if(E&&(y[V]=+!!W),j[G]=(j[G+1]<<1|1)&W,O&&(j[G]|=(v[G+1]|v[G])<<1|1|v[G+1]),j[G]&N&&(_=Zl(t,{errors:O,currentLocation:V,expectedLocation:g,distance:s,ignoreLocation:h}),_<=b)){if(b=_,x=V,x<=g)break;L=Math.max(1,2*g-x)}}if(Zl(t,{errors:O+1,currentLocation:g,expectedLocation:g,distance:s,ignoreLocation:h})>b)break;v=j}const A={isMatch:x>=0,score:Math.max(.001,_)};if(E){const O=P4(y,o);O.length?d&&(A.indices=O):A.isMatch=!1}return A}function j4(e){let t={};for(let n=0,i=e.length;n<i;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<i-n-1}return t}const Rc=String.prototype.normalize?(e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(e=>e);class OO{constructor(t,{location:n=Re.location,threshold:i=Re.threshold,distance:s=Re.distance,includeMatches:l=Re.includeMatches,findAllMatches:u=Re.findAllMatches,minMatchCharLength:o=Re.minMatchCharLength,isCaseSensitive:d=Re.isCaseSensitive,ignoreDiacritics:h=Re.ignoreDiacritics,ignoreLocation:p=Re.ignoreLocation}={}){if(this.options={location:n,threshold:i,distance:s,includeMatches:l,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:d,ignoreDiacritics:h,ignoreLocation:p},t=d?t:t.toLowerCase(),t=h?Rc(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(b,x)=>{this.chunks.push({pattern:b,alphabet:j4(b),startIndex:x})},g=this.pattern.length;if(g>Ui){let b=0;const x=g%Ui,E=g-x;for(;b<E;)f(this.pattern.substr(b,Ui),b),b+=Ui;if(x){const y=g-Ui;f(this.pattern.substr(y),y)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:i,includeMatches:s}=this.options;if(t=n?t:t.toLowerCase(),t=i?Rc(t):t,this.pattern===t){let E={isMatch:!0,score:0};return s&&(E.indices=[[0,t.length-1]]),E}const{location:l,distance:u,threshold:o,findAllMatches:d,minMatchCharLength:h,ignoreLocation:p}=this.options;let f=[],g=0,b=!1;this.chunks.forEach(({pattern:E,alphabet:y,startIndex:S})=>{const{isMatch:v,score:_,indices:C}=U4(t,E,y,{location:l+S,distance:u,threshold:o,findAllMatches:d,minMatchCharLength:h,includeMatches:s,ignoreLocation:p});v&&(b=!0),g+=_,v&&C&&(f=[...f,...C])});let x={isMatch:b,score:b?g/this.chunks.length:1};return b&&s&&(x.indices=f),x}}class gi{constructor(t){this.pattern=t}static isMultiMatch(t){return Tw(t,this.multiRegex)}static isSingleMatch(t){return Tw(t,this.singleRegex)}search(){}}function Tw(e,t){const n=e.match(t);return n?n[1]:null}class z4 extends gi{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class H4 extends gi{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const i=t.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class q4 extends gi{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class $4 extends gi{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class G4 extends gi{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class V4 extends gi{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class IO extends gi{constructor(t,{location:n=Re.location,threshold:i=Re.threshold,distance:s=Re.distance,includeMatches:l=Re.includeMatches,findAllMatches:u=Re.findAllMatches,minMatchCharLength:o=Re.minMatchCharLength,isCaseSensitive:d=Re.isCaseSensitive,ignoreDiacritics:h=Re.ignoreDiacritics,ignoreLocation:p=Re.ignoreLocation}={}){super(t),this._bitapSearch=new OO(t,{location:n,threshold:i,distance:s,includeMatches:l,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:d,ignoreDiacritics:h,ignoreLocation:p})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class LO extends gi{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,i;const s=[],l=this.pattern.length;for(;(i=t.indexOf(this.pattern,n))>-1;)n=i+l,s.push([i,n-1]);const u=!!s.length;return{isMatch:u,score:u?0:1,indices:s}}}const av=[z4,LO,q4,$4,V4,G4,H4,IO],Aw=av.length,W4=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,K4="|";function Y4(e,t={}){return e.split(K4).map(n=>{let i=n.trim().split(W4).filter(l=>l&&!!l.trim()),s=[];for(let l=0,u=i.length;l<u;l+=1){const o=i[l];let d=!1,h=-1;for(;!d&&++h<Aw;){const p=av[h];let f=p.isMultiMatch(o);f&&(s.push(new p(f,t)),d=!0)}if(!d)for(h=-1;++h<Aw;){const p=av[h];let f=p.isSingleMatch(o);if(f){s.push(new p(f,t));break}}}return s})}const X4=new Set([IO.type,LO.type]);class Z4{constructor(t,{isCaseSensitive:n=Re.isCaseSensitive,ignoreDiacritics:i=Re.ignoreDiacritics,includeMatches:s=Re.includeMatches,minMatchCharLength:l=Re.minMatchCharLength,ignoreLocation:u=Re.ignoreLocation,findAllMatches:o=Re.findAllMatches,location:d=Re.location,threshold:h=Re.threshold,distance:p=Re.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:i,includeMatches:s,minMatchCharLength:l,findAllMatches:o,ignoreLocation:u,location:d,threshold:h,distance:p},t=n?t:t.toLowerCase(),t=i?Rc(t):t,this.pattern=t,this.query=Y4(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:s,ignoreDiacritics:l}=this.options;t=s?t:t.toLowerCase(),t=l?Rc(t):t;let u=0,o=[],d=0;for(let h=0,p=n.length;h<p;h+=1){const f=n[h];o.length=0,u=0;for(let g=0,b=f.length;g<b;g+=1){const x=f[g],{isMatch:E,indices:y,score:S}=x.search(t);if(E){if(u+=1,d+=S,i){const v=x.constructor.type;X4.has(v)?o=[...o,...y]:o.push(y)}}else{d=0,u=0,o.length=0;break}}if(u){let g={isMatch:!0,score:d/u};return i&&(g.indices=o),g}}return{isMatch:!1,score:1}}}const sv=[];function Q4(...e){sv.push(...e)}function ov(e,t){for(let n=0,i=sv.length;n<i;n+=1){let s=sv[n];if(s.condition(e,t))return new s(e,t)}return new OO(e,t)}const Nc={AND:"$and",OR:"$or"},lv={PATH:"$path",PATTERN:"$val"},cv=e=>!!(e[Nc.AND]||e[Nc.OR]),J4=e=>!!e[lv.PATH],eP=e=>!Dr(e)&&AO(e)&&!cv(e),kw=e=>({[Nc.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function DO(e,t,{auto:n=!0}={}){const i=s=>{let l=Object.keys(s);const u=J4(s);if(!u&&l.length>1&&!cv(s))return i(kw(s));if(eP(s)){const d=u?s[lv.PATH]:l[0],h=u?s[lv.PATTERN]:s[d];if(!or(h))throw new Error(C4(d));const p={keyId:iv(d),pattern:h};return n&&(p.searcher=ov(h,t)),p}let o={children:[],operator:l[0]};return l.forEach(d=>{const h=s[d];Dr(h)&&h.forEach(p=>{o.children.push(i(p))})}),o};return cv(e)||(e=kw(e)),i(e)}function tP(e,{ignoreFieldNorm:t=Re.ignoreFieldNorm}){e.forEach(n=>{let i=1;n.matches.forEach(({key:s,norm:l,score:u})=>{const o=s?s.weight:null;i*=Math.pow(u===0&&o?Number.EPSILON:u,(o||1)*(t?1:l))}),n.score=i})}function nP(e,t){const n=e.matches;t.matches=[],An(n)&&n.forEach(i=>{if(!An(i.indices)||!i.indices.length)return;const{indices:s,value:l}=i;let u={indices:s,value:l};i.key&&(u.key=i.key.src),i.idx>-1&&(u.refIndex=i.idx),t.matches.push(u)})}function rP(e,t){t.score=e.score}function iP(e,t,{includeMatches:n=Re.includeMatches,includeScore:i=Re.includeScore}={}){const s=[];return n&&s.push(nP),i&&s.push(rP),e.map(l=>{const{idx:u}=l,o={item:t[u],refIndex:u};return s.length&&s.forEach(d=>{d(l,o)}),o})}class bi{constructor(t,n={},i){this.options={...Re,...n},this.options.useExtendedSearch,this._keyStore=new R4(this.options.keys),this.setCollection(t,i)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Yv))throw new Error(w4);this._myIndex=n||NO(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){An(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let i=0,s=this._docs.length;i<s;i+=1){const l=this._docs[i];t(l,i)&&(this.removeAt(i),i-=1,s-=1,n.push(l))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:i,includeScore:s,shouldSort:l,sortFn:u,ignoreFieldNorm:o}=this.options;let d=or(t)?or(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return tP(d,{ignoreFieldNorm:o}),l&&d.sort(u),TO(n)&&n>-1&&(d=d.slice(0,n)),iP(d,this._docs,{includeMatches:i,includeScore:s})}_searchStringList(t){const n=ov(t,this.options),{records:i}=this._myIndex,s=[];return i.forEach(({v:l,i:u,n:o})=>{if(!An(l))return;const{isMatch:d,score:h,indices:p}=n.searchIn(l);d&&s.push({item:l,idx:u,matches:[{score:h,value:l,norm:o,indices:p}]})}),s}_searchLogical(t){const n=DO(t,this.options),i=(o,d,h)=>{if(!o.children){const{keyId:f,searcher:g}=o,b=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(d,f),searcher:g});return b&&b.length?[{idx:h,item:d,matches:b}]:[]}const p=[];for(let f=0,g=o.children.length;f<g;f+=1){const b=o.children[f],x=i(b,d,h);if(x.length)p.push(...x);else if(o.operator===Nc.AND)return[]}return p},s=this._myIndex.records,l={},u=[];return s.forEach(({$:o,i:d})=>{if(An(o)){let h=i(n,o,d);h.length&&(l[d]||(l[d]={idx:d,item:o,matches:[]},u.push(l[d])),h.forEach(({matches:p})=>{l[d].matches.push(...p)}))}}),u}_searchObjectList(t){const n=ov(t,this.options),{keys:i,records:s}=this._myIndex,l=[];return s.forEach(({$:u,i:o})=>{if(!An(u))return;let d=[];i.forEach((h,p)=>{d.push(...this._findMatches({key:h,value:u[p],searcher:n}))}),d.length&&l.push({idx:o,item:u,matches:d})}),l}_findMatches({key:t,value:n,searcher:i}){if(!An(n))return[];let s=[];if(Dr(n))n.forEach(({v:l,i:u,n:o})=>{if(!An(l))return;const{isMatch:d,score:h,indices:p}=i.searchIn(l);d&&s.push({score:h,key:t,value:l,idx:u,norm:o,indices:p})});else{const{v:l,n:u}=n,{isMatch:o,score:d,indices:h}=i.searchIn(l);o&&s.push({score:d,key:t,value:l,norm:u,indices:h})}return s}}bi.version="7.1.0";bi.createIndex=NO;bi.parseIndex=F4;bi.config=Re;bi.parseQuery=DO;Q4(Z4);function aP(e){switch(e.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"cjs":case"py":case"rb":case"go":case"rs":case"java":case"c":case"cpp":case"h":case"hpp":return AF;case"json":case"yaml":case"yml":case"toml":return RF;case"md":case"txt":case"log":return SO;case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return WF;case"css":case"scss":case"sass":case"less":return nF;case"html":case"xml":return MF;default:return ho}}function sP(e,t){const n=t.get(e);return n?{added:{icon:kc,label:"Added",className:"text-green-500"},modified:{icon:xw,label:"Modified",className:"text-yellow-500"},untracked:{icon:kc,label:"Untracked",className:"text-blue-500"}}[n]||{icon:xw,label:"Modified",className:"text-yellow-500"}:null}function oP({files:e,changedFiles:t=[],query:n,selectedIndex:i,onSelect:s,onEnterSelect:l,onClose:u}){const o=K.useMemo(()=>new Map(t?.map(p=>[p.path,p.status])||[]),[t]),d=K.useMemo(()=>new bi(e,{threshold:.4,distance:100,ignoreLocation:!0,includeMatches:!0}),[e]),h=K.useMemo(()=>{if(!n)return e.slice(0,20);const p=d.search(n).map(f=>f.item);return p.sort((f,g)=>{const b=o.has(f),x=o.has(g);return b&&!x?-1:!b&&x?1:0}),p.slice(0,20)},[d,n,e,o]);return K.useEffect(()=>{document.getElementById(`file-item-${i}`)?.scrollIntoView({block:"nearest"})},[i]),K.useEffect(()=>{l(h[i])},[h,i,l]),K.useEffect(()=>{const p=f=>{f.target.closest("[data-file-mention-popup]")||u()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[u]),h.length===0?T.jsx("div",{"data-file-mention-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg z-50 p-3",children:T.jsx("span",{className:"text-muted-foreground text-sm",children:"No files found"})}):T.jsx("div",{"data-file-mention-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg max-h-[300px] overflow-y-auto z-50",children:h.map((p,f)=>T.jsx("button",{type:"button",id:`file-item-${f}`,onMouseDown:g=>{g.preventDefault(),s(p)},className:`w-full text-left px-3 py-2 hover:bg-accent ${f===i?"bg-accent":""}`,children:T.jsxs("div",{className:"flex items-center gap-2 w-full",children:[(()=>{const g=aP(p);return T.jsx(g,{className:"w-4 h-4 flex-shrink-0 text-muted-foreground"})})(),T.jsx("span",{className:"font-mono text-sm flex-1 truncate",children:p}),(()=>{const g=sP(p,o);return g&&T.jsx(g.icon,{className:`w-3.5 h-3.5 flex-shrink-0 ${g.className}`,title:g.label})})()]})},p))})}const Rw=[{id:"models",label:"/models",description:"Open model selector",icon:vo},{id:"agents",label:"/agents",description:"Open agent selector",icon:Za},{id:"new",label:"/new",description:"Create new session",icon:kc},{id:"help",label:"/help",description:"Show keyboard shortcuts and help",icon:xO},{id:"vim",label:"/vim",description:"Toggle Vim mode keybindings",icon:yF}];function lP(e){if(!e)return Rw;const t=e.toLowerCase(),n=[];for(const i of Rw){const s=i.label.toLowerCase().includes(t),l=i.description.toLowerCase().includes(t);if(s||l){const u=s?10:5;n.push({...i,matchScore:u})}}return n.sort((i,s)=>{const l=(s.matchScore||0)-(i.matchScore||0);return l!==0?l:i.label.localeCompare(s.label)})}function cP({query:e,selectedIndex:t,onSelect:n,onEnterSelect:i,onClose:s}){const l=K.useMemo(()=>lP(e),[e]);return K.useEffect(()=>{document.getElementById(`command-item-${t}`)?.scrollIntoView({block:"nearest"})},[t]),K.useEffect(()=>{i(l[t]?.id)},[l,t,i]),K.useEffect(()=>{const u=o=>{o.target.closest("[data-command-popup]")||s()};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]),l.length===0?T.jsx("div",{"data-command-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg z-50 p-3",children:T.jsx("span",{className:"text-muted-foreground text-sm",children:"No commands found"})}):T.jsx("div",{"data-command-popup":!0,className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg max-h-[300px] overflow-y-auto z-50",children:l.map((u,o)=>{const d=u.icon;return T.jsx("button",{type:"button",id:`command-item-${o}`,onMouseDown:h=>{h.preventDefault(),n(u.id)},className:`w-full text-left px-3 py-2 hover:bg-accent ${o===t?"bg-accent":""}`,children:T.jsxs("div",{className:"flex items-center gap-3 w-full",children:[T.jsx(d,{className:"w-4 h-4 flex-shrink-0 text-primary"}),T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx("div",{className:"font-mono text-sm font-medium text-foreground",children:u.label}),T.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.description})]})]})},u.id)})})}const uP={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function Xv({isOpen:e,onClose:t,title:n,children:i,showCloseButton:s=!0,closeOnBackdropClick:l=!0,closeOnEscape:u=!0,maxWidth:o="md"}){if(K.useEffect(()=>{if(!e||!u)return;const h=p=>{(p.key==="Escape"||p.key==="q")&&(p.preventDefault(),p.stopPropagation(),t())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,u,t]),K.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const d=h=>{l&&h.target===h.currentTarget&&t()};return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[9999] cursor-default",onClick:d,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&d(h)},"aria-label":"Close modal"}),T.jsx("div",{className:`fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[9999] w-full ${uP[o]} px-4`,children:T.jsxs("div",{className:"bg-background border border-border rounded-lg shadow-lg",children:[(n||s)&&T.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[n&&T.jsx("div",{className:"text-lg font-semibold text-foreground",children:n}),s&&T.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground hover:text-foreground transition-colors ml-auto","aria-label":"Close",children:T.jsx(qc,{className:"h-5 w-5"})})]}),T.jsx("div",{className:"p-4",children:i})]})})]})}const dP=[{keys:["Ctrl","H"],description:"Navigate to left sidebar (sessions)",category:"Navigation"},{keys:["Ctrl","L"],description:"Navigate to right sidebar (git)",category:"Navigation"},{keys:["Ctrl","/"],description:"Toggle left sidebar collapse/expand",category:"Navigation"},{keys:["Ctrl","\\"],description:"Toggle right sidebar collapse/expand",category:"Navigation"},{keys:["Ctrl","N"],description:"Create new session",category:"Navigation"},{keys:["ESC"],description:"Close sidebar and return to center",category:"Navigation"},{keys:["J"],description:"Navigate to next item (in focused list)",category:"List Navigation"},{keys:["K"],description:"Navigate to previous item (in focused list)",category:"List Navigation"},{keys:["Enter"],description:"Select focused item and return to input",category:"List Navigation"},{keys:["Space"],description:"Toggle stage/unstage for focused file (git panel)",category:"Git Operations"},{keys:["A"],description:"Stage all unstaged files",category:"Git Operations"},{keys:["U"],description:"Unstage all staged files",category:"Git Operations"},{keys:["C"],description:"Open commit modal (if files are staged)",category:"Git Operations"},{keys:["Tab"],description:"Toggle plan mode",category:"Chat"},{keys:["Enter"],description:"Send message",category:"Chat"},{keys:["Shift","Enter"],description:"New line in message",category:"Chat"},{keys:["@"],description:"Mention file (opens file picker)",category:"Chat"},{keys:["/"],description:"Slash command (opens command menu)",category:"Chat"}],hP=[{keys:["i"],description:"Enter insert mode at cursor (vim mode)",category:"Vim Mode"},{keys:["a"],description:"Enter insert mode after cursor (vim mode)",category:"Vim Mode"},{keys:["I"],description:"Enter insert mode at line start (vim mode)",category:"Vim Mode"},{keys:["A"],description:"Enter insert mode at line end (vim mode)",category:"Vim Mode"},{keys:["o"],description:"New line below and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["O"],description:"New line above and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["ESC"],description:"Return to normal mode (vim mode)",category:"Vim Mode"},{keys:["Enter"],description:"Send message in normal mode (vim mode)",category:"Vim Mode"},{keys:["w"],description:"Jump to next word start (vim mode)",category:"Vim Mode"},{keys:["e"],description:"Jump to next word end (vim mode)",category:"Vim Mode"},{keys:["b"],description:"Jump to previous word start (vim mode)",category:"Vim Mode"},{keys:["x"],description:"Delete character under cursor (vim mode)",category:"Vim Mode"},{keys:["s"],description:"Delete character and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["S"],description:"Delete line and enter insert mode (vim mode)",category:"Vim Mode"},{keys:["f","{char}"],description:"Find and jump to next character on line (vim mode)",category:"Vim Mode"},{keys:["d","d"],description:"Delete current line (vim mode)",category:"Vim Mode"},{keys:["0"],description:"Jump to line start (vim mode)",category:"Vim Mode"},{keys:["$"],description:"Jump to line end (vim mode)",category:"Vim Mode"}],fP=[{command:"/models",description:"Open model selector"},{command:"/agents",description:"Open agent selector"},{command:"/new",description:"Create new session"},{command:"/help",description:"Show keyboard shortcuts and help (this modal)"}];function pP(e){const t={};for(const n of e)t[n.category]||(t[n.category]=[]),t[n.category].push(n);return t}function mP({isOpen:e,onClose:t}){const n=[...dP,...hP],i=pP(n),s=K.useRef(null),l=K.useRef(null);return K.useEffect(()=>{e?(l.current=document.activeElement,l.current&&l.current.blur()):l.current&&(l.current.focus(),l.current=null)},[e]),K.useEffect(()=>{if(!e)return;const u=o=>{const d=o.target;if(!(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable))if(o.key==="j"){o.preventDefault();const p=s.current;p&&p.scrollBy({top:100,behavior:"smooth"})}else if(o.key==="k"){o.preventDefault();const p=s.current;p&&p.scrollBy({top:-100,behavior:"smooth"})}else o.key==="Enter"&&(o.preventDefault(),t())};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,t]),T.jsx(Xv,{isOpen:e,onClose:t,title:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(xO,{className:"w-5 h-5"}),T.jsx("span",{children:"Keyboard Shortcuts & Help"})]}),maxWidth:"2xl",closeOnEscape:!0,closeOnBackdropClick:!0,children:T.jsxs("div",{ref:s,className:"space-y-6 max-h-[70vh] overflow-y-auto",children:[Object.entries(i).map(([u,o])=>T.jsxs("div",{children:[T.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[T.jsx(_w,{className:"w-4 h-4"}),u]}),T.jsx("div",{className:"space-y-2",children:o.map((d,h)=>T.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-accent/50 hover:bg-accent transition-colors",children:[T.jsx("span",{className:"text-sm text-foreground",children:d.description}),T.jsx("div",{className:"flex items-center gap-1",children:d.keys.map(p=>T.jsxs("span",{className:"flex items-center gap-1",children:[T.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-background border border-border rounded shadow-sm",children:p}),d.keys.indexOf(p)<d.keys.length-1&&T.jsx("span",{className:"text-muted-foreground",children:"+"})]},p))})]},`${u}-${d.description}`))})]},u)),T.jsxs("div",{children:[T.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[T.jsx(_w,{className:"w-4 h-4"}),"Slash Commands"]}),T.jsx("div",{className:"space-y-2",children:fP.map((u,o)=>T.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-accent/50 hover:bg-accent transition-colors",children:[T.jsx("span",{className:"text-sm text-foreground",children:u.description}),T.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-background border border-border rounded shadow-sm",children:u.command})]},u.command))})]}),T.jsx("div",{className:"pt-4 border-t border-border",children:T.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.jsx("strong",{children:"Tip:"})," Shortcuts are disabled when typing in input fields. Press ",T.jsx("kbd",{className:"text-xs",children:"ESC"})," to close popups and return focus to chat input."]})})]})})}var Nw;(function(e){e.OPENAI="openai",e.ANTHROPIC="anthropic",e.GOOGLE="google",e.OPENROUTER="openrouter",e.OPENCODE="opencode",e.ZAI="zai",e.SOLFORGE="solforge"})(Nw||(Nw={}));function MO(e,t){return function(){return e.apply(t,arguments)}}const{toString:gP}=Object.prototype,{getPrototypeOf:Zv}=Object,{iterator:$c,toStringTag:BO}=Symbol,Gc=(e=>t=>{const n=gP.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zn=e=>(e=e.toLowerCase(),t=>Gc(t)===e),Vc=e=>t=>typeof t===e,{isArray:ts}=Array,Qa=Vc("undefined");function To(e){return e!==null&&!Qa(e)&&e.constructor!==null&&!Qa(e.constructor)&&fn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const FO=Zn("ArrayBuffer");function bP(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&FO(e.buffer),t}const yP=Vc("string"),fn=Vc("function"),PO=Vc("number"),Ao=e=>e!==null&&typeof e=="object",vP=e=>e===!0||e===!1,oc=e=>{if(Gc(e)!=="object")return!1;const t=Zv(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(BO in e)&&!($c in e)},_P=e=>{if(!Ao(e)||To(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},SP=Zn("Date"),EP=Zn("File"),xP=Zn("Blob"),wP=Zn("FileList"),CP=e=>Ao(e)&&fn(e.pipe),TP=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fn(e.append)&&((t=Gc(e))==="formdata"||t==="object"&&fn(e.toString)&&e.toString()==="[object FormData]"))},AP=Zn("URLSearchParams"),[kP,RP,NP,OP]=["ReadableStream","Request","Response","Headers"].map(Zn),IP=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ko(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),ts(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{if(To(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),u=l.length;let o;for(i=0;i<u;i++)o=l[i],t.call(null,e[o],o,e)}}function UO(e,t){if(To(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,s;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const Hi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jO=e=>!Qa(e)&&e!==Hi;function uv(){const{caseless:e,skipUndefined:t}=jO(this)&&this||{},n={},i=(s,l)=>{const u=e&&UO(n,l)||l;oc(n[u])&&oc(s)?n[u]=uv(n[u],s):oc(s)?n[u]=uv({},s):ts(s)?n[u]=s.slice():(!t||!Qa(s))&&(n[u]=s)};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&ko(arguments[s],i);return n}const LP=(e,t,n,{allOwnKeys:i}={})=>(ko(t,(s,l)=>{n&&fn(s)?e[l]=MO(s,n):e[l]=s},{allOwnKeys:i}),e),DP=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),MP=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},BP=(e,t,n,i)=>{let s,l,u;const o={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)u=s[l],(!i||i(u,e,t))&&!o[u]&&(t[u]=e[u],o[u]=!0);e=n!==!1&&Zv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},FP=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},PP=e=>{if(!e)return null;if(ts(e))return e;let t=e.length;if(!PO(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},UP=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zv(Uint8Array)),jP=(e,t)=>{const i=(e&&e[$c]).call(e);let s;for(;(s=i.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},zP=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},HP=Zn("HTMLFormElement"),qP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),Ow=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),$P=Zn("RegExp"),zO=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};ko(n,(s,l)=>{let u;(u=t(s,l,e))!==!1&&(i[l]=u||s)}),Object.defineProperties(e,i)},GP=e=>{zO(e,(t,n)=>{if(fn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(fn(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},VP=(e,t)=>{const n={},i=s=>{s.forEach(l=>{n[l]=!0})};return ts(e)?i(e):i(String(e).split(t)),n},WP=()=>{},KP=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function YP(e){return!!(e&&fn(e.append)&&e[BO]==="FormData"&&e[$c])}const XP=e=>{const t=new Array(10),n=(i,s)=>{if(Ao(i)){if(t.indexOf(i)>=0)return;if(To(i))return i;if(!("toJSON"in i)){t[s]=i;const l=ts(i)?[]:{};return ko(i,(u,o)=>{const d=n(u,s+1);!Qa(d)&&(l[o]=d)}),t[s]=void 0,l}}return i};return n(e,0)},ZP=Zn("AsyncFunction"),QP=e=>e&&(Ao(e)||fn(e))&&fn(e.then)&&fn(e.catch),HO=((e,t)=>e?setImmediate:t?((n,i)=>(Hi.addEventListener("message",({source:s,data:l})=>{s===Hi&&l===n&&i.length&&i.shift()()},!1),s=>{i.push(s),Hi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",fn(Hi.postMessage)),JP=typeof queueMicrotask<"u"?queueMicrotask.bind(Hi):typeof process<"u"&&process.nextTick||HO,eU=e=>e!=null&&fn(e[$c]),se={isArray:ts,isArrayBuffer:FO,isBuffer:To,isFormData:TP,isArrayBufferView:bP,isString:yP,isNumber:PO,isBoolean:vP,isObject:Ao,isPlainObject:oc,isEmptyObject:_P,isReadableStream:kP,isRequest:RP,isResponse:NP,isHeaders:OP,isUndefined:Qa,isDate:SP,isFile:EP,isBlob:xP,isRegExp:$P,isFunction:fn,isStream:CP,isURLSearchParams:AP,isTypedArray:UP,isFileList:wP,forEach:ko,merge:uv,extend:LP,trim:IP,stripBOM:DP,inherits:MP,toFlatObject:BP,kindOf:Gc,kindOfTest:Zn,endsWith:FP,toArray:PP,forEachEntry:jP,matchAll:zP,isHTMLForm:HP,hasOwnProperty:Ow,hasOwnProp:Ow,reduceDescriptors:zO,freezeMethods:GP,toObjectSet:VP,toCamelCase:qP,noop:WP,toFiniteNumber:KP,findKey:UO,global:Hi,isContextDefined:jO,isSpecCompliantForm:YP,toJSONObject:XP,isAsyncFn:ZP,isThenable:QP,setImmediate:HO,asap:JP,isIterable:eU};function Be(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}se.inherits(Be,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:se.toJSONObject(this.config),code:this.code,status:this.status}}});const qO=Be.prototype,$O={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{$O[e]={value:e}});Object.defineProperties(Be,$O);Object.defineProperty(qO,"isAxiosError",{value:!0});Be.from=(e,t,n,i,s,l)=>{const u=Object.create(qO);se.toFlatObject(e,u,function(p){return p!==Error.prototype},h=>h!=="isAxiosError");const o=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Be.call(u,o,d,n,i,s),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",l&&Object.assign(u,l),u};const tU=null;function dv(e){return se.isPlainObject(e)||se.isArray(e)}function GO(e){return se.endsWith(e,"[]")?e.slice(0,-2):e}function Iw(e,t,n){return e?e.concat(t).map(function(s,l){return s=GO(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function nU(e){return se.isArray(e)&&!e.some(dv)}const rU=se.toFlatObject(se,{},null,function(t){return/^is[A-Z]/.test(t)});function Wc(e,t,n){if(!se.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=se.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,y){return!se.isUndefined(y[E])});const i=n.metaTokens,s=n.visitor||p,l=n.dots,u=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&se.isSpecCompliantForm(t);if(!se.isFunction(s))throw new TypeError("visitor must be a function");function h(x){if(x===null)return"";if(se.isDate(x))return x.toISOString();if(se.isBoolean(x))return x.toString();if(!d&&se.isBlob(x))throw new Be("Blob is not supported. Use a Buffer instead.");return se.isArrayBuffer(x)||se.isTypedArray(x)?d&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function p(x,E,y){let S=x;if(x&&!y&&typeof x=="object"){if(se.endsWith(E,"{}"))E=i?E:E.slice(0,-2),x=JSON.stringify(x);else if(se.isArray(x)&&nU(x)||(se.isFileList(x)||se.endsWith(E,"[]"))&&(S=se.toArray(x)))return E=GO(E),S.forEach(function(_,C){!(se.isUndefined(_)||_===null)&&t.append(u===!0?Iw([E],C,l):u===null?E:E+"[]",h(_))}),!1}return dv(x)?!0:(t.append(Iw(y,E,l),h(x)),!1)}const f=[],g=Object.assign(rU,{defaultVisitor:p,convertValue:h,isVisitable:dv});function b(x,E){if(!se.isUndefined(x)){if(f.indexOf(x)!==-1)throw Error("Circular reference detected in "+E.join("."));f.push(x),se.forEach(x,function(S,v){(!(se.isUndefined(S)||S===null)&&s.call(t,S,se.isString(v)?v.trim():v,E,g))===!0&&b(S,E?E.concat(v):[v])}),f.pop()}}if(!se.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Lw(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Qv(e,t){this._pairs=[],e&&Wc(e,this,t)}const VO=Qv.prototype;VO.append=function(t,n){this._pairs.push([t,n])};VO.toString=function(t){const n=t?function(i){return t.call(this,i,Lw)}:Lw;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function iU(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function WO(e,t,n){if(!t)return e;const i=n&&n.encode||iU;se.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=se.isURLSearchParams(t)?t.toString():new Qv(t,n).toString(i),l){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class Dw{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){se.forEach(this.handlers,function(i){i!==null&&t(i)})}}const KO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},aU=typeof URLSearchParams<"u"?URLSearchParams:Qv,sU=typeof FormData<"u"?FormData:null,oU=typeof Blob<"u"?Blob:null,lU={isBrowser:!0,classes:{URLSearchParams:aU,FormData:sU,Blob:oU},protocols:["http","https","file","blob","url","data"]},Jv=typeof window<"u"&&typeof document<"u",hv=typeof navigator=="object"&&navigator||void 0,cU=Jv&&(!hv||["ReactNative","NativeScript","NS"].indexOf(hv.product)<0),uU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dU=Jv&&window.location.href||"http://localhost",hU=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jv,hasStandardBrowserEnv:cU,hasStandardBrowserWebWorkerEnv:uU,navigator:hv,origin:dU},Symbol.toStringTag,{value:"Module"})),Yt={...hU,...lU};function fU(e,t){return Wc(e,new Yt.classes.URLSearchParams,{visitor:function(n,i,s,l){return Yt.isNode&&se.isBuffer(n)?(this.append(i,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function pU(e){return se.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function mU(e){const t={},n=Object.keys(e);let i;const s=n.length;let l;for(i=0;i<s;i++)l=n[i],t[l]=e[l];return t}function YO(e){function t(n,i,s,l){let u=n[l++];if(u==="__proto__")return!0;const o=Number.isFinite(+u),d=l>=n.length;return u=!u&&se.isArray(s)?s.length:u,d?(se.hasOwnProp(s,u)?s[u]=[s[u],i]:s[u]=i,!o):((!s[u]||!se.isObject(s[u]))&&(s[u]=[]),t(n,i,s[u],l)&&se.isArray(s[u])&&(s[u]=mU(s[u])),!o)}if(se.isFormData(e)&&se.isFunction(e.entries)){const n={};return se.forEachEntry(e,(i,s)=>{t(pU(i),s,n,0)}),n}return null}function gU(e,t,n){if(se.isString(e))try{return(t||JSON.parse)(e),se.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Ro={transitional:KO,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,l=se.isObject(t);if(l&&se.isHTMLForm(t)&&(t=new FormData(t)),se.isFormData(t))return s?JSON.stringify(YO(t)):t;if(se.isArrayBuffer(t)||se.isBuffer(t)||se.isStream(t)||se.isFile(t)||se.isBlob(t)||se.isReadableStream(t))return t;if(se.isArrayBufferView(t))return t.buffer;if(se.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(l){if(i.indexOf("application/x-www-form-urlencoded")>-1)return fU(t,this.formSerializer).toString();if((o=se.isFileList(t))||i.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Wc(o?{"files[]":t}:t,d&&new d,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),gU(t)):t}],transformResponse:[function(t){const n=this.transitional||Ro.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(se.isResponse(t)||se.isReadableStream(t))return t;if(t&&se.isString(t)&&(i&&!this.responseType||s)){const u=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(o){if(u)throw o.name==="SyntaxError"?Be.from(o,Be.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};se.forEach(["delete","get","head","post","put","patch"],e=>{Ro.headers[e]={}});const bU=se.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),yU=e=>{const t={};let n,i,s;return e&&e.split(`
|
|
10
10
|
`).forEach(function(u){s=u.indexOf(":"),n=u.substring(0,s).trim().toLowerCase(),i=u.substring(s+1).trim(),!(!n||t[n]&&bU[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},Mw=Symbol("internals");function ro(e){return e&&String(e).trim().toLowerCase()}function lc(e){return e===!1||e==null?e:se.isArray(e)?e.map(lc):String(e)}function vU(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const _U=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Uh(e,t,n,i,s){if(se.isFunction(i))return i.call(this,t,n);if(s&&(t=n),!!se.isString(t)){if(se.isString(i))return t.indexOf(i)!==-1;if(se.isRegExp(i))return i.test(t)}}function SU(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function EU(e,t){const n=se.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(s,l,u){return this[i].call(this,t,s,l,u)},configurable:!0})})}let pn=class{constructor(t){t&&this.set(t)}set(t,n,i){const s=this;function l(o,d,h){const p=ro(d);if(!p)throw new Error("header name must be a non-empty string");const f=se.findKey(s,p);(!f||s[f]===void 0||h===!0||h===void 0&&s[f]!==!1)&&(s[f||d]=lc(o))}const u=(o,d)=>se.forEach(o,(h,p)=>l(h,p,d));if(se.isPlainObject(t)||t instanceof this.constructor)u(t,n);else if(se.isString(t)&&(t=t.trim())&&!_U(t))u(yU(t),n);else if(se.isObject(t)&&se.isIterable(t)){let o={},d,h;for(const p of t){if(!se.isArray(p))throw TypeError("Object iterator must return a key-value pair");o[h=p[0]]=(d=o[h])?se.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}u(o,n)}else t!=null&&l(n,t,i);return this}get(t,n){if(t=ro(t),t){const i=se.findKey(this,t);if(i){const s=this[i];if(!n)return s;if(n===!0)return vU(s);if(se.isFunction(n))return n.call(this,s,i);if(se.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ro(t),t){const i=se.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Uh(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let s=!1;function l(u){if(u=ro(u),u){const o=se.findKey(i,u);o&&(!n||Uh(i,i[o],o,n))&&(delete i[o],s=!0)}}return se.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const l=n[i];(!t||Uh(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,i={};return se.forEach(this,(s,l)=>{const u=se.findKey(i,l);if(u){n[u]=lc(s),delete n[l];return}const o=t?SU(l):String(l).trim();o!==l&&delete n[l],n[o]=lc(s),i[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return se.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=t&&se.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
11
11
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(s=>i.set(s)),i}static accessor(t){const i=(this[Mw]=this[Mw]={accessors:{}}).accessors,s=this.prototype;function l(u){const o=ro(u);i[o]||(EU(s,u),i[o]=!0)}return se.isArray(t)?t.forEach(l):l(t),this}};pn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);se.reduceDescriptors(pn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});se.freezeMethods(pn);function jh(e,t){const n=this||Ro,i=t||n,s=pn.from(i.headers);let l=i.data;return se.forEach(e,function(o){l=o.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function XO(e){return!!(e&&e.__CANCEL__)}function ns(e,t,n){Be.call(this,e??"canceled",Be.ERR_CANCELED,t,n),this.name="CanceledError"}se.inherits(ns,Be,{__CANCEL__:!0});function ZO(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new Be("Request failed with status code "+n.status,[Be.ERR_BAD_REQUEST,Be.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xU(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function wU(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s=0,l=0,u;return t=t!==void 0?t:1e3,function(d){const h=Date.now(),p=i[l];u||(u=h),n[s]=d,i[s]=h;let f=l,g=0;for(;f!==s;)g+=n[f++],f=f%e;if(s=(s+1)%e,s===l&&(l=(l+1)%e),h-u<t)return;const b=p&&h-p;return b?Math.round(g*1e3/b):void 0}}function CU(e,t){let n=0,i=1e3/t,s,l;const u=(h,p=Date.now())=>{n=p,s=null,l&&(clearTimeout(l),l=null),e(...h)};return[(...h)=>{const p=Date.now(),f=p-n;f>=i?u(h,p):(s=h,l||(l=setTimeout(()=>{l=null,u(s)},i-f)))},()=>s&&u(s)]}const Oc=(e,t,n=3)=>{let i=0;const s=wU(50,250);return CU(l=>{const u=l.loaded,o=l.lengthComputable?l.total:void 0,d=u-i,h=s(d),p=u<=o;i=u;const f={loaded:u,total:o,progress:o?u/o:void 0,bytes:d,rate:h||void 0,estimated:h&&o&&p?(o-u)/h:void 0,event:l,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(f)},n)},Bw=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},Fw=e=>(...t)=>se.asap(()=>e(...t)),TU=Yt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Yt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Yt.origin),Yt.navigator&&/(msie|trident)/i.test(Yt.navigator.userAgent)):()=>!0,AU=Yt.hasStandardBrowserEnv?{write(e,t,n,i,s,l,u){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];se.isNumber(n)&&o.push(`expires=${new Date(n).toUTCString()}`),se.isString(i)&&o.push(`path=${i}`),se.isString(s)&&o.push(`domain=${s}`),l===!0&&o.push("secure"),se.isString(u)&&o.push(`SameSite=${u}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function kU(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function RU(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function QO(e,t,n){let i=!kU(t);return e&&(i||n==!1)?RU(e,t):t}const Pw=e=>e instanceof pn?{...e}:e;function Zi(e,t){t=t||{};const n={};function i(h,p,f,g){return se.isPlainObject(h)&&se.isPlainObject(p)?se.merge.call({caseless:g},h,p):se.isPlainObject(p)?se.merge({},p):se.isArray(p)?p.slice():p}function s(h,p,f,g){if(se.isUndefined(p)){if(!se.isUndefined(h))return i(void 0,h,f,g)}else return i(h,p,f,g)}function l(h,p){if(!se.isUndefined(p))return i(void 0,p)}function u(h,p){if(se.isUndefined(p)){if(!se.isUndefined(h))return i(void 0,h)}else return i(void 0,p)}function o(h,p,f){if(f in t)return i(h,p);if(f in e)return i(void 0,h)}const d={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:o,headers:(h,p,f)=>s(Pw(h),Pw(p),f,!0)};return se.forEach(Object.keys({...e,...t}),function(p){const f=d[p]||s,g=f(e[p],t[p],p);se.isUndefined(g)&&f!==o||(n[p]=g)}),n}const JO=e=>{const t=Zi({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:l,headers:u,auth:o}=t;if(t.headers=u=pn.from(u),t.url=WO(QO(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&u.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),se.isFormData(n)){if(Yt.hasStandardBrowserEnv||Yt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(se.isFunction(n.getHeaders)){const d=n.getHeaders(),h=["content-type","content-length"];Object.entries(d).forEach(([p,f])=>{h.includes(p.toLowerCase())&&u.set(p,f)})}}if(Yt.hasStandardBrowserEnv&&(i&&se.isFunction(i)&&(i=i(t)),i||i!==!1&&TU(t.url))){const d=s&&l&&AU.read(l);d&&u.set(s,d)}return t},NU=typeof XMLHttpRequest<"u",OU=NU&&function(e){return new Promise(function(n,i){const s=JO(e);let l=s.data;const u=pn.from(s.headers).normalize();let{responseType:o,onUploadProgress:d,onDownloadProgress:h}=s,p,f,g,b,x;function E(){b&&b(),x&&x(),s.cancelToken&&s.cancelToken.unsubscribe(p),s.signal&&s.signal.removeEventListener("abort",p)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function S(){if(!y)return;const _=pn.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),N={data:!o||o==="text"||o==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:e,request:y};ZO(function(O){n(O),E()},function(O){i(O),E()},N),y=null}"onloadend"in y?y.onloadend=S:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(S)},y.onabort=function(){y&&(i(new Be("Request aborted",Be.ECONNABORTED,e,y)),y=null)},y.onerror=function(C){const N=C&&C.message?C.message:"Network Error",A=new Be(N,Be.ERR_NETWORK,e,y);A.event=C||null,i(A),y=null},y.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||KO;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),i(new Be(C,N.clarifyTimeoutError?Be.ETIMEDOUT:Be.ECONNABORTED,e,y)),y=null},l===void 0&&u.setContentType(null),"setRequestHeader"in y&&se.forEach(u.toJSON(),function(C,N){y.setRequestHeader(N,C)}),se.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),o&&o!=="json"&&(y.responseType=s.responseType),h&&([g,x]=Oc(h,!0),y.addEventListener("progress",g)),d&&y.upload&&([f,b]=Oc(d),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(p=_=>{y&&(i(!_||_.type?new ns(null,e,y):_),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(p),s.signal&&(s.signal.aborted?p():s.signal.addEventListener("abort",p)));const v=xU(s.url);if(v&&Yt.protocols.indexOf(v)===-1){i(new Be("Unsupported protocol "+v+":",Be.ERR_BAD_REQUEST,e));return}y.send(l||null)})},IU=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,s;const l=function(h){if(!s){s=!0,o();const p=h instanceof Error?h:this.reason;i.abort(p instanceof Be?p:new ns(p instanceof Error?p.message:p))}};let u=t&&setTimeout(()=>{u=null,l(new Be(`timeout ${t} of ms exceeded`,Be.ETIMEDOUT))},t);const o=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),e=null)};e.forEach(h=>h.addEventListener("abort",l));const{signal:d}=i;return d.unsubscribe=()=>se.asap(o),d}},LU=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,s;for(;i<n;)s=i+t,yield e.slice(i,s),i=s},DU=async function*(e,t){for await(const n of MU(e))yield*LU(n,t)},MU=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},Uw=(e,t,n,i)=>{const s=DU(e,t);let l=0,u,o=d=>{u||(u=!0,i&&i(d))};return new ReadableStream({async pull(d){try{const{done:h,value:p}=await s.next();if(h){o(),d.close();return}let f=p.byteLength;if(n){let g=l+=f;n(g)}d.enqueue(new Uint8Array(p))}catch(h){throw o(h),h}},cancel(d){return o(d),s.return()}},{highWaterMark:2})},jw=64*1024,{isFunction:Ql}=se,BU=(({Request:e,Response:t})=>({Request:e,Response:t}))(se.global),{ReadableStream:zw,TextEncoder:Hw}=se.global,qw=(e,...t)=>{try{return!!e(...t)}catch{return!1}},FU=e=>{e=se.merge.call({skipUndefined:!0},BU,e);const{fetch:t,Request:n,Response:i}=e,s=t?Ql(t):typeof fetch=="function",l=Ql(n),u=Ql(i);if(!s)return!1;const o=s&&Ql(zw),d=s&&(typeof Hw=="function"?(x=>E=>x.encode(E))(new Hw):async x=>new Uint8Array(await new n(x).arrayBuffer())),h=l&&o&&qw(()=>{let x=!1;const E=new n(Yt.origin,{body:new zw,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!E}),p=u&&o&&qw(()=>se.isReadableStream(new i("").body)),f={stream:p&&(x=>x.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!f[x]&&(f[x]=(E,y)=>{let S=E&&E[x];if(S)return S.call(E);throw new Be(`Response type '${x}' is not supported`,Be.ERR_NOT_SUPPORT,y)})});const g=async x=>{if(x==null)return 0;if(se.isBlob(x))return x.size;if(se.isSpecCompliantForm(x))return(await new n(Yt.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(se.isArrayBufferView(x)||se.isArrayBuffer(x))return x.byteLength;if(se.isURLSearchParams(x)&&(x=x+""),se.isString(x))return(await d(x)).byteLength},b=async(x,E)=>{const y=se.toFiniteNumber(x.getContentLength());return y??g(E)};return async x=>{let{url:E,method:y,data:S,signal:v,cancelToken:_,timeout:C,onDownloadProgress:N,onUploadProgress:A,responseType:O,headers:R,withCredentials:I="same-origin",fetchOptions:L}=JO(x),F=t||fetch;O=O?(O+"").toLowerCase():"text";let j=IU([v,_&&_.toAbortSignal()],C),z=null;const G=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let V;try{if(A&&h&&y!=="get"&&y!=="head"&&(V=await b(R,S))!==0){let B=new n(E,{method:"POST",body:S,duplex:"half"}),H;if(se.isFormData(S)&&(H=B.headers.get("content-type"))&&R.setContentType(H),B.body){const[U,ee]=Bw(V,Oc(Fw(A)));S=Uw(B.body,jw,U,ee)}}se.isString(I)||(I=I?"include":"omit");const W=l&&"credentials"in n.prototype,Z={...L,signal:j,method:y.toUpperCase(),headers:R.normalize().toJSON(),body:S,duplex:"half",credentials:W?I:void 0};z=l&&new n(E,Z);let J=await(l?F(z,L):F(E,Z));const P=p&&(O==="stream"||O==="response");if(p&&(N||P&&G)){const B={};["status","statusText","headers"].forEach(le=>{B[le]=J[le]});const H=se.toFiniteNumber(J.headers.get("content-length")),[U,ee]=N&&Bw(H,Oc(Fw(N),!0))||[];J=new i(Uw(J.body,jw,U,()=>{ee&&ee(),G&&G()}),B)}O=O||"text";let D=await f[se.findKey(f,O)||"text"](J,x);return!P&&G&&G(),await new Promise((B,H)=>{ZO(B,H,{data:D,headers:pn.from(J.headers),status:J.status,statusText:J.statusText,config:x,request:z})})}catch(W){throw G&&G(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new Be("Network Error",Be.ERR_NETWORK,x,z),{cause:W.cause||W}):Be.from(W,W&&W.code,x,z)}}},PU=new Map,eI=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:s}=t,l=[i,s,n];let u=l.length,o=u,d,h,p=PU;for(;o--;)d=l[o],h=p.get(d),h===void 0&&p.set(d,h=o?new Map:FU(t)),p=h;return h};eI();const e_={http:tU,xhr:OU,fetch:{get:eI}};se.forEach(e_,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $w=e=>`- ${e}`,UU=e=>se.isFunction(e)||e===null||e===!1;function jU(e,t){e=se.isArray(e)?e:[e];const{length:n}=e;let i,s;const l={};for(let u=0;u<n;u++){i=e[u];let o;if(s=i,!UU(i)&&(s=e_[(o=String(i)).toLowerCase()],s===void 0))throw new Be(`Unknown adapter '${o}'`);if(s&&(se.isFunction(s)||(s=s.get(t))))break;l[o||"#"+u]=s}if(!s){const u=Object.entries(l).map(([d,h])=>`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=n?u.length>1?`since :
|
|
12
12
|
`+u.map($w).join(`
|
|
@@ -32,7 +32,7 @@ ${E.slice(y)}`;return i(S),setTimeout(()=>{b.setSelectionRange(y,y)},0),!0}if(u=
|
|
|
32
32
|
`,b.selectionStart-1)+1;let S=E.indexOf(`
|
|
33
33
|
`,b.selectionStart);S===-1?S=E.length:S+=1;const v=E.slice(0,y)+E.slice(S);return i(v),o(""),setTimeout(()=>{b.setSelectionRange(y,y)},0),!0}return g.preventDefault(),o("d"),setTimeout(()=>o(""),1e3),!0}if(x==="Enter")return g.preventDefault(),t(),!0;if(x==="Escape")return g.preventDefault(),!0;if(x==="w"){g.preventDefault();const E=b.value,y=d(E,b.selectionStart);return b.setSelectionRange(y,y),!0}if(x==="e"){g.preventDefault();const E=b.value,y=h(E,b.selectionStart);return b.setSelectionRange(y,y),!0}if(x==="b"){g.preventDefault();const E=b.value,y=p(E,b.selectionStart);return b.setSelectionRange(y,y),!0}if(x==="x"){g.preventDefault();const E=b.value,y=b.selectionStart;if(y<E.length){const S=E.slice(0,y)+E.slice(y+1);i(S),setTimeout(()=>{b.setSelectionRange(y,y)},0)}return!0}if(x==="s"){g.preventDefault();const E=b.value,y=b.selectionStart;if(y<E.length){const S=E.slice(0,y)+E.slice(y+1);i(S),l("insert"),setTimeout(()=>{b.setSelectionRange(y,y)},0)}else l("insert");return!0}if(x==="S"){g.preventDefault();const E=b.value,y=E.lastIndexOf(`
|
|
34
34
|
`,b.selectionStart-1)+1;let S=E.indexOf(`
|
|
35
|
-
`,b.selectionStart);S===-1&&(S=E.length);const v=E.slice(0,y)+E.slice(S);return i(v),l("insert"),setTimeout(()=>{b.setSelectionRange(y,y)},0),!0}return!1},[u,t,n,i,d,h,p]);return{vimMode:s,setVimMode:l,handleVimNormalMode:f}}function M6(){const[e,t]=K.useState(!1),[n,i]=K.useState(""),[s,l]=K.useState(0),[u,o]=K.useState(),d=K.useCallback((f,g,b)=>{const x=g.current;if(!x)return;const E=x.value,y=x.selectionStart,v=E.slice(0,y).match(/@(\S*)$/);if(!v)return;const _=y-v[0].length,C=`${E.slice(0,_)}@${f} ${E.slice(y)}`;b(C),t(!1),setTimeout(()=>{const N=_+f.length+2;x.setSelectionRange(N,N),x.focus()},0)},[]),h=K.useCallback(f=>{o(f)},[]),p=K.useCallback((f,g)=>{const x=f.slice(0,g).match(/@(\S*)$/);x?(t(!0),i(x[1]),l(0)):t(!1)},[]);return{showFileMention:e,mentionQuery:n,mentionSelectedIndex:s,currentFileToSelect:u,setShowFileMention:t,setMentionQuery:i,setMentionSelectedIndex:l,setCurrentFileToSelect:o,handleFileSelect:d,handleEnterSelect:h,checkForMention:p}}function B6({onCommand:e,updatePreferences:t,vimModeEnabled:n,textareaRef:i,setMessage:s,setShowShortcutsModal:l}){const[u,o]=K.useState(!1),[d,h]=K.useState(""),[p,f]=K.useState(0),[g,b]=K.useState(),x=K.useCallback(S=>{if(S==="help"){l(!0),s(""),o(!1),i.current&&(i.current.style.height="auto"),i.current?.focus();return}if(S==="vim"){t({vimMode:!n}),s(""),o(!1),i.current&&(i.current.style.height="auto"),i.current?.focus();return}e&&e(S),s(""),o(!1),i.current&&(i.current.style.height="auto"),i.current?.focus()},[e,n,t,i,s,l]),E=K.useCallback(S=>{b(S)},[]),y=K.useCallback(S=>{S.startsWith("/")&&!S.includes(" ")?(o(!0),h(S.slice(1)),f(0)):o(!1)},[]);return{showCommandSuggestions:u,commandQuery:d,commandSelectedIndex:p,currentCommandToSelect:g,setShowCommandSuggestions:o,setCommandQuery:h,setCommandSelectedIndex:f,setCurrentCommandToSelect:b,handleCommandSelect:x,handleCommandEnterSelect:E,checkForCommand:y}}function F6(e){return t=>{const{showFileMention:n,showCommandSuggestions:i,mentionSelectedIndex:s,commandSelectedIndex:l,currentFileToSelect:u,currentCommandToSelect:o,isPlanMode:d,vimModeEnabled:h,vimMode:p,setMentionSelectedIndex:f,setCommandSelectedIndex:g,setShowFileMention:b,setShowCommandSuggestions:x,setIsPlanMode:E,setVimMode:y,handleFileSelect:S,handleCommandSelect:v,handleSend:_,handleVimNormalMode:C,onPlanModeToggle:N}=e;if(i){t.key==="ArrowDown"||t.ctrlKey&&t.key==="j"?(t.preventDefault(),g((l+1)%5)):t.key==="ArrowUp"||t.ctrlKey&&t.key==="k"?(t.preventDefault(),g((l-1+5)%5)):t.key==="Enter"?(t.preventDefault(),o&&v(o)):t.key==="Escape"&&(t.preventDefault(),x(!1));return}if(n){t.key==="ArrowDown"||t.ctrlKey&&t.key==="j"?(t.preventDefault(),f((s+1)%20)):t.key==="ArrowUp"||t.ctrlKey&&t.key==="k"?(t.preventDefault(),f((s-1+20)%20)):t.key==="Enter"?(t.preventDefault(),u&&S(u)):t.key==="Escape"&&(t.preventDefault(),b(!1),h&&y("normal"));return}if(!(h&&p==="normal"&&C(t))){if(h&&p==="insert"&&t.key==="Escape"){t.preventDefault(),y("normal");return}if(t.key==="Tab"){t.preventDefault();const A=!d;E(A),N?.(A)}else t.key==="Enter"&&!t.shiftKey&&(!h||p==="normal")&&(t.preventDefault(),_())}}}const P6=K.memo(K.forwardRef(function({onSend:t,onCommand:n,disabled:i,onConfigClick:s,onPlanModeToggle:l,isPlanMode:u},o){const[d,h]=K.useState(""),[p,f]=K.useState(u||!1),[g,b]=K.useState(!1),x=K.useRef(null),{data:E,isLoading:y}=O6(),{preferences:S,updatePreferences:v}=L6(),_=E?.files||[],C=E?.changedFiles||[],N=K.useRef(()=>{}),{showFileMention:A,mentionQuery:O,mentionSelectedIndex:R,currentFileToSelect:I,setShowFileMention:L,setMentionSelectedIndex:F,setCurrentFileToSelect:j,handleFileSelect:z,handleEnterSelect:G,checkForMention:V}=M6(),{showCommandSuggestions:W,commandQuery:Z,commandSelectedIndex:J,currentCommandToSelect:P,setShowCommandSuggestions:D,setCommandSelectedIndex:B,setCurrentCommandToSelect:H,handleCommandSelect:U,handleCommandEnterSelect:ee,checkForCommand:le}=B6({onCommand:n,updatePreferences:v,vimModeEnabled:S.vimMode,textareaRef:x,setMessage:h,setShowShortcutsModal:b}),{vimMode:ue,setVimMode:X,handleVimNormalMode:$}=D6({enabled:S.vimMode,onSend:()=>N.current(),textareaRef:x,setMessage:h});K.useEffect(()=>{x.current?.focus()},[]),K.useEffect(()=>{u!==void 0&&f(u)},[u]),K.useImperativeHandle(o,()=>({focus:()=>{x.current?.focus()}}));const ie=K.useCallback(()=>{const De=x.current;De&&(De.style.height="auto",De.style.height=`${De.scrollHeight}px`)},[]);K.useEffect(()=>{ie()},[ie,d]);const he=K.useCallback(()=>{L(!1),j(void 0)},[L,j]),be=K.useCallback(()=>{D(!1),H(void 0)},[D,H]),ge=K.useCallback(De=>{z(De,x,h)},[z]),xe=K.useCallback(()=>{!d.trim()||i||(t(d),h(""),L(!1),D(!1),j(void 0),H(void 0),x.current&&(x.current.style.height="auto"),S.vimMode&&X("normal"),x.current?.focus())},[d,i,t,S.vimMode,L,D,j,H,X]);K.useEffect(()=>{N.current=xe},[xe]);const ze=K.useCallback(De=>{if(S.vimMode&&ue==="normal")return;const Ee=De.target.value;h(Ee),le(Ee),Ee.startsWith("/")&&!Ee.includes(" ")?(L(!1),j(void 0)):(D(!1),H(void 0),V(Ee,De.target.selectionStart))},[S.vimMode,ue,le,L,j,D,H,V]),He=K.useMemo(()=>F6({showFileMention:A,showCommandSuggestions:W,mentionSelectedIndex:R,commandSelectedIndex:J,currentFileToSelect:I,currentCommandToSelect:P,isPlanMode:p,vimModeEnabled:S.vimMode,vimMode:ue,setMentionSelectedIndex:F,setCommandSelectedIndex:B,setShowFileMention:L,setShowCommandSuggestions:D,setIsPlanMode:f,setVimMode:X,handleFileSelect:ge,handleCommandSelect:U,handleSend:xe,handleVimNormalMode:$,onPlanModeToggle:l}),[A,W,R,J,I,P,p,S.vimMode,ue,F,B,L,D,X,ge,U,xe,$,l]);return K.useEffect(()=>{S.vimMode||X("insert")},[S.vimMode,X]),T.jsx("div",{className:"absolute bottom-0 left-0 right-0 pt-16 pb-6 md:pb-8 px-2 md:px-4 bg-gradient-to-t from-background via-background to-transparent pointer-events-none z-20 safe-area-inset-bottom",children:T.jsxs("div",{className:"max-w-3xl mx-auto pointer-events-auto mb-2 md:mb-0 relative",children:[S.vimMode&&ue==="normal"&&T.jsx("div",{className:"absolute -top-6 right-0 px-2 py-0.5 text-xs font-mono font-semibold bg-amber-500/90 text-white rounded shadow-sm",children:"NORMAL"}),S.vimMode&&ue==="insert"&&T.jsx("div",{className:"absolute -top-6 right-0 px-2 py-0.5 text-xs font-mono font-semibold bg-green-500/90 text-white rounded shadow-sm",children:"INSERT"}),T.jsxs("div",{className:`flex items-end gap-1 rounded-3xl p-1 transition-all touch-manipulation ${p?"bg-slate-100 dark:bg-slate-900/40 border border-slate-300 dark:border-slate-700 focus-within:border-slate-400 dark:focus-within:border-slate-600 focus-within:ring-1 focus-within:ring-slate-300 dark:focus-within:ring-slate-700":"bg-card border border-border focus-within:border-primary/60 focus-within:ring-1 focus-within:ring-primary/40"}`,children:[s&&T.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center w-10 h-10 rounded-full hover:bg-background/50 active:bg-background/70 transition-colors text-muted-foreground hover:text-foreground flex-shrink-0 touch-manipulation",children:T.jsx(xF,{className:"w-4 h-4"})}),T.jsx(Vv,{ref:x,value:d,onChange:ze,onKeyDown:He,placeholder:p?"Plan mode - Type a message...":"Type a message...",disabled:i,rows:1,className:`border-0 bg-transparent pl-1 pr-2 py-2 max-h-[200px] overflow-y-auto leading-normal resize-none scrollbar-hide text-base ${S.vimMode&&ue==="normal"?"caret-[6px]":""}`,style:{height:"2.5rem"}}),T.jsx("button",{type:"button",onClick:xe,disabled:i||!d.trim(),className:`flex items-center justify-center w-10 h-10 rounded-full transition-colors flex-shrink-0 touch-manipulation ${d.trim()?"bg-primary hover:bg-primary/90 active:bg-primary/80 text-primary-foreground":"bg-transparent text-muted-foreground"}`,children:T.jsx(J3,{className:"w-4 h-4"})})]}),A&&!y&&T.jsx(oP,{files:_,changedFiles:C,query:O,selectedIndex:R,onSelect:ge,onEnterSelect:G,onClose:he}),W&&T.jsx(cP,{query:Z,selectedIndex:J,onSelect:U,onEnterSelect:ee,onClose:be}),T.jsx(mP,{isOpen:g,onClose:()=>b(!1)})]})})}));function U6(e){return mi({queryKey:["messages",e],queryFn:()=>{if(!e)throw new Error("Session ID is required");return Dt.getMessages(e)},enabled:!!e})}function j6(e){const t=mn();return Xn({mutationFn:n=>Dt.sendMessage(e,n),onSuccess:()=>{t.invalidateQueries({queryKey:["messages",e]}),t.invalidateQueries({queryKey:["sessions"]})}})}function Xc(){return mi({queryKey:["sessions"],queryFn:()=>Dt.getSessions(),refetchInterval:5e3})}function z6(e){const{data:t}=Xc();return t?.find(n=>n.id===e)}function H6(){const e=mn();return Xn({mutationFn:t=>Dt.createSession(t),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function q6(e){const t=mn();return Xn({mutationFn:n=>Dt.updateSession(e,n),onSuccess:async()=>{await t.invalidateQueries({queryKey:["sessions"]}),await t.invalidateQueries({queryKey:["session",e]})}})}function uI(){return mi({queryKey:["config"],queryFn:()=>Dt.getConfig()})}function $6(){return mi({queryKey:["models","all"],queryFn:()=>Dt.getAllModels()})}const G6=K.forwardRef(function({provider:t,model:n,onChange:i,disabled:s=!1},l){const{data:u,isLoading:o}=$6(),[d,h]=K.useState(!1),[p,f]=K.useState(""),[g,b]=K.useState(0),x=K.useRef(null),E=K.useRef(null),y=K.useRef([]);K.useImperativeHandle(l,()=>({openAndFocus:()=>{h(!0)}}));const S=K.useMemo(()=>{if(!u)return[];const I=[];for(const[L,F]of Object.entries(u))for(const j of F.models)I.push({providerKey:L,providerLabel:F.label,modelId:j.id,modelLabel:j.label,toolCall:j.toolCall,reasoning:j.reasoning});return I},[u]),v=K.useMemo(()=>new bi(S,{keys:[{name:"modelLabel",weight:1},{name:"modelId",weight:.5},{name:"providerLabel",weight:.3}],threshold:.5,ignoreLocation:!0,includeScore:!0,distance:100,minMatchCharLength:1,findAllMatches:!0}),[S]),_=K.useMemo(()=>{if(!u)return{};if(!p.trim())return u;const L=v.search(p).sort((j,z)=>{const G=j.score??1,V=z.score??1;if(Math.abs(G-V)<.001){const W=j.item.modelLabel.toLowerCase(),Z=z.item.modelLabel.toLowerCase(),J=p.toLowerCase(),P=W.indexOf(J),D=Z.indexOf(J);if(P>=0&&D<0)return-1;if(D>=0&&P<0)return 1;if(P>=0&&D>=0)return P-D}return G-V}),F={};for(const j of L){const z=j.item;F[z.providerKey]||(F[z.providerKey]={label:z.providerLabel,models:[]}),F[z.providerKey].models.find(V=>V.id===z.modelId)||F[z.providerKey].models.push({id:z.modelId,label:z.modelLabel,toolCall:z.toolCall,reasoning:z.reasoning})}return F},[u,p,v]),C=K.useMemo(()=>{const I=[];for(const[L,F]of Object.entries(_))for(const j of F.models)I.push({providerKey:L,providerLabel:F.label,modelId:j.id,modelLabel:j.label,toolCall:j.toolCall,reasoning:j.reasoning});return I},[_]);K.useEffect(()=>{d&&b(0)},[d]),K.useEffect(()=>{d&&g>=0&&g<y.current.length&&y.current[g]?.scrollIntoView({block:"nearest",behavior:"smooth"})},[g,d]),K.useEffect(()=>{const I=F=>{x.current&&!x.current.contains(F.target)&&h(!1)},L=F=>{F.key==="Escape"&&h(!1)};return d&&(document.addEventListener("mousedown",I),document.addEventListener("keydown",L),setTimeout(()=>E.current?.focus(),0)),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",L)}},[d]);const N=(I,L)=>{i(I,L),h(!1),f("")},A=I=>{if(C.length!==0){if(I.key==="ArrowDown"||I.ctrlKey&&I.key==="j")I.preventDefault(),b(L=>L<C.length-1?L+1:0);else if(I.key==="ArrowUp"||I.ctrlKey&&I.key==="k")I.preventDefault(),b(L=>L>0?L-1:C.length-1);else if(I.key==="Enter"){I.preventDefault();const L=C[g];L&&N(L.providerKey,L.modelId)}}},O=u?.[t]?.label||t,R=u?.[t]?.models.find(I=>I.id===n)?.label||n;return T.jsxs("div",{ref:x,className:"relative w-full",children:[T.jsxs("button",{type:"button",onClick:()=>!s&&h(!d),disabled:s||o,className:"w-full flex items-center justify-between px-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded-md hover:bg-[hsl(var(--accent))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[T.jsxs("span",{className:"flex items-center gap-2 text-sm truncate",children:[T.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:O}),T.jsx("span",{className:"text-[hsl(var(--muted-foreground))]/50",children:"/"}),T.jsx("span",{className:"text-[hsl(var(--foreground))]",children:R})]}),T.jsx(cr,{className:`w-4 h-4 text-[hsl(var(--muted-foreground))] transition-transform ${d?"rotate-180":""}`})]}),d&&!o&&u&&T.jsxs("div",{className:"absolute z-50 mt-1 w-full bg-[hsl(var(--popover))] border border-[hsl(var(--border))] rounded-md shadow-lg max-h-80 overflow-hidden flex flex-col",children:[T.jsx("div",{className:"p-2 border-b border-[hsl(var(--border))]",children:T.jsxs("div",{className:"relative",children:[T.jsx(Kv,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[hsl(var(--muted-foreground))]"}),T.jsx("input",{ref:E,type:"text",value:p,onChange:I=>f(I.target.value),onKeyDown:A,placeholder:"Search providers and models...",className:"w-full pl-9 pr-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded text-sm text-[hsl(var(--foreground))] placeholder-[hsl(var(--muted-foreground))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})}),T.jsx("div",{className:"overflow-y-auto",children:Object.keys(_).length===0?T.jsx("div",{className:"p-4 text-center text-[hsl(var(--muted-foreground))] text-sm",children:"No models found"}):Object.entries(_).map(([I,L])=>T.jsxs("div",{className:"border-b border-[hsl(var(--border))] last:border-0",children:[T.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-[hsl(var(--muted-foreground))] uppercase tracking-wider bg-[hsl(var(--muted))]",children:L.label}),T.jsx("div",{children:L.models.map(F=>{const j=I===t&&F.id===n,z=C.findIndex(V=>V.providerKey===I&&V.modelId===F.id),G=z===g;return T.jsxs("button",{ref:V=>{z>=0&&(y.current[z]=V)},type:"button",onClick:()=>N(I,F.id),onMouseEnter:()=>b(z),className:`w-full text-left px-4 py-2 text-sm flex items-center justify-between transition-colors ${G?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"} ${j?"text-[hsl(var(--accent-foreground))] font-medium":"text-[hsl(var(--foreground))]"}`,children:[T.jsx("span",{className:"truncate",children:F.label}),(F.toolCall||F.reasoning)&&T.jsxs("div",{className:"flex gap-1 ml-2 flex-shrink-0",children:[F.toolCall&&T.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-green-600/20 text-green-400 rounded",children:"Tools"}),F.reasoning&&T.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-purple-600/20 text-purple-400 rounded",children:"Reasoning"})]})]},F.id)})})]},I))})]})]})}),V6=K.forwardRef(function({agent:t,agents:n,onChange:i,disabled:s=!1},l){const[u,o]=K.useState(!1),[d,h]=K.useState(""),[p,f]=K.useState(0),g=K.useRef(null),b=K.useRef(null),x=K.useRef([]);K.useImperativeHandle(l,()=>({openAndFocus:()=>{o(!0)}}));const E=K.useMemo(()=>new bi(n,{threshold:.4,ignoreLocation:!0}),[n]),y=K.useMemo(()=>d.trim()?E.search(d).map(C=>C.item):n,[n,d,E]);K.useEffect(()=>{u&&f(0)},[u]),K.useEffect(()=>{u&&p>=0&&p<x.current.length&&x.current[p]?.scrollIntoView({block:"nearest",behavior:"smooth"})},[p,u]),K.useEffect(()=>{const _=N=>{g.current&&!g.current.contains(N.target)&&o(!1)},C=N=>{N.key==="Escape"&&o(!1)};return u&&(document.addEventListener("mousedown",_),document.addEventListener("keydown",C),setTimeout(()=>b.current?.focus(),0)),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",C)}},[u]);const S=_=>{i(_),o(!1),h("")},v=_=>{if(y.length!==0){if(_.key==="ArrowDown"||_.ctrlKey&&_.key==="j")_.preventDefault(),f(C=>C<y.length-1?C+1:0);else if(_.key==="ArrowUp"||_.ctrlKey&&_.key==="k")_.preventDefault(),f(C=>C>0?C-1:y.length-1);else if(_.key==="Enter"){_.preventDefault();const C=y[p];C&&S(C)}}};return T.jsxs("div",{ref:g,className:"relative w-full",children:[T.jsxs("button",{type:"button",onClick:()=>!s&&o(!u),disabled:s,className:"w-full flex items-center justify-between px-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded-md hover:bg-[hsl(var(--accent))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[T.jsx("span",{className:"text-sm text-[hsl(var(--foreground))] truncate",children:t}),T.jsx(cr,{className:`w-4 h-4 text-[hsl(var(--muted-foreground))] transition-transform ${u?"rotate-180":""}`})]}),u&&T.jsxs("div",{className:"absolute z-50 mt-1 w-full bg-[hsl(var(--popover))] border border-[hsl(var(--border))] rounded-md shadow-lg max-h-80 overflow-hidden flex flex-col",children:[T.jsx("div",{className:"p-2 border-b border-[hsl(var(--border))]",children:T.jsxs("div",{className:"relative",children:[T.jsx(Kv,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[hsl(var(--muted-foreground))]"}),T.jsx("input",{ref:b,type:"text",value:d,onChange:_=>h(_.target.value),onKeyDown:v,placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded text-sm text-[hsl(var(--foreground))] placeholder-[hsl(var(--muted-foreground))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})}),T.jsx("div",{className:"overflow-y-auto",children:y.length===0?T.jsx("div",{className:"p-4 text-center text-[hsl(var(--muted-foreground))] text-sm",children:"No agents found"}):y.map((_,C)=>{const N=_===t,A=C===p;return T.jsx("button",{ref:O=>{x.current[C]=O},type:"button",onClick:()=>S(_),onMouseEnter:()=>f(C),className:`w-full text-left px-4 py-2 text-sm transition-colors ${A?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"} ${N?"text-[hsl(var(--accent-foreground))] font-medium":"text-[hsl(var(--foreground))]"}`,children:T.jsx("span",{className:"truncate",children:_})},_)})})]})]})});function W6({isOpen:e,onClose:t,initialFocus:n,chatInputRef:i,agent:s,provider:l,model:u,onAgentChange:o,onProviderChange:d,onModelChange:h,onModelSelectorChange:p}){const{data:f,isLoading:g}=uI(),b=K.useRef(null),x=K.useRef(null);K.useEffect(()=>{e&&n&&setTimeout(()=>{n==="agent"?b.current?.openAndFocus():n==="model"&&x.current?.openAndFocus()},100)},[e,n]);const E=()=>{t(),setTimeout(()=>{i?.current?.focus()},100)},y=(S,v)=>{p?p(S,v):(d(S),h(v))};return T.jsx(Xv,{isOpen:e,onClose:E,title:"Configuration",closeOnEscape:!0,closeOnBackdropClick:!0,children:g?T.jsx("div",{className:"text-center text-muted-foreground py-8",children:"Loading configuration..."}):f?T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{children:[T.jsx("div",{className:"block text-sm font-medium text-foreground mb-2",children:"Agent"}),T.jsx(V6,{ref:b,agent:s,agents:f.agents,onChange:o})]}),T.jsxs("div",{children:[T.jsx("div",{className:"block text-sm font-medium text-foreground mb-2",children:"Provider / Model"}),T.jsx(G6,{ref:x,provider:l,model:u,onChange:y})]})]}):null})}const K6=K.memo(K.forwardRef(function({sessionId:t,userContext:n,onNewSession:i},s){const l=z6(t),[u,o]=K.useState(""),[d,h]=K.useState(""),[p,f]=K.useState(""),[g,b]=K.useState(!1),[x,E]=K.useState(null),[y,S]=K.useState(0),v=K.useRef(null),_=j6(t),C=q6(t);K.useEffect(()=>{l&&(o(l.agent),h(l.provider),f(l.model))},[l]),K.useEffect(()=>{S(G=>G+1)},[]),K.useImperativeHandle(s,()=>({focus:()=>{v.current?.focus()}}));const N=K.useCallback(async G=>{try{await _.mutateAsync({content:G,agent:u||void 0,provider:d||void 0,model:p||void 0,userContext:n||void 0})}catch(V){console.error("Failed to send message:",V)}},[_,u,d,p,n]),A=K.useCallback(()=>{b(G=>!G)},[]),O=K.useCallback(()=>{b(!1),E(null)},[]),R=K.useCallback(G=>{G==="models"?(E("model"),b(!0)):G==="agents"?(E("agent"),b(!0)):G==="new"&&i?.()},[i]),I=K.useCallback(async G=>{o(G);try{await C.mutateAsync({agent:G})}catch(V){console.error("Failed to update agent:",V)}},[C]),L=K.useCallback(async(G,V)=>{h(G),f(V);try{await C.mutateAsync({provider:G,model:V})}catch(W){console.error("Failed to update model:",W)}},[C]),F=K.useCallback(async G=>{if(h(G),p)try{await C.mutateAsync({provider:G,model:p})}catch(V){console.error("Failed to update provider:",V)}},[p,C]),j=K.useCallback(async G=>{f(G);try{await C.mutateAsync({provider:d,model:G})}catch(V){console.error("Failed to update model:",V)}},[d,C]),z=K.useCallback(async G=>{const V=G?"plan":"build";o(V);try{await C.mutateAsync({agent:V})}catch(W){console.error("Failed to switch agent:",W)}},[C]);return T.jsxs(T.Fragment,{children:[T.jsx(W6,{isOpen:g,onClose:O,initialFocus:x,chatInputRef:v,agent:u,provider:d,model:p,onAgentChange:I,onProviderChange:F,onModelChange:j,onModelSelectorChange:L}),T.jsx(P6,{ref:v,onSend:N,onCommand:R,disabled:_.isPending,onConfigClick:A,onPlanModeToggle:z,isPlanMode:u==="plan"},y)]})}));function Y6({sessionId:e,onStop:t,disabled:n}){const[i,s]=K.useState(!1),l=async()=>{if(!i){s(!0);try{await Dt.abortSession(e),t?.()}catch(u){console.error("Failed to abort stream:",u)}finally{setTimeout(()=>s(!1),1e3)}}};return T.jsxs("button",{type:"button",onClick:l,disabled:n||i,className:"flex items-center gap-1.5 text-sm text-destructive hover:text-destructive/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"Stop generation",children:[T.jsx(hF,{className:"w-4 h-4"}),T.jsx("span",{className:"font-medium",children:i?"Stopping...":"Stop"})]})}function X6(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Z6=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q6=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J6={};function Yw(e,t){return(J6.jsx?Q6:Z6).test(e)}const ej=/[ \t\n\f\r]/g;function tj(e){return typeof e=="object"?e.type==="text"?Xw(e.value):!1:Xw(e)}function Xw(e){return e.replace(ej,"")===""}class No{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}No.prototype.normal={};No.prototype.property={};No.prototype.space=void 0;function dI(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new No(n,i,t)}function mv(e){return e.toLowerCase()}class gn{constructor(t,n){this.attribute=n,this.property=t}}gn.prototype.attribute="";gn.prototype.booleanish=!1;gn.prototype.boolean=!1;gn.prototype.commaOrSpaceSeparated=!1;gn.prototype.commaSeparated=!1;gn.prototype.defined=!1;gn.prototype.mustUseProperty=!1;gn.prototype.number=!1;gn.prototype.overloadedBoolean=!1;gn.prototype.property="";gn.prototype.spaceSeparated=!1;gn.prototype.space=void 0;let nj=0;const Ue=Ji(),Nt=Ji(),gv=Ji(),ye=Ji(),lt=Ji(),Ka=Ji(),Cn=Ji();function Ji(){return 2**++nj}const bv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Nt,commaOrSpaceSeparated:Cn,commaSeparated:Ka,number:ye,overloadedBoolean:gv,spaceSeparated:lt},Symbol.toStringTag,{value:"Module"})),$h=Object.keys(bv);class n_ extends gn{constructor(t,n,i,s){let l=-1;if(super(t,n),Zw(this,"space",s),typeof i=="number")for(;++l<$h.length;){const u=$h[l];Zw(this,$h[l],(i&bv[u])===bv[u])}}}n_.prototype.defined=!0;function Zw(e,t,n){n&&(e[t]=n)}function rs(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const l=new n_(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[mv(i)]=i,n[mv(l.attribute)]=i}return new No(t,n,e.space)}const hI=rs({properties:{ariaActiveDescendant:null,ariaAtomic:Nt,ariaAutoComplete:null,ariaBusy:Nt,ariaChecked:Nt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:lt,ariaCurrent:null,ariaDescribedBy:lt,ariaDetails:null,ariaDisabled:Nt,ariaDropEffect:lt,ariaErrorMessage:null,ariaExpanded:Nt,ariaFlowTo:lt,ariaGrabbed:Nt,ariaHasPopup:null,ariaHidden:Nt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lt,ariaLevel:ye,ariaLive:null,ariaModal:Nt,ariaMultiLine:Nt,ariaMultiSelectable:Nt,ariaOrientation:null,ariaOwns:lt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Nt,ariaReadOnly:Nt,ariaRelevant:null,ariaRequired:Nt,ariaRoleDescription:lt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Nt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function fI(e,t){return t in e?e[t]:t}function pI(e,t){return fI(e,t.toLowerCase())}const rj=rs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ka,acceptCharset:lt,accessKey:lt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:lt,autoFocus:Ue,autoPlay:Ue,blocking:lt,capture:null,charSet:null,checked:Ue,cite:null,className:lt,cols:ye,colSpan:null,content:null,contentEditable:Nt,controls:Ue,controlsList:lt,coords:ye|Ka,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:gv,draggable:Nt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:lt,height:ye,hidden:gv,high:ye,href:null,hrefLang:null,htmlFor:lt,httpEquiv:lt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:lt,itemRef:lt,itemScope:Ue,itemType:lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:ye,pattern:null,ping:lt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:lt,required:Ue,reversed:Ue,rows:ye,rowSpan:ye,sandbox:lt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Nt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Nt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Nt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:pI}),ij=rs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:lt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ka,g2:Ka,glyphName:Ka,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fI}),mI=rs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gI=rs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pI}),bI=rs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),aj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sj=/[A-Z]/g,Qw=/-[a-z]/g,oj=/^data[-\w.:]+$/i;function lj(e,t){const n=mv(t);let i=t,s=gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oj.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Qw,uj);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Qw.test(l)){let u=l.replace(sj,cj);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=n_}return new s(i,t)}function cj(e){return"-"+e.toLowerCase()}function uj(e){return e.charAt(1).toUpperCase()}const dj=dI([hI,rj,mI,gI,bI],"html"),r_=dI([hI,ij,mI,gI,bI],"svg");function hj(e){return e.join(" ").trim()}var Ha={},Gh,Jw;function fj(){if(Jw)return Gh;Jw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,d=`
|
|
35
|
+
`,b.selectionStart);S===-1&&(S=E.length);const v=E.slice(0,y)+E.slice(S);return i(v),l("insert"),setTimeout(()=>{b.setSelectionRange(y,y)},0),!0}return!1},[u,t,n,i,d,h,p]);return{vimMode:s,setVimMode:l,handleVimNormalMode:f}}function M6(){const[e,t]=K.useState(!1),[n,i]=K.useState(""),[s,l]=K.useState(0),[u,o]=K.useState(),d=K.useCallback((f,g,b)=>{const x=g.current;if(!x)return;const E=x.value,y=x.selectionStart,v=E.slice(0,y).match(/@(\S*)$/);if(!v)return;const _=y-v[0].length,C=`${E.slice(0,_)}@${f} ${E.slice(y)}`;b(C),t(!1),setTimeout(()=>{const N=_+f.length+2;x.setSelectionRange(N,N),x.focus()},0)},[]),h=K.useCallback(f=>{o(f)},[]),p=K.useCallback((f,g)=>{const x=f.slice(0,g).match(/@(\S*)$/);x?(t(!0),i(x[1]),l(0)):t(!1)},[]);return{showFileMention:e,mentionQuery:n,mentionSelectedIndex:s,currentFileToSelect:u,setShowFileMention:t,setMentionQuery:i,setMentionSelectedIndex:l,setCurrentFileToSelect:o,handleFileSelect:d,handleEnterSelect:h,checkForMention:p}}function B6({onCommand:e,updatePreferences:t,vimModeEnabled:n,textareaRef:i,setMessage:s,setShowShortcutsModal:l}){const[u,o]=K.useState(!1),[d,h]=K.useState(""),[p,f]=K.useState(0),[g,b]=K.useState(),x=K.useCallback(S=>{if(S==="help"){l(!0),s(""),o(!1),i.current&&(i.current.style.height="auto"),i.current?.focus();return}if(S==="vim"){t({vimMode:!n}),s(""),o(!1),i.current&&(i.current.style.height="auto"),i.current?.focus();return}e&&e(S),s(""),o(!1),i.current&&(i.current.style.height="auto"),i.current?.focus()},[e,n,t,i,s,l]),E=K.useCallback(S=>{b(S)},[]),y=K.useCallback(S=>{S.startsWith("/")&&!S.includes(" ")?(o(!0),h(S.slice(1)),f(0)):o(!1)},[]);return{showCommandSuggestions:u,commandQuery:d,commandSelectedIndex:p,currentCommandToSelect:g,setShowCommandSuggestions:o,setCommandQuery:h,setCommandSelectedIndex:f,setCurrentCommandToSelect:b,handleCommandSelect:x,handleCommandEnterSelect:E,checkForCommand:y}}function F6(e){return t=>{const{showFileMention:n,showCommandSuggestions:i,mentionSelectedIndex:s,commandSelectedIndex:l,currentFileToSelect:u,currentCommandToSelect:o,isPlanMode:d,vimModeEnabled:h,vimMode:p,setMentionSelectedIndex:f,setCommandSelectedIndex:g,setShowFileMention:b,setShowCommandSuggestions:x,setIsPlanMode:E,setVimMode:y,handleFileSelect:S,handleCommandSelect:v,handleSend:_,handleVimNormalMode:C,onPlanModeToggle:N}=e;if(i){t.key==="ArrowDown"||t.ctrlKey&&t.key==="j"?(t.preventDefault(),g((l+1)%5)):t.key==="ArrowUp"||t.ctrlKey&&t.key==="k"?(t.preventDefault(),g((l-1+5)%5)):t.key==="Enter"?(t.preventDefault(),o&&v(o)):t.key==="Escape"&&(t.preventDefault(),x(!1));return}if(n){t.key==="ArrowDown"||t.ctrlKey&&t.key==="j"?(t.preventDefault(),f((s+1)%20)):t.key==="ArrowUp"||t.ctrlKey&&t.key==="k"?(t.preventDefault(),f((s-1+20)%20)):t.key==="Enter"?(t.preventDefault(),u&&S(u)):t.key==="Escape"&&(t.preventDefault(),b(!1),h&&y("normal"));return}if(!(h&&p==="normal"&&C(t))){if(h&&p==="insert"&&t.key==="Escape"){t.preventDefault(),y("normal");return}if(t.key==="Tab"){t.preventDefault();const A=!d;E(A),N?.(A)}else t.key==="Enter"&&!t.shiftKey&&(!h||p==="normal")&&(t.preventDefault(),_())}}}const P6=K.memo(K.forwardRef(function({onSend:t,onCommand:n,disabled:i,onConfigClick:s,onPlanModeToggle:l,isPlanMode:u},o){const[d,h]=K.useState(""),[p,f]=K.useState(u||!1),[g,b]=K.useState(!1),x=K.useRef(null),{data:E,isLoading:y}=O6(),{preferences:S,updatePreferences:v}=L6(),_=E?.files||[],C=E?.changedFiles||[],N=K.useRef(()=>{}),{showFileMention:A,mentionQuery:O,mentionSelectedIndex:R,currentFileToSelect:I,setShowFileMention:L,setMentionSelectedIndex:F,setCurrentFileToSelect:j,handleFileSelect:z,handleEnterSelect:G,checkForMention:V}=M6(),{showCommandSuggestions:W,commandQuery:Z,commandSelectedIndex:J,currentCommandToSelect:P,setShowCommandSuggestions:D,setCommandSelectedIndex:B,setCurrentCommandToSelect:H,handleCommandSelect:U,handleCommandEnterSelect:ee,checkForCommand:le}=B6({onCommand:n,updatePreferences:v,vimModeEnabled:S.vimMode,textareaRef:x,setMessage:h,setShowShortcutsModal:b}),{vimMode:ue,setVimMode:X,handleVimNormalMode:$}=D6({enabled:S.vimMode,onSend:()=>N.current(),textareaRef:x,setMessage:h});K.useEffect(()=>{x.current?.focus()},[]),K.useEffect(()=>{u!==void 0&&f(u)},[u]),K.useImperativeHandle(o,()=>({focus:()=>{x.current?.focus()}}));const ie=K.useCallback(()=>{const De=x.current;De&&(De.style.height="auto",De.style.height=`${De.scrollHeight}px`)},[]);K.useEffect(()=>{ie()},[ie,d]);const he=K.useCallback(()=>{L(!1),j(void 0)},[L,j]),be=K.useCallback(()=>{D(!1),H(void 0)},[D,H]),ge=K.useCallback(De=>{z(De,x,h)},[z]),xe=K.useCallback(()=>{!d.trim()||i||(t(d),h(""),L(!1),D(!1),j(void 0),H(void 0),x.current&&(x.current.style.height="auto"),S.vimMode&&X("normal"),x.current?.focus())},[d,i,t,S.vimMode,L,D,j,H,X]);K.useEffect(()=>{N.current=xe},[xe]);const ze=K.useCallback(De=>{if(S.vimMode&&ue==="normal")return;const Ee=De.target.value;h(Ee),le(Ee),Ee.startsWith("/")&&!Ee.includes(" ")?(L(!1),j(void 0)):(D(!1),H(void 0),V(Ee,De.target.selectionStart))},[S.vimMode,ue,le,L,j,D,H,V]),He=K.useMemo(()=>F6({showFileMention:A,showCommandSuggestions:W,mentionSelectedIndex:R,commandSelectedIndex:J,currentFileToSelect:I,currentCommandToSelect:P,isPlanMode:p,vimModeEnabled:S.vimMode,vimMode:ue,setMentionSelectedIndex:F,setCommandSelectedIndex:B,setShowFileMention:L,setShowCommandSuggestions:D,setIsPlanMode:f,setVimMode:X,handleFileSelect:ge,handleCommandSelect:U,handleSend:xe,handleVimNormalMode:$,onPlanModeToggle:l}),[A,W,R,J,I,P,p,S.vimMode,ue,F,B,L,D,X,ge,U,xe,$,l]);return K.useEffect(()=>{S.vimMode||X("insert")},[S.vimMode,X]),T.jsx("div",{className:"absolute bottom-0 left-0 right-0 pt-16 pb-6 md:pb-8 px-2 md:px-4 bg-gradient-to-t from-background via-background to-transparent pointer-events-none z-20 safe-area-inset-bottom",children:T.jsxs("div",{className:"max-w-3xl mx-auto pointer-events-auto mb-2 md:mb-0 relative",children:[S.vimMode&&ue==="normal"&&T.jsx("div",{className:"absolute -top-6 right-0 px-2 py-0.5 text-xs font-mono font-semibold bg-amber-500/90 text-white rounded shadow-sm",children:"NORMAL"}),S.vimMode&&ue==="insert"&&T.jsx("div",{className:"absolute -top-6 right-0 px-2 py-0.5 text-xs font-mono font-semibold bg-green-500/90 text-white rounded shadow-sm",children:"INSERT"}),T.jsxs("div",{className:`flex items-end gap-1 rounded-3xl p-1 transition-all touch-manipulation ${p?"bg-slate-100 dark:bg-slate-900/40 border border-slate-300 dark:border-slate-700 focus-within:border-slate-400 dark:focus-within:border-slate-600 focus-within:ring-1 focus-within:ring-slate-300 dark:focus-within:ring-slate-700":"bg-card border border-border focus-within:border-primary/60 focus-within:ring-1 focus-within:ring-primary/40"}`,children:[s&&T.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center w-10 h-10 rounded-full hover:bg-background/50 active:bg-background/70 transition-colors text-muted-foreground hover:text-foreground flex-shrink-0 touch-manipulation",children:T.jsx(xF,{className:"w-4 h-4"})}),T.jsx(Vv,{ref:x,value:d,onChange:ze,onKeyDown:He,placeholder:p?"Plan mode - Type a message...":"Type a message...",disabled:i,rows:1,className:`border-0 bg-transparent pl-1 pr-2 py-2 max-h-[200px] overflow-y-auto leading-normal resize-none scrollbar-hide text-base ${S.vimMode&&ue==="normal"?"caret-[6px]":""}`,style:{height:"2.5rem"}}),T.jsx("button",{type:"button",onClick:xe,disabled:i||!d.trim(),className:`flex items-center justify-center w-10 h-10 rounded-full transition-colors flex-shrink-0 touch-manipulation ${d.trim()?"bg-primary hover:bg-primary/90 active:bg-primary/80 text-primary-foreground":"bg-transparent text-muted-foreground"}`,children:T.jsx(J3,{className:"w-4 h-4"})})]}),A&&!y&&T.jsx(oP,{files:_,changedFiles:C,query:O,selectedIndex:R,onSelect:ge,onEnterSelect:G,onClose:he}),W&&T.jsx(cP,{query:Z,selectedIndex:J,onSelect:U,onEnterSelect:ee,onClose:be}),T.jsx(mP,{isOpen:g,onClose:()=>b(!1)})]})})}));function U6(e){return mi({queryKey:["messages",e],queryFn:()=>{if(!e)throw new Error("Session ID is required");return Dt.getMessages(e)},enabled:!!e})}function j6(e){const t=mn();return Xn({mutationFn:n=>Dt.sendMessage(e,n),onSuccess:()=>{t.invalidateQueries({queryKey:["messages",e]}),t.invalidateQueries({queryKey:["sessions"]})}})}function Xc(){return mi({queryKey:["sessions"],queryFn:()=>Dt.getSessions(),refetchInterval:5e3})}function z6(e){const{data:t}=Xc();return t?.find(n=>n.id===e)}function H6(){const e=mn();return Xn({mutationFn:t=>Dt.createSession(t),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function q6(e){const t=mn();return Xn({mutationFn:n=>Dt.updateSession(e,n),onSuccess:async()=>{await t.invalidateQueries({queryKey:["sessions"]}),await t.invalidateQueries({queryKey:["session",e]})}})}function uI(){return mi({queryKey:["config"],queryFn:()=>Dt.getConfig()})}function $6(){return mi({queryKey:["models","all"],queryFn:()=>Dt.getAllModels()})}const G6=K.forwardRef(function({provider:t,model:n,onChange:i,disabled:s=!1},l){const{data:u,isLoading:o}=$6(),[d,h]=K.useState(!1),[p,f]=K.useState(""),[g,b]=K.useState(0),x=K.useRef(null),E=K.useRef(null),y=K.useRef([]);K.useImperativeHandle(l,()=>({openAndFocus:()=>{h(!0)}}));const S=K.useMemo(()=>{if(!u)return[];const I=[];for(const[L,F]of Object.entries(u))for(const j of F.models)I.push({providerKey:L,providerLabel:F.label,modelId:j.id,modelLabel:j.label,toolCall:j.toolCall,reasoning:j.reasoning});return I},[u]),v=K.useMemo(()=>new bi(S,{keys:[{name:"modelLabel",weight:1},{name:"modelId",weight:.5},{name:"providerLabel",weight:.3}],threshold:.5,ignoreLocation:!0,includeScore:!0,distance:100,minMatchCharLength:1,findAllMatches:!0}),[S]),_=K.useMemo(()=>{if(!u)return{};if(!p.trim())return u;const L=v.search(p).sort((j,z)=>{const G=j.score??1,V=z.score??1;if(Math.abs(G-V)<.001){const W=j.item.modelLabel.toLowerCase(),Z=z.item.modelLabel.toLowerCase(),J=p.toLowerCase(),P=W.indexOf(J),D=Z.indexOf(J);if(P>=0&&D<0)return-1;if(D>=0&&P<0)return 1;if(P>=0&&D>=0)return P-D}return G-V}),F={};for(const j of L){const z=j.item;F[z.providerKey]||(F[z.providerKey]={label:z.providerLabel,models:[]}),F[z.providerKey].models.find(V=>V.id===z.modelId)||F[z.providerKey].models.push({id:z.modelId,label:z.modelLabel,toolCall:z.toolCall,reasoning:z.reasoning})}return F},[u,p,v]),C=K.useMemo(()=>{const I=[];for(const[L,F]of Object.entries(_))for(const j of F.models)I.push({providerKey:L,providerLabel:F.label,modelId:j.id,modelLabel:j.label,toolCall:j.toolCall,reasoning:j.reasoning});return I},[_]);K.useEffect(()=>{d&&b(0)},[d]),K.useEffect(()=>{d&&g>=0&&g<y.current.length&&y.current[g]?.scrollIntoView({block:"nearest",behavior:"smooth"})},[g,d]),K.useEffect(()=>{const I=F=>{x.current&&!x.current.contains(F.target)&&h(!1)},L=F=>{(F.key==="Escape"||F.key==="q")&&h(!1)};return d&&(document.addEventListener("mousedown",I),document.addEventListener("keydown",L),setTimeout(()=>E.current?.focus(),0)),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",L)}},[d]);const N=(I,L)=>{i(I,L),h(!1),f("")},A=I=>{if(C.length!==0){if(I.key==="ArrowDown"||I.ctrlKey&&I.key==="j")I.preventDefault(),b(L=>L<C.length-1?L+1:0);else if(I.key==="ArrowUp"||I.ctrlKey&&I.key==="k")I.preventDefault(),b(L=>L>0?L-1:C.length-1);else if(I.key==="Enter"){I.preventDefault();const L=C[g];L&&N(L.providerKey,L.modelId)}}},O=u?.[t]?.label||t,R=u?.[t]?.models.find(I=>I.id===n)?.label||n;return T.jsxs("div",{ref:x,className:"relative w-full",children:[T.jsxs("button",{type:"button",onClick:()=>!s&&h(!d),disabled:s||o,className:"w-full flex items-center justify-between px-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded-md hover:bg-[hsl(var(--accent))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[T.jsxs("span",{className:"flex items-center gap-2 text-sm truncate",children:[T.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:O}),T.jsx("span",{className:"text-[hsl(var(--muted-foreground))]/50",children:"/"}),T.jsx("span",{className:"text-[hsl(var(--foreground))]",children:R})]}),T.jsx(cr,{className:`w-4 h-4 text-[hsl(var(--muted-foreground))] transition-transform ${d?"rotate-180":""}`})]}),d&&!o&&u&&T.jsxs("div",{className:"absolute z-50 mt-1 w-full bg-[hsl(var(--popover))] border border-[hsl(var(--border))] rounded-md shadow-lg max-h-80 overflow-hidden flex flex-col",children:[T.jsx("div",{className:"p-2 border-b border-[hsl(var(--border))]",children:T.jsxs("div",{className:"relative",children:[T.jsx(Kv,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[hsl(var(--muted-foreground))]"}),T.jsx("input",{ref:E,type:"text",value:p,onChange:I=>f(I.target.value),onKeyDown:A,placeholder:"Search providers and models...",className:"w-full pl-9 pr-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded text-sm text-[hsl(var(--foreground))] placeholder-[hsl(var(--muted-foreground))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})}),T.jsx("div",{className:"overflow-y-auto",children:Object.keys(_).length===0?T.jsx("div",{className:"p-4 text-center text-[hsl(var(--muted-foreground))] text-sm",children:"No models found"}):Object.entries(_).map(([I,L])=>T.jsxs("div",{className:"border-b border-[hsl(var(--border))] last:border-0",children:[T.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-[hsl(var(--muted-foreground))] uppercase tracking-wider bg-[hsl(var(--muted))]",children:L.label}),T.jsx("div",{children:L.models.map(F=>{const j=I===t&&F.id===n,z=C.findIndex(V=>V.providerKey===I&&V.modelId===F.id),G=z===g;return T.jsxs("button",{ref:V=>{z>=0&&(y.current[z]=V)},type:"button",onClick:()=>N(I,F.id),onMouseEnter:()=>b(z),className:`w-full text-left px-4 py-2 text-sm flex items-center justify-between transition-colors ${G?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"} ${j?"text-[hsl(var(--accent-foreground))] font-medium":"text-[hsl(var(--foreground))]"}`,children:[T.jsx("span",{className:"truncate",children:F.label}),(F.toolCall||F.reasoning)&&T.jsxs("div",{className:"flex gap-1 ml-2 flex-shrink-0",children:[F.toolCall&&T.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-green-600/20 text-green-400 rounded",children:"Tools"}),F.reasoning&&T.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-purple-600/20 text-purple-400 rounded",children:"Reasoning"})]})]},F.id)})})]},I))})]})]})}),V6=K.forwardRef(function({agent:t,agents:n,onChange:i,disabled:s=!1},l){const[u,o]=K.useState(!1),[d,h]=K.useState(""),[p,f]=K.useState(0),g=K.useRef(null),b=K.useRef(null),x=K.useRef([]);K.useImperativeHandle(l,()=>({openAndFocus:()=>{o(!0)}}));const E=K.useMemo(()=>new bi(n,{threshold:.4,ignoreLocation:!0}),[n]),y=K.useMemo(()=>d.trim()?E.search(d).map(C=>C.item):n,[n,d,E]);K.useEffect(()=>{u&&f(0)},[u]),K.useEffect(()=>{u&&p>=0&&p<x.current.length&&x.current[p]?.scrollIntoView({block:"nearest",behavior:"smooth"})},[p,u]),K.useEffect(()=>{const _=N=>{g.current&&!g.current.contains(N.target)&&o(!1)},C=N=>{(N.key==="Escape"||N.key==="q")&&o(!1)};return u&&(document.addEventListener("mousedown",_),document.addEventListener("keydown",C),setTimeout(()=>b.current?.focus(),0)),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",C)}},[u]);const S=_=>{i(_),o(!1),h("")},v=_=>{if(y.length!==0){if(_.key==="ArrowDown"||_.ctrlKey&&_.key==="j")_.preventDefault(),f(C=>C<y.length-1?C+1:0);else if(_.key==="ArrowUp"||_.ctrlKey&&_.key==="k")_.preventDefault(),f(C=>C>0?C-1:y.length-1);else if(_.key==="Enter"){_.preventDefault();const C=y[p];C&&S(C)}}};return T.jsxs("div",{ref:g,className:"relative w-full",children:[T.jsxs("button",{type:"button",onClick:()=>!s&&o(!u),disabled:s,className:"w-full flex items-center justify-between px-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded-md hover:bg-[hsl(var(--accent))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[T.jsx("span",{className:"text-sm text-[hsl(var(--foreground))] truncate",children:t}),T.jsx(cr,{className:`w-4 h-4 text-[hsl(var(--muted-foreground))] transition-transform ${u?"rotate-180":""}`})]}),u&&T.jsxs("div",{className:"absolute z-50 mt-1 w-full bg-[hsl(var(--popover))] border border-[hsl(var(--border))] rounded-md shadow-lg max-h-80 overflow-hidden flex flex-col",children:[T.jsx("div",{className:"p-2 border-b border-[hsl(var(--border))]",children:T.jsxs("div",{className:"relative",children:[T.jsx(Kv,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[hsl(var(--muted-foreground))]"}),T.jsx("input",{ref:b,type:"text",value:d,onChange:_=>h(_.target.value),onKeyDown:v,placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded text-sm text-[hsl(var(--foreground))] placeholder-[hsl(var(--muted-foreground))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})}),T.jsx("div",{className:"overflow-y-auto",children:y.length===0?T.jsx("div",{className:"p-4 text-center text-[hsl(var(--muted-foreground))] text-sm",children:"No agents found"}):y.map((_,C)=>{const N=_===t,A=C===p;return T.jsx("button",{ref:O=>{x.current[C]=O},type:"button",onClick:()=>S(_),onMouseEnter:()=>f(C),className:`w-full text-left px-4 py-2 text-sm transition-colors ${A?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"} ${N?"text-[hsl(var(--accent-foreground))] font-medium":"text-[hsl(var(--foreground))]"}`,children:T.jsx("span",{className:"truncate",children:_})},_)})})]})]})});function W6({isOpen:e,onClose:t,initialFocus:n,chatInputRef:i,agent:s,provider:l,model:u,onAgentChange:o,onProviderChange:d,onModelChange:h,onModelSelectorChange:p}){const{data:f,isLoading:g}=uI(),b=K.useRef(null),x=K.useRef(null);K.useEffect(()=>{e&&n&&setTimeout(()=>{n==="agent"?b.current?.openAndFocus():n==="model"&&x.current?.openAndFocus()},100)},[e,n]);const E=()=>{t(),setTimeout(()=>{i?.current?.focus()},100)},y=(S,v)=>{p?p(S,v):(d(S),h(v))};return T.jsx(Xv,{isOpen:e,onClose:E,title:"Configuration",closeOnEscape:!0,closeOnBackdropClick:!0,children:g?T.jsx("div",{className:"text-center text-muted-foreground py-8",children:"Loading configuration..."}):f?T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{children:[T.jsx("div",{className:"block text-sm font-medium text-foreground mb-2",children:"Agent"}),T.jsx(V6,{ref:b,agent:s,agents:f.agents,onChange:o})]}),T.jsxs("div",{children:[T.jsx("div",{className:"block text-sm font-medium text-foreground mb-2",children:"Provider / Model"}),T.jsx(G6,{ref:x,provider:l,model:u,onChange:y})]})]}):null})}const K6=K.memo(K.forwardRef(function({sessionId:t,userContext:n,onNewSession:i},s){const l=z6(t),[u,o]=K.useState(""),[d,h]=K.useState(""),[p,f]=K.useState(""),[g,b]=K.useState(!1),[x,E]=K.useState(null),[y,S]=K.useState(0),v=K.useRef(null),_=j6(t),C=q6(t);K.useEffect(()=>{l&&(o(l.agent),h(l.provider),f(l.model))},[l]),K.useEffect(()=>{S(G=>G+1)},[]),K.useImperativeHandle(s,()=>({focus:()=>{v.current?.focus()}}));const N=K.useCallback(async G=>{try{await _.mutateAsync({content:G,agent:u||void 0,provider:d||void 0,model:p||void 0,userContext:n||void 0})}catch(V){console.error("Failed to send message:",V)}},[_,u,d,p,n]),A=K.useCallback(()=>{b(G=>!G)},[]),O=K.useCallback(()=>{b(!1),E(null)},[]),R=K.useCallback(G=>{G==="models"?(E("model"),b(!0)):G==="agents"?(E("agent"),b(!0)):G==="new"&&i?.()},[i]),I=K.useCallback(async G=>{o(G);try{await C.mutateAsync({agent:G})}catch(V){console.error("Failed to update agent:",V)}},[C]),L=K.useCallback(async(G,V)=>{h(G),f(V);try{await C.mutateAsync({provider:G,model:V})}catch(W){console.error("Failed to update model:",W)}},[C]),F=K.useCallback(async G=>{if(h(G),p)try{await C.mutateAsync({provider:G,model:p})}catch(V){console.error("Failed to update provider:",V)}},[p,C]),j=K.useCallback(async G=>{f(G);try{await C.mutateAsync({provider:d,model:G})}catch(V){console.error("Failed to update model:",V)}},[d,C]),z=K.useCallback(async G=>{const V=G?"plan":"build";o(V);try{await C.mutateAsync({agent:V})}catch(W){console.error("Failed to switch agent:",W)}},[C]);return T.jsxs(T.Fragment,{children:[T.jsx(W6,{isOpen:g,onClose:O,initialFocus:x,chatInputRef:v,agent:u,provider:d,model:p,onAgentChange:I,onProviderChange:F,onModelChange:j,onModelSelectorChange:L}),T.jsx(P6,{ref:v,onSend:N,onCommand:R,disabled:_.isPending,onConfigClick:A,onPlanModeToggle:z,isPlanMode:u==="plan"},y)]})}));function Y6({sessionId:e,onStop:t,disabled:n}){const[i,s]=K.useState(!1),l=async()=>{if(!i){s(!0);try{await Dt.abortSession(e),t?.()}catch(u){console.error("Failed to abort stream:",u)}finally{setTimeout(()=>s(!1),1e3)}}};return T.jsxs("button",{type:"button",onClick:l,disabled:n||i,className:"flex items-center gap-1.5 text-sm text-destructive hover:text-destructive/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"Stop generation",children:[T.jsx(hF,{className:"w-4 h-4"}),T.jsx("span",{className:"font-medium",children:i?"Stopping...":"Stop"})]})}function X6(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Z6=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q6=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J6={};function Yw(e,t){return(J6.jsx?Q6:Z6).test(e)}const ej=/[ \t\n\f\r]/g;function tj(e){return typeof e=="object"?e.type==="text"?Xw(e.value):!1:Xw(e)}function Xw(e){return e.replace(ej,"")===""}class No{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}No.prototype.normal={};No.prototype.property={};No.prototype.space=void 0;function dI(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new No(n,i,t)}function mv(e){return e.toLowerCase()}class gn{constructor(t,n){this.attribute=n,this.property=t}}gn.prototype.attribute="";gn.prototype.booleanish=!1;gn.prototype.boolean=!1;gn.prototype.commaOrSpaceSeparated=!1;gn.prototype.commaSeparated=!1;gn.prototype.defined=!1;gn.prototype.mustUseProperty=!1;gn.prototype.number=!1;gn.prototype.overloadedBoolean=!1;gn.prototype.property="";gn.prototype.spaceSeparated=!1;gn.prototype.space=void 0;let nj=0;const Ue=Ji(),Nt=Ji(),gv=Ji(),ye=Ji(),lt=Ji(),Ka=Ji(),Cn=Ji();function Ji(){return 2**++nj}const bv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Nt,commaOrSpaceSeparated:Cn,commaSeparated:Ka,number:ye,overloadedBoolean:gv,spaceSeparated:lt},Symbol.toStringTag,{value:"Module"})),$h=Object.keys(bv);class n_ extends gn{constructor(t,n,i,s){let l=-1;if(super(t,n),Zw(this,"space",s),typeof i=="number")for(;++l<$h.length;){const u=$h[l];Zw(this,$h[l],(i&bv[u])===bv[u])}}}n_.prototype.defined=!0;function Zw(e,t,n){n&&(e[t]=n)}function rs(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const l=new n_(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[mv(i)]=i,n[mv(l.attribute)]=i}return new No(t,n,e.space)}const hI=rs({properties:{ariaActiveDescendant:null,ariaAtomic:Nt,ariaAutoComplete:null,ariaBusy:Nt,ariaChecked:Nt,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:lt,ariaCurrent:null,ariaDescribedBy:lt,ariaDetails:null,ariaDisabled:Nt,ariaDropEffect:lt,ariaErrorMessage:null,ariaExpanded:Nt,ariaFlowTo:lt,ariaGrabbed:Nt,ariaHasPopup:null,ariaHidden:Nt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lt,ariaLevel:ye,ariaLive:null,ariaModal:Nt,ariaMultiLine:Nt,ariaMultiSelectable:Nt,ariaOrientation:null,ariaOwns:lt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Nt,ariaReadOnly:Nt,ariaRelevant:null,ariaRequired:Nt,ariaRoleDescription:lt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Nt,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function fI(e,t){return t in e?e[t]:t}function pI(e,t){return fI(e,t.toLowerCase())}const rj=rs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ka,acceptCharset:lt,accessKey:lt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:lt,autoFocus:Ue,autoPlay:Ue,blocking:lt,capture:null,charSet:null,checked:Ue,cite:null,className:lt,cols:ye,colSpan:null,content:null,contentEditable:Nt,controls:Ue,controlsList:lt,coords:ye|Ka,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:gv,draggable:Nt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:lt,height:ye,hidden:gv,high:ye,href:null,hrefLang:null,htmlFor:lt,httpEquiv:lt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:lt,itemRef:lt,itemScope:Ue,itemType:lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:ye,pattern:null,ping:lt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:lt,required:Ue,reversed:Ue,rows:ye,rowSpan:ye,sandbox:lt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Nt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Nt,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Nt,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:pI}),ij=rs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cn,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:lt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ka,g2:Ka,glyphName:Ka,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:Cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cn,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fI}),mI=rs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gI=rs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pI}),bI=rs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),aj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sj=/[A-Z]/g,Qw=/-[a-z]/g,oj=/^data[-\w.:]+$/i;function lj(e,t){const n=mv(t);let i=t,s=gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oj.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Qw,uj);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Qw.test(l)){let u=l.replace(sj,cj);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=n_}return new s(i,t)}function cj(e){return"-"+e.toLowerCase()}function uj(e){return e.charAt(1).toUpperCase()}const dj=dI([hI,rj,mI,gI,bI],"html"),r_=dI([hI,ij,mI,gI,bI],"svg");function hj(e){return e.join(" ").trim()}var Ha={},Gh,Jw;function fj(){if(Jw)return Gh;Jw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,d=`
|
|
36
36
|
`,h="/",p="*",f="",g="comment",b="declaration";function x(y,S){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];S=S||{};var v=1,_=1;function C(G){var V=G.match(t);V&&(v+=V.length);var W=G.lastIndexOf(d);_=~W?G.length-W:_+G.length}function N(){var G={line:v,column:_};return function(V){return V.position=new A(G),I(),V}}function A(G){this.start=G,this.end={line:v,column:_},this.source=S.source}A.prototype.content=y;function O(G){var V=new Error(S.source+":"+v+":"+_+": "+G);if(V.reason=G,V.filename=S.source,V.line=v,V.column=_,V.source=y,!S.silent)throw V}function R(G){var V=G.exec(y);if(V){var W=V[0];return C(W),y=y.slice(W.length),V}}function I(){R(n)}function L(G){var V;for(G=G||[];V=F();)V!==!1&&G.push(V);return G}function F(){var G=N();if(!(h!=y.charAt(0)||p!=y.charAt(1))){for(var V=2;f!=y.charAt(V)&&(p!=y.charAt(V)||h!=y.charAt(V+1));)++V;if(V+=2,f===y.charAt(V-1))return O("End of comment missing");var W=y.slice(2,V-2);return _+=2,C(W),y=y.slice(V),_+=2,G({type:g,comment:W})}}function j(){var G=N(),V=R(i);if(V){if(F(),!R(s))return O("property missing ':'");var W=R(l),Z=G({type:b,property:E(V[0].replace(e,f)),value:W?E(W[0].replace(e,f)):f});return R(u),Z}}function z(){var G=[];L(G);for(var V;V=j();)V!==!1&&(G.push(V),L(G));return G}return I(),z()}function E(y){return y?y.replace(o,f):f}return Gh=x,Gh}var e1;function pj(){if(e1)return Ha;e1=1;var e=Ha&&Ha.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.default=n;const t=e(fj());function n(i,s){let l=null;if(!i||typeof i!="string")return l;const u=(0,t.default)(i),o=typeof s=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;o?s(h,p,d):p&&(l=l||{},l[h]=p)}),l}return Ha}var io={},t1;function mj(){if(t1)return io;t1=1,Object.defineProperty(io,"__esModule",{value:!0}),io.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},u=function(h,p){return p.toUpperCase()},o=function(h,p){return"".concat(p,"-")},d=function(h,p){return p===void 0&&(p={}),l(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,o):h=h.replace(i,o),h.replace(t,u))};return io.camelCase=d,io}var ao,n1;function gj(){if(n1)return ao;n1=1;var e=ao&&ao.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(pj()),n=mj();function i(s,l){var u={};return!s||typeof s!="string"||(0,t.default)(s,function(o,d){o&&d&&(u[(0,n.camelCase)(o,l)]=d)}),u}return i.default=i,ao=i,ao}var bj=gj();const yj=Bc(bj),yI=vI("end"),i_=vI("start");function vI(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function vj(e){const t=i_(e),n=yI(e);if(t&&n)return{start:t,end:n}}function fo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?r1(e.position):"start"in e||"end"in e?r1(e):"line"in e||"column"in e?yv(e):""}function yv(e){return i1(e&&e.line)+":"+i1(e&&e.column)}function r1(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function i1(e){return e&&typeof e=="number"?e:1}class Zt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(u=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?l.ruleId=i:(l.source=i.slice(0,d),l.ruleId=i.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=fo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zt.prototype.file="";Zt.prototype.name="";Zt.prototype.reason="";Zt.prototype.message="";Zt.prototype.stack="";Zt.prototype.column=void 0;Zt.prototype.line=void 0;Zt.prototype.ancestors=void 0;Zt.prototype.cause=void 0;Zt.prototype.fatal=void 0;Zt.prototype.place=void 0;Zt.prototype.ruleId=void 0;Zt.prototype.source=void 0;const a_={}.hasOwnProperty,_j=new Map,Sj=/[A-Z]/g,Ej=new Set(["table","tbody","thead","tfoot","tr"]),xj=new Set(["td","th"]),_I="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wj(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Ij(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Oj(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?r_:dj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=SI(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function SI(e,t,n){if(t.type==="element")return Cj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Tj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kj(e,t,n);if(t.type==="mdxjsEsm")return Aj(e,t);if(t.type==="root")return Rj(e,t,n);if(t.type==="text")return Nj(e,t)}function Cj(e,t,n){const i=e.schema;let s=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=r_,e.schema=s),e.ancestors.push(t);const l=xI(e,t.tagName,!1),u=Lj(e,t);let o=o_(e,t);return Ej.has(t.tagName)&&(o=o.filter(function(d){return typeof d=="string"?!tj(d):!0})),EI(e,u,l,t),s_(u,o),e.ancestors.pop(),e.schema=i,e.create(t,l,u,n)}function Tj(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}_o(e,t.position)}function Aj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_o(e,t.position)}function kj(e,t,n){const i=e.schema;let s=i;t.name==="svg"&&i.space==="html"&&(s=r_,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:xI(e,t.name,!0),u=Dj(e,t),o=o_(e,t);return EI(e,u,l,t),s_(u,o),e.ancestors.pop(),e.schema=i,e.create(t,l,u,n)}function Rj(e,t,n){const i={};return s_(i,o_(e,t)),e.create(t,e.Fragment,i,n)}function Nj(e,t){return t.value}function EI(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function s_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Oj(e,t,n){return i;function i(s,l,u,o){const h=Array.isArray(u.children)?n:t;return o?h(l,u,o):h(l,u)}}function Ij(e,t){return n;function n(i,s,l,u){const o=Array.isArray(l.children),d=i_(i);return t(s,l,u,o,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Lj(e,t){const n={};let i,s;for(s in t.properties)if(s!=="children"&&a_.call(t.properties,s)){const l=Mj(e,s,t.properties[s]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&xj.has(t.tagName)?i=o:n[u]=o}}if(i){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Dj(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else _o(e,t.position);else{const s=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const o=i.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else _o(e,t.position);else l=i.value===null?!0:i.value;n[s]=l}return n}function o_(e,t){const n=[];let i=-1;const s=e.passKeys?new Map:_j;for(;++i<t.children.length;){const l=t.children[i];let u;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const h=s.get(d)||0;u=d+"-"+h,s.set(d,h+1)}}const o=SI(e,l,u);o!==void 0&&n.push(o)}return n}function Mj(e,t,n){const i=lj(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?X6(n):hj(n)),i.property==="style"){let s=typeof n=="object"?n:Bj(e,String(n));return e.stylePropertyNameCase==="css"&&(s=Fj(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?aj[i.property]||i.property:i.attribute,n]}}function Bj(e,t){try{return yj(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,s=new Zt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=_I+"#cannot-parse-style-attribute",s}}function xI(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,u;for(;++l<s.length;){const o=Yw(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}i=u}else i=Yw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const s=i.value;return a_.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);_o(e)}function _o(e,t){const n=new Zt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=_I+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Fj(e){const t={};let n;for(n in e)a_.call(e,n)&&(t[Pj(n)]=e[n]);return t}function Pj(e){let t=e.replace(Sj,Uj);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Uj(e){return"-"+e.toLowerCase()}const Vh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},jj={};function l_(e,t){const n=jj,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wI(e,i,s)}function wI(e,t,n){if(zj(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return a1(e.children,t,n)}return Array.isArray(e)?a1(e,t,n):""}function a1(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=wI(e[s],t,n);return i.join("")}function zj(e){return!!(e&&typeof e=="object")}const s1=document.createElement("i");function c_(e){const t="&"+e+";";s1.innerHTML=t;const n=s1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rn(e,t,n,i){const s=e.length;let l=0,u;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)u=Array.from(i),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<i.length;)u=i.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function $n(e,t){return e.length>0?(Rn(e,e.length,0,t),e):t}const o1={}.hasOwnProperty;function CI(e){const t={};let n=-1;for(;++n<e.length;)Hj(t,e[n]);return t}function Hj(e,t){let n;for(n in t){const s=(o1.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){o1.call(s,u)||(s[u]=[]);const o=l[u];qj(s[u],Array.isArray(o)?o:o?[o]:[])}}}function qj(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Rn(e,0,0,i)}function TI(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=yi(/[A-Za-z]/),Xt=yi(/[\dA-Za-z]/),$j=yi(/[#-'*+\--9=?A-Z^-~]/);function Ic(e){return e!==null&&(e<32||e===127)}const vv=yi(/\d/),Gj=yi(/[\dA-Fa-f]/),Vj=yi(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const Zc=yi(new RegExp("\\p{P}|\\p{S}","u")),Qi=yi(/\s/);function yi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function is(e){const t=[];let n=-1,i=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&Xt(e.charCodeAt(n+1))&&Xt(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),s=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(i,n),encodeURIComponent(u)),i=n+s+1,u=""),s&&(n+=s,s=0)}return t.join("")+e.slice(i)}function Ye(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(d){return Ge(d)?(e.enter(n),o(d)):t(d)}function o(d){return Ge(d)&&l++<s?(e.consume(d),o):(e.exit(n),t(d))}}const Wj={tokenize:Kj};function Kj(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let n;return t;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ye(e,t,"linePrefix")}function s(o){return e.enter("paragraph"),l(o)}function l(o){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,u(o)}function u(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Te(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),u)}}const Yj={tokenize:Xj},l1={tokenize:Zj};function Xj(e){const t=this,n=[];let i=0,s,l,u;return o;function o(_){if(i<n.length){const C=n[i];return t.containerState=C[1],e.attempt(C[0].continuation,d,h)(_)}return h(_)}function d(_){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&v();const C=t.events.length;let N=C,A;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){A=t.events[N][1].end;break}S(i);let O=C;for(;O<t.events.length;)t.events[O][1].end={...A},O++;return Rn(t.events,N+1,0,t.events.slice(C)),t.events.length=O,h(_)}return o(_)}function h(_){if(i===n.length){if(!s)return g(_);if(s.currentConstruct&&s.currentConstruct.concrete)return x(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(l1,p,f)(_)}function p(_){return s&&v(),S(i),g(_)}function f(_){return t.parser.lazy[t.now().line]=i!==n.length,u=t.now().offset,x(_)}function g(_){return t.containerState={},e.attempt(l1,b,x)(_)}function b(_){return i++,n.push([t.currentConstruct,t.containerState]),g(_)}function x(_){if(_===null){s&&v(),S(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),E(_)}function E(_){if(_===null){y(e.exit("chunkFlow"),!0),S(0),e.consume(_);return}return Te(_)?(e.consume(_),y(e.exit("chunkFlow")),i=0,t.interrupt=void 0,o):(e.consume(_),E)}function y(_,C){const N=t.sliceStream(_);if(C&&N.push(null),_.previous=l,l&&(l.next=_),l=_,s.defineSkip(_.start),s.write(N),t.parser.lazy[_.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<u&&(!s.events[A][1].end||s.events[A][1].end.offset>u))return;const O=t.events.length;let R=O,I,L;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(I){L=t.events[R][1].end;break}I=!0}for(S(i),A=O;A<t.events.length;)t.events[A][1].end={...L},A++;Rn(t.events,R+1,0,t.events.slice(O)),t.events.length=A}}function S(_){let C=n.length;for(;C-- >_;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=_}function v(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function Zj(e,t,n){return Ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ja(e){if(e===null||ot(e)||Qi(e))return 1;if(Zc(e))return 2}function Qc(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!i.includes(l)&&(t=l(t,n),i.push(l))}return t}const _v={name:"attention",resolveAll:Qj,tokenize:Jj};function Qj(e,t){let n=-1,i,s,l,u,o,d,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},g={...e[n][1].start};c1(f,-d),c1(g,d),u={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},o={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},l={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[i][1].end={...u.start},e[n][1].start={...o.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=$n(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=$n(h,[["enter",s,t],["enter",u,t],["exit",u,t],["enter",l,t]]),h=$n(h,Qc(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=$n(h,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=$n(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Rn(e,i-1,n-i+3,h),n=i+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Jj(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Ja(i);let l;return u;function u(d){return l=d,e.enter("attentionSequence"),o(d)}function o(d){if(d===l)return e.consume(d),o;const h=e.exit("attentionSequence"),p=Ja(d),f=!p||p===2&&s||n.includes(d),g=!s||s===2&&p||n.includes(i);return h._open=!!(l===42?f:f&&(s||!g)),h._close=!!(l===42?g:g&&(p||!f)),t(d)}}function c1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const e5={name:"autolink",tokenize:t5};function t5(e,t,n){let i=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return en(b)?(e.consume(b),u):b===64?n(b):h(b)}function u(b){return b===43||b===45||b===46||Xt(b)?(i=1,o(b)):h(b)}function o(b){return b===58?(e.consume(b),i=0,d):(b===43||b===45||b===46||Xt(b))&&i++<32?(e.consume(b),o):(i=0,h(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Ic(b)?n(b):(e.consume(b),d)}function h(b){return b===64?(e.consume(b),p):$j(b)?(e.consume(b),h):n(b)}function p(b){return Xt(b)?f(b):n(b)}function f(b){return b===46?(e.consume(b),i=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):g(b)}function g(b){if((b===45||Xt(b))&&i++<63){const x=b===45?g:f;return e.consume(b),x}return n(b)}}const Oo={partial:!0,tokenize:n5};function n5(e,t,n){return i;function i(l){return Ge(l)?Ye(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Te(l)?t(l):n(l)}}const AI={continuation:{tokenize:i5},exit:a5,name:"blockQuote",tokenize:r5};function r5(e,t,n){const i=this;return s;function s(u){if(u===62){const o=i.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return Ge(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function i5(e,t,n){const i=this;return s;function s(u){return Ge(u)?Ye(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(AI,t,n)(u)}}function a5(e){e.exit("blockQuote")}const kI={name:"characterEscape",tokenize:s5};function s5(e,t,n){return i;function i(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return Vj(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const RI={name:"characterReference",tokenize:o5};function o5(e,t,n){const i=this;let s=0,l,u;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),d}function d(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,u=Xt,p(f))}function h(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=Gj,p):(e.enter("characterReferenceValue"),l=7,u=vv,p(f))}function p(f){if(f===59&&s){const g=e.exit("characterReferenceValue");return u===Xt&&!c_(i.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(f)&&s++<l?(e.consume(f),p):n(f)}}const u1={partial:!0,tokenize:c5},d1={concrete:!0,name:"codeFenced",tokenize:l5};function l5(e,t,n){const i=this,s={partial:!0,tokenize:N};let l=0,u=0,o;return d;function d(A){return h(A)}function h(A){const O=i.events[i.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===o?(u++,e.consume(A),p):u<3?n(A):(e.exit("codeFencedFenceSequence"),Ge(A)?Ye(e,f,"whitespace")(A):f(A))}function f(A){return A===null||Te(A)?(e.exit("codeFencedFence"),i.interrupt?t(A):e.check(u1,E,C)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||Te(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(A)):Ge(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ye(e,b,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),g)}function b(A){return A===null||Te(A)?f(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Te(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(A)):A===96&&A===o?n(A):(e.consume(A),x)}function E(A){return e.attempt(s,C,y)(A)}function y(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return l>0&&Ge(A)?Ye(e,v,"linePrefix",l+1)(A):v(A)}function v(A){return A===null||Te(A)?e.check(u1,E,C)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||Te(A)?(e.exit("codeFlowValue"),v(A)):(e.consume(A),_)}function C(A){return e.exit("codeFenced"),t(A)}function N(A,O,R){let I=0;return L;function L(V){return A.enter("lineEnding"),A.consume(V),A.exit("lineEnding"),F}function F(V){return A.enter("codeFencedFence"),Ge(V)?Ye(A,j,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):j(V)}function j(V){return V===o?(A.enter("codeFencedFenceSequence"),z(V)):R(V)}function z(V){return V===o?(I++,A.consume(V),z):I>=u?(A.exit("codeFencedFenceSequence"),Ge(V)?Ye(A,G,"whitespace")(V):G(V)):R(V)}function G(V){return V===null||Te(V)?(A.exit("codeFencedFence"),O(V)):R(V)}}}function c5(e,t,n){const i=this;return s;function s(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}const Wh={name:"codeIndented",tokenize:d5},u5={partial:!0,tokenize:h5};function d5(e,t,n){const i=this;return s;function s(h){return e.enter("codeIndented"),Ye(e,l,"linePrefix",5)(h)}function l(h){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?d(h):Te(h)?e.attempt(u5,u,d)(h):(e.enter("codeFlowValue"),o(h))}function o(h){return h===null||Te(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),o)}function d(h){return e.exit("codeIndented"),t(h)}}function h5(e,t,n){const i=this;return s;function s(u){return i.parser.lazy[i.now().line]?n(u):Te(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):Ye(e,l,"linePrefix",5)(u)}function l(u){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Te(u)?s(u):n(u)}}const f5={name:"codeText",previous:m5,resolve:p5,tokenize:g5};function p5(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function m5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function g5(e,t,n){let i=0,s,l;return u;function u(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),i++,o):(e.exit("codeTextSequence"),d(f))}function d(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),d):f===96?(l=e.enter("codeTextSequence"),s=0,p(f)):Te(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(f))}function h(f){return f===null||f===32||f===96||Te(f)?(e.exit("codeTextData"),d(f)):(e.consume(f),h)}function p(f){return f===96?(e.consume(f),s++,p):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(l.type="codeTextData",h(f))}}class b5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&so(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),so(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),so(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);so(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);so(this.left,n.reverse())}}}function so(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function NI(e){const t={};let n=-1,i,s,l,u,o,d,h;const p=new b5(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,y5(p,n)),n=t[n],h=!0);else if(i[1]._container){for(l=n,s=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(i[1].end={...p.get(s)[1].start},o=p.slice(s,n),o.unshift(i),p.splice(s,n-s+1,o))}}return Rn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function y5(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const l=[];let u=n._tokenizer;u||(u=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,d=[],h={};let p,f,g=-1,b=n,x=0,E=0;const y=[E];for(;b;){for(;e.get(++s)[1]!==b;);l.push(s),b._tokenizer||(p=i.sliceStream(b),b.next||p.push(null),f&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),f=b,b=b.next}for(b=n;++g<o.length;)o[g][0]==="exit"&&o[g-1][0]==="enter"&&o[g][1].type===o[g-1][1].type&&o[g][1].start.line!==o[g][1].end.line&&(E=g+1,y.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):y.pop(),g=y.length;g--;){const S=o.slice(y[g],y[g+1]),v=l.pop();d.push([v,v+S.length-1]),e.splice(v,2,S)}for(d.reverse(),g=-1;++g<d.length;)h[x+d[g][0]]=x+d[g][1],x+=d[g][1]-d[g][0]-1;return h}const v5={resolve:S5,tokenize:E5},_5={partial:!0,tokenize:x5};function S5(e){return NI(e),e}function E5(e,t){let n;return i;function i(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(o)}function s(o){return o===null?l(o):Te(o)?e.check(_5,u,l)(o):(e.consume(o),s)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function u(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function x5(e,t,n){const i=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ye(e,l,"linePrefix")}function l(u){if(u===null||Te(u))return n(u);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):e.interrupt(i.parser.constructs.flow,n,t)(u)}}function OI(e,t,n,i,s,l,u,o,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return f;function f(S){return S===60?(e.enter(i),e.enter(s),e.enter(l),e.consume(S),e.exit(l),g):S===null||S===32||S===41||Ic(S)?n(S):(e.enter(i),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),E(S))}function g(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(s),e.exit(i),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(e.exit("chunkString"),e.exit(o),g(S)):S===null||S===60||Te(S)?n(S):(e.consume(S),S===92?x:b)}function x(S){return S===60||S===62||S===92?(e.consume(S),b):b(S)}function E(S){return!p&&(S===null||S===41||ot(S))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(i),t(S)):p<h&&S===40?(e.consume(S),p++,E):S===41?(e.consume(S),p--,E):S===null||S===32||S===40||Ic(S)?n(S):(e.consume(S),S===92?y:E)}function y(S){return S===40||S===41||S===92?(e.consume(S),E):E(S)}}function II(e,t,n,i,s,l){const u=this;let o=0,d;return h;function h(b){return e.enter(i),e.enter(s),e.consume(b),e.exit(s),e.enter(l),p}function p(b){return o>999||b===null||b===91||b===93&&!d||b===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(b):b===93?(e.exit(l),e.enter(s),e.consume(b),e.exit(s),e.exit(i),t):Te(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||b===91||b===93||Te(b)||o++>999?(e.exit("chunkString"),p(b)):(e.consume(b),d||(d=!Ge(b)),b===92?g:f)}function g(b){return b===91||b===92||b===93?(e.consume(b),o++,f):f(b)}}function LI(e,t,n,i,s,l){let u;return o;function o(g){return g===34||g===39||g===40?(e.enter(i),e.enter(s),e.consume(g),e.exit(s),u=g===40?41:g,d):n(g)}function d(g){return g===u?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),t):(e.enter(l),h(g))}function h(g){return g===u?(e.exit(l),d(u)):g===null?n(g):Te(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Ye(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===u||g===null||Te(g)?(e.exit("chunkString"),h(g)):(e.consume(g),g===92?f:p)}function f(g){return g===u||g===92?(e.consume(g),p):p(g)}}function po(e,t){let n;return i;function i(s){return Te(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):Ge(s)?Ye(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const w5={name:"definition",tokenize:T5},C5={partial:!0,tokenize:A5};function T5(e,t,n){const i=this;let s;return l;function l(b){return e.enter("definition"),u(b)}function u(b){return II.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function o(b){return s=Yn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return ot(b)?po(e,h)(b):h(b)}function h(b){return OI(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(C5,f,f)(b)}function f(b){return Ge(b)?Ye(e,g,"whitespace")(b):g(b)}function g(b){return b===null||Te(b)?(e.exit("definition"),i.parser.defined.push(s),t(b)):n(b)}}function A5(e,t,n){return i;function i(o){return ot(o)?po(e,s)(o):n(o)}function s(o){return LI(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Ge(o)?Ye(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Te(o)?t(o):n(o)}}const k5={name:"hardBreakEscape",tokenize:R5};function R5(e,t,n){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Te(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const N5={name:"headingAtx",resolve:O5,tokenize:I5};function O5(e,t){let n=e.length-2,i=3,s,l;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},l={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Rn(e,i,n-i+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function I5(e,t,n){let i=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&i++<6?(e.consume(p),u):p===null||ot(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Te(p)?(e.exit("atxHeading"),t(p)):Ge(p)?Ye(e,o,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),o(p))}function h(p){return p===null||p===35||ot(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),h)}}const L5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],h1=["pre","script","style","textarea"],D5={concrete:!0,name:"htmlFlow",resolveTo:F5,tokenize:P5},M5={partial:!0,tokenize:j5},B5={partial:!0,tokenize:U5};function F5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function P5(e,t,n){const i=this;let s,l,u,o,d;return h;function h(U){return p(U)}function p(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),g):U===47?(e.consume(U),l=!0,E):U===63?(e.consume(U),s=3,i.interrupt?t:D):en(U)?(e.consume(U),u=String.fromCharCode(U),y):n(U)}function g(U){return U===45?(e.consume(U),s=2,b):U===91?(e.consume(U),s=5,o=0,x):en(U)?(e.consume(U),s=4,i.interrupt?t:D):n(U)}function b(U){return U===45?(e.consume(U),i.interrupt?t:D):n(U)}function x(U){const ee="CDATA[";return U===ee.charCodeAt(o++)?(e.consume(U),o===ee.length?i.interrupt?t:j:x):n(U)}function E(U){return en(U)?(e.consume(U),u=String.fromCharCode(U),y):n(U)}function y(U){if(U===null||U===47||U===62||ot(U)){const ee=U===47,le=u.toLowerCase();return!ee&&!l&&h1.includes(le)?(s=1,i.interrupt?t(U):j(U)):L5.includes(u.toLowerCase())?(s=6,ee?(e.consume(U),S):i.interrupt?t(U):j(U)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):l?v(U):_(U))}return U===45||Xt(U)?(e.consume(U),u+=String.fromCharCode(U),y):n(U)}function S(U){return U===62?(e.consume(U),i.interrupt?t:j):n(U)}function v(U){return Ge(U)?(e.consume(U),v):L(U)}function _(U){return U===47?(e.consume(U),L):U===58||U===95||en(U)?(e.consume(U),C):Ge(U)?(e.consume(U),_):L(U)}function C(U){return U===45||U===46||U===58||U===95||Xt(U)?(e.consume(U),C):N(U)}function N(U){return U===61?(e.consume(U),A):Ge(U)?(e.consume(U),N):_(U)}function A(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),d=U,O):Ge(U)?(e.consume(U),A):R(U)}function O(U){return U===d?(e.consume(U),d=null,I):U===null||Te(U)?n(U):(e.consume(U),O)}function R(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ot(U)?N(U):(e.consume(U),R)}function I(U){return U===47||U===62||Ge(U)?_(U):n(U)}function L(U){return U===62?(e.consume(U),F):n(U)}function F(U){return U===null||Te(U)?j(U):Ge(U)?(e.consume(U),F):n(U)}function j(U){return U===45&&s===2?(e.consume(U),W):U===60&&s===1?(e.consume(U),Z):U===62&&s===4?(e.consume(U),B):U===63&&s===3?(e.consume(U),D):U===93&&s===5?(e.consume(U),P):Te(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(M5,H,z)(U)):U===null||Te(U)?(e.exit("htmlFlowData"),z(U)):(e.consume(U),j)}function z(U){return e.check(B5,G,H)(U)}function G(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),V}function V(U){return U===null||Te(U)?z(U):(e.enter("htmlFlowData"),j(U))}function W(U){return U===45?(e.consume(U),D):j(U)}function Z(U){return U===47?(e.consume(U),u="",J):j(U)}function J(U){if(U===62){const ee=u.toLowerCase();return h1.includes(ee)?(e.consume(U),B):j(U)}return en(U)&&u.length<8?(e.consume(U),u+=String.fromCharCode(U),J):j(U)}function P(U){return U===93?(e.consume(U),D):j(U)}function D(U){return U===62?(e.consume(U),B):U===45&&s===2?(e.consume(U),D):j(U)}function B(U){return U===null||Te(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),B)}function H(U){return e.exit("htmlFlow"),t(U)}}function U5(e,t,n){const i=this;return s;function s(u){return Te(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}function j5(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Oo,t,n)}}const z5={name:"htmlText",tokenize:H5};function H5(e,t,n){const i=this;let s,l,u;return o;function o(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),N):D===63?(e.consume(D),_):en(D)?(e.consume(D),R):n(D)}function h(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),l=0,x):en(D)?(e.consume(D),v):n(D)}function p(D){return D===45?(e.consume(D),b):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),g):Te(D)?(u=f,Z(D)):(e.consume(D),f)}function g(D){return D===45?(e.consume(D),b):f(D)}function b(D){return D===62?W(D):D===45?g(D):f(D)}function x(D){const B="CDATA[";return D===B.charCodeAt(l++)?(e.consume(D),l===B.length?E:x):n(D)}function E(D){return D===null?n(D):D===93?(e.consume(D),y):Te(D)?(u=E,Z(D)):(e.consume(D),E)}function y(D){return D===93?(e.consume(D),S):E(D)}function S(D){return D===62?W(D):D===93?(e.consume(D),S):E(D)}function v(D){return D===null||D===62?W(D):Te(D)?(u=v,Z(D)):(e.consume(D),v)}function _(D){return D===null?n(D):D===63?(e.consume(D),C):Te(D)?(u=_,Z(D)):(e.consume(D),_)}function C(D){return D===62?W(D):_(D)}function N(D){return en(D)?(e.consume(D),A):n(D)}function A(D){return D===45||Xt(D)?(e.consume(D),A):O(D)}function O(D){return Te(D)?(u=O,Z(D)):Ge(D)?(e.consume(D),O):W(D)}function R(D){return D===45||Xt(D)?(e.consume(D),R):D===47||D===62||ot(D)?I(D):n(D)}function I(D){return D===47?(e.consume(D),W):D===58||D===95||en(D)?(e.consume(D),L):Te(D)?(u=I,Z(D)):Ge(D)?(e.consume(D),I):W(D)}function L(D){return D===45||D===46||D===58||D===95||Xt(D)?(e.consume(D),L):F(D)}function F(D){return D===61?(e.consume(D),j):Te(D)?(u=F,Z(D)):Ge(D)?(e.consume(D),F):I(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),s=D,z):Te(D)?(u=j,Z(D)):Ge(D)?(e.consume(D),j):(e.consume(D),G)}function z(D){return D===s?(e.consume(D),s=void 0,V):D===null?n(D):Te(D)?(u=z,Z(D)):(e.consume(D),z)}function G(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||ot(D)?I(D):(e.consume(D),G)}function V(D){return D===47||D===62||ot(D)?I(D):n(D)}function W(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function Z(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),J}function J(D){return Ge(D)?Ye(e,P,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):P(D)}function P(D){return e.enter("htmlTextData"),u(D)}}const u_={name:"labelEnd",resolveAll:V5,resolveTo:W5,tokenize:K5},q5={tokenize:Y5},$5={tokenize:X5},G5={tokenize:Z5};function V5(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==n.length&&Rn(e,0,e.length,n),e}function W5(e,t){let n=e.length,i=0,s,l,u,o;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(u=n);const d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+i+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",d,t],["enter",h,t]],o=$n(o,e.slice(l+1,l+i+3)),o=$n(o,[["enter",p,t]]),o=$n(o,Qc(t.parser.constructs.insideSpan.null,e.slice(l+i+4,u-3),t)),o=$n(o,[["exit",p,t],e[u-2],e[u-1],["exit",h,t]]),o=$n(o,e.slice(u+1)),o=$n(o,[["exit",d,t]]),Rn(e,l,e.length,o),e}function K5(e,t,n){const i=this;let s=i.events.length,l,u;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){l=i.events[s][1];break}return o;function o(g){return l?l._inactive?f(g):(u=i.parser.defined.includes(Yn(i.sliceSerialize({start:l.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(q5,p,u?p:f)(g):g===91?e.attempt($5,p,u?h:f)(g):u?p(g):f(g)}function h(g){return e.attempt(G5,p,f)(g)}function p(g){return t(g)}function f(g){return l._balanced=!0,n(g)}}function Y5(e,t,n){return i;function i(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return ot(f)?po(e,l)(f):l(f)}function l(f){return f===41?p(f):OI(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function u(f){return ot(f)?po(e,d)(f):p(f)}function o(f){return n(f)}function d(f){return f===34||f===39||f===40?LI(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):p(f)}function h(f){return ot(f)?po(e,p)(f):p(f)}function p(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function X5(e,t,n){const i=this;return s;function s(o){return II.call(i,e,l,u,"reference","referenceMarker","referenceString")(o)}function l(o){return i.parser.defined.includes(Yn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function u(o){return n(o)}}function Z5(e,t,n){return i;function i(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const Q5={name:"labelStartImage",resolveAll:u_.resolveAll,tokenize:J5};function J5(e,t,n){const i=this;return s;function s(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),u):n(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const ez={name:"labelStartLink",resolveAll:u_.resolveAll,tokenize:tz};function tz(e,t,n){const i=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):t(u)}}const Kh={name:"lineEnding",tokenize:nz};function nz(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ye(e,t,"linePrefix")}}const uc={name:"thematicBreak",tokenize:rz};function rz(e,t,n){let i=0,s;return l;function l(h){return e.enter("thematicBreak"),u(h)}function u(h){return s=h,o(h)}function o(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):i>=3&&(h===null||Te(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),Ge(h)?Ye(e,o,"whitespace")(h):o(h))}}const dn={continuation:{tokenize:oz},exit:cz,name:"list",tokenize:sz},iz={partial:!0,tokenize:uz},az={partial:!0,tokenize:lz};function sz(e,t,n){const i=this,s=i.events[i.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return o;function o(b){const x=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:vv(b)){if(i.containerState.type||(i.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(uc,n,h)(b):h(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return vv(b)&&++u<10?(e.consume(b),d):(!i.interrupt||u<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(Oo,i.interrupt?n:p,e.attempt(iz,g,f))}function p(b){return i.containerState.initialBlankLine=!0,l++,g(b)}function f(b){return Ge(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function oz(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Oo,s,l);function s(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ye(e,t,"listItemIndent",i.containerState.size+1)(o)}function l(o){return i.containerState.furtherBlankLines||!Ge(o)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(o)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(az,t,u)(o))}function u(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ye(e,e.attempt(dn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function lz(e,t,n){const i=this;return Ye(e,s,"listItemIndent",i.containerState.size+1);function s(l){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?t(l):n(l)}}function cz(e){e.exit(this.containerState.type)}function uz(e,t,n){const i=this;return Ye(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const u=i.events[i.events.length-1];return!Ge(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const f1={name:"setextUnderline",resolveTo:dz,tokenize:hz};function dz(e,t){let n=e.length,i,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",u,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=u,e.push(["exit",u,t]),e}function hz(e,t,n){const i=this;let s;return l;function l(h){let p=i.events.length,f;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){f=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),s=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===s?(e.consume(h),o):(e.exit("setextHeadingLineSequence"),Ge(h)?Ye(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Te(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const fz={tokenize:pz};function pz(e){const t=this,n=e.attempt(Oo,i,e.attempt(this.parser.constructs.flowInitial,s,Ye(e,e.attempt(this.parser.constructs.flow,s,e.attempt(v5,s)),"linePrefix")));return n;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const mz={resolveAll:MI()},gz=DI("string"),bz=DI("text");function DI(e){return{resolveAll:MI(e==="text"?yz:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],l=n.attempt(s,u,o);return u;function u(p){return h(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return h(p)?(n.exit("data"),l(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const f=s[p];let g=-1;if(f)for(;++g<f.length;){const b=f[g];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function MI(e){return t;function t(n,i){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,i):n}}function yz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let l=s.length,u=-1,o=0,d;for(;l--;){const h=s[l];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(h===-2)d=!0,o++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const h={type:n===e.length||d||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:i.start._bufferIndex+u,_index:i.start._index+l,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const vz={42:dn,43:dn,45:dn,48:dn,49:dn,50:dn,51:dn,52:dn,53:dn,54:dn,55:dn,56:dn,57:dn,62:AI},_z={91:w5},Sz={[-2]:Wh,[-1]:Wh,32:Wh},Ez={35:N5,42:uc,45:[f1,uc],60:D5,61:f1,95:uc,96:d1,126:d1},xz={38:RI,92:kI},wz={[-5]:Kh,[-4]:Kh,[-3]:Kh,33:Q5,38:RI,42:_v,60:[e5,z5],91:ez,92:[k5,kI],93:u_,95:_v,96:f5},Cz={null:[_v,mz]},Tz={null:[42,95]},Az={null:[]},kz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Tz,contentInitial:_z,disable:Az,document:vz,flow:Ez,flowInitial:Sz,insideSpan:Cz,string:xz,text:wz},Symbol.toStringTag,{value:"Module"}));function Rz(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let u=[],o=[];const d={attempt:O(N),check:O(A),consume:v,enter:_,exit:C,interrupt:O(A,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:x,parser:e,previous:null,sliceSerialize:g,sliceStream:b,write:f};let p=t.tokenize.call(h,d);return t.resolveAll&&l.push(t),h;function f(F){return u=$n(u,F),y(),u[u.length-1]!==null?[]:(R(t,0),h.events=Qc(l,h.events,h),h.events)}function g(F,j){return Oz(b(F),j)}function b(F){return Nz(u,F)}function x(){const{_bufferIndex:F,_index:j,line:z,column:G,offset:V}=i;return{_bufferIndex:F,_index:j,line:z,column:G,offset:V}}function E(F){s[F.line]=F.column,L()}function y(){let F;for(;i._index<u.length;){const j=u[i._index];if(typeof j=="string")for(F=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===F&&i._bufferIndex<j.length;)S(j.charCodeAt(i._bufferIndex));else S(j)}}function S(F){p=p(F)}function v(F){Te(F)?(i.line++,i.column=1,i.offset+=F===-3?2:1,L()):F!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=F}function _(F,j){const z=j||{};return z.type=F,z.start=x(),h.events.push(["enter",z,h]),o.push(z),z}function C(F){const j=o.pop();return j.end=x(),h.events.push(["exit",j,h]),j}function N(F,j){R(F,j.from)}function A(F,j){j.restore()}function O(F,j){return z;function z(G,V,W){let Z,J,P,D;return Array.isArray(G)?H(G):"tokenize"in G?H([G]):B(G);function B(ue){return X;function X($){const ie=$!==null&&ue[$],he=$!==null&&ue.null,be=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(he)?he:he?[he]:[]];return H(be)($)}}function H(ue){return Z=ue,J=0,ue.length===0?W:U(ue[J])}function U(ue){return X;function X($){return D=I(),P=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?le():ue.tokenize.call(j?Object.assign(Object.create(h),j):h,d,ee,le)($)}}function ee(ue){return F(P,D),V}function le(ue){return D.restore(),++J<Z.length?U(Z[J]):W}}}function R(F,j){F.resolveAll&&!l.includes(F)&&l.push(F),F.resolve&&Rn(h.events,j,h.events.length-j,F.resolve(h.events.slice(j),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function I(){const F=x(),j=h.previous,z=h.currentConstruct,G=h.events.length,V=Array.from(o);return{from:G,restore:W};function W(){i=F,h.previous=j,h.currentConstruct=z,h.events.length=G,o=V,L()}}function L(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function Nz(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let u;if(n===s)u=[e[n].slice(i,l)];else{if(u=e.slice(n,s),i>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(i):u.shift()}l>0&&u.push(e[s].slice(0,l))}return u}function Oz(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
|
|
37
37
|
`;break}case-3:{u=`\r
|
|
38
38
|
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&s)continue;u=" ";break}default:u=String.fromCharCode(l)}s=l===-2,i.push(u)}return i.join("")}function Iz(e){const i={constructs:CI([kz,...(e||{}).extensions||[]]),content:s(Wj),defined:[],document:s(Yj),flow:s(fz),lazy:{},string:s(gz),text:s(bz)};return i;function s(l){return u;function u(o){return Rz(i,l,o)}}}function Lz(e){for(;!NI(e););return e}const p1=/[\0\t\n\r]/g;function Dz(){let e=1,t="",n=!0,i;return s;function s(l,u,o){const d=[];let h,p,f,g,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),f=0,t="",n&&(l.charCodeAt(0)===65279&&f++,n=void 0);f<l.length;){if(p1.lastIndex=f,h=p1.exec(l),g=h&&h.index!==void 0?h.index:l.length,b=l.charCodeAt(g),!h){t=l.slice(f);break}if(b===10&&f===g&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),f<g&&(d.push(l.slice(f,g)),e+=g-f),b){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}f=g+1}return o&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Mz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Bz(e){return e.replace(Mz,Fz)}function Fz(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return TI(n.slice(l?2:1),l?16:10)}return c_(n)||e}const BI={}.hasOwnProperty;function Pz(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Uz(n)(Lz(Iz(n).document().write(Dz()(e,t,!0))))}function Uz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Mt),autolinkProtocol:I,autolinkEmail:I,atxHeading:l(He),blockQuote:l(he),characterEscape:I,characterReference:I,codeFenced:l(be),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(be,u),codeText:l(ge,u),codeTextData:I,data:I,codeFlowValue:I,definition:l(xe),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(ze),hardBreakEscape:l(De),hardBreakTrailing:l(De),htmlFlow:l(Ee,u),htmlFlowData:I,htmlText:l(Ee,u),htmlTextData:I,image:l(wt),label:u,link:l(Mt),listItem:l(Vt),listItemValue:g,listOrdered:l(ft,f),listUnordered:l(ft),paragraph:l(Bt),reference:U,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(He),strong:l(Ne),thematicBreak:l(je)},exit:{atxHeading:d(),atxHeadingSequence:N,autolink:d(),autolinkEmail:ie,autolinkProtocol:$,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:X,codeFenced:d(y),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:d(S),codeText:d(V),codeTextData:L,data:L,definition:d(),definitionDestinationString:C,definitionLabelString:v,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(j),hardBreakTrailing:d(j),htmlFlow:d(z),htmlFlowData:L,htmlText:d(G),htmlTextData:L,image:d(Z),label:P,labelText:J,lineEnding:F,link:d(W),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ee,resourceDestinationString:D,resourceTitleString:B,resource:H,setextHeading:d(R),setextHeadingLineSequence:O,setextHeadingText:A,strong:d(),thematicBreak:d()}};FI(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ce){let me={type:"root",children:[]};const ve={stack:[me],tokenStack:[],config:t,enter:o,exit:h,buffer:u,resume:p,data:n},Ce=[];let Ie=-1;for(;++Ie<ce.length;)if(ce[Ie][1].type==="listOrdered"||ce[Ie][1].type==="listUnordered")if(ce[Ie][0]==="enter")Ce.push(Ie);else{const pt=Ce.pop();Ie=s(ce,pt,Ie)}for(Ie=-1;++Ie<ce.length;){const pt=t[ce[Ie][0]];BI.call(pt,ce[Ie][1].type)&&pt[ce[Ie][1].type].call(Object.assign({sliceSerialize:ce[Ie][2].sliceSerialize},ve),ce[Ie][1])}if(ve.tokenStack.length>0){const pt=ve.tokenStack[ve.tokenStack.length-1];(pt[1]||m1).call(ve,void 0,pt[0])}for(me.position={start:oi(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:oi(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)me=t.transforms[Ie](me)||me;return me}function s(ce,me,ve){let Ce=me-1,Ie=-1,pt=!1,Fe,mt,at,dt;for(;++Ce<=ve;){const Je=ce[Ce];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Ie++:Ie--,dt=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Fe&&!dt&&!Ie&&!at&&(at=Ce),dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dt=void 0}if(!Ie&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Ie===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Fe){let nn=Ce;for(mt=void 0;nn--;){const Wt=ce[nn];if(Wt[1].type==="lineEnding"||Wt[1].type==="lineEndingBlank"){if(Wt[0]==="exit")continue;mt&&(ce[mt][1].type="lineEndingBlank",pt=!0),Wt[1].type="lineEnding",mt=nn}else if(!(Wt[1].type==="linePrefix"||Wt[1].type==="blockQuotePrefix"||Wt[1].type==="blockQuotePrefixWhitespace"||Wt[1].type==="blockQuoteMarker"||Wt[1].type==="listItemIndent"))break}at&&(!mt||at<mt)&&(Fe._spread=!0),Fe.end=Object.assign({},mt?ce[mt][1].start:Je[1].end),ce.splice(mt||Ce,0,["exit",Fe,Je[2]]),Ce++,ve++}if(Je[1].type==="listItemPrefix"){const nn={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Fe=nn,ce.splice(Ce,0,["enter",nn,Je[2]]),Ce++,ve++,at=void 0,dt=!0}}}return ce[me][1]._spread=pt,ve}function l(ce,me){return ve;function ve(Ce){o.call(this,ce(Ce),Ce),me&&me.call(this,Ce)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(ce,me,ve){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([me,ve||void 0]),ce.position={start:oi(me.start),end:void 0}}function d(ce){return me;function me(ve){ce&&ce.call(this,ve),h.call(this,ve)}}function h(ce,me){const ve=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==ce.type&&(me?me.call(this,ce,Ce[0]):(Ce[1]||m1).call(this,ce,Ce[0]));else throw new Error("Cannot close `"+ce.type+"` ("+fo({start:ce.start,end:ce.end})+"): it’s not open");ve.position.end=oi(ce.end)}function p(){return l_(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.lang=ce}function x(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.meta=ce}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.value=ce.replace(/(\r?\n|\r)$/g,"")}function v(ce){const me=this.resume(),ve=this.stack[this.stack.length-1];ve.label=me,ve.identifier=Yn(this.sliceSerialize(ce)).toLowerCase()}function _(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.title=ce}function C(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.url=ce}function N(ce){const me=this.stack[this.stack.length-1];if(!me.depth){const ve=this.sliceSerialize(ce).length;me.depth=ve}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function O(ce){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function I(ce){const ve=this.stack[this.stack.length-1].children;let Ce=ve[ve.length-1];(!Ce||Ce.type!=="text")&&(Ce=Oe(),Ce.position={start:oi(ce.start),end:void 0},ve.push(Ce)),this.stack.push(Ce)}function L(ce){const me=this.stack.pop();me.value+=this.sliceSerialize(ce),me.position.end=oi(ce.end)}function F(ce){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=me.children[me.children.length-1];ve.position.end=oi(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(I.call(this,ce),L.call(this,ce))}function j(){this.data.atHardBreak=!0}function z(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.value=ce}function G(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.value=ce}function V(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.value=ce}function W(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=me,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Z(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=me,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function J(ce){const me=this.sliceSerialize(ce),ve=this.stack[this.stack.length-2];ve.label=Bz(me),ve.identifier=Yn(me).toLowerCase()}function P(){const ce=this.stack[this.stack.length-1],me=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Ce=ce.children;ve.children=Ce}else ve.alt=me}function D(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.url=ce}function B(){const ce=this.resume(),me=this.stack[this.stack.length-1];me.title=ce}function H(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function ee(ce){const me=this.resume(),ve=this.stack[this.stack.length-1];ve.label=me,ve.identifier=Yn(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function le(ce){this.data.characterReferenceType=ce.type}function ue(ce){const me=this.sliceSerialize(ce),ve=this.data.characterReferenceType;let Ce;ve?(Ce=TI(me,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=c_(me);const Ie=this.stack[this.stack.length-1];Ie.value+=Ce}function X(ce){const me=this.stack.pop();me.position.end=oi(ce.end)}function $(ce){L.call(this,ce);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ce)}function ie(ce){L.call(this,ce);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ce)}function he(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function ge(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function Ee(){return{type:"html",value:""}}function wt(){return{type:"image",title:null,url:"",alt:null}}function Mt(){return{type:"link",title:null,url:"",children:[]}}function ft(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Vt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Bt(){return{type:"paragraph",children:[]}}function Ne(){return{type:"strong",children:[]}}function Oe(){return{type:"text",value:""}}function je(){return{type:"thematicBreak"}}}function oi(e){return{line:e.line,column:e.column,offset:e.offset}}function FI(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?FI(e,i):jz(e,i)}}function jz(e,t){let n;for(n in t)if(BI.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function m1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fo({start:t.start,end:t.end})+") is still open")}function zz(e){const t=this;t.parser=n;function n(i){return Pz(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hz(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -80,7 +80,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
80
80
|
|
|
81
81
|
`)}}}catch(n){n instanceof Error&&n.name==="AbortError"||console.error("[SSE] Connection error:",n)}}disconnect(){this.running=!1,this.abortController&&(this.abortController.abort(),this.abortController=null)}on(t,n){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t)?.add(n),()=>{this.off(t,n)}}off(t,n){const i=this.handlers.get(t);i&&(i.delete(n),i.size===0&&this.handlers.delete(t))}emit(t){const n=this.handlers.get(t.type);if(n)for(const s of n)s(t);const i=this.handlers.get("*");if(i)for(const s of i)s(t)}}function UX(e){const t=mn(),n=K.useRef(null),i=K.useRef(null),s=K.useRef(0);K.useEffect(()=>{if(!e){console.log("[useSessionStream] No sessionId, skipping");return}i.current=null;const l=new PX;n.current=l;const u=Dt.getStreamUrl(e);console.log("[useSessionStream] Connecting to stream:",u),l.connect(u);const o=v=>{if(i.current){const _=v.findIndex(C=>C.id===i.current);if(_!==-1)return _}for(let _=v.length-1;_>=0;_-=1){const C=v[_];if(C.role==="assistant"&&C.status!=="complete")return _}return-1},d=v=>{if(v.contentJson&&typeof v.contentJson=="object"&&!Array.isArray(v.contentJson)&&"text"in v.contentJson)return String(v.contentJson.text??"");if(typeof v.content=="string"){try{const _=JSON.parse(v.content);if(_&&typeof _.text=="string")return _.text}catch{}return v.content}return""},h=v=>{const _=typeof v?.messageId=="string"?v.messageId:null,C=typeof v?.partId=="string"?v.partId:null,N=typeof v?.delta=="string"?v.delta:null;!_||!C||N===null||t.setQueryData(["messages",e],A=>{if(!A)return A;const O=[...A],R=O.findIndex(z=>z.id===_);if(R===-1)return A;const I=O[R],L=I.parts?[...I.parts]:[];let F=L.findIndex(z=>z.id===C);const j=typeof v?.stepIndex=="number"?v.stepIndex:null;if(F===-1){const z={id:C,messageId:_,index:L.length,stepIndex:j,type:"reasoning",content:JSON.stringify({text:N}),contentJson:{text:N},agent:I.agent,provider:I.provider,model:I.model,startedAt:Date.now(),completedAt:null,toolName:null,toolCallId:null,toolDurationMs:null};L.push(z),F=L.length-1}else{const z=L[F],V=`${d(z)}${N}`;L[F]={...z,content:JSON.stringify({text:V}),contentJson:{text:V},stepIndex:j??z.stepIndex??null,completedAt:null}}return O[R]={...I,parts:L},O})},p=v=>{const _=typeof v?.messageId=="string"?v.messageId:null,C=typeof v?.partId=="string"?v.partId:null,N=typeof v?.delta=="string"?v.delta:null;!_||!C||N===null||t.setQueryData(["messages",e],A=>{if(!A)return A;const O=[...A],R=O.findIndex(z=>z.id===_);if(R===-1)return A;const I=O[R],L=I.parts?[...I.parts]:[];let F=L.findIndex(z=>z.id===C);const j=typeof v?.stepIndex=="number"?v.stepIndex:null;if(F===-1){const z={id:C,messageId:_,index:L.length,stepIndex:j,type:"text",content:JSON.stringify({text:N}),contentJson:{text:N},agent:I.agent,provider:I.provider,model:I.model,startedAt:Date.now(),completedAt:null,toolName:null,toolCallId:null,toolDurationMs:null};L.push(z),F=L.length-1}else{const z=L[F],V=`${d(z)}${N}`;L[F]={...z,content:JSON.stringify({text:V}),contentJson:{text:V},stepIndex:j??z.stepIndex??null,completedAt:null}}return O[R]={...I,parts:L},O})},f=v=>{if(!v)return;const _=typeof v.callId=="string"?v.callId:null,C=typeof v.name=="string"?v.name:null;C&&t.setQueryData(["messages",e],N=>{if(!N)return N;const A=[...N];let O=o(A);if(typeof v.messageId=="string"){const G=A.findIndex(V=>V.id===v.messageId);G!==-1&&(O=G)}if(O===-1)return N;const R=A[O],I=R.parts?[...R.parts]:[];let L=-1;_&&(L=I.findIndex(G=>G.toolCallId===_&&G.ephemeral)),L===-1&&(L=I.findIndex(G=>G.ephemeral&&G.toolName===C));const F=v.args,j=typeof v.stepIndex=="number"?v.stepIndex:null,z={name:C};if(_&&(z.callId=_),F!==void 0&&(z.args=F),L===-1){const G={id:_?`ephemeral-tool-call-${_}`:`ephemeral-tool-call-${C}-${Date.now()}`,messageId:R.id,index:I.length,stepIndex:j,type:"tool_call",content:JSON.stringify(z),contentJson:z,agent:R.agent,provider:R.provider,model:R.model,startedAt:Date.now(),completedAt:null,toolName:C,toolCallId:_,toolDurationMs:null,ephemeral:!0};I.push(G)}else{const G=I[L],V={...typeof G.contentJson=="object"&&!Array.isArray(G.contentJson)?G.contentJson:{},name:C};_&&(V.callId=_),F!==void 0&&(V.args=F),I[L]={...G,content:JSON.stringify(V),contentJson:V,stepIndex:j??G.stepIndex??null,toolCallId:_??G.toolCallId,toolName:C}}return A[O]={...R,parts:I},A})},g=v=>{const _=typeof v?.callId=="string"?v.callId:null;_&&t.setQueryData(["messages",e],C=>{if(!C)return C;let N=!1;const A=C.map(O=>{if(!O.parts?.length)return O;const R=O.parts.filter(I=>!(I.ephemeral&&I.toolCallId===_));return R.length===O.parts.length?O:(N=!0,{...O,parts:R})});return N?A:C})},b=v=>{v&&t.setQueryData(["messages",e],_=>{if(!_)return _;const C=_.findIndex(O=>O.id===v);if(C===-1)return _;const N=_[C];if(!N.parts?.some(O=>O.ephemeral))return _;const A=[..._];return A[C]={...N,parts:N.parts?.filter(O=>!O.ephemeral)??[]},A})},x=v=>{const _=typeof v?.id=="string"?v.id:null;_&&t.setQueryData(["messages",e],C=>{if(!C)return C;const N=[...C],A=N.findIndex(R=>R.id===_);if(A===-1)return C;const O=N[A];return N[A]={...O,status:"complete",completedAt:Date.now()},N})},E=()=>{const v=Date.now();v-s.current<500||(s.current=v,t.invalidateQueries({queryKey:["messages",e]}))},y=new Set(["message.completed","tool.result","finish-step","error"]),S=l.on("*",v=>{const _=v.payload;switch(v.type){case"message.created":{const C=typeof _?.role=="string"?_.role:null,N=typeof _?.id=="string"?_.id:null;C==="assistant"&&N&&(i.current=N);break}case"message.part.delta":{p(_);break}case"reasoning.delta":{h(_);break}case"message.completed":{const C=typeof _?.id=="string"?_.id:null;C&&i.current===C&&(i.current=null),x(_),b(C);break}case"tool.delta":{(typeof _?.channel=="string"?_.channel:null)==="input"&&f(_);break}case"tool.call":{f(_);break}case"tool.result":{g(_);break}case"error":{g(_);const C=typeof _?.messageId=="string"?_.messageId:null;C&&b(C);break}}y.has(v.type)&&E()});return()=>{S(),l.disconnect()}},[e,t])}const jX=K.memo(function({sessionId:t}){const{data:n=[],isLoading:i}=U6(t),{data:s=[]}=Xc();UX(t);const l=K.useMemo(()=>s.find(o=>o.id===t),[s,t]),u=K.useMemo(()=>n.some(o=>o.role==="assistant"&&o.status==="pending"),[n]);return i?T.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Loading messages..."}):T.jsx(FX,{messages:n,session:l,isGenerating:u})}),zX=K.memo(function({session:t,isActive:n,onClick:i}){const s=d=>{const h=new Date(d),f=new Date().getTime()-h.getTime(),g=Math.floor(f/6e4),b=Math.floor(g/60),x=Math.floor(b/24);return g<1?"just now":g<60?`${g}m ago`:b<24?`${b}h ago`:x<7?`${x}d ago`:h.toLocaleDateString()};return T.jsx("button",{type:"button",onClick:i,className:`group w-full rounded-lg px-3 py-3 text-left transition-colors duration-150 ${n?"bg-primary/10":"hover:bg-muted/20"}`,children:T.jsxs("div",{className:"flex items-start gap-3",children:[T.jsx(JF,{className:`h-4 w-4 shrink-0 mt-1 text-muted-foreground ${n?"text-primary":""}`}),T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsx("div",{className:"flex items-center gap-2",children:T.jsx("h3",{className:"truncate text-sm font-semibold text-foreground",children:t.title||`Session ${t.id.slice(0,8)}`})}),T.jsxs("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground/80",children:[t.agent&&T.jsx("span",{className:"uppercase",children:t.agent}),t.agent&&T.jsx("span",{children:"•"}),T.jsx("span",{children:s(t.lastActiveAt||t.createdAt)})]})]})]})})}),N_=Co(e=>({currentFocus:null,sessionIndex:0,gitFileIndex:0,setFocus:t=>e({currentFocus:t}),setSessionIndex:t=>e({sessionIndex:t}),setGitFileIndex:t=>e({gitFileIndex:t}),resetGitFileIndex:()=>e({gitFileIndex:0}),resetSessionIndex:()=>e({sessionIndex:0})})),HX=K.memo(function({activeSessionId:t,onSelectSession:n}){const{data:i=[],isLoading:s}=Xc(),{currentFocus:l,sessionIndex:u}=N_(),o=K.useRef(new Map),d=K.useCallback(p=>{n(p)},[n]),h=K.useMemo(()=>i.map(p=>({id:p.id,title:p.title,agent:p.agent,createdAt:p.createdAt})),[i]);return K.useEffect(()=>{l==="sessions"&&o.current.get(u)?.scrollIntoView({block:"nearest",behavior:"smooth"})},[l,u]),s?T.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground/80",children:"Loading sessions..."}):h.length===0?T.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground/80",children:"No sessions yet. Create one to get started."}):T.jsx("div",{className:"flex flex-col gap-1 px-2 py-2 overflow-y-auto scrollbar-hide",children:h.map((p,f)=>{const g=i.find(x=>x.id===p.id);if(!g)return null;const b=l==="sessions"&&u===f;return T.jsx("div",{ref:x=>{x?o.current.set(f,x):o.current.delete(f)},className:b?"ring-1 ring-primary/40 rounded-md":"",children:T.jsx(zX,{session:g,isActive:p.id===t,onClick:()=>d(p.id)})},p.id)})})}),qX={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",html:"html",css:"css",scss:"scss",md:"markdown",txt:"plaintext",svelte:"svelte"};function $X(e){const t=e.split(".").pop()?.toLowerCase()??"";return t?qX[t]??"plaintext":"plaintext"}function GX(e){const t=e.split("/");return t[t.length-1]}function VX({diff:e}){const t=document?.documentElement.classList.contains("dark")?ta:vi,n=e.language&&e.language.trim().length>0?e.language:$X(e.file),i=GX(e.file);if(e.isNewFile&&e.content)return T.jsxs("div",{className:"flex flex-col h-full bg-background",children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between min-h-10",children:[T.jsx("span",{className:"font-mono text-sm text-foreground truncate",title:e.file,children:i}),T.jsxs("div",{className:"flex items-center gap-3 text-xs flex-shrink-0",children:[T.jsxs("span",{className:"text-green-600 dark:text-green-500",children:["+",e.insertions]}),T.jsx("span",{className:"text-muted-foreground",children:n})]})]}),T.jsx("div",{className:"px-4 py-3 bg-green-500/10 border-b border-green-500/20",children:T.jsxs("p",{className:"text-sm text-green-600 dark:text-green-400 font-medium",children:["New file: ",e.insertions," lines"]})}),T.jsx("div",{className:"flex-1 overflow-auto",children:T.jsx(ur,{language:n,style:t,showLineNumbers:!0,customStyle:{margin:0,padding:"1rem",background:"transparent"},lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:"var(--color-muted-foreground)",userSelect:"none"},children:e.content})})]});if(e.isBinary)return T.jsxs("div",{className:"flex flex-col h-full bg-background",children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between min-h-10",children:[T.jsx("span",{className:"font-mono text-sm text-foreground truncate",title:e.file,children:i}),T.jsx("div",{className:"flex items-center gap-3 text-xs flex-shrink-0",children:T.jsx("span",{className:"text-muted-foreground",children:"Binary file"})})]}),T.jsx("div",{className:"flex-1 flex items-center justify-center",children:T.jsx("div",{className:"p-4 text-center",children:T.jsx("p",{className:"text-sm text-muted-foreground",children:"Binary file - cannot display diff"})})})]});const s=e.diff.split(`
|
|
82
82
|
`),l=[];let u=0,o=0;for(const h of s)if(h.startsWith("@@")){const p=h.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);p&&(u=parseInt(p[1],10),o=parseInt(p[2],10)),l.push({oldLineNumber:null,newLineNumber:null,content:h,codeContent:h,type:"hunk"})}else h.startsWith("diff")||h.startsWith("index")||h.startsWith("---")||h.startsWith("+++")?l.push({oldLineNumber:null,newLineNumber:null,content:h,codeContent:h,type:"meta"}):h.startsWith("+")?(l.push({oldLineNumber:null,newLineNumber:o,content:h,codeContent:h.slice(1),type:"add"}),o++):h.startsWith("-")?(l.push({oldLineNumber:u,newLineNumber:null,content:h,codeContent:h.slice(1),type:"delete"}),u++):(l.push({oldLineNumber:u,newLineNumber:o,content:h,codeContent:h,type:"context"}),u++,o++);const d=(h,p)=>{let f="flex hover:bg-muted/20",g="flex-shrink-0 w-20 px-2 py-0.5 text-xs font-mono select-none border-r border-border",b="flex-1 px-4 py-0.5 font-mono text-xs overflow-x-auto";h.type==="hunk"?(f+=" bg-blue-500/10",g+=" text-blue-600 dark:text-blue-400",b+=" text-blue-600 dark:text-blue-400 font-semibold"):h.type==="add"?(f+=" bg-green-500/10",g+=" text-green-700 dark:text-green-400",b+=" text-green-700 dark:text-green-400"):h.type==="delete"?(f+=" bg-red-500/10",g+=" text-red-600 dark:text-red-400",b+=" text-red-600 dark:text-red-400"):h.type==="meta"?(b+=" text-muted-foreground",g+=" text-muted-foreground"):(b+=" text-foreground/80",g+=" text-muted-foreground");const x=h.oldLineNumber!==null?h.oldLineNumber.toString():"",E=h.newLineNumber!==null?h.newLineNumber.toString():"";let y=h.content||" ";return h.type!=="meta"&&h.type!=="hunk"&&n!=="plaintext"&&h.codeContent.trim()&&(y=T.jsx(ur,{language:n,style:t,customStyle:{margin:0,padding:0,background:"transparent",display:"inline",fontSize:"inherit",lineHeight:"inherit"},codeTagProps:{style:{fontFamily:"inherit",background:"transparent"}},PreTag:"span",children:h.codeContent}),h.type==="add"?y=T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"select-none",children:"+"}),y]}):h.type==="delete"&&(y=T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"select-none",children:"-"}),y]}))),T.jsxs("div",{className:f,children:[T.jsx("div",{className:g,children:T.jsxs("div",{className:"flex justify-between gap-2",children:[T.jsx("span",{className:"text-right w-8",children:x}),T.jsx("span",{className:"text-right w-8",children:E})]})}),T.jsx("div",{className:b,children:y})]},p)};return T.jsxs("div",{className:"flex flex-col h-full bg-background",children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between min-h-10",children:[T.jsx("span",{className:"font-mono text-sm text-foreground truncate",title:e.file,children:i}),T.jsxs("div",{className:"flex items-center gap-3 text-xs flex-shrink-0",children:[e.insertions>0&&T.jsxs("span",{className:"text-green-600 dark:text-green-500",children:["+",e.insertions]}),e.deletions>0&&T.jsxs("span",{className:"text-red-600 dark:text-red-500",children:["-",e.deletions]}),T.jsx("span",{className:"text-muted-foreground",children:n})]})]}),T.jsx("div",{className:"flex-1 overflow-auto",children:e.diff.trim()===""?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No changes to display"}):T.jsx("div",{className:"min-w-max",children:l.map(d)})})]})}const sr=Co(e=>({isExpanded:!1,selectedTerminalId:null,toggleSidebar:()=>{e(t=>{const n=!t.isExpanded;return n&&Gt.getState().collapseSidebar(),{isExpanded:n}})},expandSidebar:()=>e({isExpanded:!0}),collapseSidebar:()=>e({isExpanded:!1,selectedTerminalId:null}),selectTerminal:t=>e({selectedTerminalId:t})})),Gt=Co(e=>({isExpanded:!1,selectedFile:null,selectedFileStaged:!1,isDiffOpen:!1,isCommitModalOpen:!1,wasSessionListCollapsed:!1,toggleSidebar:()=>{e(t=>{const n=!t.isExpanded;return n&&sr.getState().collapseSidebar(),{isExpanded:n}})},expandSidebar:()=>e({isExpanded:!0}),collapseSidebar:()=>e({isExpanded:!1,isDiffOpen:!1,selectedFile:null}),openDiff:(t,n)=>e({selectedFile:t,selectedFileStaged:n,isDiffOpen:!0,isExpanded:!0}),closeDiff:()=>e({isDiffOpen:!1,selectedFile:null}),switchFile:(t,n)=>e({selectedFile:t,selectedFileStaged:n}),openCommitModal:()=>e({isCommitModalOpen:!0}),closeCommitModal:()=>e({isCommitModalOpen:!1}),setSessionListCollapsed:t=>e({wasSessionListCollapsed:t})}));function O_(){const e=Gt(t=>t.isExpanded);return mi({queryKey:["git","status"],queryFn:()=>Dt.getGitStatus(),refetchInterval:e?5e3:!1,retry:1,staleTime:3e3})}function WX(e,t=!1){return mi({queryKey:["git","diff",e,t],queryFn:()=>e?Dt.getGitDiff(e,t):null,enabled:!!e,retry:1,refetchInterval:!1})}function KX(){return Xn({mutationFn:()=>Dt.generateCommitMessage()})}function I_(){const e=mn();return Xn({mutationFn:t=>Dt.stageFiles(t),onSuccess:()=>{e.invalidateQueries({queryKey:["git","status"]})}})}function L_(){const e=mn();return Xn({mutationFn:t=>Dt.unstageFiles(t),onSuccess:()=>{e.invalidateQueries({queryKey:["git","status"]})}})}function ML(){const e=mn();return Xn({mutationFn:t=>Dt.restoreFiles(t),onSuccess:()=>{e.invalidateQueries({queryKey:["git","status"]})}})}function BL(){const e=mn();return Xn({mutationFn:t=>Dt.deleteFiles(t),onSuccess:()=>{e.invalidateQueries({queryKey:["git","status"]})}})}function YX(){const e=mn();return Xn({mutationFn:t=>Dt.commitChanges(t),onSuccess:()=>{e.invalidateQueries({queryKey:["git","status"]}),e.invalidateQueries({queryKey:["git","branch"]})}})}function XX(){const e=mn();return Xn({mutationFn:()=>Dt.pushCommits(),onSuccess:()=>{e.invalidateQueries({queryKey:["git","status"]}),e.invalidateQueries({queryKey:["git","branch"]})}})}function ZX(e,t=2){const n=e.split("/");return n.length<=t+1?e:`../${n.slice(-t).join("/")}`}function Gy({file:e,staged:t,showModifiedIndicator:n=!1}){const{openDiff:i}=Gt(),s=I_(),l=L_(),u=ML(),o=BL(),d=Wv(_=>_.openConfirmation),[h,p]=K.useState(t),f=async _=>{_.stopPropagation();const C=_.target.checked;p(C);try{C?await s.mutateAsync([e.path]):await l.mutateAsync([e.path])}catch(N){p(!C),console.error("Failed to stage/unstage file:",N)}},g=async _=>{_.stopPropagation(),d({title:"Restore File",message:`Restore ${e.path} to HEAD state? This will discard all changes.`,confirmLabel:"Restore",variant:"destructive",onConfirm:async()=>{try{await u.mutateAsync([e.path])}catch(C){throw console.error("Failed to restore file:",C),C}}})},b=async _=>{_.stopPropagation(),d({title:"Delete File",message:`Delete ${e.path}? This will permanently remove the untracked file.`,confirmLabel:"Delete",variant:"destructive",onConfirm:async()=>{try{await o.mutateAsync([e.path])}catch(C){throw console.error("Failed to delete file:",C),C}}})},x=()=>{i(e.path,t)},y=(()=>{switch(e.status){case"added":case"untracked":return{icon:IF,color:"text-green-500",label:"A",labelColor:"text-green-500"};case"deleted":return{icon:FF,color:"text-red-500",label:"D",labelColor:"text-red-500"};case"modified":return{icon:ho,color:"text-blue-500",label:"M",labelColor:"text-blue-500"};case"renamed":return{icon:ho,color:"text-purple-500",label:"R",labelColor:"text-purple-500"};default:return{icon:ho,color:"text-muted-foreground",label:"?",labelColor:"text-muted-foreground"}}})(),S=y.icon,v=ZX(e.path,2);return T.jsxs("button",{type:"button",className:"flex items-center gap-2 px-3 py-2 hover:bg-muted/50 cursor-pointer group transition-colors w-full text-left",onClick:x,children:[T.jsx("input",{type:"checkbox",checked:h,onChange:f,onClick:_=>_.stopPropagation(),className:"w-4 h-4 rounded border-border","aria-label":`${h?"Unstage":"Stage"} ${e.path}`}),T.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[T.jsx(S,{className:`w-4 h-4 flex-shrink-0 ${y.color}`}),T.jsx("div",{className:"flex-1 min-w-0",children:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("span",{className:"text-sm text-foreground font-mono truncate",title:`${e.path}
|
|
83
|
-
${e.absPath}`,children:v}),T.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[T.jsx("span",{className:`text-xs font-semibold ${y.labelColor}`,children:y.label}),n&&T.jsx("div",{title:"Also modified in working directory",children:T.jsx(dr,{className:"w-3.5 h-3.5 text-orange-500"})})]})]})})]}),e.insertions!==void 0||e.deletions!==void 0?T.jsxs("div",{className:"flex items-center gap-2 text-xs flex-shrink-0",children:[e.insertions!==void 0&&e.insertions>0&&T.jsxs("span",{className:"text-green-500",children:["+",e.insertions]}),e.deletions!==void 0&&e.deletions>0&&T.jsxs("span",{className:"text-red-500",children:["-",e.deletions]})]}):null,!t&&e.status==="untracked"&&T.jsx("button",{type:"button",onClick:b,className:"p-1.5 hover:bg-destructive/10 rounded opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",title:"Delete untracked file","aria-label":`Delete ${e.path}`,children:T.jsx(p4,{className:"w-3.5 h-3.5 text-destructive"})}),!t&&e.status!=="untracked"&&e.status!=="added"&&T.jsx("button",{type:"button",onClick:g,className:"p-1.5 hover:bg-destructive/10 rounded opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",title:"Restore file to HEAD (Shift+R)","aria-label":`Restore ${e.path}`,children:T.jsx(o4,{className:"w-3.5 h-3.5 text-destructive"})}),t&&!n&&T.jsx(vO,{className:"w-4 h-4 text-green-500 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}function QX({status:e}){const{openCommitModal:t,openDiff:n}=Gt(),i=I_();L_();const{currentFocus:s,gitFileIndex:l}=N_(),u=K.useRef(new Map),o=e.staged.length>0,d=e.unstaged.length>0||e.untracked.length>0,h=[...e.unstaged,...e.untracked],p=h.length>0;K.useMemo(()=>[...e.staged,...e.unstaged,...e.untracked],[e]);const f=new Set(e.unstaged.map(b=>b.path)),g=()=>{const b=h.map(x=>x.path);b.length>0&&i.mutate(b)};return K.useEffect(()=>{if(s==="git"&&l>=0){u.current.get(l)?.scrollIntoView({block:"nearest",behavior:"smooth"});const E=[...e.staged,...e.unstaged,...e.untracked][l];if(E){const y=e.staged.includes(E);n(E.path,y)}}},[s,l,e.staged,e.unstaged,e.untracked,n]),T.jsxs("div",{className:"flex flex-col",children:[o&&T.jsxs("div",{className:"border-b border-border",children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between",children:[T.jsxs("span",{className:"text-xs font-semibold text-foreground uppercase",children:["Staged Changes (",e.staged.length,")"]}),T.jsx("div",{className:"flex items-center gap-1",children:e.staged.length>0&&T.jsxs(bt,{variant:"primary",size:"sm",onClick:t,className:"h-6 text-xs",children:[T.jsx(Ac,{className:"w-3 h-3 mr-1"}),"Commit"]})})]}),T.jsx("div",{className:"divide-y divide-border",children:e.staged.map((b,x)=>{const E=x,y=s==="git"&&l===E;return T.jsx("div",{ref:S=>{S?u.current.set(E,S):u.current.delete(E)},className:y?"ring-1 ring-inset ring-primary/40":"",children:T.jsx(Gy,{file:b,staged:!0,showModifiedIndicator:f.has(b.path)})},b.path)})})]}),d&&T.jsxs("div",{children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between",children:[T.jsxs("span",{className:"text-xs font-semibold text-foreground uppercase",children:["Changes (",e.unstaged.length+e.untracked.length,")"]}),p&&T.jsxs(bt,{variant:"ghost",size:"sm",onClick:g,title:"Stage all changes",className:"h-6 text-xs",children:[T.jsx(d4,{className:"w-3 h-3 mr-1"}),"Stage All"]})]}),T.jsxs("div",{className:"divide-y divide-border",children:[e.unstaged.map((b,x)=>{const E=e.staged.length+x,y=s==="git"&&l===E;return T.jsx("div",{ref:S=>{S?u.current.set(E,S):u.current.delete(E)},className:y?"ring-1 ring-inset ring-primary/40":"",children:T.jsx(Gy,{file:b,staged:!1})},b.path)}),e.untracked.map((b,x)=>{const E=e.staged.length+e.unstaged.length+x,y=s==="git"&&l===E;return T.jsx("div",{ref:S=>{S?u.current.set(E,S):u.current.delete(E)},className:y?"ring-1 ring-inset ring-primary/40":"",children:T.jsx(Gy,{file:b,staged:!1})},b.path)})]})]}),!o&&!d&&T.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No changes"})]})}const JX=K.memo(function(){const t=Gt(y=>y.isExpanded),n=Gt(y=>y.collapseSidebar),{data:i,isLoading:s,error:l,refetch:u}=O_(),o=mn(),d=XX(),[h,p]=K.useState(null);K.useEffect(()=>{t&&o.invalidateQueries({queryKey:["git","status"]})},[t,o]);const f=()=>{u()},g=async()=>{p(null);try{await d.mutateAsync()}catch(y){p(y instanceof Error?y.message:"Failed to push")}};if(!t)return null;const x=[...i?.staged||[],...i?.unstaged||[],...i?.untracked||[]].length,E=i&&i.ahead>0;return T.jsxs("div",{className:"w-80 border-l border-border bg-background flex flex-col h-full",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center justify-between",children:[T.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[T.jsx(Tc,{className:"w-4 h-4 text-muted-foreground"}),T.jsxs("span",{className:"font-medium text-foreground",children:["Git Changes",x>0&&T.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",x,")"]})]})]}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,title:"Close sidebar",children:T.jsx(Ot,{className:"w-4 h-4"})})]}),T.jsx("div",{className:"flex-1 overflow-y-auto",children:s?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading git status..."}):l?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx("span",{className:"text-orange-500",children:l instanceof Error?l.message:"Failed to load git status"}),T.jsx(bt,{variant:"secondary",size:"sm",onClick:f,children:"Retry"})]})}):!i||x===0?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No changes detected"}):T.jsx(QX,{status:i})}),i?.branch&&T.jsxs("div",{className:"border-t border-border",children:[h&&T.jsx("div",{className:"px-4 py-2 text-xs text-orange-500 border-b border-border bg-orange-50 dark:bg-orange-950/20",children:h}),T.jsxs("div",{className:"px-4 py-2 text-xs text-muted-foreground flex items-center justify-between gap-2",children:[T.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[T.jsx(Tc,{className:"w-3 h-3 flex-shrink-0"}),T.jsx("span",{className:"truncate",children:i.branch}),i.ahead>0&&T.jsxs("span",{className:"text-green-500 flex-shrink-0",children:["↑",i.ahead]}),i.behind>0&&T.jsxs("span",{className:"text-orange-500 flex-shrink-0",children:["↓",i.behind]})]}),T.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[E&&T.jsx(bt,{variant:"ghost",size:"icon",onClick:g,title:"Push commits to remote",className:"h-6 w-6 transition-transform duration-200 hover:scale-110",disabled:d.isPending,children:T.jsx(g4,{className:`w-3 h-3 ${d.isPending?"animate-pulse":""}`})}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:f,title:"Refresh git status",className:"h-6 w-6 transition-transform duration-200 hover:scale-110",disabled:s,children:T.jsx(a4,{className:`w-3 h-3 ${s?"animate-spin":""}`})})]})]})]})]})}),eZ=K.memo(function(){const t=Gt(l=>l.isExpanded),n=Gt(l=>l.toggleSidebar),{data:i}=O_(),s=(i?.staged?.length??0)+(i?.unstaged?.length??0)+(i?.untracked?.length??0);return T.jsxs("button",{type:"button",onClick:n,className:`relative p-3 w-full transition-colors touch-manipulation ${t?"bg-muted border-r-2 border-primary":"hover:bg-muted/50"}`,title:"Git",children:[T.jsx(Tc,{className:"w-5 h-5 text-muted-foreground mx-auto"}),s>0&&T.jsx("span",{className:"absolute top-1 right-1 w-5 h-5 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center font-semibold",children:s>9?"9+":s})]})});function tZ(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const u=d=>d===null?null:JSON.parse(d,void 0),o=(l=n.getItem(s))!=null?l:null;return o instanceof Promise?o.then(u):u(o)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const Nv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(i){return Nv(i)(n)},catch(i){return this}}}catch(n){return{then(i){return this},catch(i){return Nv(i)(n)}}}},nZ=(e,t)=>(n,i,s)=>{let l={storage:tZ(()=>localStorage),partialize:E=>E,version:0,merge:(E,y)=>({...y,...E}),...t},u=!1;const o=new Set,d=new Set;let h=l.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...E)},i,s);const p=()=>{const E=l.partialize({...i()});return h.setItem(l.name,{state:E,version:l.version})},f=s.setState;s.setState=(E,y)=>(f(E,y),p());const g=e((...E)=>(n(...E),p()),i,s);s.getInitialState=()=>g;let b;const x=()=>{var E,y;if(!h)return;u=!1,o.forEach(v=>{var _;return v((_=i())!=null?_:g)});const S=((y=l.onRehydrateStorage)==null?void 0:y.call(l,(E=i())!=null?E:g))||void 0;return Nv(h.getItem.bind(h))(l.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==l.version){if(l.migrate){const _=l.migrate(v.state,v.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var _;const[C,N]=v;if(b=l.merge(N,(_=i())!=null?_:g),n(b,!0),C)return p()}).then(()=>{S?.(b,void 0),b=i(),u=!0,d.forEach(v=>v(b))}).catch(v=>{S?.(void 0,v)})};return s.persist={setOptions:E=>{l={...l,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>x(),hasHydrated:()=>u,onHydrate:E=>(o.add(E),()=>{o.delete(E)}),onFinishHydration:E=>(d.add(E),()=>{d.delete(E)})},l.skipHydration||x(),b||g},rZ=nZ,Ir=Co()(rZ(e=>({isCollapsed:!1,wasCollapsedBeforeDiff:null,toggleCollapse:()=>e(t=>({isCollapsed:!t.isCollapsed})),setCollapsed:t=>e({isCollapsed:t}),setWasCollapsedBeforeDiff:t=>e({wasCollapsedBeforeDiff:t})}),{name:"sidebar-storage",partialize:e=>({isCollapsed:e.isCollapsed})})),iZ=K.memo(function(){const t=Gt(p=>p.isDiffOpen),n=Gt(p=>p.selectedFile),i=Gt(p=>p.selectedFileStaged),s=Gt(p=>p.closeDiff),l=Ir(p=>p.wasCollapsedBeforeDiff),u=Ir(p=>p.setWasCollapsedBeforeDiff),o=Ir(p=>p.setCollapsed),{data:d,isLoading:h}=WX(n,i);return K.useEffect(()=>{const{isCollapsed:p}=Ir.getState();t?(u(p),o(!0)):l!==null&&(o(l),u(null))},[t,u,o,l]),K.useEffect(()=>{const p=f=>{f.key==="Escape"&&t&&s()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,s]),!t||!n?null:T.jsxs("div",{className:"absolute inset-0 bg-background z-50 flex flex-col animate-in slide-in-from-left duration-300",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center gap-3",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:s,title:"Close diff viewer (ESC)",children:T.jsx(qc,{className:"w-4 h-4"})}),T.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[T.jsx("span",{className:"text-sm font-medium text-foreground font-mono truncate",title:`${n}
|
|
83
|
+
${e.absPath}`,children:v}),T.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[T.jsx("span",{className:`text-xs font-semibold ${y.labelColor}`,children:y.label}),n&&T.jsx("div",{title:"Also modified in working directory",children:T.jsx(dr,{className:"w-3.5 h-3.5 text-orange-500"})})]})]})})]}),e.insertions!==void 0||e.deletions!==void 0?T.jsxs("div",{className:"flex items-center gap-2 text-xs flex-shrink-0",children:[e.insertions!==void 0&&e.insertions>0&&T.jsxs("span",{className:"text-green-500",children:["+",e.insertions]}),e.deletions!==void 0&&e.deletions>0&&T.jsxs("span",{className:"text-red-500",children:["-",e.deletions]})]}):null,!t&&e.status==="untracked"&&T.jsx("button",{type:"button",onClick:b,className:"p-1.5 hover:bg-destructive/10 rounded opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",title:"Delete untracked file","aria-label":`Delete ${e.path}`,children:T.jsx(p4,{className:"w-3.5 h-3.5 text-destructive"})}),!t&&e.status!=="untracked"&&e.status!=="added"&&T.jsx("button",{type:"button",onClick:g,className:"p-1.5 hover:bg-destructive/10 rounded opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",title:"Restore file to HEAD (Shift+R)","aria-label":`Restore ${e.path}`,children:T.jsx(o4,{className:"w-3.5 h-3.5 text-destructive"})}),t&&!n&&T.jsx(vO,{className:"w-4 h-4 text-green-500 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}function QX({status:e}){const{openCommitModal:t,openDiff:n}=Gt(),i=I_();L_();const{currentFocus:s,gitFileIndex:l}=N_(),u=K.useRef(new Map),o=e.staged.length>0,d=e.unstaged.length>0||e.untracked.length>0,h=[...e.unstaged,...e.untracked],p=h.length>0;K.useMemo(()=>[...e.staged,...e.unstaged,...e.untracked],[e]);const f=new Set(e.unstaged.map(b=>b.path)),g=()=>{const b=h.map(x=>x.path);b.length>0&&i.mutate(b)};return K.useEffect(()=>{if(s==="git"&&l>=0){u.current.get(l)?.scrollIntoView({block:"nearest",behavior:"smooth"});const E=[...e.staged,...e.unstaged,...e.untracked][l];if(E){const y=e.staged.includes(E);n(E.path,y)}}},[s,l,e.staged,e.unstaged,e.untracked,n]),T.jsxs("div",{className:"flex flex-col",children:[o&&T.jsxs("div",{className:"border-b border-border",children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between",children:[T.jsxs("span",{className:"text-xs font-semibold text-foreground uppercase",children:["Staged Changes (",e.staged.length,")"]}),T.jsx("div",{className:"flex items-center gap-1",children:e.staged.length>0&&T.jsxs(bt,{variant:"primary",size:"sm",onClick:t,className:"h-6 text-xs",children:[T.jsx(Ac,{className:"w-3 h-3 mr-1"}),"Commit"]})})]}),T.jsx("div",{className:"divide-y divide-border",children:e.staged.map((b,x)=>{const E=x,y=s==="git"&&l===E;return T.jsx("div",{ref:S=>{S?u.current.set(E,S):u.current.delete(E)},className:y?"ring-1 ring-inset ring-primary/40":"",children:T.jsx(Gy,{file:b,staged:!0,showModifiedIndicator:f.has(b.path)})},b.path)})})]}),d&&T.jsxs("div",{children:[T.jsxs("div",{className:"px-4 py-2 bg-muted/50 flex items-center justify-between",children:[T.jsxs("span",{className:"text-xs font-semibold text-foreground uppercase",children:["Changes (",e.unstaged.length+e.untracked.length,")"]}),p&&T.jsxs(bt,{variant:"ghost",size:"sm",onClick:g,title:"Stage all changes",className:"h-6 text-xs",children:[T.jsx(d4,{className:"w-3 h-3 mr-1"}),"Stage All"]})]}),T.jsxs("div",{className:"divide-y divide-border",children:[e.unstaged.map((b,x)=>{const E=e.staged.length+x,y=s==="git"&&l===E;return T.jsx("div",{ref:S=>{S?u.current.set(E,S):u.current.delete(E)},className:y?"ring-1 ring-inset ring-primary/40":"",children:T.jsx(Gy,{file:b,staged:!1})},b.path)}),e.untracked.map((b,x)=>{const E=e.staged.length+e.unstaged.length+x,y=s==="git"&&l===E;return T.jsx("div",{ref:S=>{S?u.current.set(E,S):u.current.delete(E)},className:y?"ring-1 ring-inset ring-primary/40":"",children:T.jsx(Gy,{file:b,staged:!1})},b.path)})]})]}),!o&&!d&&T.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No changes"})]})}const JX=K.memo(function(){const t=Gt(y=>y.isExpanded),n=Gt(y=>y.collapseSidebar),{data:i,isLoading:s,error:l,refetch:u}=O_(),o=mn(),d=XX(),[h,p]=K.useState(null);K.useEffect(()=>{t&&o.invalidateQueries({queryKey:["git","status"]})},[t,o]);const f=()=>{u()},g=async()=>{p(null);try{await d.mutateAsync()}catch(y){p(y instanceof Error?y.message:"Failed to push")}};if(!t)return null;const x=[...i?.staged||[],...i?.unstaged||[],...i?.untracked||[]].length,E=i&&i.ahead>0;return T.jsxs("div",{className:"w-80 border-l border-border bg-background flex flex-col h-full",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center justify-between",children:[T.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[T.jsx(Tc,{className:"w-4 h-4 text-muted-foreground"}),T.jsxs("span",{className:"font-medium text-foreground",children:["Git Changes",x>0&&T.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",x,")"]})]})]}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,title:"Close sidebar",children:T.jsx(Ot,{className:"w-4 h-4"})})]}),T.jsx("div",{className:"flex-1 overflow-y-auto",children:s?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading git status..."}):l?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx("span",{className:"text-orange-500",children:l instanceof Error?l.message:"Failed to load git status"}),T.jsx(bt,{variant:"secondary",size:"sm",onClick:f,children:"Retry"})]})}):!i||x===0?T.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No changes detected"}):T.jsx(QX,{status:i})}),i?.branch&&T.jsxs("div",{className:"border-t border-border",children:[h&&T.jsx("div",{className:"px-4 py-2 text-xs text-orange-500 border-b border-border bg-orange-50 dark:bg-orange-950/20",children:h}),T.jsxs("div",{className:"px-4 py-2 text-xs text-muted-foreground flex items-center justify-between gap-2",children:[T.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[T.jsx(Tc,{className:"w-3 h-3 flex-shrink-0"}),T.jsx("span",{className:"truncate",children:i.branch}),i.ahead>0&&T.jsxs("span",{className:"text-green-500 flex-shrink-0",children:["↑",i.ahead]}),i.behind>0&&T.jsxs("span",{className:"text-orange-500 flex-shrink-0",children:["↓",i.behind]})]}),T.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[E&&T.jsx(bt,{variant:"ghost",size:"icon",onClick:g,title:"Push commits to remote",className:"h-6 w-6 transition-transform duration-200 hover:scale-110",disabled:d.isPending,children:T.jsx(g4,{className:`w-3 h-3 ${d.isPending?"animate-pulse":""}`})}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:f,title:"Refresh git status",className:"h-6 w-6 transition-transform duration-200 hover:scale-110",disabled:s,children:T.jsx(a4,{className:`w-3 h-3 ${s?"animate-spin":""}`})})]})]})]})]})}),eZ=K.memo(function(){const t=Gt(l=>l.isExpanded),n=Gt(l=>l.toggleSidebar),{data:i}=O_(),s=(i?.staged?.length??0)+(i?.unstaged?.length??0)+(i?.untracked?.length??0);return T.jsxs("button",{type:"button",onClick:n,className:`relative p-3 w-full transition-colors touch-manipulation ${t?"bg-muted border-r-2 border-primary":"hover:bg-muted/50"}`,title:"Git",children:[T.jsx(Tc,{className:"w-5 h-5 text-muted-foreground mx-auto"}),s>0&&T.jsx("span",{className:"absolute top-1 right-1 w-5 h-5 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center font-semibold",children:s>9?"9+":s})]})});function tZ(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const u=d=>d===null?null:JSON.parse(d,void 0),o=(l=n.getItem(s))!=null?l:null;return o instanceof Promise?o.then(u):u(o)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const Nv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(i){return Nv(i)(n)},catch(i){return this}}}catch(n){return{then(i){return this},catch(i){return Nv(i)(n)}}}},nZ=(e,t)=>(n,i,s)=>{let l={storage:tZ(()=>localStorage),partialize:E=>E,version:0,merge:(E,y)=>({...y,...E}),...t},u=!1;const o=new Set,d=new Set;let h=l.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...E)},i,s);const p=()=>{const E=l.partialize({...i()});return h.setItem(l.name,{state:E,version:l.version})},f=s.setState;s.setState=(E,y)=>(f(E,y),p());const g=e((...E)=>(n(...E),p()),i,s);s.getInitialState=()=>g;let b;const x=()=>{var E,y;if(!h)return;u=!1,o.forEach(v=>{var _;return v((_=i())!=null?_:g)});const S=((y=l.onRehydrateStorage)==null?void 0:y.call(l,(E=i())!=null?E:g))||void 0;return Nv(h.getItem.bind(h))(l.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==l.version){if(l.migrate){const _=l.migrate(v.state,v.version);return _ instanceof Promise?_.then(C=>[!0,C]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var _;const[C,N]=v;if(b=l.merge(N,(_=i())!=null?_:g),n(b,!0),C)return p()}).then(()=>{S?.(b,void 0),b=i(),u=!0,d.forEach(v=>v(b))}).catch(v=>{S?.(void 0,v)})};return s.persist={setOptions:E=>{l={...l,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>x(),hasHydrated:()=>u,onHydrate:E=>(o.add(E),()=>{o.delete(E)}),onFinishHydration:E=>(d.add(E),()=>{d.delete(E)})},l.skipHydration||x(),b||g},rZ=nZ,Ir=Co()(rZ(e=>({isCollapsed:!1,wasCollapsedBeforeDiff:null,toggleCollapse:()=>e(t=>({isCollapsed:!t.isCollapsed})),setCollapsed:t=>e({isCollapsed:t}),setWasCollapsedBeforeDiff:t=>e({wasCollapsedBeforeDiff:t})}),{name:"sidebar-storage",partialize:e=>({isCollapsed:e.isCollapsed})})),iZ=K.memo(function(){const t=Gt(p=>p.isDiffOpen),n=Gt(p=>p.selectedFile),i=Gt(p=>p.selectedFileStaged),s=Gt(p=>p.closeDiff),l=Ir(p=>p.wasCollapsedBeforeDiff),u=Ir(p=>p.setWasCollapsedBeforeDiff),o=Ir(p=>p.setCollapsed),{data:d,isLoading:h}=WX(n,i);return K.useEffect(()=>{const{isCollapsed:p}=Ir.getState();t?(u(p),o(!0)):l!==null&&(o(l),u(null))},[t,u,o,l]),K.useEffect(()=>{const p=f=>{(f.key==="Escape"||f.key==="q")&&t&&s()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,s]),!t||!n?null:T.jsxs("div",{className:"absolute inset-0 bg-background z-50 flex flex-col animate-in slide-in-from-left duration-300",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center gap-3",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:s,title:"Close diff viewer (ESC)",children:T.jsx(qc,{className:"w-4 h-4"})}),T.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[T.jsx("span",{className:"text-sm font-medium text-foreground font-mono truncate",title:`${n}
|
|
84
84
|
${d?.absPath||""}`,children:n}),i&&T.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-primary/10 text-primary flex-shrink-0",children:"Staged"})]})]}),T.jsx("div",{className:"flex-1 overflow-auto",children:h?T.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:"Loading diff..."}):d?T.jsx(VX,{diff:d}):T.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:"No diff available"})})]})});function aZ(){const{isCommitModalOpen:e,closeCommitModal:t}=Gt(),n=YX(),i=KX(),[s,l]=K.useState(""),u=K.useId(),o=K.useCallback(async()=>{if(s.trim())try{await n.mutateAsync(s),l(""),t()}catch(p){console.error("Failed to commit:",p)}},[s,n,t]),d=()=>{l(""),t()},h=K.useCallback(async()=>{try{const p=await i.mutateAsync();l(p.message)}catch(p){console.error("Failed to generate commit message:",p)}},[i]);return K.useEffect(()=>{if(!e)return;const p=f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&(f.preventDefault(),f.stopPropagation(),s.trim()&&!n.isPending&&o()),(f.metaKey||f.ctrlKey)&&f.key==="g"&&(f.preventDefault(),f.stopPropagation(),h())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,s,n.isPending,o,h]),T.jsx(Xv,{isOpen:e,onClose:d,title:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Ac,{className:"w-5 h-5"}),T.jsx("span",{children:"Commit Changes"})]}),maxWidth:"2xl",children:T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{className:"space-y-2",children:[T.jsx("label",{htmlFor:u,className:"text-sm font-medium text-foreground",children:"Commit Message"}),T.jsx(Vv,{id:u,value:s,onChange:p=>l(p.target.value),placeholder:"Enter commit message...",rows:6,className:"w-full resize-none",autoFocus:!0,disabled:i.isPending})]}),T.jsx(bt,{variant:"secondary",onClick:h,className:"w-full",disabled:i.isPending,children:i.isPending?T.jsxs(T.Fragment,{children:[T.jsx(wO,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):T.jsxs(T.Fragment,{children:[T.jsx(vo,{className:"w-4 h-4 mr-2"}),"Generate commit message"," ",T.jsx("span",{className:"text-muted-foreground ml-1",children:"(⌘G)"})]})}),i.isError&&T.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-500/10 border border-red-500/20 rounded px-3 py-2",children:i.error?.message||"Failed to generate commit message"}),T.jsxs("div",{className:"flex items-center justify-end gap-2 pt-4 border-t border-border",children:[T.jsxs(bt,{variant:"ghost",onClick:d,children:["Cancel ",T.jsx("span",{className:"text-muted-foreground ml-1",children:"(Esc)"})]}),T.jsx(bt,{variant:"primary",onClick:o,disabled:!s.trim()||n.isPending,children:n.isPending?T.jsx("span",{children:"Committing..."}):T.jsxs(T.Fragment,{children:[T.jsx(Ac,{className:"w-4 h-4 mr-2"}),"Commit ",T.jsx("span",{className:"text-muted-foreground ml-1",children:"(⌘↵)"})]})})]}),n.isError&&T.jsx("div",{className:"text-sm text-red-600 dark:text-red-400 bg-red-500/10 border border-red-500/20 rounded px-3 py-2",children:n.error?.message||"Failed to commit changes"})]})})}function D_(){return mi({queryKey:["terminals"],queryFn:async()=>{const e=await w6();if(e.error)throw new Error("Failed to fetch terminals");return e.data},refetchInterval:2e3})}function sZ(){const e=mn();return Xn({mutationFn:async t=>{const n=await C6({body:t});if(n.error)throw new Error("Failed to create terminal");return n.data},onSuccess:()=>{e.invalidateQueries({queryKey:["terminals"]})}})}const oZ=K.memo(function({terminals:t,isLoading:n}){const i=sr(s=>s.selectTerminal);return n?T.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:T.jsx("div",{className:"text-sm",children:"Loading terminals..."})}):t.length===0?T.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground px-4 text-center",children:[T.jsx(Za,{className:"w-12 h-12 mb-3 opacity-50"}),T.jsx("div",{className:"text-sm font-medium mb-1",children:"No active terminals"}),T.jsx("div",{className:"text-xs",children:"Click the + button to create a new terminal"})]}):T.jsx("div",{className:"flex-1 overflow-y-auto",children:T.jsx("div",{className:"p-2 space-y-1",children:t.map(s=>T.jsx(bt,{variant:"ghost",className:"w-full justify-start h-auto py-3 px-3",onClick:()=>i(s.id),children:T.jsxs("div",{className:"flex items-start gap-3 w-full",children:[T.jsx("div",{className:"shrink-0 mt-0.5",children:s.createdBy==="llm"?T.jsx(yO,{className:"w-4 h-4 text-blue-500"}):T.jsx(CO,{className:"w-4 h-4 text-green-500"})}),T.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[T.jsx("div",{className:"text-sm font-medium truncate",children:s.title}),T.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[s.command," ",s.args.length>0&&s.args.join(" ")]}),T.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[T.jsx("span",{className:`text-xs ${s.status==="running"?"text-green-600":"text-orange-600"}`,children:s.status==="running"?"Running":`Exited (${s.exitCode})`}),T.jsxs("span",{className:"text-xs text-muted-foreground",children:["• ",lZ(s.uptime)]})]})]})]})},s.id))})})});function lZ(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),i=Math.floor(n/60);return i>0?`${i}h ${n%60}m`:n>0?`${n}m`:`${t}s`}var Vy={exports:{}},RN;function cZ(){return RN||(RN=1,(function(e,t){(function(n,i){e.exports=i()})(self,(()=>(()=>{var n={};return(()=>{var i=n;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const l=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(l._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,l=s._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),d=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),f=d-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(g/l.css.cell.width)),rows:Math.max(1,Math.floor(f/l.css.cell.height))}}}})(),n})()))})(Vy)),Vy.exports}var uZ=cZ(),hc={exports:{}},dZ=hc.exports,NN;function hZ(){return NN||(NN=1,(function(e,t){(function(n,i){e.exports=i()})(dZ,(()=>(()=>{var n={433:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV11=void 0;const h=d(938),p=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],g=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],b=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let x;function E(y,S){let v,_=0,C=S.length-1;if(y<S[0][0]||y>S[C][1])return!1;for(;C>=_;)if(v=_+C>>1,y>S[v][1])_=v+1;else{if(!(y<S[v][0]))return!0;C=v-1}return!1}o.UnicodeV11=class{constructor(){if(this.version="11",!x){x=new Uint8Array(65536),x.fill(1),x[0]=0,x.fill(0,1,32),x.fill(0,127,160);for(let y=0;y<p.length;++y)x.fill(0,p[y][0],p[y][1]+1);for(let y=0;y<g.length;++y)x.fill(2,g[y][0],g[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?x[y]:E(y,f)?0:E(y,b)?2:1}charProperties(y,S){let v=this.wcwidth(y),_=v===0&&S!==0;if(_){const C=h.UnicodeService.extractWidth(S);C===0?_=!1:C>v&&(v=C)}return h.UnicodeService.createPropertyValue(0,v,_)}}},345:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===d)return void this._listeners.splice(h,1)}}})),this._event}fire(d,h){const p=[];for(let f=0;f<this._listeners.length;f++)p.push(this._listeners[f]);for(let f=0;f<p.length;f++)p[f].call(void 0,d,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(d,h){return d((p=>h.fire(p)))},o.runAndSubscribe=function(d,h){return h(void 0),d((p=>h(p)))}},490:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=d(938),p=[[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]],f=[[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 g;o.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;b<p.length;++b)g.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?g[b]:(function(x,E){let y,S=0,v=E.length-1;if(x<E[0][0]||x>E[v][1])return!1;for(;v>=S;)if(y=S+v>>1,x>E[y][1])S=y+1;else{if(!(x<E[y][0]))return!0;v=y-1}return!1})(b,f)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,x){let E=this.wcwidth(b),y=E===0&&x!==0;if(y){const S=h.UnicodeService.extractWidth(x);S===0?y=!1:S>E&&(E=S)}return h.UnicodeService.createPropertyValue(0,E,y)}}},938:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=d(345),p=d(490);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,x,E=!1){return(16777215&b)<<3|(3&x)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let x=0,E=0;const y=b.length;for(let S=0;S<y;++S){let v=b.charCodeAt(S);if(55296<=v&&v<=56319){if(++S>=y)return x+this.wcwidth(v);const N=b.charCodeAt(S);56320<=N&&N<=57343?v=1024*(v-55296)+N-56320+65536:x+=this.wcwidth(N)}const _=this.charProperties(v,E);let C=f.extractWidth(_);f.extractShouldJoin(_)&&(C-=f.extractWidth(E)),x+=C,E=_}return x}charProperties(b,x){return this._activeProvider.charProperties(b,x)}}o.UnicodeService=f}},i={};function s(u){var o=i[u];if(o!==void 0)return o.exports;var d=i[u]={exports:{}};return n[u](d,d.exports,s),d.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Unicode11Addon=void 0;const o=s(433);u.Unicode11Addon=class{activate(d){d.unicode.register(new o.UnicodeV11)}dispose(){}}})(),l})()))})(hc)),hc.exports}var fZ=hZ(),Wy={exports:{}},ON;function pZ(){return ON||(ON=1,(function(e,t){(function(n,i){e.exports=i()})(globalThis,(()=>(()=>{var n={4567:function(u,o,d){var h=this&&this.__decorate||function(v,_,C,N){var A,O=arguments.length,R=O<3?_:N===null?N=Object.getOwnPropertyDescriptor(_,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,C,N);else for(var I=v.length-1;I>=0;I--)(A=v[I])&&(R=(O<3?A(R):O>3?A(_,C,R):A(_,C))||R);return O>3&&R&&Object.defineProperty(_,C,R),R},p=this&&this.__param||function(v,_){return function(C,N){_(C,N,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=d(9042),g=d(9924),b=d(844),x=d(4725),E=d(2585),y=d(3656);let S=o.AccessibilityManager=class extends b.Disposable{constructor(v,_,C,N){super(),this._terminal=v,this._coreBrowserService=C,this._renderService=N,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 A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._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 g.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((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
85
85
|
`)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let _=0;_<v;_++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
|
|
86
86
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,_){this._liveRegionDebouncer.refresh(v,_,this._terminal.rows)}_renderRows(v,_){const C=this._terminal.buffer,N=C.lines.length.toString();for(let A=v;A<=_;A++){const O=C.lines.get(C.ydisp+A),R=[],I=O?.translateToString(!0,void 0,void 0,R)||"",L=(C.ydisp+A+1).toString(),F=this._rowElements[A];F&&(I.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=I,this._rowColumns.set(F,R)),F.setAttribute("aria-posinset",L),F.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,_){const C=v.target,N=this._rowElements[_===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==N)return;let A,O;if(_===0?(A=C,O=this._rowElements.pop(),this._rowContainer.removeChild(O)):(A=this._rowElements.shift(),O=C,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),O.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const R=this._createAccessibilityTreeNode();this._rowElements.unshift(R),this._rowContainer.insertAdjacentElement("afterbegin",R)}else{const R=this._createAccessibilityTreeNode();this._rowElements.push(R),this._rowContainer.appendChild(R)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:v.anchorNode,offset:v.anchorOffset},C={node:v.focusNode,offset:v.focusOffset};if((_.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===C.node&&_.offset>C.offset)&&([_,C]=[C,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const N=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:N,offset:N.textContent?.length??0}),!this._rowContainer.contains(C.node))return;const A=({node:I,offset:L})=>{const F=I instanceof Text?I.parentNode:I;let j=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(j))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(F);if(!z)return console.warn("columns is null. Race condition?"),null;let G=L<z.length?z[L]:z.slice(-1)[0]+1;return G>=this._terminal.cols&&(++j,G=0),{row:j,column:G}},O=A(_),R=A(C);if(O&&R){if(O.row>R.row||O.row===R.row&&O.column>=R.column)throw new Error("invalid range");this._terminal.select(O.column,O.row,(R.row-O.row)*this._terminal.cols-O.column+R.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_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 v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=h([p(1,E.IInstantiationService),p(2,x.ICoreBrowserService),p(3,x.IRenderService)],S)},3614:(u,o)=>{function d(g){return g.replace(/\r?\n/g,"\r")}function h(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function p(g,b,x,E){g=h(g=d(g),x.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(g,!0),b.value=""}function f(g,b,x){const E=x.getBoundingClientRect(),y=g.clientX-E.left-10,S=g.clientY-E.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${y}px`,b.style.top=`${S}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=d,o.bracketTextForPaste=h,o.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},o.handlePasteEvent=function(g,b,x,E){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),b,x,E)},o.paste=p,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(g,b,x,E,y){f(g,b,x),y&&E.rightClickSelect(g),b.value=E.selectionText,b.select()}},7239:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=d(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,f,g){this._css.set(p,f,g)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,g){this._color.set(p,f,g)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(d,h,p,f){d.addEventListener(h,p,f);let g=!1;return{dispose:()=>{g||(g=!0,d.removeEventListener(h,p,f))}}}},3551:function(u,o,d){var h=this&&this.__decorate||function(S,v,_,C){var N,A=arguments.length,O=A<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(S,v,_,C);else for(var R=S.length-1;R>=0;R--)(N=S[R])&&(O=(A<3?N(O):A>3?N(v,_,O):N(v,_))||O);return A>3&&O&&Object.defineProperty(v,_,O),O},p=this&&this.__param||function(S,v){return function(_,C){v(_,C,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=d(3656),g=d(8460),b=d(844),x=d(2585),E=d(4725);let y=o.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(S,v,_,C,N){super(),this._element=S,this._mouseService=v,this._renderService=_,this._bufferService=C,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const v=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const _=S.composedPath();for(let C=0;C<_.length;C++){const N=_[C];if(N.classList.contains("xterm"))break;if(N.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,v){this._activeProviderReplies&&v||(this._activeProviderReplies?.forEach((C=>{C?.forEach((N=>{N.link.dispose&&N.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let _=!1;for(const[C,N]of this._linkProviderService.linkProviders.entries())v?this._activeProviderReplies?.get(C)&&(_=this._checkLinkProviderResult(C,S,_)):N.provideLinks(S.y,(A=>{if(this._isMouseOut)return;const O=A?.map((R=>({link:R})));this._activeProviderReplies?.set(C,O),_=this._checkLinkProviderResult(C,S,_),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,v){const _=new Set;for(let C=0;C<v.size;C++){const N=v.get(C);if(N)for(let A=0;A<N.length;A++){const O=N[A],R=O.link.range.start.y<S?0:O.link.range.start.x,I=O.link.range.end.y>S?this._bufferService.cols:O.link.range.end.x;for(let L=R;L<=I;L++){if(_.has(L)){N.splice(A--,1);break}_.add(L)}}}}_checkLinkProviderResult(S,v,_){if(!this._activeProviderReplies)return _;const C=this._activeProviderReplies.get(S);let N=!1;for(let A=0;A<S;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(N=!0);if(!N&&C){const A=C.find((O=>this._linkAtPosition(O.link,v)));A&&(_=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let A=0;A<this._activeProviderReplies.size;A++){const O=this._activeProviderReplies.get(A)?.find((R=>this._linkAtPosition(R.link,v)));if(O){_=!0,this._handleNewLink(O);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const v=this._positionFromMouseEvent(S,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,v){this._currentLink&&this._lastMouseEvent&&(!S||!v||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(S.link,v)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:_=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",_))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:_=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const C=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(C,N),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(S,v,_){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(_,v.text)}_fireUnderlineEvent(S,v){const _=S.range,C=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-C-1,_.end.x,_.end.y-C-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(S,v,_){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(_,v.text)}_linkAtPosition(S,v){const _=S.range.start.y*this._bufferService.cols+S.range.start.x,C=S.range.end.y*this._bufferService.cols+S.range.end.x,N=v.y*this._bufferService.cols+v.x;return _<=N&&N<=C}_positionFromMouseEvent(S,v,_){const C=_.getCoords(S,v,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,v,_,C,N){return{x1:S,y1:v,x2:_,y2:C,cols:this._bufferService.cols,fg:N}}};o.Linkifier=y=h([p(1,E.IMouseService),p(2,E.IRenderService),p(3,x.IBufferService),p(4,E.ILinkProviderService)],y)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,d){var h=this&&this.__decorate||function(E,y,S,v){var _,C=arguments.length,N=C<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(E,y,S,v);else for(var A=E.length-1;A>=0;A--)(_=E[A])&&(N=(C<3?_(N):C>3?_(y,S,N):_(y,S))||N);return C>3&&N&&Object.defineProperty(y,S,N),N},p=this&&this.__param||function(E,y){return function(S,v){y(S,v,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=d(511),g=d(2585);let b=o.OscLinkProvider=class{constructor(E,y,S){this._bufferService=E,this._optionsService=y,this._oscLinkService=S}provideLinks(E,y){const S=this._bufferService.buffer.lines.get(E-1);if(!S)return void y(void 0);const v=[],_=this._optionsService.rawOptions.linkHandler,C=new f.CellData,N=S.getTrimmedLength();let A=-1,O=-1,R=!1;for(let I=0;I<N;I++)if(O!==-1||S.hasContent(I)){if(S.loadCell(I,C),C.hasExtendedAttrs()&&C.extended.urlId){if(O===-1){O=I,A=C.extended.urlId;continue}R=C.extended.urlId!==A}else O!==-1&&(R=!0);if(R||O!==-1&&I===N-1){const L=this._oscLinkService.getLinkData(A)?.uri;if(L){const F={start:{x:O+1,y:E},end:{x:I+(R||I!==N-1?0:1),y:E}};let j=!1;if(!_?.allowNonHttpProtocols)try{const z=new URL(L);["http:","https:"].includes(z.protocol)||(j=!0)}catch{j=!0}j||v.push({text:L,range:F,activate:(z,G)=>_?_.activate(z,G,F):x(0,G),hover:(z,G)=>_?.hover?.(z,G,F),leave:(z,G)=>_?.leave?.(z,G,F)})}R=!1,C.hasExtendedAttrs()&&C.extended.urlId?(O=I,A=C.extended.urlId):(O=-1,A=-1)}}y(v)}};function x(E,y){if(confirm(`Do you want to navigate to ${y}?
|
|
@@ -91,4 +91,4 @@ WARNING: This link could potentially be dangerous`)){const S=window.open();if(S)
|
|
|
91
91
|
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(d||(o.C0=d={})),(function(f){f.PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC=""})(h||(o.C1=h={})),(function(f){f.ST=`${d.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=d(2584),p={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:["'",'"']};o.evaluateKeyboardEvent=function(f,g,b,x){const E={type:0,cancel:!1,key:void 0},y=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?E.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?E.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?E.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(E.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(f.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,f.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(f.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(b?"b":"[1;5D"))):E.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(b?"f":"[1;5C"))):E.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"A",b||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"B",b||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=y?h.C0.ESC+"[3;"+(y+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=y?h.C0.ESC+"[1;"+(y+1)+"H":g?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=y?h.C0.ESC+"[1;"+(y+1)+"F":g?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?E.type=2:f.ctrlKey?E.key=h.C0.ESC+"[5;"+(y+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?E.type=3:f.ctrlKey?E.key=h.C0.ESC+"[6;"+(y+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=y?h.C0.ESC+"[1;"+(y+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=y?h.C0.ESC+"[1;"+(y+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=y?h.C0.ESC+"[1;"+(y+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=y?h.C0.ESC+"[1;"+(y+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=y?h.C0.ESC+"[15;"+(y+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=y?h.C0.ESC+"[17;"+(y+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=y?h.C0.ESC+"[18;"+(y+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=y?h.C0.ESC+"[19;"+(y+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=y?h.C0.ESC+"[20;"+(y+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=y?h.C0.ESC+"[21;"+(y+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=y?h.C0.ESC+"[23;"+(y+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=y?h.C0.ESC+"[24;"+(y+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!x||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?E.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(E.key=h.C0.US),f.key==="@"&&(E.key=h.C0.NUL)):f.keyCode===65&&(E.type=1);else{const S=p[f.keyCode],v=S?.[f.shiftKey?1:0];if(v)E.key=h.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const _=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(_);f.shiftKey&&(C=C.toUpperCase()),E.key=h.C0.ESC+C}else if(f.keyCode===32)E.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let _=f.code.slice(3,4);f.shiftKey||(_=_.toLowerCase()),E.key=h.C0.ESC+_,E.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?E.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?E.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?E.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?E.key=h.C0.DEL:f.keyCode===219?E.key=h.C0.ESC:f.keyCode===220?E.key=h.C0.FS:f.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},o.utf32ToString=function(d,h=0,p=d.length){let f="";for(let g=h;g<p;++g){let b=d[g];b>65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,h){const p=d.length;if(!p)return 0;let f=0,g=0;if(this._interim){const b=d.charCodeAt(g++);56320<=b&&b<=57343?h[f++]=1024*(this._interim-55296)+b-56320+65536:(h[f++]=this._interim,h[f++]=b),this._interim=0}for(let b=g;b<p;++b){const x=d.charCodeAt(b);if(55296<=x&&x<=56319){if(++b>=p)return this._interim=x,f;const E=d.charCodeAt(b);56320<=E&&E<=57343?h[f++]=1024*(x-55296)+E-56320+65536:(h[f++]=x,h[f++]=E)}else x!==65279&&(h[f++]=x)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,h){const p=d.length;if(!p)return 0;let f,g,b,x,E=0,y=0,S=0;if(this.interim[0]){let C=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let A,O=0;for(;(A=63&this.interim[++O])&&O<4;)N<<=6,N|=A;const R=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,I=R-O;for(;S<I;){if(S>=p)return 0;if(A=d[S++],(192&A)!=128){S--,C=!0;break}this.interim[O++]=A,N<<=6,N|=63&A}C||(R===2?N<128?S--:h[E++]=N:R===3?N<2048||N>=55296&&N<=57343||N===65279||(h[E++]=N):N<65536||N>1114111||(h[E++]=N)),this.interim.fill(0)}const v=p-4;let _=S;for(;_<p;){for(;!(!(_<v)||128&(f=d[_])||128&(g=d[_+1])||128&(b=d[_+2])||128&(x=d[_+3]));)h[E++]=f,h[E++]=g,h[E++]=b,h[E++]=x,_+=4;if(f=d[_++],f<128)h[E++]=f;else if((224&f)==192){if(_>=p)return this.interim[0]=f,E;if(g=d[_++],(192&g)!=128){_--;continue}if(y=(31&f)<<6|63&g,y<128){_--;continue}h[E++]=y}else if((240&f)==224){if(_>=p)return this.interim[0]=f,E;if(g=d[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=f,this.interim[1]=g,E;if(b=d[_++],(192&b)!=128){_--;continue}if(y=(15&f)<<12|(63&g)<<6|63&b,y<2048||y>=55296&&y<=57343||y===65279)continue;h[E++]=y}else if((248&f)==240){if(_>=p)return this.interim[0]=f,E;if(g=d[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=f,this.interim[1]=g,E;if(b=d[_++],(192&b)!=128){_--;continue}if(_>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,E;if(x=d[_++],(192&x)!=128){_--;continue}if(y=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&x,y<65536||y>1114111)continue;h[E++]=y}}return E}}},225:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=d(1480),p=[[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]],f=[[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 g;o.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;b<p.length;++b)g.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?g[b]:(function(x,E){let y,S=0,v=E.length-1;if(x<E[0][0]||x>E[v][1])return!1;for(;v>=S;)if(y=S+v>>1,x>E[y][1])S=y+1;else{if(!(x<E[y][0]))return!0;v=y-1}return!1})(b,f)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,x){let E=this.wcwidth(b),y=E===0&&x!==0;if(y){const S=h.UnicodeService.extractWidth(x);S===0?y=!1:S>E&&(E=S)}return h.UnicodeService.createPropertyValue(0,E,y)}}},5981:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=d(8460),p=d(844);class f extends p.Disposable{constructor(b){super(),this._action=b,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(b,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,x){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(x)}_innerWrite(b=0,x=!0){const E=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],S=this._action(y,x);if(S){const _=C=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(E,C);return void S.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(_)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=f},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const d=/^([\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 p(f,g){const b=f.toString(16),x=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=d.exec(g);if(b){const x=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/x*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/x*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/x*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),h.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,x=[0,0,0];for(let E=0;E<3;++E){const y=parseInt(g.slice(b*E,b*E+b),16);x[E]=b===1?y<<4:b===2?y:b===3?y>>4:y>>8}return x}},o.toRgbString=function(f,g=16){const[b,x,E]=f;return`rgb:${p(b,g)}/${p(x,g)}/${p(E,g)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=d(482),p=d(8742),f=d(5770),g=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(x,E){this._handlers[x]===void 0&&(this._handlers[x]=[]);const y=this._handlers[x];return y.push(E),{dispose:()=>{const S=y.indexOf(E);S!==-1&&y.splice(S,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(x,E){if(this.reset(),this._ident=x,this._active=this._handlers[x]||g,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(x,E,y){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(x,E,y);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(x,E,y))}unhook(x,E=!0){if(this._active.length){let y=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,y=E,v=this._stack.fallThrough,this._stack.paused=!1),!v&&y===!1){for(;S>=0&&(y=this._active[S].unhook(x),y!==!0);S--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,y;S--}for(;S>=0;S--)if(y=this._active[S].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",x);this._active=g,this._ident=0}};const b=new p.Params;b.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=b,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():b,this._data="",this._hitLimit=!1}put(x,E,y){this._hitLimit||(this._data+=(0,h.utf32ToString)(x,E,y),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let E=!1;if(this._hitLimit)E=!1;else if(x&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((y=>(this._params=b,this._data="",this._hitLimit=!1,y)));return this._params=b,this._data="",this._hitLimit=!1,E}}},2015:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=d(844),p=d(8742),f=d(6242),g=d(6351);class b{constructor(S){this.table=new Uint8Array(S)}setDefault(S,v){this.table.fill(S<<4|v)}add(S,v,_,C){this.table[v<<8|S]=_<<4|C}addMany(S,v,_,C){for(let N=0;N<S.length;N++)this.table[v<<8|S[N]]=_<<4|C}}o.TransitionTable=b;const x=160;o.VT500_TRANSITION_TABLE=(function(){const y=new b(4095),S=Array.apply(null,Array(256)).map(((O,R)=>R)),v=(O,R)=>S.slice(O,R),_=v(32,127),C=v(0,24);C.push(25),C.push.apply(C,v(28,32));const N=v(0,14);let A;for(A in y.setDefault(1,0),y.addMany(_,0,2,0),N)y.addMany([24,26,153,154],A,3,0),y.addMany(v(128,144),A,3,0),y.addMany(v(144,152),A,3,0),y.add(156,A,0,0),y.add(27,A,11,1),y.add(157,A,4,8),y.addMany([152,158,159],A,0,7),y.add(155,A,11,3),y.add(144,A,11,9);return y.addMany(C,0,3,0),y.addMany(C,1,3,1),y.add(127,1,0,1),y.addMany(C,8,0,8),y.addMany(C,3,3,3),y.add(127,3,0,3),y.addMany(C,4,3,4),y.add(127,4,0,4),y.addMany(C,6,3,6),y.addMany(C,5,3,5),y.add(127,5,0,5),y.addMany(C,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(_,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(v(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(_,7,0,7),y.addMany(C,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(v(64,127),3,7,0),y.addMany(v(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(v(48,60),4,8,4),y.addMany(v(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(v(32,64),6,0,6),y.add(127,6,0,6),y.addMany(v(64,127),6,0,0),y.addMany(v(32,48),3,9,5),y.addMany(v(32,48),5,9,5),y.addMany(v(48,64),5,0,6),y.addMany(v(64,127),5,7,0),y.addMany(v(32,48),4,9,5),y.addMany(v(32,48),1,9,2),y.addMany(v(32,48),2,9,2),y.addMany(v(48,127),2,10,0),y.addMany(v(48,80),1,10,0),y.addMany(v(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(v(96,127),1,10,0),y.add(80,1,11,9),y.addMany(C,9,0,9),y.add(127,9,0,9),y.addMany(v(28,32),9,0,9),y.addMany(v(32,48),9,9,12),y.addMany(v(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(C,11,0,11),y.addMany(v(32,128),11,0,11),y.addMany(v(28,32),11,0,11),y.addMany(C,10,0,10),y.add(127,10,0,10),y.addMany(v(28,32),10,0,10),y.addMany(v(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(v(32,48),10,9,12),y.addMany(C,12,0,12),y.add(127,12,0,12),y.addMany(v(28,32),12,0,12),y.addMany(v(32,48),12,9,12),y.addMany(v(48,64),12,0,11),y.addMany(v(64,127),12,12,13),y.addMany(v(64,127),10,12,13),y.addMany(v(64,127),9,12,13),y.addMany(C,13,13,13),y.addMany(_,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(x,0,2,0),y.add(x,8,5,8),y.add(x,6,0,6),y.add(x,11,0,11),y.add(x,13,13,13),y})();class E extends h.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,_,C)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,_)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,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 f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,v=[64,126]){let _=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=S.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;N<S.intermediates.length;++N){const A=S.intermediates.charCodeAt(N);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=A}}if(S.final.length!==1)throw new Error("final must be a single byte");const C=S.final.charCodeAt(0);if(v[0]>C||C>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return _<<=8,_|=C,_}identToString(S){const v=[];for(;S;)v.push(String.fromCharCode(255&S)),S>>=8;return v.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,v){const _=this._identifier(S,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const C=this._escHandlers[_];return C.push(v),{dispose:()=>{const N=C.indexOf(v);N!==-1&&C.splice(N,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,v){this._executeHandlers[S.charCodeAt(0)]=v}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,v){const _=this._identifier(S);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const C=this._csiHandlers[_];return C.push(v),{dispose:()=>{const N=C.indexOf(v);N!==-1&&C.splice(N,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,v){return this._dcsParser.registerHandler(this._identifier(S),v)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,v){return this._oscParser.registerHandler(S,v)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}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(S,v,_,C,N){this._parseStack.state=S,this._parseStack.handlers=v,this._parseStack.handlerPos=_,this._parseStack.transition=C,this._parseStack.chunkPos=N}parse(S,v,_){let C,N=0,A=0,O=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,O=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const R=this._parseStack.handlers;let I=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&I>-1){for(;I>=0&&(C=R[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._parseStack.handlerPos=I,C}this._parseStack.handlers=[];break;case 4:if(_===!1&&I>-1){for(;I>=0&&(C=R[I](),C!==!0);I--)if(C instanceof Promise)return this._parseStack.handlerPos=I,C}this._parseStack.handlers=[];break;case 6:if(N=S[this._parseStack.chunkPos],C=this._dcsParser.unhook(N!==24&&N!==26,_),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=S[this._parseStack.chunkPos],C=this._oscParser.end(N!==24&&N!==26,_),C)return C;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,O=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let R=O;R<v;++R){switch(N=S[R],A=this._transitions.table[this.currentState<<8|(N<160?N:x)],A>>4){case 2:for(let z=R+1;;++z){if(z>=v||(N=S[z])<32||N>126&&N<x){this._printHandler(S,R,z),R=z-1;break}if(++z>=v||(N=S[z])<32||N>126&&N<x){this._printHandler(S,R,z),R=z-1;break}if(++z>=v||(N=S[z])<32||N>126&&N<x){this._printHandler(S,R,z),R=z-1;break}if(++z>=v||(N=S[z])<32||N>126&&N<x){this._printHandler(S,R,z),R=z-1;break}}break;case 3:this._executeHandlers[N]?this._executeHandlers[N]():this._executeHandlerFb(N),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:R,code:N,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const I=this._csiHandlers[this._collect<<8|N];let L=I?I.length-1:-1;for(;L>=0&&(C=I[L](this._params),C!==!0);L--)if(C instanceof Promise)return this._preserveStack(3,I,L,A,R),C;L<0&&this._csiHandlerFb(this._collect<<8|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++R<v&&(N=S[R])>47&&N<60);R--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const F=this._escHandlers[this._collect<<8|N];let j=F?F.length-1:-1;for(;j>=0&&(C=F[j](),C!==!0);j--)if(C instanceof Promise)return this._preserveStack(4,F,j,A,R),C;j<0&&this._escHandlerFb(this._collect<<8|N),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|N,this._params);break;case 13:for(let z=R+1;;++z)if(z>=v||(N=S[z])===24||N===26||N===27||N>127&&N<x){this._dcsParser.put(S,R,z),R=z-1;break}break;case 14:if(C=this._dcsParser.unhook(N!==24&&N!==26),C)return this._preserveStack(6,[],0,A,R),C;N===27&&(A|=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 z=R+1;;z++)if(z>=v||(N=S[z])<32||N>127&&N<x){this._oscParser.put(S,R,z),R=z-1;break}break;case 6:if(C=this._oscParser.end(N!==24&&N!==26),C)return this._preserveStack(5,[],0,A,R),C;N===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}o.EscapeSequenceParser=E},6242:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=d(5770),p=d(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const x=this._handlers[g];return x.push(b),{dispose:()=>{const E=x.indexOf(b);E!==-1&&x.splice(E,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,x){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(g,b,x);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,b,x))}start(){this.reset(),this._state=1}put(g,b,x){if(this._state!==3){if(this._state===1)for(;b<x;){const E=g[b++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&x-b>0&&this._put(g,b,x)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,E=this._active.length-1,y=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,x=b,y=this._stack.fallThrough,this._stack.paused=!1),!y&&x===!1){for(;E>=0&&(x=this._active[E].end(g),x!==!0);E--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,x;E--}for(;E>=0;E--)if(x=this._active[E].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,x){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,b,x),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,b}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const d=2147483647;class h{static fromArray(f){const g=new h;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b<f.length;++b){const x=f[b];if(Array.isArray(x))for(let E=0;E<x.length;++E)g.addSubParam(x[E]);else g.addParam(x)}return g}constructor(f=32,g=32){if(this.maxLength=f,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g<this.length;++g){f.push(this.params[g]);const b=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,x))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>d?d:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>d?d:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const b=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-b>0&&(f[g]=this._subParams.slice(b,x))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,x=b[g-1];b[g-1]=~x?Math.min(10*x+f,d):f}}o.Params=h},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,h){const p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===d){h=p;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(h,1)}}},8771:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=d(3785),p=d(511);o.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new h.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=d(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new h.CellData)}translateToString(p,f,g){return this._line.translateToString(p,f,g)}}},8285:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=d(8771),p=d(8460),f=d(844);class g extends f.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new p.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)}}o.BufferNamespaceApi=g},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,h){return this._core.registerCsiHandler(d,(p=>h(p.toArray())))}addCsiHandler(d,h){return this.registerCsiHandler(d,h)}registerDcsHandler(d,h){return this._core.registerDcsHandler(d,((p,f)=>h(p,f.toArray())))}addDcsHandler(d,h){return this.registerDcsHandler(d,h)}registerEscHandler(d,h){return this._core.registerEscHandler(d,h)}addEscHandler(d,h){return this.registerEscHandler(d,h)}registerOscHandler(d,h){return this._core.registerOscHandler(d,h)}addOscHandler(d,h){return this.registerOscHandler(d,h)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(u,o,d){var h=this&&this.__decorate||function(y,S,v,_){var C,N=arguments.length,A=N<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,S,v,_);else for(var O=y.length-1;O>=0;O--)(C=y[O])&&(A=(N<3?C(A):N>3?C(S,v,A):C(S,v))||A);return N>3&&A&&Object.defineProperty(S,v,A),A},p=this&&this.__param||function(y,S){return function(v,_){S(v,_,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=d(8460),g=d(844),b=d(5295),x=d(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(y,this))}resize(y,S){this.cols=y,this.rows=S,this.buffers.resize(y,S),this._onResize.fire({cols:y,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,S=!1){const v=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===y.fg&&_.getBg(0)===y.bg||(_=v.getBlankLine(y,S),this._cachedBlankLine=_),_.isWrapped=S;const C=v.ybase+v.scrollTop,N=v.ybase+v.scrollBottom;if(v.scrollTop===0){const A=v.lines.isFull;N===v.lines.length-1?A?v.lines.recycle().copyFrom(_):v.lines.push(_.clone()):v.lines.splice(N+1,0,_.clone()),A?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const A=N-C+1;v.lines.shiftElements(C+1,A-1,-1),v.lines.set(N,_.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(y,S,v){const _=this.buffer;if(y<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else y+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const C=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+y,_.ybase),0),C!==_.ydisp&&(S||this._onScroll.fire(_.ydisp))}};o.BufferService=E=h([p(0,x.IOptionsService)],E)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,h){this._charsets[d]=h,this.glevel===d&&(this.charset=h)}}},1753:function(u,o,d){var h=this&&this.__decorate||function(_,C,N,A){var O,R=arguments.length,I=R<3?C:A===null?A=Object.getOwnPropertyDescriptor(C,N):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(_,C,N,A);else for(var L=_.length-1;L>=0;L--)(O=_[L])&&(I=(R<3?O(I):R>3?O(C,N,I):O(C,N))||I);return R>3&&I&&Object.defineProperty(C,N,I),I},p=this&&this.__param||function(_,C){return function(N,A){C(N,A,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=d(2585),g=d(8460),b=d(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function E(_,C){let N=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(N|=64,N|=_.action):(N|=3&_.button,4&_.button&&(N|=64),8&_.button&&(N|=128),_.action===32?N|=32:_.action!==0||C||(N|=3)),N}const y=String.fromCharCode,S={DEFAULT:_=>{const C=[E(_,!1)+32,_.col+32,_.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${y(C[0])}${y(C[1])}${y(C[2])}`},SGR:_=>{const C=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${E(_,!0)};${_.col};${_.row}${C}`},SGR_PIXELS:_=>{const C=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${E(_,!0)};${_.x};${_.y}${C}`}};let v=o.CoreMouseService=class extends b.Disposable{constructor(_,C){super(),this._bufferService=_,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(x))this.addProtocol(N,x[N]);for(const N of Object.keys(S))this.addEncoding(N,S[N]);this.reset()}addProtocol(_,C){this._protocols[_]=C}addEncoding(_,C){this._encodings[_]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const C=this._encodings[this._activeEncoding](_);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,C,N){if(N){if(_.x!==C.x||_.y!==C.y)return!1}else if(_.col!==C.col||_.row!==C.row)return!1;return _.button===C.button&&_.action===C.action&&_.ctrl===C.ctrl&&_.alt===C.alt&&_.shift===C.shift}};o.CoreMouseService=v=h([p(0,f.IBufferService),p(1,f.ICoreService)],v)},6975:function(u,o,d){var h=this&&this.__decorate||function(v,_,C,N){var A,O=arguments.length,R=O<3?_:N===null?N=Object.getOwnPropertyDescriptor(_,C):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,C,N);else for(var I=v.length-1;I>=0;I--)(A=v[I])&&(R=(O<3?A(R):O>3?A(_,C,R):A(_,C))||R);return O>3&&R&&Object.defineProperty(_,C,R),R},p=this&&this.__param||function(v,_){return function(C,N){_(C,N,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=d(1439),g=d(8460),b=d(844),x=d(2585),E=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends b.Disposable{constructor(v,_,C){super(),this._bufferService=v,this._logService=_,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(E),this.decPrivateModes=(0,f.clone)(y)}reset(){this.modes=(0,f.clone)(E),this.decPrivateModes=(0,f.clone)(y)}triggerDataEvent(v,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((N=>N.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((_=>_.charCodeAt(0))))),this._onBinary.fire(v))}};o.CoreService=S=h([p(0,x.IBufferService),p(1,x.ILogService),p(2,x.IOptionsService)],S)},9074:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=d(8055),p=d(8460),f=d(844),g=d(6106);let b=0,x=0;class E extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((v=>v?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const _=new y(v);if(_){const C=_.marker.onDispose((()=>_.dispose()));_.onDispose((()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),C.dispose())})),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,_,C){let N=0,A=0;for(const O of this._decorations.getKeyIterator(_))N=O.options.x??0,A=N+(O.options.width??1),v>=N&&v<A&&(!C||(O.options.layer??"bottom")===C)&&(yield O)}forEachDecorationAtCell(v,_,C,N){this._decorations.forEachByKey(_,(A=>{b=A.options.x??0,x=b+(A.options.width??1),v>=b&&v<x&&(!C||(A.options.layer??"bottom")===C)&&N(A)}))}}o.DecorationService=E;class y extends f.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(v){super(),this.options=v,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=d(2585),p=d(8343);class f{constructor(...b){this._entries=new Map;for(const[x,E]of b)this.set(x,E)}set(b,x){const E=this._entries.get(b);return this._entries.set(b,x),E}forEach(b){for(const[x,E]of this._entries.entries())b(x,E)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const x=(0,p.getServiceDependencies)(g).sort(((S,v)=>S.index-v.index)),E=[];for(const S of x){const v=this._services.get(S.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${S.id}.`);E.push(v)}const y=x.length>0?x[0].index:b.length;if(b.length!==y)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${y+1} conflicts with ${b.length} static arguments`);return new g(...b,...E)}}},7866:function(u,o,d){var h=this&&this.__decorate||function(y,S,v,_){var C,N=arguments.length,A=N<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,S,v,_);else for(var O=y.length-1;O>=0;O--)(C=y[O])&&(A=(N<3?C(A):N>3?C(S,v,A):C(S,v))||A);return N>3&&A&&Object.defineProperty(S,v,A),A},p=this&&this.__param||function(y,S){return function(v,_){S(v,_,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=d(844),g=d(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,E=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let S=0;S<y.length;S++)typeof y[S]=="function"&&(y[S]=y[S]())}_log(y,S,v){this._evalLazyOptionalParams(v),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...v)}trace(y,...S){this._logLevel<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,y,S)}debug(y,...S){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,y,S)}info(y,...S){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,y,S)}warn(y,...S){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,y,S)}error(y,...S){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,y,S)}};o.LogService=E=h([p(0,g.IOptionsService)],E),o.setTraceLogger=function(y){x=y},o.traceCall=function(y,S,v){if(typeof v.value!="function")throw new Error("not supported");const _=v.value;v.value=function(...C){if(x.logLevel!==g.LogLevelEnum.TRACE)return _.apply(this,C);x.trace(`GlyphRenderer#${_.name}(${C.map((A=>JSON.stringify(A))).join(", ")})`);const N=_.apply(this,C);return x.trace(`GlyphRenderer#${_.name} return`,N),N}}},7302:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=d(8460),p=d(844),f=d(6114);o.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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends p.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...o.DEFAULT_OPTIONS};for(const S in E)if(S in y)try{const v=E[S];y[S]=this._sanitizeAndValidateOption(S,v)}catch(v){console.error(v)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,y){return this.onOptionChange((S=>{S===E&&y(this.rawOptions[E])}))}onMultipleOptionChange(E,y){return this.onOptionChange((S=>{E.indexOf(S)!==-1&&y()}))}_setupOptions(){const E=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},y=(S,v)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);v=this._sanitizeAndValidateOption(S,v),this.rawOptions[S]!==v&&(this.rawOptions[S]=v,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const v={get:E.bind(this,S),set:y.bind(this,S)};Object.defineProperty(this.options,S,v)}}_sanitizeAndValidateOption(E,y){switch(E){case"cursorStyle":if(y||(y=o.DEFAULT_OPTIONS[E]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${E}`);break;case"wordSeparator":y||(y=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=g.includes(y)?y:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${E} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${E} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}o.OptionsService=b},2660:function(u,o,d){var h=this&&this.__decorate||function(b,x,E,y){var S,v=arguments.length,_=v<3?x:y===null?y=Object.getOwnPropertyDescriptor(x,E):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(b,x,E,y);else for(var C=b.length-1;C>=0;C--)(S=b[C])&&(_=(v<3?S(_):v>3?S(x,E,_):S(x,E))||_);return v>3&&_&&Object.defineProperty(x,E,_),_},p=this&&this.__param||function(b,x){return function(E,y){x(E,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=d(2585);let g=o.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const x=this._bufferService.buffer;if(b.id===void 0){const C=x.addMarker(x.ybase+x.y),N={data:b,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(N,C))),this._dataByLinkId.set(N.id,N),N.id}const E=b,y=this._getEntryIdKey(E),S=this._entriesWithId.get(y);if(S)return this.addLineToLink(S.id,x.ybase+x.y),S.id;const v=x.addMarker(x.ybase+x.y),_={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(_,v))),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(b,x){const E=this._dataByLinkId.get(b);if(E&&E.lines.every((y=>y.line!==x))){const y=this._bufferService.buffer.addMarker(x);E.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(E,y)))}}getLinkData(b){return this._dataByLinkId.get(b)?.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,x){const E=b.lines.indexOf(x);E!==-1&&(b.lines.splice(E,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};o.OscLinkService=g=h([p(0,f.IBufferService)],g)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const d="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[h]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const f=function(g,b,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,y,S){y[d]===y?y[h].push({id:E,index:S}):(y[h]=[{id:E,index:S}],y[d]=y)})(f,g,x)};return f.toString=()=>p,o.serviceRegistry.set(p,f),f}},2585:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=d(8343);var p;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(u,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=d(8460),p=d(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,x,E=!1){return(16777215&b)<<3|(3&x)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let x=0,E=0;const y=b.length;for(let S=0;S<y;++S){let v=b.charCodeAt(S);if(55296<=v&&v<=56319){if(++S>=y)return x+this.wcwidth(v);const N=b.charCodeAt(S);56320<=N&&N<=57343?v=1024*(v-55296)+N-56320+65536:x+=this.wcwidth(N)}const _=this.charProperties(v,E);let C=f.extractWidth(_);f.extractShouldJoin(_)&&(C-=f.extractWidth(E)),x+=C,E=_}return x}charProperties(b,x){return this._activeProvider.charProperties(b,x)}}o.UnicodeService=f}},i={};function s(u){var o=i[u];if(o!==void 0)return o.exports;var d=i[u]={exports:{}};return n[u].call(d.exports,d,d.exports,s),d.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=s(9042),d=s(3236),h=s(844),p=s(5741),f=s(8285),g=s(7975),b=s(7090),x=["cols","rows"];class E extends h.Disposable{constructor(S){super(),this._core=this.register(new d.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const v=C=>this._core.options[C],_=(C,N)=>{this._checkReadonlyOptions(C),this._core.options[C]=N};for(const C in this._core.options){const N={get:v.bind(this,C),set:_.bind(this,C)};Object.defineProperty(this._publicOptions,C,N)}}_checkReadonlyOptions(S){if(x.includes(S))throw new Error(`Option "${S}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const v in S)this._publicOptions[v]=S[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,v=!0){this._core.input(S,v)}resize(S,v){this._verifyIntegers(S,v),this._core.resize(S,v)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,v,_){this._verifyIntegers(S,v,_),this._core.select(S,v,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,v){this._verifyIntegers(S,v),this._core.selectLines(S,v)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,v){this._core.write(S,v)}writeln(S,v){this._core.write(S),this._core.write(`\r
|
|
92
92
|
`,v)}paste(S){this._core.paste(S)}refresh(S,v){this._verifyIntegers(S,v),this._core.refresh(S,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const v of S)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const v of S)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}u.Terminal=E})(),l})()))})(Wy)),Wy.exports}var mZ=pZ();const IN=['"Symbols Nerd Font Mono"','"Symbols Nerd Font"','"JetBrainsMono Nerd Font Mono"','"JetBrainsMono Nerd Font"','"JetBrains Mono Nerd Font Mono"','"JetBrains Mono Nerd Font"','"FiraCode Nerd Font Mono"','"FiraCode Nerd Font"','"Fira Code Nerd Font Mono"','"Fira Code Nerd Font"','"CaskaydiaCove Nerd Font"','"Caskaydia Cove Nerd Font"','"Cascadia Code PL"','"Hack Nerd Font Mono"','"Hack Nerd Font"','"MesloLGS NF"'],LN=["Menlo","Monaco",'"Courier New"',"monospace"];function DN(){const e=_t.getConfig?.();return e&&typeof e.baseURL=="string"&&e.baseURL.length>0?e.baseURL:A6()}function gZ(){if(typeof document<"u"&&"fonts"in document){const e=IN.filter(t=>{try{return document.fonts.check(`12px ${t}`)}catch{return!1}});if(e.length>0)return[...e,...LN].join(", ")}return[...IN,...LN].join(", ")}function bZ({terminalId:e}){const t=K.useRef(null),n=K.useRef(null),i=K.useRef(null),s=K.useRef(null),{data:l}=D_(),{selectTerminal:u}=sr(),o=l?.terminals.find(h=>h.id===e),d=async()=>{try{const h=DN();await fetch(`${h}/v1/terminals/${e}`,{method:"DELETE"}),u(null)}catch(h){console.error("Failed to kill terminal:",h)}};return K.useEffect(()=>{if(!t.current||!e)return;s.current&&(console.log("[TerminalViewer] Closing existing EventSource"),s.current.close(),s.current=null),console.log("[TerminalViewer] Setting up terminal:",e);const h=gZ(),p=new mZ.Terminal({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#000000",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:"#e5e5e5"},fontSize:13,fontFamily:h,cursorBlink:!0,convertEol:!0,scrollback:1e3,allowProposedApi:!0}),f=new uZ.FitAddon,g=new fZ.Unicode11Addon;p.loadAddon(f),p.loadAddon(g),p.unicode.activeVersion="11",p.open(t.current),t.current.querySelectorAll(".xterm, .xterm-rows, .xterm-helper-textarea").forEach(S=>{S.style.fontFamily=h}),setTimeout(()=>{try{f.fit()}catch(S){console.error("Failed to fit terminal:",S)}},50);const x=DN(),E=new EventSource(`${x}/v1/terminals/${e}/output`);s.current=E,E.onopen=()=>{console.log("[TerminalViewer] SSE connection opened:",e)},E.onmessage=S=>{try{const v=JSON.parse(S.data);v.type==="data"?p.write(v.line):v.type==="exit"&&p.write(`\r
|
|
93
93
|
\x1B[33m[Process exited with code ${v.exitCode}]\x1B[0m\r
|
|
94
|
-
`)}catch(v){console.error("Failed to parse terminal output:",v)}},E.onerror=S=>{E.readyState!==EventSource.CLOSED&&console.error("[TerminalViewer] SSE connection error:",{terminalId:e,url:`${x}/v1/terminals/${e}/output`,readyState:E.readyState,readyStateText:E.readyState===0?"CONNECTING":E.readyState===1?"OPEN":"CLOSED",error:S}),console.log("[TerminalViewer] Closing EventSource due to error"),E.close(),s.current===E&&(s.current=null)},p.onData(S=>{fetch(`${x}/v1/terminals/${e}/input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:S})}).catch(v=>{console.error("Failed to send terminal input:",v)})}),n.current=p,i.current=f;const y=()=>{if(i.current)try{i.current.fit()}catch(S){console.error("Failed to fit terminal on resize:",S)}};return window.addEventListener("resize",y),()=>{console.log("[TerminalViewer] Cleanup:",e),s.current&&(s.current.close(),s.current=null),window.removeEventListener("resize",y),p.dispose()}},[e]),T.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-background",children:[T.jsxs("div",{className:"h-10 border-b border-border px-3 flex items-center justify-between shrink-0 bg-muted/40",children:[T.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:()=>u(null),title:"Back to terminal list",className:"h-6 w-6 shrink-0",children:T.jsx(Y3,{className:"w-3.5 h-3.5"})}),T.jsx("span",{className:"text-xs font-medium text-muted-foreground truncate",children:o?.title||o?.purpose||e})]}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:d,title:"Kill terminal",className:"h-6 w-6 shrink-0 text-destructive hover:text-destructive",children:T.jsx(qc,{className:"w-3.5 h-3.5"})})]}),T.jsx("div",{ref:t,className:"h-full w-full bg-background"})]})}const yZ=K.memo(function(){const t=sr(p=>p.isExpanded),n=sr(p=>p.collapseSidebar),i=sr(p=>p.selectedTerminalId),s=sr(p=>p.selectTerminal),l=sr(p=>p.expandSidebar),{data:u,isLoading:o}=D_(),d=sZ(),h=async()=>{try{const p=await d.mutateAsync({command:"bash",purpose:"Manual shell"});s(p.terminalId),l()}catch(p){console.error("Failed to create terminal:",p)}};return t?T.jsxs("div",{className:"w-80 border-l border-border bg-background flex flex-col h-full",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center justify-between shrink-0",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Za,{className:"w-4 h-4"}),T.jsx("span",{className:"font-medium",children:"Terminals"}),u&&u.count>0&&T.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.count,")"]})]}),T.jsxs("div",{className:"flex items-center gap-1",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:h,title:"New terminal",disabled:d.isPending,children:T.jsx(kc,{className:"w-4 h-4"})}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,children:T.jsx(Ot,{className:"w-4 h-4"})})]})]}),T.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:i?T.jsx(bZ,{terminalId:i}):T.jsx(oZ,{terminals:u?.terminals??[],isLoading:o})})]}):null}),vZ=K.memo(function(){const t=sr(l=>l.isExpanded),n=sr(l=>l.toggleSidebar),{data:i}=D_(),s=i?.count??0;return T.jsxs("button",{type:"button",onClick:n,className:`relative p-3 w-full transition-colors touch-manipulation ${t?"bg-muted border-r-2 border-primary":"hover:bg-muted/50"}`,title:"Terminals",children:[T.jsx(Za,{className:"w-5 h-5 text-muted-foreground mx-auto"}),s>0&&T.jsx("span",{className:"absolute top-1 right-1 w-5 h-5 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center font-semibold",children:s>9?"9+":s})]})});const _Z=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),SZ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),MN=e=>{const t=SZ(e);return t.charAt(0).toUpperCase()+t.slice(1)},PL=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),EZ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var xZ={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"};const wZ=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:u,...o},d)=>K.createElement("svg",{ref:d,...xZ,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:PL("lucide",s),...!l&&!EZ(o)&&{"aria-hidden":"true"},...o},[...u.map(([h,p])=>K.createElement(h,p)),...Array.isArray(l)?l:[l]]));const as=(e,t)=>{const n=K.forwardRef(({className:i,...s},l)=>K.createElement(wZ,{ref:l,iconNode:t,className:PL(`lucide-${_Z(MN(e))}`,`lucide-${e}`,i),...s}));return n.displayName=MN(e),n};const CZ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],TZ=as("chevron-right",CZ);const AZ=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],kZ=as("menu",AZ);const RZ=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],NZ=as("moon",RZ);const OZ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],BN=as("plus",OZ);const IZ=[["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"}]],LZ=as("sun",IZ);const DZ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],MZ=as("x",DZ),BZ=K.memo(function({theme:t,onToggleTheme:n}){const i=Ir(s=>s.toggleCollapse);return T.jsxs("header",{className:"h-14 border-b border-border bg-background px-4 flex items-center justify-between relative z-30",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:i,className:"md:hidden touch-manipulation",title:"Toggle menu","aria-label":"Toggle menu",children:T.jsx(kZ,{className:"w-5 h-5"})}),T.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"AGI"})]}),T.jsx("div",{className:"flex items-center gap-2",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,title:`Switch to ${t==="dark"?"light":"dark"} mode`,"aria-label":`Switch to ${t==="dark"?"light":"dark"} mode`,className:"touch-manipulation",children:t==="dark"?T.jsx(LZ,{className:"w-4 h-4"}):T.jsx(NZ,{className:"w-4 h-4"})})})]})}),FZ=K.memo(function({children:t,onNewSession:n}){const i=Gt(u=>u.isDiffOpen),s=Ir(u=>u.isCollapsed),l=Ir(u=>u.toggleCollapse);return K.useEffect(()=>(s?document.body.style.overflow="":document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[s]),s?T.jsxs("aside",{className:"w-12 md:w-12 border-r border-border bg-background flex flex-col transition-all duration-300 ease-in-out hidden md:flex",children:[T.jsx("div",{className:"h-14 border-b border-border flex items-center justify-center",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,title:"New session",className:"rounded-full touch-manipulation",children:T.jsx(BN,{className:"w-4 h-4"})})}),T.jsx("button",{type:"button",className:"flex-1 cursor-pointer hover:bg-muted/50 transition-colors touch-manipulation",onClick:i?void 0:l,title:i?void 0:"Expand sidebar","aria-label":"Expand sidebar"}),T.jsx("div",{className:"border-t border-border p-2 flex items-center justify-center",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:l,title:"Expand sidebar",disabled:i,className:"transition-transform duration-200 hover:scale-110 touch-manipulation",children:T.jsx(TZ,{className:"w-4 h-4"})})})]}):T.jsxs(T.Fragment,{children:[!s&&T.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:l,"aria-hidden":"true"}),T.jsxs("aside",{className:"w-full md:w-64 border-r border-border bg-background flex flex-col transition-all duration-300 ease-in-out fixed md:relative top-0 left-0 z-50 h-screen md:h-auto",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center gap-2 md:hidden bg-background",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:l,title:"Close menu",className:"touch-manipulation flex-shrink-0","aria-label":"Close menu",children:T.jsx(MZ,{className:"w-5 h-5"})}),T.jsx("h1",{className:"text-lg font-semibold text-foreground flex-1",children:"AGI"})]}),T.jsx("div",{className:"h-14 border-b border-border px-4 flex items-center gap-2",children:T.jsxs(bt,{variant:"primary",size:"sm",onClick:n,className:"flex-1 touch-manipulation",children:[T.jsx(BN,{className:"w-4 h-4 mr-2"}),"New Session"]})}),T.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:t}),T.jsx("div",{className:"border-t border-border p-2 flex items-center justify-end",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:l,title:"Collapse sidebar",disabled:i,className:"transition-transform duration-200 hover:scale-110 touch-manipulation",children:T.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300",role:"img","aria-label":"Collapse sidebar",children:[T.jsx("title",{children:"Collapse sidebar"}),T.jsx("path",{d:"M15 18l-6-6 6-6"})]})})})]})]})}),PZ=K.memo(function({sidebar:t,children:n,onNewSession:i,theme:s,onToggleTheme:l}){return T.jsxs("div",{className:"h-screen flex flex-col bg-background touch-manipulation",children:[T.jsx(BZ,{onToggleTheme:l,theme:s}),T.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[T.jsx(FZ,{onNewSession:i,children:t}),T.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden relative w-full md:w-auto",children:[T.jsx(iZ,{}),n]}),T.jsxs("div",{className:"hidden md:flex",children:[T.jsx(JX,{}),T.jsx(yZ,{}),T.jsxs("div",{className:"flex flex-col w-12 border-l border-border bg-background",children:[T.jsx(eZ,{}),T.jsx(vZ,{})]})]})]}),T.jsx(aZ,{}),T.jsx(v4,{})]})}),UL="agi-theme",FN="dark";function UZ(){if(typeof window>"u")return FN;const e=window.localStorage.getItem(UL);return e==="light"||e==="dark"?e:FN}function jZ(){const[e,t]=K.useState(()=>UZ());K.useEffect(()=>{if(typeof document>"u")return;const i=document.documentElement;e==="dark"?i.classList.add("dark"):i.classList.remove("dark");try{window.localStorage.setItem(UL,e)}catch(s){console.warn("Failed to persist theme preference",s)}},[e]);const n=K.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return K.useMemo(()=>({theme:e,setTheme:t,toggleTheme:n}),[e,n])}function zZ(){const[e,t]=K.useState(null);return K.useEffect(()=>{(async()=>{try{const l=`${window.AGI_SERVER_URL||t_}/v1/config/cwd`;console.log("[useWorkingDirectory] Fetching from:",l);const u=await fetch(l);if(!u.ok)throw console.error("[useWorkingDirectory] Failed:",u.status,u.statusText),new Error(`Failed to fetch working directory: ${u.status}`);const o=await u.json();console.log("[useWorkingDirectory] Success:",o),o.dirName&&(console.log("[useWorkingDirectory] Setting title to:",o.dirName),t(o.dirName),document.title=o.dirName)}catch(i){console.error("[useWorkingDirectory] Error:",i),document.title="AGI"}})()},[]),e}function HZ({sessionIds:e,activeSessionId:t,gitFiles:n,onSelectSession:i,onNewSession:s,onStageFile:l,onUnstageFile:u,onRestoreFile:o,onDeleteFile:d,onStageAll:h,onUnstageAll:p,onOpenCommitModal:f,onViewDiff:g,onReturnToInput:b}){const{currentFocus:x,sessionIndex:E,gitFileIndex:y,setFocus:S,setSessionIndex:v,setGitFileIndex:_,resetGitFileIndex:C}=N_(),{setCollapsed:N,toggleCollapse:A}=Ir(),{isExpanded:O,toggleSidebar:R}=Gt(),I=Gt(j=>j.closeDiff),L=e.indexOf(t||""),F=K.useCallback(j=>{const z=j.target,G=z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable;if((j.ctrlKey||j.metaKey)&&j.key==="h"){j.preventDefault(),x==="sessions"?(document.activeElement?.blur(),S("input"),N(!0),setTimeout(()=>b?.(),50)):x==="git"?(document.activeElement?.blur(),S("input"),R(),I(),setTimeout(()=>b?.(),50)):(document.activeElement?.blur(),S("sessions"),N(!1),L>=0&&v(L));return}if((j.ctrlKey||j.metaKey)&&j.key==="l"){j.preventDefault(),x==="git"?(document.activeElement?.blur(),S("input"),R(),I(),setTimeout(()=>b?.(),50)):x==="sessions"?(document.activeElement?.blur(),S("input"),N(!0),setTimeout(()=>b?.(),50)):(document.activeElement?.blur(),O||R(),S("git"),C());return}if((j.ctrlKey||j.metaKey)&&j.key==="/"){j.preventDefault(),A();return}if((j.ctrlKey||j.metaKey)&&j.key==="\\"){j.preventDefault(),R();return}if((j.ctrlKey||j.metaKey)&&j.key==="n"){j.preventDefault(),s();return}if(j.key==="Escape"){j.preventDefault(),x==="sessions"?N(!0):x==="git"&&(R(),I()),S("input"),b?.();return}if(x==="sessions"&&!G){if(j.key==="j"&&e.length>0){j.preventDefault();const V=Math.min(E+1,e.length-1);v(V);return}if(j.key==="k"&&e.length>0){j.preventDefault();const V=Math.max(E-1,0);v(V);return}if(j.key==="Enter"&&e[E]){j.preventDefault(),i(e[E]),S("input");return}}if(x==="git"&&!G){if(j.key==="j"&&n.length>0){j.preventDefault();const V=Math.min(y+1,n.length-1);_(V);return}if(j.key==="k"&&n.length>0){j.preventDefault();const V=Math.max(y-1,0);_(V);return}if(j.key===" "&&n[y]){j.preventDefault();const V=n[y];V.staged?u?.(V.path):l?.(V.path);return}if(j.key==="a"){j.preventDefault(),h?.();return}if(j.key==="u"){j.preventDefault(),p?.();return}if(j.key==="R"&&n[y]){j.preventDefault();const V=n[y];!V.staged&&V.status!=="untracked"&&V.status!=="added"&&o?.(V.path);return}if(j.shiftKey&&j.key==="D"||j.key==="Backspace"){j.preventDefault();const V=n[y];V&&!V.staged&&V.status==="untracked"&&d?.(V.path);return}if(j.key==="c"){j.preventDefault(),f?.();return}if(j.key==="Enter"&&n[y]){j.preventDefault();const V=n[y];g?.(V.path,V.staged);return}}},[x,E,y,e,n,L,O,S,v,_,C,N,R,A,i,s,l,u,o,d,h,p,f,g,b,I]);return K.useEffect(()=>(window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)),[F]),{currentFocus:x,sessionIndex:E,gitFileIndex:y}}function jL({sessionId:e}){const t=K.useRef(null),n=H6(),{data:i}=uI(),{theme:s,toggleTheme:l}=jZ(),u=Ir(O=>O.setCollapsed),{openCommitModal:o,openDiff:d}=Gt(),h=zc(),{data:p=[]}=Xc(),{data:f}=O_(),g=I_(),b=L_(),x=ML(),E=BL(),y=Wv(O=>O.openConfirmation);zZ();const S=K.useCallback(()=>{setTimeout(()=>{t.current?.focus()},100)},[]),v=K.useCallback(async()=>{try{const O=await n.mutateAsync({agent:i?.defaults.agent||"general",provider:i?.defaults.provider,model:i?.defaults.model});h({to:"/sessions/$sessionId",params:{sessionId:O.id},replace:!1}),u(!0),S()}catch(O){console.error("Failed to create session:",O)}},[n,i,h,u,S]),_=K.useCallback(O=>{h({to:"/sessions/$sessionId",params:{sessionId:O}}),u(!0),S()},[h,u,S]),C=K.useMemo(()=>f?[...f.staged.map(O=>({path:O.path,staged:!0,status:O.status})),...f.unstaged.map(O=>({path:O.path,staged:!1,status:O.status})),...f.untracked.map(O=>({path:O.path,staged:!1,status:O.status}))]:[],[f]),N=K.useMemo(()=>p.map(O=>O.id),[p]);HZ({sessionIds:N,activeSessionId:e,gitFiles:C,onSelectSession:_,onNewSession:v,onStageFile:O=>g.mutate([O]),onUnstageFile:O=>b.mutate([O]),onRestoreFile:O=>x.mutate([O]),onDeleteFile:O=>{y({title:"Delete File",message:`Delete ${O}? This will permanently remove the untracked file.`,confirmLabel:"Delete",variant:"destructive",onConfirm:async()=>{await E.mutateAsync([O])}})},onStageAll:()=>{const O=C.filter(R=>!R.staged).map(R=>R.path);O.length>0&&g.mutate(O)},onUnstageAll:()=>{const O=C.filter(R=>R.staged).map(R=>R.path);O.length>0&&b.mutate(O)},onOpenCommitModal:o,onViewDiff:d,onReturnToInput:S}),K.useEffect(()=>{e&&S()},[e,S]);const A=K.useMemo(()=>e?T.jsxs(T.Fragment,{children:[T.jsx(jX,{sessionId:e}),T.jsx(K6,{ref:t,sessionId:e,onNewSession:v})]}):T.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a session or create a new one to start"}),[e,v]);return T.jsx(PZ,{onNewSession:v,theme:s,onToggleTheme:l,sidebar:T.jsx(HX,{activeSessionId:e,onSelectSession:_}),children:A})}const qZ=yo("/sessions/")({component:$Z});function $Z(){return T.jsx(jL,{})}const zL=yo("/sessions/$sessionId")({component:GZ});function GZ(){const{sessionId:e}=zL.useParams();return T.jsx(jL,{sessionId:e})}const VZ=M3.update({id:"/",path:"/",getParentRoute:()=>Hc}),WZ=qZ.update({id:"/sessions/",path:"/sessions/",getParentRoute:()=>Hc}),KZ=zL.update({id:"/sessions/$sessionId",path:"/sessions/$sessionId",getParentRoute:()=>Hc}),YZ={IndexRoute:VZ,SessionsSessionIdRoute:KZ,SessionsIndexRoute:WZ},XZ=Hc._addFileChildren(YZ)._addFileTypes(),ZZ=()=>{const n=(typeof globalThis<"u"?globalThis.AGI_ROUTER_BASEPATH:void 0)??"/"??"/";if(!n||n==="/")return"/";const i=n.replace(/\/+$/,"")||"/";return i.startsWith("/")?i:`/${i}`},QZ=N3({routeTree:XZ,basepath:ZZ()}),JZ=new LM({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,structuralSharing:!0}}});function eQ(){return T.jsx(DM,{client:JZ,children:T.jsx(L3,{router:QZ})})}const HL=document.getElementById("root");if(!HL)throw new Error("Root element not found");cM.createRoot(HL).render(T.jsx(K.StrictMode,{children:T.jsx(eQ,{})}));
|
|
94
|
+
`)}catch(v){console.error("Failed to parse terminal output:",v)}},E.onerror=S=>{E.readyState!==EventSource.CLOSED&&console.error("[TerminalViewer] SSE connection error:",{terminalId:e,url:`${x}/v1/terminals/${e}/output`,readyState:E.readyState,readyStateText:E.readyState===0?"CONNECTING":E.readyState===1?"OPEN":"CLOSED",error:S}),console.log("[TerminalViewer] Closing EventSource due to error"),E.close(),s.current===E&&(s.current=null)},p.onData(S=>{fetch(`${x}/v1/terminals/${e}/input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:S})}).catch(v=>{console.error("Failed to send terminal input:",v)})}),n.current=p,i.current=f;const y=()=>{if(i.current)try{i.current.fit()}catch(S){console.error("Failed to fit terminal on resize:",S)}};return window.addEventListener("resize",y),()=>{console.log("[TerminalViewer] Cleanup:",e),s.current&&(s.current.close(),s.current=null),window.removeEventListener("resize",y),p.dispose()}},[e]),T.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-background",children:[T.jsxs("div",{className:"h-10 border-b border-border px-3 flex items-center justify-between shrink-0 bg-muted/40",children:[T.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:()=>u(null),title:"Back to terminal list",className:"h-6 w-6 shrink-0",children:T.jsx(Y3,{className:"w-3.5 h-3.5"})}),T.jsx("span",{className:"text-xs font-medium text-muted-foreground truncate",children:o?.title||o?.purpose||e})]}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:d,title:"Kill terminal",className:"h-6 w-6 shrink-0 text-destructive hover:text-destructive",children:T.jsx(qc,{className:"w-3.5 h-3.5"})})]}),T.jsx("div",{ref:t,className:"h-full w-full bg-background"})]})}const yZ=K.memo(function(){const t=sr(p=>p.isExpanded),n=sr(p=>p.collapseSidebar),i=sr(p=>p.selectedTerminalId),s=sr(p=>p.selectTerminal),l=sr(p=>p.expandSidebar),{data:u,isLoading:o}=D_(),d=sZ(),h=async()=>{try{const p=await d.mutateAsync({command:"bash",purpose:"Manual shell"});s(p.terminalId),l()}catch(p){console.error("Failed to create terminal:",p)}};return t?T.jsxs("div",{className:"w-80 border-l border-border bg-background flex flex-col h-full",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center justify-between shrink-0",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Za,{className:"w-4 h-4"}),T.jsx("span",{className:"font-medium",children:"Terminals"}),u&&u.count>0&&T.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u.count,")"]})]}),T.jsxs("div",{className:"flex items-center gap-1",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:h,title:"New terminal",disabled:d.isPending,children:T.jsx(kc,{className:"w-4 h-4"})}),T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,children:T.jsx(Ot,{className:"w-4 h-4"})})]})]}),T.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:i?T.jsx(bZ,{terminalId:i}):T.jsx(oZ,{terminals:u?.terminals??[],isLoading:o})})]}):null}),vZ=K.memo(function(){const t=sr(l=>l.isExpanded),n=sr(l=>l.toggleSidebar),{data:i}=D_(),s=i?.count??0;return T.jsxs("button",{type:"button",onClick:n,className:`relative p-3 w-full transition-colors touch-manipulation ${t?"bg-muted border-r-2 border-primary":"hover:bg-muted/50"}`,title:"Terminals",children:[T.jsx(Za,{className:"w-5 h-5 text-muted-foreground mx-auto"}),s>0&&T.jsx("span",{className:"absolute top-1 right-1 w-5 h-5 bg-primary text-primary-foreground text-xs rounded-full flex items-center justify-center font-semibold",children:s>9?"9+":s})]})});const _Z=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),SZ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),MN=e=>{const t=SZ(e);return t.charAt(0).toUpperCase()+t.slice(1)},PL=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),EZ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var xZ={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"};const wZ=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:u,...o},d)=>K.createElement("svg",{ref:d,...xZ,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:PL("lucide",s),...!l&&!EZ(o)&&{"aria-hidden":"true"},...o},[...u.map(([h,p])=>K.createElement(h,p)),...Array.isArray(l)?l:[l]]));const as=(e,t)=>{const n=K.forwardRef(({className:i,...s},l)=>K.createElement(wZ,{ref:l,iconNode:t,className:PL(`lucide-${_Z(MN(e))}`,`lucide-${e}`,i),...s}));return n.displayName=MN(e),n};const CZ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],TZ=as("chevron-right",CZ);const AZ=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],kZ=as("menu",AZ);const RZ=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],NZ=as("moon",RZ);const OZ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],BN=as("plus",OZ);const IZ=[["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"}]],LZ=as("sun",IZ);const DZ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],MZ=as("x",DZ),BZ=K.memo(function({theme:t,onToggleTheme:n}){const i=Ir(s=>s.toggleCollapse);return T.jsxs("header",{className:"h-14 border-b border-border bg-background px-4 flex items-center justify-between relative z-30",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:i,className:"md:hidden touch-manipulation",title:"Toggle menu","aria-label":"Toggle menu",children:T.jsx(kZ,{className:"w-5 h-5"})}),T.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"AGI"})]}),T.jsx("div",{className:"flex items-center gap-2",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,title:`Switch to ${t==="dark"?"light":"dark"} mode`,"aria-label":`Switch to ${t==="dark"?"light":"dark"} mode`,className:"touch-manipulation",children:t==="dark"?T.jsx(LZ,{className:"w-4 h-4"}):T.jsx(NZ,{className:"w-4 h-4"})})})]})}),FZ=K.memo(function({children:t,onNewSession:n}){const i=Gt(u=>u.isDiffOpen),s=Ir(u=>u.isCollapsed),l=Ir(u=>u.toggleCollapse);return K.useEffect(()=>(s?document.body.style.overflow="":document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[s]),s?T.jsxs("aside",{className:"w-12 md:w-12 border-r border-border bg-background flex flex-col transition-all duration-300 ease-in-out hidden md:flex",children:[T.jsx("div",{className:"h-14 border-b border-border flex items-center justify-center",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:n,title:"New session",className:"rounded-full touch-manipulation",children:T.jsx(BN,{className:"w-4 h-4"})})}),T.jsx("button",{type:"button",className:"flex-1 cursor-pointer hover:bg-muted/50 transition-colors touch-manipulation",onClick:i?void 0:l,title:i?void 0:"Expand sidebar","aria-label":"Expand sidebar"}),T.jsx("div",{className:"border-t border-border p-2 flex items-center justify-center",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:l,title:"Expand sidebar",disabled:i,className:"transition-transform duration-200 hover:scale-110 touch-manipulation",children:T.jsx(TZ,{className:"w-4 h-4"})})})]}):T.jsxs(T.Fragment,{children:[!s&&T.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:l,"aria-hidden":"true"}),T.jsxs("aside",{className:"w-full md:w-64 border-r border-border bg-background flex flex-col transition-all duration-300 ease-in-out fixed md:relative top-0 left-0 z-50 h-screen md:h-auto",children:[T.jsxs("div",{className:"h-14 border-b border-border px-4 flex items-center gap-2 md:hidden bg-background",children:[T.jsx(bt,{variant:"ghost",size:"icon",onClick:l,title:"Close menu",className:"touch-manipulation flex-shrink-0","aria-label":"Close menu",children:T.jsx(MZ,{className:"w-5 h-5"})}),T.jsx("h1",{className:"text-lg font-semibold text-foreground flex-1",children:"AGI"})]}),T.jsx("div",{className:"h-14 border-b border-border px-4 flex items-center gap-2",children:T.jsxs(bt,{variant:"primary",size:"sm",onClick:n,className:"flex-1 touch-manipulation",children:[T.jsx(BN,{className:"w-4 h-4 mr-2"}),"New Session"]})}),T.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:t}),T.jsx("div",{className:"border-t border-border p-2 flex items-center justify-end",children:T.jsx(bt,{variant:"ghost",size:"icon",onClick:l,title:"Collapse sidebar",disabled:i,className:"transition-transform duration-200 hover:scale-110 touch-manipulation",children:T.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300",role:"img","aria-label":"Collapse sidebar",children:[T.jsx("title",{children:"Collapse sidebar"}),T.jsx("path",{d:"M15 18l-6-6 6-6"})]})})})]})]})}),PZ=K.memo(function({sidebar:t,children:n,onNewSession:i,theme:s,onToggleTheme:l}){return T.jsxs("div",{className:"h-screen flex flex-col bg-background touch-manipulation",children:[T.jsx(BZ,{onToggleTheme:l,theme:s}),T.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[T.jsx(FZ,{onNewSession:i,children:t}),T.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden relative w-full md:w-auto",children:[T.jsx(iZ,{}),n]}),T.jsxs("div",{className:"hidden md:flex",children:[T.jsx(JX,{}),T.jsx(yZ,{}),T.jsxs("div",{className:"flex flex-col w-12 border-l border-border bg-background",children:[T.jsx(eZ,{}),T.jsx(vZ,{})]})]})]}),T.jsx(aZ,{}),T.jsx(v4,{})]})}),UL="agi-theme",FN="dark";function UZ(){if(typeof window>"u")return FN;const e=window.localStorage.getItem(UL);return e==="light"||e==="dark"?e:FN}function jZ(){const[e,t]=K.useState(()=>UZ());K.useEffect(()=>{if(typeof document>"u")return;const i=document.documentElement;e==="dark"?i.classList.add("dark"):i.classList.remove("dark");try{window.localStorage.setItem(UL,e)}catch(s){console.warn("Failed to persist theme preference",s)}},[e]);const n=K.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return K.useMemo(()=>({theme:e,setTheme:t,toggleTheme:n}),[e,n])}function zZ(){const[e,t]=K.useState(null);return K.useEffect(()=>{(async()=>{try{const l=`${window.AGI_SERVER_URL||t_}/v1/config/cwd`;console.log("[useWorkingDirectory] Fetching from:",l);const u=await fetch(l);if(!u.ok)throw console.error("[useWorkingDirectory] Failed:",u.status,u.statusText),new Error(`Failed to fetch working directory: ${u.status}`);const o=await u.json();console.log("[useWorkingDirectory] Success:",o),o.dirName&&(console.log("[useWorkingDirectory] Setting title to:",o.dirName),t(o.dirName),document.title=o.dirName)}catch(i){console.error("[useWorkingDirectory] Error:",i),document.title="AGI"}})()},[]),e}function HZ({sessionIds:e,activeSessionId:t,gitFiles:n,onSelectSession:i,onNewSession:s,onStageFile:l,onUnstageFile:u,onRestoreFile:o,onDeleteFile:d,onStageAll:h,onUnstageAll:p,onOpenCommitModal:f,onViewDiff:g,onReturnToInput:b}){const{currentFocus:x,sessionIndex:E,gitFileIndex:y,setFocus:S,setSessionIndex:v,setGitFileIndex:_,resetGitFileIndex:C}=N_(),{setCollapsed:N,toggleCollapse:A}=Ir(),{isExpanded:O,toggleSidebar:R}=Gt(),I=Gt(j=>j.closeDiff),L=e.indexOf(t||""),F=K.useCallback(j=>{const z=j.target,G=z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable;if((j.ctrlKey||j.metaKey)&&j.key==="h"){j.preventDefault(),x==="sessions"?(document.activeElement?.blur(),S("input"),N(!0),setTimeout(()=>b?.(),50)):x==="git"?(document.activeElement?.blur(),S("input"),R(),I(),setTimeout(()=>b?.(),50)):(document.activeElement?.blur(),S("sessions"),N(!1),L>=0&&v(L));return}if((j.ctrlKey||j.metaKey)&&j.key==="l"){j.preventDefault(),x==="git"?(document.activeElement?.blur(),S("input"),R(),I(),setTimeout(()=>b?.(),50)):x==="sessions"?(document.activeElement?.blur(),S("input"),N(!0),setTimeout(()=>b?.(),50)):(document.activeElement?.blur(),O||R(),S("git"),C());return}if((j.ctrlKey||j.metaKey)&&j.key==="/"){j.preventDefault(),A();return}if((j.ctrlKey||j.metaKey)&&j.key==="\\"){j.preventDefault(),R();return}if((j.ctrlKey||j.metaKey)&&j.key==="n"){j.preventDefault(),s();return}if(j.key==="Escape"||j.key==="q"){j.preventDefault(),x==="sessions"?N(!0):x==="git"&&(R(),I()),S("input"),b?.();return}if(x==="sessions"&&!G){if(j.key==="j"&&e.length>0){j.preventDefault();const V=Math.min(E+1,e.length-1);v(V);return}if(j.key==="k"&&e.length>0){j.preventDefault();const V=Math.max(E-1,0);v(V);return}if(j.key==="Enter"&&e[E]){j.preventDefault(),i(e[E]),S("input");return}}if(x==="git"&&!G){if(j.key==="j"&&n.length>0){j.preventDefault();const V=Math.min(y+1,n.length-1);_(V);return}if(j.key==="k"&&n.length>0){j.preventDefault();const V=Math.max(y-1,0);_(V);return}if(j.key===" "&&n[y]){j.preventDefault();const V=n[y];V.staged?u?.(V.path):l?.(V.path);return}if(j.key==="a"){j.preventDefault(),h?.();return}if(j.key==="u"){j.preventDefault(),p?.();return}if(j.key==="R"&&n[y]){j.preventDefault();const V=n[y];!V.staged&&V.status!=="untracked"&&V.status!=="added"&&o?.(V.path);return}if(j.shiftKey&&j.key==="D"||j.key==="Backspace"){j.preventDefault();const V=n[y];V&&!V.staged&&V.status==="untracked"&&d?.(V.path);return}if(j.key==="c"){j.preventDefault(),f?.();return}if(j.key==="Enter"&&n[y]){j.preventDefault();const V=n[y];g?.(V.path,V.staged);return}}},[x,E,y,e,n,L,O,S,v,_,C,N,R,A,i,s,l,u,o,d,h,p,f,g,b,I]);return K.useEffect(()=>(window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)),[F]),{currentFocus:x,sessionIndex:E,gitFileIndex:y}}function jL({sessionId:e}){const t=K.useRef(null),n=H6(),{data:i}=uI(),{theme:s,toggleTheme:l}=jZ(),u=Ir(O=>O.setCollapsed),{openCommitModal:o,openDiff:d}=Gt(),h=zc(),{data:p=[]}=Xc(),{data:f}=O_(),g=I_(),b=L_(),x=ML(),E=BL(),y=Wv(O=>O.openConfirmation);zZ();const S=K.useCallback(()=>{setTimeout(()=>{t.current?.focus()},100)},[]),v=K.useCallback(async()=>{try{const O=await n.mutateAsync({agent:i?.defaults.agent||"general",provider:i?.defaults.provider,model:i?.defaults.model});h({to:"/sessions/$sessionId",params:{sessionId:O.id},replace:!1}),u(!0),S()}catch(O){console.error("Failed to create session:",O)}},[n,i,h,u,S]),_=K.useCallback(O=>{h({to:"/sessions/$sessionId",params:{sessionId:O}}),u(!0),S()},[h,u,S]),C=K.useMemo(()=>f?[...f.staged.map(O=>({path:O.path,staged:!0,status:O.status})),...f.unstaged.map(O=>({path:O.path,staged:!1,status:O.status})),...f.untracked.map(O=>({path:O.path,staged:!1,status:O.status}))]:[],[f]),N=K.useMemo(()=>p.map(O=>O.id),[p]);HZ({sessionIds:N,activeSessionId:e,gitFiles:C,onSelectSession:_,onNewSession:v,onStageFile:O=>g.mutate([O]),onUnstageFile:O=>b.mutate([O]),onRestoreFile:O=>x.mutate([O]),onDeleteFile:O=>{y({title:"Delete File",message:`Delete ${O}? This will permanently remove the untracked file.`,confirmLabel:"Delete",variant:"destructive",onConfirm:async()=>{await E.mutateAsync([O])}})},onStageAll:()=>{const O=C.filter(R=>!R.staged).map(R=>R.path);O.length>0&&g.mutate(O)},onUnstageAll:()=>{const O=C.filter(R=>R.staged).map(R=>R.path);O.length>0&&b.mutate(O)},onOpenCommitModal:o,onViewDiff:d,onReturnToInput:S}),K.useEffect(()=>{e&&S()},[e,S]);const A=K.useMemo(()=>e?T.jsxs(T.Fragment,{children:[T.jsx(jX,{sessionId:e}),T.jsx(K6,{ref:t,sessionId:e,onNewSession:v})]}):T.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Select a session or create a new one to start"}),[e,v]);return T.jsx(PZ,{onNewSession:v,theme:s,onToggleTheme:l,sidebar:T.jsx(HX,{activeSessionId:e,onSelectSession:_}),children:A})}const qZ=yo("/sessions/")({component:$Z});function $Z(){return T.jsx(jL,{})}const zL=yo("/sessions/$sessionId")({component:GZ});function GZ(){const{sessionId:e}=zL.useParams();return T.jsx(jL,{sessionId:e})}const VZ=M3.update({id:"/",path:"/",getParentRoute:()=>Hc}),WZ=qZ.update({id:"/sessions/",path:"/sessions/",getParentRoute:()=>Hc}),KZ=zL.update({id:"/sessions/$sessionId",path:"/sessions/$sessionId",getParentRoute:()=>Hc}),YZ={IndexRoute:VZ,SessionsSessionIdRoute:KZ,SessionsIndexRoute:WZ},XZ=Hc._addFileChildren(YZ)._addFileTypes(),ZZ=()=>{const n=(typeof globalThis<"u"?globalThis.AGI_ROUTER_BASEPATH:void 0)??"/"??"/";if(!n||n==="/")return"/";const i=n.replace(/\/+$/,"")||"/";return i.startsWith("/")?i:`/${i}`},QZ=N3({routeTree:XZ,basepath:ZZ()}),JZ=new LM({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,structuralSharing:!0}}});function eQ(){return T.jsx(DM,{client:JZ,children:T.jsx(L3,{router:QZ})})}const HL=document.getElementById("root");if(!HL)throw new Error("Root element not found");cM.createRoot(HL).render(T.jsx(K.StrictMode,{children:T.jsx(eQ,{})}));
|