opencode-webui 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{index-BHminhzR.js → index-DDE-utaG.js} +5 -5
- package/dist/assets/{report-9wOQi_Kx.js → report-B9LU5-59.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +2 -1
- package/server/ext/engine.ts +161 -0
- package/server/ext/kv.ts +2 -3
- package/server/ext/registry.ts +3 -3
- package/server/ext/types.ts +24 -0
- package/server/index.ts +70 -1
- package/skills/webui/SKILL.md +17 -13
- package/webui-extensions/README.md +119 -15
|
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
6
6
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function ot(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,L=`__reactProps$`+st,lt=`__reactContainer$`+st,ut=`__reactEvents$`+st,dt=`__reactListeners$`+st,ft=`__reactHandles$`+st,pt=`__reactResources$`+st,mt=`__reactMarker$`+st;function ht(e){delete e[ct],delete e[L],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[ct])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[ct]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$`),Et={},Dt={};function Ot(e){return Se.call(Dt,e)?!0:Se.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Mt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Zt=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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[L]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[L]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(ku(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[L]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=m({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(m({},On,{dataTransfer:0})),jn=bn(m({},Cn,{relatedTarget:0})),Mn=bn(m({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(m({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),R=bn(m({},xn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=bn(m({},Cn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=bn(m({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),z=bn(m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Vn=bn(m({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=bn(m({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Un=bn(m({},xn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=un&&`CompositionEvent`in window,Kn=null;un&&`documentMode`in document&&(Kn=document.documentMode);var qn=un&&`TextEvent`in window&&!Kn,Jn=un&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=gn(),hn=mn=pn=null,$n=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Ld(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var B=null,ar=null;function or(e){kd(e,0)}function sr(e){if(It(vt(e)))return e}function cr(e,t){if(e===`change`)return t}var lr=!1;if(un){var ur;if(un){var dr=`oninput`in document;if(!dr){var fr=document.createElement(`div`);fr.setAttribute(`oninput`,`return;`),dr=typeof fr.oninput==`function`}ur=dr}else ur=!1;lr=ur&&(!document.documentMode||9<document.documentMode)}function pr(){B&&(B.detachEvent(`onpropertychange`,mr),ar=B=null)}function mr(e){if(e.propertyName===`value`&&sr(ar)){var t=[];ir(t,ar,e,nn(e)),cn(or,t)}}function hr(e,t,n){e===`focusin`?(pr(),B=t,ar=n,B.attachEvent(`onpropertychange`,mr)):e===`focusout`&&pr()}function gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return sr(ar)}function _r(e,t){if(e===`click`)return sr(t)}function vr(e,t){if(e===`input`||e===`change`)return sr(t)}function yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var br=typeof Object.is==`function`?Object.is:yr;function xr(e,t){if(br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Se.call(t,i)||!br(e[i],t[i]))return!1}return!0}function Sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=Sr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Dr=un&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==Lt(r)||(r=Or,`selectionStart`in r&&Er(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&xr(Ar,r)||(Ar=r,r=Ld(kr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},Fr={},Ir={};un&&(Ir=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function Lr(e){if(Fr[e])return Fr[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ir)return Fr[e]=t[n];return e}var Rr=Lr(`animationend`),zr=Lr(`animationiteration`),Br=Lr(`animationstart`),Vr=Lr(`transitionrun`),Hr=Lr(`transitionstart`),Ur=Lr(`transitioncancel`),Wr=Lr(`transitionend`),Gr=new Map,Kr=`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(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),Ct(t,[e])}var Jr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Yr=[],Xr=0,Zr=0;function V(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<bu)throw bu=0,xu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=tp(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ai(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ui(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ai(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ai(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ai(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-ze(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[L]=r,n){case`dialog`:Ad(`cancel`,t),Ad(`close`,t);break;case`iframe`:case`object`:case`embed`:Ad(`load`,t);break;case`video`:case`audio`:for(n=0;n<Dd.length;n++)Ad(Dd[n],t);break;case`source`:Ad(`error`,t);break;case`img`:case`image`:case`link`:Ad(`error`,t),Ad(`load`,t);break;case`details`:Ad(`toggle`,t);break;case`input`:Ad(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Ad(`invalid`,t);break;case`textarea`:Ad(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ud(t.textContent,n)?(r.popover!=null&&(Ad(`beforetoggle`,t),Ad(`toggle`,t)),r.onScroll!=null&&Ad(`scroll`,t),r.onScrollEnd!=null&&Ad(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||tf(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=Sf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=Sf(e)}else t===27?(t=ji,uf(e.type)?(e=xf,xf=null,ji=e):ji=t):ji=Ai?bf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=F(null),Wi=null,Gi=null;function Ki(e,t,n){oe(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,I(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=xd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=N.S;N.S=function(e,t){lu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=F(null);function _a(){var e=ga.current;return e===null?Wl.pooledCache:e}function va(e,t){t===null?oe(ga,ga.current):oe(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Wl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ui(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=li(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=pi(t,e.mode,n),t.return=e,t;case O:return t=Ea(t),f(e,t,n)}if(ne(t)||j(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ea(n),p(e,t,n,r)}if(ne(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ea(r),m(e,t,n,r,i)}if(ne(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Mi&&Ti(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Mi&&Ti(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Mi&&Ti(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ea(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===C)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ul&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Kl&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),eu|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=F(null),Za=F(0);function Qa(e,t){e=Ql,oe(Za,e),oe(Xa,t),Ql=e|t.baseLanes}function $a(){oe(Za,Ql),oe(Xa,Xa.current)}function eo(){Ql=Za.current,I(Xa),I(Za)}var to=F(null),no=null;function ro(e){var t=e.alternate;oe(co,co.current&1),oe(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){oe(co,co.current),oe(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(oe(co,co.current),oe(to,e),no===null&&(no=e)):oo(e)}function oo(){oe(co,co.current),oe(to,to.current)}function so(e){I(to),no===e&&(no=null),I(co)}var co=F(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_f(n)||vf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=0,fo=null,po=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function So(){throw Error(i(321))}function Co(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!br(e[n],t[n]))return!1;return!0}function wo(e,t,n,r,i,a){return uo=a,fo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Vs:Hs,_o=!1,a=n(r,i),_o=!1,go&&(a=Eo(t,n,r,i)),To(e),a}function To(e){N.H=Bs;var t=po!==null&&po.next!==null;if(uo=0,mo=po=fo=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||ac||(e=e.dependencies,e!==null&&Zi(e)&&(ac=!0))}function Eo(e,t,n,r){fo=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Us,o=t(n,r)}while(go);return o}function Do(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Po(t):t,e=e.useState()[0],(po===null?null:po.memoizedState)!==e&&(fo.flags|=1024),t}function Oo(){var e=vo!==0;return vo=0,e}function ko(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ao(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}uo=0,mo=po=fo=null,go=!1,yo=vo=0,bo=null}function jo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?fo.memoizedState=mo=e:mo=mo.next=e,mo}function Mo(){if(po===null){var e=fo.alternate;e=e===null?null:e.memoizedState}else e=po.next;var t=mo===null?fo.memoizedState:mo.next;if(t!==null)mo=t,po=e;else{if(e===null)throw fo.alternate===null?Error(i(467)):Error(i(310));po=e,e={memoizedState:po.memoizedState,baseState:po.baseState,baseQueue:po.baseQueue,queue:po.queue,next:null},mo===null?fo.memoizedState=mo=e:mo=mo.next=e}return mo}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Ta(bo,e,t),t=fo,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Vs:Hs),e}function Fo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Po(e);if(e.$$typeof===C)return $i(e)}throw Error(i(438,String(e)))}function Io(e){var t=null,n=fo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=fo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),fo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(Mo(),po,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(uo&f)===f:(Kl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,fo.lanes|=p,eu|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,fo.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!br(o,e.memoizedState)&&(ac=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=Mo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);br(o,t.memoizedState)||(ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vo(e,t,n){var r=fo,a=Mo(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!br((po||a).memoizedState,n);if(s&&(a.memoizedState=n,ac=!0),a=a.queue,fs(Wo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),Wl===null)throw Error(i(349));o||uo&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fo.updateQueue,t===null?(t=No(),fo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!br(e,n)}catch{return!0}}function Ko(e){var t=ei(e,2);t!==null&&wu(t,e,2)}function qo(e){var t=jo();if(typeof e==`function`){var n=e;if(e=n(),_o){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,po,typeof r==`function`?r:Lo)}function Yo(e,t,n,r,a){if(Ls(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Xo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(Mi){var n=Wl.formState;if(n!==null){a:{var r=fo;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=bf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=bf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=jo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,fo,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,fo,!1,r.queue),r=jo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,fo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(Mo(),po,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(Lo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Po(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Mo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(fo.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=Mo(),n=po;if(n!==null)return is(t,n,e);Mo(),t=t.memoizedState,n=Mo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=fo.updateQueue,t===null&&(t=No(),fo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return Mo().memoizedState}function ls(e,t,n,r){var i=jo();fo.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=Mo();r=r===void 0?null:r;var a=i.memoizedState.inst;po!==null&&r!==null&&Co(r,po.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(fo.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){fo.flags|=4;var t=fo.updateQueue;if(t===null)t=No(),fo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=Mo().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(Ul&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Co(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Co(t,r[1]))return r[0];if(r=e(),_o){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||uo&1073741824&&!(Kl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),fo.lanes|=e,eu|=e,n)}function Cs(e,t,n,r){return br(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(Kl&261930)?(ac=!0,e.memoizedState=n):(e=Cu(),fo.lanes|=e,eu|=e,t):(e=Ss(e,n,r),br(e,t)||(ac=!0),e)}function ws(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Is(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ma(c,r),Su(e)):Fs(e,t,r,Su(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;ws(e,a,t,re,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},Su())}function ks(){return $i(up)}function As(){return Mo().memoizedState}function js(){return Mo().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Va(n);var r=Ha(t,e,n);r!==null&&(wu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=$r(e,t,n,r),n!==null&&(wu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,Su())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,o))return Qr(e,t,i,0),Wl===null&&V(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return wu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&wu(t,e,2)}function Ls(e){var t=e.alternate;return e===fo||t!==null&&t===fo}function Rs(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Bs={readContext:$i,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Bs.useEffectEvent=So;var Vs={readContext:$i,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,fo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,fo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,fo,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=fo,a=jo();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Wl===null)throw Error(i(349));Kl&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=Wl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=jo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,fo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Io,useCacheRefresh:function(){return jo().memoizedState=Ms.bind(null,fo)},useEffectEvent:function(e){var t=jo(),n={impl:e};return t.memoizedState=n,function(){if(Ul&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:$i,use:Fo,useCallback:bs,useContext:$i,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(Mo(),po.memoizedState,e,t)},useTransition:function(){var e=Ro(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(Mo(),po,e,t)},useMemoCache:Io,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:$i,use:Fo,useCallback:bs,useContext:$i,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=Mo();return po===null?Ss(n,e,t):Cs(n,po.memoizedState,e,t)},useTransition:function(){var e=Bo(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=Mo();return po===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,po,e,t)},useMemoCache:Io,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(wu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(wu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(wu(t,e,n),Ua(t,e,n))}};function Ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!xr(n,r)||!xr(i,a):!0}function qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){Jr(e)}function Xs(e){console.error(e)}function Zs(e){Jr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Va(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(fu===null?fu=new Set([this]):fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Iu():n.alternate===null&&$l===0&&($l=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),td(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),td(e,r,a)),!1}throw Error(i(435,n.tag))}return td(e,r,a),Iu(),!1}if(Mi)return t=to.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=ec(e.stateNode,r,a),Wa(e,a),$l!==4&&($l=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),au===null?au=[o]:au.push(o),$l!==4&&($l=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(fu===null||!fu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=wo(e,t,n,o,a,i),s=Oo(),e!==null&&!ac?(ko(e,t,i),jc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref){if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Ia(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(io(t),(e=ji)?(e=gf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a){if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(ac||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,ac||a){if(r=Wl,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),wu(r,e,s),ic;Iu(),t=mc(e,t,n)}else e=o.treeContext,ji=bf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=pc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return Qi(t),n=wo(e,t,n,r,void 0,i),r=Oo(),e!==null&&!ac?(ko(e,t,i),jc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=Eo(t,r,n,i),To(e),r=Oo(),e!==null&&!ac?(ko(e,t,a),jc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Ra||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Ra||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Bi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:ya()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function wc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(co.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Mi){if(a?ro(t):oo(t),(e=ji)?(e=gf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(oo(t),a=t.mode,c=Ec({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(ro(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ro(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,a=t.mode,r=Ec({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),vf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Wl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),wu(s,e,r),ic;_f(c)||Iu(),t=Dc(e,t,n)}else _f(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=bf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return a?(oo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ia(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,oe(co,o),oc(e,t,r,n),r=Mi?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Zi(e)))}function Nc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(co,co.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}}else ac=!1,Mi&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=sc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),yc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=bc(e,t,r,n);break a}if(r!==a){a=hi(Error(i(424)),t),Hi(a),t=bc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=bf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=Vf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Qd(le.current).createElement(n),r[ct]=t,r[L]=e,Kd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Mi&&(r=t.stateNode=wf(t.type,t.pendingProps,le.current),Ai=t,Pi=!0,a=ji,uf(t.type)?(xf=a,ji=bf(r.firstChild)):ji=a),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=mf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=bf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,tf(a,o)?r=null:s!==null&&tf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=wo(e,t,Do,null,null,n),up._currentValue=a),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=hf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return wc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Wl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Nu())e.flags|=8192;else throw Da=Ca,xa}}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!np(t)){if(Nu())e.flags|=8192;else throw Da=Ca,xa}}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,iu|=t)}function zc(e,t){if(!Mi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Bc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Fc(t),o===null?(Bc(t),Ic(t,a,null,r,n)):(Bc(t),Lc(t,o))):o?o===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,o)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}e=se.current,zi(t)?Li(t,e):(e=wf(a,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}if(o=se.current,zi(t))Li(t,o);else{var s=Qd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[L]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Kd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Ii(t,!0)}else e=Qd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(i(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(so(t),t):(so(t),null)}return so(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),Bc(t),null);case 4:return fe(),e===null&&Nd(t.stateNode.containerInfo),Bc(t),null;case 10:return qi(t.type),Bc(t),null;case 19:if(I(co),r=t.memoizedState,r===null)return Bc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)zc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return oe(co,co.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>uu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return Bc(t),null}else 2*De()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=co.current,oe(co,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Bc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(co),null;case 4:return fe(),null;case 10:return qi(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&I(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Uc(e,t){switch(Oi(t),t.tag){case 3:qi(aa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:I(co);break;case 10:qi(t.type);break;case 22:case 23:so(t),eo(),e!==null&&I(ga);break;case 24:qi(aa)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ed(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){ed(e,e.return,t)}}}function qc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ed(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ed(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ed(e,t,n)}else n.current=null}}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ed(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[L]=t}catch(t){ed(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&uf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[ct]=e,t[L]=n}catch(t){ed(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,Xd=yp,e=Tr(e),Er(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},yp=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ed(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:wl(e,n),r&4&&Wc(5,n);break;case 1:if(wl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ed(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ed(n,n.return,e)}}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(wl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){ed(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:wl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:wl(e,n);break;case 31:wl(e,n),r&4&&hl(e,n);break;case 13:wl(e,n),r&4&&gl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=id.bind(null,n),yf(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?El(e,n,!!(n.subtreeFlags&8772)):wl(e,n),rl=i,il=a}break;case 30:break;default:wl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dl=null,fl=!1;function pl(e,t,n){for(n=n.child;n!==null;)ml(e,t,n),n=n.sibling}function ml(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=dl,i=fl;uf(n.type)&&(dl=n.stateNode,fl=!1),pl(e,t,n),Tf(n.stateNode),dl=r,fl=i;break;case 5:il||Yc(n,t);case 6:if(r=dl,i=fl,dl=null,pl(e,t,n),dl=r,fl=i,dl!==null){if(fl)try{(dl.nodeType===9?dl.body:dl.nodeName===`HTML`?dl.ownerDocument.body:dl).removeChild(n.stateNode)}catch(e){ed(n,t,e)}else try{dl.removeChild(n.stateNode)}catch(e){ed(n,t,e)}}break;case 18:dl!==null&&(fl?(e=dl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):df(dl,n.stateNode));break;case 4:r=dl,i=fl,dl=n.stateNode.containerInfo,fl=!0,pl(e,t,n),dl=r,fl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),pl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,pl(e,t,n),il=r;break;default:pl(e,t,n)}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){ed(t,t.return,e)}}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){ed(t,t.return,e)}}function _l(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(i(435,e.tag))}}function vl(e,t){var n=_l(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ad.bind(null,e,t);t.then(r,r)}})}function yl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){dl=c.stateNode,fl=!1;break a}break;case 5:dl=c.stateNode,fl=!1;break a;case 3:case 4:dl=c.stateNode.containerInfo,fl=!0;break a}c=c.return}if(dl===null)throw Error(i(160));ml(o,s,a),dl=null,fl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xl(t,e),t=t.sibling}var bl=null;function xl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yl(t,e),Sl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=bl;if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[mt]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Kd(o,r,n),o[ct]=e,bt(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=$f(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,bt(o),r=o}e.stateNode=r}else ep(a,e.type,e.stateNode)}else e.stateNode=Jf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ep(a,e.type,e.stateNode):Jf(a,r,e.memoizedProps))}break;case 27:yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(yl(t,e),Sl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){ed(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(yl(t,e),Sl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ed(e,e.return,t)}}break;case 3:if(Qf=null,a=bl,bl=Of(t.containerInfo),yl(t,e),bl=a,Sl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){ed(e,e.return,t)}al&&(al=!1,Cl(e));break;case 4:r=bl,bl=Of(e.stateNode.containerInfo),yl(t,e),Sl(e),bl=r;break;case 12:yl(t,e),Sl(e);break;case 31:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 13:yl(t,e),Sl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||a,il=d||l,yl(t,e),il=d,rl=u,Sl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||rl||il||Tl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){ed(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){ed(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){ed(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,vl(e,n))));break;case 19:yl(t,e),Sl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,vl(e,r)));break;case 30:break;case 21:break;default:yl(t,e),Sl(e)}}function Sl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;tl(e,$c(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),tl(e,$c(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(i(161))}}catch(t){ed(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),Tl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),Tl(t);break;case 27:Tf(t.stateNode);case 26:case 5:Yc(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function El(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:El(i,a,n),Wc(4,a);break;case 1:if(El(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ed(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){ed(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:El(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:El(i,a,n);break;case 31:El(i,a,n),n&&o&4&&hl(i,a);break;case 13:El(i,a,n),n&&o&4&&gl(i,a);break;case 22:a.memoizedState===null&&El(i,a,n),Jc(a,a.return);break;case 30:break;default:El(i,a,n)}t=t.sibling}}function Dl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function Ol(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function kl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Al(e,t,n,r),t=t.sibling}function Al(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:kl(e,t,n,r),i&2048&&Wc(9,t);break;case 1:kl(e,t,n,r);break;case 3:kl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){kl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){ed(t,t.return,e)}}else kl(e,t,n,r);break;case 31:kl(e,t,n,r);break;case 13:kl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?kl(e,t,n,r):(a._visibility|=2,jl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?kl(e,t,n,r):Ml(e,t),i&2048&&Dl(o,t);break;case 24:kl(e,t,n,r),i&2048&&Ol(t.alternate,t);break;default:kl(e,t,n,r)}}function jl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:jl(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,jl(a,o,s,c,i)):u._visibility&2?jl(a,o,s,c,i):Ml(a,o),i&&l&2048&&Dl(o.alternate,o);break;case 24:jl(a,o,s,c,i),i&&l&2048&&Ol(o.alternate,o);break;default:jl(a,o,s,c,i)}t=t.sibling}}function Ml(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ml(n,r),i&2048&&Dl(r.alternate,r);break;case 24:Ml(n,r),i&2048&&Ol(r.alternate,r);break;default:Ml(n,r)}t=t.sibling}}var Nl=8192;function Pl(e,t,n){if(e.subtreeFlags&Nl)for(e=e.child;e!==null;)Fl(e,t,n),e=e.sibling}function Fl(e,t,n){switch(e.tag){case 26:Pl(e,t,n),e.flags&Nl&&e.memoizedState!==null&&rp(n,bl,e.memoizedState,e.memoizedProps);break;case 5:Pl(e,t,n);break;case 3:case 4:var r=bl;bl=Of(e.stateNode.containerInfo),Pl(e,t,n),bl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Nl,Nl=16777216,Pl(e,t,n),Nl=r):Pl(e,t,n));break;default:Pl(e,t,n)}}function Il(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rl(e),e=e.sibling}function Rl(e){switch(e.tag){case 0:case 11:case 15:Ll(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Ll(e);break;case 12:Ll(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zl(e)):Ll(e);break;default:Ll(e)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Bl(r,e)}Il(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),zl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zl(t));break;default:zl(t)}e=e.sibling}}function Bl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Vl={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Hl=typeof WeakMap==`function`?WeakMap:Map,Ul=0,Wl=null,Gl=null,Kl=0,ql=0,Jl=null,Yl=!1,Xl=!1,Zl=!1,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=null,ou=null,su=!1,cu=0,lu=0,uu=1/0,du=null,fu=null,pu=0,mu=null,hu=null,gu=0,_u=0,vu=null,yu=null,bu=0,xu=null;function Su(){return Ul&2&&Kl!==0?Kl&-Kl:N.T===null?at():xd()}function Cu(){if(ru===0){if(!(Kl&536870912)||Mi){var e=We;We<<=1,!(We&3932160)&&(We=262144),ru=e}else ru=536870912}return e=to.current,e!==null&&(e.flags|=32),ru}function wu(e,t,n){(e===Wl&&(ql===2||ql===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,Kl,ru,!1)),Qe(e,n),(!(Ul&2)||e!==Wl)&&(e===Wl&&(!(Ul&2)&&(tu|=n),$l===4&&Ou(e,Kl,ru,!1)),pd(e))}function Tu(e,t,n){if(Ul&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Je(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Xl&&!r&&Ou(e,t,0,!1);break}if(n=e.current.alternate,o&&!Du(n)){a=Lu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=au;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Zl&&!l){c.errorRecoveryDisabledLanes|=o,tu|=o,a=4;break a}o=ou,ou=a,o!==null&&(ou===null?ou=o:ou.push.apply(ou,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ju(e,0),Ou(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ou(r,t,ru,!Yl);break a;case 2:ou=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=cu+300-De(),10<a)){if(Ou(r,t,ru,!Yl),qe(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=af(Eu.bind(null,r,n,ou,du,su,t,ru,tu,iu,Yl,o,`Throttled`,-0,0),a);break a}Eu(r,n,ou,du,su,t,ru,tu,iu,Yl,o,null,-0,0)}break}while(1);pd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},Fl(t,a,d);var m=(a&62914560)===a?cu-De():(a&4194048)===a?lu-De():0;if(m=ap(d,m),m!==null){gu=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Du(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ou(e,t,n,r){t&=~nu,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function ku(){return Ul&6?!0:(md(0,!1),!1)}function Au(){if(Gl!==null){if(ql===0)var e=Gl.return;else e=Gl,Gi=Wi=null,Ao(e),Aa=null,ja=0,e=Gl;for(;e!==null;)Uc(e.alternate,e),e=e.return;Gl=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,of(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Wl=e,Gl=n=si(e.current,null),Kl=t,ql=0,Jl=null,Yl=!1,Xl=Je(e,t),Zl=!1,iu=ru=nu=tu=eu=$l=0,ou=au=null,su=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return Ql=t,V(),n}function Mu(e,t){fo=null,N.H=Bs,t===ba||t===Sa?(t=Oa(),ql=3):t===xa?(t=Oa(),ql=4):ql=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Jl=t,Gl===null&&($l=1,Qs(e,hi(t,e.current)))}function Nu(){var e=to.current;return e===null?!0:(Kl&4194048)===Kl?no===null:(Kl&62914560)===Kl||Kl&536870912?e===no:!1}function Pu(){var e=N.H;return N.H=Bs,e===null?Bs:e}function Fu(){var e=N.A;return N.A=Vl,e}function Iu(){$l=4,Yl||(Kl&4194048)!==Kl&&to.current!==null||(Xl=!0),!(eu&134217727)&&!(tu&134217727)||Wl===null||Ou(Wl,Kl,ru,!1)}function Lu(e,t,n){var r=Ul;Ul|=2;var i=Pu(),a=Fu();(Wl!==e||Kl!==t)&&(du=null,ju(e,t)),t=!1;var o=$l;a:do try{if(ql!==0&&Gl!==null){var s=Gl,c=Jl;switch(ql){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=ql;if(ql=0,Jl=null,Uu(e,s,c,l),n&&Xl){o=0;break a}break;default:l=ql,ql=0,Jl=null,Uu(e,s,c,l)}}Ru(),o=$l;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,Ul=r,N.H=i,N.A=a,Gl===null&&(Wl=null,Kl=0,V()),o}function Ru(){for(;Gl!==null;)Vu(Gl)}function zu(e,t){var n=Ul;Ul|=2;var r=Pu(),a=Fu();Wl!==e||Kl!==t?(du=null,uu=De()+500,ju(e,t)):Xl=Je(e,t);a:do try{if(ql!==0&&Gl!==null){t=Gl;var o=Jl;b:switch(ql){case 1:ql=0,Jl=null,Uu(e,t,o,1);break;case 2:case 9:if(wa(o)){ql=0,Jl=null,Hu(t);break}t=function(){ql!==2&&ql!==9||Wl!==e||(ql=7),pd(e)},o.then(t,t);break a;case 3:ql=7;break a;case 4:ql=5;break a;case 7:wa(o)?(ql=0,Jl=null,Hu(t)):(ql=0,Jl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(Gl.tag){case 26:s=Gl.memoizedState;case 5:case 27:var c=Gl;if(s?np(s):c.stateNode.complete){ql=0,Jl=null;var l=c.sibling;if(l!==null)Gl=l;else{var u=c.return;u===null?Gl=null:(Gl=u,Wu(u))}break b}}ql=0,Jl=null,Uu(e,t,o,5);break;case 6:ql=0,Jl=null,Uu(e,t,o,6);break;case 8:Au(),$l=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Mu(e,t)}while(1);return Gi=Wi=null,N.H=r,N.A=a,Ul=n,Gl===null?(Wl=null,Kl=0,V(),$l):0}function Bu(){for(;Gl!==null&&!Te();)Vu(Gl)}function Vu(e){var t=Pc(e.alternate,e,Ql);e.memoizedProps=e.pendingProps,t===null?Wu(e):Gl=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,Kl);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,Kl);break;case 5:Ao(t);default:Uc(n,t),t=Gl=ci(t,Ql),t=Pc(n,t,Ql)}e.memoizedProps=e.pendingProps,t===null?Wu(e):Gl=t}function Uu(e,t,n,r){Gi=Wi=null,Ao(t),Aa=null,ja=0;var i=t.return;try{if(rc(e,i,t,n,Kl)){$l=1,Qs(e,hi(n,e.current)),Gl=null;return}}catch(t){if(i!==null)throw Gl=i,t;$l=1,Qs(e,hi(n,e.current)),Gl=null;return}t.flags&32768?(Mi||r===1?e=!0:Xl||Kl&536870912?e=!1:(Yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Yl);return}e=t.return;var n=Vc(t.alternate,t,Ql);if(n!==null){Gl=n;return}if(t=t.sibling,t!==null){Gl=t;return}Gl=t=e}while(t!==null);$l===0&&($l=5)}function Gu(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,Gl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Gl=e;return}Gl=e=n}while(e!==null);$l=6,Gl=null}function Ku(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(pu!==0);if(Ul&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,$e(e,n,o,s,c,l),e===Wl&&(Gl=Wl=null,Kl=0),hu=t,mu=e,gu=n,_u=o,vu=a,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,od(je,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Ul,Ul|=4;try{cl(e,t,n)}finally{Ul=s,P.p=a,N.T=r}}pu=1,qu(),Ju(),Yu()}}function qu(){if(pu===1){pu=0;var e=mu,t=hu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ul;Ul|=4;try{xl(t,e);var a=Zd,o=Tr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&wr(s.ownerDocument.documentElement,s)){if(c!==null&&Er(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Cr(s,h),v=Cr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yp=!!Xd,Zd=Xd=null}finally{Ul=i,P.p=r,N.T=n}}e.current=t,pu=2}}function Ju(){if(pu===2){pu=0;var e=mu,t=hu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ul;Ul|=4;try{ll(e,t.alternate,t)}finally{Ul=i,P.p=r,N.T=n}}pu=3}}function Yu(){if(pu===4||pu===3){pu=0,Ee();var e=mu,t=hu,n=gu,r=yu;t.subtreeFlags&10256||t.flags&10256?pu=5:(pu=0,hu=mu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(fu=null),it(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}gu&3&&Zu(),pd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,md(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=it(gu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,Ul&6)throw Error(i(331));var c=Ul;if(Ul|=4,Rl(o.current),Al(o,o.current,s,n),Ul=c,md(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{P.p=a,N.T=r,Xu(e,t)}}function $u(e,t,n){t=hi(n,t),t=ec(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Qe(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=hi(n,e),n=tc(2),r=Ha(t,n,2),r!==null&&(nc(n,r,t,e),Qe(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Hl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Zl=!0,i.add(n),e=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wl===e&&(Kl&n)===n&&($l===4||$l===3&&(Kl&62914560)===Kl&&300>De()-cu?!(Ul&2)&&ju(e,0):nu|=n,iu===Kl&&(iu=0)),pd(e)}function rd(e,t){t===0&&(t=Xe()),e=ei(e,t),e!==null&&(Qe(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),rd(e,n)}function od(e,t){return Ce(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,bd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,yd(r,a))}else a=Kl,a=qe(r,r===Wl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,yd(r,a))}r=r.next}while(n);dd=!1}}function hd(){gd()}function gd(){ud=ld=!1;var e=0;fd!==0&&rf()&&(e=fd);for(var t=De(),n=null,r=sd;r!==null;){var i=r.next,a=_d(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}pu!==0&&pu!==5||md(e,!1),fd!==0&&(fd=0)}function _d(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Wl,n=Kl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ql===2||ql===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),it(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=vd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function vd(e,t){if(pu!==0&&pu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=Kl;return r=qe(e,e===Wl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),_d(e,De()),e.callbackNode!=null&&e.callbackNode===n?vd.bind(null,e):null)}function yd(e,t){if(Zu())return null;Tu(e,t,!0)}function bd(){cf(function(){Ul&6?Ce(ke,hd):gd()})}function xd(){if(fd===0){var e=ua;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),fd=e}return fd}function Sd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function Cd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function wd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Sd((i[L]||null).action),o=r.submitter;o&&(t=(t=o[L]||null)?Sd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(fd!==0){var e=o?Cd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Cd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Td=0;Td<Kr.length;Td++){var Ed=Kr[Td];qr(Ed.toLowerCase(),`on`+(Ed[0].toUpperCase()+Ed.slice(1)))}qr(Rr,`onAnimationEnd`),qr(zr,`onAnimationIteration`),qr(Br,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Vr,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Dd=`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(` `),Od=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Dd));function kd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Jr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Jr(e)}i.currentTarget=null,a=c}}}}function Ad(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,xt.forEach(function(t){t!==`selectionchange`&&(Od.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Fd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=gt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=z;break;case Rr:case zr:case Br:l=Mn;break;case Wr:l=Vn;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Hn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Un}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Id(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Rd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&zd(s,c,l,d,!1),u!==null&&f!==null&&zd(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=cr;else if(rr(c)){if(lr)v=vr;else{v=gr;var y=hr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=cr):v=_r;if(v&&=v(e,r)){ir(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(Or=y,kr=r,Ar=null);break;case`focusout`:Ar=kr=Or=null;break;case`mousedown`:jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:jr=!1,Mr(s,n,i);break;case`selectionchange`:if(Dr)break;case`keydown`:case`keyup`:Mr(s,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,$n=!0)),y=Ld(r,x),0<y.length&&(x=new R(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new R(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),wd(s,e,r,n,i)}kd(s,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(Id(e,i,a)),i=ln(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Id(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
9
|
-
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Ad(`beforetoggle`,e),Ad(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[L]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ad(`error`,e),Ad(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:Ad(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Wd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ad(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Ad(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Wd(e,t,s,c,n,null)}Gt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Wd(e,t,l,r,n,null)}return;case`dialog`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ad(`cancel`,e),Ad(`close`,e);break;case`iframe`:case`object`:Ad(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)Ad(Dd[r],e);break;case`image`:Ad(`error`,e),Ad(`load`,e);break;case`details`:Ad(`toggle`,e);break;case`embed`:case`source`:case`link`:Ad(`error`,e),Ad(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Wd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Wd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Wd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Wd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Wd(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Wd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Wd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Wd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Wd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Jd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Jd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function $d(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function ef(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function tf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e!==nf&&(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body)}n=i}while(n);Gp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wf(e,t,n){switch(t=Qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=P.d;P.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=ku();return e||t}function jf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=yt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);bt(c),Kd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=yt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=m({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),bt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=yt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),bt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=le.current)?Of(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Hf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Kf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+zt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),bt(t),e.head.appendChild(t))}function Kf(e){return`[src="`+zt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Kd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,bt(a),a):(r=n,(a=Ef.get(o))&&(r=m({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Yf(r,n.precedence,e));return t.instance}function Yf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[mt]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=op.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var up={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function pp(e){return e?(e=ri,e):ri}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(wu(n,e,t),Ua(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&wu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=Su();t=rt(t);var n=ei(e,t);n!==null&&wu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function xp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Fd(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Ul&6)&&(uu=De()+500,md(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&wu(s,a,2),ku(),gp(a,2)}if(a=Cp(r),a===null&&Fd(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Cp(e){return e=nn(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wp=e,null}function Ep(e){switch(e){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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`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 Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=_t(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){vp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Tp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[L]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[L]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,Su(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),ku(),t[lt]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.8`)throw Error(i(527,Yp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Ie=Zp.inject(Xp),Le=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[lt]=t.current,Nd(e),new qp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),y=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),b=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S={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`},C=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},w=l(d(),1),T=(0,w.createContext)({}),E=()=>(0,w.useContext)(T),D=(0,w.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=E()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,w.createElement)(`svg`,{ref:c,...S,width:t??l??S.width,height:t??l??S.height,stroke:e??f,strokeWidth:m,className:v(`lucide`,p,i),...!a&&!C(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),O=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(D,{ref:i,iconNode:t,className:v(`lucide-${y(x(e))}`,`lucide-${e}`,n),...r}));return n.displayName=x(e),n},k=O(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),ee=O(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),A=O(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),j=O(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),M=O(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),te=O(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ne=O(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),N=O(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),P=O(`brain`,[[`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`}]]),re=O(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),ie=O(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ae=O(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),F=O(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),I=O(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),oe=O(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),se=O(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),ce=O(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),le=O(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ue=O(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),de=O(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),fe=O(`ellipsis-vertical`,[[`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`}]]),pe=O(`external-link`,[[`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`}]]),me=O(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),he=O(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ge=O(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),_e=O(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`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`}]]),ve=O(`file-braces-corner`,[[`path`,{d:`M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6`,key:`14cnrg`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1`,key:`sr0ebq`}],[`path`,{d:`M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1`,key:`w793db`}]]),ye=O(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),be=O(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),xe=O(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),Se=O(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Ce=O(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),we=O(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Te=O(`folder-tree`,[[`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`}]]),Ee=O(`folder`,[[`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`}]]),De=O(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Oe=O(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),ke=O(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ae=O(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),je=O(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Me=O(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ne=O(`message-square`,[[`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`}]]),Pe=O(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Fe=O(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Ie=O(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Le=O(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Re=O(`pencil`,[[`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`}]]),ze=O(`picture-in-picture-2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),Be=O(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Ve=O(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),He=O(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ue=O(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),We=O(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ge=O(`refresh-cw`,[[`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`}]]),Ke=O(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),qe=O(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Je=O(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Ye=O(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Xe=O(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ze=O(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Qe=O(`square-split-horizontal`,[[`path`,{d:`M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3`,key:`lubmu8`}],[`path`,{d:`M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3`,key:`1ag34g`}],[`line`,{x1:`12`,x2:`12`,y1:`4`,y2:`20`,key:`1tx1rr`}]]),$e=O(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),et=O(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),tt=O(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),nt=O(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),rt=O(`trash-2`,[[`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`}]]),it=O(`user`,[[`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`}]]),at=O(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ot=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),st=o(((e,t)=>{t.exports=ot()})),ct=_(),L=st(),lt=[],ut=new Map,dt=0,ft=new Set;function pt(e){return ft.add(e),()=>ft.delete(e)}function mt(){dt++;for(let e of ft)e()}function ht(e){if(e.length===0)return;let t=new Set(e),n=!1;for(let e=lt.length-1;e>=0;e--)t.has(lt[e].id)&&(lt.splice(e,1),n=!0);n&&mt()}function gt(){return lt.map(e=>e.id)}function _t(e){for(let[t,n]of Object.entries(e))ut.set(t,n);mt()}function vt(e){return{wraps:lt.filter(t=>t.kind===`wrap`&&t.target===e).sort((e,t)=>(e.order??100)-(t.order??100)||e.id.localeCompare(t.id)),replaces:lt.filter(t=>t.kind===`replace`&&t.target===e).sort((e,t)=>(e.priority??100)-(t.priority??100)||e.id.localeCompare(t.id)),core:ut.get(e)}}function yt(e,t){let n=e.core??(()=>null);for(let r of e.replaces){let e=null;try{e=r.render(t,n)}catch(e){console.error(`[extensions] replace "${r.id}" crashed:`,e);continue}if(e!==null)return e}try{return n(t)}catch(e){return console.error(`[extensions] core target crashed:`,e),null}}function bt(e,t,n,r){if(t>=e.length)return r();let i=e[t];try{return i.render(n,()=>bt(e,t+1,n,r))}catch(a){return console.error(`[extensions] wrap "${i.id}" crashed, falling through:`,a),bt(e,t+1,n,r)}}var xt=new Set;function St(e,t={}){let n=vt(e);return!n.core&&n.replaces.length===0&&!xt.has(e)&&(xt.add(e),console.warn(`[extensions] target "${e}" has no core default — its module's autoRegister never ran (is it imported at boot?). Rendering null.`)),bt(n.wraps,0,t,()=>yt(n,t))}function Ct(e){(0,w.useSyncExternalStore)(pt,()=>dt);let{id:t,...n}=e;return(0,L.jsx)(kt,{id:t,children:St(t,n)})}function wt(e){return lt.filter(t=>t.kind===`contribute`&&t.collection===e).map(e=>({id:e.id,item:e.item,order:e.order??100})).sort((e,t)=>e.order-t.order||e.id.localeCompare(t.id))}function Tt(e){let t,n=-1/0;for(let r of lt){if(r.kind!==`service`)continue;let i=r;if(i.service!==e)continue;let a=i.precedence??0;a>n&&(t=i,n=a)}return t?.value}function Et(e){return lt.filter(t=>t.kind===`service`&&t.service===e).map(e=>({id:e.id,value:e.value,precedence:e.precedence??0})).sort((e,t)=>t.precedence-e.precedence||e.id.localeCompare(t.id))}function Dt(e){return lt.filter(t=>t.kind===`hook`&&t.event===e)}function Ot(e){let t=e,n=lt.findIndex(e=>e.id===t.id);if(n!==-1){lt[n]=t,mt();return}lt.push(t),mt()}var kt=class extends w.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[extensions] target "${this.props.id}" crashed:`,e)}render(){return this.state.failed?null:this.props.children}};function At(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=At(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function jt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=At(e))&&(r&&(r+=` `),r+=t);return r}var Mt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Nt=(e,t)=>({classGroupId:e,validator:t}),Pt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ft=`-`,It=[],Lt=`arbitrary..`,Rt=e=>{let t=Vt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Bt(e);let n=e.split(Ft);return zt(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Mt(i,t):t:i||It}return n[e]||It}}},zt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=zt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ft):e.slice(t).join(Ft),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Bt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Lt+r:void 0})(),Vt=e=>{let{theme:t,classGroups:n}=e;return Ht(n,t)},Ht=(e,t)=>{let n=Pt();for(let r in e){let i=e[r];Ut(i,n,r,t)}return n},Ut=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Wt(i,t,n,r)}},Wt=(e,t,n,r)=>{if(typeof e==`string`){Gt(e,t,n);return}if(typeof e==`function`){Kt(e,t,n,r);return}qt(e,t,n,r)},Gt=(e,t,n)=>{let r=e===``?t:Jt(t,e);r.classGroupId=n},Kt=(e,t,n,r)=>{if(Yt(e)){Ut(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Nt(n,e))},qt=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ut(o,Jt(t,a),n,r)}},Jt=(e,t)=>{let n=e,r=t.split(Ft),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Pt(),n.nextPart.set(t,i)),n=i}return n},Yt=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Xt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Zt=`!`,Qt=`:`,$t=[],en=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),tn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Qt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Zt)?(c=s.slice(0,-1),l=!0):s.startsWith(Zt)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return en(t,l,c,u)};if(t){let e=t+Qt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):en($t,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},nn=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},rn=e=>({cache:Xt(e.cacheSize),parseClassName:tn(e),sortModifiers:nn(e),postfixLookupClassGroupIds:an(e),...Rt(e)}),an=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},on=/\s+/,sn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(on),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Zt:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},cn=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ln(n))&&(i&&(i+=` `),i+=r);return i},ln=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ln(e[r]))&&(n&&(n+=` `),n+=t);return n},un=(e,...t)=>{let n,r,i,a,o=o=>(n=rn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=sn(e,n);return i(e,a),a};return a=o,(...e)=>a(cn(...e))},dn=[],fn=e=>{let t=t=>t[e]||dn;return t.isThemeGetter=!0,t},pn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xn=e=>hn.test(e),Sn=e=>!!e&&!Number.isNaN(Number(e)),Cn=e=>!!e&&Number.isInteger(Number(e)),wn=e=>e.endsWith(`%`)&&Sn(e.slice(0,-1)),Tn=e=>gn.test(e),En=()=>!0,Dn=e=>_n.test(e)&&!vn.test(e),On=()=>!1,kn=e=>yn.test(e),An=e=>bn.test(e),jn=e=>!R(e)&&!z(e),Mn=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Nn=e=>Jn(e,Qn,On),R=e=>pn.test(e),Pn=e=>Jn(e,$n,Dn),Fn=e=>Jn(e,er,Sn),In=e=>Jn(e,nr,En),Ln=e=>Jn(e,tr,On),Rn=e=>Jn(e,Xn,On),zn=e=>Jn(e,Zn,An),Bn=e=>Jn(e,rr,kn),z=e=>mn.test(e),Vn=e=>Yn(e,$n),Hn=e=>Yn(e,tr),Un=e=>Yn(e,Xn),Wn=e=>Yn(e,Qn),Gn=e=>Yn(e,Zn),Kn=e=>Yn(e,rr,!0),qn=e=>Yn(e,nr,!0),Jn=(e,t,n)=>{let r=pn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yn=(e,t,n=!1)=>{let r=mn.exec(e);return r?r[1]?t(r[1]):n:!1},Xn=e=>e===`position`||e===`percentage`,Zn=e=>e===`image`||e===`url`,Qn=e=>e===`length`||e===`size`||e===`bg-size`,$n=e=>e===`length`,er=e=>e===`number`,tr=e=>e===`family-name`,nr=e=>e===`number`||e===`weight`,rr=e=>e===`shadow`,ir=un(()=>{let e=fn(`color`),t=fn(`font`),n=fn(`text`),r=fn(`font-weight`),i=fn(`tracking`),a=fn(`leading`),o=fn(`breakpoint`),s=fn(`container`),c=fn(`spacing`),l=fn(`radius`),u=fn(`shadow`),d=fn(`inset-shadow`),f=fn(`text-shadow`),p=fn(`drop-shadow`),m=fn(`blur`),h=fn(`perspective`),g=fn(`aspect`),_=fn(`ease`),v=fn(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),z,R],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[z,R,c],T=()=>[xn,`full`,`auto`,...w()],E=()=>[Cn,`none`,`subgrid`,z,R],D=()=>[`auto`,{span:[`full`,Cn,z,R]},Cn,z,R],O=()=>[Cn,`auto`,z,R],k=()=>[`auto`,`min`,`max`,`fr`,z,R],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[xn,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[xn,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[xn,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,z,R],P=()=>[...b(),Un,Rn,{position:[z,R]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Wn,Nn,{size:[z,R]}],ae=()=>[wn,Vn,Pn],F=()=>[``,`none`,`full`,l,z,R],I=()=>[``,Sn,Vn,Pn],oe=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[Sn,wn,Un,Rn],le=()=>[``,`none`,m,z,R],ue=()=>[`none`,Sn,z,R],de=()=>[`none`,Sn,z,R],fe=()=>[Sn,z,R],pe=()=>[xn,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Tn],breakpoint:[Tn],color:[En],container:[Tn],"drop-shadow":[Tn],ease:[`in`,`out`,`in-out`],font:[jn],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Tn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Tn],shadow:[Tn],spacing:[`px`,Sn],text:[Tn],"text-shadow":[Tn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,xn,R,z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,z,R]}],"container-named":[Mn],columns:[{columns:[Sn,R,z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Cn,`auto`,z,R]}],basis:[{basis:[xn,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Sn,xn,`auto`,`initial`,`none`,R]}],grow:[{grow:[``,Sn,z,R]}],shrink:[{shrink:[``,Sn,z,R]}],order:[{order:[Cn,`first`,`last`,`none`,z,R]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,Vn,Pn]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,qn,In]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,wn,R]}],"font-family":[{font:[Hn,Ln,t]}],"font-features":[{"font-features":[R]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,z,R]}],"line-clamp":[{"line-clamp":[Sn,`none`,z,Fn]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,z,R]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,z,R]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...oe(),`wavy`]}],"text-decoration-thickness":[{decoration:[Sn,`from-font`,`auto`,z,Pn]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Sn,`auto`,z,R]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Cn,z,R]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,z,R]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,z,R]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Cn,z,R],radial:[``,z,R],conic:[Cn,z,R]},Gn,zn]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...oe(),`hidden`,`none`]}],"divide-style":[{divide:[...oe(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...oe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Sn,z,R]}],"outline-w":[{outline:[``,Sn,Vn,Pn]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Kn,Bn]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Kn,Bn]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Sn,Pn]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Kn,Bn]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Sn,z,R]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Sn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[z,R]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Sn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,z,R]}],filter:[{filter:[``,`none`,z,R]}],blur:[{blur:le()}],brightness:[{brightness:[Sn,z,R]}],contrast:[{contrast:[Sn,z,R]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Kn,Bn]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,Sn,z,R]}],"hue-rotate":[{"hue-rotate":[Sn,z,R]}],invert:[{invert:[``,Sn,z,R]}],saturate:[{saturate:[Sn,z,R]}],sepia:[{sepia:[``,Sn,z,R]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,z,R]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Sn,z,R]}],"backdrop-contrast":[{"backdrop-contrast":[Sn,z,R]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Sn,z,R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Sn,z,R]}],"backdrop-invert":[{"backdrop-invert":[``,Sn,z,R]}],"backdrop-opacity":[{"backdrop-opacity":[Sn,z,R]}],"backdrop-saturate":[{"backdrop-saturate":[Sn,z,R]}],"backdrop-sepia":[{"backdrop-sepia":[``,Sn,z,R]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,z,R]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Sn,`initial`,z,R]}],ease:[{ease:[`linear`,`initial`,_,z,R]}],delay:[{delay:[Sn,z,R]}],animate:[{animate:[`none`,v,z,R]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,z,R]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[z,R,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Cn,z,R]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,z,R]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,z,R]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[Sn,Vn,Pn,Fn]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function B(...e){return ir(jt(e))}var ar=Object.defineProperty,or=(e,t)=>ar(e,`name`,{value:t,configurable:!0});function sr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}or(sr,`setRef`);function cr(...e){return t=>{let n=!1,r=e.map(e=>{let r=sr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():sr(e[t],null)}}}}or(cr,`composeRefs`);function lr(...e){return w.useCallback(cr(...e),e)}or(lr,`useComposedRefs`);var ur=Object.defineProperty,dr=(e,t)=>ur(e,`name`,{value:t,configurable:!0});function fr(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xr(r)&&typeof Tr==`function`&&(r=Tr(r._payload)),w.Children.forEach(r,e=>{if(yr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xr(n)&&typeof Tr==`function`&&(n=Tr(n._payload)),a=gr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?vr(a):void 0,l=lr(n,c);if(!a){if(r||r===0)throw Error(o?wr(e):Cr(e));return r}let u=_r(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}dr(fr,`createSlot`);var pr=fr(`Slot`),mr=Symbol.for(`radix.slottable`);function hr(e){let t=dr(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=mr,t}dr(hr,`createSlottable`);var gr=dr((e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function _r(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}dr(_r,`mergeProps`);function vr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}dr(vr,`getElementRef`);function yr(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===mr}dr(yr,`isSlottable`);var br=Symbol.for(`react.lazy`);function xr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===br&&`_payload`in e&&Sr(e._payload)}dr(xr,`isLazyComponent`);function Sr(e){return typeof e==`object`&&!!e&&`then`in e}dr(Sr,`isPromiseLike`);var Cr=dr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),wr=dr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Tr=w.use,Er=l(h(),1),Dr=Object.defineProperty,Or=(e,t)=>Dr(e,`name`,{value:t,configurable:!0}),kr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=fr(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ar(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}Or(Ar,`dispatchDiscreteCustomEvent`);var jr=Object.defineProperty,Mr=(e,t)=>jr(e,`name`,{value:t,configurable:!0});function Nr(e,t){let n=w.createContext(t);n.displayName=e+`Context`;let r=Mr(e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=w.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Mr(i,`useContext`),[r,i]}Mr(Nr,`createContext`);function Pr(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Mr(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=w.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Mr(s,`useContext`),[o,s]}Mr(r,`createContext`);let i=Mr(()=>{let t=n.map(e=>w.createContext(e));return Mr(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Fr(i,...t)]}Mr(Pr,`createContextScope`);function Fr(...e){let t=e[0];if(e.length===1)return t;let n=Mr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Mr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Mr(Fr,`composeContextScopes`);var Ir=Object.defineProperty,Lr=(e,t)=>Ir(e,`name`,{value:t,configurable:!0});function Rr(e){let t=e+`CollectionProvider`,[n,r]=Pr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Lr(e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=fr(s),l=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=lr(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=fr(u),p=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=lr(t,o),c=a(u,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Lr(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Lr(Rr,`createCollection`);var zr=new WeakMap,Br=class e extends Map{static{Lr(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],zr.set(this,!0)}set(e,t){return zr.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Ur(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Vr(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Vr(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Vr(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Vr(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Hr(e,t);return n===-1?void 0:e[n]}Lr(Vr,`at`);function Hr(e,t){let n=e.length,r=Ur(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Lr(Hr,`toSafeIndex`);function Ur(e){return e!==e||e===0?0:Math.trunc(e)}Lr(Ur,`toSafeInteger`);function Wr(e){let t=e+`CollectionProvider`,[n,r]=Pr(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Br,setItemMap:Lr(()=>void 0,`setItemMap`)}),o=Lr(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Lr(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Lr(e=>{let{scope:t,children:n,state:r}=e,a=w.useRef(null),[o,s]=w.useState(null),c=lr(a,s),[l,u]=r;return w.useEffect(()=>{if(!o)return;let e=Jr(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=fr(l),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=lr(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=fr(f),m=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),[s,c]=w.useState(null),l=lr(t,o,c),{setItemMap:u}=a(f,n),d=w.useRef(i);Gr(d.current,i)||(d.current=i);let m=d.current;return w.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(qr):(t.set(s,{...e,element:s}),t.toSorted(qr)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Br(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return w.useState(new Br)}Lr(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Lr(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Lr(Wr,`createCollection`);function Gr(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Lr(Gr,`shallowEqual`);function Kr(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Lr(Kr,`isElementPreceding`);function qr(e,t){return!e[1].element||!t[1].element?0:Kr(e[1].element,t[1].element)?-1:1}Lr(qr,`sortByDocumentPosition`);function Jr(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Lr(Jr,`getChildListObserver`);var Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return Xr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Xr(V,`composeEventHandlers`);function Qr(e){if(!Zr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Xr(Qr,`getOwnerWindow`);function $r(e){if(!Zr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Xr($r,`getOwnerDocument`);function ei(e,t=!1){let{activeElement:n}=$r(e);if(!n?.nodeName)return null;if(ti(n)&&n.contentDocument)return ei(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=$r(n).getElementById(e);if(t)return t}}return n}Xr(ei,`getActiveElement`);function ti(e){return e.tagName===`IFRAME`}Xr(ti,`isFrame`);var ni=globalThis?.document?w.useLayoutEffect:()=>{},ri=Object.defineProperty,ii=(e,t)=>ri(e,`name`,{value:t,configurable:!0}),ai=w.useEffectEvent,oi=w.useInsertionEffect;function si(e){if(typeof ai==`function`)return ai(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof oi==`function`?oi(()=>{t.current=e}):ni(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}ii(si,`useEffectEvent`);var ci=Object.defineProperty,li=(e,t)=>ci(e,`name`,{value:t,configurable:!0}),ui=w.useInsertionEffect||ni;function di({prop:e,defaultProp:t,onChange:n=li(()=>{},`onChange`),caller:r}){let[i,a,o]=fi({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=pi(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}li(di,`useControllableState`);function fi({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return ui(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}li(fi,`useUncontrolledState`);function pi(e){return typeof e==`function`}li(pi,`isFunction`);var mi=Symbol(`RADIX:SYNC_STATE`);function hi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=si(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===mi)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=w.useRef(p);w.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=w.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return w.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:mi,state:i})},[i,d.state,c]),[h,f]}li(hi,`useControllableStateReducer`);var gi=Object.defineProperty,_i=(e,t)=>gi(e,`name`,{value:t,configurable:!0});function vi(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}_i(vi,`useStateMachine`);var yi=_i(e=>{let{present:t,children:n}=e,r=bi(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=Si(r.ref,wi(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function bi(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),o=w.useRef(void 0),[s,c]=vi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{s===`mounted`?(a.current=o.current??Ci(r.current),o.current=void 0):a.current=`none`},[s]),ni(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Ci(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),ni(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=_i(a=>{let o=Ci(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=_i(e=>{e.target===t&&(a.current=Ci(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Ci(t)}else r.current=null;n(e)},[])}}_i(bi,`usePresence`);function xi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}_i(xi,`setRef`);function Si(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=xi(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():xi(n[e],null)}}},[])}_i(Si,`useStableComposedRefs`);function Ci(e){return e?.animationName||`none`}_i(Ci,`getAnimationName`);function wi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}_i(wi,`getElementRef`);var Ti=Object.defineProperty,Ei=(e,t)=>Ti(e,`name`,{value:t,configurable:!0}),Di=w.useId||(()=>void 0),Oi=0;function ki(e){let[t,n]=w.useState(Di());return ni(()=>{e||n(e=>e??String(Oi++))},[e]),e||(t?`radix-${t}`:``)}Ei(ki,`useId`);var Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0}),Mi=w.createContext(void 0);function Ni(e){let t=w.useContext(Mi);return e||t||`ltr`}ji(Ni,`useDirection`);var Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Fi(Ii,`useCallbackRef`);var Li=Object.defineProperty,Ri=(e,t)=>Li(e,`name`,{value:t,configurable:!0}),zi=`dismissableLayer.update`,Bi=`dismissableLayer.pointerDownOutside`,Vi=`dismissableLayer.focusOutside`,Hi,Ui=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Wi=w.forwardRef(Ri(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(Ui),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=w.useState({}),h=lr(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=w.useRef(!1),C=qi(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=Ji(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,D=Ii(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hi=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Yi(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Hi))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Yi())},[d,u]),w.useEffect(()=>{let e=Ri(()=>m({}),`handleUpdate`);return document.addEventListener(zi,e),()=>document.removeEventListener(zi,e)},[]),(0,L.jsx)(kr.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Gi(){let e=w.useContext(Ui),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ri(Gi,`useDismissableLayerSurface`);var Ki=Ri(()=>!0,`IS_TRUE`);function qi(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ki}=t,s=Ii(e),c=w.useRef(!1),l=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ri(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ri(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ri(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ri(p,`handleInteractionBubble`);let m=Ri(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Xi(Bi,s,p,{discrete:!0})};if(Ri(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ri(()=>c.current=!0,`onPointerDownCapture`)}}Ri(qi,`usePointerDownOutside`);function Ji(e,t=globalThis?.document){let n=Ii(e),r=w.useRef(!1);return w.useEffect(()=>{let e=Ri(e=>{e.target&&!r.current&&Xi(Vi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ri(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ri(()=>r.current=!1,`onBlurCapture`)}}Ri(Ji,`useFocusOutside`);function Yi(){let e=new CustomEvent(zi);document.dispatchEvent(e)}Ri(Yi,`dispatchUpdate`);function Xi(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ar(i,a):i.dispatchEvent(a)}Ri(Xi,`handleAndDispatchCustomEvent`);var Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0}),$i=`focusScope.autoFocusOnMount`,ea=`focusScope.autoFocusOnUnmount`,ta={bubbles:!1,cancelable:!0},na=w.forwardRef(Qi(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=Ii(i),u=Ii(a),d=w.useRef(null),f=lr(t,c),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:la(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||la(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&la(s)};Qi(e,`handleFocusIn`),Qi(t,`handleFocusOut`),Qi(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){ua.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent($i,ta);s.addEventListener($i,l),s.dispatchEvent(t),t.defaultPrevented||(ra(pa(aa(s)),{select:!0}),document.activeElement===e&&la(s))}return()=>{s.removeEventListener($i,l),setTimeout(()=>{let t=new CustomEvent(ea,ta);s.addEventListener(ea,u),s.dispatchEvent(t),t.defaultPrevented||la(e??document.body,{select:!0}),s.removeEventListener(ea,u),ua.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ia(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&la(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&la(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(kr.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function ra(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(la(r,{select:t}),document.activeElement!==n)return}Qi(ra,`focusFirst`);function ia(e){let t=aa(e);return[oa(t,e),oa(t.reverse(),e)]}Qi(ia,`getTabbableEdges`);function aa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Qi(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Qi(aa,`getTabbableCandidates`);function oa(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):sa(r,{upTo:t})))return r}Qi(oa,`findVisible`);function sa(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Qi(sa,`isHidden`);function ca(e){return e instanceof HTMLInputElement&&`select`in e}Qi(ca,`isSelectableInput`);function la(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ca(e)&&t&&e.select()}}Qi(la,`focus`);var ua=da();function da(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=fa(e,t),e.unshift(t)},remove(t){e=fa(e,t),e[0]?.resume()}}}Qi(da,`createFocusScopesStack`);function fa(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Qi(fa,`arrayRemove`);function pa(e){return e.filter(e=>e.tagName!==`A`)}Qi(pa,`removeLinks`);var ma=Object.defineProperty,ha=w.forwardRef(((e,t)=>ma(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=w.useState(!1);ni(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Er.createPortal((0,L.jsx)(kr.div,{...r,ref:t}),o):null},`Portal`)),ga=Object.defineProperty,_a=(e,t)=>ga(e,`name`,{value:t,configurable:!0}),va=0,ya=null;function ba(e){return xa(),e.children}_a(ba,`FocusGuards`);function xa(){w.useEffect(()=>{ya||={start:Sa(),end:Sa()};let{start:e,end:t}=ya;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),va++,()=>{va===1&&(ya?.start.remove(),ya?.end.remove(),ya=null),va=Math.max(0,va-1)}},[])}_a(xa,`useFocusGuards`);function Sa(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}_a(Sa,`createFocusGuard`);var Ca=function(){return Ca=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ca.apply(this,arguments)};function wa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ta(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ea=`right-scroll-bar-position`,Da=`width-before-scroll-bar`,Oa=`with-scroll-bars-hidden`,ka=`--removed-body-scroll-bar-size`;function Aa(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ja(e,t){var n=(0,w.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ma=typeof window<`u`?w.useLayoutEffect:w.useEffect,Na=new WeakMap;function Pa(e,t){var n=ja(t||null,function(t){return e.forEach(function(e){return Aa(e,t)})});return Ma(function(){var t=Na.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Aa(e,null)}),i.forEach(function(e){r.has(e)||Aa(e,a)})}Na.set(n,e)},[e]),n}function Fa(e){return e}function Ia(e,t){t===void 0&&(t=Fa);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function La(e){e===void 0&&(e={});var t=Ia(null);return t.options=Ca({async:!0,ssr:!1},e),t}var Ra=function(e){var t=e.sideCar,n=wa(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return w.createElement(r,Ca({},n))};Ra.isSideCarExport=!0;function za(e,t){return e.useMedium(t),Ra}var Ba=La(),Va=function(){},Ha=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Va,onWheelCapture:Va,onTouchMoveCapture:Va}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=wa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Pa([n,t]),C=Ca(Ca({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Ba,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),Ca(Ca({},C),{ref:S})):w.createElement(v,Ca({},C,{className:c,ref:S}),s))});Ha.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ha.classNames={fullWidth:Da,zeroRight:Ea};var Ua,Wa=function(){if(Ua)return Ua;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ga(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Wa();return t&&e.setAttribute(`nonce`,t),e}function Ka(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qa(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ja=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ga())&&(Ka(t,n),qa(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ya=function(){var e=Ja();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xa=function(){var e=Ya();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Za={left:0,top:0,right:0,gap:0},Qa=function(e){return parseInt(e||``,10)||0},$a=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Qa(n),Qa(r),Qa(i)]},eo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Za;var t=$a(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},to=Xa(),no=`data-scroll-locked`,ro=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
9
|
+
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Ad(`beforetoggle`,e),Ad(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[L]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ad(`error`,e),Ad(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:Ad(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Wd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ad(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Ad(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Wd(e,t,s,c,n,null)}Gt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Wd(e,t,l,r,n,null)}return;case`dialog`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ad(`cancel`,e),Ad(`close`,e);break;case`iframe`:case`object`:Ad(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)Ad(Dd[r],e);break;case`image`:Ad(`error`,e),Ad(`load`,e);break;case`details`:Ad(`toggle`,e);break;case`embed`:case`source`:case`link`:Ad(`error`,e),Ad(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Wd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Wd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Wd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Wd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Wd(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Wd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Wd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Wd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Wd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Jd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Jd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function $d(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function ef(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function tf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e!==nf&&(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body)}n=i}while(n);Gp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wf(e,t,n){switch(t=Qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=P.d;P.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=ku();return e||t}function jf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=yt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);bt(c),Kd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=yt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=m({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),bt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=yt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),bt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=le.current)?Of(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Hf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Kf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+zt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),bt(t),e.head.appendChild(t))}function Kf(e){return`[src="`+zt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Kd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,bt(a),a):(r=n,(a=Ef.get(o))&&(r=m({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Yf(r,n.precedence,e));return t.instance}function Yf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[mt]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=op.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var up={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function pp(e){return e?(e=ri,e):ri}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(wu(n,e,t),Ua(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&wu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=Su();t=rt(t);var n=ei(e,t);n!==null&&wu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function xp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,Sp(e,t,n,r)}finally{P.p=a,N.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Fd(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Ul&6)&&(uu=De()+500,md(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&wu(s,a,2),ku(),gp(a,2)}if(a=Cp(r),a===null&&Fd(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Cp(e){return e=nn(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wp=e,null}function Ep(e){switch(e){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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`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 Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=_t(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){vp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Tp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[L]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[L]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,Su(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),ku(),t[lt]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.8`)throw Error(i(527,Yp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Ie=Zp.inject(Xp),Le=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[lt]=t.current,Nd(e),new qp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),y=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),b=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S={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`},C=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},w=l(d(),1),T=(0,w.createContext)({}),E=()=>(0,w.useContext)(T),D=(0,w.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=E()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,w.createElement)(`svg`,{ref:c,...S,width:t??l??S.width,height:t??l??S.height,stroke:e??f,strokeWidth:m,className:v(`lucide`,p,i),...!a&&!C(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),O=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(D,{ref:i,iconNode:t,className:v(`lucide-${y(x(e))}`,`lucide-${e}`,n),...r}));return n.displayName=x(e),n},k=O(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),ee=O(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),A=O(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),j=O(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),M=O(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),te=O(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ne=O(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),N=O(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),P=O(`brain`,[[`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`}]]),re=O(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),ie=O(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ae=O(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),F=O(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),I=O(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),oe=O(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),se=O(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),ce=O(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),le=O(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ue=O(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),de=O(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),fe=O(`ellipsis-vertical`,[[`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`}]]),pe=O(`external-link`,[[`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`}]]),me=O(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),he=O(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ge=O(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),_e=O(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`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`}]]),ve=O(`file-braces-corner`,[[`path`,{d:`M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6`,key:`14cnrg`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1`,key:`sr0ebq`}],[`path`,{d:`M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1`,key:`w793db`}]]),ye=O(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),be=O(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),xe=O(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),Se=O(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Ce=O(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),we=O(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Te=O(`folder-tree`,[[`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`}]]),Ee=O(`folder`,[[`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`}]]),De=O(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Oe=O(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),ke=O(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ae=O(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),je=O(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Me=O(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ne=O(`message-square`,[[`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`}]]),Pe=O(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Fe=O(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Ie=O(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Le=O(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Re=O(`pencil`,[[`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`}]]),ze=O(`picture-in-picture-2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),Be=O(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Ve=O(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),He=O(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ue=O(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),We=O(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ge=O(`refresh-cw`,[[`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`}]]),Ke=O(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),qe=O(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Je=O(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Ye=O(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Xe=O(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ze=O(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Qe=O(`square-split-horizontal`,[[`path`,{d:`M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3`,key:`lubmu8`}],[`path`,{d:`M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3`,key:`1ag34g`}],[`line`,{x1:`12`,x2:`12`,y1:`4`,y2:`20`,key:`1tx1rr`}]]),$e=O(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),et=O(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),tt=O(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),nt=O(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),rt=O(`trash-2`,[[`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`}]]),it=O(`user`,[[`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`}]]),at=O(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ot=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),st=o(((e,t)=>{t.exports=ot()})),ct=_(),L=st(),lt=[],ut=new Map,dt=0,ft=new Set;function pt(e){return ft.add(e),()=>ft.delete(e)}function mt(){dt++;for(let e of ft)e()}function ht(e){if(e.length===0)return;let t=new Set(e),n=!1;for(let e=lt.length-1;e>=0;e--)t.has(lt[e].id)&&(lt.splice(e,1),n=!0);n&&mt()}function gt(){return lt.map(e=>e.id)}function _t(e){for(let[t,n]of Object.entries(e))ut.set(t,n);mt()}function vt(e){return{wraps:lt.filter(t=>t.kind===`wrap`&&t.target===e).sort((e,t)=>(e.order??100)-(t.order??100)||e.id.localeCompare(t.id)),replaces:lt.filter(t=>t.kind===`replace`&&t.target===e).sort((e,t)=>(e.priority??100)-(t.priority??100)||e.id.localeCompare(t.id)),core:ut.get(e)}}function yt(e,t){let n=e.core??(()=>null);for(let r of e.replaces){let e=null;try{e=r.render(t,n)}catch(e){console.error(`[extensions] replace "${r.id}" crashed:`,e);continue}if(e!==null)return e}try{return n(t)}catch(e){return console.error(`[extensions] core target crashed:`,e),null}}function bt(e,t,n,r){if(t>=e.length)return r();let i=e[t];try{return i.render(n,()=>bt(e,t+1,n,r))}catch(a){return console.error(`[extensions] wrap "${i.id}" crashed, falling through:`,a),bt(e,t+1,n,r)}}var xt=new Set;function St(e,t={}){let n=vt(e);return!n.core&&n.replaces.length===0&&!xt.has(e)&&(xt.add(e),console.warn(`[extensions] target "${e}" has no core default — its module's autoRegister never ran (is it imported at boot?). Rendering null.`)),bt(n.wraps,0,t,()=>yt(n,t))}function Ct(e){(0,w.useSyncExternalStore)(pt,()=>dt);let{id:t,...n}=e;return(0,L.jsx)(kt,{id:t,children:St(t,n)})}function wt(e){return lt.filter(t=>t.kind===`contribute`&&t.collection===e).map(e=>({id:e.id,item:e.item,order:e.order??100})).sort((e,t)=>e.order-t.order||e.id.localeCompare(t.id))}function Tt(e){let t,n=-1/0;for(let r of lt){if(r.kind!==`service`)continue;let i=r;if(i.service!==e)continue;let a=i.precedence??0;a>n&&(t=i,n=a)}return t?.value}function Et(e){return lt.filter(t=>t.kind===`service`&&t.service===e).map(e=>({id:e.id,value:e.value,precedence:e.precedence??0})).sort((e,t)=>t.precedence-e.precedence||e.id.localeCompare(t.id))}function Dt(e){return lt.filter(t=>t.kind===`hook`&&t.event===e)}function Ot(e){let t=e,n=lt.findIndex(e=>e.id===t.id);if(n!==-1){let e=lt[n];(e.kind!==t.kind||e.target!==t.target)&&console.warn(`[extensions] id "${t.id}" re-registered as ${t.kind} (was ${e.kind}) — same-id re-register SWAPS, so the previous entry is gone. Use distinct ids per entry.`),lt[n]=t,mt();return}lt.push(t),mt()}var kt=class extends w.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[extensions] target "${this.props.id}" crashed:`,e)}render(){return this.state.failed?null:this.props.children}};function At(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=At(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function jt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=At(e))&&(r&&(r+=` `),r+=t);return r}var Mt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Nt=(e,t)=>({classGroupId:e,validator:t}),Pt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ft=`-`,It=[],Lt=`arbitrary..`,Rt=e=>{let t=Vt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Bt(e);let n=e.split(Ft);return zt(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Mt(i,t):t:i||It}return n[e]||It}}},zt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=zt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ft):e.slice(t).join(Ft),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Bt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Lt+r:void 0})(),Vt=e=>{let{theme:t,classGroups:n}=e;return Ht(n,t)},Ht=(e,t)=>{let n=Pt();for(let r in e){let i=e[r];Ut(i,n,r,t)}return n},Ut=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Wt(i,t,n,r)}},Wt=(e,t,n,r)=>{if(typeof e==`string`){Gt(e,t,n);return}if(typeof e==`function`){Kt(e,t,n,r);return}qt(e,t,n,r)},Gt=(e,t,n)=>{let r=e===``?t:Jt(t,e);r.classGroupId=n},Kt=(e,t,n,r)=>{if(Yt(e)){Ut(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Nt(n,e))},qt=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ut(o,Jt(t,a),n,r)}},Jt=(e,t)=>{let n=e,r=t.split(Ft),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Pt(),n.nextPart.set(t,i)),n=i}return n},Yt=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Xt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Zt=`!`,Qt=`:`,$t=[],en=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),tn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Qt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Zt)?(c=s.slice(0,-1),l=!0):s.startsWith(Zt)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return en(t,l,c,u)};if(t){let e=t+Qt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):en($t,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},nn=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},rn=e=>({cache:Xt(e.cacheSize),parseClassName:tn(e),sortModifiers:nn(e),postfixLookupClassGroupIds:an(e),...Rt(e)}),an=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},on=/\s+/,sn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(on),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Zt:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},cn=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ln(n))&&(i&&(i+=` `),i+=r);return i},ln=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ln(e[r]))&&(n&&(n+=` `),n+=t);return n},un=(e,...t)=>{let n,r,i,a,o=o=>(n=rn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=sn(e,n);return i(e,a),a};return a=o,(...e)=>a(cn(...e))},dn=[],fn=e=>{let t=t=>t[e]||dn;return t.isThemeGetter=!0,t},pn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xn=e=>hn.test(e),Sn=e=>!!e&&!Number.isNaN(Number(e)),Cn=e=>!!e&&Number.isInteger(Number(e)),wn=e=>e.endsWith(`%`)&&Sn(e.slice(0,-1)),Tn=e=>gn.test(e),En=()=>!0,Dn=e=>_n.test(e)&&!vn.test(e),On=()=>!1,kn=e=>yn.test(e),An=e=>bn.test(e),jn=e=>!R(e)&&!z(e),Mn=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Nn=e=>Jn(e,Qn,On),R=e=>pn.test(e),Pn=e=>Jn(e,$n,Dn),Fn=e=>Jn(e,er,Sn),In=e=>Jn(e,nr,En),Ln=e=>Jn(e,tr,On),Rn=e=>Jn(e,Xn,On),zn=e=>Jn(e,Zn,An),Bn=e=>Jn(e,rr,kn),z=e=>mn.test(e),Vn=e=>Yn(e,$n),Hn=e=>Yn(e,tr),Un=e=>Yn(e,Xn),Wn=e=>Yn(e,Qn),Gn=e=>Yn(e,Zn),Kn=e=>Yn(e,rr,!0),qn=e=>Yn(e,nr,!0),Jn=(e,t,n)=>{let r=pn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yn=(e,t,n=!1)=>{let r=mn.exec(e);return r?r[1]?t(r[1]):n:!1},Xn=e=>e===`position`||e===`percentage`,Zn=e=>e===`image`||e===`url`,Qn=e=>e===`length`||e===`size`||e===`bg-size`,$n=e=>e===`length`,er=e=>e===`number`,tr=e=>e===`family-name`,nr=e=>e===`number`||e===`weight`,rr=e=>e===`shadow`,ir=un(()=>{let e=fn(`color`),t=fn(`font`),n=fn(`text`),r=fn(`font-weight`),i=fn(`tracking`),a=fn(`leading`),o=fn(`breakpoint`),s=fn(`container`),c=fn(`spacing`),l=fn(`radius`),u=fn(`shadow`),d=fn(`inset-shadow`),f=fn(`text-shadow`),p=fn(`drop-shadow`),m=fn(`blur`),h=fn(`perspective`),g=fn(`aspect`),_=fn(`ease`),v=fn(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),z,R],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[z,R,c],T=()=>[xn,`full`,`auto`,...w()],E=()=>[Cn,`none`,`subgrid`,z,R],D=()=>[`auto`,{span:[`full`,Cn,z,R]},Cn,z,R],O=()=>[Cn,`auto`,z,R],k=()=>[`auto`,`min`,`max`,`fr`,z,R],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[xn,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[xn,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[xn,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,z,R],P=()=>[...b(),Un,Rn,{position:[z,R]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Wn,Nn,{size:[z,R]}],ae=()=>[wn,Vn,Pn],F=()=>[``,`none`,`full`,l,z,R],I=()=>[``,Sn,Vn,Pn],oe=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[Sn,wn,Un,Rn],le=()=>[``,`none`,m,z,R],ue=()=>[`none`,Sn,z,R],de=()=>[`none`,Sn,z,R],fe=()=>[Sn,z,R],pe=()=>[xn,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Tn],breakpoint:[Tn],color:[En],container:[Tn],"drop-shadow":[Tn],ease:[`in`,`out`,`in-out`],font:[jn],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Tn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Tn],shadow:[Tn],spacing:[`px`,Sn],text:[Tn],"text-shadow":[Tn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,xn,R,z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,z,R]}],"container-named":[Mn],columns:[{columns:[Sn,R,z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Cn,`auto`,z,R]}],basis:[{basis:[xn,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Sn,xn,`auto`,`initial`,`none`,R]}],grow:[{grow:[``,Sn,z,R]}],shrink:[{shrink:[``,Sn,z,R]}],order:[{order:[Cn,`first`,`last`,`none`,z,R]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,Vn,Pn]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,qn,In]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,wn,R]}],"font-family":[{font:[Hn,Ln,t]}],"font-features":[{"font-features":[R]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,z,R]}],"line-clamp":[{"line-clamp":[Sn,`none`,z,Fn]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,z,R]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,z,R]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...oe(),`wavy`]}],"text-decoration-thickness":[{decoration:[Sn,`from-font`,`auto`,z,Pn]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Sn,`auto`,z,R]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Cn,z,R]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,z,R]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,z,R]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Cn,z,R],radial:[``,z,R],conic:[Cn,z,R]},Gn,zn]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...oe(),`hidden`,`none`]}],"divide-style":[{divide:[...oe(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...oe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Sn,z,R]}],"outline-w":[{outline:[``,Sn,Vn,Pn]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Kn,Bn]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Kn,Bn]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Sn,Pn]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Kn,Bn]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Sn,z,R]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Sn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[z,R]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Sn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,z,R]}],filter:[{filter:[``,`none`,z,R]}],blur:[{blur:le()}],brightness:[{brightness:[Sn,z,R]}],contrast:[{contrast:[Sn,z,R]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Kn,Bn]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,Sn,z,R]}],"hue-rotate":[{"hue-rotate":[Sn,z,R]}],invert:[{invert:[``,Sn,z,R]}],saturate:[{saturate:[Sn,z,R]}],sepia:[{sepia:[``,Sn,z,R]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,z,R]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Sn,z,R]}],"backdrop-contrast":[{"backdrop-contrast":[Sn,z,R]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Sn,z,R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Sn,z,R]}],"backdrop-invert":[{"backdrop-invert":[``,Sn,z,R]}],"backdrop-opacity":[{"backdrop-opacity":[Sn,z,R]}],"backdrop-saturate":[{"backdrop-saturate":[Sn,z,R]}],"backdrop-sepia":[{"backdrop-sepia":[``,Sn,z,R]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,z,R]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Sn,`initial`,z,R]}],ease:[{ease:[`linear`,`initial`,_,z,R]}],delay:[{delay:[Sn,z,R]}],animate:[{animate:[`none`,v,z,R]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,z,R]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[z,R,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Cn,z,R]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,z,R]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,z,R]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[Sn,Vn,Pn,Fn]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function B(...e){return ir(jt(e))}var ar=Object.defineProperty,or=(e,t)=>ar(e,`name`,{value:t,configurable:!0});function sr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}or(sr,`setRef`);function cr(...e){return t=>{let n=!1,r=e.map(e=>{let r=sr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():sr(e[t],null)}}}}or(cr,`composeRefs`);function lr(...e){return w.useCallback(cr(...e),e)}or(lr,`useComposedRefs`);var ur=Object.defineProperty,dr=(e,t)=>ur(e,`name`,{value:t,configurable:!0});function fr(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xr(r)&&typeof Tr==`function`&&(r=Tr(r._payload)),w.Children.forEach(r,e=>{if(yr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xr(n)&&typeof Tr==`function`&&(n=Tr(n._payload)),a=gr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?vr(a):void 0,l=lr(n,c);if(!a){if(r||r===0)throw Error(o?wr(e):Cr(e));return r}let u=_r(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}dr(fr,`createSlot`);var pr=fr(`Slot`),mr=Symbol.for(`radix.slottable`);function hr(e){let t=dr(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=mr,t}dr(hr,`createSlottable`);var gr=dr((e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function _r(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}dr(_r,`mergeProps`);function vr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}dr(vr,`getElementRef`);function yr(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===mr}dr(yr,`isSlottable`);var br=Symbol.for(`react.lazy`);function xr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===br&&`_payload`in e&&Sr(e._payload)}dr(xr,`isLazyComponent`);function Sr(e){return typeof e==`object`&&!!e&&`then`in e}dr(Sr,`isPromiseLike`);var Cr=dr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),wr=dr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Tr=w.use,Er=l(h(),1),Dr=Object.defineProperty,Or=(e,t)=>Dr(e,`name`,{value:t,configurable:!0}),kr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=fr(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ar(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}Or(Ar,`dispatchDiscreteCustomEvent`);var jr=Object.defineProperty,Mr=(e,t)=>jr(e,`name`,{value:t,configurable:!0});function Nr(e,t){let n=w.createContext(t);n.displayName=e+`Context`;let r=Mr(e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=w.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Mr(i,`useContext`),[r,i]}Mr(Nr,`createContext`);function Pr(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Mr(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=w.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Mr(s,`useContext`),[o,s]}Mr(r,`createContext`);let i=Mr(()=>{let t=n.map(e=>w.createContext(e));return Mr(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Fr(i,...t)]}Mr(Pr,`createContextScope`);function Fr(...e){let t=e[0];if(e.length===1)return t;let n=Mr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Mr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Mr(Fr,`composeContextScopes`);var Ir=Object.defineProperty,Lr=(e,t)=>Ir(e,`name`,{value:t,configurable:!0});function Rr(e){let t=e+`CollectionProvider`,[n,r]=Pr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Lr(e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=fr(s),l=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=lr(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=fr(u),p=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=lr(t,o),c=a(u,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Lr(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Lr(Rr,`createCollection`);var zr=new WeakMap,Br=class e extends Map{static{Lr(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],zr.set(this,!0)}set(e,t){return zr.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Ur(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Vr(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Vr(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Vr(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Vr(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Hr(e,t);return n===-1?void 0:e[n]}Lr(Vr,`at`);function Hr(e,t){let n=e.length,r=Ur(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Lr(Hr,`toSafeIndex`);function Ur(e){return e!==e||e===0?0:Math.trunc(e)}Lr(Ur,`toSafeInteger`);function Wr(e){let t=e+`CollectionProvider`,[n,r]=Pr(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Br,setItemMap:Lr(()=>void 0,`setItemMap`)}),o=Lr(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Lr(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Lr(e=>{let{scope:t,children:n,state:r}=e,a=w.useRef(null),[o,s]=w.useState(null),c=lr(a,s),[l,u]=r;return w.useEffect(()=>{if(!o)return;let e=Jr(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=fr(l),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=lr(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=fr(f),m=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),[s,c]=w.useState(null),l=lr(t,o,c),{setItemMap:u}=a(f,n),d=w.useRef(i);Gr(d.current,i)||(d.current=i);let m=d.current;return w.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(qr):(t.set(s,{...e,element:s}),t.toSorted(qr)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Br(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return w.useState(new Br)}Lr(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Lr(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Lr(Wr,`createCollection`);function Gr(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Lr(Gr,`shallowEqual`);function Kr(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Lr(Kr,`isElementPreceding`);function qr(e,t){return!e[1].element||!t[1].element?0:Kr(e[1].element,t[1].element)?-1:1}Lr(qr,`sortByDocumentPosition`);function Jr(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Lr(Jr,`getChildListObserver`);var Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return Xr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Xr(V,`composeEventHandlers`);function Qr(e){if(!Zr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Xr(Qr,`getOwnerWindow`);function $r(e){if(!Zr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Xr($r,`getOwnerDocument`);function ei(e,t=!1){let{activeElement:n}=$r(e);if(!n?.nodeName)return null;if(ti(n)&&n.contentDocument)return ei(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=$r(n).getElementById(e);if(t)return t}}return n}Xr(ei,`getActiveElement`);function ti(e){return e.tagName===`IFRAME`}Xr(ti,`isFrame`);var ni=globalThis?.document?w.useLayoutEffect:()=>{},ri=Object.defineProperty,ii=(e,t)=>ri(e,`name`,{value:t,configurable:!0}),ai=w.useEffectEvent,oi=w.useInsertionEffect;function si(e){if(typeof ai==`function`)return ai(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof oi==`function`?oi(()=>{t.current=e}):ni(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}ii(si,`useEffectEvent`);var ci=Object.defineProperty,li=(e,t)=>ci(e,`name`,{value:t,configurable:!0}),ui=w.useInsertionEffect||ni;function di({prop:e,defaultProp:t,onChange:n=li(()=>{},`onChange`),caller:r}){let[i,a,o]=fi({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=pi(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}li(di,`useControllableState`);function fi({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return ui(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}li(fi,`useUncontrolledState`);function pi(e){return typeof e==`function`}li(pi,`isFunction`);var mi=Symbol(`RADIX:SYNC_STATE`);function hi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=si(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===mi)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=w.useRef(p);w.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=w.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return w.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:mi,state:i})},[i,d.state,c]),[h,f]}li(hi,`useControllableStateReducer`);var gi=Object.defineProperty,_i=(e,t)=>gi(e,`name`,{value:t,configurable:!0});function vi(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}_i(vi,`useStateMachine`);var yi=_i(e=>{let{present:t,children:n}=e,r=bi(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=Si(r.ref,wi(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function bi(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),o=w.useRef(void 0),[s,c]=vi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{s===`mounted`?(a.current=o.current??Ci(r.current),o.current=void 0):a.current=`none`},[s]),ni(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Ci(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),ni(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=_i(a=>{let o=Ci(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=_i(e=>{e.target===t&&(a.current=Ci(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Ci(t)}else r.current=null;n(e)},[])}}_i(bi,`usePresence`);function xi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}_i(xi,`setRef`);function Si(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=xi(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():xi(n[e],null)}}},[])}_i(Si,`useStableComposedRefs`);function Ci(e){return e?.animationName||`none`}_i(Ci,`getAnimationName`);function wi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}_i(wi,`getElementRef`);var Ti=Object.defineProperty,Ei=(e,t)=>Ti(e,`name`,{value:t,configurable:!0}),Di=w.useId||(()=>void 0),Oi=0;function ki(e){let[t,n]=w.useState(Di());return ni(()=>{e||n(e=>e??String(Oi++))},[e]),e||(t?`radix-${t}`:``)}Ei(ki,`useId`);var Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0}),Mi=w.createContext(void 0);function Ni(e){let t=w.useContext(Mi);return e||t||`ltr`}ji(Ni,`useDirection`);var Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Fi(Ii,`useCallbackRef`);var Li=Object.defineProperty,Ri=(e,t)=>Li(e,`name`,{value:t,configurable:!0}),zi=`dismissableLayer.update`,Bi=`dismissableLayer.pointerDownOutside`,Vi=`dismissableLayer.focusOutside`,Hi,Ui=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Wi=w.forwardRef(Ri(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(Ui),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=w.useState({}),h=lr(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=w.useRef(!1),C=qi(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=Ji(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?y===g.length-1:!1,D=Ii(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hi=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Yi(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Hi))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Yi())},[d,u]),w.useEffect(()=>{let e=Ri(()=>m({}),`handleUpdate`);return document.addEventListener(zi,e),()=>document.removeEventListener(zi,e)},[]),(0,L.jsx)(kr.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,T.onFocusCapture),onBlurCapture:V(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Gi(){let e=w.useContext(Ui),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ri(Gi,`useDismissableLayerSurface`);var Ki=Ri(()=>!0,`IS_TRUE`);function qi(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ki}=t,s=Ii(e),c=w.useRef(!1),l=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ri(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ri(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ri(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ri(p,`handleInteractionBubble`);let m=Ri(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Xi(Bi,s,p,{discrete:!0})};if(Ri(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ri(()=>c.current=!0,`onPointerDownCapture`)}}Ri(qi,`usePointerDownOutside`);function Ji(e,t=globalThis?.document){let n=Ii(e),r=w.useRef(!1);return w.useEffect(()=>{let e=Ri(e=>{e.target&&!r.current&&Xi(Vi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ri(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ri(()=>r.current=!1,`onBlurCapture`)}}Ri(Ji,`useFocusOutside`);function Yi(){let e=new CustomEvent(zi);document.dispatchEvent(e)}Ri(Yi,`dispatchUpdate`);function Xi(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ar(i,a):i.dispatchEvent(a)}Ri(Xi,`handleAndDispatchCustomEvent`);var Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0}),$i=`focusScope.autoFocusOnMount`,ea=`focusScope.autoFocusOnUnmount`,ta={bubbles:!1,cancelable:!0},na=w.forwardRef(Qi(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=Ii(i),u=Ii(a),d=w.useRef(null),f=lr(t,c),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:la(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||la(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&la(s)};Qi(e,`handleFocusIn`),Qi(t,`handleFocusOut`),Qi(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){ua.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent($i,ta);s.addEventListener($i,l),s.dispatchEvent(t),t.defaultPrevented||(ra(pa(aa(s)),{select:!0}),document.activeElement===e&&la(s))}return()=>{s.removeEventListener($i,l),setTimeout(()=>{let t=new CustomEvent(ea,ta);s.addEventListener(ea,u),s.dispatchEvent(t),t.defaultPrevented||la(e??document.body,{select:!0}),s.removeEventListener(ea,u),ua.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ia(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&la(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&la(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(kr.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function ra(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(la(r,{select:t}),document.activeElement!==n)return}Qi(ra,`focusFirst`);function ia(e){let t=aa(e);return[oa(t,e),oa(t.reverse(),e)]}Qi(ia,`getTabbableEdges`);function aa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Qi(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Qi(aa,`getTabbableCandidates`);function oa(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):sa(r,{upTo:t})))return r}Qi(oa,`findVisible`);function sa(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Qi(sa,`isHidden`);function ca(e){return e instanceof HTMLInputElement&&`select`in e}Qi(ca,`isSelectableInput`);function la(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ca(e)&&t&&e.select()}}Qi(la,`focus`);var ua=da();function da(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=fa(e,t),e.unshift(t)},remove(t){e=fa(e,t),e[0]?.resume()}}}Qi(da,`createFocusScopesStack`);function fa(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Qi(fa,`arrayRemove`);function pa(e){return e.filter(e=>e.tagName!==`A`)}Qi(pa,`removeLinks`);var ma=Object.defineProperty,ha=w.forwardRef(((e,t)=>ma(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=w.useState(!1);ni(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Er.createPortal((0,L.jsx)(kr.div,{...r,ref:t}),o):null},`Portal`)),ga=Object.defineProperty,_a=(e,t)=>ga(e,`name`,{value:t,configurable:!0}),va=0,ya=null;function ba(e){return xa(),e.children}_a(ba,`FocusGuards`);function xa(){w.useEffect(()=>{ya||={start:Sa(),end:Sa()};let{start:e,end:t}=ya;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),va++,()=>{va===1&&(ya?.start.remove(),ya?.end.remove(),ya=null),va=Math.max(0,va-1)}},[])}_a(xa,`useFocusGuards`);function Sa(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}_a(Sa,`createFocusGuard`);var Ca=function(){return Ca=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ca.apply(this,arguments)};function wa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ta(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ea=`right-scroll-bar-position`,Da=`width-before-scroll-bar`,Oa=`with-scroll-bars-hidden`,ka=`--removed-body-scroll-bar-size`;function Aa(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ja(e,t){var n=(0,w.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ma=typeof window<`u`?w.useLayoutEffect:w.useEffect,Na=new WeakMap;function Pa(e,t){var n=ja(t||null,function(t){return e.forEach(function(e){return Aa(e,t)})});return Ma(function(){var t=Na.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Aa(e,null)}),i.forEach(function(e){r.has(e)||Aa(e,a)})}Na.set(n,e)},[e]),n}function Fa(e){return e}function Ia(e,t){t===void 0&&(t=Fa);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function La(e){e===void 0&&(e={});var t=Ia(null);return t.options=Ca({async:!0,ssr:!1},e),t}var Ra=function(e){var t=e.sideCar,n=wa(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return w.createElement(r,Ca({},n))};Ra.isSideCarExport=!0;function za(e,t){return e.useMedium(t),Ra}var Ba=La(),Va=function(){},Ha=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Va,onWheelCapture:Va,onTouchMoveCapture:Va}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=wa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Pa([n,t]),C=Ca(Ca({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Ba,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),Ca(Ca({},C),{ref:S})):w.createElement(v,Ca({},C,{className:c,ref:S}),s))});Ha.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ha.classNames={fullWidth:Da,zeroRight:Ea};var Ua,Wa=function(){if(Ua)return Ua;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ga(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Wa();return t&&e.setAttribute(`nonce`,t),e}function Ka(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qa(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ja=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ga())&&(Ka(t,n),qa(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ya=function(){var e=Ja();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xa=function(){var e=Ya();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Za={left:0,top:0,right:0,gap:0},Qa=function(e){return parseInt(e||``,10)||0},$a=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Qa(n),Qa(r),Qa(i)]},eo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Za;var t=$a(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},to=Xa(),no=`data-scroll-locked`,ro=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
10
10
|
.${Oa} {
|
|
11
11
|
overflow: hidden ${r};
|
|
12
12
|
padding-right: ${s}px ${r};
|
|
@@ -67,7 +67,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
67
67
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===QD+1&&(this._liveRegion.textContent+=Sb.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(!(!a||!o)){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};$D=vb([Y(1,Yb),Y(2,ix),Y(3,ox)],$D);var eO=class extends Px{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new X),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new X),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(jx(()=>{kx(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(TC(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(TC(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(TC(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(TC(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&tO(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,kx(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};eO=vb([Y(1,ax),Y(2,ox),Y(3,Gb),Y(4,ux)],eO);function tO(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var nO=class extends VD{constructor(e={}){super(e),this._linkifier=this._register(new Fx),this.browser=mT,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Fx),this._onCursorMove=this._register(new X),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new X),this.onKey=this._onKey.event,this._onRender=this._register(new X),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new X),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new X),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new X),this.onBell=this._onBell.event,this._onFocus=this._register(new X),this._onBlur=this._register(new X),this._onA11yCharEmitter=this._register(new X),this._onA11yTabEmitter=this._register(new X),this._onWillOpen=this._register(new X),this._setup(),this._decorationService=this._instantiationService.createInstance(JD),this._instantiationService.setService(ex,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(lT),this._instantiationService.setService(ux,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(tx)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(Hx.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Hx.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Hx.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Hx.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(jx(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=jw.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${Z.ESC}]${n};${TD(r)}${Cw.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=Aw.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=Aw.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($D,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(TC(this.element,`copy`,e=>{this.hasSelection()&&Tb(e,this._selectionService)}));let e=e=>Eb(e,this.textarea,this.coreService,this.optionsService);this._register(TC(this.textarea,`paste`,e)),this._register(TC(this.element,`paste`,e)),vT?this._register(TC(this.element,`mousedown`,e=>{e.button===2&&kb(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(TC(this.element,`contextmenu`,e=>{kb(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ET&&this._register(TC(this.element,`auxclick`,e=>{e.button===1&&Ob(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(TC(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(TC(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(TC(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(TC(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(TC(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(TC(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(TC(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(TC(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,bb.get()),DT||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(sT,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(ix,this._coreBrowserService),this._register(TC(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(TC(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(rT,this._document,this._helperContainer),this._instantiationService.setService(rx,this._charSizeService),this._themeService=this._instantiationService.createInstance(dE),this._instantiationService.setService(lx,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Rw),this._instantiationService.setService(cx,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(NT,this.rows,this.screenElement)),this._instantiationService.setService(ox,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(ww,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(fT),this._instantiationService.setService(ax,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(eO,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(hw,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(tE,this.element,this.screenElement,r)),this._instantiationService.setService(sx,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(Hx.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(gw,this.screenElement)),this._register(TC(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance($D,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(xw,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(xw,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(nT,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(TC(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(TC(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=Z.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Db(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=UD(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===Z.ETX||n.key===Z.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(rO(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(xE));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(Z.ESC+`[I`):this.coreService.triggerDataEvent(Z.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Z.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Z.ESC}[6;${r};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function rO(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var iO=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},aO=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Rb)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},oO=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new aO(t)}getNullCell(){return new Rb}},sO=class extends Px{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new X),this.onBufferChange=this._onBufferChange.event,this._normal=new oO(this._core.buffers.normal,`normal`),this._alternate=new oO(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 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)}},cO=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},lO=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},uO=[`cols`,`rows`],dO=0,fO=class extends Px{constructor(e){super(),this._core=this._register(new nO(e)),this._addonManager=this._register(new iO),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(uO.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw 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||=new cO(this._core),this._parser}get unicode(){return this._checkProposedApi(),new lO(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._register(new sO(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
68
68
|
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return bb.get()},set promptLabel(e){bb.set(e)},get tooMuchOutput(){return Sb.get()},set tooMuchOutput(e){Sb.set(e)}}}_verifyIntegers(...e){for(dO of e)if(dO===1/0||isNaN(dO)||dO%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(dO of e)if(dO&&(dO===1/0||isNaN(dO)||dO%1!=0||dO<0))throw Error(`This API only accepts positive integers`)}},pO=2,mO=1,hO=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(pO,Math.floor(u/e.css.cell.width)),rows:Math.max(mO,Math.floor(l/e.css.cell.height))}}},gO={background:`#101010`,foreground:`#e6e6e6`,cursor:`#9dbefe`,cursorAccent:`#101010`,selectionBackground:`rgba(157, 190, 254, 0.25)`,black:`#101010`,red:`#fc533a`,green:`#12c905`,yellow:`#fcd53a`,blue:`#9dbefe`,magenta:`#edb2f1`,cyan:`#94e2d5`,white:`#e6e6e6`,brightBlack:`#555555`,brightRed:`#ff8a77`,brightGreen:`#6bff5c`,brightYellow:`#ffe57a`,brightBlue:`#c6dcff`,brightMagenta:`#ffd3f8`,brightCyan:`#b9fff2`,brightWhite:`#ffffff`};function _O({ptyID:e,onClose:t,onError:n}){let r=(0,w.useRef)(null),i=(0,w.useRef)(null),a=(0,w.useRef)(null),o=(0,w.useRef)(null),s=(0,w.useRef)(e);s.current=e;let[c,l]=(0,w.useState)(!1),u=async()=>{if(!c){l(!0);try{await W.ptyDelete(e),a.current?.close()}catch(e){l(!1),n?.(e instanceof Error?e.message:String(e))}}};return(0,w.useEffect)(()=>{let e=r.current;if(!e)return;let c=new fO({fontFamily:`"JetBrainsMono Nerd Font Mono", monospace`,fontSize:13,lineHeight:1.3,cursorBlink:!0,theme:gO,scrollback:5e3}),l=new hO;c.loadAddon(l),c.open(e);try{l.fit()}catch{}i.current=c,o.current=l,c.focus();let u=()=>{try{l.fit()}catch{return}let e=c.cols>0&&c.rows>0?{cols:c.cols,rows:c.rows}:null;e&&W.ptyUpdate(s.current,{size:e}).catch(()=>{})},d=new ResizeObserver(u);d.observe(e);let f=null,p=!1,m=!1,h=async()=>{try{let e=await W.ptyConnectToken(s.current),r=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/api/pty/${s.current}/connect?ticket=${e.data.ticket}`;if(p)return;f=new WebSocket(r),a.current=f,f.onopen=()=>u(),f.onmessage=e=>{typeof e.data==`string`?c.write(e.data):e.data instanceof Blob?e.data.arrayBuffer().then(e=>g(new Uint8Array(e),c)):g(new Uint8Array(e.data),c)},f.onclose=()=>{p||t()},f.onerror=()=>{n?.(`Terminal connection lost`)}}catch(e){n?.(e instanceof Error?e.message:String(e))}},g=(e,t)=>{if(e[0]===0){let t=new TextDecoder().decode(e.subarray(1));try{typeof JSON.parse(t).cursor==`number`&&!m&&(m=!0,u())}catch{}return}t.write(new Uint8Array(e))},_=c.onData(e=>{a.current?.readyState===WebSocket.OPEN&&a.current.send(e)});return h(),()=>{p=!0,_.dispose(),d.disconnect(),a.current?.close(),c.dispose(),i.current=null}},[e]),(0,L.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-3 py-1.5`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-xs text-[var(--text-weak)]`,children:e}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,L.jsxs)(H,{variant:`ghost`,size:`sm`,onClick:()=>void u(),disabled:c,title:`Kill process`,"aria-label":`Kill terminal`,className:`text-[color:var(--surface-critical-strong)]`,children:[(0,L.jsx)(et,{}),`Kill`]}),(0,L.jsx)(H,{variant:`ghost`,size:`sm`,onClick:t,children:`Close`})]})]}),(0,L.jsx)(`div`,{ref:r,className:`min-h-0 flex-1 bg-[var(--background-base)] p-2`})]})}function vO({className:e,orientation:t=`horizontal`,...n}){return(0,L.jsx)(gm,{"data-slot":`tabs`,"data-orientation":t,className:B(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var yO=Sm(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function bO({className:e,variant:t=`default`,...n}){return(0,L.jsx)(_m,{"data-slot":`tabs-list`,"data-variant":t,className:B(yO({variant:t}),e),...n})}function xO({className:e,...t}){return(0,L.jsx)(vm,{"data-slot":`tabs-trigger`,className:B(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function SO({className:e,...t}){return(0,L.jsx)(ym,{"data-slot":`tabs-content`,className:B(`flex-1 text-sm outline-none`,e),...t})}var CO=12e4,wO={running:`blue`,exited:`green`,timeout:`amber`,killed:`red`};function TO(e){let t=e.time.completed??Date.now(),n=Math.max(0,Math.floor((t-e.time.started)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function EO({trigger:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(`shell`),a=J(e=>e.shellPanelTick);return(0,w.useEffect)(()=>{a>0&&n(!0)},[a]),(0,L.jsxs)(wm,{open:t,onOpenChange:n,children:[e===void 0?(0,L.jsx)(Tm,{asChild:!0,children:(0,L.jsxs)(H,{variant:`ghost`,size:`sm`,children:[(0,L.jsx)(tt,{}),`Shell`]})}):(0,L.jsx)(Tm,{asChild:!0,children:e}),(0,L.jsxs)(km,{className:`flex max-h-[85vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl md:max-w-3xl`,children:[(0,L.jsxs)(Am,{className:`border-b border-(--border-weak-base) px-4 py-3`,children:[(0,L.jsxs)(Mm,{className:`flex items-center gap-2`,children:[(0,L.jsx)(tt,{className:`size-4 text-(color:--text-interactive-base)`}),`Shell & Terminals`]}),(0,L.jsx)(Nm,{children:`Run shell commands and manage PTY sessions.`})]}),(0,L.jsxs)(vO,{value:r,onValueChange:i,className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(bO,{variant:`line`,className:`mx-4 mt-3`,children:[(0,L.jsx)(xO,{value:`shell`,children:`Shell`}),(0,L.jsx)(xO,{value:`terminals`,children:`Terminals`})]}),(0,L.jsx)(SO,{value:`shell`,forceMount:!0,className:B(`min-h-0`,r!==`shell`&&`hidden`),children:(0,L.jsx)(DO,{active:r===`shell`})}),(0,L.jsx)(SO,{value:`terminals`,forceMount:!0,className:B(`min-h-0`,r!==`terminals`&&`hidden`),children:(0,L.jsx)(kO,{active:r===`terminals`})})]})]})]})}function DO({active:e}){let[t,n]=(0,w.useState)([]),[r,i]=(0,w.useState)(!0),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(``),[l,u]=(0,w.useState)(String(CO)),[d,f]=(0,w.useState)(!1),[p,m]=(0,w.useState)(null),[h,g]=(0,w.useState)({}),_=(0,w.useRef)({}),v=(0,w.useCallback)(async()=>{try{let e=await W.shellList();n(e.data),o(null)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}},[]);(0,w.useEffect)(()=>{if(e)return v(),Bh({name:`shell-panel-list`,minInterval:5e3,run:()=>v()})},[e,v]);let y=(0,w.useCallback)(async e=>{try{let t=(await W.shellOutput(e,{cursor:_.current[e]})).data,n=t.truncated||_.current[e]===void 0;g(r=>({...r,[e]:(n?``:r[e]??``)+t.output})),_.current[e]=t.cursor}catch{g(t=>({...t,[e]:(t[e]??``)+`
|
|
69
69
|
[output stream unavailable]`}))}},[]);(0,w.useEffect)(()=>{if(!e||!p)return;let n=t.find(e=>e.id===p);if(!(!n||n.status!==`running`))return Bh({name:`shell-panel-output`,minInterval:1200,run:()=>y(p)})},[e,p,t,y]);let b=async()=>{if(!(!s.trim()||d)){f(!0),o(null);try{let e=Number(l),t=await W.shellCreate({command:s.trim(),timeout:Number.isFinite(e)&&e>0?e:CO});c(``),await v(),m(t.data.id)}catch(e){o(e instanceof Error?e.message:String(e))}finally{f(!1)}}},x=async e=>{try{await W.shellDelete(e),g(t=>{let n={...t};return delete n[e],n}),delete _.current[e],p===e&&m(null),await v()}catch(e){o(e instanceof Error?e.message:String(e))}},S=async(e,t)=>{let n=Number(t);if(!(!Number.isFinite(n)||n<0))try{await W.shellTimeout(e,n),await v()}catch(e){o(e instanceof Error?e.message:String(e))}};return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-4`,children:[(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(Pm,{value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&b()},placeholder:`command to run`,className:`flex-1 font-mono text-xs`}),(0,L.jsx)(Pm,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&b()},placeholder:`timeout ms`,title:`Timeout in milliseconds`,className:`w-24 font-mono text-xs`}),(0,L.jsxs)(H,{onClick:()=>void b(),disabled:!s.trim()||d,children:[(0,L.jsx)(Be,{}),`Run`]}),(0,L.jsx)(H,{variant:`ghost`,size:`icon`,title:`Refresh`,onClick:()=>void v(),children:(0,L.jsx)(Ke,{})})]}),a&&(0,L.jsx)(`p`,{className:`text-xs text-(color:--surface-critical-strong)`,children:a}),(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto`,children:r?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-2 text-xs text-(color:--text-weaker)`,children:[(0,L.jsx)(lb,{}),` Loading shells…`]}):t.length===0?(0,L.jsx)(`p`,{className:`px-1 py-2 text-xs text-(color:--text-weaker)`,children:`No shell sessions yet — run a command above.`}):t.map(e=>(0,L.jsx)(OO,{shell:e,expanded:p===e.id,output:h[e.id]??``,onToggle:()=>{m(t=>t===e.id?null:e.id),_.current[e.id]||y(e.id)},onKill:()=>void x(e.id),onSetTimeout:t=>void S(e.id,t)},e.id))})]})}function OO({shell:e,expanded:t,output:n,onToggle:r,onKill:i,onSetTimeout:a}){let[o,s]=(0,w.useState)(``),c=(0,w.useRef)(null);return(0,w.useEffect)(()=>{let e=c.current;e&&(e.scrollTop=e.scrollHeight)},[n]),(0,L.jsxs)(`div`,{className:`rounded-md border border-(--border-weak-base) bg-(--surface-base)`,children:[(0,L.jsxs)(`div`,{className:`flex cursor-pointer items-center gap-2 px-2.5 py-1.5 hover:bg-(--surface-base-hover)`,onClick:r,children:[t?(0,L.jsx)(ae,{className:`size-3.5 shrink-0 text-(color:--text-weaker)`}):(0,L.jsx)(F,{className:`size-3.5 shrink-0 text-(color:--text-weaker)`}),(0,L.jsx)(db,{tone:wO[e.status],children:e.status}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-(color:--text-strong)`,children:e.command}),(0,L.jsx)(`span`,{className:`hidden max-w-40 truncate font-mono text-xs text-(color:--text-weaker) sm:inline`,children:e.cwd}),(0,L.jsxs)(`span`,{className:`shrink-0 text-xs text-(color:--text-weak)`,children:[pb(e.time.started),` · `,TO(e)]}),e.status===`running`&&(0,L.jsx)(H,{variant:`ghost`,size:`icon-xs`,title:`Kill`,"aria-label":`Kill`,onClick:e=>{e.stopPropagation(),i()},className:`text-(color:--surface-critical-strong)`,children:(0,L.jsx)(et,{})})]}),t&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-(--border-weak-base) p-2.5`,children:[(0,L.jsx)(`pre`,{ref:c,className:B(`max-h-56 min-h-10 overflow-auto rounded-md border border-(--border-weak-base) bg-(--surface-inset-base) p-2 font-mono text-xs whitespace-pre-wrap text-(color:--text-base)`,!n&&`text-(color:--text-weaker)`),children:n||`No output yet…`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(nt,{className:`size-3.5 text-(color:--text-weaker)`}),(0,L.jsx)(Pm,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(a(o),s(``))},placeholder:`set timeout (ms)`,className:`h-6 w-36 font-mono text-xs`}),(0,L.jsx)(H,{variant:`ghost`,size:`xs`,disabled:!o.trim(),onClick:()=>{a(o),s(``)},children:`Apply`})]})]})]})}function kO({active:e}){let[t,n]=(0,w.useState)([]),[r,i]=(0,w.useState)(!0),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(``),[l,u]=(0,w.useState)(``),[d,f]=(0,w.useState)(``),[p,m]=(0,w.useState)(!1),[h,g]=(0,w.useState)({}),[_,v]=(0,w.useState)(Date.now()),[y,b]=(0,w.useState)(null),x=(0,w.useCallback)(async()=>{try{let e=await W.ptyList();n(e.data),o(null)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}},[]);(0,w.useEffect)(()=>{if(e)return x(),Bh({name:`pty-panel-list`,minInterval:5e3,run:()=>{x(),v(Date.now())}})},[e,x]);let S=async()=>{if(!(!l.trim()||p)){m(!0),o(null);try{await W.ptyCreate({command:l.trim(),cwd:d.trim()||void 0,title:s.trim()||void 0}),c(``),u(``),f(``),await x()}catch(e){o(e instanceof Error?e.message:String(e))}finally{m(!1)}}},C=async e=>{try{await W.ptyDelete(e),g(t=>{let n={...t};return delete n[e],n}),await x()}catch(e){o(e instanceof Error?e.message:String(e))}},T=async e=>{try{let t=await W.ptyConnectToken(e);g(n=>({...n,[e]:{kind:`connected`,ticket:t.data.ticket,expiresAt:Date.now()+t.data.expires_in*1e3}})),o(null)}catch(t){g(n=>({...n,[e]:{kind:`error`,message:t instanceof Error?t.message:String(t)}}))}};return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-4`,children:y?(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,L.jsx)(_O,{ptyID:y,onClose:()=>b(null),onError:e=>o(e)})}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(Pm,{value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&S()},placeholder:`title`,className:`w-28 text-xs`}),(0,L.jsx)(Pm,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&S()},placeholder:`command (e.g. bash)`,className:`flex-1 font-mono text-xs`}),(0,L.jsx)(Pm,{value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&S()},placeholder:`cwd (optional)`,className:`w-36 font-mono text-xs`}),(0,L.jsxs)(H,{onClick:()=>void S(),disabled:!l.trim()||p,children:[(0,L.jsx)(tt,{}),`Create`]}),(0,L.jsx)(H,{variant:`ghost`,size:`icon`,title:`Refresh`,onClick:()=>void x(),children:(0,L.jsx)(Ke,{})})]}),a&&(0,L.jsx)(`p`,{className:`text-xs text-(color:--surface-critical-strong)`,children:a}),(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto`,children:r?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-2 text-xs text-(color:--text-weaker)`,children:[(0,L.jsx)(lb,{}),` Loading terminals…`]}):t.length===0?(0,L.jsx)(`p`,{className:`px-1 py-2 text-xs text-(color:--text-weaker)`,children:`No PTY sessions yet — create one above.`}):t.map(e=>(0,L.jsx)(AO,{pty:e,connection:h[e.id],now:_,onConnect:()=>void T(e.id),onOpen:()=>b(e.id),onDelete:()=>void C(e.id)},e.id))}),(0,L.jsx)(mb,{className:`bg-(--border-weak-base)`}),(0,L.jsx)(`p`,{className:`text-xs text-(color:--text-weaker)`,children:`Live terminals stream over a websocket — open one to interact.`})]})})}function AO({pty:e,connection:t,now:n,onConnect:r,onOpen:i,onDelete:a}){let o=e.args.length>0?` ${e.args.join(` `)}`:``,s=t?.kind===`connected`?Math.max(0,Math.ceil((t.expiresAt-n)/1e3)):0;return(0,L.jsxs)(`div`,{className:`rounded-md border border-(--border-weak-base) bg-(--surface-base) px-2.5 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(db,{tone:e.status===`running`?`blue`:`neutral`,children:e.status}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-(color:--text-strong)`,children:e.title||e.command}),(0,L.jsxs)(`span`,{className:`hidden shrink-0 text-xs text-(color:--text-weaker) md:inline`,children:[`pid `,e.pid,e.exitCode===void 0?``:` · exit ${e.exitCode}`]}),(0,L.jsxs)(H,{variant:`ghost`,size:`xs`,onClick:i,disabled:e.status!==`running`,children:[(0,L.jsx)($e,{}),`Open`]}),(0,L.jsxs)(H,{variant:`ghost`,size:`xs`,onClick:r,disabled:e.status!==`running`,children:[(0,L.jsx)(re,{}),`Connect`]}),(0,L.jsx)(H,{variant:`ghost`,size:`icon-xs`,title:e.status===`running`?`Kill`:`Delete`,"aria-label":e.status===`running`?`Kill terminal`:`Delete terminal record`,onClick:a,className:`text-(color:--surface-critical-strong)`,children:e.status===`running`?(0,L.jsx)(et,{}):(0,L.jsx)(rt,{})})]}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 pl-5`,children:[(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-(color:--text-weak)`,children:[e.command,o,e.cwd?` — ${e.cwd}`:``]}),t?.kind===`connected`?(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs`,children:[(0,L.jsx)(Ve,{className:`size-3 text-(color:--surface-success-strong)`}),(0,L.jsx)(db,{tone:`green`,children:`connected`}),(0,L.jsxs)(`span`,{className:`hidden font-mono text-(color:--text-weaker) sm:inline`,children:[t.ticket.slice(0,10),`… · `,s,`s`]})]}):t?.kind===`error`?(0,L.jsx)(`span`,{className:`max-w-56 shrink-0 truncate`,title:t.message,children:(0,L.jsx)(db,{tone:`red`,children:t.message})}):(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-(color:--text-weaker)`,children:`disconnected`})]})]})}var jO=`fixed top-1/2 left-1/2 z-50 flex w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-2 rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,MO=`w-full rounded-md border border-[var(--border-base)] bg-[var(--input-base)] px-2.5 py-1.5 text-sm text-[var(--text-strong)] outline-none transition-colors placeholder:text-[var(--text-weaker)] focus:border-[var(--border-selected)]`,NO=`flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors text-[color:var(--text-base)] hover:bg-[color:var(--surface-base-hover)]`,PO=`flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors bg-[color:var(--surface-raised-base-active)] text-[color:var(--text-strong)]`;function FO(){return J(e=>e.splitPickerOpen)?(0,L.jsx)(IO,{}):null}function IO(){let e=J(e=>e.sessions),t=J(e=>e.panes),n=J(e=>e.running),r=J(e=>e.queued),i=J(e=>e.activeIDs),a=J(e=>e.currentSessionID&&!og(e.currentSessionID)?e.sessions.find(t=>t.id===e.currentSessionID)??e.sessionDetails[e.currentSessionID]:void 0),[o,s]=(0,w.useState)(`sessions`),[c,l]=(0,w.useState)(``),[u,d]=(0,w.useState)(0),[f,p]=(0,w.useState)(null),[m,h]=(0,w.useState)([]),[g,_]=(0,w.useState)(!1),[v,y]=(0,w.useState)(null),[b,x]=(0,w.useState)(null),S=(0,w.useRef)(null),C=(0,w.useRef)(!1),T=(0,w.useMemo)(()=>new Set(t.map(e=>e.sessionID)),[t]),E=c.trim().toLowerCase(),D=(0,w.useMemo)(()=>e.filter(e=>!T.has(e.id)&&!e.parentID&&(!E||(e.title??``).toLowerCase().includes(E)||e.id.toLowerCase().includes(E)||e.location.directory.toLowerCase().includes(E))).sort((e,t)=>t.time.updated-e.time.updated),[e,T,E]),O=Math.min(u,Math.max(0,D.length-1));(0,w.useEffect)(()=>d(0),[E]);let k=a?.location?.directory;function ee(){s(`workspace`),x(null),!C.current&&(C.current=!0,_(!0),Promise.all([W.locationInfo(),W.projectList()]).then(([e,t])=>{p(e),h(t)}).catch(()=>x(`Could not load workspaces`)).finally(()=>_(!1)))}function A(){s(`sessions`),x(null)}function M(e){Tv(e).then(e=>{e||x(`Already open in a pane, or no free slots`)})}async function te(e,t){if(!v){y(e),x(null);try{await Tv(await Ay(t))||x(`No free split slots`)}catch(e){x(e instanceof Error?e.message:String(e))}finally{y(null)}}}let ne=(0,w.useMemo)(()=>{let e=new Set;for(let t of m)t.directory&&e.add(t.directory);return[...e]},[m]);return(0,L.jsx)(Yo,{open:!0,onOpenChange:e=>{e||wv()},children:(0,L.jsxs)(ts,{children:[(0,L.jsx)(rs,{className:`bg-black/60`}),(0,L.jsxs)(ss,{tabIndex:-1,"data-slot":`dialog-content`,className:jO,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault(),S.current?.focus()},children:[(0,L.jsxs)(fs,{className:`flex items-center gap-2 text-[var(--font-size-large)] font-medium text-[var(--text-strong)]`,children:[(0,L.jsx)(Qe,{className:`size-4 shrink-0 text-[var(--text-interactive-base)]`,"aria-hidden":!0}),`Split view`,(0,L.jsx)(`span`,{className:`truncate text-xs font-normal text-[var(--text-weaker)]`,children:`open a session beside this one`})]}),o===`sessions`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`input`,{ref:S,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),d(Math.min(O+1,D.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),d(Math.max(O-1,0));else if(e.key===`Enter`){e.preventDefault();let t=D[O];t&&M(t.id)}},placeholder:`Filter sessions… (title, id, workspace)`,className:MO,autoComplete:`off`,spellCheck:!1}),(0,L.jsxs)(`button`,{type:`button`,onClick:ee,disabled:v!==null,className:`flex w-full cursor-pointer items-center gap-2 rounded-md border border-dashed border-[var(--border-weak-base)] px-2 py-1.5 text-left text-sm text-[var(--text-weak)] transition-colors hover:border-[var(--border-selected)] hover:text-[var(--text-strong)] disabled:pointer-events-none disabled:opacity-50`,children:[(0,L.jsx)(He,{className:`size-3.5 shrink-0`}),`Start new session`]}),(0,L.jsx)(`div`,{className:`-mx-1 max-h-72 overflow-y-auto px-1`,children:D.length===0?(0,L.jsx)(`p`,{className:`px-2 py-6 text-center text-xs text-[var(--text-weaker)]`,children:E?`No matching sessions`:`Every session is already in a pane`}):D.map((e,t)=>(0,L.jsx)(RO,{title:e.title||`session ${e.id.slice(0,8)}…`,dir:e.location.directory,at:e.time.updated,running:!!n[e.id]||!!r[e.id]||i.includes(e.id),highlighted:t===O,onHover:()=>d(t),onPick:()=>M(e.id)},e.id))})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:A,className:`flex cursor-pointer items-center gap-1 self-start rounded-md px-1 py-0.5 text-xs text-[var(--text-weaker)] transition-colors hover:text-[var(--text-strong)]`,children:[(0,L.jsx)(j,{className:`size-3`}),` all sessions`]}),(0,L.jsx)(`div`,{className:`-mx-1 max-h-80 overflow-y-auto px-1`,children:g?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-6 text-xs text-[var(--text-weaker)]`,children:[(0,L.jsx)(lb,{className:`size-3`}),` Loading workspaces…`]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(zO,{label:`Default workspace`,sub:f?.directory,busy:v==="default",disabled:v!==null,onChoose:()=>te(`default`,null)}),k&&a&&(0,L.jsx)(zO,{label:`same as ${a.title??`current session`}`,sub:k,busy:v===`focused`,disabled:v!==null,onChoose:()=>te(`focused`,k)}),ne.map(e=>(0,L.jsx)(zO,{label:LO(e),sub:e,busy:v===e,disabled:v!==null,onChoose:()=>te(e,e)},e)),ne.length===0&&!k&&(0,L.jsx)(`p`,{className:`px-2 py-4 text-center text-xs text-[var(--text-weaker)]`,children:`No workspaces`})]})})]}),b&&(0,L.jsx)(`p`,{className:`text-xs text-[var(--surface-critical-strong)]`,children:b}),(0,L.jsxs)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:[(0,L.jsx)(`span`,{className:`font-mono`,children:`↑↓`}),` select · `,(0,L.jsx)(`span`,{className:`font-mono`,children:`↵`}),` open ·`,` `,(0,L.jsx)(`span`,{className:`font-mono`,children:`esc`}),` close`]}),(0,L.jsx)(gs,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Close`,className:`absolute top-2 right-2 flex size-7 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)]`,children:(0,L.jsx)(at,{className:`size-4`})})})]})]})})}function LO(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function RO({title:e,dir:t,at:n,running:r,highlighted:i,onHover:a,onPick:o}){let s=(0,w.useRef)(null);return(0,w.useEffect)(()=>{i&&s.current?.scrollIntoView({block:`nearest`})},[i]),(0,L.jsxs)(`button`,{ref:s,type:`button`,onMouseMove:a,onClick:o,title:t,className:i?PO:NO,children:[(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${r?`animate-pulse bg-emerald-500`:`bg-[color:var(--border-base)]`}`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),(0,L.jsx)(`span`,{className:`max-w-44 shrink-0 truncate font-mono text-[10px] text-[var(--text-weaker)]`,children:t}),r&&(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,children:`running`}),(0,L.jsx)(`span`,{className:`w-8 shrink-0 text-right font-mono text-[10px] text-[var(--text-weaker)]`,children:fb(n)})]})}function zO({label:e,sub:t,busy:n,disabled:r,onChoose:i}){return(0,L.jsxs)(`button`,{type:`button`,onClick:i,disabled:r,className:n?PO:NO,children:[n?(0,L.jsx)(lb,{className:`size-3.5 shrink-0`}):(0,L.jsx)(Ee,{className:`size-3.5 shrink-0 text-[var(--text-weaker)]`}),(0,L.jsx)(`span`,{className:`min-w-0 shrink truncate`,children:e}),t&&(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] text-[var(--text-weaker)]`,children:t})]})}var BO=`webui.activityStrip.collapsed`,VO=15e3;function HO(e){return e?e.replace(/\/+$/,``).replace(/^\/(home|Users)\/[^/]+/,`~`):``}function UO(e){let t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r?`${n}m ${r}s`:`${n}m`}function WO(e){let t=e.name||`tool`;if(e.status===`streaming`&&e.inputText){let n=e.inputText.replace(/\s+/g,` `).trim().slice(0,80);return n?`${t} ${n}…`:t}let n=e.input;if(n){if(typeof n.path==`string`)return`${t} ${String(n.path).split(`/`).pop()}`;if(typeof n.command==`string`)return`${t} ${String(n.command).slice(0,48)}`;if(typeof n.pattern==`string`)return`${t} "${String(n.pattern).slice(0,32)}"`;if(typeof n.description==`string`)return`${t} ${n.description.slice(0,40)}`;if(typeof n.agent==`string`&&typeof n.description==`string`)return`${t} ${String(n.agent)} — ${String(n.description).slice(0,24)}`}if(e.inputText){try{let n=JSON.parse(e.inputText);if(typeof n.path==`string`)return`${t} ${String(n.path).split(`/`).pop()}`;if(typeof n.command==`string`)return`${t} ${String(n.command).slice(0,48)}`}catch{}let n=e.inputText.replace(/\s+/g,` `).trim().slice(0,80);if(n&&n!==`{}`&&n!==`[]`)return`${t} ${n}`}return t}function GO(e){document.querySelectorAll(`link[rel="stylesheet"], style`).forEach(t=>{e.document.head.appendChild(t.cloneNode(!0))});try{document.adoptedStyleSheets?.length&&(e.document.adoptedStyleSheets=document.adoptedStyleSheets)}catch{}}function KO({tool:e}){let t=e.status===`running`||e.status===`streaming`,n=e.status===`error`,r=n?`✗`:t?`⠋`:e.name===`subagent`?`→`:e.name===`shell`||e.name===`bash`?`$`:e.name===`edit`?`←`:`·`;return(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 truncate py-0.5 text-[11px] ${n?`text-[var(--surface-critical-strong)]`:t?`text-[var(--text-base)]`:`text-[var(--text-weak)]`}`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono text-[10px] ${t?`animate-pulse`:``}`,children:t?`●`:r}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:WO(e)}),t&&(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 animate-pulse rounded-full bg-emerald-500`,"aria-hidden":!0})]})}function qO({assistants:e}){if(e.length===0)return(0,L.jsx)(`span`,{className:`text-[11px] italic text-[var(--text-weaker)]`,children:`waiting…`});let t=e.flatMap(e=>e.content),n=t.filter(e=>e.type===`reasoning`).slice(-1),r=t.filter(e=>e.type===`text`).slice(-2),i=t.filter(e=>e.type===`tool`).slice(-6),a=i.filter(e=>e.tool.status===`running`||e.tool.status===`streaming`),o=[...i.filter(e=>e.tool.status!==`running`&&e.tool.status!==`streaming`).slice(-3),...a];return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[n.length>0&&(0,L.jsx)(`div`,{className:`line-clamp-1 truncate text-[11px] italic text-[var(--text-weaker)]`,children:(()=>{let e=n[0].text.replace(/\s+/g,` `).trim();return`thought: ${e.length>140?`…${e.slice(-140)}`:e}`})()}),r.map(e=>{let t=e.text.replace(/\s+/g,` `).trim();if(!t)return null;let n=t.length>220?`…${t.slice(-220)}`:t;return(0,L.jsx)(`div`,{className:`line-clamp-2 break-words text-xs leading-snug text-[var(--text-base)]`,children:n},`t-${e.ordinal}`)}),o.map(e=>(0,L.jsx)(KO,{tool:e.tool},e.tool.id)),t.length===0&&(0,L.jsx)(`span`,{className:`text-[11px] text-[var(--text-weaker)]`,children:`working…`})]})}function JO({session:e,assistants:t,running:n,queued:r,onOpen:i}){let[a,o]=(0,w.useState)(0);(0,w.useEffect)(()=>{if(n)return Bh({name:`activity-row-elapsed`,minInterval:1e3,run:()=>o(e=>e+1)})},[n]);let s=t[0]?.started??e.time?.updated??Date.now(),c=n?`running`:r?`queued`:`idle`;return(0,L.jsxs)(`div`,{className:`group flex min-w-0 flex-col gap-1 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-2 py-1.5 hover:border-[var(--border-base)]`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${c===`running`?`bg-emerald-500 animate-pulse`:c===`queued`?`bg-amber-500 animate-pulse`:`bg-[var(--border-base)]`}`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-[var(--text-strong)]`,title:e.title??e.id,children:e.title||`Untitled session`}),e.location?.directory&&(0,L.jsx)(`span`,{className:`hidden max-w-[14ch] truncate font-mono text-[10px] text-[var(--text-weaker)] sm:inline`,title:e.location.directory,children:HO(e.location.directory)}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,children:n?UO(s):r?`queued`:``}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),title:`Open session`,className:`inline-flex shrink-0 cursor-pointer items-center gap-1 rounded-md border border-transparent px-1 py-0.5 text-[11px] text-[var(--text-weaker)] hover:border-[var(--border-weak-base)] hover:text-[var(--text-strong)]`,children:[(0,L.jsx)(pe,{className:`size-3`}),` open`]})]}),(0,L.jsx)(`div`,{className:`min-w-0 pl-3`,children:(0,L.jsx)(qO,{assistants:t})})]})}function YO({onOpen:e}){let t=J(e=>e.sessions),n=J(e=>e.running),r=J(e=>e.queued),i=J(e=>e.activeIDs),a=J(e=>e.live),o=(0,w.useMemo)(()=>{let e=new Map;for(let t of a){let n=e.get(t.sessionID)??[];n.push(t),e.set(t.sessionID,n)}for(let t of e.values())t.sort((e,t)=>e.started-t.started);return e},[a]),s=e=>n[e]||r[e]||(o.get(e)??[]).some(e=>e.finish===void 0)?!0:i.includes(e)&&Date.now()-Og(e)<VO,c=(0,w.useMemo)(()=>{let e=t.filter(e=>!e.parentID),r=[];for(let n of e){let e=cv(t,n.id).filter(e=>s(e.id)),i=s(n.id);(i||e.length>0)&&r.push({parent:n,parentLive:i,children:e})}let i=new Set(r.flatMap(e=>e.children.map(e=>e.id))),a=t.filter(e=>!!e.parentID&&s(e.id)&&!i.has(e.id));for(let e of a){let n=t.find(t=>t.id===e.parentID)??{id:e.parentID,title:`Parent`,time:{updated:0}};r.find(t=>t.parent.id===e.parentID)||r.push({parent:n,parentLive:!1,children:[e]})}return r.sort((e,t)=>{let r=e.parentLive&&n[e.parent.id]?1:+!!e.children.some(e=>!!n[e.id]),i=t.parentLive&&n[t.parent.id]?1:+!!t.children.some(e=>!!n[e.id]);return r===i?(t.parent.time?.updated??0)-(e.parent.time?.updated??0):i-r}),r},[t,n,r,i,a,o]);return c.length===0?(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs text-[var(--text-weaker)]`,children:`No active agents.`}):(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:c.map(t=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t.parentLive?(0,L.jsx)(JO,{session:t.parent,assistants:o.get(t.parent.id)??[],running:!!n[t.parent.id],queued:!!r[t.parent.id],onOpen:e}):(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 text-[11px] font-medium text-[var(--text-weaker)]`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:t.parent.title||HO(t.parent.location?.directory)||t.parent.id.slice(0,8)}),(0,L.jsxs)(`span`,{className:`font-mono text-[10px]`,children:[`· `,t.children.length,` subagent`,t.children.length===1?``:`s`]})]}),t.children.length>0&&(0,L.jsx)(`div`,{className:`ml-3 flex flex-col gap-1 border-l border-[var(--border-weak-base)] pl-2`,children:t.children.map(t=>(0,L.jsx)(JO,{session:t,assistants:o.get(t.id)??[],running:!!n[t.id],queued:!!r[t.id],onOpen:e},t.id))})]},t.parent.id))})}function XO(){let e=J(e=>e.running),t=J(e=>e.queued),n=J(e=>e.live),r=J(e=>e.activeIDs),[,i]=(0,w.useState)(0),a=(0,w.useMemo)(()=>{let e=new Map;for(let t of n){let n=e.get(t.sessionID)??[];n.push(t),e.set(t.sessionID,n)}return e},[n]),o=n=>e[n]||t[n]||(a.get(n)??[]).some(e=>e.finish===void 0)?!0:r.includes(n)&&Date.now()-Og(n)<VO,s=(0,w.useMemo)(()=>{let i=new Set([...Object.keys(e),...Object.keys(t),...r,...n.map(e=>e.sessionID)]);for(let e of i)if(o(e))return!0;return!1},[e,t,r,n,a]);(0,w.useEffect)(()=>{if(s)return Bh({name:`activity-strip-tick`,minInterval:1e3,run:()=>i(e=>e+1)})},[s]);let[c,l]=(0,w.useState)(()=>{try{return localStorage.getItem(BO)===`1`}catch{return!1}}),[u,d]=(0,w.useState)(null),[f,p]=(0,w.useState)(null),m=typeof window<`u`&&`documentPictureInPicture`in window;(0,w.useEffect)(()=>{try{localStorage.setItem(BO,c?`1`:`0`)}catch{}},[c]);let h=(0,w.useMemo)(()=>{let i=new Set([...Object.keys(e),...Object.keys(t),...r,...n.map(e=>e.sessionID)]),a=0;for(let e of i)o(e)&&a++;return a},[e,t,r,n,a]);if(!s)return null;let g=e=>void Ov(e),_=async()=>{if(u){u.close(),d(null),p(null);return}try{let e=await window.documentPictureInPicture.requestWindow({width:380,height:560});GO(e),e.document.body.style.margin=`0`,e.document.documentElement.style.background=`var(--background-base)`,e.document.body.style.background=`var(--background-base)`,e.document.body.style.fontFamily=getComputedStyle(document.body).fontFamily;let t=e.document.createElement(`div`);t.id=`activity-strip-pip-root`,t.style.height=`100vh`,t.style.overflow=`auto`,t.style.background=`var(--background-base)`,e.document.body.appendChild(t),p(t),d(e),e.addEventListener(`pagehide`,()=>{d(null),p(null)})}catch(e){console.warn(`PiP failed`,e)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`shrink-0 border-t border-[var(--border-base)] bg-[var(--background-base)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-[var(--text-strong)]`,children:[(0,L.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-500`,"aria-hidden":!0}),h,` active`,(0,L.jsx)(`span`,{className:`font-normal text-[var(--text-weaker)]`,children:`· streaming`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[m&&(0,L.jsxs)(`button`,{type:`button`,onClick:_,title:u?`Close picture-in-picture`:`Pop out — always on top outside Chrome`,className:`inline-flex cursor-pointer items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] ${u?`border-[var(--border-selected)] bg-[var(--surface-interactive-weak)] text-[var(--text-interactive-base)]`:`border-[var(--border-weak-base)] text-[var(--text-weaker)] hover:text-[var(--text-strong)]`}`,children:[(0,L.jsx)(ze,{className:`size-3`}),` `,u?`popped`:`pop out`]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),title:c?`Expand`:`Collapse`,className:`flex size-6 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] hover:bg-[var(--surface-base-hover)] hover:text-[var(--text-strong)]`,children:c?(0,L.jsx)(ae,{className:`size-3.5`}):(0,L.jsx)(I,{className:`size-3.5`})})]})]}),c?null:(0,L.jsx)(`div`,{className:`max-h-[42vh] overflow-auto px-2 pb-2`,children:(0,L.jsx)(YO,{onOpen:g})})]}),u&&f?(0,Er.createPortal)((0,L.jsxs)(`div`,{className:`min-h-screen bg-[var(--background-base)] p-2`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,L.jsxs)(`span`,{className:`text-xs font-medium text-[var(--text-strong)]`,children:[`Live — `,h,` active`]}),(0,L.jsx)(`button`,{type:`button`,onClick:_,className:`rounded-md border border-[var(--border-weak-base)] px-1.5 py-0.5 text-[11px] text-[var(--text-weaker)]`,children:`close`})]}),(0,L.jsx)(YO,{onOpen:e=>{Ov(e);try{window.focus()}catch{}}})]}),f):null]})}function ZO(e){let t=e.toLowerCase().split(`+`).map(e=>e.trim()).filter(Boolean),n=!1,r=!1,i=!1,a=!1,o=``;for(let e of t)e===`ctrl`||e===`control`?n=!0:e===`meta`||e===`cmd`||e===`command`||e===`super`?r=!0:e===`shift`?i=!0:e===`alt`||e===`option`?a=!0:o=e;return{ctrl:n,meta:r,shift:i,alt:a,key:o}}function QO(e,t){let n=ZO(e);return!n.key||n.ctrl!==t.ctrlKey||n.meta!==t.metaKey||n.shift!==t.shiftKey||n.alt!==t.altKey?!1:t.key.toLowerCase()===n.key.toLowerCase()}function $O(e){let t=e;return t?t.isContentEditable||t.closest?.(`input, textarea, select, [contenteditable=true]`)?!0:t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`:!1}function ek(){return(0,w.useEffect)(()=>{let e=wt(`palette`),t=pt(()=>{e=wt(`palette`)}),n=t=>{if(!t.repeat&&!$O(t.target)&&!document.querySelector(`[role="dialog"], [cmdk-root], [data-radix-popper-content-wrapper], [role="menu"], [role="listbox"]`))for(let n of e){let e=n.item.keybind;if(e&&QO(e,t)){t.preventDefault();try{let e=pg().currentSessionID??void 0;n.item.run({sessionID:e})}catch(e){console.error(`[extensions] command "${n.id}" keybind failed:`,e)}break}}};return window.addEventListener(`keydown`,n),()=>{t(),window.removeEventListener(`keydown`,n)}},[]),null}var tk=[],nk=new Set,rk=0;function ik(){for(let e of nk)e()}function ak(e){return nk.add(e),()=>nk.delete(e)}function ok(){return tk}function sk(e){let t=tk.length;tk=tk.filter(t=>t.id!==e),tk.length!==t&&ik()}function ck(e){let t=`toast_${Date.now().toString(36)}_${++rk}`,n={id:t,title:e.title,description:e.description,variant:e.variant??`default`,created:Date.now()};return tk=[...tk,n],ik(),setTimeout(()=>sk(t),3e3),t}function lk(){let e=(0,w.useSyncExternalStore)(ak,ok,ok);return e.length===0?null:(0,L.jsx)(`div`,{className:`pointer-events-none fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))] flex-col gap-2`,children:e.map(e=>(0,L.jsxs)(`div`,{role:`status`,className:`pointer-events-auto flex flex-col gap-0.5 rounded-md border px-3 py-2.5 shadow-lg backdrop-blur-sm transition-all ${e.variant===`destructive`?`border-[color:var(--surface-critical-strong)] bg-[color-mix(in_oklch,var(--surface-critical-strong)_12%,var(--surface-float-base))] text-[var(--text-strong)]`:`border-[var(--border-weak-base)] bg-[var(--surface-float-base)] text-[var(--text-strong)]`}`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium leading-tight`,children:e.title}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>sk(e.id),className:`shrink-0 cursor-pointer text-[var(--text-weaker)] transition-colors hover:text-[var(--text-strong)]`,"aria-label":`Dismiss`,children:`✕`})]}),e.description?(0,L.jsx)(`span`,{className:`text-xs leading-snug text-[var(--text-weak)]`,children:e.description}):null]},e.id))})}function uk(e,t=`main`){let n=pg();if(n.currentSessionID&&ng(n).some(e=>e.req.sessionID===n.currentSessionID))return;iv();let r=document.getElementById(`composer-input-${t}`);if(r){r.focus({preventScroll:!0});return}fk(e,t)}function dk(){let e=!1,t=null,n=e=>{let n=e.target;n?.id?.startsWith(`composer-input-`)&&(t=n)};document.addEventListener(`focusin`,n,!0);let r=e=>!!e&&(e.tagName===`TEXTAREA`||e.tagName===`INPUT`||e.isContentEditable),i=()=>{if(t&&document.contains(t))return t;let e=kv(),n=document.getElementById(`composer-input-${e}`);if(n)return n;let r=document.getElementById(`composer-input-main`);if(r)return r;let i=document.querySelectorAll(`textarea[id^="composer-input-"]`);for(let e of i)if(e.offsetParent!==null)return e;return i[0]??null},a=t=>{if(e||r(t.target))return;if(document.querySelector(`[role="dialog"], [cmdk-root], [data-radix-popper-content-wrapper], [role="menu"]`)){let e=document.activeElement;if(e&&r(e))return}let n=i();if(!n)return;let a=t.clipboardData;if(!a)return;let o=a.files&&a.files.length>0,s=``;try{s=a.getData(`text/plain`)||``}catch{s=``}if(!(!o&&!s)){t.preventDefault(),e=!0;try{if(iv(),n.focus({preventScroll:!0}),o)try{let e=new ClipboardEvent(`paste`,{bubbles:!0,cancelable:!0,clipboardData:a});n.dispatchEvent(e)}catch{}if(s){let e=n.value.length;n.setSelectionRange(e,e);let t=!1;try{t=document.execCommand(`insertText`,!1,s)}catch{t=!1}if(!t){let e=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set;if(e){e.call(n,n.value+s),n.dispatchEvent(new Event(`input`,{bubbles:!0}));let t=n.value.length;n.setSelectionRange(t,t)}}}}finally{setTimeout(()=>{e=!1},0)}}};return document.addEventListener(`paste`,a,!0),()=>{document.removeEventListener(`paste`,a,!0),document.removeEventListener(`focusin`,n,!0)}}function fk(e,t){let n=0,r=()=>{let i=document.getElementById(`composer-input-${t}`);if(!i){n++===2&&ov(),n<30&&requestAnimationFrame(r);return}i.focus({preventScroll:!0});let a=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set;if(a){a.call(i,i.value+e),i.dispatchEvent(new Event(`input`,{bubbles:!0}));let t=i.value.length;i.setSelectionRange(t,t)}};requestAnimationFrame(r)}var pk=/^\/ext\/([A-Za-z0-9_-]+)$/,mk=`webui:navigate`;function hk(){let[e,t]=(0,w.useState)(()=>window.location.pathname);return(0,w.useEffect)(()=>{let e=()=>t(window.location.pathname);return window.addEventListener(`popstate`,e),window.addEventListener(mk,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(mk,e)}},[]),e}function gk(){let e=J(e=>e.currentSessionID),t=J(e=>e.connected),n=J(e=>e.currentSessionID?e.sessions.find(t=>t.id===e.currentSessionID)??e.sessionDetails[e.currentSessionID]:void 0),r=J(e=>e.sessions),i=J(e=>e.runsPanelOpen),a=J(t=>lv(t,e)),o=J(e=>e.panes[0]?.sessionID??null),s=J(e=>e.panes.slice(1)),c=J(e=>e.focusedPane),l=hk(),u=pk.exec(l)?.[1]??null,d=(u?wt(`pages`).find(e=>e.id===u):void 0)?.item.title;(0,w.useEffect)(()=>{if(d!==void 0){document.title=d;return}document.title=e?`${a?`● `:``}${og(e)?`New session`:n?.title??`Untitled session`}`:`OpenCode Web`},[e,n?.title,a,d]);function f(){return!!document.querySelector(`[role="dialog"]`)||i}let p=e=>void Ov(e);function m(t){if(!e||!n?.parentID||f())return;let i=cv(r,n.parentID).slice().sort((e,t)=>e.id<t.id?-1:1);if(i.length===0)return;let a=i.findIndex(t=>t.id===e),o=(((a===-1?0:a)+t)%i.length+i.length)%i.length;p(i[o].id)}(0,w.useEffect)(()=>{let e=e=>{if(e.key.length!==1||e.metaKey)return;let t=e.ctrlKey&&e.altKey;if(e.ctrlKey&&!t||e.altKey&&!t)return;let n=e.target;n&&(n.isContentEditable||n.closest(`input, textarea, select, [contenteditable=true]`))||document.querySelector(`[role="dialog"], [cmdk-root], [data-radix-popper-content-wrapper], [role="menu"], [role="listbox"]`)||uk(e.key,kv())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,w.useEffect)(()=>dk(),[]);function h(){if(f())return;let e=document.getElementById(`session-search`);e&&(e.focus(),e.select())}Qy({arrowup:()=>{!n?.parentID||!e||f()||p(n.parentID)},arrowdown:()=>{!e||f()||rv()},arrowleft:()=>m(-1),arrowright:()=>m(1),enter:()=>{!n?.parentID||!e||f()||ov()},backspace:()=>{if(!n?.parentID||!e||f())return;let t=document.getElementById(`composer-input-${kv()}`);t&&t.value!==``||p(n.parentID)},"ctrl+n":()=>Ty(null),"ctrl+\\":()=>Cv(),"meta+f":h,"ctrl+f":h,escape:e=>{let t=e?.target;document.querySelector(`[role="dialog"]`)||t&&(t.id.startsWith(`composer-input`)||t.closest(`[data-radix-popper-content-wrapper], [cmdk-root], [data-slot="command"]`))||_y()}});let g=e=>()=>void Sv(e);return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,L.jsx)(Ct,{id:`sidebar`}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 overflow-x-auto`,children:[(0,L.jsx)(`section`,{className:`flex min-w-0 flex-1 flex-col`,onPointerDownCapture:g(ig),onFocusCapture:g(ig),children:u?(0,L.jsx)(yk,{id:u}):o?(0,L.jsx)(Ct,{id:`conversation`,sessionID:o,paneKey:`main`,focused:c===ig,onNavigate:p},o):(0,L.jsx)(vk,{connected:t})}),s.map(e=>(0,L.jsx)(`section`,{className:`pane-surface hidden min-w-0 border-l border-[var(--border-base)] lg:flex`,style:{flex:`1 1 0`,maxWidth:`50%`},onPointerDownCapture:g(e.id),onFocusCapture:g(e.id),children:e.sessionID?(0,L.jsx)(Ct,{id:`conversation`,sessionID:e.sessionID,paneKey:e.id,focused:c===e.id,onClose:()=>void Ev(e.id),onNavigate:p},`${e.id}:${e.sessionID}`):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--text-weaker)]`,children:`Empty pane`})},e.id)),(0,L.jsx)(`div`,{className:`hidden w-9 shrink-0 flex-col items-center border-l border-[var(--border-base)] pt-2 lg:flex`,children:(0,L.jsx)(`button`,{type:`button`,onClick:Cv,disabled:s.length>=3,title:`Split view — open a session beside this one`,className:`flex size-7 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)] disabled:pointer-events-none disabled:opacity-40`,children:(0,L.jsx)(ce,{className:`size-4`})})})]})]}),(0,L.jsx)(XO,{}),(0,L.jsx)(_k,{}),(0,L.jsx)(FO,{}),(0,L.jsx)(nb,{}),(0,L.jsx)(ek,{}),(0,L.jsx)(lk,{}),(0,L.jsx)(ib,{}),(0,L.jsx)(EO,{trigger:(0,L.jsx)(`span`,{className:`hidden`})})]})}function _k(){let e=J(e=>ng(e).filter(t=>t.req.sessionID!==e.currentSessionID)),t=e.map(e=>e.req.id).join(`,`);return(0,w.useEffect)(()=>{t&&G(`chip`,`foreign waiting: ${t}`)},[t]),e.length===0?null:(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void mv(e[0].req.sessionID,{history:`push`}),title:e.map(e=>`${e.kind} — ${e.req.sessionID}`).join(`
|
|
70
|
-
`),className:`fixed right-4 bottom-10 z-40 flex items-center gap-1.5 rounded-full border border-[color-mix(in_oklch,var(--surface-warning-strong)_45%,transparent)] bg-[var(--surface-float-base)] px-2.5 py-1 text-xs text-[var(--text-weak)] shadow-md transition-colors hover:text-[var(--text-strong)]`,children:[(0,L.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-[color:var(--surface-warning-strong)]`,"aria-hidden":!0}),e.length,` waiting in other session`,e.length>1?`s`:``,` — switch`]})}function vk({connected:e}){return(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-neutral-500`,children:[(0,L.jsx)(`div`,{className:`size-2.5 rounded-full ${e?`bg-emerald-500`:`bg-amber-500`}`}),(0,L.jsx)(`p`,{className:`text-sm`,children:e?`Select or create a session on the left`:`Connecting to the opencode service…`})]})}function yk({id:e}){bk();let t=wt(`pages`),n=t.find(t=>t.id===e);return(0,L.jsx)(`div`,{className:`pane-surface flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto`,children:(0,L.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-6 py-6`,children:[(0,L.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>window.history.back(),title:`Go back`,className:`inline-flex cursor-pointer items-center gap-1 rounded-md border border-[var(--border-weak-base)] px-1.5 py-0.5 text-xs text-[var(--text-weak)] transition-colors hover:border-[var(--border-selected)] hover:text-[var(--text-strong)]`,children:[(0,L.jsx)(j,{className:`size-3`}),`Back`]}),(0,L.jsx)(`h1`,{className:`truncate text-[var(--font-size-large)] font-medium text-[var(--text-strong)]`,children:n?n.item.title:`Unknown extension page`})]}),n?.item.description&&(0,L.jsx)(`p`,{className:`mt-1 text-sm text-[var(--text-weaker)]`,children:n.item.description})]})}),(0,L.jsx)(`div`,{className:`mt-4`,children:n?n.item.render({}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm text-[var(--text-weak)]`,children:[(0,L.jsxs)(`p`,{children:[`No extension registered “`,e,`”. Available pages:`]}),t.length===0?(0,L.jsx)(`p`,{className:`text-[var(--text-weaker)]`,children:`No extension pages are registered.`}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`a`,{href:`/ext/${e.id}`,title:e.item.description??e.item.title,className:`text-[var(--text-interactive-base)] underline underline-offset-2`,children:[`/ext/`,e.id,` — `,e.item.title]})},e.id))})]})})]})})}function bk(){let[e,t]=(0,w.useState)(0);return(0,w.useEffect)(()=>pt(()=>t(e=>e+1)),[]),[e]}var xk=class extends w.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){console.error(`[app] render error:`,e)}render(){return this.state.error?(0,L.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-3 bg-background p-6 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:`The UI hit a render error.`}),(0,L.jsx)(`pre`,{className:`max-h-48 max-w-full overflow-auto rounded-md border border-border bg-muted p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:this.state.error.message}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>this.setState({error:null}),className:`cursor-pointer rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-muted`,children:`Retry`})]}):this.props.children}},Sk=Object.assign({"./report/index.tsx":()=>Wh(()=>import(`./report-
|
|
70
|
+
`),className:`fixed right-4 bottom-10 z-40 flex items-center gap-1.5 rounded-full border border-[color-mix(in_oklch,var(--surface-warning-strong)_45%,transparent)] bg-[var(--surface-float-base)] px-2.5 py-1 text-xs text-[var(--text-weak)] shadow-md transition-colors hover:text-[var(--text-strong)]`,children:[(0,L.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-[color:var(--surface-warning-strong)]`,"aria-hidden":!0}),e.length,` waiting in other session`,e.length>1?`s`:``,` — switch`]})}function vk({connected:e}){return(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-neutral-500`,children:[(0,L.jsx)(`div`,{className:`size-2.5 rounded-full ${e?`bg-emerald-500`:`bg-amber-500`}`}),(0,L.jsx)(`p`,{className:`text-sm`,children:e?`Select or create a session on the left`:`Connecting to the opencode service…`})]})}function yk({id:e}){bk();let t=wt(`pages`),n=t.find(t=>t.id===e);return(0,L.jsx)(`div`,{className:`pane-surface flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto`,children:(0,L.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-6 py-6`,children:[(0,L.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>window.history.back(),title:`Go back`,className:`inline-flex cursor-pointer items-center gap-1 rounded-md border border-[var(--border-weak-base)] px-1.5 py-0.5 text-xs text-[var(--text-weak)] transition-colors hover:border-[var(--border-selected)] hover:text-[var(--text-strong)]`,children:[(0,L.jsx)(j,{className:`size-3`}),`Back`]}),(0,L.jsx)(`h1`,{className:`truncate text-[var(--font-size-large)] font-medium text-[var(--text-strong)]`,children:n?n.item.title:`Unknown extension page`})]}),n?.item.description&&(0,L.jsx)(`p`,{className:`mt-1 text-sm text-[var(--text-weaker)]`,children:n.item.description})]})}),(0,L.jsx)(`div`,{className:`mt-4`,children:n?n.item.render({}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm text-[var(--text-weak)]`,children:[(0,L.jsxs)(`p`,{children:[`No extension registered “`,e,`”. Available pages:`]}),t.length===0?(0,L.jsx)(`p`,{className:`text-[var(--text-weaker)]`,children:`No extension pages are registered.`}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`a`,{href:`/ext/${e.id}`,title:e.item.description??e.item.title,className:`text-[var(--text-interactive-base)] underline underline-offset-2`,children:[`/ext/`,e.id,` — `,e.item.title]})},e.id))})]})})]})})}function bk(){let[e,t]=(0,w.useState)(0);return(0,w.useEffect)(()=>pt(()=>t(e=>e+1)),[]),[e]}var xk=class extends w.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){console.error(`[app] render error:`,e)}render(){return this.state.error?(0,L.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-3 bg-background p-6 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:`The UI hit a render error.`}),(0,L.jsx)(`pre`,{className:`max-h-48 max-w-full overflow-auto rounded-md border border-border bg-muted p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:this.state.error.message}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>this.setState({error:null}),className:`cursor-pointer rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-muted`,children:`Retry`})]}):this.props.children}},Sk=Object.assign({"./report/index.tsx":()=>Wh(()=>import(`./report-B9LU5-59.js`),[])});async function Ck(){let e=new Map(Object.entries({}).map(([e,t])=>[e,new Set(t)])),t=new Set;for(let n of Object.values(Sk)){let r=new Set(gt()),i;try{i=await n()}catch{continue}if(!i||typeof i.id!=`string`)continue;t.add(i.id);let a=gt(),o=e.get(i.id);o||(o=new Set,e.set(i.id,o));for(let e of a)r.has(e)||o.add(e)}let n=[...new Set([])].filter(e=>!t.has(e));if(n.length>0){let t=new Set;for(let r of n){let n=e.get(r);if(n&&n.size>0)for(let e of n)t.add(e);else t.add(r);e.delete(r)}ht([...t])}}Ck();var wk=300,Tk=4,Ek=40,Dk=new Map;function Ok(e){switch(e.type){case`user`:case`system`:case`synthetic`:case`skill`:return e.text??``;case`shell`:return e.command??``;case`compaction`:return e.summary??``;case`assistant`:{let t=``;for(let n of e.content??[])n?.type===`text`&&(t+=n.text+`
|
|
71
71
|
`);return t}default:return``}}function kk(e,t,n){let r=e.toLowerCase().indexOf(t);if(r===-1)return null;let i=Math.max(0,r-Ek),a=Math.min(e.length,r+n+Ek),o=e.slice(i,a).replace(/\s+/g,` `),s=o.toLowerCase().indexOf(t),c=s===-1?r-i:s,l=c+n;c<0&&(c=0),l>o.length&&(l=o.length);let u=i>0?`… `:``,d=a<e.length?` …`:``;return u&&(o=u+o,c+=u.length,l+=u.length),d&&(o+=d),{snippet:o,matchStart:c,matchEnd:l}}async function Ak(e){try{let t=(await W.messages(e,100)).data.map(e=>{let t=Ok(e);return t?{id:e.id,text:t,lower:t.toLowerCase()}:null}).filter(e=>!!e),n=t.map(e=>e.lower).join(`
|
|
72
72
|
`);Dk.set(e,{messages:t,combinedLower:n})}catch{Dk.set(e,{messages:[],combinedLower:``})}}function jk(e){let t=new Map,n=e.length;for(let[r,i]of Dk){if(!i.combinedLower.includes(e))continue;let a=[];for(let t of i.messages){if(!t.lower.includes(e))continue;let r=kk(t.text,e,n);r&&a.push({messageID:t.id,snippet:r.snippet,matchStart:r.matchStart,matchEnd:r.matchEnd})}a.length>0&&t.set(r,a)}return t}function Mk(e,t,n){let r=e.trim().toLowerCase();if(!r)return Promise.resolve(new Map);let i=[...t].sort((e,t)=>t.time.updated-e.time.updated).slice(0,wk).map(e=>e.id).filter(e=>!Dk.has(e));return(async()=>{for(let e=0;e<i.length;e+=Tk){let t=i.slice(e,e+Tk);await Promise.all(t.map(Ak)),n?.(jk(r))}return jk(r)})()}var Nk=/mac|iphone|ipad|ipod/i.test(typeof navigator>`u`?``:navigator.userAgent),Pk=Nk?`⌘F`:`Ctrl F`;function Fk({...e}){return(0,L.jsx)(Qd,{"data-slot":`context-menu`,...e})}function Ik({...e}){return(0,L.jsx)($d,{"data-slot":`context-menu-trigger`,...e})}function Lk({className:e,...t}){return(0,L.jsx)(ef,{children:(0,L.jsx)(tf,{"data-slot":`context-menu-content`,className:B(`z-50 min-w-32 overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...t})})}function Rk({className:e,inset:t,variant:n=`default`,...r}){return(0,L.jsx)(nf,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:B(`relative flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1.5 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function zk({className:e,...t}){return(0,L.jsx)(rf,{"data-slot":`context-menu-separator`,className:B(`-mx-1 my-1 h-px bg-border`,e),...t})}function Bk({className:e,children:t,...n}){return(0,L.jsxs)(Up,{"data-slot":`scroll-area`,className:B(`relative`,e),...n,children:[(0,L.jsx)(Wp,{"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 max-w-full overflow-x-hidden rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,L.jsx)(Vk,{}),(0,L.jsx)(Gp,{})]})}function Vk({className:e,orientation:t=`vertical`,...n}){return(0,L.jsx)(_p,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:B(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,L.jsx)(Op,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function Hk({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`skeleton`,className:B(`animate-pulse rounded-md bg-muted`,e),...t})}function Uk({...e}){return(0,L.jsx)(Yo,{"data-slot":`sheet`,...e})}function Wk({...e}){return(0,L.jsx)(ts,{"data-slot":`sheet-portal`,...e})}function Gk({className:e,...t}){return(0,L.jsx)(rs,{"data-slot":`sheet-overlay`,className:B(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Kk({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,L.jsxs)(Wk,{children:[(0,L.jsx)(Gk,{}),(0,L.jsxs)(ss,{"data-slot":`sheet-content`,"data-side":n,className:B(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,L.jsx)(gs,{"data-slot":`sheet-close`,asChild:!0,children:(0,L.jsxs)(H,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,L.jsx)(at,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function qk({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sheet-header`,className:B(`flex flex-col gap-0.5 p-4`,e),...t})}function Jk({className:e,...t}){return(0,L.jsx)(fs,{"data-slot":`sheet-title`,className:B(`font-heading text-base font-medium text-foreground`,e),...t})}function Yk({className:e,...t}){return(0,L.jsx)(ms,{"data-slot":`sheet-description`,className:B(`text-sm text-muted-foreground`,e),...t})}var Xk=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function Zk(e){let t=[],n=0,r=0;for(let i of e.split(`
|
|
73
73
|
`))if(!(i.startsWith(`Index: `)||i.startsWith(`=======`)||i.startsWith(`diff --git `))){if(i.startsWith(`+++ `)||i.startsWith(`--- `)){t.push({text:i,kind:`file`});continue}if(i.startsWith(`@@`)){let e=Xk.exec(i);n=e?Number(e[1]):0,r=e?Number(e[3]):0,t.push({text:i,kind:`hunk`});continue}i.startsWith(`+`)?(t.push({text:i,kind:`add`,newNo:r}),r+=1):i.startsWith(`-`)?(t.push({text:i,kind:`delete`,oldNo:n}),n+=1):(t.push({text:i,kind:`context`,oldNo:n>0?n:void 0,newNo:r>0?r:void 0}),n>0&&(n+=1),r>0&&(r+=1))}return t}var Qk={file:`bg-(--surface-diff-unchanged-base) text-(color:--text-strong)`,hunk:`bg-(--surface-diff-hidden-base) text-(color:--text-weak)`,add:`bg-(--surface-diff-add-weak) text-(color:--text-diff-add-base)`,delete:`bg-(--surface-diff-delete-weak) text-(color:--text-diff-delete-base)`,context:`bg-(--surface-diff-unchanged-base) text-(color:--text-base)`};function $k({diff:e,className:t}){let n=(0,w.useMemo)(()=>Zk(e),[e]);return(0,L.jsx)(`div`,{className:B(`overflow-x-auto font-mono text-xs`,t),children:(0,L.jsx)(`div`,{className:`min-w-max`,children:n.map((e,t)=>(0,L.jsx)(eA,{row:e},t))})})}function eA({row:e}){let t=e.kind===`add`||e.kind===`delete`||e.kind===`context`;return(0,L.jsxs)(`div`,{className:B(`flex items-center whitespace-pre`,Qk[e.kind]),children:[t&&(0,L.jsxs)(`span`,{className:`shrink-0 select-none pl-2 pr-1 text-right text-(color:--text-weaker)`,children:[(0,L.jsx)(`span`,{className:`inline-block w-9`,children:e.oldNo??``}),(0,L.jsx)(`span`,{className:`inline-block w-9`,children:e.newNo??``})]}),(0,L.jsx)(`span`,{className:B(`min-w-0`,t&&`pr-2`),children:e.text||` `})]})}var tA=e=>e.replace(/\/+$/,``),nA=e=>tA(e).split(`/`).filter(Boolean).pop()??e,rA=e=>e instanceof Error?e.message:String(e);function iA(e,t){let n=tA(e.replace(/^\.\//,``)),r=tA(t.replace(/^\.\//,``));return n===r||n.endsWith(`/${r}`)||r.endsWith(`/${n}`)}function aA(e){return[...e].sort((e,t)=>e.type===t.type?tA(e.path).localeCompare(tA(t.path)):e.type===`directory`?-1:1)}function oA(e){let t=e.includes(`.`)?(e.split(`.`).pop()??``).toLowerCase():``,n=`size-3.5 shrink-0 text-[var(--text-weaker)]`;return[`png`,`jpg`,`jpeg`,`gif`,`svg`,`webp`,`ico`,`avif`].includes(t)?(0,L.jsx)(be,{className:n}):[`json`,`jsonc`,`yaml`,`yml`,`toml`].includes(t)?(0,L.jsx)(_e,{className:n}):[`zip`,`tar`,`gz`,`tgz`,`bz2`,`xz`,`7z`].includes(t)?(0,L.jsx)(ge,{className:n}):[`txt`,`log`,`csv`,`tsv`,`ini`,`env`,`conf`,`lock`,`gitignore`].includes(t)?(0,L.jsx)(Se,{className:n}):`ts.tsx.js.jsx.mjs.cjs.go.rs.py.rb.java.c.h.hpp.cc.cpp.css.scss.html.vue.svelte.sh.bash.zsh.sql.graphql.gql.md.mdx.zig`.split(`.`).includes(t)?(0,L.jsx)(ye,{className:n}):(0,L.jsx)(Ce,{className:n})}function sA({entry:e,depth:t,nodes:n,selectedPath:r,onToggle:i,onOpen:a}){let o=e.type===`directory`,s=tA(e.path),c=n[s],l=nA(e.path),u=r===s,d=6+t*13,f=()=>o?i(e):a(e);return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:f,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f())},className:B(`flex cursor-pointer items-center gap-1 rounded-sm py-[3px] pr-2`,u?`bg-[var(--surface-raised-base)] text-[var(--text-strong)]`:`text-[var(--text-base)] hover:bg-[var(--surface-base-hover)]`),style:{paddingLeft:d},children:[o?(0,L.jsx)(F,{className:B(`size-3 shrink-0 text-[var(--text-weaker)] transition-transform`,c?.expanded&&`rotate-90`)}):(0,L.jsx)(`span`,{className:`w-3 shrink-0`}),o?(0,L.jsx)(Ee,{className:B(`size-3.5 shrink-0`,c?.expanded?`text-[var(--text-interactive-base)]`:`text-[var(--text-weak)]`)}):oA(l),(0,L.jsx)(`span`,{className:B(`truncate font-mono text-xs`,o?`text-[var(--text-strong)]`:`text-[var(--text-base)]`),children:l}),c?.loading&&(0,L.jsx)(Me,{className:`ml-auto size-3 shrink-0 animate-spin text-[var(--text-weaker)]`}),c?.error&&(0,L.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] text-[var(--text-on-critical-base)]`,children:`!`})]}),o&&c?.expanded&&(0,L.jsx)(`div`,{children:c.loading?(0,L.jsxs)(`div`,{className:`space-y-1.5 py-1`,style:{paddingLeft:d+13},children:[(0,L.jsx)(Hk,{className:`h-3 w-3/4`}),(0,L.jsx)(Hk,{className:`h-3 w-1/2`})]}):c.error?(0,L.jsx)(`div`,{className:`py-1 text-[11px] text-[var(--text-on-critical-base)]`,style:{paddingLeft:d+13},children:c.error}):c.children&&c.children.length===0?(0,L.jsx)(`div`,{className:`py-0.5 text-[11px] italic text-[var(--text-weaker)]`,style:{paddingLeft:d+13},children:`empty`}):c.children?.map(e=>(0,L.jsx)(sA,{entry:e,depth:t+1,nodes:n,selectedPath:r,onToggle:i,onOpen:a},tA(e.path)))})]})}function cA({count:e,error:t}){return t?(0,L.jsx)(ob,{variant:`outline`,title:t,className:`border-border/50 text-[var(--text-weaker)]`,children:`vcs n/a`}):e===null?null:e===0?(0,L.jsx)(ob,{className:`border-transparent bg-[var(--surface-success-base)] text-[var(--text-on-success-base)]`,children:`clean`}):(0,L.jsxs)(ob,{className:`border-transparent bg-[var(--surface-critical-base)] text-[var(--text-on-critical-base)]`,children:[e,` changed`]})}function lA({open:e,onOpenChange:t}){let n=J(e=>e.sessions.find(t=>t.id===e.currentSessionID)?.location?.directory),[r,i]=(0,w.useState)(null),[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(null),[l,u]=(0,w.useState)({}),[d,f]=(0,w.useState)(null),[p,m]=(0,w.useState)({loading:!1}),[h,g]=(0,w.useState)({loading:!1}),[_,v]=(0,w.useState)(null),[y,b]=(0,w.useState)(null),x=(0,w.useRef)(null),S=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=!1,r=e=>{t||(S.current!==e&&(S.current=e,o(null),c(null),u({}),v(null),b(null),f(null),x.current=null),i(e),W.fsList({location:e}).then(e=>{t||(o(e.data),c(null))}).catch(e=>{t||c(rA(e))}),W.vcsStatus({directory:e}).then(e=>{t||v(e.data.length)}).catch(e=>{t||b(rA(e))}))};return n?r(n):W.location().then(e=>{t||r(e.directory)}).catch(e=>{t||c(rA(e))}),()=>{t=!0}},[e,n]),(0,w.useEffect)(()=>{e||(f(null),x.current=null,m({loading:!1}),g({loading:!1}))},[e]);let C=e=>{let t=tA(e.path),n=l[t];if(n?.expanded){u(e=>{let n={...e};return delete n[t],n});return}u(e=>({...e,[t]:{expanded:!0,loading:!e[t]?.children,children:e[t]?.children}})),n?.children||W.fsList({location:r??void 0,path:t}).then(e=>u(n=>n[t]?{...n,[t]:{...n[t],children:e.data,loading:!1}}:n)).catch(e=>u(n=>n[t]?{...n,[t]:{...n[t],error:rA(e),loading:!1}}:n))},T=e=>{x.current=e,f(e),m({loading:!0}),g({loading:!0}),W.fsRead(e.path,r??void 0).then(t=>{x.current?.path===e.path&&m({content:t,loading:!1})}).catch(t=>{x.current?.path===e.path&&m({error:rA(t),loading:!1})}),W.vcsBase(r?{directory:r}:void 0).then(e=>e.data).catch(()=>null).then(e=>W.vcsDiff(`working`,r?{directory:r}:void 0,3,e?.ref??null)).then(t=>{if(x.current?.path!==e.path)return;let n=t.data.find(t=>iA(t.file,e.path));g({patch:n?.patch,loading:!1})}).catch(t=>{x.current?.path===e.path&&g({error:rA(t),loading:!1})})};return(0,L.jsx)(Uk,{open:e,onOpenChange:t,children:(0,L.jsxs)(Kk,{side:`left`,className:`w-[min(44rem,calc(100vw-0.5rem))]! gap-0 p-0 sm:max-w-[44rem]!`,children:[(0,L.jsxs)(qk,{className:`border-b border-border px-4 py-3 pr-12`,children:[(0,L.jsxs)(Jk,{className:`flex items-center gap-2 text-sm`,children:[(0,L.jsx)(Te,{className:`size-4 text-[var(--text-weak)]`}),`Files`,(0,L.jsx)(cA,{count:_,error:y})]}),r&&(0,L.jsx)(Yk,{className:`truncate font-mono text-[11px] text-[var(--text-weaker)]`,children:r})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`flex w-[40%] min-w-56 shrink-0 flex-col border-r border-border`,children:(0,L.jsx)(Bk,{className:`min-h-0 flex-1`,children:(0,L.jsx)(`div`,{className:`p-1.5`,children:s?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-[var(--text-on-critical-base)]`,children:s}):a===null?(0,L.jsx)(`div`,{className:`space-y-1.5 p-1`,children:[0,1,2,3,4].map(e=>(0,L.jsx)(Hk,{className:`h-4 w-full`},e))}):a.length===0?(0,L.jsx)(`div`,{className:`px-2 py-3 text-xs text-[var(--text-weak)]`,children:`Empty directory`}):aA(a).map(e=>(0,L.jsx)(sA,{entry:e,depth:0,nodes:l,selectedPath:d?tA(d.path):null,onToggle:C,onOpen:T},tA(e.path)))})})}),(0,L.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:d?(0,L.jsxs)(vO,{defaultValue:`preview`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1.5`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[var(--text-weak)]`,children:d.path}),(0,L.jsxs)(bO,{variant:`line`,className:`h-6 shrink-0`,children:[(0,L.jsx)(xO,{value:`preview`,className:`text-xs`,children:`Preview`}),(0,L.jsx)(xO,{value:`diff`,className:`text-xs`,children:`Diff`})]})]}),(0,L.jsx)(SO,{value:`preview`,className:`flex min-h-0 flex-1 flex-col`,children:p.loading?(0,L.jsxs)(`div`,{className:`space-y-1.5 p-3`,children:[(0,L.jsx)(Hk,{className:`h-3 w-3/4`}),(0,L.jsx)(Hk,{className:`h-3 w-2/3`}),(0,L.jsx)(Hk,{className:`h-3 w-5/6`}),(0,L.jsx)(Hk,{className:`h-3 w-1/2`})]}):p.error?(0,L.jsx)(`div`,{className:`p-4 text-xs text-[var(--text-on-critical-base)]`,children:p.error}):(0,L.jsx)(Bk,{className:`min-h-0 flex-1`,children:(0,L.jsx)(`pre`,{className:`p-3 font-mono text-xs leading-[1.6] whitespace-pre text-[var(--text-base)]`,children:p.content??``})})}),(0,L.jsx)(SO,{value:`diff`,className:`flex min-h-0 flex-1 flex-col`,children:h.loading?(0,L.jsxs)(`div`,{className:`space-y-1.5 p-3`,children:[(0,L.jsx)(Hk,{className:`h-3 w-11/12`}),(0,L.jsx)(Hk,{className:`h-3 w-3/4`}),(0,L.jsx)(Hk,{className:`h-3 w-2/3`}),(0,L.jsx)(Hk,{className:`h-3 w-5/6`})]}):h.error?(0,L.jsxs)(`div`,{className:`p-4 text-xs text-[var(--text-on-critical-base)]`,children:[`Diff unavailable: `,h.error]}):h.patch?(0,L.jsx)(Bk,{className:`min-h-0 flex-1`,children:(0,L.jsx)($k,{diff:h.patch,className:`p-3`})}):(0,L.jsx)(`div`,{className:`p-4 text-xs text-[var(--text-weak)]`,children:`No uncommitted changes for this file.`})})]}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-xs text-[var(--text-weak)]`,children:`Select a file to preview`})})]})]})})}var uA=`w-full rounded-md border border-[var(--border-weak-base)] bg-[var(--input-base)] px-2.5 py-1.5 text-sm text-[var(--text-strong)] outline-none transition-colors placeholder:text-[var(--text-weaker)] focus:border-[var(--border-selected)] focus:ring-1 focus:ring-[var(--border-selected)]`;function dA({title:e,note:t,onRefresh:n,loading:r}){return(0,L.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,L.jsx)(`h3`,{className:`shrink-0 text-[13px] font-medium text-[var(--text-strong)]`,children:e}),t&&(0,L.jsx)(`span`,{className:`truncate text-[11px] text-[var(--text-weaker)]`,children:t})]}),n&&(0,L.jsx)(H,{variant:`ghost`,size:`icon-sm`,title:`Refresh`,disabled:r,onClick:n,children:(0,L.jsx)(Ge,{className:r?`animate-spin`:``})})]})}function fA({children:e}){return(0,L.jsx)(`p`,{className:`py-3 text-center text-xs text-[var(--text-weaker)]`,children:e})}function pA(e){let[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)(null),[a,o]=(0,w.useState)(!0),[s,c]=(0,w.useState)(0);return(0,w.useEffect)(()=>{let t=!1;return o(!0),i(null),e().then(e=>{t||n(e)}).catch(e=>{t||i(e instanceof Error?e.message:String(e))}).finally(()=>{t||o(!1)}),()=>{t=!0}},[s]),{data:t,error:r,loading:a,refresh:(0,w.useCallback)(()=>c(e=>e+1),[])}}function mA({message:e}){return(0,L.jsx)(`p`,{className:`rounded-md border border-[var(--surface-critical-base)] bg-[var(--surface-critical-weak)] px-2.5 py-1.5 text-xs text-[var(--surface-critical-strong)]`,children:e})}function hA({text:e}){let[t,n]=(0,w.useState)(!1);return(0,L.jsx)(H,{variant:`ghost`,size:`xs`,title:`Copy`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1200)})},children:t?`copied`:`copy`})}function gA(){let{data:e,error:t,loading:n,refresh:r}=pA(()=>W.configGet());return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Configuration`,note:`Read-only — edit server-side in opencode.jsonc`,onRefresh:r,loading:n}),t&&(0,L.jsx)(mA,{message:t}),!t&&e&&e.length===0&&(0,L.jsx)(fA,{children:`No configuration found.`}),(0,L.jsx)(`div`,{className:`space-y-2`,children:e?.map((e,t)=>(0,L.jsx)(_A,{entry:e},t))})]})}function _A({entry:e}){return(0,L.jsxs)(`div`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] p-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(db,{tone:e.type===`document`?`blue`:`neutral`,children:e.type}),e.path&&(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-[var(--text-weak)]`,children:e.path})]}),e.type===`document`&&(0,L.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-[var(--text-base)] mt-2 max-h-72`,children:JSON.stringify(e.info,null,2)})]})}var vA=e=>e instanceof Error?e.message:String(e),yA=`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-3 rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`;function bA(e,t,n,r){let[i,a]=(0,w.useState)({kind:`idle`}),o=i.kind===`active`?i.attemptID:null,s=i.kind===`active`?i.status:null;return(0,w.useEffect)(()=>{if(!e){a({kind:`idle`});return}let n=!1;return a({kind:`starting`}),t(e).then(e=>{n||a({kind:`active`,attemptID:e.attemptID,url:e.url,instructions:e.instructions,status:`pending`})}).catch(e=>a({kind:`starting`,error:e instanceof Error?e.message:String(e)})),()=>{n=!0}},[e?.integrationID,e?.methodID]),(0,w.useEffect)(()=>{if(!e||!o||s!==`pending`)return;let t=async()=>{try{let t=await n(e,o);a(e=>e.kind===`active`?{...e,status:t.status,message:t.message}:e),t.status===`complete`&&r()}catch{}};return Bh({name:`integration-attempt`,minInterval:2e3,run:()=>t()})},[e?.integrationID,e?.methodID,o,s]),i}function xA({state:e,onCancel:t,label:n}){return e.kind===`idle`?null:e.kind===`starting`?(0,L.jsxs)(`div`,{className:`space-y-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] p-2.5`,children:[e.error?(0,L.jsx)(mA,{message:e.error}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-[var(--text-base)]`,children:[(0,L.jsx)(Me,{className:`size-3.5 animate-spin`}),` starting `,n,`…`]}),(0,L.jsx)(H,{variant:`ghost`,size:`xs`,onClick:t,children:`cancel`})]}):(0,L.jsxs)(`div`,{className:`space-y-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] p-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-[var(--text-base)]`,children:[n,` attempt`]}),(0,L.jsx)(db,{tone:e.status===`complete`?`green`:e.status===`pending`?`amber`:`red`,children:e.status})]}),e.url&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`a`,{className:`min-w-0 truncate text-xs text-[var(--text-interactive-base)] underline underline-offset-2`,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),(0,L.jsx)(pe,{className:`size-3 shrink-0 text-[var(--text-weaker)]`}),(0,L.jsx)(hA,{text:e.url})]}),e.instructions&&(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weak)]`,children:e.instructions}),e.message&&(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weak)]`,children:e.message}),e.status===`pending`&&(0,L.jsx)(H,{variant:`ghost`,size:`xs`,onClick:t,children:`cancel`})]})}function SA({integration:e,method:t,open:n,onClose:r,onDone:i}){let[a,o]=(0,w.useState)(``),[s,c]=(0,w.useState)(``),[l,u]=(0,w.useState)(!1),[d,f]=(0,w.useState)(null);return(0,L.jsx)(wm,{open:n,onOpenChange:e=>!e&&r(),children:(0,L.jsxs)(Em,{children:[(0,L.jsx)(Om,{className:`bg-black/60`}),(0,L.jsxs)(ss,{"data-slot":`dialog-content`,className:yA,children:[(0,L.jsxs)(Am,{children:[(0,L.jsxs)(Mm,{children:[e.name,` · API key`]}),(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:t.label??`Connect with an API key for ${e.id}`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`input`,{className:uA,placeholder:`API key`,type:`password`,autoComplete:`off`,value:a,onChange:e=>o(e.target.value)}),(0,L.jsx)(`input`,{className:uA,placeholder:`Label (optional)`,value:s,onChange:e=>c(e.target.value)}),d&&(0,L.jsx)(mA,{message:d})]}),(0,L.jsxs)(jm,{className:`rounded-b-lg`,children:[(0,L.jsx)(H,{variant:`ghost`,onClick:r,disabled:l,children:`Cancel`}),(0,L.jsx)(H,{disabled:a.trim().length===0||l,onClick:()=>{u(!0),f(null),W.integrationConnectKey(e.id,{key:a.trim(),label:s.trim()||null}).then(()=>{r(),i()}).catch(e=>f(e instanceof Error?e.message:String(e))).finally(()=>u(!1))},children:l?`Connecting…`:`Connect`})]}),(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsxs)(H,{variant:`ghost`,size:`icon-sm`,className:`absolute top-2 right-2`,children:[(0,L.jsx)(at,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})})}function CA(){let{data:e,error:t,loading:n,refresh:r}=pA(()=>W.integrationList().then(e=>e.data)),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(``),c=pA(()=>W.models()),l=pA(()=>W.providerList().then(e=>e.data)),[u,d]=(0,w.useState)(null),[f,p]=(0,w.useState)(null),[m,h]=(0,w.useState)(null),g=bA(f,e=>W.integrationConnectOauth(e.integrationID,{methodID:e.methodID}).then(e=>({attemptID:e.data.attemptID,url:e.data.url,instructions:e.data.instructions})),(e,t)=>W.integrationOauthAttempt(e.integrationID,t).then(e=>e.data),r),_=bA(m,e=>W.integrationConnectCommand(e.integrationID,{methodID:e.methodID}).then(e=>({attemptID:e.data.attemptID})),(e,t)=>W.integrationCommandAttempt(e.integrationID,t).then(e=>e.data),r),v=(0,w.useMemo)(()=>{let e=new Map;if(!c.data||!l.data)return e;let t=new Map;for(let e of l.data){if(!e.integrationID)continue;let n=t.get(e.integrationID)??new Set;n.add(e.id),t.set(e.integrationID,n)}for(let n of c.data)for(let[r,i]of t)i.has(n.providerID)&&e.set(r,(e.get(r)??0)+1);return e},[c.data,l.data]),y=(0,w.useMemo)(()=>e?[...e].sort((e,t)=>{let n=+(e.connections.length>0),r=+(t.connections.length>0);return n===r?(e.name||e.id).localeCompare(t.name||t.id):r-n}):[],[e]),b=o.trim().toLowerCase(),x=(0,w.useMemo)(()=>b?y.filter(e=>e.name.toLowerCase().includes(b)||e.id.toLowerCase().includes(b)):y,[y,b]);return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Integrations`,note:`Connect providers — API keys, OAuth, CLI commands`,onRefresh:r,loading:n}),(0,L.jsx)(`p`,{className:`-mt-1 mb-2 text-xs text-[var(--text-weaker)]`,children:`An integration is how the engine authenticates to a model provider. Connect one to enable its models.`}),(0,L.jsxs)(`div`,{className:`relative mb-2`,children:[(0,L.jsx)(qe,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(`input`,{className:`${uA} h-7 pl-7`,placeholder:`Search integrations`,value:o,onChange:e=>s(e.target.value)})]}),b&&(0,L.jsxs)(`p`,{className:`mb-1 px-1 text-[11px] text-[var(--text-weaker)]`,"aria-live":`polite`,children:[x.length,` of `,y.length]}),t&&(0,L.jsx)(mA,{message:t}),!t&&e&&e.length===0&&(0,L.jsx)(fA,{children:`No integrations available.`}),!t&&e&&e.length>0&&x.length===0&&(0,L.jsxs)(fA,{children:[`No integrations match “`,o.trim(),`”.`]}),(0,L.jsx)(`div`,{className:`space-y-1`,children:x.map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-raised-base-hover)]`,onClick:()=>a(i===e.id?null:e.id),children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(F,{className:`size-3.5 shrink-0 text-[var(--text-weaker)] transition-transform ${i===e.id?`rotate-90`:``}`}),(0,L.jsx)(`span`,{className:`truncate text-[13px] text-[var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-[var(--text-weaker)]`,children:e.id})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(v.get(e.id)??0)>0&&(0,L.jsxs)(`span`,{className:`text-[11px] text-[var(--text-weaker)]`,children:[`· `,v.get(e.id),` models`]}),e.connections.length>0?(0,L.jsxs)(db,{tone:`green`,children:[`connected`,e.connections.length>1?` · ${e.connections.length}`:``]}):(0,L.jsx)(db,{children:`not connected`}),e.connections.map((e,t)=>(0,L.jsx)(db,{tone:`blue`,children:e.type===`credential`?e.label:e.name},t))]})]}),i===e.id&&(0,L.jsxs)(`div`,{className:`mt-1 ml-4 space-y-1.5 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] p-2.5`,children:[e.connections.length===0&&(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:`No connections yet.`}),e.connections.length>0&&(0,L.jsx)(`div`,{className:`space-y-1`,children:e.connections.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,L.jsx)(db,{tone:e.type===`credential`?`blue`:`neutral`,children:e.type===`credential`?`credential`:`env`}),(0,L.jsx)(`span`,{className:`font-mono text-[var(--text-base)]`,children:e.type===`credential`?e.label:e.name}),e.type===`credential`&&(0,L.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-weaker)]`,children:e.id}),e.type===`credential`&&(0,L.jsx)(`button`,{type:`button`,className:`rounded border border-[var(--border-weak-base)] px-1.5 py-0.5 text-[10px] text-[var(--text-weak)] transition-colors hover:bg-[var(--surface-raised-base-hover)] hover:text-[var(--text-strong)]`,onClick:()=>{W.credentialActivate(e.id).then(r).catch(e=>ck({title:`Activate failed`,description:vA(e),variant:`destructive`}))},children:`activate`})]},t))}),(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5 pt-1`,children:e.methods.map((t,n)=>(0,L.jsx)(wA,{method:t,onKey:()=>d({integration:e,method:t}),onOauth:()=>p({integrationID:e.id,methodID:t.id}),onCommand:()=>h({integrationID:e.id,methodID:t.id})},n))}),f?.integrationID===e.id&&(0,L.jsx)(xA,{state:g,onCancel:()=>p(null),label:`OAuth`}),m?.integrationID===e.id&&(0,L.jsx)(xA,{state:_,onCancel:()=>h(null),label:`Command`})]})]},e.id))}),u&&(0,L.jsx)(SA,{integration:u.integration,method:u.method,open:!0,onClose:()=>d(null),onDone:r})]})}function wA({method:e,onKey:t,onOauth:n,onCommand:r}){let i=e.type===`env`?`env: ${e.names.join(`, `)}`:e.label??e.type;return e.type===`env`?(0,L.jsx)(H,{size:`xs`,variant:`outline`,disabled:!0,title:`Configured via environment variables`,children:i}):(0,L.jsx)(H,{size:`xs`,variant:`outline`,onClick:e.type===`key`?t:e.type===`oauth`?n:r,children:i})}var TA=`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-3 rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`;function EA(e){switch(e.status){case`connected`:return`green`;case`pending`:case`needs_auth`:return`amber`;case`failed`:return`red`;default:return`neutral`}}function DA(e){return e.status===`needs_auth`?`needs auth`:e.status}function OA(){let e=pA(()=>W.mcpList().then(e=>e.data)),t=pA(()=>W.mcpResource().then(e=>e.data)),[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(null),c=()=>{e.refresh(),t.refresh()},l=(e,t)=>{r(e),a(null),t().catch(e=>a(e instanceof Error?e.message:String(e))).finally(()=>{r(null),c()})};return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`MCP servers`,note:`Model Context Protocol endpoints`,onRefresh:c,loading:e.loading}),e.error&&(0,L.jsx)(mA,{message:e.error}),i&&(0,L.jsx)(mA,{message:i}),!e.error&&e.data&&e.data.length===0&&(0,L.jsx)(fA,{children:`No MCP servers configured.`}),(0,L.jsx)(`div`,{className:`space-y-1`,children:e.data?.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[13px] text-[var(--text-strong)]`,children:e.name}),(0,L.jsx)(db,{tone:EA(e.status),children:DA(e.status)}),e.status.status===`failed`&&(0,L.jsx)(`span`,{className:`max-w-40 truncate text-[10px] text-[var(--text-on-critical-base)]`,children:e.status.error})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.status.status!==`connected`&&(0,L.jsx)(H,{size:`xs`,variant:`outline`,disabled:n!==null,onClick:()=>l(`connect:${e.name}`,()=>W.mcpConnect(e.name)),children:n===`connect:${e.name}`?`Connecting…`:`Connect`}),e.status.status===`connected`&&(0,L.jsx)(H,{size:`xs`,variant:`outline`,disabled:n!==null,onClick:()=>l(`disconnect:${e.name}`,()=>W.mcpDisconnect(e.name)),children:n===`disconnect:${e.name}`?`Disconnecting…`:`Disconnect`}),(0,L.jsx)(H,{size:`xs`,variant:`ghost`,disabled:n!==null,className:`text-[var(--surface-critical-strong)]`,onClick:()=>s(e),children:`Remove`})]})]},e.name))})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Resources`,note:`Read-only catalog`,onRefresh:t.refresh,loading:t.loading}),t.error&&(0,L.jsx)(mA,{message:t.error}),!t.error&&t.data&&t.data.resources.length===0&&(0,L.jsx)(fA,{children:`No resources exposed.`}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[t.data?.resources.map(e=>(0,L.jsx)(kA,{resource:e},`${e.server}:${e.name}`)),t.data?.templates.map(e=>(0,L.jsx)(AA,{template:e},`${e.server}:${e.name}`))]})]}),o&&(0,L.jsx)(wm,{open:!0,onOpenChange:e=>!e&&s(null),children:(0,L.jsxs)(Em,{children:[(0,L.jsx)(Om,{className:`bg-black/60`}),(0,L.jsxs)(ss,{"data-slot":`dialog-content`,className:TA,children:[(0,L.jsxs)(Am,{children:[(0,L.jsx)(Mm,{children:`Remove MCP server`}),(0,L.jsxs)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:[`Remove`,` `,(0,L.jsx)(`span`,{className:`font-mono text-[var(--text-base)]`,children:o.name}),` `,`from the config? This affects the server-side configuration.`]})]}),(0,L.jsxs)(jm,{className:`rounded-b-lg`,children:[(0,L.jsx)(H,{variant:`ghost`,onClick:()=>s(null),children:`Cancel`}),(0,L.jsx)(H,{variant:`destructive`,onClick:()=>{l(`remove:${o.name}`,()=>W.mcpDelete(o.name)),s(null)},children:`Remove`})]}),(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsxs)(H,{variant:`ghost`,size:`icon-sm`,className:`absolute top-2 right-2`,children:[(0,L.jsx)(at,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})})]})}function kA({resource:e}){return(0,L.jsxs)(`div`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-2.5 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate text-xs text-[var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,children:e.server})]}),(0,L.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,L.jsx)(Ae,{className:`size-3 shrink-0 text-[var(--text-weaker)]`}),(0,L.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[var(--text-weak)]`,children:e.uri})]}),e.description&&(0,L.jsx)(`p`,{className:`mt-0.5 truncate text-[11px] text-[var(--text-weaker)]`,children:e.description})]})}function AA({template:e}){return(0,L.jsxs)(`div`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-2.5 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate text-xs text-[var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,children:e.server})]}),(0,L.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,L.jsx)(Ae,{className:`size-3 shrink-0 text-[var(--text-weaker)]`}),(0,L.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[var(--text-weak)]`,children:e.uriTemplate})]})]})}function jA(){let{data:e,error:t,loading:n,refresh:r}=pA(()=>W.pluginList().then(e=>e.data));return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Plugins`,note:`Read-only — installed plugins`,onRefresh:r,loading:n}),t&&(0,L.jsx)(mA,{message:t}),!t&&e&&e.length===0&&(0,L.jsx)(fA,{children:`No plugins installed.`}),(0,L.jsx)(`div`,{className:`space-y-1`,children:e?.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-1.5`,children:[(0,L.jsx)(We,{className:`size-3.5 shrink-0 text-[var(--text-weaker)]`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-[var(--text-strong)]`,children:e.id})]},e.id))})]})}function MA(){let{data:e,error:t,loading:n,refresh:r}=pA(()=>W.providerList().then(e=>e.data)),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(null),[c,l]=(0,w.useState)(null);return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Providers`,note:`Registered model providers`,onRefresh:r,loading:n}),t&&(0,L.jsx)(mA,{message:t}),!t&&e&&e.length===0&&(0,L.jsx)(fA,{children:`No providers registered.`}),(0,L.jsx)(`div`,{className:`space-y-1`,children:e?.map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-raised-base-hover)]`,onClick:()=>{if(i===e.id){a(null),s(null);return}a(e.id),s(null),l(null),W.providerGet(e.id).then(e=>s(e.data)).catch(e=>l(e instanceof Error?e.message:String(e)))},children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(F,{className:`size-3.5 shrink-0 text-[var(--text-weaker)] transition-transform ${i===e.id?`rotate-90`:``}`}),(0,L.jsx)(`span`,{className:`truncate text-[13px] text-[var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-[var(--text-weaker)]`,children:e.id})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e.disabled&&(0,L.jsx)(`span`,{className:`rounded border border-[var(--border-weak-base)] px-1.5 py-0.5 text-[10px] text-[var(--text-weaker)]`,children:`disabled`}),(0,L.jsx)(`span`,{className:`max-w-48 truncate font-mono text-[10px] text-[var(--text-weak)]`,children:e.package})]})]}),i===e.id&&(0,L.jsxs)(`div`,{className:`mt-1 ml-4 space-y-1.5 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] p-2.5`,children:[c&&(0,L.jsx)(mA,{message:c}),!o&&!c&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-[var(--text-weaker)]`,children:[(0,L.jsx)(Me,{className:`size-3.5 animate-spin`}),` loading…`]}),o&&(0,L.jsxs)(L.Fragment,{children:[o.integrationID&&(0,L.jsxs)(`p`,{className:`text-[11px] text-[var(--text-weak)]`,children:[`integration:`,` `,(0,L.jsx)(`span`,{className:`font-mono text-[var(--text-base)]`,children:o.integrationID})]}),o.settings&&Object.keys(o.settings).length>0&&(0,L.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-[var(--text-base)]`,children:JSON.stringify(o.settings,null,2)}),o.headers&&Object.keys(o.headers).length>0&&(0,L.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-[var(--text-base)]`,children:JSON.stringify(o.headers,null,2)}),o.body&&Object.keys(o.body).length>0&&(0,L.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-[var(--text-base)]`,children:JSON.stringify(o.body,null,2)}),(!o.settings||Object.keys(o.settings).length===0)&&(!o.headers||Object.keys(o.headers).length===0)&&(!o.body||Object.keys(o.body).length===0)&&(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:`No settings.`})]})]})]},e.id))})]})}var NA=`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-3 rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`;function PA(){let{data:e,error:t,loading:n,refresh:r}=pA(()=>W.serverInfo()),[i,a]=(0,w.useState)(!1),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)(null),[u,d]=(0,w.useState)(null);return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Server`,note:`Backend service`,onRefresh:r,loading:n}),t&&(0,L.jsx)(mA,{message:t}),!t&&e&&e.urls.length===0&&(0,L.jsx)(fA,{children:`No server endpoints.`}),(0,L.jsx)(`div`,{className:`space-y-1`,children:e?.urls.map(e=>(0,L.jsx)(`div`,{className:`flex items-center gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-1.5`,children:(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-[var(--text-strong)]`,children:e})},e))})]}),(0,L.jsxs)(`div`,{className:`space-y-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] p-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[13px] font-medium text-[var(--text-strong)]`,children:`Stop service`}),(0,L.jsx)(`p`,{className:`text-[11px] text-[var(--text-weaker)]`,children:`Request the managed opencode service to shut down. The web UI itself keeps running.`})]}),(0,L.jsxs)(H,{variant:`destructive`,onClick:()=>a(!0),disabled:o,children:[(0,L.jsx)(Ue,{}),o?`Stopping…`:`Stop`]})]}),c&&(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-base)]`,children:c}),u&&(0,L.jsx)(mA,{message:u})]}),i&&(0,L.jsx)(wm,{open:!0,onOpenChange:e=>!e&&a(!1),children:(0,L.jsxs)(Em,{children:[(0,L.jsx)(Om,{className:`bg-black/60`}),(0,L.jsxs)(ss,{"data-slot":`dialog-content`,className:NA,children:[(0,L.jsxs)(Am,{children:[(0,L.jsx)(Mm,{children:`Stop the service?`}),(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:`This stops the background opencode service. Running sessions will be interrupted.`})]}),(0,L.jsxs)(jm,{className:`rounded-b-lg`,children:[(0,L.jsx)(H,{variant:`ghost`,onClick:()=>a(!1),disabled:o,children:`Cancel`}),(0,L.jsx)(H,{variant:`destructive`,disabled:o,onClick:()=>{s(!0),l(null),d(null),W.serviceStop().then(e=>{l(e.accepted?`Stop accepted — the service is shutting down.`:`Stop not accepted — this instance is not the service owner.`)}).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>{s(!1),a(!1)})},children:`Stop service`})]}),(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsxs)(H,{variant:`ghost`,size:`icon-sm`,className:`absolute top-2 right-2`,children:[(0,L.jsx)(at,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})})]})}function FA(){let{data:e,error:t,loading:n,refresh:r}=pA(()=>W.websearchProviders().then(e=>e.data)),[i,a]=(0,w.useState)(``),[o,s]=(0,w.useState)(``),[c,l]=(0,w.useState)(null),[u,d]=(0,w.useState)(!1),[f,p]=(0,w.useState)(null),m=i||e?.[0]?.id||``;return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Websearch`,note:`Test search providers`,onRefresh:r,loading:n}),t&&(0,L.jsx)(mA,{message:t}),!t&&e&&e.length===0&&(0,L.jsx)(fA,{children:`No websearch providers available.`}),(0,L.jsx)(`div`,{className:`space-y-1`,children:e?.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate text-xs text-[var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-[var(--text-weaker)]`,children:e.id})]}),(0,L.jsx)(H,{size:`xs`,variant:i===e.id?`default`:`outline`,onClick:()=>a(i===e.id?``:e.id),children:i===e.id?`selected`:`select`})]},e.id))})]}),e&&e.length>0&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`input`,{className:`w-full rounded-md border border-[var(--border-weak-base)] bg-[var(--input-base)] px-2.5 py-1.5 text-sm text-[var(--text-strong)] outline-none transition-colors placeholder:text-[var(--text-weaker)] focus:border-[var(--border-selected)] focus:ring-1 focus:ring-[var(--border-selected)] h-8 flex-1`,placeholder:`Search query…`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o.trim()&&!u&&h()}}),(0,L.jsxs)(H,{variant:`default`,disabled:!o.trim()||u||!m,onClick:h,children:[(0,L.jsx)(qe,{}),u?`Searching…`:`Search`]})]}),!m&&(0,L.jsx)(`p`,{className:`text-[11px] text-[var(--text-weaker)]`,children:`Select a provider to search.`}),f&&(0,L.jsx)(mA,{message:f}),c&&(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsxs)(`p`,{className:`text-[11px] text-[var(--text-weaker)]`,children:[c.results.length,` results · provider `,c.providerID]}),c.results.length===0&&(0,L.jsx)(fA,{children:`No results.`}),c.results.map((e,t)=>(0,L.jsxs)(`div`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-2.5 py-2`,children:[(0,L.jsx)(`a`,{className:`block truncate text-xs text-[var(--text-interactive-base)] underline underline-offset-2`,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.title??e.url}),(0,L.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11px] text-[var(--text-weak)]`,children:e.content}),(0,L.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-[var(--text-weaker)]`,children:e.url})]},`${e.url}:${t}`))]})]}),(0,L.jsx)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-2.5 py-2`,children:(0,L.jsxs)(`p`,{className:`text-[11px] text-[var(--text-weaker)]`,children:[`Searching with`,` `,(0,L.jsx)(`span`,{className:`font-mono text-[var(--text-base)]`,children:e?.find(e=>e.id===m)?.name??m})]})})]});function h(){!o.trim()||u||(d(!0),p(null),W.websearch(o.trim(),m).then(e=>l(e.data)).catch(e=>p(e instanceof Error?e.message:String(e))).finally(()=>d(!1)))}}var IA=null;function LA(e){IA?.(e)}var RA=`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 grid-rows-[auto_minmax(0,1fr)] gap-3 rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-3xl h-[min(84vh,660px)] data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,zA=[{id:`providers`,label:`Providers`,icon:ue},{id:`integrations`,label:`Integrations`,icon:Ve},{id:`mcp`,label:`MCP`,icon:N},{id:`plugins`,label:`Plugins`,icon:We},{id:`extensions`,label:`Extensions`,icon:ne},{id:`config`,label:`Config`,icon:ve},{id:`websearch`,label:`Websearch`,icon:ke},{id:`server`,label:`Server`,icon:Ye}];function BA(){let[e,t]=(0,w.useState)(!1),[n,r]=(0,w.useState)(`providers`);return(0,w.useEffect)(()=>(IA=e=>{e&&r(e),t(!0)},()=>{IA=null}),[]),(0,L.jsx)(wm,{open:e,onOpenChange:e=>{t(e),e||r(`providers`)},children:(0,L.jsxs)(Em,{children:[(0,L.jsx)(Om,{className:`bg-black/60`}),(0,L.jsxs)(ss,{"data-slot":`dialog-content`,className:RA,children:[(0,L.jsxs)(Am,{className:`pr-8`,children:[(0,L.jsx)(Mm,{children:`Settings`}),(0,L.jsx)(`p`,{className:`text-xs text-[var(--text-weaker)]`,children:`Providers · integrations · MCP · plugins · extensions · config`})]}),(0,L.jsxs)(vO,{value:n,onValueChange:r,className:`flex min-h-0 flex-col`,children:[(0,L.jsx)(bO,{className:`mb-2 flex w-full flex-wrap justify-start gap-1 rounded-md bg-[var(--surface-base)] p-1`,children:zA.map(e=>(0,L.jsxs)(xO,{value:e.id,title:e.id===`integrations`?`Connect providers`:void 0,className:`h-7 gap-1.5 rounded px-2 text-xs`,children:[(0,L.jsx)(e.icon,{className:`size-3.5`}),e.label]},e.id))}),(0,L.jsxs)(Bk,{className:`min-h-0 flex-1 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] p-3`,children:[(0,L.jsx)(SO,{value:`providers`,children:(0,L.jsx)(MA,{})}),(0,L.jsx)(SO,{value:`integrations`,children:(0,L.jsx)(CA,{})}),(0,L.jsx)(SO,{value:`mcp`,children:(0,L.jsx)(OA,{})}),(0,L.jsx)(SO,{value:`plugins`,children:(0,L.jsx)(jA,{})}),(0,L.jsx)(SO,{value:`extensions`,children:(0,L.jsx)(HA,{})}),(0,L.jsx)(SO,{value:`config`,children:(0,L.jsx)(gA,{})}),(0,L.jsx)(SO,{value:`websearch`,children:(0,L.jsx)(FA,{})}),(0,L.jsx)(SO,{value:`server`,children:(0,L.jsx)(PA,{})})]})]}),(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsxs)(H,{variant:`ghost`,size:`icon-sm`,className:`absolute top-2 right-2`,children:[(0,L.jsx)(at,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})})}function VA(){let[e,t]=(0,w.useState)(0);return(0,w.useEffect)(()=>pt(()=>t(e=>e+1)),[]),e}function HA(){let e=VA(),[t,n]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=async()=>{if(!document.hidden)try{let e=await fetch(`/api/webui/extensions`);if(!e.ok)throw Error(String(e.status));let t=await e.json();n(t.data??[])}catch{n([])}};return e(),Bh({name:`extensions-runtime-list`,minInterval:1e4,run:()=>e()})},[]);let r=(0,w.useMemo)(()=>wt(`settings`),[e]),i=(0,w.useMemo)(()=>gt(),[e]);return(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Extensions`,note:`one folder per extension — presence installs, manifest paused disables`}),t===null?null:t.length===0?(0,L.jsx)(fA,{children:`No folder extensions installed.`}):(0,L.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`truncate font-mono text-xs text-[var(--text-strong)]`,children:e.id}),(0,L.jsx)(`p`,{className:`truncate text-[11px] text-[var(--text-weaker)]`,children:e.source??e.url??``})]}),e.disabled?(0,L.jsx)(`span`,{className:`shrink-0 rounded-sm border border-[var(--border-weak-base)] px-1.5 py-0.5 font-mono text-[10px] text-[var(--text-weaker)]`,children:`paused`}):(0,L.jsx)(`span`,{className:`shrink-0 rounded-sm border border-transparent bg-[var(--surface-success-base)] px-1.5 py-0.5 font-mono text-[10px] text-[var(--text-on-success-base)]`,children:`on`})]},e.id))}),(0,L.jsx)(`p`,{className:`mt-1 text-[11px] text-[var(--text-weaker)]`,children:'pause with `"disabled": true` in the folder\'s manifest.json; delete the folder to uninstall.'})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Registered in this page`}),i.length>0?(0,L.jsx)(`div`,{className:`mb-1 flex flex-wrap gap-1`,children:i.map(e=>(0,L.jsx)(`span`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2 py-1 font-mono text-xs text-[var(--text-strong)]`,children:e},e))}):(0,L.jsx)(fA,{children:`No registrations.`})]}),r.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dA,{title:`Extension settings`,note:`contributed by installed extensions`}),(0,L.jsx)(`div`,{className:`space-y-2`,children:r.map(t=>(0,L.jsx)(UA,{id:t.id,children:(0,L.jsxs)(`section`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] p-2.5`,children:[(0,L.jsx)(`h4`,{className:`text-xs font-medium text-[var(--text-strong)]`,children:t.item.title}),t.item.description&&(0,L.jsx)(`p`,{className:`mt-0.5 text-[11px] text-[var(--text-weaker)]`,children:t.item.description}),(0,L.jsx)(`div`,{className:`mt-2`,children:t.item.render()})]})},`${e}:${t.id}`))})]})]})}var UA=class extends w.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[extensions] settings section "${this.props.id}" crashed:`,e)}render(){return this.state.failed?(0,L.jsx)(`p`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-raised-base)] px-2.5 py-2 text-xs text-[var(--text-weaker)]`,children:`This extension's settings crashed.`}):this.props.children}},WA=3,GA=20,KA=2,qA=`webui:navigate`,JA=288,YA=240,XA=480,ZA=56,QA=0,$A=new Set,ej=!1;function tj(){ej||(ej=!0,pt(()=>{QA++;for(let e of $A)e()}))}function nj(e){return tj(),$A.add(e),()=>$A.delete(e)}function rj(){return QA}function ij(){return 0}function aj(){return(0,w.useSyncExternalStore)(nj,rj,ij)}function oj({sessionID:e,children:t}){let n=aj(),r=(0,w.useMemo)(()=>wt(`contextMenu.session`),[n]);return r.length===0?(0,L.jsx)(L.Fragment,{children:t}):(0,L.jsxs)(Fk,{children:[(0,L.jsx)(Ik,{asChild:!0,children:t}),(0,L.jsx)(Lk,{className:`min-w-36`,children:r.map(t=>(0,L.jsx)(Rk,{onSelect:()=>{try{t.item.run({sessionID:e})}catch(e){console.error(`[extensions] contextMenu "${t.id}" crashed:`,e)}},children:t.item.label},t.id))})]})}function sj(e){return/^\/home\/[^/]+$/.test(e)||/^\/Users\/[^/]+$/.test(e)}function cj(e){let t=new Map;for(let n of e){if(!n)continue;let e=n.replace(/\/+$/,``);sj(e)&&t.set(e,(t.get(e)??0)+1)}let n,r=0;for(let[e,i]of t)i>r&&(n=e,r=i);return n}function lj(e,t){if(!e)return`Other`;let n=e.replace(/\/+$/,``);return t&&sj(t)&&n===t?`~`:t&&sj(t)&&n.startsWith(t+`/`)?`~/`+n.slice(t.length+1):n}function uj(e,t){return!!e&&!!t&&e.replace(/\/+$/,``)===t.replace(/\/+$/,``)}function dj(){let e=J(e=>e.sessions),t=J(e=>e.sessionsCursor),n=J(e=>e.activeIDs),r=J(e=>e.currentSessionID),i=J(e=>e.connected),a=J(e=>e.pendingWorkspace),o=J(e=>e.running),s=J(e=>e.queued),[c,l]=(0,w.useState)(``),[u,d]=(0,w.useState)([]),[f,p]=(0,w.useState)(new Map),[m,h]=(0,w.useState)(!1),[g,_]=(0,w.useState)(new Set),v=(0,w.useRef)(null),[y,b]=(0,w.useState)({}),[x,S]=(0,w.useState)({}),[C,T]=(0,w.useState)(!1),[E,D]=(0,w.useState)(JA),[O,k]=(0,w.useState)(!1),[ee,A]=(0,w.useState)(!1),j=J(e=>e.uiSignals.explorer);(0,w.useEffect)(()=>{j&&A(!0)},[j]);let M=(0,w.useMemo)(()=>cj(e.map(e=>e.location?.directory)),[e]),te=e=>!!o[e]||!!s[e],ne=(0,w.useMemo)(()=>{let t=new Set;for(let n of e)n.parentID&&te(n.id)&&t.add(n.parentID);return t},[e,o,s]),N=c.trim(),P=N.toLowerCase();(0,w.useEffect)(()=>{if(N.length<2){d([]);return}let e=!1,t=setTimeout(()=>{W.listSessions({search:N,limit:100}).then(t=>{e||d(t.data.filter(e=>!e.parentID))}).catch(()=>{e||d([])})},250);return()=>{e=!0,clearTimeout(t)}},[N]),(0,w.useEffect)(()=>{if(N.length<2){p(new Map),h(!1);return}let t=!1;h(!0);let n=setTimeout(()=>{Mk(N,e,e=>{t||p(new Map(e))}).catch(()=>new Map).then(e=>{t||(p(new Map(e)),h(!1))})},250);return()=>{t=!0,clearTimeout(n)}},[N,e]),(0,w.useEffect)(()=>{if(!a)return;let e=e=>{v.current&&!v.current.contains(e.target)&&Ey(null)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[a]);let re=(0,w.useMemo)(()=>{let t=new Map,r=new Set;for(let n of e){if(n.parentID||P&&!(n.title??`Untitled session`).toLowerCase().includes(P)&&!lj(n.location?.directory,M).toLowerCase().includes(P)&&!(n.location?.directory??``).toLowerCase().includes(P))continue;r.add(n.id);let e=lj(n.location?.directory,M),i=t.get(e)??[];i.push(n),t.set(e,i)}for(let e of u){if(r.has(e.id))continue;r.add(e.id);let n=lj(e.location?.directory,M),i=t.get(n)??[];i.push(e),t.set(n,i)}let i=e=>!!(o[e]||n.includes(e)),a=[...t.entries()].map(([e,t])=>({name:e,list:[...t].sort((e,t)=>{let n=i(e.id),r=i(t.id);return n===r?t.time.updated-e.time.updated:Number(r)-Number(n)})}));return a.sort((e,n)=>{let r=t.get(e.name)?.some(e=>i(e.id))??!1,a=t.get(n.name)?.some(e=>i(e.id))??!1;return r===a?0:Number(a)-Number(r)}),a},[e,u,P,M,o,n]),ie=(0,w.useMemo)(()=>{if(!P||f.size===0)return[];let t=new Set(re.flatMap(e=>e.list.map(e=>e.id))),n=new Map(e.map(e=>[e.id,e])),r=[];for(let e of f.keys()){if(t.has(e))continue;let i=n.get(e);i&&r.push(i)}return r.sort((e,t)=>t.time.updated-e.time.updated).slice(0,GA)},[e,re,f,P]),F=re.reduce((e,t)=>e+t.list.length,0)+ie.length,I=e=>{_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},oe=(e,t)=>{Dy(e,t,N),mv(e)},se=t!=null,ce=e=>{let t=!x[e];S(n=>({...n,[e]:t})),t&&b(t=>({...t,[e]:!1}))},le=e=>{let t=e??null;Ey(t),r===`__draft__`&&Ty(t)},ue=e=>b(t=>({...t,[e]:!t[e]})),de=e=>{e.button===0&&(e.currentTarget.setPointerCapture(e.pointerId),k(!0))},fe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&D(Math.min(XA,Math.max(YA,e.clientX)))},pe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),k(!1)},me=()=>T(e=>!e);return(0,L.jsxs)(`aside`,{ref:v,"data-oc-sidebar":!0,className:`relative flex min-w-0 shrink-0 flex-col overflow-hidden border-r border-border bg-background ${O?`select-none`:``}`,style:{width:C?ZA:E},children:[(0,L.jsxs)(`div`,{className:`border-b border-border ${C?`flex flex-col items-center gap-2 px-2 py-2.5`:`flex items-center justify-between gap-2 px-3 py-2.5`}`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${i?`bg-[var(--surface-success-strong)]`:`bg-[var(--surface-warning-strong)]`}`}),C?(0,L.jsx)(`span`,{className:`font-mono text-xs font-semibold text-foreground`,title:`OpenCode`,children:`OC`}):(0,L.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:`OpenCode`})]}),C?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(pj,{collapsed:!0}),(0,L.jsx)(H,{variant:`ghost`,size:`icon`,onClick:me,title:`Expand sidebar`,children:(0,L.jsx)(Ie,{})})]}):(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,L.jsx)(H,{variant:`ghost`,size:`icon`,onClick:me,title:`Collapse sidebar`,children:(0,L.jsx)(Fe,{})}),(0,L.jsx)(pj,{})]})]}),C?(0,L.jsx)(mj,{groups:re,current:r,activeIDs:n,onExpand:me}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`border-b border-border p-2`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(qe,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(Pm,{id:`session-search`,value:c,onChange:e=>l(e.target.value),placeholder:`Search sessions`,className:`h-7 pl-7 ${Nk?`pr-8`:`pr-12`}`}),(0,L.jsx)(`kbd`,{"aria-hidden":!0,title:`Focus session search (${Nk?`Cmd+F`:`Ctrl+F`})`,className:`pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 rounded border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] px-1 py-px font-mono text-[9px] leading-[1.4] text-[var(--text-weaker)]`,children:Pk})]}),N.length>=KA&&(0,L.jsxs)(`p`,{className:`mt-1 px-1 text-[10px] text-[var(--text-weaker)]`,"aria-live":`polite`,children:[F,` matched`,m?` · searching messages…`:``]})]}),(0,L.jsx)(Bk,{className:`min-h-0 min-w-0 flex-1`,children:(0,L.jsxs)(`div`,{className:`w-full min-w-0 max-w-full p-2`,children:[ie.length>0&&(0,L.jsxs)(`section`,{className:`mb-4 w-full min-w-0 max-w-full last:mb-1`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex min-w-0 items-center gap-2 border-b border-[var(--border-weak-base)] px-2 py-1.5`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate text-[11px] font-medium tracking-wide text-[var(--text-weaker)] uppercase`,children:`Content matches`}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,children:ie.length})]}),ie.map(e=>{let t=f.get(e.id)??[],i=g.has(e.id);return(0,L.jsxs)(`div`,{className:`mb-1`,children:[(0,L.jsx)(Ct,{id:`sidebar.sessionRow`,sessionID:e.id,title:e.title??`Untitled session`,updated:e.time.updated,active:n.includes(e.id),selected:e.id===r,subagentsActive:ne.has(e.id),onSelect:()=>void mv(e.id)}),t.length>0&&(0,L.jsxs)(`div`,{className:`ml-2 border-l border-[var(--border-weak-base)] pl-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>I(e.id),className:`mb-1 flex w-full cursor-pointer items-center gap-1 text-[10px] text-[var(--text-weaker)] hover:text-[var(--text-weak)]`,children:[(0,L.jsx)(ae,{className:`size-3 shrink-0 transition-transform ${i?`-rotate-90`:``}`}),t.length,` `,t.length===1?`message`:`messages`,` match`,t.length===1?``:`es`]}),!i&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 pb-1`,children:[t.slice(0,5).map(t=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>oe(e.id,t.messageID),className:`cursor-pointer rounded-md bg-[var(--surface-inset-base)] px-2 py-1 text-left text-xs leading-relaxed text-[var(--text-weak)] hover:bg-[var(--surface-base-hover)] hover:text-[var(--text-strong)]`,title:`Open session and scroll to message`,children:(0,L.jsxs)(`span`,{className:`line-clamp-2`,children:[t.snippet.slice(0,t.matchStart),(0,L.jsx)(`mark`,{className:`rounded-sm bg-yellow-500/30 px-0.5 font-medium text-[var(--text-strong)]`,children:t.snippet.slice(t.matchStart,t.matchEnd)}),t.snippet.slice(t.matchEnd)]})},t.messageID)),t.length>5&&(0,L.jsxs)(`span`,{className:`px-2 text-[10px] text-[var(--text-weaker)]`,children:[`+`,t.length-5,` more in this session`]})]})]})]},e.id)})]}),re.length===0&&ie.length===0&&(0,L.jsx)(`p`,{className:`px-2.5 py-4 text-xs text-[var(--text-weak)]`,children:e.length===0?`No sessions yet.`:`No matches.`}),re.map(e=>{let t=!!x[e.name],i=!!y[e.name],o=t?[]:i?e.list:e.list.filter((e,t)=>t<WA||te(e.id)),s=e.list.length-o.length,c=e.list.find(e=>e.location?.directory)?.location?.directory??null,l=!!a&&!!c&&uj(a,c);return(0,L.jsxs)(`section`,{className:`mb-4 w-full min-w-0 max-w-full last:mb-1`,children:[(0,L.jsxs)(`div`,{onClick:()=>l?ce(e.name):le(c??void 0),"aria-pressed":l,title:l?`Collapse / expand workspace`:`New session here`,className:`mb-1 flex min-w-0 cursor-pointer select-none items-center gap-2 border-b px-2 py-1.5 text-[11px] font-medium uppercase tracking-wide transition-colors ${l?`ring-1 ring-inset ring-[var(--border-selected)] bg-[var(--surface-raised-base)]`:``} ${l?``:`border-[var(--border-weak-base)]`}`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate ${l?`text-[var(--text-weak)]`:`text-[var(--text-weaker)]`}`,children:e.name}),(0,L.jsx)(`button`,{type:`button`,"aria-expanded":!t,"aria-label":t?`Expand ${e.name}`:`Collapse ${e.name}`,onClick:t=>{t.stopPropagation(),ce(e.name)},title:t?`Expand workspace`:`Collapse workspace`,className:`ml-auto inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm p-0.5 hover:bg-[var(--surface-base-hover)] hover:text-[var(--text-weak)]`,children:(0,L.jsx)(ae,{className:`size-3 shrink-0 text-[var(--text-weaker)] transition-transform ${t?`-rotate-90`:``}`})}),l&&(0,L.jsx)(`span`,{className:`shrink-0 cursor-pointer text-[var(--text-weaker)] hover:text-foreground`,title:`New session here`,onClick:e=>{e.stopPropagation(),Ty(c)},children:(0,L.jsx)(He,{className:`size-3.5`})}),(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,children:e.list.length})]}),o.map(e=>{let t=n.includes(e.id),i=f.get(e.id)??[],a=g.has(e.id),o=i.length>0&&N.length>=KA;return(0,L.jsxs)(`div`,{className:`mb-0.5`,children:[(0,L.jsx)(Ct,{id:`sidebar.sessionRow`,sessionID:e.id,title:e.title??`Untitled session`,updated:e.time.updated,active:t,selected:e.id===r,subagentsActive:ne.has(e.id),onSelect:()=>void mv(e.id)}),o&&(0,L.jsxs)(`div`,{className:`ml-2 border-l border-[var(--border-weak-base)] pl-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>I(e.id),className:`mb-1 flex w-full cursor-pointer items-center gap-1 text-[10px] text-[var(--text-weaker)] hover:text-[var(--text-weak)]`,children:[(0,L.jsx)(ae,{className:`size-3 shrink-0 transition-transform ${a?`-rotate-90`:``}`}),i.length,` `,i.length===1?`message`:`messages`,` match`,i.length===1?``:`es`]}),!a&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 pb-1`,children:[i.slice(0,5).map(t=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>oe(e.id,t.messageID),className:`cursor-pointer rounded-md bg-[var(--surface-inset-base)] px-2 py-1 text-left text-xs leading-relaxed text-[var(--text-weak)] hover:bg-[var(--surface-base-hover)] hover:text-[var(--text-strong)]`,title:`Open session and scroll to message`,children:(0,L.jsxs)(`span`,{className:`line-clamp-2`,children:[t.snippet.slice(0,t.matchStart),(0,L.jsx)(`mark`,{className:`rounded-sm bg-yellow-500/30 px-0.5 font-medium text-[var(--text-strong)]`,children:t.snippet.slice(t.matchStart,t.matchEnd)}),t.snippet.slice(t.matchEnd)]})},t.messageID)),i.length>5&&(0,L.jsxs)(`span`,{className:`px-2 text-[10px] text-[var(--text-weaker)]`,children:[`+`,i.length-5,` more in this session`]})]})]})]},e.id)}),!t&&s>0&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>ue(e.name),className:`mt-1 w-full cursor-pointer rounded-md px-2.5 py-1.5 text-left text-xs text-[var(--text-weaker)] transition-colors hover:bg-[var(--surface-base-hover)] hover:text-[var(--text-weak)]`,children:i?`Show less`:`Show ${s} more…`})]},e.name)}),se&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>void Ag(),className:`w-full cursor-pointer rounded-md px-2.5 py-2 text-center text-xs text-[var(--text-weaker)] transition-colors hover:bg-[var(--surface-base-hover)] hover:text-[var(--text-weak)]`,children:`Load more sessions`})]})}),(0,L.jsx)(hj,{onFiles:()=>A(!0)})]}),C&&(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1 border-t border-border p-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>A(!0),className:`inline-flex cursor-pointer rounded-md p-1.5 text-[var(--text-weak)] hover:bg-[var(--surface-base-hover)] hover:text-foreground`,title:`Files`,children:(0,L.jsx)(Te,{className:`size-4`})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>LA(),className:`inline-flex cursor-pointer rounded-md p-1.5 text-[var(--text-weak)] hover:bg-[var(--surface-base-hover)] hover:text-foreground`,title:`Settings`,children:(0,L.jsx)(Xe,{className:`size-4`})})]}),(0,L.jsx)(lA,{open:ee,onOpenChange:A}),(0,L.jsx)(BA,{}),!C&&(0,L.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,"aria-valuemin":YA,"aria-valuemax":XA,"aria-valuenow":E,tabIndex:0,onPointerDown:de,onPointerMove:fe,onPointerUp:pe,onPointerCancel:pe,onDoubleClick:()=>D(JA),onKeyDown:e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=e.key===`ArrowRight`?16:-16;D(e=>Math.min(XA,Math.max(YA,e+t)))},className:`absolute top-0 right-0 z-20 h-full w-1 cursor-col-resize touch-none bg-transparent transition-colors hover:bg-[var(--border-hover)] focus:bg-[var(--border-selected)] focus:outline-none`})]})}function fj(){let[e,t]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=!1;return fetch(`/api/webui/config`).then(e=>e.ok?e.json():null).then(n=>{!e&&n?.version&&t(n.version)}).catch(()=>{}),()=>{e=!0}},[]),e?(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-[var(--text-weaker)]`,title:`webui v${e}`,children:[`v`,e]}):null}function pj({collapsed:e=!1}){return(0,L.jsx)(H,{asChild:!0,variant:`default`,size:e?`icon`:`sm`,children:(0,L.jsxs)(`a`,{href:mg,"aria-label":`New session`,title:e?`New session`:void 0,onClick:e=>{e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),Ty(null))},children:[(0,L.jsx)(He,{}),!e&&(0,L.jsx)(`span`,{className:`truncate`,children:`New session`})]})})}function mj({groups:e,current:t,activeIDs:n,onExpand:r}){return(0,L.jsx)(Bk,{className:`min-h-0 min-w-0 flex-1`,children:(0,L.jsx)(`div`,{className:`flex w-full min-w-0 flex-col items-center gap-3 p-2`,children:e.map(e=>(0,L.jsxs)(`section`,{className:`flex w-full flex-col items-center gap-1.5 border-b border-[var(--border-weak-base)] pb-3 last:border-b-0`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:r,title:`${e.name} (${e.list.length} sessions)`,className:`inline-flex size-8 cursor-pointer items-center justify-center rounded-md text-[var(--text-weak)] hover:bg-[var(--surface-base-hover)] hover:text-foreground`,children:(0,L.jsx)(Te,{className:`size-4`})}),e.list.slice(0,WA).map(e=>(0,L.jsx)(vj,{id:e.id,title:e.title??`Untitled session`,selected:e.id===t,active:n.includes(e.id),onSelect:()=>void mv(e.id)},e.id)),e.list.length>WA&&(0,L.jsxs)(`button`,{type:`button`,onClick:r,title:`Open workspace to see ${e.list.length-WA} more sessions`,className:`inline-flex size-8 cursor-pointer items-center justify-center rounded-md text-[10px] text-[var(--text-weaker)] hover:bg-[var(--surface-base-hover)] hover:text-foreground`,children:[`+`,e.list.length-WA]})]},e.name))})})}function hj({onFiles:e}){return(0,L.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1 border-t border-border px-3 py-2 text-xs text-[var(--text-weak)]`,children:(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:e,className:`inline-flex cursor-pointer items-center gap-1.5 hover:text-foreground`,children:[(0,L.jsx)(Te,{className:`size-3`}),`Files`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>LA(),className:`inline-flex cursor-pointer items-center gap-1.5 hover:text-foreground`,children:[(0,L.jsx)(Xe,{className:`size-3`}),`Settings`]}),(0,L.jsx)(fj,{}),(0,L.jsx)(_j,{})]})})}function gj(){let[e,t]=(0,w.useState)(0);return(0,w.useEffect)(()=>pt(()=>t(e=>e+1)),[]),e}function _j(){let e=gj(),t=(0,w.useMemo)(()=>wt(`pages`),[e]);return t.length===0?null:(0,L.jsx)(L.Fragment,{children:t.map(e=>(0,L.jsxs)(`a`,{href:`/ext/${e.id}`,title:e.item.description?`${e.item.title} — ${e.item.description}`:e.item.title,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),window.history.pushState({},``,`/ext/${e.id}`),window.dispatchEvent(new Event(qA)))},className:`inline-flex cursor-pointer items-center gap-1.5 hover:text-foreground`,children:[(0,L.jsx)(We,{className:`size-3`}),e.item.title]},e.id))})}function vj({id:e,title:t,selected:n,active:r,onSelect:i}){return(0,L.jsxs)(`a`,{href:hg(e),title:t,"aria-label":t,"aria-current":n?`page`:void 0,onClick:e=>yj(e,i),onMouseEnter:()=>Av(e),onFocus:()=>Av(e),className:`relative inline-flex size-8 items-center justify-center rounded-md text-xs font-medium transition-colors ${n?`bg-[var(--surface-raised-base)] text-foreground`:`text-[var(--text-weak)] hover:bg-[var(--surface-base-hover)] hover:text-foreground`}`,children:[(t.trim()[0]??`S`).toUpperCase(),r&&(0,L.jsx)(`span`,{className:`absolute right-0.5 bottom-0.5 size-1.5 rounded-full bg-[var(--surface-success-strong)]`})]})}function yj(e,t){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t())}function bj({id:e,title:t,updated:n,active:r,selected:i,subagentsActive:a,onSelect:o}){let[s,c]=(0,w.useState)(!1);return(0,L.jsx)(oj,{sessionID:e,children:(0,L.jsxs)(`div`,{className:`group relative mb-0.5 w-full min-w-0 max-w-full`,children:[(0,L.jsxs)(`a`,{href:hg(e),title:t,"aria-current":i?`page`:void 0,onClick:e=>yj(e,o),onMouseEnter:()=>Av(e),onFocus:()=>Av(e),className:`block w-full min-w-0 max-w-full overflow-hidden rounded-md px-2.5 py-2 pr-12 transition-colors ${i?`bg-[var(--surface-raised-base)]`:`hover:bg-[var(--surface-base-hover)]`}`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[a&&(0,L.jsx)(`span`,{title:`Subagents running`,"aria-label":`Subagents running`,className:`size-1.5 shrink-0 animate-pulse rounded-full bg-[var(--surface-success-strong)]`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium text-foreground`,children:t}),r&&(0,L.jsx)(ob,{className:`shrink-0 border-transparent bg-[var(--surface-success-base)] text-[var(--text-on-success-base)]`,children:`run`})]}),(0,L.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 max-w-full items-center gap-2 text-xs text-[var(--text-weak)]`,children:[(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-[var(--text-weaker)]`,children:e.slice(0,12)}),(0,L.jsx)(`span`,{className:`shrink-0`,children:fb(n)})]})]}),(0,L.jsx)(`div`,{className:`invisible absolute right-2 bottom-1.5 flex items-center gap-1 group-hover:visible group-focus-within:visible`,children:s?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,className:`cursor-pointer text-[var(--text-on-critical-strong)] hover:text-[var(--text-on-critical-base)]`,onClick:()=>{W.deleteSession(e).then(kg),i&&mv(null)},children:`yes`}),(0,L.jsx)(`button`,{type:`button`,className:`cursor-pointer text-[var(--text-weak)] hover:text-foreground`,onClick:()=>c(!1),children:`no`})]}):(0,L.jsx)(`button`,{type:`button`,title:`Delete session`,"aria-label":`Delete ${t}`,className:`cursor-pointer text-[var(--text-weaker)] hover:text-[var(--text-on-critical-base)]`,onClick:()=>c(!0),children:(0,L.jsx)(at,{className:`size-3.5`})})})]})})}_t({sidebar:e=>(0,L.jsx)(dj,{}),"sidebar.sessionRow":e=>(0,L.jsx)(bj,{id:e.sessionID,title:e.title,updated:e.updated,active:e.active,selected:e.selected,subagentsActive:e.subagentsActive,onSelect:e.onSelect})});function xj({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=Sj(Cj(r,i),t);if(!n)return w.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!w.isValidElement(n))return null;let o=n.props,s={...Sj(a,o),ref:Ej(a.ref,o.ref)};return w.cloneElement(n,s)}function Sj(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?Ej(i,r):Tj(n)&&typeof i==`function`&&typeof r==`function`?wj(r,i):r}}return t}function Cj(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function wj(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Tj(e){return/^on[A-Z]/.test(e)}function Ej(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var Dj=8,Oj=64,kj=0,Aj=.5,jj=180,Mj=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Nj={start:!1,end:!1},Pj={currentAnchorId:null,visibleMessageIds:[]};function Fj({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Nj;let i=qj({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Ij({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Pj;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Lj(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+Aj&&(u=e)}return l.length===0&&u===null?Pj:{currentAnchorId:u,visibleMessageIds:l}}function Lj(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Rj(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function zj(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function Bj(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Vj(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Hj({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Lj(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Uj({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Wj(t,i),o=t.getBoundingClientRect().height,s=Xj(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Wj(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function Gj(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Kj({content:e,scrollTop:t,spacer:n,viewport:r}){let i=qj({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function qj({content:e,spacer:t,viewport:n}){let r=Lj(e,t),i=Yj(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function Jj(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Yj(e){let t=window.getComputedStyle(e);return{end:Qj(t.paddingBlockEnd||t.paddingBottom),start:Qj(t.paddingBlockStart||t.paddingTop)}}function Xj(e){let t=e?.parentElement;return t?Yj(t):{end:0,start:0}}function Zj(e){if(!e)return 0;let t=window.getComputedStyle(e);return Qj(t.rowGap===`normal`?t.gap:t.rowGap)}function Qj(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function $j({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,defaultScrollPositionAppliedRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=w.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},jj))},[t]),S=w.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=w.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);if(Math.abs(a.scrollTop-o)<=Aj){a.scrollTop=o,t();return}i&&x(!0),a.scrollTo({top:o,behavior:r}),n()},[t,n,x]),T=w.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),E=w.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(Jj(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),D=w.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=Uj({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:l}),d=Kj({content:s,scrollTop:u,spacer:y.current,viewport:l});return S(d),m.current={element:e,viewportTop:Gj(e,l)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),O=w.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:D(e,{align:`start`},{keepPreviousPeek:!0})},[D]),k=w.useCallback((e,t)=>{let n=d.current.get(e);return n?(l.current=!0,D(n,t)?(p.current=null,!0):(p.current={messageId:e,options:t},!0)):u.current===0&&(p.current={messageId:e,options:t},l.current=!0,!0)},[D]);return{flushPendingScrollToMessage:w.useCallback(()=>{let e=p.current;if(!e)return!1;let t=d.current.get(e.messageId);return!t||!D(t,e.options)?!1:(p.current=null,l.current=!0,!0)},[D]),reanchorToAnchoredMessage:O,scrollToElement:D,scrollToEnd:E,scrollToMessage:k,scrollToStart:T}}function eM(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function tM(e,t){return eM(e,t)}function nM(){return eM(Pj,iM)}function rM(e,t){return e.start===t.start&&e.end===t.end}function iM(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function aM({autoScroll:e,scrollEdgeThreshold:t,scrollMargin:n,scrollPreviousItemPeek:r}){let i=w.useRef(e),a=w.useRef(!1),o=w.useRef(null),s=w.useRef(!1),c=w.useRef(t),l=w.useRef(0),u=w.useRef(null),d=w.useRef(0),f=w.useRef(e?`following-bottom`:`free-scrolling`),p=w.useRef(new Map),m=w.useRef(null),h=w.useRef(null),g=w.useRef(null),_=w.useRef(r),v=w.useRef(!0),y=w.useRef(null),b=w.useRef(n),x=w.useRef(null),S=w.useRef(0),C=w.useRef(0),T=w.useRef(null),E=w.useRef(null),D=w.useRef(null),O=w.useRef(null),k=w.useRef(null),ee=w.useRef(null),A=w.useRef(null),j=w.useRef(null),M=w.useRef(new Set),te=w.useRef(new WeakSet);return D.current===null&&(D.current=tM(Nj,rM)),j.current===null&&(j.current=nM()),i.current=e,c.current=t,b.current=n,_.current=r,{autoScrollRef:i,autoscrollingRef:a,autoscrollingTimeoutRef:O,streamingTurnRef:g,contentRef:o,defaultScrollPositionAppliedRef:s,firstItemRef:u,itemCountRef:l,lastScrollTopRef:d,messageElementsRef:p,modeRef:f,pendingScrollFrameRef:x,pendingScrollToMessageRef:m,prependRestoreRef:h,preserveScrollOnPrependRef:v,rootRef:y,scrollEdgeThresholdRef:c,scrollMarginRef:b,scrollPreviousItemPeekRef:_,spacerGapRef:S,spacerHeightRef:C,spacerRef:T,stateFrameRef:E,stateStore:D.current,viewportRef:k,visibilityFrameRef:ee,visibilityObserverRef:A,visibilityStore:j.current,visibleMessageIdsRef:M,handledScrollAnchorsRef:te}}function oM(e,t){return w.useCallback(n=>{e.current=n,n&&t()},[e,t])}function sM({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Dj,scrollPreviousItemPeek:r=Oj,scrollMargin:i=kj}){let a=aM({autoScroll:e,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,rootRef:x,scrollEdgeThresholdRef:S,scrollMarginRef:C,scrollPreviousItemPeekRef:T,spacerGapRef:E,spacerHeightRef:D,spacerRef:O,stateFrameRef:k,stateStore:ee,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:te,visibleMessageIdsRef:ne,handledScrollAnchorsRef:N}=a,P=w.useRef(t);P.current!==t&&(P.current=t,d.current=!1);let re=w.useCallback(e=>{let t=x.current,n=A.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ie=w.useCallback(e=>{let t=A.current?.scrollTop??0,n=t<m.current-Aj;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),ae=w.useCallback(()=>{let e=Fj({content:u.current,scrollEdgeThreshold:S.current,spacer:O.current,viewport:A.current});ie(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;re(t),ee.setSnapshot(t)},[ie,ee,re]),F=w.useCallback(()=>{k.current===null&&(k.current=window.requestAnimationFrame(()=>{k.current=null,ae()}))},[ae]),I=w.useCallback(()=>{te.hasListeners()&&j.current===null&&(j.current=window.requestAnimationFrame(()=>{j.current=null,te.hasListeners()&&te.setSnapshot(Ij({content:u.current,scrollMargin:C.current,scrollPreviousItemPeek:T.current,spacer:O.current,viewport:A.current,visibleMessageIds:ne.current}))}))},[te]),{flushPendingScrollToMessage:oe,reanchorToAnchoredMessage:se,scrollToElement:ce,scrollToEnd:le,scrollToMessage:ue,scrollToStart:de}=$j({refs:a,commitScrollState:ae,scheduleStateCommit:F,scheduleVisibilitySync:I}),fe=w.useCallback(()=>{let e=y.current,t=A.current;if(!e||!t||!e.element.isConnected)return!1;let n=Gj(e.element,t)-e.viewportTop;return Math.abs(n)<=Aj?!1:(t.scrollTop+=n,e.viewportTop=Gj(e.element,t),F(),I(),!0)},[F,I]),pe=w.useCallback(()=>{let e=u.current,t=A.current;if(!e||!t){y.current=null;return}let n=Hj({content:e,spacer:O.current,viewport:t});y.current=n?{element:n,viewportTop:Gj(n,t)}:null},[]),me=w.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,oe()&&pe()}))},[pe,oe]),he=w.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=A.current,r=t&&n?Vj(Lj(t,O.current)):null;if(!t||!n||!r)e=le({behavior:`auto`});else{let i=Wj(r,n);e=qj({content:t,spacer:O.current,viewport:n})-i<=n.clientHeight?le({behavior:`auto`}):ce(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?le({behavior:`auto`}):de({behavior:`auto`});return e?(d.current=!0,!0):!1},[t,ce,le,de]),ge=w.useCallback(()=>{let e=u.current;if(!e)return;let t=Lj(e,O.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(oe())return;if(n===0){if(he()||t.length>0&&s.current&&le({behavior:`auto`}))return;ae(),I();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0){fe();return}if(t.length>n){let e=Rj(t,n);if(e){if(s.current&&g.current===`following-bottom`&&Bj(t,n)){le({behavior:`auto`});return}ce(e,{align:`start`},{keepPreviousPeek:!0}),N.current.add(e);return}}if(t.length===n){let e=zj(t,N.current);if(e){ce(e,{align:`start`},{keepPreviousPeek:!0}),N.current.add(e);return}}g.current===`following-bottom`&&s.current?le({behavior:`auto`}):(ae(),I())})(),pe()},[he,pe,ae,oe,fe,I,ce,le]),_e=w.useCallback(()=>{if(g.current===`following-bottom`&&s.current){le({behavior:`auto`});return}let e=D.current;if(se()){s.current&&e>0&&D.current===0&&le({behavior:`auto`});return}F(),I()},[se,F,I,le]),ve=w.useCallback(()=>{let e=A.current;if(!(!e||!te.hasListeners())){if(typeof IntersectionObserver>`u`){I();return}M.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?ne.current.add(e):ne.current.delete(e))}I()},{root:e,rootMargin:`${-(C.current+T.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{M.current?.observe(e)}),I()}},[I,te]),ye=w.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),M.current?.disconnect(),M.current=null,ne.current.clear(),te.setSnapshot(Pj)},[te]),be=w.useCallback((e,t,n)=>{if(t){h.current.set(e,t),M.current?.observe(t),I(),v.current?.messageId===e&&me();return}n&&h.current.get(e)===n&&(h.current.delete(e),ne.current.delete(e),M.current?.unobserve(n),I())},[me,I]),xe=w.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),Se=w.useCallback(()=>re(ee.getSnapshot()),[ee,re]),Ce=oM(x,Se),we=oM(A,Se),Te=w.useCallback(e=>{u.current=e},[]),Ee=w.useCallback(e=>{O.current=e,E.current=Zj(e?.parentElement??null)},[]),De=w.useCallback(()=>{ae(),I(),pe()},[pe,ae,I]),Oe=w.useMemo(()=>({handleContentChange:ge,handleResize:_e,observeVisibility:ve,preserveScrollOnPrependRef:b,scrollToEnd:le,scrollToMessage:ue,scrollToStart:de,setContentElement:Te,setRootElement:Ce,setSpacerElement:Ee,setViewportElement:we,stateStore:ee,syncAfterScroll:De,unobserveVisibility:ye,userScrollIntent:xe,viewportRef:A,visibilityStore:te}),[ge,_e,ve,le,ue,de,Te,Ce,Ee,we,ee,De,ye,xe,te]);return w.useLayoutEffect(()=>{he()},[he]),w.useEffect(()=>()=>{k.current!==null&&(window.cancelAnimationFrame(k.current),k.current=null),j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),M.current?.disconnect(),M.current=null},[]),w.useLayoutEffect(()=>{if(e&&g.current===`following-bottom`&&p.current>0){le({behavior:`auto`});return}ae()},[e,ae,le]),{context:Oe,registerMessage:be}}function cM(e){let t=w.useRef(e);return t.current=e,t}var lM=w.createContext(null),uM=w.createContext(null);function dM(){let e=w.useContext(lM);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function fM(){let e=w.useContext(uM);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function pM(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=dM();return w.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function mM({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=sM({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,L.jsx)(lM.Provider,{value:o,children:(0,L.jsx)(uM.Provider,{value:s,children:t})})}function hM({children:e,...t}){let{setRootElement:n}=dM();return(0,L.jsx)(`div`,{ref:n,...t,children:e})}function gM({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=dM();f.current=o;let _=w.useCallback(e=>{p(e),Ej(s)?.(e)},[s,p]);function v(e){m(),r?.(e)}function y(e){h(),a?.(e)}function b(e){h(),i?.(e)}function x(e){Mj.has(e.key)&&h(),n?.(e)}return w.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,L.jsx)(`div`,{ref:_,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:x,onScroll:v,onTouchMove:b,onWheel:y,...u,children:t})}function _M({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=dM(),u=w.useRef(null),d=w.useCallback(e=>{u.current=e,c(e),Ej(n)?.(e)},[n,c]);return w.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),w.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,L.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,L.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function vM({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=fM(),a=w.useRef(null),o=w.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Ej(t)?.(n)},[e,t,i]);return(0,L.jsx)(`div`,{ref:o,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function yM({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=dM(),d=cM(r),f=w.useCallback(e=>u.subscribe(e),[u]),p=w.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=w.useSyncExternalStore(f,p,p),h=w.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return xj({defaultTagName:`button`,props:Sj({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,L.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var bM={Provider:mM,Root:hM,Viewport:gM,Content:_M,Item:vM,Button:yM};function xM(e){return(0,L.jsx)(bM.Provider,{...e})}function SM({className:e,...t}){return(0,L.jsx)(bM.Root,{"data-slot":`message-scroller`,className:B(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function CM({className:e,...t}){return(0,L.jsx)(bM.Viewport,{"data-slot":`message-scroller-viewport`,className:B(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content [overflow-anchor:none]`,e),...t})}function wM({className:e,...t}){return(0,L.jsx)(bM.Content,{"data-slot":`message-scroller-content`,className:B(`flex h-max min-h-full flex-col gap-6`,e),...t})}function TM({className:e,scrollAnchor:t=!1,...n}){return(0,L.jsx)(bM.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:B(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function EM({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,L.jsx)(bM.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:B(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,t),render:r??(0,L.jsx)(H,{variant:i,size:a}),...o,children:n??(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function DM(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var OM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AM={};function jM(e,t){return((t||AM).jsx?kM:OM).test(e)}var MM=/[ \t\n\f\r]/g;function NM(e){return typeof e==`object`?e.type===`text`&&PM(e.value):PM(e)}function PM(e){return e.replace(MM,``)===``}var FM=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};FM.prototype.normal={},FM.prototype.property={},FM.prototype.space=void 0;function IM(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new FM(n,r,t)}function LM(e){return e.toLowerCase()}var RM=class{constructor(e,t){this.attribute=t,this.property=e}};RM.prototype.attribute=``,RM.prototype.booleanish=!1,RM.prototype.boolean=!1,RM.prototype.commaOrSpaceSeparated=!1,RM.prototype.commaSeparated=!1,RM.prototype.defined=!1,RM.prototype.mustUseProperty=!1,RM.prototype.number=!1,RM.prototype.overloadedBoolean=!1,RM.prototype.property=``,RM.prototype.spaceSeparated=!1,RM.prototype.space=void 0;var zM=s({boolean:()=>VM,booleanish:()=>HM,commaOrSpaceSeparated:()=>KM,commaSeparated:()=>GM,number:()=>Q,overloadedBoolean:()=>UM,spaceSeparated:()=>WM}),BM=0,VM=qM(),HM=qM(),UM=qM(),Q=qM(),WM=qM(),GM=qM(),KM=qM();function qM(){return 2**++BM}var JM=Object.keys(zM),YM=class extends RM{constructor(e,t,n,r){let i=-1;if(super(e,t),XM(this,`space`,r),typeof n==`number`)for(;++i<JM.length;){let e=JM[i];XM(this,JM[i],(n&zM[e])===zM[e])}}};YM.prototype.defined=!0;function XM(e,t,n){n&&(e[t]=n)}function ZM(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new YM(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[LM(r)]=r,n[LM(a.attribute)]=r}return new FM(t,n,e.space)}var QM=ZM({properties:{ariaActiveDescendant:null,ariaAtomic:HM,ariaAutoComplete:null,ariaBusy:HM,ariaChecked:HM,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:WM,ariaCurrent:null,ariaDescribedBy:WM,ariaDetails:null,ariaDisabled:HM,ariaDropEffect:WM,ariaErrorMessage:null,ariaExpanded:HM,ariaFlowTo:WM,ariaGrabbed:HM,ariaHasPopup:null,ariaHidden:HM,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:WM,ariaLevel:Q,ariaLive:null,ariaModal:HM,ariaMultiLine:HM,ariaMultiSelectable:HM,ariaOrientation:null,ariaOwns:WM,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:HM,ariaReadOnly:HM,ariaRelevant:null,ariaRequired:HM,ariaRoleDescription:WM,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:HM,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function $M(e,t){return t in e?e[t]:t}function eN(e,t){return $M(e,t.toLowerCase())}var tN=ZM({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:GM,acceptCharset:WM,accessKey:WM,action:null,allow:null,allowFullScreen:VM,allowPaymentRequest:VM,allowUserMedia:VM,alpha:VM,alt:null,as:null,async:VM,autoCapitalize:null,autoComplete:WM,autoFocus:VM,autoPlay:VM,blocking:WM,capture:null,charSet:null,checked:VM,cite:null,className:WM,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:HM,controls:VM,controlsList:WM,coords:Q|GM,crossOrigin:null,data:null,dateTime:null,decoding:null,default:VM,defer:VM,dir:null,dirName:null,disabled:VM,download:UM,draggable:HM,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:VM,formTarget:null,headers:WM,height:Q,hidden:UM,high:Q,href:null,hrefLang:null,htmlFor:WM,httpEquiv:WM,id:null,imageSizes:null,imageSrcSet:null,inert:VM,inputMode:null,integrity:null,is:null,isMap:VM,itemId:null,itemProp:WM,itemRef:WM,itemScope:VM,itemType:WM,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:VM,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:VM,muted:VM,name:null,nonce:null,noModule:VM,noValidate:VM,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:VM,optimum:Q,pattern:null,ping:WM,placeholder:null,playsInline:VM,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:VM,referrerPolicy:null,rel:WM,required:VM,reversed:VM,rows:Q,rowSpan:Q,sandbox:WM,scope:null,scoped:VM,seamless:VM,selected:VM,shadowRootClonable:VM,shadowRootCustomElementRegistry:VM,shadowRootDelegatesFocus:VM,shadowRootMode:null,shadowRootSerializable:VM,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:HM,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:VM,useMap:null,value:HM,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:WM,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:VM,declare:VM,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:VM,noHref:VM,noShade:VM,noWrap:VM,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:HM,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:VM,disablePictureInPicture:VM,disableRemotePlayback:VM,exportParts:GM,part:WM,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:eN}),nN=ZM({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`,maskType:`mask-type`,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:KM,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:WM,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:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:VM,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,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:GM,g2:GM,glyphName:GM,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:KM,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,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:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:WM,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:KM,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:KM,rev:KM,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:KM,requiredFeatures:KM,requiredFonts:KM,requiredFormats:KM,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:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:KM,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:KM,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:KM,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:$M}),rN=ZM({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()}}),iN=ZM({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:eN}),aN=ZM({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),oN={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`},sN=/[A-Z]/g,cN=/-[a-z]/g,lN=/^data[-\w.:]+$/i;function uN(e,t){let n=LM(t),r=t,i=RM;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&lN.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(cN,fN);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!cN.test(e)){let n=e.replace(sN,dN);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=YM}return new i(r,t)}function dN(e){return`-`+e.toLowerCase()}function fN(e){return e.charAt(1).toUpperCase()}var pN=IM([QM,tN,rN,iN,aN],`html`),mN=IM([QM,nN,rN,iN,aN],`svg`);function hN(e){return e.join(` `).trim()}var gN=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
@@ -107,7 +107,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
107
107
|
`).length>10,p=l||!f,m=p?s:s.split(`
|
|
108
108
|
`).slice(0,10).join(`
|
|
109
109
|
`),h=i?.truncated;return(0,L.jsxs)(`div`,{className:`w-full max-w-[85%] overflow-hidden rounded-lg border border-[var(--border-weak-base)] bg-[var(--background-strong)]`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>u(e=>!e),title:l?`Click to collapse`:t,className:`flex w-full items-center justify-between gap-2 bg-[var(--surface-base)] px-2.5 py-1.5 text-left font-mono text-xs text-[var(--text-weak)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)]`,children:[(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 ${l?`whitespace-pre-wrap break-all`:`truncate`}`,children:[(0,L.jsx)(`span`,{className:`text-[var(--text-weaker)]`,children:`$`}),` `,t]}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[a&&typeof r==`number`&&(0,L.jsxs)(`span`,{className:`rounded-sm bg-[color-mix(in_oklch,var(--surface-critical-strong)_12%,transparent)] px-1 py-px text-[10px] text-[color:var(--surface-critical-strong)]`,children:[`exit `,r]}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 ${d}`,title:n===`timeout`?`Command timed out`:n===`killed`?`Command was killed`:void 0,children:[o&&(0,L.jsx)(lb,{className:`size-3`}),n]}),(0,L.jsx)(F,{className:`size-3 shrink-0 text-[var(--text-weaker)] transition-transform ${l?`rotate-90`:``}`})]})]}),o&&!c&&(0,L.jsx)(`div`,{className:`px-2.5 py-2 font-mono text-xs text-[var(--text-weaker)]`,children:`Running…`}),c&&(0,L.jsx)(`div`,{className:`border-t border-[var(--border-weak-base)]`,children:(0,L.jsxs)(`pre`,{onClick:()=>f&&u(e=>!e),className:`max-h-64 overflow-auto whitespace-pre-wrap px-2.5 py-2 font-mono text-xs leading-relaxed text-[var(--text-base)] ${f?`cursor-pointer hover:bg-[color:var(--surface-base-hover)]`:``}`,title:f?l?`Click to collapse`:`Click to expand full output`:void 0,children:[m,!p&&f&&`
|
|
110
|
-
…`,h&&(0,L.jsx)(`span`,{className:`text-[var(--text-weaker)]`,children:` (truncated)`})]})}),!c&&!o&&(0,L.jsx)(`div`,{className:`border-t border-[var(--border-weak-base)] px-2.5 py-2 font-mono text-xs text-[var(--text-weaker)]`,children:`(no output)`})]})}function rU({label:e,reason:t,summary:n,recent:r,running:i}){let[a,o]=(0,w.useState)(!1),s=!!n&&n.length>400,c=!s||a?n:n?`${n.slice(0,400).trim()}…`:void 0;return(0,L.jsxs)(`div`,{className:`w-full max-w-[85%] overflow-hidden rounded-lg border border-[var(--border-weak-base)] bg-[var(--background-strong)]`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 bg-[var(--surface-base)] px-2.5 py-1.5 text-left text-xs text-[var(--text-weak)] transition-colors hover:bg-[color:var(--surface-base-hover)]`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium text-[var(--text-strong)]`,children:[i&&(0,L.jsx)(lb,{className:`size-3`}),e,(0,L.jsx)(`span`,{className:`font-normal text-[var(--text-weaker)]`,children:t})]}),s&&(0,L.jsx)(F,{className:`ml-auto size-3 shrink-0 text-[var(--text-weaker)] transition-transform ${a?`rotate-90`:``}`})]}),c&&(0,L.jsxs)(`div`,{className:`border-t border-[var(--border-weak-base)] px-2.5 py-2 text-xs leading-relaxed text-[var(--text-base)] whitespace-pre-wrap`,children:[c,s&&!a&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`ml-1 cursor-pointer text-[var(--text-interactive-base)] hover:underline`,children:`show more`})]}),r&&(0,L.jsxs)(`div`,{className:`border-t border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] px-2.5 py-2`,children:[(0,L.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase tracking-wide text-[var(--text-weaker)]`,children:`Recent context`}),(0,L.jsx)(`pre`,{className:`max-h-32 overflow-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-[var(--text-weak)]`,children:r})]})]})}function iU({message:e,compact:t,showCopy:n,copyText:r}){let i=DH();return(0,L.jsx)(dU,{align:`left`,children:(0,L.jsxs)(`div`,{className:`group w-full space-y-2.5 text-sm leading-relaxed`,children:[!t&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-[var(--text-weak)]`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[var(--text-strong)]`,children:e.agent??`assistant`}),e.model&&(0,L.jsx)(`span`,{className:`font-mono text-[var(--text-weaker)]`,children:CH(e.model)}),i&&(0,L.jsx)(Ct,{id:`message.timestamp`,time:e.time.created}),e.cost!==void 0&&e.cost>0&&(0,L.jsx)(Ct,{id:`message.cost`,cost:e.cost}),e.tokens&&(0,L.jsx)(Ct,{id:`message.tokens`,tokens:e.tokens}),e.finish&&e.finish!==`stop`&&(0,L.jsx)(`span`,{className:`rounded-sm border border-[var(--border-weak-base)] px-1 py-px font-mono text-[10px] text-[var(--text-weak)]`,children:e.finish})]}),e.error&&(0,L.jsxs)(`div`,{className:`rounded-md border border-[color-mix(in_oklch,var(--surface-critical-strong)_40%,transparent)] bg-[var(--surface-critical-weak)] px-3 py-2 text-xs text-[var(--text-on-critical-strong)]`,children:[e.error.type,`: `,e.error.message]}),(()=>{let t={text:0,reasoning:0};return e.content.map((n,r)=>{let i=n.type===`tool`?`${e.id}:tool:${n.id}`:`${e.id}:${n.type}:${t[n.type]++}`;return(0,L.jsxs)(w.Fragment,{children:[(0,L.jsx)(aU,{stateKey:i,part:n}),(0,L.jsx)(RH,{message:e,part:n,partIndex:r})]},i)})})(),n&&r&&(0,L.jsx)(`div`,{className:`flex justify-start pt-1`,children:(0,L.jsx)(Ct,{id:`message.copyButton`,text:r,variant:`assistant`})})]})})}function aU({part:e,stateKey:t}){return e.type===`reasoning`?(0,L.jsx)(cU,{text:e.text,stateKey:t}):e.type===`tool`?(0,L.jsx)(Ct,{id:`tool.card`,part:e,stateKey:t}):!e.text||!e.text.trim()?null:(0,L.jsx)(uU,{text:e.text})}var oU=new Map;function sU(e,t){for(oU.delete(e),oU.set(e,t);oU.size>2e3;){let e=oU.keys().next().value;if(!e)break;oU.delete(e)}}function cU({text:e,stateKey:t}){let[n,r]=(0,w.useState)(ah().showReasoning),[i,a]=(0,w.useState)(()=>t?oU.get(t)??null:null);(0,w.useEffect)(()=>sh(()=>{r(ah().showReasoning),a(null)}),[]);let o=i??n;return e?(0,L.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)]`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{let e=!o;a(e),t&&sU(t,e)},className:`flex w-full cursor-pointer items-center gap-1.5 px-2.5 py-1.5 text-left text-xs text-[var(--text-weak)] transition-colors hover:text-[var(--text-base)]`,children:[(0,L.jsx)(F,{className:`size-3 shrink-0 transition-transform ${o?`rotate-90`:``}`}),(0,L.jsx)(P,{className:`size-3.5 shrink-0`}),`Reasoning`]}),o&&(0,L.jsx)(`div`,{className:`border-t border-[var(--border-weak-base)] px-2.5 py-2 text-xs leading-relaxed text-[var(--text-weak)] italic whitespace-pre-wrap`,children:e})]}):null}function lU(e){let t=e.trim();return/^data:image\/[a-z0-9.+-]+;/i.test(t)?t:dz(e)}function uU({text:e}){return(0,L.jsx)(`div`,{className:`text-sm leading-relaxed text-[var(--text-base)] [&_h1]:text-[var(--text-strong)] [&_h2]:text-[var(--text-strong)] [&_h3]:text-[var(--text-strong)] [&_strong]:text-[var(--text-strong)] [&_a]:text-[var(--text-interactive-base)] [&_a]:underline [&_a]:underline-offset-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_blockquote]:border-l-2 [&_blockquote]:border-[var(--border-weak-base)] [&_blockquote]:pl-3 [&_blockquote]:text-[var(--text-weak)] [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-[var(--border-weak-base)] [&_pre]:bg-[var(--surface-inset-base)] [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-xs [&_pre]:text-[var(--text-base)] [&_code]:rounded [&_code]:bg-[var(--surface-base)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em] [&_code]:text-[var(--text-base)] [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-inherit [&_img]:max-h-96 [&_img]:max-w-full [&_img]:rounded-md [&_img]:border [&_img]:border-[color:var(--border-weak-base)]`,children:(0,L.jsx)(sz,{remarkPlugins:[dH],urlTransform:lU,children:e})})}function dU({align:e=`left`,children:t}){return(0,L.jsxs)(`div`,{className:`mb-3.5 flex w-full ${e===`right`?`justify-end`:`justify-start`}`,children:[t,e===`right`&&(0,L.jsx)(`span`,{className:`sr-only`,children:`user message`})]})}_t({"message.timestamp":e=>(0,L.jsx)($H,{time:e.time}),"message.tokens":e=>(0,L.jsx)(tU,{tokens:e.tokens}),"message.cost":e=>(0,L.jsx)(eU,{cost:e.cost}),"message.copyButton":e=>e.variant===`assistant`?(0,L.jsx)(UH,{text:e.text}):(0,L.jsx)(HH,{text:e.text})});var fU={permission:`var(--surface-critical-strong)`,question:`var(--text-interactive-base)`,form:`var(--surface-warning-strong)`},pU={permission:{icon:Ze,label:`Permission required`,hint:`esc rejects`},question:{icon:oe,label:`Question`,hint:`esc rejects`},form:{icon:se,label:`Form`,hint:`esc cancels`}},mU=`overflow-x-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-base)]`;function hU({sessionID:e}){let t=J(t=>ng(t).find(t=>t.req.sessionID===e)),n=J(t=>ng(t).filter(t=>t.req.sessionID===e).length-1);return t?(0,L.jsx)(gU,{item:t,behind:n},`${t.kind}:${t.req.id}`):null}function gU({item:e,behind:t}){let n=pU[e.kind],r=n.icon,i=fU[e.kind],a=(0,w.useRef)(null),o=J(t=>rg(t,e.req.sessionID));(0,w.useEffect)(()=>{let t=t=>{t.key===`Escape`&&(document.querySelector(`[role="dialog"]`)||(t.preventDefault(),t.stopPropagation(),wy(e)))};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e]);let s=`${e.kind}:${e.req.id}`;return(0,w.useEffect)(()=>{G(`panel`,`show ${s}`);let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>{cancelAnimationFrame(e),G(`panel`,`hide ${s}`)}},[s]),(0,L.jsx)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2 pt-2`,children:(0,L.jsx)(`div`,{className:`mx-auto max-w-3xl`,children:(0,L.jsxs)(`div`,{ref:a,tabIndex:-1,className:`max-h-72 overflow-y-auto border-l-2 bg-[color:var(--background-strong)] px-4 py-2 font-mono text-sm outline-none`,style:{borderLeftColor:i},children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 font-medium ${e.kind===`permission`?`text-[color:var(--surface-critical-strong)]`:e.kind===`question`?`text-[color:var(--text-interactive-base)]`:`text-[color:var(--surface-warning-strong)]`}`,children:[(0,L.jsx)(r,{className:`size-3.5`,"aria-hidden":!0}),e.kind===`form`?e.req.title||`Form`:n.label]}),(0,L.jsx)(ob,{variant:`outline`,className:`max-w-52 truncate border-[var(--border-weak-base)] font-normal text-[var(--text-weak)]`,children:o})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>wy(e),title:n.hint,className:`flex shrink-0 cursor-pointer items-center gap-1 font-mono text-xs text-[color:var(--text-weaker)] hover:text-[color:var(--text-weak)]`,children:[n.hint.replace(`esc `,``),(0,L.jsx)(at,{className:`size-3.5`})]})]}),(0,L.jsxs)(`div`,{className:`pt-1.5`,children:[e.kind===`permission`&&(0,L.jsx)(_U,{req:e.req}),e.kind===`question`&&(0,L.jsx)(vU,{req:e.req}),e.kind===`form`&&(0,L.jsx)(yU,{req:e.req})]}),t>0&&(0,L.jsxs)(`p`,{className:`pt-1.5 text-xs text-[color:var(--text-weaker)]`,children:[`+`,t,` more queued in this session`]})]})})})}function _U({req:e}){return(0,L.jsxs)(L.Fragment,{children:[e.resources.length>0&&(0,L.jsx)(`div`,{className:`space-y-1 pb-1.5`,children:e.resources.map((e,t)=>(0,L.jsx)(`pre`,{className:mU,children:e},t))}),e.metadata&&Object.keys(e.metadata).length>0&&(0,L.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] p-2.5 mb-1.5 font-mono text-xs whitespace-pre-wrap text-[var(--text-weak)]`,children:JSON.stringify(e.metadata,null,2)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`font-sans text-xs text-[color:var(--text-weak)]`,children:e.source?(0,L.jsxs)(L.Fragment,{children:[`by tool `,(0,L.jsx)(`span`,{className:`font-mono`,children:e.source.id})]}):e.action||null}),(0,L.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,L.jsx)(H,{variant:`destructive`,size:`sm`,onClick:()=>void yy(e.id,`reject`),children:`Reject`}),(0,L.jsx)(H,{variant:`secondary`,size:`sm`,onClick:()=>void yy(e.id,`once`),children:`Once`}),(0,L.jsx)(H,{size:`sm`,onClick:()=>void yy(e.id,`always`),children:`Always allow`})]})]})]})}function vU({req:e}){let t=e.questions.length,[n,r]=(0,w.useState)(()=>e.questions.map(()=>[])),[i,a]=(0,w.useState)(()=>e.questions.map(()=>``)),[o,s]=(0,w.useState)(0),[c,l]=(0,w.useState)(0),[u,d]=(0,w.useState)(!1),f=e=>e.value??e.label,p=e.questions[Math.min(o,t-1)],m=o>=t-1,h=t=>{let r=e.questions[t];return n[t].length>0||r.custom&&i[t].trim().length>0},g=t=>e.questions.map((e,r)=>{let a=t&&t.qi===r?t.picked:n[r],o=i[r].trim();return e.multiple?[...a,...o?[o]:[]]:t?.explicit&&t.qi===r?a.slice(0,1):o?[o]:a.slice(0,1)}),_=t=>{d(!1),Sy(e.id,t).then(e=>{e||d(!0)})},v=(e,n)=>{e>=t?_(g(n)):(d(!1),s(e),l(t=>Math.max(t,e)))},y=(e,t,i)=>{if(d(!1),t.multiple){r(t=>t.map((t,n)=>n===e?t.includes(i)?t.filter(e=>e!==i):[...t,i]:t));return}let a=n[e].includes(i)?[]:[i];r(t=>t.map((t,n)=>n===e?a:t)),v(e+1,{qi:e,picked:a,explicit:!0})},b=(0,w.useRef)(()=>{});return b.current=()=>{m?e.questions.every((e,t)=>h(t))?_(g()):d(!1):h(o)&&v(o+1)},(0,w.useEffect)(()=>{let e=e=>{e.key!==`Enter`||!(e.ctrlKey||e.metaKey)||(e.preventDefault(),e.stopPropagation(),b.current())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,L.jsxs)(L.Fragment,{children:[t>1&&(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 pb-1.5`,children:e.questions.map((e,t)=>(0,L.jsxs)(`button`,{type:`button`,disabled:t>c,onClick:()=>t<=c&&(s(t),d(!1)),title:e.question||e.header,className:`max-w-40 cursor-pointer truncate rounded px-1.5 py-0.5 font-mono text-xs transition-colors ${t===o?`bg-[color:var(--surface-inset-strong,var(--surface-inset-base))] text-[color:var(--text-strong)] outline outline-1 outline-[var(--border-selected,var(--border-weak-base))]`:t<c||t===c&&t!==o?`text-[color:var(--text-weak)] hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-strong)]`:`cursor-default text-[color:var(--text-weaker)] opacity-60`}`,children:[h(t)&&t!==o?`✓ `:``,e.header||`Q${t+1}`]},t))}),e.tool&&(0,L.jsxs)(`p`,{className:`pb-1.5 font-sans text-xs text-[color:var(--text-weak)]`,children:[`by tool `,(0,L.jsx)(`span`,{className:`font-mono`,children:e.tool.id})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[p.header&&t>1&&(0,L.jsxs)(`span`,{className:`shrink-0 text-xs text-[color:var(--text-weaker)]`,children:[o+1,`/`,t]}),(0,L.jsx)(`span`,{className:`min-w-0 break-words text-sm text-[color:var(--text-strong)]`,children:p.question})]}),p.options.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1 pt-1`,children:p.options.map(e=>{let t=f(e),r=n[o].includes(t);return(0,L.jsx)(H,{type:`button`,variant:r?`default`:`secondary`,size:`xs`,title:e.description,onClick:()=>y(o,p,t),children:e.label},t)})}),p.custom&&(0,L.jsx)(Fm,{value:i[o],onChange:e=>{d(!1),a(t=>t.map((t,n)=>n===o?e.target.value:t))},placeholder:`Custom answer…`,className:`mt-1 min-h-12 font-mono text-xs`})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pt-1.5`,children:[u&&(0,L.jsx)(`p`,{className:`mr-auto font-sans text-xs text-[color:var(--surface-critical-strong)]`,children:`answer rejected — request still open, adjust and retry`}),t>1&&o>0&&(0,L.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>s(o-1),children:`Back`}),(0,L.jsx)(H,{variant:`destructive`,size:`sm`,onClick:()=>void wy(x()),children:`Reject`}),m?(0,L.jsx)(H,{size:`sm`,disabled:!e.questions.every((e,t)=>h(t)),onClick:()=>_(g()),children:`Reply`}):(0,L.jsx)(H,{size:`sm`,disabled:!h(o),onClick:()=>v(o+1),children:`Next`})]})]});function x(){return{kind:`question`,req:e}}}function yU({req:e}){let t=e.fields,[n,r]=(0,w.useState)(()=>{let e={};for(let n of t)n.type!==`external`&&(n.default===void 0?n.type===`multiselect`?e[n.key]=[]:n.type===`boolean`?e[n.key]=!1:e[n.key]=``:e[n.key]=n.default);return e}),[i,a]=(0,w.useState)(!1),o=t.filter(e=>e.type!==`external`&&e.required===!0).every(e=>{let t=n[e.key];return e.type===`boolean`?!0:Array.isArray(t)?t.length>0:typeof t==`number`||typeof t==`string`&&t.trim().length>0});function s(e,t){r(n=>({...n,[e]:t}))}return(0,L.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),!(!o||i)&&(a(!0),by(e.id,n).finally(()=>a(!1)))},children:[t.map(e=>(0,L.jsx)(`div`,{className:`pb-1.5`,children:(0,L.jsx)(bU,{field:e,value:n[e.key],onChange:t=>s(e.key,t)})},e.key)),(0,L.jsxs)(`div`,{className:`flex justify-end gap-1.5 pt-1`,children:[(0,L.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>wy({kind:`form`,req:e}),children:`Cancel`}),(0,L.jsx)(H,{type:`submit`,size:`sm`,disabled:!o||i,children:`Submit`})]})]})}function bU({field:e,value:t,onChange:n}){let r=`w-full rounded-md border border-[var(--border-weak-base)] bg-[var(--input-base)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-strong)] outline-none transition-colors placeholder:text-[var(--text-weaker)] focus:border-[var(--border-selected)] focus:ring-1 focus:ring-[var(--border-selected)]`,i=(0,L.jsxs)(`label`,{className:`mb-1 block font-sans text-xs font-medium text-[var(--text-base)]`,children:[e.title??e.key,e.type!==`external`&&e.required&&(0,L.jsx)(`span`,{className:`text-[var(--surface-critical-strong)]`,children:` *`})]});switch(e.type){case`string`:return(0,L.jsxs)(`div`,{children:[i,e.options&&e.options.length>0?(0,L.jsxs)(`select`,{className:r,value:t??``,onChange:e=>n(e.target.value),children:[(0,L.jsx)(`option`,{value:``,children:`—`}),e.options.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))]}):(0,L.jsx)(`input`,{className:r,placeholder:e.placeholder,value:t??``,onChange:e=>n(e.target.value)})]});case`number`:case`integer`:return(0,L.jsxs)(`div`,{children:[i,(0,L.jsx)(`input`,{type:`number`,className:r,value:t??``,onChange:e=>n(e.target.value===``?0:Number(e.target.value))})]});case`boolean`:return(0,L.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 font-sans text-sm text-[var(--text-base)]`,children:[(0,L.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--text-interactive-base)]`,checked:!!t,onChange:e=>n(e.target.checked)}),e.title??e.key]});case`multiselect`:return(0,L.jsxs)(`div`,{children:[i,(0,L.jsx)(`div`,{className:`space-y-1`,children:e.options.map(e=>{let r=(t??[]).includes(e.value);return(0,L.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 font-sans text-sm text-[var(--text-base)]`,children:[(0,L.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--text-interactive-base)]`,checked:r,onChange:r=>{let i=t??[];n(r.target.checked?[...i,e.value]:i.filter(t=>t!==e.value))}}),e.label]},e.value)})})]});case`external`:return(0,L.jsxs)(`div`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-3 py-2 font-sans text-xs text-[var(--text-base)]`,children:[e.title??`External input`,`:`,` `,(0,L.jsx)(`a`,{className:`text-[var(--text-interactive-base)] underline`,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url})]});default:return null}}var xU=`flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)] focus-visible:text-[var(--text-strong)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--border-selected)]`,SU=[{delivery:`steer`,caption:`⚡ steer · sent at the next step`,accent:`border-l-[color:var(--surface-warning-strong)]`},{delivery:`queue`,caption:`⏳ queue · sent after this turn`,accent:`border-l-[color:var(--text-interactive-base)]`}];function CU({sessionID:e}){let t=J(t=>t.pending[e]),n=J(t=>t.running[e]??!1);if(!t||t.length===0)return null;let r=t.filter(e=>(e.delivery??`steer`)===`steer`),i=t.filter(e=>e.delivery===`queue`);return r.length===0&&i.length===0?null:(0,L.jsx)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-1 pt-1`,"data-oc-queue-strip":!0,children:(0,L.jsx)(`div`,{className:`mx-auto max-w-3xl overflow-hidden rounded-md border border-[color-mix(in_oklch,var(--border-base)_55%,transparent)] bg-[color-mix(in_oklch,var(--surface-base)_40%,transparent)]`,children:(0,L.jsx)(`div`,{className:`divide-y divide-[color:var(--border-weak-base)]`,children:SU.map(t=>{let a=t.delivery===`steer`?r:i;return a.length===0?null:(0,L.jsxs)(`div`,{className:`${t.accent} border-l-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-2 pb-0.5 pt-1`,children:[(0,L.jsxs)(`span`,{className:`truncate font-mono text-[10px] tracking-wide uppercase text-[var(--text-weaker)]`,children:[t.caption,a.length>1?` (${a.length})`:``]}),t.delivery===`steer`&&n&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void ry(e),title:`Interrupt the current step and deliver all steered messages now (queued ones stay parked)`,className:`${xU} ml-auto h-5 w-auto gap-1 px-1.5 font-mono text-[10px] normal-case`,children:[(0,L.jsx)(Be,{className:`size-3`}),`interrupt & send now`]})]}),a.map(t=>(0,L.jsx)(wU,{sessionID:e,row:t},t.key))]},t.delivery)})})})})}function wU({sessionID:e,row:t}){let n=t.state===`sending`,r=t.delivery===`queue`;return(0,L.jsxs)(`div`,{className:`group flex items-center gap-2 py-1 pr-1 pl-2.5 text-xs text-[var(--text-base)]`,children:[n?(0,L.jsx)(Me,{className:`size-3 shrink-0 animate-spin text-[var(--text-weaker)]`}):(0,L.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full ${r?`bg-[color:var(--text-interactive-base)]`:`bg-[color:var(--surface-warning-strong)]`}`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:t.text,children:t.text}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>ty(e,t.key,r?`steer`:`queue`),title:r?`send at next step`:`move to queue`,className:`${xU} ${n?`pointer-events-none opacity-40`:``}`,children:r?(0,L.jsx)(M,{className:`size-3.5`}):(0,L.jsx)(ee,{className:`size-3.5`})}),r&&!n&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>ny(e,t.key),title:`send now`,className:xU,children:(0,L.jsx)(Be,{className:`size-3.5`})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>ey(e,t.key),title:n?`cancel send`:`cancel`,className:xU,children:(0,L.jsx)(rt,{className:`size-3.5`})})]})]})}function TU(e){requestAnimationFrame(()=>{let t=document.getElementById(`composer-input-${e}`);if(!(t instanceof HTMLTextAreaElement))return;t.focus();let n=t.value.length;t.setSelectionRange(n,n)})}function EU({sessionID:e,paneKey:t=`main`}){let n=J(e=>e.sessions),r=J(e=>e.running),i=J(e=>e.activeIDs),a=J(e=>e.runsPanelOpen),o=J(e=>e.runsSelection),s=J(t=>t.sessions.find(t=>t.id===e)??t.sessionDetails[e]),c=J(t=>t.sessions.find(t=>t.id===e)?.location?.directory),[l,u]=(0,w.useState)(`subagents`),[d,f]=(0,w.useState)(null),[p,m]=(0,w.useState)(0),[h,g]=(0,w.useState)([]),_=(0,w.useRef)(null),v=cv(n,s?.parentID??e),y=e=>r[e]||i.includes(e),b=[...v].sort((e,t)=>Number(y(t.id))-Number(y(e.id))),x=Math.max(0,b.findIndex(e=>e.id===d));(0,w.useEffect)(()=>{if(!a)return;let t=b.length>0?`subagents`:`shells`,n=b.some(t=>t.id===e)?e:b[0]?.id??null,r=0,i=o,s=i?.section===`subagents`?i.subID:null;s&&b.some(e=>e.id===s)?(t=`subagents`,n=s):i?.section===`shells`&&(t=`shells`,r=Math.max(0,i.shellIndex)),u(t),f(n),m(r),document.activeElement?.blur?.(),requestAnimationFrame(()=>_.current?.focus({preventScroll:!0}))},[a]),(0,w.useEffect)(()=>{a&&av({section:l,subID:d,shellIndex:p})},[a,l,d,p]),(0,w.useEffect)(()=>{l===`shells`&&h.length>0&&p>h.length-1&&m(h.length-1)},[l,p,h.length]);let S=(0,w.useCallback)(async()=>{try{let e=c?{directory:c}:void 0,[t,n]=await Promise.all([W.shellList(e),W.ptyList(e)]);g([...t.data.map(e=>({id:e.id,label:e.command||e.shell,running:e.status===`running`,kind:`shell`})),...n.data.map(e=>({id:e.id,label:e.title||e.command,running:e.status===`running`,kind:`pty`}))])}catch{}},[c]);(0,w.useEffect)(()=>{if(!a){g([]);return}return S(),Bh({name:`runs-panel-shells`,minInterval:5e3,run:()=>S()})},[a,S]);let C=(0,w.useCallback)(async e=>{let t=c?{directory:c}:void 0;try{e.kind===`shell`?await W.shellDelete(e.id,t):await W.ptyDelete(e.id,t)}catch{}S()},[c,S]);(0,w.useEffect)(()=>{if(!a)return;let e=e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`k`){if(e.preventDefault(),e.stopPropagation(),l===`shells`){let e=h[p];e?.running&&C(e)}return}if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`,`Escape`].includes(e.key)){if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){iv(),TU(t);return}if(e.key===`ArrowLeft`||e.key===`ArrowRight`){u(e=>e===`subagents`?`shells`:`subagents`);return}if(e.key===`ArrowUp`){(l===`subagents`?b.length===0||x===0:h.length===0||p===0)?(iv(),TU(t)):l===`subagents`?f(b[x-1].id):m(e=>e-1);return}if(e.key===`ArrowDown`){l===`subagents`?b.length>0&&f(b[(x+1)%b.length].id):h.length>0&&m(e=>(e+1)%h.length);return}l===`subagents`&&b[x]?(iv(),mv(b[x].id)):l===`shells`&&h[p]&&(iv(),tv())}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[a,l,x,p,b,h,C]);let T=(0,w.useRef)(e);(0,w.useEffect)(()=>{T.current!==e&&(T.current=e,iv())},[e]);let E=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(!a)return;function e(e){let t=e.target;t instanceof Element&&(E.current?.contains(t)||t.closest(`[data-runs-panel-trigger]`)||iv())}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),a?(0,L.jsx)(`div`,{ref:E,className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2 pt-2`,"data-oc-runs-panel":!0,children:(0,L.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,L.jsxs)(`div`,{ref:_,tabIndex:-1,className:`min-h-44 max-h-64 overflow-y-auto border-l-2 border-[color:var(--border-strong)] bg-[color:var(--background-strong)] px-4 py-2 font-mono text-sm outline-none`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,L.jsx)(DU,{active:l===`subagents`,onClick:()=>u(`subagents`),children:`Subagents`}),(0,L.jsx)(DU,{active:l===`shells`,onClick:()=>u(`shells`),children:`Shell`})]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{iv(),TU(t)},className:`cursor-pointer font-mono text-xs text-[color:var(--text-weaker)] hover:text-[color:var(--text-weak)]`,children:`esc`})]}),l===`subagents`&&(b.length===0?(0,L.jsx)(`p`,{className:`pt-2 text-[color:var(--text-weak)]`,children:`No active subagents`}):b.map((t,n)=>(0,L.jsx)(OU,{selected:n===x,current:t.id===e,running:y(t.id),label:t.agent&&t.title?`${t.agent} — ${t.title}`:t.title||t.agent||t.id,onClick:()=>{iv(),mv(t.id)}},t.id))),l===`shells`&&(h.length===0?(0,L.jsx)(`p`,{className:`pt-2 text-[color:var(--text-weak)]`,children:`No shell commands`}):h.map((e,t)=>(0,L.jsx)(OU,{selected:t===p,running:e.running,label:e.label,onKill:e.running?()=>void C(e):void 0,onClick:()=>{iv(),tv()}},e.id)))]}),(0,L.jsxs)(`p`,{className:`mt-1 pl-1 font-mono text-[10px] text-[color:var(--text-weaker)]`,children:[`tabs `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`←/→`}),(l===`subagents`?b.length:h.length)>0&&(0,L.jsxs)(L.Fragment,{children:[` · `,`↑↓ select`,` · `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`↵`}),` open`]}),l===`shells`&&h.some(e=>e.running)&&(0,L.jsxs)(L.Fragment,{children:[` · `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`ctrl+k`}),` kill`]}),` · `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`type`}),` → composer`]})]})}):null}function DU({active:e,onClick:t,children:n}){return(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer bg-transparent p-0 font-mono text-sm transition-colors ${e?`font-bold text-[color:var(--text-strong)]`:`font-normal text-[color:var(--text-weaker)] hover:text-[color:var(--text-weak)]`}`,children:n})}function OU({selected:e,current:t,running:n,label:r,hint:i,onClick:a,onKill:o}){let s=(0,w.useRef)(null);return(0,w.useEffect)(()=>{e&&s.current?.scrollIntoView({block:`nearest`})},[e]),(0,L.jsxs)(`div`,{className:`flex w-full items-center gap-1`,children:[(0,L.jsxs)(`button`,{ref:s,type:`button`,onClick:a,title:t?`Currently open session`:void 0,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-sm px-1 py-1 text-left font-mono text-xs transition-colors ${e?`bg-[color:var(--surface-raised-base-active)] text-[color:var(--text-strong)]`:`text-[color:var(--text-base)] hover:bg-[color:var(--surface-base-hover)]`}`,children:[(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${n?`bg-emerald-500`:`bg-[color:var(--text-weaker)]`}`}),t&&(0,L.jsx)(F,{className:`size-3 shrink-0 text-[color:var(--text-weak)]`,"aria-label":`current session`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate ${t&&!e?`font-medium text-[color:var(--text-strong)]`:``}`,children:r}),i&&(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[color:var(--text-weaker)]`,children:i})]}),o!==void 0&&(0,L.jsx)(`button`,{type:`button`,"aria-label":`Kill`,title:`Kill`,onClick:e=>{e.stopPropagation(),o()},className:`shrink-0 cursor-pointer rounded-sm p-0.5 text-[color:var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--surface-critical-strong)]`,children:(0,L.jsx)(et,{className:`size-3`})})]})}var kU=1e4,AU=250,jU={retry:{icon:`⚠`,label:`Retry`,iconClass:`text-[color:var(--surface-warning-strong)]`,labelClass:`font-medium text-[color:var(--surface-warning-strong)]`,rowClass:`border-l-[color:var(--surface-warning-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-warning-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-warning-strong)_8%,transparent)]`,barClass:`bg-[color:var(--surface-warning-strong)]`},error:{icon:`⚠`,label:`Error`,iconClass:`text-[color:var(--surface-critical-strong)]`,labelClass:`font-medium text-[color:var(--surface-critical-strong)]`,rowClass:`border-l-[color:var(--surface-critical-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-critical-strong)_8%,transparent)]`,barClass:`bg-[color:var(--surface-critical-strong)]`},failed:{icon:`⚠`,label:`Failed`,iconClass:`text-[color:var(--surface-critical-strong)]`,labelClass:`font-medium text-[color:var(--surface-critical-strong)]`,rowClass:`border-l-[color:var(--surface-critical-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-critical-strong)_8%,transparent)]`,barClass:`bg-[color:var(--surface-critical-strong)]`},interrupted:{icon:`⏹`,label:`Interrupted`,iconClass:`text-[var(--text-weaker)]`,labelClass:`font-medium text-[var(--text-weaker)]`,rowClass:`border-l-[color:var(--text-weaker)] border-y border-r border-[color-mix(in_oklch,var(--text-weaker)_25%,transparent)] bg-transparent`,barClass:`bg-[color:var(--text-weaker)]`}};function MU(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<10)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function NU(e){let[,t]=(0,w.useState)(0);(0,w.useEffect)(()=>{if(e)return Bh({name:`run-notices-age`,minInterval:15e3,run:()=>t(e=>e+1)})},[e])}function PU(e,t){let[n,r]=(0,w.useState)({}),i=(0,w.useRef)({}),a=t?t.map(e=>e.id).join(`
|
|
110
|
+
…`,h&&(0,L.jsx)(`span`,{className:`text-[var(--text-weaker)]`,children:` (truncated)`})]})}),!c&&!o&&(0,L.jsx)(`div`,{className:`border-t border-[var(--border-weak-base)] px-2.5 py-2 font-mono text-xs text-[var(--text-weaker)]`,children:`(no output)`})]})}function rU({label:e,reason:t,summary:n,recent:r,running:i}){let[a,o]=(0,w.useState)(!1),s=!!n&&n.length>400,c=!s||a?n:n?`${n.slice(0,400).trim()}…`:void 0;return(0,L.jsxs)(`div`,{className:`w-full max-w-[85%] overflow-hidden rounded-lg border border-[var(--border-weak-base)] bg-[var(--background-strong)]`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 bg-[var(--surface-base)] px-2.5 py-1.5 text-left text-xs text-[var(--text-weak)] transition-colors hover:bg-[color:var(--surface-base-hover)]`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium text-[var(--text-strong)]`,children:[i&&(0,L.jsx)(lb,{className:`size-3`}),e,(0,L.jsx)(`span`,{className:`font-normal text-[var(--text-weaker)]`,children:t})]}),s&&(0,L.jsx)(F,{className:`ml-auto size-3 shrink-0 text-[var(--text-weaker)] transition-transform ${a?`rotate-90`:``}`})]}),c&&(0,L.jsxs)(`div`,{className:`border-t border-[var(--border-weak-base)] px-2.5 py-2 text-xs leading-relaxed text-[var(--text-base)] whitespace-pre-wrap`,children:[c,s&&!a&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`ml-1 cursor-pointer text-[var(--text-interactive-base)] hover:underline`,children:`show more`})]}),r&&(0,L.jsxs)(`div`,{className:`border-t border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] px-2.5 py-2`,children:[(0,L.jsx)(`div`,{className:`mb-1 text-[10px] font-medium uppercase tracking-wide text-[var(--text-weaker)]`,children:`Recent context`}),(0,L.jsx)(`pre`,{className:`max-h-32 overflow-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-[var(--text-weak)]`,children:r})]})]})}function iU({message:e,compact:t,showCopy:n,copyText:r}){let i=DH();return(0,L.jsx)(dU,{align:`left`,children:(0,L.jsxs)(`div`,{className:`group w-full space-y-2.5 text-sm leading-relaxed`,children:[!t&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-[var(--text-weak)]`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[var(--text-strong)]`,children:e.agent??`assistant`}),e.model&&(0,L.jsx)(`span`,{className:`font-mono text-[var(--text-weaker)]`,children:CH(e.model)}),i&&(0,L.jsx)(Ct,{id:`message.timestamp`,time:e.time.created}),e.cost!==void 0&&e.cost>0&&(0,L.jsx)(Ct,{id:`message.cost`,cost:e.cost}),e.tokens&&(0,L.jsx)(Ct,{id:`message.tokens`,tokens:e.tokens}),e.finish&&e.finish!==`stop`&&(0,L.jsx)(`span`,{className:`rounded-sm border border-[var(--border-weak-base)] px-1 py-px font-mono text-[10px] text-[var(--text-weak)]`,children:e.finish})]}),e.error&&(0,L.jsxs)(`div`,{className:`rounded-md border border-[color-mix(in_oklch,var(--surface-critical-strong)_40%,transparent)] bg-[var(--surface-critical-weak)] px-3 py-2 text-xs text-[var(--text-on-critical-strong)]`,children:[e.error.type,`: `,e.error.message]}),(()=>{let t={text:0,reasoning:0};return e.content.map((n,r)=>{let i=n.type===`tool`?`${e.id}:tool:${n.id}`:`${e.id}:${n.type}:${t[n.type]++}`;return(0,L.jsxs)(w.Fragment,{children:[(0,L.jsx)(aU,{stateKey:i,part:n,messageID:e.id,partIndex:r,message:e}),(0,L.jsx)(RH,{message:e,part:n,partIndex:r})]},i)})})(),n&&r&&(0,L.jsx)(`div`,{className:`flex justify-start pt-1`,children:(0,L.jsx)(Ct,{id:`message.copyButton`,text:r,variant:`assistant`})})]})})}function aU({part:e,stateKey:t,messageID:n,partIndex:r,message:i}){return e.type===`reasoning`?(0,L.jsx)(cU,{text:e.text,stateKey:t}):e.type===`tool`?(0,L.jsx)(Ct,{id:`tool.card`,part:e,stateKey:t}):!e.text||!e.text.trim()?null:(0,L.jsx)(Ct,{id:`message.markdown`,text:e.text,messageID:n,partIndex:r,message:i})}var oU=new Map;function sU(e,t){for(oU.delete(e),oU.set(e,t);oU.size>2e3;){let e=oU.keys().next().value;if(!e)break;oU.delete(e)}}function cU({text:e,stateKey:t}){let[n,r]=(0,w.useState)(ah().showReasoning),[i,a]=(0,w.useState)(()=>t?oU.get(t)??null:null);(0,w.useEffect)(()=>sh(()=>{r(ah().showReasoning),a(null)}),[]);let o=i??n;return e?(0,L.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)]`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{let e=!o;a(e),t&&sU(t,e)},className:`flex w-full cursor-pointer items-center gap-1.5 px-2.5 py-1.5 text-left text-xs text-[var(--text-weak)] transition-colors hover:text-[var(--text-base)]`,children:[(0,L.jsx)(F,{className:`size-3 shrink-0 transition-transform ${o?`rotate-90`:``}`}),(0,L.jsx)(P,{className:`size-3.5 shrink-0`}),`Reasoning`]}),o&&(0,L.jsx)(`div`,{className:`border-t border-[var(--border-weak-base)] px-2.5 py-2 text-xs leading-relaxed text-[var(--text-weak)] italic whitespace-pre-wrap`,children:e})]}):null}function lU(e){let t=e.trim();return/^data:image\/[a-z0-9.+-]+;/i.test(t)?t:dz(e)}function uU({text:e}){return(0,L.jsx)(`div`,{className:`text-sm leading-relaxed text-[var(--text-base)] [&_h1]:text-[var(--text-strong)] [&_h2]:text-[var(--text-strong)] [&_h3]:text-[var(--text-strong)] [&_strong]:text-[var(--text-strong)] [&_a]:text-[var(--text-interactive-base)] [&_a]:underline [&_a]:underline-offset-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_blockquote]:border-l-2 [&_blockquote]:border-[var(--border-weak-base)] [&_blockquote]:pl-3 [&_blockquote]:text-[var(--text-weak)] [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-[var(--border-weak-base)] [&_pre]:bg-[var(--surface-inset-base)] [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-xs [&_pre]:text-[var(--text-base)] [&_code]:rounded [&_code]:bg-[var(--surface-base)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em] [&_code]:text-[var(--text-base)] [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-inherit [&_img]:max-h-96 [&_img]:max-w-full [&_img]:rounded-md [&_img]:border [&_img]:border-[color:var(--border-weak-base)]`,children:(0,L.jsx)(sz,{remarkPlugins:[dH],urlTransform:lU,children:e})})}function dU({align:e=`left`,children:t}){return(0,L.jsxs)(`div`,{className:`mb-3.5 flex w-full ${e===`right`?`justify-end`:`justify-start`}`,children:[t,e===`right`&&(0,L.jsx)(`span`,{className:`sr-only`,children:`user message`})]})}_t({"message.markdown":e=>(0,L.jsx)(uU,{text:e.text}),"message.timestamp":e=>(0,L.jsx)($H,{time:e.time}),"message.tokens":e=>(0,L.jsx)(tU,{tokens:e.tokens}),"message.cost":e=>(0,L.jsx)(eU,{cost:e.cost}),"message.copyButton":e=>e.variant===`assistant`?(0,L.jsx)(UH,{text:e.text}):(0,L.jsx)(HH,{text:e.text})});var fU={permission:`var(--surface-critical-strong)`,question:`var(--text-interactive-base)`,form:`var(--surface-warning-strong)`},pU={permission:{icon:Ze,label:`Permission required`,hint:`esc rejects`},question:{icon:oe,label:`Question`,hint:`esc rejects`},form:{icon:se,label:`Form`,hint:`esc cancels`}},mU=`overflow-x-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-base)]`;function hU({sessionID:e}){let t=J(t=>ng(t).find(t=>t.req.sessionID===e)),n=J(t=>ng(t).filter(t=>t.req.sessionID===e).length-1);return t?(0,L.jsx)(gU,{item:t,behind:n},`${t.kind}:${t.req.id}`):null}function gU({item:e,behind:t}){let n=pU[e.kind],r=n.icon,i=fU[e.kind],a=(0,w.useRef)(null),o=J(t=>rg(t,e.req.sessionID));(0,w.useEffect)(()=>{let t=t=>{t.key===`Escape`&&(document.querySelector(`[role="dialog"]`)||(t.preventDefault(),t.stopPropagation(),wy(e)))};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e]);let s=`${e.kind}:${e.req.id}`;return(0,w.useEffect)(()=>{G(`panel`,`show ${s}`);let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>{cancelAnimationFrame(e),G(`panel`,`hide ${s}`)}},[s]),(0,L.jsx)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2 pt-2`,children:(0,L.jsx)(`div`,{className:`mx-auto max-w-3xl`,children:(0,L.jsxs)(`div`,{ref:a,tabIndex:-1,className:`max-h-72 overflow-y-auto border-l-2 bg-[color:var(--background-strong)] px-4 py-2 font-mono text-sm outline-none`,style:{borderLeftColor:i},children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 font-medium ${e.kind===`permission`?`text-[color:var(--surface-critical-strong)]`:e.kind===`question`?`text-[color:var(--text-interactive-base)]`:`text-[color:var(--surface-warning-strong)]`}`,children:[(0,L.jsx)(r,{className:`size-3.5`,"aria-hidden":!0}),e.kind===`form`?e.req.title||`Form`:n.label]}),(0,L.jsx)(ob,{variant:`outline`,className:`max-w-52 truncate border-[var(--border-weak-base)] font-normal text-[var(--text-weak)]`,children:o})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>wy(e),title:n.hint,className:`flex shrink-0 cursor-pointer items-center gap-1 font-mono text-xs text-[color:var(--text-weaker)] hover:text-[color:var(--text-weak)]`,children:[n.hint.replace(`esc `,``),(0,L.jsx)(at,{className:`size-3.5`})]})]}),(0,L.jsxs)(`div`,{className:`pt-1.5`,children:[e.kind===`permission`&&(0,L.jsx)(_U,{req:e.req}),e.kind===`question`&&(0,L.jsx)(vU,{req:e.req}),e.kind===`form`&&(0,L.jsx)(yU,{req:e.req})]}),t>0&&(0,L.jsxs)(`p`,{className:`pt-1.5 text-xs text-[color:var(--text-weaker)]`,children:[`+`,t,` more queued in this session`]})]})})})}function _U({req:e}){return(0,L.jsxs)(L.Fragment,{children:[e.resources.length>0&&(0,L.jsx)(`div`,{className:`space-y-1 pb-1.5`,children:e.resources.map((e,t)=>(0,L.jsx)(`pre`,{className:mU,children:e},t))}),e.metadata&&Object.keys(e.metadata).length>0&&(0,L.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-inset-base)] p-2.5 mb-1.5 font-mono text-xs whitespace-pre-wrap text-[var(--text-weak)]`,children:JSON.stringify(e.metadata,null,2)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`font-sans text-xs text-[color:var(--text-weak)]`,children:e.source?(0,L.jsxs)(L.Fragment,{children:[`by tool `,(0,L.jsx)(`span`,{className:`font-mono`,children:e.source.id})]}):e.action||null}),(0,L.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,L.jsx)(H,{variant:`destructive`,size:`sm`,onClick:()=>void yy(e.id,`reject`),children:`Reject`}),(0,L.jsx)(H,{variant:`secondary`,size:`sm`,onClick:()=>void yy(e.id,`once`),children:`Once`}),(0,L.jsx)(H,{size:`sm`,onClick:()=>void yy(e.id,`always`),children:`Always allow`})]})]})]})}function vU({req:e}){let t=e.questions.length,[n,r]=(0,w.useState)(()=>e.questions.map(()=>[])),[i,a]=(0,w.useState)(()=>e.questions.map(()=>``)),[o,s]=(0,w.useState)(0),[c,l]=(0,w.useState)(0),[u,d]=(0,w.useState)(!1),f=e=>e.value??e.label,p=e.questions[Math.min(o,t-1)],m=o>=t-1,h=t=>{let r=e.questions[t];return n[t].length>0||r.custom&&i[t].trim().length>0},g=t=>e.questions.map((e,r)=>{let a=t&&t.qi===r?t.picked:n[r],o=i[r].trim();return e.multiple?[...a,...o?[o]:[]]:t?.explicit&&t.qi===r?a.slice(0,1):o?[o]:a.slice(0,1)}),_=t=>{d(!1),Sy(e.id,t).then(e=>{e||d(!0)})},v=(e,n)=>{e>=t?_(g(n)):(d(!1),s(e),l(t=>Math.max(t,e)))},y=(e,t,i)=>{if(d(!1),t.multiple){r(t=>t.map((t,n)=>n===e?t.includes(i)?t.filter(e=>e!==i):[...t,i]:t));return}let a=n[e].includes(i)?[]:[i];r(t=>t.map((t,n)=>n===e?a:t)),v(e+1,{qi:e,picked:a,explicit:!0})},b=(0,w.useRef)(()=>{});return b.current=()=>{m?e.questions.every((e,t)=>h(t))?_(g()):d(!1):h(o)&&v(o+1)},(0,w.useEffect)(()=>{let e=e=>{e.key!==`Enter`||!(e.ctrlKey||e.metaKey)||(e.preventDefault(),e.stopPropagation(),b.current())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,L.jsxs)(L.Fragment,{children:[t>1&&(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 pb-1.5`,children:e.questions.map((e,t)=>(0,L.jsxs)(`button`,{type:`button`,disabled:t>c,onClick:()=>t<=c&&(s(t),d(!1)),title:e.question||e.header,className:`max-w-40 cursor-pointer truncate rounded px-1.5 py-0.5 font-mono text-xs transition-colors ${t===o?`bg-[color:var(--surface-inset-strong,var(--surface-inset-base))] text-[color:var(--text-strong)] outline outline-1 outline-[var(--border-selected,var(--border-weak-base))]`:t<c||t===c&&t!==o?`text-[color:var(--text-weak)] hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-strong)]`:`cursor-default text-[color:var(--text-weaker)] opacity-60`}`,children:[h(t)&&t!==o?`✓ `:``,e.header||`Q${t+1}`]},t))}),e.tool&&(0,L.jsxs)(`p`,{className:`pb-1.5 font-sans text-xs text-[color:var(--text-weak)]`,children:[`by tool `,(0,L.jsx)(`span`,{className:`font-mono`,children:e.tool.id})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[p.header&&t>1&&(0,L.jsxs)(`span`,{className:`shrink-0 text-xs text-[color:var(--text-weaker)]`,children:[o+1,`/`,t]}),(0,L.jsx)(`span`,{className:`min-w-0 break-words text-sm text-[color:var(--text-strong)]`,children:p.question})]}),p.options.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1 pt-1`,children:p.options.map(e=>{let t=f(e),r=n[o].includes(t);return(0,L.jsx)(H,{type:`button`,variant:r?`default`:`secondary`,size:`xs`,title:e.description,onClick:()=>y(o,p,t),children:e.label},t)})}),p.custom&&(0,L.jsx)(Fm,{value:i[o],onChange:e=>{d(!1),a(t=>t.map((t,n)=>n===o?e.target.value:t))},placeholder:`Custom answer…`,className:`mt-1 min-h-12 font-mono text-xs`})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 pt-1.5`,children:[u&&(0,L.jsx)(`p`,{className:`mr-auto font-sans text-xs text-[color:var(--surface-critical-strong)]`,children:`answer rejected — request still open, adjust and retry`}),t>1&&o>0&&(0,L.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>s(o-1),children:`Back`}),(0,L.jsx)(H,{variant:`destructive`,size:`sm`,onClick:()=>void wy(x()),children:`Reject`}),m?(0,L.jsx)(H,{size:`sm`,disabled:!e.questions.every((e,t)=>h(t)),onClick:()=>_(g()),children:`Reply`}):(0,L.jsx)(H,{size:`sm`,disabled:!h(o),onClick:()=>v(o+1),children:`Next`})]})]});function x(){return{kind:`question`,req:e}}}function yU({req:e}){let t=e.fields,[n,r]=(0,w.useState)(()=>{let e={};for(let n of t)n.type!==`external`&&(n.default===void 0?n.type===`multiselect`?e[n.key]=[]:n.type===`boolean`?e[n.key]=!1:e[n.key]=``:e[n.key]=n.default);return e}),[i,a]=(0,w.useState)(!1),o=t.filter(e=>e.type!==`external`&&e.required===!0).every(e=>{let t=n[e.key];return e.type===`boolean`?!0:Array.isArray(t)?t.length>0:typeof t==`number`||typeof t==`string`&&t.trim().length>0});function s(e,t){r(n=>({...n,[e]:t}))}return(0,L.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),!(!o||i)&&(a(!0),by(e.id,n).finally(()=>a(!1)))},children:[t.map(e=>(0,L.jsx)(`div`,{className:`pb-1.5`,children:(0,L.jsx)(bU,{field:e,value:n[e.key],onChange:t=>s(e.key,t)})},e.key)),(0,L.jsxs)(`div`,{className:`flex justify-end gap-1.5 pt-1`,children:[(0,L.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>wy({kind:`form`,req:e}),children:`Cancel`}),(0,L.jsx)(H,{type:`submit`,size:`sm`,disabled:!o||i,children:`Submit`})]})]})}function bU({field:e,value:t,onChange:n}){let r=`w-full rounded-md border border-[var(--border-weak-base)] bg-[var(--input-base)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-strong)] outline-none transition-colors placeholder:text-[var(--text-weaker)] focus:border-[var(--border-selected)] focus:ring-1 focus:ring-[var(--border-selected)]`,i=(0,L.jsxs)(`label`,{className:`mb-1 block font-sans text-xs font-medium text-[var(--text-base)]`,children:[e.title??e.key,e.type!==`external`&&e.required&&(0,L.jsx)(`span`,{className:`text-[var(--surface-critical-strong)]`,children:` *`})]});switch(e.type){case`string`:return(0,L.jsxs)(`div`,{children:[i,e.options&&e.options.length>0?(0,L.jsxs)(`select`,{className:r,value:t??``,onChange:e=>n(e.target.value),children:[(0,L.jsx)(`option`,{value:``,children:`—`}),e.options.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))]}):(0,L.jsx)(`input`,{className:r,placeholder:e.placeholder,value:t??``,onChange:e=>n(e.target.value)})]});case`number`:case`integer`:return(0,L.jsxs)(`div`,{children:[i,(0,L.jsx)(`input`,{type:`number`,className:r,value:t??``,onChange:e=>n(e.target.value===``?0:Number(e.target.value))})]});case`boolean`:return(0,L.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 font-sans text-sm text-[var(--text-base)]`,children:[(0,L.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--text-interactive-base)]`,checked:!!t,onChange:e=>n(e.target.checked)}),e.title??e.key]});case`multiselect`:return(0,L.jsxs)(`div`,{children:[i,(0,L.jsx)(`div`,{className:`space-y-1`,children:e.options.map(e=>{let r=(t??[]).includes(e.value);return(0,L.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 font-sans text-sm text-[var(--text-base)]`,children:[(0,L.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--text-interactive-base)]`,checked:r,onChange:r=>{let i=t??[];n(r.target.checked?[...i,e.value]:i.filter(t=>t!==e.value))}}),e.label]},e.value)})})]});case`external`:return(0,L.jsxs)(`div`,{className:`rounded-md border border-[var(--border-weak-base)] bg-[var(--surface-base)] px-3 py-2 font-sans text-xs text-[var(--text-base)]`,children:[e.title??`External input`,`:`,` `,(0,L.jsx)(`a`,{className:`text-[var(--text-interactive-base)] underline`,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url})]});default:return null}}var xU=`flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)] focus-visible:text-[var(--text-strong)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--border-selected)]`,SU=[{delivery:`steer`,caption:`⚡ steer · sent at the next step`,accent:`border-l-[color:var(--surface-warning-strong)]`},{delivery:`queue`,caption:`⏳ queue · sent after this turn`,accent:`border-l-[color:var(--text-interactive-base)]`}];function CU({sessionID:e}){let t=J(t=>t.pending[e]),n=J(t=>t.running[e]??!1);if(!t||t.length===0)return null;let r=t.filter(e=>(e.delivery??`steer`)===`steer`),i=t.filter(e=>e.delivery===`queue`);return r.length===0&&i.length===0?null:(0,L.jsx)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-1 pt-1`,"data-oc-queue-strip":!0,children:(0,L.jsx)(`div`,{className:`mx-auto max-w-3xl overflow-hidden rounded-md border border-[color-mix(in_oklch,var(--border-base)_55%,transparent)] bg-[color-mix(in_oklch,var(--surface-base)_40%,transparent)]`,children:(0,L.jsx)(`div`,{className:`divide-y divide-[color:var(--border-weak-base)]`,children:SU.map(t=>{let a=t.delivery===`steer`?r:i;return a.length===0?null:(0,L.jsxs)(`div`,{className:`${t.accent} border-l-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-2 pb-0.5 pt-1`,children:[(0,L.jsxs)(`span`,{className:`truncate font-mono text-[10px] tracking-wide uppercase text-[var(--text-weaker)]`,children:[t.caption,a.length>1?` (${a.length})`:``]}),t.delivery===`steer`&&n&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void ry(e),title:`Interrupt the current step and deliver all steered messages now (queued ones stay parked)`,className:`${xU} ml-auto h-5 w-auto gap-1 px-1.5 font-mono text-[10px] normal-case`,children:[(0,L.jsx)(Be,{className:`size-3`}),`interrupt & send now`]})]}),a.map(t=>(0,L.jsx)(wU,{sessionID:e,row:t},t.key))]},t.delivery)})})})})}function wU({sessionID:e,row:t}){let n=t.state===`sending`,r=t.delivery===`queue`;return(0,L.jsxs)(`div`,{className:`group flex items-center gap-2 py-1 pr-1 pl-2.5 text-xs text-[var(--text-base)]`,children:[n?(0,L.jsx)(Me,{className:`size-3 shrink-0 animate-spin text-[var(--text-weaker)]`}):(0,L.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full ${r?`bg-[color:var(--text-interactive-base)]`:`bg-[color:var(--surface-warning-strong)]`}`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:t.text,children:t.text}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>ty(e,t.key,r?`steer`:`queue`),title:r?`send at next step`:`move to queue`,className:`${xU} ${n?`pointer-events-none opacity-40`:``}`,children:r?(0,L.jsx)(M,{className:`size-3.5`}):(0,L.jsx)(ee,{className:`size-3.5`})}),r&&!n&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>ny(e,t.key),title:`send now`,className:xU,children:(0,L.jsx)(Be,{className:`size-3.5`})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>ey(e,t.key),title:n?`cancel send`:`cancel`,className:xU,children:(0,L.jsx)(rt,{className:`size-3.5`})})]})]})}function TU(e){requestAnimationFrame(()=>{let t=document.getElementById(`composer-input-${e}`);if(!(t instanceof HTMLTextAreaElement))return;t.focus();let n=t.value.length;t.setSelectionRange(n,n)})}function EU({sessionID:e,paneKey:t=`main`}){let n=J(e=>e.sessions),r=J(e=>e.running),i=J(e=>e.activeIDs),a=J(e=>e.runsPanelOpen),o=J(e=>e.runsSelection),s=J(t=>t.sessions.find(t=>t.id===e)??t.sessionDetails[e]),c=J(t=>t.sessions.find(t=>t.id===e)?.location?.directory),[l,u]=(0,w.useState)(`subagents`),[d,f]=(0,w.useState)(null),[p,m]=(0,w.useState)(0),[h,g]=(0,w.useState)([]),_=(0,w.useRef)(null),v=cv(n,s?.parentID??e),y=e=>r[e]||i.includes(e),b=[...v].sort((e,t)=>Number(y(t.id))-Number(y(e.id))),x=Math.max(0,b.findIndex(e=>e.id===d));(0,w.useEffect)(()=>{if(!a)return;let t=b.length>0?`subagents`:`shells`,n=b.some(t=>t.id===e)?e:b[0]?.id??null,r=0,i=o,s=i?.section===`subagents`?i.subID:null;s&&b.some(e=>e.id===s)?(t=`subagents`,n=s):i?.section===`shells`&&(t=`shells`,r=Math.max(0,i.shellIndex)),u(t),f(n),m(r),document.activeElement?.blur?.(),requestAnimationFrame(()=>_.current?.focus({preventScroll:!0}))},[a]),(0,w.useEffect)(()=>{a&&av({section:l,subID:d,shellIndex:p})},[a,l,d,p]),(0,w.useEffect)(()=>{l===`shells`&&h.length>0&&p>h.length-1&&m(h.length-1)},[l,p,h.length]);let S=(0,w.useCallback)(async()=>{try{let e=c?{directory:c}:void 0,[t,n]=await Promise.all([W.shellList(e),W.ptyList(e)]);g([...t.data.map(e=>({id:e.id,label:e.command||e.shell,running:e.status===`running`,kind:`shell`})),...n.data.map(e=>({id:e.id,label:e.title||e.command,running:e.status===`running`,kind:`pty`}))])}catch{}},[c]);(0,w.useEffect)(()=>{if(!a){g([]);return}return S(),Bh({name:`runs-panel-shells`,minInterval:5e3,run:()=>S()})},[a,S]);let C=(0,w.useCallback)(async e=>{let t=c?{directory:c}:void 0;try{e.kind===`shell`?await W.shellDelete(e.id,t):await W.ptyDelete(e.id,t)}catch{}S()},[c,S]);(0,w.useEffect)(()=>{if(!a)return;let e=e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`k`){if(e.preventDefault(),e.stopPropagation(),l===`shells`){let e=h[p];e?.running&&C(e)}return}if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`,`Escape`].includes(e.key)){if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){iv(),TU(t);return}if(e.key===`ArrowLeft`||e.key===`ArrowRight`){u(e=>e===`subagents`?`shells`:`subagents`);return}if(e.key===`ArrowUp`){(l===`subagents`?b.length===0||x===0:h.length===0||p===0)?(iv(),TU(t)):l===`subagents`?f(b[x-1].id):m(e=>e-1);return}if(e.key===`ArrowDown`){l===`subagents`?b.length>0&&f(b[(x+1)%b.length].id):h.length>0&&m(e=>(e+1)%h.length);return}l===`subagents`&&b[x]?(iv(),mv(b[x].id)):l===`shells`&&h[p]&&(iv(),tv())}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[a,l,x,p,b,h,C]);let T=(0,w.useRef)(e);(0,w.useEffect)(()=>{T.current!==e&&(T.current=e,iv())},[e]);let E=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(!a)return;function e(e){let t=e.target;t instanceof Element&&(E.current?.contains(t)||t.closest(`[data-runs-panel-trigger]`)||iv())}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),a?(0,L.jsx)(`div`,{ref:E,className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2 pt-2`,"data-oc-runs-panel":!0,children:(0,L.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,L.jsxs)(`div`,{ref:_,tabIndex:-1,className:`min-h-44 max-h-64 overflow-y-auto border-l-2 border-[color:var(--border-strong)] bg-[color:var(--background-strong)] px-4 py-2 font-mono text-sm outline-none`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,L.jsx)(DU,{active:l===`subagents`,onClick:()=>u(`subagents`),children:`Subagents`}),(0,L.jsx)(DU,{active:l===`shells`,onClick:()=>u(`shells`),children:`Shell`})]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{iv(),TU(t)},className:`cursor-pointer font-mono text-xs text-[color:var(--text-weaker)] hover:text-[color:var(--text-weak)]`,children:`esc`})]}),l===`subagents`&&(b.length===0?(0,L.jsx)(`p`,{className:`pt-2 text-[color:var(--text-weak)]`,children:`No active subagents`}):b.map((t,n)=>(0,L.jsx)(OU,{selected:n===x,current:t.id===e,running:y(t.id),label:t.agent&&t.title?`${t.agent} — ${t.title}`:t.title||t.agent||t.id,onClick:()=>{iv(),mv(t.id)}},t.id))),l===`shells`&&(h.length===0?(0,L.jsx)(`p`,{className:`pt-2 text-[color:var(--text-weak)]`,children:`No shell commands`}):h.map((e,t)=>(0,L.jsx)(OU,{selected:t===p,running:e.running,label:e.label,onKill:e.running?()=>void C(e):void 0,onClick:()=>{iv(),tv()}},e.id)))]}),(0,L.jsxs)(`p`,{className:`mt-1 pl-1 font-mono text-[10px] text-[color:var(--text-weaker)]`,children:[`tabs `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`←/→`}),(l===`subagents`?b.length:h.length)>0&&(0,L.jsxs)(L.Fragment,{children:[` · `,`↑↓ select`,` · `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`↵`}),` open`]}),l===`shells`&&h.some(e=>e.running)&&(0,L.jsxs)(L.Fragment,{children:[` · `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`ctrl+k`}),` kill`]}),` · `,(0,L.jsx)(`span`,{className:`text-[color:var(--text-weak)]`,children:`type`}),` → composer`]})]})}):null}function DU({active:e,onClick:t,children:n}){return(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer bg-transparent p-0 font-mono text-sm transition-colors ${e?`font-bold text-[color:var(--text-strong)]`:`font-normal text-[color:var(--text-weaker)] hover:text-[color:var(--text-weak)]`}`,children:n})}function OU({selected:e,current:t,running:n,label:r,hint:i,onClick:a,onKill:o}){let s=(0,w.useRef)(null);return(0,w.useEffect)(()=>{e&&s.current?.scrollIntoView({block:`nearest`})},[e]),(0,L.jsxs)(`div`,{className:`flex w-full items-center gap-1`,children:[(0,L.jsxs)(`button`,{ref:s,type:`button`,onClick:a,title:t?`Currently open session`:void 0,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-sm px-1 py-1 text-left font-mono text-xs transition-colors ${e?`bg-[color:var(--surface-raised-base-active)] text-[color:var(--text-strong)]`:`text-[color:var(--text-base)] hover:bg-[color:var(--surface-base-hover)]`}`,children:[(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${n?`bg-emerald-500`:`bg-[color:var(--text-weaker)]`}`}),t&&(0,L.jsx)(F,{className:`size-3 shrink-0 text-[color:var(--text-weak)]`,"aria-label":`current session`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate ${t&&!e?`font-medium text-[color:var(--text-strong)]`:``}`,children:r}),i&&(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-[color:var(--text-weaker)]`,children:i})]}),o!==void 0&&(0,L.jsx)(`button`,{type:`button`,"aria-label":`Kill`,title:`Kill`,onClick:e=>{e.stopPropagation(),o()},className:`shrink-0 cursor-pointer rounded-sm p-0.5 text-[color:var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--surface-critical-strong)]`,children:(0,L.jsx)(et,{className:`size-3`})})]})}var kU=1e4,AU=250,jU={retry:{icon:`⚠`,label:`Retry`,iconClass:`text-[color:var(--surface-warning-strong)]`,labelClass:`font-medium text-[color:var(--surface-warning-strong)]`,rowClass:`border-l-[color:var(--surface-warning-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-warning-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-warning-strong)_8%,transparent)]`,barClass:`bg-[color:var(--surface-warning-strong)]`},error:{icon:`⚠`,label:`Error`,iconClass:`text-[color:var(--surface-critical-strong)]`,labelClass:`font-medium text-[color:var(--surface-critical-strong)]`,rowClass:`border-l-[color:var(--surface-critical-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-critical-strong)_8%,transparent)]`,barClass:`bg-[color:var(--surface-critical-strong)]`},failed:{icon:`⚠`,label:`Failed`,iconClass:`text-[color:var(--surface-critical-strong)]`,labelClass:`font-medium text-[color:var(--surface-critical-strong)]`,rowClass:`border-l-[color:var(--surface-critical-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-critical-strong)_8%,transparent)]`,barClass:`bg-[color:var(--surface-critical-strong)]`},interrupted:{icon:`⏹`,label:`Interrupted`,iconClass:`text-[var(--text-weaker)]`,labelClass:`font-medium text-[var(--text-weaker)]`,rowClass:`border-l-[color:var(--text-weaker)] border-y border-r border-[color-mix(in_oklch,var(--text-weaker)_25%,transparent)] bg-transparent`,barClass:`bg-[color:var(--text-weaker)]`}};function MU(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<10)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function NU(e){let[,t]=(0,w.useState)(0);(0,w.useEffect)(()=>{if(e)return Bh({name:`run-notices-age`,minInterval:15e3,run:()=>t(e=>e+1)})},[e])}function PU(e,t){let[n,r]=(0,w.useState)({}),i=(0,w.useRef)({}),a=t?t.map(e=>e.id).join(`
|
|
111
111
|
`):``;return(0,w.useEffect)(()=>{let t=a?a.split(`
|
|
112
112
|
`):[];for(let e of t)e in i.current||(i.current[e]=kU);for(let e of Object.keys(i.current))t.includes(e)||delete i.current[e];if(t.length===0){r({});return}let n=Date.now(),o=setInterval(()=>{let a=Date.now(),o=a-n;if(n=a,typeof document<`u`&&document.hidden)return;let s={},c=[];for(let e of t){let t=Math.max(0,(i.current[e]??kU)-o);i.current[e]=t,s[e]=kU-t,t===0&&c.push(e)}r(s);for(let t of c)T_(e,t)},AU);return()=>clearInterval(o)},[a,e]),n}function FU({sessionID:e}){let t=J(t=>t.runNotices[e]);NU(!!t&&t.length>0);let n=PU(e,t);return!t||t.length===0?null:(0,L.jsx)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-1 pt-2`,children:(0,L.jsx)(`div`,{className:`mx-auto flex max-h-32 max-w-3xl flex-col gap-1 overflow-y-auto`,children:t.map(t=>{let r=jU[t.kind],i=Math.min(100,(n[t.id]??0)/kU*100);return(0,L.jsxs)(`div`,{className:`relative flex items-start gap-2 rounded-md border-l-2 py-1 pl-2.5 pr-2 pb-1.5 text-xs text-[var(--text-base)] ${r.rowClass}`,children:[(0,L.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 ${r.iconClass}`,children:r.icon}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 break-words`,children:[(0,L.jsx)(`span`,{className:r.labelClass,children:r.label}),`: `,t.text]}),(0,L.jsx)(`span`,{className:`shrink-0 whitespace-nowrap tabular-nums text-[var(--text-weaker)]`,children:MU(t.at)}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>T_(e,t.id),title:`Dismiss`,className:`shrink-0 cursor-pointer text-[var(--text-weaker)] transition-colors hover:text-[var(--text-strong)]`,children:`✕`}),(0,L.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-[2px] opacity-40 ${r.barClass}`,style:{width:`${i}%`}})]},t.id)})})})}function IU({sessionID:e}){let t=J(t=>t.sendErrors[e]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(FU,{sessionID:e}),t?(0,L.jsx)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2 pt-2`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-3xl items-start gap-2 rounded-md border-l-2 border-l-[color:var(--surface-critical-strong)] border-y border-r border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[color-mix(in_oklch,var(--surface-critical-strong)_8%,transparent)] py-1.5 pl-2.5 pr-2 text-xs text-[var(--text-base)]`,children:[(0,L.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[color:var(--surface-warning-strong)]`,children:`⚠`}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 break-words`,children:[(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--surface-critical-strong)]`,children:t.type}),`: `,t.message]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>$v(e),title:`Dismiss`,className:`shrink-0 cursor-pointer text-[var(--text-weaker)] transition-colors hover:text-[var(--text-strong)]`,children:`✕`})]})}):null]})}function LU({...e}){return(0,L.jsx)(Sf,{"data-slot":`dropdown-menu`,...e})}function RU({...e}){return(0,L.jsx)(Cf,{"data-slot":`dropdown-menu-trigger`,...e})}function zU({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,L.jsx)(wf,{children:(0,L.jsx)(Tf,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:B(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function BU({className:e,inset:t,variant:n=`default`,...r}){return(0,L.jsx)(Df,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:B(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function VU({className:e,inset:t,...n}){return(0,L.jsx)(Ef,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:B(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function HU({className:e,...t}){return(0,L.jsx)(Of,{"data-slot":`dropdown-menu-separator`,className:B(`-mx-1 my-1 h-px bg-border`,e),...t})}function UU({sessionID:e}){let t=J(t=>t.sessions.find(t=>t.id===e)),[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(null);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(LU,{open:n,onOpenChange:r,children:[(0,L.jsx)(RU,{asChild:!0,children:(0,L.jsx)(H,{variant:`ghost`,size:`icon`,title:`Session actions`,children:(0,L.jsx)(fe,{})})}),(0,L.jsxs)(zU,{align:`end`,className:`w-48`,children:[(0,L.jsxs)(BU,{onSelect:()=>a(`rename`),children:[(0,L.jsx)(Re,{}),` Rename…`]}),(0,L.jsxs)(BU,{onSelect:()=>a(`fork`),children:[(0,L.jsx)(Oe,{}),` Fork…`]}),(0,L.jsxs)(BU,{onSelect:()=>void qU(e),children:[(0,L.jsx)(de,{}),` Export`]}),(0,L.jsx)(HU,{}),(0,L.jsxs)(BU,{onSelect:()=>a(`compact`),children:[(0,L.jsx)(k,{}),` Compact`]})]})]}),i===`rename`&&(0,L.jsx)(WU,{sessionID:e,initialTitle:t?.title??``,onClose:()=>a(null)}),i===`fork`&&(0,L.jsx)(GU,{sessionID:e,onClose:()=>a(null)}),i===`compact`&&(0,L.jsx)(KU,{sessionID:e,onClose:()=>a(null)})]})}function WU({sessionID:e,initialTitle:t,onClose:n}){let[r,i]=(0,w.useState)(t),[a,o]=(0,w.useState)(!1),s=async()=>{let t=r.trim();if(!(!t||a)){o(!0);try{await Fy(e,t),n()}finally{o(!1)}}};return(0,L.jsx)(wm,{open:!0,onOpenChange:e=>!e&&!a&&n(),children:(0,L.jsxs)(km,{children:[(0,L.jsxs)(Am,{children:[(0,L.jsx)(Mm,{children:`Rename session`}),(0,L.jsx)(Nm,{children:`Give this session a new title.`})]}),(0,L.jsx)(Pm,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},placeholder:`Untitled session`,autoFocus:!0}),(0,L.jsxs)(jm,{children:[(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsx)(H,{variant:`outline`,disabled:a,children:`Cancel`})}),(0,L.jsx)(H,{onClick:()=>void s(),disabled:a||!r.trim(),children:`Rename`})]})]})})}function GU({sessionID:e,onClose:t}){let[n,r]=(0,w.useState)(``),[i,a]=(0,w.useState)(!1),o=async()=>{if(!i){a(!0);try{await mv(await Iy(e,n.trim()?{type:`before`,messageID:n.trim()}:{type:`through`})),t()}finally{a(!1)}}};return(0,L.jsx)(wm,{open:!0,onOpenChange:e=>!e&&!i&&t(),children:(0,L.jsxs)(km,{children:[(0,L.jsxs)(Am,{children:[(0,L.jsx)(Mm,{children:`Fork session`}),(0,L.jsx)(Nm,{children:`Copies the conversation into a new session. Leave the boundary empty to fork the full session.`})]}),(0,L.jsx)(Fm,{value:n,onChange:e=>r(e.target.value),placeholder:`Boundary message ID (msg_…) — empty forks the full session`,rows:3,autoFocus:!0}),(0,L.jsxs)(jm,{children:[(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsx)(H,{variant:`outline`,disabled:i,children:`Cancel`})}),(0,L.jsx)(H,{onClick:()=>void o(),disabled:i,children:`Fork`})]})]})})}function KU({sessionID:e,onClose:t}){let[n,r]=(0,w.useState)(!1),i=async()=>{if(!n){r(!0);try{await Ry(e,`steer`),t()}finally{r(!1)}}};return(0,L.jsx)(wm,{open:!0,onOpenChange:e=>!e&&!n&&t(),children:(0,L.jsxs)(km,{children:[(0,L.jsxs)(Am,{children:[(0,L.jsx)(Mm,{children:`Compact session`}),(0,L.jsx)(Nm,{children:`Summarizes the conversation so far into a single compact message so the agent can keep going with full context.`})]}),(0,L.jsxs)(jm,{children:[(0,L.jsx)(Dm,{asChild:!0,children:(0,L.jsx)(H,{variant:`outline`,disabled:n,children:`Cancel`})}),(0,L.jsx)(H,{onClick:()=>void i(),disabled:n,children:`Compact`})]})]})})}async function qU(e){try{let t=await Ly(e),n=new Blob([JU(t)],{type:`text/markdown`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`session-${e.slice(0,8)}.md`,i.click(),URL.revokeObjectURL(r)}catch(e){console.warn(`session export failed:`,e)}}function JU(e){let{info:t,messages:n}=e,r=[`# ${t.title||`Untitled session`}`,``];r.push(`Session \`${t.id}\` · exported ${new Date(t.time.created).toISOString()}`,``);for(let e of n)if(e.type===`assistant`){r.push(`## assistant`,``);for(let t of e.content)t.type===`text`&&t.text?r.push(t.text,``):t.type===`reasoning`&&t.text?r.push("```reasoning",t.text,"```",``):t.type===`tool`&&r.push(`> tool: \`${t.name}\` (\`${t.id}\`)`,``)}else`text`in e&&typeof e.text==`string`&&e.text?r.push(`## ${e.type}`,``,e.text,``):e.type===`shell`&&r.push(`## shell`,``,`> \`${e.command}\``,``);return r.join(`
|
|
113
113
|
`)}function YU({sessionID:e,onNavigate:t}){let n=J(t=>cv(t.sessions,e)),r=J(e=>e.running),i=J(e=>e.activeIDs),[a,o]=(0,w.useState)(()=>{try{return localStorage.getItem(`webui.subagentStripCollapsed`)!==`1`}catch{return!1}}),s=e=>t?t(e):void mv(e);if(n.length===0)return null;let c=n.filter(e=>r[e.id]||i.includes(e.id)).length;return(0,L.jsxs)(`div`,{className:`border-b border-[color:var(--border-weak-base)] px-4 py-1`,"data-oc-subagent-strip":!0,children:[(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>{o(e=>{let t=!e;try{localStorage.setItem(`webui.subagentStripCollapsed`,t?`0`:`1`)}catch{}return t})},className:`flex cursor-pointer items-center gap-1.5 rounded-md px-1 py-0.5 text-[11px] text-[color:var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-weak)]`,title:`Subagent sessions of this session`,children:[a?(0,L.jsx)(ae,{className:`size-3`}):(0,L.jsx)(F,{className:`size-3`}),(0,L.jsxs)(`span`,{className:`font-medium`,children:[`Subagents (`,n.length,`)`]}),c>0&&(0,L.jsxs)(`span`,{className:`flex items-center gap-1 text-[color:var(--surface-brand-base)]`,children:[(0,L.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-[color:var(--surface-brand-base)]`}),c,` running`]})]}),a&&(0,L.jsx)(`div`,{className:`mt-0.5 mb-1 flex flex-col gap-0.5`,children:n.map(e=>(0,L.jsx)(XU,{id:e.id,title:e.title,agent:e.agent,running:!!r[e.id]||i.includes(e.id),onOpen:()=>s(e.id)},e.id))})]})}function XU({id:e,title:t,agent:n,running:r,onOpen:i}){let[a,o]=(0,w.useState)(!1),[s,c]=(0,w.useState)(``),l=()=>{let t=s.trim();t&&(Fv(e,t),c(``),o(!1))};return(0,L.jsxs)(`div`,{className:`rounded-md px-1 py-0.5 transition-colors hover:bg-[color:var(--surface-base-hover)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${r?`animate-pulse bg-[color:var(--surface-success-strong)]`:`bg-[color:var(--border-base)]`}`,title:r?`Running`:`Idle`}),(0,L.jsxs)(`button`,{type:`button`,onClick:i,className:`min-w-0 flex-1 cursor-pointer truncate text-left text-xs text-[color:var(--text-weak)] hover:text-[color:var(--text-strong)]`,title:`Open ${t??e}`,children:[n&&t?`${n} — ${t}`:t||n||`subagent`,(0,L.jsx)(`span`,{className:`ml-2 hidden font-mono text-[10px] text-[color:var(--text-weaker)] sm:inline`,children:e.slice(0,12)})]}),(0,L.jsxs)(H,{variant:`ghost`,size:`xs`,onClick:()=>{o(e=>!e),c(``)},title:a?`Cancel`:`Message this subagent`,children:[(0,L.jsx)(Ne,{}),`Message`]}),(0,L.jsx)(H,{variant:`ghost`,size:`xs`,onClick:i,title:`Open session`,children:`Open`})]}),a&&(0,L.jsx)(`input`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),l()),e.key===`Escape`&&(e.preventDefault(),o(!1))},placeholder:`message this subagent… (enter to send)`,className:`mt-1 w-full rounded-md border border-[color:var(--border-base)] bg-[color:var(--input-base)] px-2 py-1 font-mono text-xs text-[color:var(--text-strong)] outline-none placeholder:text-[color:var(--text-weaker)] focus:border-[color:var(--border-selected)]`})]})}var ZU=`webui.theme`,QU=`oc-theme`,$U=[{id:`opencode`,label:`Opencode`,vars:{}},{id:`catppuccin`,label:`Catppuccin`,vars:{"--background-base":`#1e1e2e`,"--surface-float-base":`#181825`,"--background-weak":`#11111b`,"--text-strong":`#cdd6f4`,"--text-weak":`#9399b2`,"--border-selected":`#89b4fa`,"--surface-brand-base":`#f5c2e7`,"--surface-success-strong":`#a6e3a1`,"--surface-critical-strong":`#f38ba8`,"--surface-warning-strong":`#f9e2af`,"--surface-info-strong":`#94e2d5`}},{id:`nord`,label:`Nord`,vars:{"--background-base":`#2e3440`,"--surface-float-base":`#3b4252`,"--background-weak":`#434c5e`,"--text-strong":`#eceff4`,"--text-weak":`#8b95a7`,"--border-selected":`#88c0d0`,"--surface-brand-base":`#8fbcbb`,"--surface-success-strong":`#a3be8c`,"--surface-critical-strong":`#bf616a`,"--surface-warning-strong":`#d08770`,"--surface-info-strong":`#88c0d0`}},{id:`tokyonight`,label:`Tokyo Night`,vars:{"--background-base":`#1a1b26`,"--surface-float-base":`#1e2030`,"--background-weak":`#222436`,"--text-strong":`#c8d3f5`,"--text-weak":`#828bb8`,"--border-selected":`#82aaff`,"--surface-brand-base":`#ff966c`,"--surface-success-strong":`#c3e88d`,"--surface-critical-strong":`#ff757f`,"--surface-warning-strong":`#ffc777`,"--surface-info-strong":`#82aaff`}},{id:`dracula`,label:`Dracula`,vars:{"--background-base":`#282a36`,"--surface-float-base":`#21222c`,"--background-weak":`#44475a`,"--text-strong":`#f8f8f2`,"--text-weak":`#6272a4`,"--border-selected":`#bd93f9`,"--surface-brand-base":`#8be9fd`,"--surface-success-strong":`#50fa7b`,"--surface-critical-strong":`#ff5555`,"--surface-warning-strong":`#f1fa8c`,"--surface-info-strong":`#ffb86c`}},{id:`gruvbox`,label:`Gruvbox`,vars:{"--background-base":`#282828`,"--surface-float-base":`#3c3836`,"--background-weak":`#504945`,"--text-strong":`#ebdbb2`,"--text-weak":`#928374`,"--border-selected":`#83a598`,"--surface-brand-base":`#8ec07c`,"--surface-success-strong":`#b8bb26`,"--surface-critical-strong":`#fb4934`,"--surface-warning-strong":`#fe8019`,"--surface-info-strong":`#fabd2f`}},{id:`github`,label:`GitHub`,vars:{"--background-base":`#0d1117`,"--surface-float-base":`#010409`,"--background-weak":`#161b22`,"--text-strong":`#c9d1d9`,"--text-weak":`#8b949e`,"--border-selected":`#58a6ff`,"--surface-brand-base":`#39c5cf`,"--surface-success-strong":`#3fb950`,"--surface-critical-strong":`#f85149`,"--surface-warning-strong":`#e3b341`,"--surface-info-strong":`#d29922`}}];function eW(){let e=localStorage.getItem(ZU);return $U.find(t=>t.id===e)??$U[0]}function tW(e){let t=$U.find(t=>t.id===e)??$U[0],n=document.getElementById(QU);n||(n=document.createElement(`style`),n.id=QU,document.head.appendChild(n));let r=Object.entries(t.vars);return n.textContent=r.length>0?`:root:root {\n ${r.map(([e,t])=>`${e}: ${t};`).join(`
|
|
@@ -115,7 +115,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
115
115
|
|
|
116
116
|
`))}let r=e.join(`
|
|
117
117
|
|
|
118
|
-
`);r&&(u=r)}a.push((0,L.jsx)(TM,{messageId:r.id,id:`msg-${r.id}`,children:(0,L.jsx)(WH,{message:r,compact:s,sessionID:e,isTail:l,responseText:u})},r.id))}return n.length>0&&a.push((0,L.jsx)(TM,{children:(0,L.jsx)(_W,{assistants:n,running:r})},`live`)),a})()]})},fW);function mW(){return(0,L.jsx)(`div`,{className:`flex justify-center pt-16`,children:(0,L.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-1.5 rounded-lg border border-[var(--border-weak-base)] bg-[var(--background-weak)] px-8 py-10 text-center`,children:[(0,L.jsx)(`h1`,{className:`text-[var(--font-size-large)] font-medium text-[var(--text-base)]`,children:`Start a conversation`}),(0,L.jsx)(`p`,{className:`text-[var(--font-size-base)] text-[var(--text-weaker)]`,children:`The agent can read, edit, and run commands in the session workspace.`})]})})}function hW(e){return e.replace(/\/+$/,``).replace(/^\/(home|Users)\/[^/]+/,`~`)}function gW({title:e,sessionID:t,running:n,queued:r,parentID:i,go:a,onClose:o}){let s=J(e=>e.sessionDetails[i??``]?.title),c=og(t),l=J(e=>e.draftWorkspace);return(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[var(--border-base)] px-4 py-2.5`,"data-oc-session-header":!0,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(i),title:`Back to parent session${s?`: ${s}`:``}`,className:`cursor-pointer rounded-md border border-[var(--border-weak-base)] px-1.5 py-0.5 text-xs text-[var(--text-weak)] transition-colors hover:border-[var(--border-selected)] hover:text-[var(--text-strong)]`,children:`↑ Parent`}),(0,L.jsx)(`button`,{type:`button`,className:`mr-1 cursor-pointer text-[var(--text-weaker)] transition-colors hover:text-[var(--text-strong)] lg:hidden`,onClick:()=>o?o():a(null),children:`←`}),(0,L.jsx)(`span`,{className:`truncate text-[var(--font-size-base)] font-medium text-[var(--text-strong)]`,children:c?`New session`:e??`Untitled session`}),c?(0,L.jsx)(`span`,{className:`hidden truncate font-mono text-xs text-[var(--text-weaker)] sm:inline`,children:l?hW(l):`default workspace`}):(0,L.jsx)(`span`,{className:`hidden font-mono text-xs text-[var(--text-weaker)] sm:inline`,children:t.slice(0,12)}),r&&!n&&(0,L.jsx)(ob,{className:`border-transparent bg-[var(--surface-warning-weak)] text-[var(--surface-warning-strong)]`,title:`Message sent — waiting for the agent to start responding`,children:`waiting`}),n&&(0,L.jsx)(ob,{className:`border-transparent bg-[var(--surface-interactive-weak)] text-[var(--text-interactive-base)]`,children:`working`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[o&&(0,L.jsx)(`button`,{type:`button`,onClick:o,title:`Close split`,className:`flex size-6 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)]`,children:(0,L.jsx)(at,{className:`size-3.5`})}),(0,L.jsx)(aW,{sessionID:t}),(0,L.jsx)(nW,{}),(0,L.jsx)(UU,{sessionID:t})]})]})}function _W({assistants:e,running:t}){let n=e.flatMap(e=>e.content.map(t=>({key:yW(e.id,t),part:t}))),r=e.filter(e=>e.error).map(e=>({id:e.id,error:e.error}));return n.length===0&&!t&&r.length===0?null:(0,L.jsxs)(`div`,{children:[r.map(({id:e,error:t})=>(0,L.jsxs)(`div`,{className:`mb-2 rounded-md border border-[color-mix(in_oklch,var(--surface-critical-strong)_40%,transparent)] bg-[var(--surface-critical-weak)] px-3 py-2 text-xs text-[var(--text-on-critical-strong)]`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:t.type}),(0,L.jsx)(`div`,{className:`mt-0.5`,children:t.message})]},e)),n.length===0&&t&&r.length===0&&(0,L.jsx)(`div`,{className:`flex items-center gap-2 py-1 text-[var(--font-size-base)] text-[var(--text-weak)] animate-pulse`,children:`thinking…`}),n.map(({key:e,part:t})=>(0,L.jsx)(aU,{stateKey:e,part:t.type===`tool`?u_(t.tool):t},e))]})}function vW({messages:e}){let t=(0,w.useMemo)(()=>e.filter(e=>e.type===`user`),[e]),[n,r]=(0,w.useState)(null);if((0,w.useEffect)(()=>{if(t.length===0)return;let e=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>t.intersectionRatio-e.intersectionRatio);if(t[0]?.target){let e=t[0].target.id.replace(/^msg-/,``);r(e)}},{root:null,rootMargin:`-30% 0px -60% 0px`,threshold:[0,.25,.5,1]}),n=[];for(let r of t){let t=document.getElementById(`msg-${r.id}`);t&&(e.observe(t),n.push(t))}return()=>{for(let t of n)e.unobserve(t);e.disconnect()}},[t]),t.length<3)return null;let i=e=>{let t=document.getElementById(`msg-${e}`);if(t)t.scrollIntoView({behavior:`smooth`,block:`start`});else try{let t=`[data-message-id="${CSS.escape(e)}"]`;document.querySelector(t)?.scrollIntoView({behavior:`smooth`,block:`start`})}catch{}};return(0,L.jsx)(`div`,{className:`pointer-events-none absolute top-1/2 right-3 hidden -translate-y-1/2 flex-col items-center justify-center md:flex`,style:{maxHeight:`min(70vh, 560px)`},children:(0,L.jsxs)(`div`,{className:`pointer-events-auto flex flex-col items-center gap-2 rounded-full border border-[var(--border-weak-base)] bg-[var(--background-base)]/95 px-2 py-3 shadow-md backdrop-blur`,children:[(0,L.jsx)(`div`,{className:`absolute inset-y-3 w-px bg-[var(--border-weak-base)]`}),t.map(e=>{let t=(e.text??``).replace(/\s+/g,` `).slice(0,400)||e.id.slice(0,8),r=e.id===n;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),title:t,className:`group relative flex size-4 items-center justify-center`,children:[(0,L.jsx)(`span`,{className:`rounded-full ring-1 transition-all ${r?`size-3 bg-[var(--surface-brand-base)] ring-[var(--surface-brand-base)] shadow-sm`:`size-2 bg-[var(--text-weaker)] ring-[var(--border-weak-base)] group-hover:size-2.5 group-hover:bg-[var(--text-strong)]`}`}),(0,L.jsx)(`span`,{className:`pointer-events-none absolute right-full mr-4 hidden max-w-[560px] whitespace-pre-wrap rounded-xl border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] px-4 py-3 text-sm leading-relaxed text-[var(--text-weak)] shadow-xl group-hover:block`,children:t})]},e.id)})]})})}function yW(e,t){return t.type===`tool`?`${e}:tool:${t.tool.id}`:`${e}:${t.type}:${t.ordinal}`}_t({conversation:e=>(0,L.jsx)(oW,{...e}),"conversation.header":e=>(0,L.jsx)(gW,{...e}),"conversation.empty":e=>(0,L.jsx)(mW,{...e})});var bW=s({clearDraft:()=>DW,loadDraft:()=>TW,saveDraft:()=>EW}),xW=`webui.drafts`,SW=50;function CW(){try{let e=localStorage.getItem(xW);if(!e)return{};let t=JSON.parse(e);return t&&typeof t==`object`?t:{}}catch{return{}}}function wW(e){try{let t=Object.entries(e).sort((e,t)=>t[1].at-e[1].at).slice(0,SW);localStorage.setItem(xW,JSON.stringify(Object.fromEntries(t)))}catch{}}function TW(e){return CW()[e]?.text??``}function EW(e,t){let n=CW();if(t)n[e]={text:t,at:Date.now()};else{if(!(e in n))return;delete n[e]}wW(n)}function DW(e){let t=CW();e in t&&(delete t[e],wW(t))}function OW(e){let t=(0,w.useRef)(null);return(0,w.useEffect)(()=>{function n(n){t.current&&!t.current.contains(n.target)&&e()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e]),t}function kW({open:e,onClose:t,count:n,onSelect:r,listId:i,query:a,onQueryChange:o}){let[s,c]=(0,w.useState)(0),l=(0,w.useRef)(0);l.current=s;let u=(0,w.useRef)({prefix:``,at:0});(0,w.useEffect)(()=>{e&&c(0)},[e,a]),(0,w.useEffect)(()=>{e&&document.getElementById(`${i}-item-${s}`)?.scrollIntoView({block:`nearest`})},[e,s,i]);function d(e){let t=e.currentTarget,n=Array.from(t.querySelectorAll(`[role="option"]`));for(let t of n){let r=t.getBoundingClientRect();if(e.clientY>=r.top&&e.clientY<r.bottom){c(n.indexOf(t));return}}}return(0,w.useEffect)(()=>{if(!e)return;let s=null,d=e=>{if(e.key===`Escape`||e.key===`Tab`){if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`&&o&&a){o(``);return}t();return}if(n===0)return;if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),c(e=>(e+1)%n);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),c(e=>e<=0?n-1:e-1);return}if(e.key===`Home`){e.preventDefault(),e.stopPropagation(),c(0);return}if(e.key===`End`){e.preventDefault(),e.stopPropagation(),c(n-1);return}if(e.key===`Enter`){e.preventDefault(),e.stopPropagation(),r(l.current<n?l.current:0);return}if(o)return;let d=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?e.key.toLowerCase():null;if(!d)return;let f=Date.now(),p=u.current,m=f-p.at<1e3?p.prefix+d:d;p.prefix=m,p.at=f,s??=Array.from(document.querySelectorAll(`#${i} > button`)).map(e=>(e.textContent??``).trim().toLowerCase()),c(e=>{for(let t=1;t<=n;t++){let r=(e+t)%n;if((s?.[r]??``).startsWith(m))return r}return e})};return window.addEventListener(`keydown`,d,!0),()=>window.removeEventListener(`keydown`,d,!0)},[e,n,t,r,i,a,o]),[s,c,d]}async function AW(){try{let e=await W.agents();return e.find(e=>e.mode===`primary`&&!e.hidden)??e[0]}catch{return}}function jW(e){let t=J(t=>t.sessions.find(t=>t.id===e)),n=J(t=>t.sessionDetails[e]);return(0,w.useEffect)(()=>{f_(e)},[e]),{session:t,detail:n}}var MW=`flex w-full cursor-pointer items-center justify-between px-3 py-2 text-left transition-colors hover:bg-[color:var(--surface-base-hover)] data-[hl=true]:bg-[color:var(--surface-raised-base-active)]`;function NW({sessionID:e,openUp:t=!1,align:n=`right`}){let{session:r,detail:i}=jW(e),a=J(e=>e.pendingModel),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),[u,d]=(0,w.useState)(null),f=OW(()=>s(!1)),p=J(e=>e.uiSignals.models);(0,w.useEffect)(()=>{p&&s(!0)},[p]);let m=(0,w.useMemo)(()=>c.filter(e=>e.enabled),[c]),h=`menu-models`;function g(e,t){if(t.includes(e)){let n=t.indexOf(e),r=1e3-n*2;return(n===0||t[n-1]===` `||t[n-1]===`/`||t[n-1]===`-`)&&(r+=20),r}let n=0,r=-2,i=0,a=0,o=0,s=0,c=0;for(let l=0;l<t.length&&n<e.length;l++)t[l]===e[n]&&((l===0||t[l-1]===` `||t[l-1]===`/`||t[l-1]===`-`)&&c++,r+1===l?(a++,s++,o=Math.max(o,s)):(i+=l-r-1,s=1),r=l,n++);return n===e.length?500-r*.5-i*2+a*10+c*2+o*3:null}let[_,v]=(0,w.useState)(``),y=_.trim().toLowerCase(),b=(0,w.useMemo)(()=>{if(!y)return m;let e=[];for(let t=0;t<m.length;t++){let n=m[t],r=`${n.name} ${n.modelID} ${n.providerID} ${n.id}`.toLowerCase(),i=g(y,r);i!==null&&e.push({m:n,s:i,i:t})}return e.sort((e,t)=>t.s-e.s||e.i-t.i),e.map(e=>e.m)},[m,y]),x=(0,w.useRef)(null);(0,w.useEffect)(()=>{o&&(v(``),x.current?.focus())},[o]);let S=a??i?.model??r?.model??u??void 0;(0,w.useEffect)(()=>{o&&c.length===0&&W.models().then(l)},[o,c.length]),(0,w.useEffect)(()=>{!r?.model&&u===null&&m_().then(e=>{e&&d(e)})},[r?.model,u]);let C=t=>{let n=b[t];n&&(Py(e,{id:n.modelID,providerID:n.providerID}).then(kg),s(!1))},[T,,E]=kW({open:o,onClose:()=>s(!1),count:b.length,onSelect:C,listId:h,query:_,onQueryChange:v}),D=`${t?`bottom-full mb-1`:`mt-1`} ${n===`right`?`right-0`:`left-0`}`;return(0,L.jsxs)(`div`,{ref:f,className:`relative`,children:[(0,L.jsx)(cb,{variant:`outline`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`listbox`,title:`Switch model`,className:`h-7 max-w-48 gap-1 px-2 font-mono text-[11px]`,children:(0,L.jsx)(`span`,{className:`truncate`,children:S?CH(S):`model`})}),o&&(0,L.jsxs)(`div`,{className:`absolute z-40 w-72 overflow-hidden rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] shadow-xl ${D}`,children:[(0,L.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-[color:var(--border-weak-base)] px-2.5`,children:[(0,L.jsx)(qe,{className:`size-3.5 shrink-0 text-[color:var(--text-weaker)]`}),(0,L.jsx)(`input`,{ref:x,value:_,onChange:e=>v(e.target.value),placeholder:`Filter models…`,"aria-label":`Filter models`,autoComplete:`off`,spellCheck:!1,className:`h-full w-full bg-transparent font-mono text-[11px] text-[color:var(--text-strong)] outline-none placeholder:text-[color:var(--text-weaker)]`})]}),(0,L.jsx)(`div`,{id:h,role:`listbox`,"aria-label":`Switch model`,"aria-activedescendant":b.length>0?`${h}-item-${T}`:void 0,className:`max-h-72 overflow-y-auto`,onMouseMove:E,children:b.length===0?(0,L.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-[color:var(--text-weaker)]`,children:`No matching models`}):b.map((e,t)=>(0,L.jsxs)(`button`,{id:`${h}-item-${t}`,type:`button`,role:`option`,"aria-selected":S?.id===e.modelID&&S?.providerID===e.providerID,"data-hl":t===T||void 0,className:MW,onClick:()=>C(t),children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`span`,{className:`font-mono text-[color:var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`ml-2 font-mono text-[color:var(--text-weaker)]`,children:e.providerID})]}),S?.id===e.modelID&&S?.providerID===e.providerID&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]},`${e.providerID}/${e.modelID}`))})]})]})}function PW({sessionID:e,openUp:t=!1,align:n=`right`}){let{session:r,detail:i}=jW(e),a=J(e=>e.pendingModel),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),u=OW(()=>s(!1)),d=J(e=>e.uiSignals.variants);(0,w.useEffect)(()=>{d&&s(!0)},[d]),(0,w.useEffect)(()=>{o&&c.length===0&&W.models().then(l)},[o,c.length]);let f=a??i?.model??r?.model,p=c.find(e=>e.enabled&&e.modelID===f?.id&&e.providerID===f?.providerID)?.variants??[],m=f?.variant&&f.variant!=="default"?f.variant:void 0;function h(t){Py(e,{id:f.id,providerID:f.providerID,...t?{variant:t}:{}}),s(!1)}let g=`menu-variants`,[_,,v]=kW({open:o,onClose:()=>s(!1),count:p.length+1,onSelect:e=>{e===0?h():h(p[e-1]?.id)},listId:g});if(!f||p.length===0)return null;let y=`${t?`bottom-full mb-1`:`mt-1`} ${n===`right`?`right-0`:`left-0`}`;return(0,L.jsxs)(`div`,{ref:u,className:`relative`,children:[(0,L.jsx)(cb,{variant:`outline`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`listbox`,title:`Switch model variant`,className:`h-7 max-w-20 px-2 font-mono text-[11px]`,children:(0,L.jsx)(`span`,{className:`truncate`,children:m?`@${m}`:`@default`})}),o&&(0,L.jsxs)(`div`,{id:g,role:`listbox`,"aria-label":`Switch model variant`,"aria-activedescendant":`${g}-item-${_}`,className:`absolute z-40 max-h-80 w-48 overflow-y-auto rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] shadow-xl ${y}`,onMouseMove:v,children:[(0,L.jsxs)(`button`,{id:`${g}-item-0`,type:`button`,role:`option`,"aria-selected":!m,"data-hl":_===0||void 0,className:MW,onClick:()=>h(),children:[(0,L.jsx)(`span`,{className:`text-[color:var(--text-strong)]`,children:`Default`}),!m&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]}),p.map((e,t)=>(0,L.jsxs)(`button`,{id:`${g}-item-${t+1}`,type:`button`,role:`option`,"aria-selected":m===e.id,"data-hl":_===t+1||void 0,className:`${MW} font-mono text-xs`,onClick:()=>h(e.id),children:[(0,L.jsx)(`span`,{className:`text-[color:var(--text-strong)]`,children:e.id}),m===e.id&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]},e.id))]})]})}function FW({sessionID:e,openUp:t=!1,align:n=`right`}){let{session:r,detail:i}=jW(e),a=J(e=>e.pendingAgent),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),[u,d]=(0,w.useState)(null),f=OW(()=>s(!1)),p=J(e=>e.uiSignals.agents);(0,w.useEffect)(()=>{p&&s(!0)},[p]);let m=(0,w.useMemo)(()=>c.filter(e=>e.mode===`primary`&&!e.hidden),[c]),h=`menu-agents`,g=a??i?.agent??r?.agent??u??void 0;(0,w.useEffect)(()=>{o&&c.length===0&&W.agents().then(l)},[o,c.length]),(0,w.useEffect)(()=>{!r?.agent&&u===null&&AW().then(e=>{e&&d(e.id)})},[r?.agent,u]);let _=t=>{let n=m[t];n&&(Ny(e,n.id).then(kg),s(!1))},[v,,y]=kW({open:o,onClose:()=>s(!1),count:m.length,onSelect:_,listId:h}),b=`${t?`bottom-full mb-1`:`mt-1`} ${n===`right`?`right-0`:`left-0`}`;return(0,L.jsxs)(`div`,{ref:f,className:`relative`,children:[(0,L.jsx)(cb,{variant:`outline`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`listbox`,title:`Switch agent (Tab)`,className:`h-7 max-w-28 px-2 text-[11px]`,children:(0,L.jsx)(`span`,{className:`truncate`,children:g??`agent`})}),o&&(0,L.jsx)(`div`,{id:h,role:`listbox`,"aria-label":`Switch agent`,"aria-activedescendant":`${h}-item-${v}`,className:`absolute z-40 max-h-80 w-60 overflow-y-auto rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] shadow-xl ${b}`,onMouseMove:y,children:m.map((e,t)=>(0,L.jsxs)(`button`,{id:`${h}-item-${t}`,type:`button`,role:`option`,"aria-selected":g===e.id,"data-hl":t===v||void 0,className:MW,onClick:()=>_(t),children:[(0,L.jsx)(`span`,{className:`text-[color:var(--text-strong)]`,children:e.name}),g===e.id&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]},e.id))})]})}function IW({...e}){return(0,L.jsx)(ep,{"data-slot":`popover`,...e})}function LW({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,L.jsx)(np,{children:(0,L.jsx)(rp,{"data-slot":`popover-content`,align:t,sideOffset:n,className:B(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function RW({...e}){return(0,L.jsx)(tp,{"data-slot":`popover-anchor`,...e})}function zW({open:e,query:t,location:n,onOpenChange:r,onPick:i,children:a}){let[o,s]=(0,w.useState)([]),[c,l]=(0,w.useState)(n);return(0,w.useEffect)(()=>{e&&!n&&!c&&W.location().then(e=>l(e.directory)).catch(()=>void 0)},[e,n,c]),(0,w.useEffect)(()=>{if(!e){s([]);return}let n=!1,r=setTimeout(()=>{W.fsFind(t,{location:c,limit:20}).then(e=>{n||s(e.data)}).catch(()=>{n||s([])})},120);return()=>{n=!0,clearTimeout(r)}},[e,t,c]),(0,L.jsxs)(IW,{open:e,onOpenChange:r,children:[(0,L.jsx)(RW,{asChild:!0,children:a}),(0,L.jsx)(LW,{side:`top`,align:`start`,sideOffset:8,className:`w-[min(26rem,calc(100vw-2rem))] p-0`,children:(0,L.jsx)(Gm,{children:(0,L.jsxs)(Jm,{children:[o.length>0&&(0,L.jsx)(Xm,{heading:`Files`,children:o.map(e=>(0,L.jsxs)(Qm,{value:e.path,onSelect:()=>i(e),children:[e.type===`directory`?(0,L.jsx)(Ee,{className:`text-[color:var(--text-weak)]`}):(0,L.jsx)(Ce,{className:`text-[color:var(--text-weak)]`}),(0,L.jsx)(`span`,{className:`font-mono text-[color:var(--text-strong)]`,children:e.path})]},e.path))}),o.length===0&&(0,L.jsx)(Ym,{children:`No matching files`})]})})})]})}var BW=null;function VW(){return BW??=W.models().catch(()=>[]),BW}var HW=null;function UW(){return HW??=W.agents().catch(()=>[]),HW}var WW=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e);async function GW(e){try{let t=await Ly(e);await navigator.clipboard.writeText(JU(t))}catch{}}var KW=10;function qW(e,t){let n=0;for(let r of t)if(r===e[n]&&(n+=1),n===e.length)return!0;return n===e.length}function JW(e,t){let n=t.trim().toLowerCase();if(!n)return e.slice(0,KW);let r=[];for(let t of e){let e=0,i=`/${t.names[0]}`;if(i.startsWith(`/${n}`))e=1e3;else if(i.includes(n))e=600;else if(qW(n,i))e=200;else for(let r of t.names.slice(1)){let t=`/${r}`;t.startsWith(`/${n}`)?e=Math.max(e,800):t.includes(n)&&(e=Math.max(e,400))}e<100&&t.description?.toLowerCase().includes(n)&&(e=100),e>0&&r.push({entry:t,score:e})}return r.sort((e,t)=>t.score-e.score||e.entry.display.localeCompare(t.entry.display)),r.slice(0,KW).map(e=>e.entry)}function YW(){let[e,t]=(0,w.useState)(ah);return(0,w.useEffect)(()=>sh(()=>t(ah())),[]),e}function XW(e){let[t,n]=(0,w.useState)({shells:[],ptys:[]});return(0,w.useEffect)(()=>{async function t(){try{let t=e?{directory:e}:void 0,[r,i]=await Promise.all([W.shellList(t),W.ptyList(t)]);n({shells:r.data,ptys:i.data})}catch{}}return t(),Bh({name:`composer-runs`,minInterval:5e3,intervals:{live:5e3,idle:15e3},run:()=>t()})},[e]),t}function ZW(e,t){let n=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(!e)return;function r(e){n.current&&!n.current.contains(e.target)&&t()}return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[e,t]),n}function QW(e){let t=e.value.length;e.setSelectionRange(t,t)}function $W({sessionID:e,paneKey:t=`main`,onNavigate:n}){let r=e=>n?n(e):void mv(e),[i,a]=(0,w.useState)(()=>TW(e)),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),[u,d]=(0,w.useState)([]),f=YW(),[p,m]=(0,w.useState)(null),[h,g]=(0,w.useState)([]),[_,v]=(0,w.useState)([]),[y,b]=(0,w.useState)(0),[x,S]=(0,w.useState)(!1),[C,T]=(0,w.useState)(!1),[E,D]=(0,w.useState)([]),[O,k]=(0,w.useState)([]),ee=J(t=>t.running[e]??!1),A=J(t=>!!t.queued[e]),j=J(e=>e.interruptArmed),M=J(t=>t.messages[e]),te=J(t=>t.sessionDetails[e]),ne=J(t=>t.sessions.find(t=>t.id===e)?.parentID??t.sessionDetails[e]?.parentID),[N,P]=(0,w.useState)(0);(0,w.useEffect)(()=>pt(()=>P(e=>e+1)),[]);let re=(0,w.useMemo)(()=>wt(`slash`),[N]),ie=J(t=>t.sessions.find(t=>t.id===e)?.location?.directory),ae=(0,w.useRef)(null),[F,I]=(0,w.useState)(0);function oe(e){I(e.selectionStart??e.value.length)}let se=(0,w.useMemo)(()=>(M??[]).filter(e=>e.type===`user`&&!e.id.startsWith(`msg_local_`)).map(e=>e.text).filter(e=>e&&!e.startsWith(`/`)).reverse(),[M]),[ce,le]=(0,w.useState)(null),ue=(0,w.useRef)(``),de=(0,w.useRef)(e);(0,w.useEffect)(()=>{le(null),de.current!==e&&(de.current=e,a(TW(e)))},[e]),(0,w.useEffect)(()=>{de.current===e&&EW(e,i)},[e,i]);let fe=J(t=>cv(t.sessions,e)),pe=J(e=>e.running),me=J(e=>e.activeIDs),he=XW(ie),ge=e=>pe[e]||me.includes(e),_e=fe.filter(e=>ge(e.id)).length,ve=he.shells.filter(e=>e.status===`running`).length+he.ptys.filter(e=>e.status===`running`).length,ye=he.shells.length+he.ptys.length,be=[fe.length>0?_e>0?`${_e}/${fe.length} agents`:`${fe.length} agents`:null,ye>0?ve>0?`${ve}/${ye} shells`:`${ye} shells`:null].filter(Boolean).join(` · `)||`runs`,xe=_e>0||ve>0,Se=J(e=>e.runsPanelOpen),[Ce,we]=(0,w.useState)(!1),Te=ZW(Ce,()=>we(!1)),[Ee,De]=(0,w.useState)(!1),Oe=J(e=>e.pendingEdit),ke=Oe?.sessionID===e;(0,w.useEffect)(()=>{W.commands().then(l),W.skills().then(d),VW().then(D),UW().then(k)},[]);function Ae(){let e=ae.current;e&&(e.focus(),QW(e),I(e.value.length))}(0,w.useEffect)(()=>{let e=ae.current;e&&(e.focus(),QW(e),I(e.value.length))},[e]);let Me=J(e=>e.revertPrompt);(0,w.useEffect)(()=>{Me&&(a(Me),sv(),I(0),requestAnimationFrame(()=>ae.current?.setSelectionRange(0,0)))},[Me]);let Ne=Math.min(F,i.length),Pe=i.slice(0,Ne),Fe=!C&&Pe.startsWith(`/`)&&!/^\S+\s+\S/.test(Pe)&&p!==Pe,Ie=Pe.slice(1),Le=(0,w.useMemo)(()=>[{name:`new`,aliases:[`clear`],description:`New session`,run:()=>void My()},{name:`sessions`,aliases:[`resume`,`continue`],description:`Switch session`,run:()=>r(null)},{name:`move`,description:`Move session to another workspace`,run:t=>{let n=t.trim();if(og(e)){window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Create a session first`,variant:`destructive`}}));return}if(n){W.moveSession(e,n).then(()=>{window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Moved to ${n}`}})),f_(e),kg()}).catch(e=>{let t=e instanceof Error?e.message:String(e);window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Move failed: ${t}`,variant:`destructive`}}))});return}De(!0)}},{name:`undo`,description:`Undo previous message`,run:()=>void zy(e)},{name:`redo`,description:`Redo`,run:()=>void By(e)},{name:`thinking`,aliases:[`toggle-thinking`],description:f.showReasoning?`Collapse all thinking`:`Expand all thinking`,run:()=>oh(`showReasoning`,!ah().showReasoning)},{name:`timestamps`,aliases:[`toggle-timestamps`],description:f.showTimestamps?`Hide timestamps`:`Show timestamps`,run:()=>oh(`showTimestamps`,!ah().showTimestamps)},{name:`rename`,description:`Rename session`,run:t=>{let n=t.trim();n&&Fy(e,n)}},{name:`fork`,description:`Fork session`,run:()=>void Iy(e,{type:`through`}).then(e=>r(e))},{name:`export`,description:`Export session transcript`,run:()=>void qU(e)},{name:`copy`,description:`Copy session transcript`,run:()=>void GW(e)},{name:`compact`,aliases:[`summarize`],description:`Compact session`,run:()=>void Ry(e,`steer`)},{name:`connect`,description:`Connect providers & integrations`,run:()=>LA(`integrations`)},{name:`models`,aliases:[`mo`],description:`Switch model`,run:()=>nv(`models`)},{name:`variants`,description:`Switch model variant`,run:()=>nv(`variants`)},{name:`agents`,description:`Switch agent`,run:()=>nv(`agents`)},{name:`themes`,description:`Switch theme`,run:()=>nv(`themes`)},{name:`skills`,description:`Browse skills`,run:()=>we(!0)},{name:`mcps`,description:`Toggle MCPs`,run:()=>LA(`mcp`)},{name:`status`,description:`View status`,run:()=>LA(`server`)},{name:`diff`,description:`Open diff viewer`,run:()=>nv(`explorer`)},{name:`help`,description:`Help`,run:()=>nv(`help`)}],[e,f.showReasoning,f.showTimestamps]),ze=(0,w.useMemo)(()=>new Set(c.map(e=>e.name)),[c]);function Be(e){ze.has(e.name)?(a(`/${e.name} `),m(`/${e.name} `),Ae()):(a(``),fy(e.id))}let Ve=te?.model,He=(0,w.useMemo)(()=>Ve?(E.find(e=>e.enabled&&e.modelID===Ve.id&&e.providerID===Ve.providerID)?.variants?.length??0)>0:!1,[E,Ve]),Ue=(0,w.useMemo)(()=>{let t=[];for(let e of Le)e.name===`variants`&&!He||t.push({key:`action:${e.name}`,display:`/${e.name}`,names:[e.name,...e.aliases??[]],description:e.description,onSelect:()=>{a(``),e.run(``)}});for(let n of re)t.push({key:`slash:${n.id}`,display:`/${n.item.name}`,names:[n.item.name,...n.item.aliases??[]],description:n.item.description,onSelect:()=>{a(``),n.item.run(``,{sessionID:e})}});for(let e of c)t.push({key:`command:${e.name}`,display:`/${e.name}`,names:[e.name],description:e.description,onSelect:()=>{a(`/${e.name} `),m(`/${e.name} `),Ae()}});for(let e of u)t.push({key:`skill:${e.id}`,display:`/${e.name}`,names:[e.name],description:e.description,onSelect:()=>Be(e)});return t.sort((e,t)=>e.display.localeCompare(t.display))},[Le,re,c,u,ze,He,e]),We=(0,w.useMemo)(()=>JW(Ue,Ie),[Ue,Ie]),Ge=(0,w.useMemo)(()=>{let e=i.lastIndexOf(`@`);if(e===-1)return;let t=e===0?``:i[e-1],n=i.slice(e+1);if((e===0||/\s/.test(t))&&!/\s/.test(n))return n},[i]);(0,w.useEffect)(()=>{S(!1)},[i]);let Ke=(0,w.useMemo)(()=>{let e=M??[];for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`assistant`)return n}},[M]),qe=Ke?.type===`assistant`?Ke.tokens:void 0,Ye=qe?qe.input+qe.output+qe.reasoning+qe.cache.read+qe.cache.write:void 0,Xe=(Ke?.type===`assistant`?Ke.cost:void 0)??te?.cost??0,Ze=E.find(e=>e.enabled&&e.modelID===Ve?.id&&e.providerID===Ve?.providerID)?.limit?.context,Qe=Ye&&Ze?Math.round(Ye/Ze*100):void 0,$e=[Ye===void 0?void 0:`${WW(Ye)} tok`,Qe===void 0?void 0:`${Qe}% ctx`,Xe>0?`$${Xe.toFixed(4)}`:void 0].filter(Boolean),et=te?.agent;function nt(t){let n=O.filter(e=>e.mode===`primary`&&!e.hidden);if(n.length===0)return;let r=n.findIndex(e=>e.id===et),i=n[(((r===-1?0:r)+t)%n.length+n.length)%n.length];Ny(e,i.id).then(()=>void f_(e))}function rt(e,t){let n=yH(e)??`application/octet-stream`;v(r=>[...r,{id:`att_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,name:e.split(`/`).pop()||e,mime:n,uri:`data:${n};base64,${SH(t)}`}])}function it(e){let t=i.lastIndexOf(`@`);if(t===-1)return;if(e.type===`file`&&mH(e.path)){a(i.slice(0,t)+i.slice(t+1+(Ge?.length??0))),Ae(),W.fsReadBytes(e.path,ie).then(t=>rt(e.path,t)).catch(()=>void 0);return}let n=`@${e.path}`;a(i.slice(0,t)+n+` `),g(t=>[...t,{path:e.path}]),ie&&W.fsRead(e.path,ie).then(t=>g(n=>n.map(n=>n.path===e.path?{path:n.path,content:t}:n))).catch(()=>void 0),Ae()}async function ot(){if(og(e))try{return await jy(i)}catch{return null}return e||null}async function st(t){let n=i.trim();if(!(!n&&_.length===0||o)){s(!0),le(null);try{if(!C&&n.startsWith(`/`)){let t=n.slice(1).split(` `),r=t[0],i=Le.find(e=>e.name===r||e.aliases?.includes(r));if(i){i.run(t.slice(1).join(` `)),a(``),g([]),v([]);return}let o=re.find(e=>e.item.name===r||e.item.aliases?.includes(r));if(o){await o.item.run(t.slice(1).join(` `),{sessionID:e}),a(``),g([]),v([]);return}}let r=await ot();if(!r)return;let i=pg().pendingEdit;if(i&&i.sessionID===r){let{commitPendingEdit:e}=await Wh(async()=>{let{commitPendingEdit:e}=await Promise.resolve().then(()=>Gh);return{commitPendingEdit:e}},void 0);await e(r)}if(C)await Zv(n.startsWith(`!`)?n.slice(1):n);else if(n.startsWith(`!`))await Zv(n.slice(1));else if(n.startsWith(`/`)){let e=n.slice(1).split(` `),t=e[0];await Xv(t,e.slice(1).join(` `)||void 0)}else if(h.length>0||_.length>0){let e=pg().draftWorkspace,i=ie??e??void 0,a=[];for(let e of h){if(!i)continue;let t=`@${e.path}`,r=n.indexOf(t);a.push({uri:`file://${encodeURI(`${i.replace(/\/+$/,``)}/${e.path}`)}`,name:e.path,mention:r===-1?void 0:{start:r,end:r+t.length,text:t}})}for(let e of _)a.push(vH(e));a.length>0?await Qv(n,a):await Fv(r,n,t)}else await Fv(r,n,t);a(``),g([]),v([])}catch{a(n)}finally{s(!1),Ae()}}}let ct=C?`bash — esc to exit`:ee?`Agent is working… — ↵ steers · ctrl+↵ queues`:A?`Waiting for the agent… — ↵ steers · ctrl+↵ queues`:`Message the agent…`,lt=C?(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--surface-brand-base)]`,children:`Shell`}),` · esc to exit`]}):ee&&j?(0,L.jsx)(`p`,{className:`font-medium text-[color:var(--surface-warning-strong)]`,children:`Press esc again to interrupt`}):ee||A?(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(lb,{className:`size-3`}),ee?`Working… · esc to interrupt`:`Waiting…`,i.trim()?` · ↵ steer · ctrl+↵ queue`:``]}):(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`Tab`}),` agent,`,` `,(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`/`}),` commands,`,` `,(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`@`}),` files,`,` `,(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`!`}),` bash`]}),ut=ie?.split(`/`).filter(Boolean).pop();return(0,L.jsxs)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2.5 pt-2`,children:[(0,L.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,L.jsx)(`div`,{className:`relative`,children:Ce&&(0,L.jsxs)(`div`,{ref:Te,className:`absolute bottom-full left-0 z-40 mb-2 max-h-80 w-[min(26rem,calc(100vw-2rem))] overflow-y-auto rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] p-1 shadow-xl`,children:[u.length===0&&(0,L.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-[color:var(--text-weaker)]`,children:`No skills available`}),u.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{we(!1),Be(e)},className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-[color:var(--surface-base-hover)]`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-[color:var(--text-strong)]`,children:[`/`,e.name]}),e.description&&(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-[color:var(--text-weaker)]`,children:e.description})]},e.id))]})}),(0,L.jsxs)(IW,{open:Fe,children:[(0,L.jsx)(RW,{asChild:!0,children:(0,L.jsxs)(`div`,{"data-oc-composer":!0,onDragEnter:e=>{Array.from(e.dataTransfer.types).includes(`Files`)&&b(e=>e+1)},onDragOver:e=>{Array.from(e.dataTransfer.types).includes(`Files`)&&e.preventDefault()},onDragLeave:()=>b(e=>Math.max(0,e-1)),onDrop:e=>{b(0),e.dataTransfer.files.length!==0&&(e.preventDefault(),_H(e.dataTransfer.files).then(e=>{e.length>0&&v(t=>[...t,...e])}))},className:`rounded-lg border bg-[color:var(--input-base)] p-2 transition-colors focus-within:border-[color:var(--border-selected)] ${y>0||C?`border-[color:var(--surface-brand-base)]`:`border-[color:var(--border-base)]`}`,children:[ke&&Oe&&(0,L.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1.5 text-xs`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium text-amber-700 dark:text-amber-300`,children:[(0,L.jsx)(Re,{className:`size-3`}),` Editing`]}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[var(--text-weaker)]`,title:Oe.originalText,children:Oe.originalText.slice(0,80).replace(/\s+/g,` `)||`(empty)`}),(0,L.jsx)(`span`,{className:`hidden text-[10px] text-[var(--text-weaker)] sm:inline`,children:`will revert on send`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{Wh(()=>Promise.resolve().then(()=>Gh).then(e=>e.clearPendingEdit()),void 0)},title:`Dismiss edit — next send is a normal message`,className:`ml-auto flex size-6 cursor-pointer items-center justify-center rounded-md hover:bg-black/10 dark:hover:bg-white/10`,children:(0,L.jsx)(at,{className:`size-3`})})]}),_.length>0&&(0,L.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-start gap-2 border-b border-[color:var(--border-weak-base)] pb-1.5`,children:[_.map(e=>(0,L.jsxs)(`span`,{className:`relative inline-block`,title:`${e.name} (${e.mime})`,children:[(0,L.jsx)(`img`,{src:e.uri,alt:e.name,draggable:!1,className:`size-12 rounded-md border border-[color:var(--border-weak-base)] object-cover`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>v(t=>t.filter(t=>t.id!==e.id)),title:`Remove attachment`,className:`absolute -right-1.5 -top-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] text-[color:var(--text-weak)] transition-colors hover:text-[color:var(--text-strong)]`,children:(0,L.jsx)(at,{className:`size-2.5`})})]},e.id)),(0,L.jsxs)(`span`,{className:`self-center text-[11px] text-[color:var(--text-weaker)]`,children:[`image`,_.length===1?``:`s`,` attached`]})]}),(0,L.jsx)(zW,{open:Ge!==void 0&&!x&&!Fe,query:Ge??``,location:ie,onOpenChange:S,onPick:it,children:(0,L.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,L.jsx)(Fm,{id:`composer-input-${t}`,"data-oc-composer-input":!0,ref:ae,value:i,placeholder:ct,className:`max-h-40 min-h-0 flex-1 resize-none border-0 bg-transparent px-1.5 py-1 text-sm placeholder:text-[color:var(--text-weaker)] focus-visible:ring-0 ${C?`font-mono`:``}`,onChange:e=>{le(null),a(e.target.value),oe(e.currentTarget)},onSelect:e=>oe(e.currentTarget),onClick:e=>oe(e.currentTarget),onKeyUp:e=>oe(e.currentTarget),onPaste:e=>{let t=[];for(let n of Array.from(e.clipboardData?.items??[])){if(n.kind!==`file`)continue;let e=n.getAsFile();e&&t.push(e)}t.some(e=>e.type.startsWith(`image/`)||mH(e.name))&&(e.preventDefault(),_H(t).then(e=>{e.length>0&&v(t=>[...t,...e])}))},onKeyDown:t=>{if(Fe){if(t.key===`Escape`){t.preventDefault(),Ne===i.length&&!i.endsWith(` `)?a(``):m(Pe);return}if(t.key===`ArrowDown`){t.preventDefault(),Hm(1);return}if(t.key===`ArrowUp`){t.preventDefault(),Hm(-1);return}if(t.key===`Enter`){t.preventDefault(),Um();return}if(t.key===`Tab`){t.preventDefault(),Um();return}}if(Ge!==void 0&&!x&&!Fe&&document.querySelector(`[data-slot="command-item"]`)){if(t.key===`ArrowDown`){t.preventDefault(),Hm(1);return}if(t.key===`ArrowUp`){t.preventDefault(),Hm(-1);return}if(t.key===`Enter`&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey&&!t.altKey){t.preventDefault(),Um();return}}if(Ce&&t.key===`Escape`){t.preventDefault(),we(!1);return}if(!Fe&&Ge===void 0&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.shiftKey){if(t.key===`ArrowUp`){let e=t.currentTarget;if(e.selectionStart===0&&e.selectionEnd===0&&se.length>0){t.preventDefault(),ce===null&&(ue.current=i);let n=ce===null?0:Math.min(ce+1,se.length-1);le(n);let r=se[n]??``;a(r),I(0),requestAnimationFrame(()=>e.setSelectionRange(0,0))}return}if(t.key===`ArrowDown`){let e=t.currentTarget;if(e.selectionStart===i.length&&e.selectionEnd===i.length){if(ce===null)t.preventDefault(),rv();else if(ce<=0)t.preventDefault(),le(null),a(ue.current),I(ue.current.length),requestAnimationFrame(()=>e.setSelectionRange(ue.current.length,ue.current.length));else{t.preventDefault();let n=Math.min(ce-1,se.length-1);le(n);let r=se[Math.max(n,0)]??``;a(r),I(r.length),requestAnimationFrame(()=>e.setSelectionRange(r.length,r.length))}}return}}if(t.key.toLowerCase()===`b`&&t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.shiftKey){Fe||(t.preventDefault(),(ee||A)&&vy(e));return}if(t.key===`Escape`){if(t.preventDefault(),C){T(!1);return}if(ee){_y();return}return}if(t.key===`Tab`){t.preventDefault(),nt(t.shiftKey?-1:1);return}if(t.key===`Backspace`&&!i&&ne){t.preventDefault(),r(ne);return}if(t.key===`Enter`&&!t.shiftKey&&!t.altKey&&(t.ctrlKey||t.metaKey)&&!Fe&&Ge===void 0){t.preventDefault(),st(C?void 0:{delivery:`queue`});return}t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),st())}}),o?(0,L.jsx)(lb,{className:`mb-1.5 mr-2`}):(0,L.jsxs)(H,{variant:`default`,size:`sm`,"data-oc-composer-send":!0,disabled:!i.trim()&&_.length===0,onClick:()=>void st(),title:ee?`Send (↵ steer · ctrl+↵ queue)`:`Send (Enter)`,children:[(0,L.jsx)(Je,{}),`Send`]})]})}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 border-t border-[color:var(--border-weak-base)] px-1 pt-1`,children:[(0,L.jsxs)(`button`,{type:`button`,"data-runs-panel-trigger":!0,onClick:()=>Se?iv():rv(),title:Se?`Close subagents & shells (↓)`:`Subagents & shells — opens the runs panel (↓)`,className:`flex h-6 cursor-pointer items-center gap-1 rounded-md px-1.5 font-mono text-[11px] transition-colors ${xe?`text-[color:var(--surface-brand-base)] hover:bg-[color:var(--surface-base-hover)]`:`text-[color:var(--text-weaker)] hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-weak)]`}`,children:[(0,L.jsx)(je,{className:`size-3`}),be]}),(0,L.jsx)(`button`,{type:`button`,title:`Shell mode (! command)`,onClick:()=>T(e=>!e),className:`flex size-6 cursor-pointer items-center justify-center rounded-md transition-colors ${C?`bg-[color:var(--surface-brand-weak)] text-[color:var(--surface-brand-strong)]`:`text-[color:var(--text-weaker)] hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-weak)]`}`,children:(0,L.jsx)(tt,{className:`size-3.5`})}),(0,L.jsx)(FW,{sessionID:e,openUp:!0,align:`left`}),(0,L.jsx)(NW,{sessionID:e,openUp:!0,align:`left`}),(0,L.jsx)(PW,{sessionID:e,openUp:!0,align:`left`}),(0,L.jsx)(Ct,{id:`composer.contextReadout`,parts:$e})]})]})}),(0,L.jsx)(LW,{side:`top`,align:`start`,sideOffset:8,className:`w-[min(26rem,calc(100vw-2rem))] p-0`,onOpenAutoFocus:e=>e.preventDefault(),children:(0,L.jsx)(Gm,{children:(0,L.jsxs)(Jm,{children:[We.map(e=>(0,L.jsxs)(Qm,{value:e.key,onSelect:e.onSelect,children:[(0,L.jsx)(`span`,{className:`font-mono text-[color:var(--text-base)]`,children:e.display}),e.description&&(0,L.jsx)(`span`,{className:`ml-auto max-w-[55%] truncate pl-3 text-xs text-[color:var(--text-weaker)]`,children:e.description})]},e.key)),We.length===0&&(0,L.jsx)(Ym,{children:`No matching items`})]})})})]}),(0,L.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between px-1 text-[11px] text-[color:var(--text-weaker)]`,children:[lt,ut&&(0,L.jsx)(`p`,{className:`hidden truncate font-mono sm:block`,children:ut})]})]}),Ee&&(0,L.jsx)(eG,{sessionID:e,currentDirectory:ie,onClose:()=>De(!1),onMoved:t=>{De(!1),window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Moved to ${t}`}})),f_(e),kg()}})]})}function eG({sessionID:e,currentDirectory:t,onClose:n,onMoved:r}){let[i,a]=(0,w.useState)([]),[o,s]=(0,w.useState)(``),[c,l]=(0,w.useState)(!0);(0,w.useEffect)(()=>{let e=!1;return(async()=>{try{let[n,r]=await Promise.all([W.projectList().catch(()=>[]),W.location().catch(()=>null)]);if(e)return;let i=new Set;for(let e of n){let t=e.directory;t&&i.add(t)}r?.directory&&i.add(r.directory),t&&i.add(t),a([...i].sort())}catch{}e||l(!1)})(),()=>{e=!0}},[t]);let u=t=>{let n=t.trim();n&&W.moveSession(e,n).then(()=>r(n)).catch(e=>{let t=e instanceof Error?e.message:String(e);window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Move failed: ${t}`,variant:`destructive`}}))})};return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,onClick:n,children:(0,L.jsxs)(`div`,{className:`w-full max-w-lg rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 shadow-xl`,onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-[var(--text-strong)]`,children:`Move session`}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-[var(--text-weaker)]`,children:`Pick a workspace or enter a path. Mirrors the TUI picker.`}),c?(0,L.jsx)(`p`,{className:`mt-4 text-xs text-[var(--text-weaker)]`,children:`Loading workspaces…`}):(0,L.jsxs)(`div`,{className:`mt-3 max-h-56 overflow-y-auto rounded-md border border-[var(--border-weak-base)]`,children:[i.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-xs hover:bg-[var(--surface-base-hover)] ${e===t?`bg-[var(--surface-raised-base-active)] font-medium`:``}`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[var(--text-strong)]`,children:e.replace(/^\/(home|Users)\/[^/]+/,`~`)}),e===t&&(0,L.jsx)(`span`,{className:`ml-2 text-[10px] text-[var(--text-weaker)]`,children:`current`})]},e)),i.length===0&&(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs text-[var(--text-weaker)]`,children:`No workspaces found`})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,L.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u(o),e.key===`Escape`&&n()},placeholder:`Custom path — e.g. /home/z/projects/foo`,className:`flex-1 rounded-md border border-[var(--border-base)] bg-[var(--input-base)] px-2.5 py-1.5 font-mono text-xs outline-none focus:border-[var(--border-selected)]`,autoFocus:!0}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(o),disabled:!o.trim(),className:`rounded-md bg-[var(--surface-brand-base)] px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50`,children:`Move`}),(0,L.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md border border-[var(--border-weak-base)] px-3 py-1.5 text-xs`,children:`Cancel`})]})]})})}function tG({parts:e}){return e.length===0?null:(0,L.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-[color:var(--text-weaker)]`,title:`Tokens used · share of model context window · session cost`,children:e.join(` · `)})}_t({composer:e=>(0,L.jsx)($W,{...e}),"composer.contextReadout":e=>(0,L.jsx)(tG,{parts:e.parts})});var nG=new Map;function rG(e,t){for(nG.delete(e),nG.set(e,t);nG.size>2e3;){let e=nG.keys().next().value;if(!e)break;nG.delete(e)}}function iG({part:e,stateKey:t}){let[n,r]=(0,w.useState)(ah().showToolDetails);(0,w.useEffect)(()=>sh(()=>r(ah().showToolDetails)),[]);let[,i]=(0,w.useState)(0);(0,w.useEffect)(()=>pt(()=>i(e=>e+1)),[]);let a=vt(`tool:${e.name}`);if(a.replaces.length>0||a.wraps.length>0){let t=St(`tool:${e.name}`,{part:e});if(t!=null)return(0,L.jsx)(L.Fragment,{children:t})}if(!e.state)return null;let o=e.state,s=o.status===`completed`&&o.content?.some(e=>e.type===`file`&&pG(e.mime));if(!n&&o.status===`completed`&&!s)return null;let c=o.status===`streaming`?{}:o.input??{},l=o.status===`streaming`?{}:`metadata`in o?o.metadata??{}:{},u={part:e,state:o,stateKey:t,input:c,meta:l,output:o.status===`completed`||o.status===`error`?oG(o.content):void 0,error:o.status===`error`?o.error:void 0,streamingText:o.status===`streaming`?o.input:void 0},d=(()=>{switch(e.name){case`edit`:return(0,L.jsx)(Ct,{id:`tool.edit`,...u});case`write`:return(0,L.jsx)(Ct,{id:`tool.write`,...u});case`shell`:case`bash`:return(0,L.jsx)(Ct,{id:`tool.shell`,...u});case`subagent`:case`task`:return(0,L.jsx)(Ct,{id:`tool.subagent`,...u});case`execute`:return(0,L.jsx)(Ct,{id:`tool.execute`,...u});case`read`:return(0,L.jsx)(cG,{...u,icon:`→`,pending:`Reading file…`,label:(0,L.jsxs)(L.Fragment,{children:[`Read `,(0,L.jsx)(sG,{value:c.path}),c.offset!==void 0&&(0,L.jsxs)(`span`,{className:`text-[var(--text-weaker)]`,children:[` from `,String(c.offset)]})]})});case`grep`:return(0,L.jsx)(cG,{...u,icon:`✱`,pending:`Searching content…`,label:(0,L.jsxs)(L.Fragment,{children:[`Grep "`,c.pattern,`" `,(0,L.jsx)(sG,{value:c.path,prefix:`in `}),l.matches!==void 0&&(0,L.jsxs)(`span`,{className:`text-[var(--text-weaker)]`,children:[` (`,String(l.matches),` matches)`]})]})});case`glob`:return(0,L.jsx)(cG,{...u,icon:`✱`,pending:`Finding files…`,label:(0,L.jsxs)(L.Fragment,{children:[`Glob "`,c.pattern,`" `,(0,L.jsx)(sG,{value:c.path,prefix:`in `}),l.count!==void 0&&(0,L.jsxs)(`span`,{className:`text-[var(--text-weaker)]`,children:[` (`,String(l.count),`)`]})]})});case`webfetch`:return(0,L.jsx)(cG,{...u,icon:`%`,pending:`Fetching from the web…`,label:(0,L.jsxs)(L.Fragment,{children:[e.name,` `,c.url]})});case`websearch`:return(0,L.jsx)(cG,{...u,icon:`◈`,pending:`Searching web…`,label:(0,L.jsxs)(L.Fragment,{children:[`Search "`,c.query,`"`]})});default:return(0,L.jsx)(Ct,{id:`tool.generic`,...u,name:e.name})}})();return(0,L.jsx)(`div`,{"data-oc-tool-card":!0,"data-oc-tool-name":e.name,children:d})}function aG(e){return typeof e==`string`&&e?e:void 0}function oG(e){return(e??[]).filter(e=>e.type===`text`).map(e=>e.text??``).join(`
|
|
118
|
+
`);r&&(u=r)}a.push((0,L.jsx)(TM,{messageId:r.id,id:`msg-${r.id}`,children:(0,L.jsx)(WH,{message:r,compact:s,sessionID:e,isTail:l,responseText:u})},r.id))}return n.length>0&&a.push((0,L.jsx)(TM,{children:(0,L.jsx)(_W,{assistants:n,running:r})},`live`)),a})()]})},fW);function mW(){return(0,L.jsx)(`div`,{className:`flex justify-center pt-16`,children:(0,L.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-1.5 rounded-lg border border-[var(--border-weak-base)] bg-[var(--background-weak)] px-8 py-10 text-center`,children:[(0,L.jsx)(`h1`,{className:`text-[var(--font-size-large)] font-medium text-[var(--text-base)]`,children:`Start a conversation`}),(0,L.jsx)(`p`,{className:`text-[var(--font-size-base)] text-[var(--text-weaker)]`,children:`The agent can read, edit, and run commands in the session workspace.`})]})})}function hW(e){return e.replace(/\/+$/,``).replace(/^\/(home|Users)\/[^/]+/,`~`)}function gW({title:e,sessionID:t,running:n,queued:r,parentID:i,go:a,onClose:o}){let s=J(e=>e.sessionDetails[i??``]?.title),c=og(t),l=J(e=>e.draftWorkspace);return(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[var(--border-base)] px-4 py-2.5`,"data-oc-session-header":!0,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(i),title:`Back to parent session${s?`: ${s}`:``}`,className:`cursor-pointer rounded-md border border-[var(--border-weak-base)] px-1.5 py-0.5 text-xs text-[var(--text-weak)] transition-colors hover:border-[var(--border-selected)] hover:text-[var(--text-strong)]`,children:`↑ Parent`}),(0,L.jsx)(`button`,{type:`button`,className:`mr-1 cursor-pointer text-[var(--text-weaker)] transition-colors hover:text-[var(--text-strong)] lg:hidden`,onClick:()=>o?o():a(null),children:`←`}),(0,L.jsx)(`span`,{className:`truncate text-[var(--font-size-base)] font-medium text-[var(--text-strong)]`,children:c?`New session`:e??`Untitled session`}),c?(0,L.jsx)(`span`,{className:`hidden truncate font-mono text-xs text-[var(--text-weaker)] sm:inline`,children:l?hW(l):`default workspace`}):(0,L.jsx)(`span`,{className:`hidden font-mono text-xs text-[var(--text-weaker)] sm:inline`,children:t.slice(0,12)}),r&&!n&&(0,L.jsx)(ob,{className:`border-transparent bg-[var(--surface-warning-weak)] text-[var(--surface-warning-strong)]`,title:`Message sent — waiting for the agent to start responding`,children:`waiting`}),n&&(0,L.jsx)(ob,{className:`border-transparent bg-[var(--surface-interactive-weak)] text-[var(--text-interactive-base)]`,children:`working`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[o&&(0,L.jsx)(`button`,{type:`button`,onClick:o,title:`Close split`,className:`flex size-6 cursor-pointer items-center justify-center rounded-md text-[var(--text-weaker)] transition-colors hover:bg-[color:var(--surface-base-hover)] hover:text-[var(--text-strong)]`,children:(0,L.jsx)(at,{className:`size-3.5`})}),(0,L.jsx)(aW,{sessionID:t}),(0,L.jsx)(nW,{}),(0,L.jsx)(UU,{sessionID:t})]})]})}function _W({assistants:e,running:t}){let n=e.flatMap(e=>e.content.map(t=>({key:yW(e.id,t),part:t}))),r=e.filter(e=>e.error).map(e=>({id:e.id,error:e.error}));return n.length===0&&!t&&r.length===0?null:(0,L.jsxs)(`div`,{children:[r.map(({id:e,error:t})=>(0,L.jsxs)(`div`,{className:`mb-2 rounded-md border border-[color-mix(in_oklch,var(--surface-critical-strong)_40%,transparent)] bg-[var(--surface-critical-weak)] px-3 py-2 text-xs text-[var(--text-on-critical-strong)]`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:t.type}),(0,L.jsx)(`div`,{className:`mt-0.5`,children:t.message})]},e)),n.length===0&&t&&r.length===0&&(0,L.jsx)(`div`,{className:`flex items-center gap-2 py-1 text-[var(--font-size-base)] text-[var(--text-weak)] animate-pulse`,children:`thinking…`}),n.map(({key:e,part:t})=>(0,L.jsx)(aU,{stateKey:e,part:t.type===`tool`?u_(t.tool):t},e))]})}function vW({messages:e}){let t=(0,w.useMemo)(()=>e.filter(e=>e.type===`user`),[e]),[n,r]=(0,w.useState)(null);if((0,w.useEffect)(()=>{if(t.length===0)return;let e=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>t.intersectionRatio-e.intersectionRatio);if(t[0]?.target){let e=t[0].target.id.replace(/^msg-/,``);r(e)}},{root:null,rootMargin:`-30% 0px -60% 0px`,threshold:[0,.25,.5,1]}),n=[];for(let r of t){let t=document.getElementById(`msg-${r.id}`);t&&(e.observe(t),n.push(t))}return()=>{for(let t of n)e.unobserve(t);e.disconnect()}},[t]),t.length<3)return null;let i=e=>{let t=document.getElementById(`msg-${e}`);if(t)t.scrollIntoView({behavior:`smooth`,block:`start`});else try{let t=`[data-message-id="${CSS.escape(e)}"]`;document.querySelector(t)?.scrollIntoView({behavior:`smooth`,block:`start`})}catch{}};return(0,L.jsx)(`div`,{className:`pointer-events-none absolute top-1/2 right-3 hidden -translate-y-1/2 flex-col items-center justify-center md:flex`,style:{maxHeight:`min(70vh, 560px)`},children:(0,L.jsxs)(`div`,{className:`pointer-events-auto flex flex-col items-center gap-2 rounded-full border border-[var(--border-weak-base)] bg-[var(--background-base)]/95 px-2 py-3 shadow-md backdrop-blur`,children:[(0,L.jsx)(`div`,{className:`absolute inset-y-3 w-px bg-[var(--border-weak-base)]`}),t.map(e=>{let t=(e.text??``).replace(/\s+/g,` `).slice(0,400)||e.id.slice(0,8),r=e.id===n;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),title:t,className:`group relative flex size-4 items-center justify-center`,children:[(0,L.jsx)(`span`,{className:`rounded-full ring-1 transition-all ${r?`size-3 bg-[var(--surface-brand-base)] ring-[var(--surface-brand-base)] shadow-sm`:`size-2 bg-[var(--text-weaker)] ring-[var(--border-weak-base)] group-hover:size-2.5 group-hover:bg-[var(--text-strong)]`}`}),(0,L.jsx)(`span`,{className:`pointer-events-none absolute right-full mr-4 hidden max-w-[560px] whitespace-pre-wrap rounded-xl border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] px-4 py-3 text-sm leading-relaxed text-[var(--text-weak)] shadow-xl group-hover:block`,children:t})]},e.id)})]})})}function yW(e,t){return t.type===`tool`?`${e}:tool:${t.tool.id}`:`${e}:${t.type}:${t.ordinal}`}_t({conversation:e=>(0,L.jsx)(oW,{...e}),"conversation.header":e=>(0,L.jsx)(gW,{...e}),"conversation.empty":e=>(0,L.jsx)(mW,{...e})});var bW=s({clearDraft:()=>DW,loadDraft:()=>TW,saveDraft:()=>EW}),xW=`webui.drafts`,SW=50;function CW(){try{let e=localStorage.getItem(xW);if(!e)return{};let t=JSON.parse(e);return t&&typeof t==`object`?t:{}}catch{return{}}}function wW(e){try{let t=Object.entries(e).sort((e,t)=>t[1].at-e[1].at).slice(0,SW);localStorage.setItem(xW,JSON.stringify(Object.fromEntries(t)))}catch{}}function TW(e){return CW()[e]?.text??``}function EW(e,t){let n=CW();if(t)n[e]={text:t,at:Date.now()};else{if(!(e in n))return;delete n[e]}wW(n)}function DW(e){let t=CW();e in t&&(delete t[e],wW(t))}function OW(e){let t=(0,w.useRef)(null);return(0,w.useEffect)(()=>{function n(n){t.current&&!t.current.contains(n.target)&&e()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e]),t}function kW({open:e,onClose:t,count:n,onSelect:r,listId:i,query:a,onQueryChange:o}){let[s,c]=(0,w.useState)(0),l=(0,w.useRef)(0);l.current=s;let u=(0,w.useRef)({prefix:``,at:0});(0,w.useEffect)(()=>{e&&c(0)},[e,a]),(0,w.useEffect)(()=>{e&&document.getElementById(`${i}-item-${s}`)?.scrollIntoView({block:`nearest`})},[e,s,i]);function d(e){let t=e.currentTarget,n=Array.from(t.querySelectorAll(`[role="option"]`));for(let t of n){let r=t.getBoundingClientRect();if(e.clientY>=r.top&&e.clientY<r.bottom){c(n.indexOf(t));return}}}return(0,w.useEffect)(()=>{if(!e)return;let s=null,d=e=>{if(e.key===`Escape`||e.key===`Tab`){if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`&&o&&a){o(``);return}t();return}if(n===0)return;if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),c(e=>(e+1)%n);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),c(e=>e<=0?n-1:e-1);return}if(e.key===`Home`){e.preventDefault(),e.stopPropagation(),c(0);return}if(e.key===`End`){e.preventDefault(),e.stopPropagation(),c(n-1);return}if(e.key===`Enter`){e.preventDefault(),e.stopPropagation(),r(l.current<n?l.current:0);return}if(o)return;let d=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?e.key.toLowerCase():null;if(!d)return;let f=Date.now(),p=u.current,m=f-p.at<1e3?p.prefix+d:d;p.prefix=m,p.at=f,s??=Array.from(document.querySelectorAll(`#${i} > button`)).map(e=>(e.textContent??``).trim().toLowerCase()),c(e=>{for(let t=1;t<=n;t++){let r=(e+t)%n;if((s?.[r]??``).startsWith(m))return r}return e})};return window.addEventListener(`keydown`,d,!0),()=>window.removeEventListener(`keydown`,d,!0)},[e,n,t,r,i,a,o]),[s,c,d]}async function AW(){try{let e=await W.agents();return e.find(e=>e.mode===`primary`&&!e.hidden)??e[0]}catch{return}}function jW(e){let t=J(t=>t.sessions.find(t=>t.id===e)),n=J(t=>t.sessionDetails[e]);return(0,w.useEffect)(()=>{f_(e)},[e]),{session:t,detail:n}}var MW=`flex w-full cursor-pointer items-center justify-between px-3 py-2 text-left transition-colors hover:bg-[color:var(--surface-base-hover)] data-[hl=true]:bg-[color:var(--surface-raised-base-active)]`;function NW({sessionID:e,openUp:t=!1,align:n=`right`}){let{session:r,detail:i}=jW(e),a=J(e=>e.pendingModel),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),[u,d]=(0,w.useState)(null),f=OW(()=>s(!1)),p=J(e=>e.uiSignals.models);(0,w.useEffect)(()=>{p&&s(!0)},[p]);let m=(0,w.useMemo)(()=>c.filter(e=>e.enabled),[c]),h=`menu-models`;function g(e,t){if(t.includes(e)){let n=t.indexOf(e),r=1e3-n*2;return(n===0||t[n-1]===` `||t[n-1]===`/`||t[n-1]===`-`)&&(r+=20),r}let n=0,r=-2,i=0,a=0,o=0,s=0,c=0;for(let l=0;l<t.length&&n<e.length;l++)t[l]===e[n]&&((l===0||t[l-1]===` `||t[l-1]===`/`||t[l-1]===`-`)&&c++,r+1===l?(a++,s++,o=Math.max(o,s)):(i+=l-r-1,s=1),r=l,n++);return n===e.length?500-r*.5-i*2+a*10+c*2+o*3:null}let[_,v]=(0,w.useState)(``),y=_.trim().toLowerCase(),b=(0,w.useMemo)(()=>{if(!y)return m;let e=[];for(let t=0;t<m.length;t++){let n=m[t],r=`${n.name} ${n.modelID} ${n.providerID} ${n.id}`.toLowerCase(),i=g(y,r);i!==null&&e.push({m:n,s:i,i:t})}return e.sort((e,t)=>t.s-e.s||e.i-t.i),e.map(e=>e.m)},[m,y]),x=(0,w.useRef)(null);(0,w.useEffect)(()=>{o&&(v(``),x.current?.focus())},[o]);let S=a??i?.model??r?.model??u??void 0;(0,w.useEffect)(()=>{o&&c.length===0&&W.models().then(l)},[o,c.length]),(0,w.useEffect)(()=>{!r?.model&&u===null&&m_().then(e=>{e&&d(e)})},[r?.model,u]);let C=t=>{let n=b[t];n&&(Py(e,{id:n.modelID,providerID:n.providerID}).then(kg),s(!1))},[T,,E]=kW({open:o,onClose:()=>s(!1),count:b.length,onSelect:C,listId:h,query:_,onQueryChange:v}),D=`${t?`bottom-full mb-1`:`mt-1`} ${n===`right`?`right-0`:`left-0`}`;return(0,L.jsxs)(`div`,{ref:f,className:`relative`,children:[(0,L.jsx)(cb,{variant:`outline`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`listbox`,title:`Switch model`,className:`h-7 max-w-48 gap-1 px-2 font-mono text-[11px]`,children:(0,L.jsx)(`span`,{className:`truncate`,children:S?CH(S):`model`})}),o&&(0,L.jsxs)(`div`,{className:`absolute z-40 w-72 overflow-hidden rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] shadow-xl ${D}`,children:[(0,L.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-[color:var(--border-weak-base)] px-2.5`,children:[(0,L.jsx)(qe,{className:`size-3.5 shrink-0 text-[color:var(--text-weaker)]`}),(0,L.jsx)(`input`,{ref:x,value:_,onChange:e=>v(e.target.value),placeholder:`Filter models…`,"aria-label":`Filter models`,autoComplete:`off`,spellCheck:!1,className:`h-full w-full bg-transparent font-mono text-[11px] text-[color:var(--text-strong)] outline-none placeholder:text-[color:var(--text-weaker)]`})]}),(0,L.jsx)(`div`,{id:h,role:`listbox`,"aria-label":`Switch model`,"aria-activedescendant":b.length>0?`${h}-item-${T}`:void 0,className:`max-h-72 overflow-y-auto`,onMouseMove:E,children:b.length===0?(0,L.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-[color:var(--text-weaker)]`,children:`No matching models`}):b.map((e,t)=>(0,L.jsxs)(`button`,{id:`${h}-item-${t}`,type:`button`,role:`option`,"aria-selected":S?.id===e.modelID&&S?.providerID===e.providerID,"data-hl":t===T||void 0,className:MW,onClick:()=>C(t),children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`span`,{className:`font-mono text-[color:var(--text-strong)]`,children:e.name}),(0,L.jsx)(`span`,{className:`ml-2 font-mono text-[color:var(--text-weaker)]`,children:e.providerID})]}),S?.id===e.modelID&&S?.providerID===e.providerID&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]},`${e.providerID}/${e.modelID}`))})]})]})}function PW({sessionID:e,openUp:t=!1,align:n=`right`}){let{session:r,detail:i}=jW(e),a=J(e=>e.pendingModel),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),u=OW(()=>s(!1)),d=J(e=>e.uiSignals.variants);(0,w.useEffect)(()=>{d&&s(!0)},[d]),(0,w.useEffect)(()=>{o&&c.length===0&&W.models().then(l)},[o,c.length]);let f=a??i?.model??r?.model,p=c.find(e=>e.enabled&&e.modelID===f?.id&&e.providerID===f?.providerID)?.variants??[],m=f?.variant&&f.variant!=="default"?f.variant:void 0;function h(t){Py(e,{id:f.id,providerID:f.providerID,...t?{variant:t}:{}}),s(!1)}let g=`menu-variants`,[_,,v]=kW({open:o,onClose:()=>s(!1),count:p.length+1,onSelect:e=>{e===0?h():h(p[e-1]?.id)},listId:g});if(!f||p.length===0)return null;let y=`${t?`bottom-full mb-1`:`mt-1`} ${n===`right`?`right-0`:`left-0`}`;return(0,L.jsxs)(`div`,{ref:u,className:`relative`,children:[(0,L.jsx)(cb,{variant:`outline`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`listbox`,title:`Switch model variant`,className:`h-7 max-w-20 px-2 font-mono text-[11px]`,children:(0,L.jsx)(`span`,{className:`truncate`,children:m?`@${m}`:`@default`})}),o&&(0,L.jsxs)(`div`,{id:g,role:`listbox`,"aria-label":`Switch model variant`,"aria-activedescendant":`${g}-item-${_}`,className:`absolute z-40 max-h-80 w-48 overflow-y-auto rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] shadow-xl ${y}`,onMouseMove:v,children:[(0,L.jsxs)(`button`,{id:`${g}-item-0`,type:`button`,role:`option`,"aria-selected":!m,"data-hl":_===0||void 0,className:MW,onClick:()=>h(),children:[(0,L.jsx)(`span`,{className:`text-[color:var(--text-strong)]`,children:`Default`}),!m&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]}),p.map((e,t)=>(0,L.jsxs)(`button`,{id:`${g}-item-${t+1}`,type:`button`,role:`option`,"aria-selected":m===e.id,"data-hl":_===t+1||void 0,className:`${MW} font-mono text-xs`,onClick:()=>h(e.id),children:[(0,L.jsx)(`span`,{className:`text-[color:var(--text-strong)]`,children:e.id}),m===e.id&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]},e.id))]})]})}function FW({sessionID:e,openUp:t=!1,align:n=`right`}){let{session:r,detail:i}=jW(e),a=J(e=>e.pendingAgent),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),[u,d]=(0,w.useState)(null),f=OW(()=>s(!1)),p=J(e=>e.uiSignals.agents);(0,w.useEffect)(()=>{p&&s(!0)},[p]);let m=(0,w.useMemo)(()=>c.filter(e=>e.mode===`primary`&&!e.hidden),[c]),h=`menu-agents`,g=a??i?.agent??r?.agent??u??void 0;(0,w.useEffect)(()=>{o&&c.length===0&&W.agents().then(l)},[o,c.length]),(0,w.useEffect)(()=>{!r?.agent&&u===null&&AW().then(e=>{e&&d(e.id)})},[r?.agent,u]);let _=t=>{let n=m[t];n&&(Ny(e,n.id).then(kg),s(!1))},[v,,y]=kW({open:o,onClose:()=>s(!1),count:m.length,onSelect:_,listId:h}),b=`${t?`bottom-full mb-1`:`mt-1`} ${n===`right`?`right-0`:`left-0`}`;return(0,L.jsxs)(`div`,{ref:f,className:`relative`,children:[(0,L.jsx)(cb,{variant:`outline`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`listbox`,title:`Switch agent (Tab)`,className:`h-7 max-w-28 px-2 text-[11px]`,children:(0,L.jsx)(`span`,{className:`truncate`,children:g??`agent`})}),o&&(0,L.jsx)(`div`,{id:h,role:`listbox`,"aria-label":`Switch agent`,"aria-activedescendant":`${h}-item-${v}`,className:`absolute z-40 max-h-80 w-60 overflow-y-auto rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] shadow-xl ${b}`,onMouseMove:y,children:m.map((e,t)=>(0,L.jsxs)(`button`,{id:`${h}-item-${t}`,type:`button`,role:`option`,"aria-selected":g===e.id,"data-hl":t===v||void 0,className:MW,onClick:()=>_(t),children:[(0,L.jsx)(`span`,{className:`text-[color:var(--text-strong)]`,children:e.name}),g===e.id&&(0,L.jsx)(`span`,{className:`text-emerald-500`,children:`✓`})]},e.id))})]})}function IW({...e}){return(0,L.jsx)(ep,{"data-slot":`popover`,...e})}function LW({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,L.jsx)(np,{children:(0,L.jsx)(rp,{"data-slot":`popover-content`,align:t,sideOffset:n,className:B(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function RW({...e}){return(0,L.jsx)(tp,{"data-slot":`popover-anchor`,...e})}function zW({open:e,query:t,location:n,onOpenChange:r,onPick:i,children:a}){let[o,s]=(0,w.useState)([]),[c,l]=(0,w.useState)(n);return(0,w.useEffect)(()=>{e&&!n&&!c&&W.location().then(e=>l(e.directory)).catch(()=>void 0)},[e,n,c]),(0,w.useEffect)(()=>{if(!e){s([]);return}let n=!1,r=setTimeout(()=>{W.fsFind(t,{location:c,limit:20}).then(e=>{n||s(e.data)}).catch(()=>{n||s([])})},120);return()=>{n=!0,clearTimeout(r)}},[e,t,c]),(0,L.jsxs)(IW,{open:e,onOpenChange:r,children:[(0,L.jsx)(RW,{asChild:!0,children:a}),(0,L.jsx)(LW,{side:`top`,align:`start`,sideOffset:8,className:`w-[min(26rem,calc(100vw-2rem))] p-0`,children:(0,L.jsx)(Gm,{children:(0,L.jsxs)(Jm,{children:[o.length>0&&(0,L.jsx)(Xm,{heading:`Files`,children:o.map(e=>(0,L.jsxs)(Qm,{value:e.path,onSelect:()=>i(e),children:[e.type===`directory`?(0,L.jsx)(Ee,{className:`text-[color:var(--text-weak)]`}):(0,L.jsx)(Ce,{className:`text-[color:var(--text-weak)]`}),(0,L.jsx)(`span`,{className:`font-mono text-[color:var(--text-strong)]`,children:e.path})]},e.path))}),o.length===0&&(0,L.jsx)(Ym,{children:`No matching files`})]})})})]})}var BW=null;function VW(){return BW??=W.models().catch(()=>[]),BW}var HW=null;function UW(){return HW??=W.agents().catch(()=>[]),HW}var WW=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e);async function GW(e){try{let t=await Ly(e);await navigator.clipboard.writeText(JU(t))}catch{}}var KW=10;function qW(e,t){let n=0;for(let r of t)if(r===e[n]&&(n+=1),n===e.length)return!0;return n===e.length}function JW(e,t){let n=t.trim().toLowerCase();if(!n)return e.slice(0,KW);let r=[];for(let t of e){let e=0,i=`/${t.names[0]}`;if(i.startsWith(`/${n}`))e=1e3;else if(i.includes(n))e=600;else if(qW(n,i))e=200;else for(let r of t.names.slice(1)){let t=`/${r}`;t.startsWith(`/${n}`)?e=Math.max(e,800):t.includes(n)&&(e=Math.max(e,400))}e<100&&t.description?.toLowerCase().includes(n)&&(e=100),e>0&&r.push({entry:t,score:e})}return r.sort((e,t)=>t.score-e.score||e.entry.display.localeCompare(t.entry.display)),r.slice(0,KW).map(e=>e.entry)}function YW(){let[e,t]=(0,w.useState)(ah);return(0,w.useEffect)(()=>sh(()=>t(ah())),[]),e}function XW(e){let[t,n]=(0,w.useState)({shells:[],ptys:[]});return(0,w.useEffect)(()=>{async function t(){try{let t=e?{directory:e}:void 0,[r,i]=await Promise.all([W.shellList(t),W.ptyList(t)]);n({shells:r.data,ptys:i.data})}catch{}}return t(),Bh({name:`composer-runs`,minInterval:5e3,intervals:{live:5e3,idle:15e3},run:()=>t()})},[e]),t}function ZW(e,t){let n=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(!e)return;function r(e){n.current&&!n.current.contains(e.target)&&t()}return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[e,t]),n}function QW(e){let t=e.value.length;e.setSelectionRange(t,t)}function $W({sessionID:e,paneKey:t=`main`,onNavigate:n}){let r=e=>n?n(e):void mv(e),[i,a]=(0,w.useState)(()=>TW(e)),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),[u,d]=(0,w.useState)([]),f=YW(),[p,m]=(0,w.useState)(null),[h,g]=(0,w.useState)([]),[_,v]=(0,w.useState)([]),[y,b]=(0,w.useState)(0),[x,S]=(0,w.useState)(!1),[C,T]=(0,w.useState)(!1),[E,D]=(0,w.useState)([]),[O,k]=(0,w.useState)([]),ee=J(t=>t.running[e]??!1),A=J(t=>!!t.queued[e]),j=J(e=>e.interruptArmed),M=J(t=>t.messages[e]),te=J(t=>t.sessionDetails[e]),ne=J(t=>t.sessions.find(t=>t.id===e)?.parentID??t.sessionDetails[e]?.parentID),[N,P]=(0,w.useState)(0);(0,w.useEffect)(()=>pt(()=>P(e=>e+1)),[]);let re=(0,w.useMemo)(()=>wt(`slash`),[N]),ie=J(t=>t.sessions.find(t=>t.id===e)?.location?.directory),ae=(0,w.useRef)(null),[F,I]=(0,w.useState)(0);function oe(e){I(e.selectionStart??e.value.length)}let se=(0,w.useMemo)(()=>(M??[]).filter(e=>e.type===`user`&&!e.id.startsWith(`msg_local_`)).map(e=>e.text).filter(e=>e&&!e.startsWith(`/`)).reverse(),[M]),[ce,le]=(0,w.useState)(null),ue=(0,w.useRef)(``),de=(0,w.useRef)(e);(0,w.useEffect)(()=>{le(null),de.current!==e&&(de.current=e,a(TW(e)))},[e]),(0,w.useEffect)(()=>{de.current===e&&EW(e,i)},[e,i]);let fe=J(t=>cv(t.sessions,e)),pe=J(e=>e.running),me=J(e=>e.activeIDs),he=XW(ie),ge=e=>pe[e]||me.includes(e),_e=fe.filter(e=>ge(e.id)).length,ve=he.shells.filter(e=>e.status===`running`).length+he.ptys.filter(e=>e.status===`running`).length,ye=he.shells.length+he.ptys.length,be=[fe.length>0?_e>0?`${_e}/${fe.length} agents`:`${fe.length} agents`:null,ye>0?ve>0?`${ve}/${ye} shells`:`${ye} shells`:null].filter(Boolean).join(` · `)||`runs`,xe=_e>0||ve>0,Se=J(e=>e.runsPanelOpen),[Ce,we]=(0,w.useState)(!1),Te=ZW(Ce,()=>we(!1)),[Ee,De]=(0,w.useState)(!1),Oe=J(e=>e.pendingEdit),ke=Oe?.sessionID===e;(0,w.useEffect)(()=>{W.commands().then(l),W.skills().then(d),VW().then(D),UW().then(k)},[]);function Ae(){let e=ae.current;e&&(e.focus(),QW(e),I(e.value.length))}function Me(e){let t=e.trim();t&&(le(null),a(e=>{let n=e.replace(/\s+$/,``);return n===``?t:`${n} ${t}`}),requestAnimationFrame(()=>{let e=ae.current;e&&(e.focus(),QW(e),I(e.value.length))}))}(0,w.useEffect)(()=>{let e=ae.current;e&&(e.focus(),QW(e),I(e.value.length))},[e]);let Ne=J(e=>e.revertPrompt);(0,w.useEffect)(()=>{Ne&&(a(Ne),sv(),I(0),requestAnimationFrame(()=>ae.current?.setSelectionRange(0,0)))},[Ne]);let Pe=Math.min(F,i.length),Fe=i.slice(0,Pe),Ie=!C&&Fe.startsWith(`/`)&&!/^\S+\s+\S/.test(Fe)&&p!==Fe,Le=Fe.slice(1),ze=(0,w.useMemo)(()=>[{name:`new`,aliases:[`clear`],description:`New session`,run:()=>void My()},{name:`sessions`,aliases:[`resume`,`continue`],description:`Switch session`,run:()=>r(null)},{name:`move`,description:`Move session to another workspace`,run:t=>{let n=t.trim();if(og(e)){window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Create a session first`,variant:`destructive`}}));return}if(n){W.moveSession(e,n).then(()=>{window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Moved to ${n}`}})),f_(e),kg()}).catch(e=>{let t=e instanceof Error?e.message:String(e);window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Move failed: ${t}`,variant:`destructive`}}))});return}De(!0)}},{name:`undo`,description:`Undo previous message`,run:()=>void zy(e)},{name:`redo`,description:`Redo`,run:()=>void By(e)},{name:`thinking`,aliases:[`toggle-thinking`],description:f.showReasoning?`Collapse all thinking`:`Expand all thinking`,run:()=>oh(`showReasoning`,!ah().showReasoning)},{name:`timestamps`,aliases:[`toggle-timestamps`],description:f.showTimestamps?`Hide timestamps`:`Show timestamps`,run:()=>oh(`showTimestamps`,!ah().showTimestamps)},{name:`rename`,description:`Rename session`,run:t=>{let n=t.trim();n&&Fy(e,n)}},{name:`fork`,description:`Fork session`,run:()=>void Iy(e,{type:`through`}).then(e=>r(e))},{name:`export`,description:`Export session transcript`,run:()=>void qU(e)},{name:`copy`,description:`Copy session transcript`,run:()=>void GW(e)},{name:`compact`,aliases:[`summarize`],description:`Compact session`,run:()=>void Ry(e,`steer`)},{name:`connect`,description:`Connect providers & integrations`,run:()=>LA(`integrations`)},{name:`models`,aliases:[`mo`],description:`Switch model`,run:()=>nv(`models`)},{name:`variants`,description:`Switch model variant`,run:()=>nv(`variants`)},{name:`agents`,description:`Switch agent`,run:()=>nv(`agents`)},{name:`themes`,description:`Switch theme`,run:()=>nv(`themes`)},{name:`skills`,description:`Browse skills`,run:()=>we(!0)},{name:`mcps`,description:`Toggle MCPs`,run:()=>LA(`mcp`)},{name:`status`,description:`View status`,run:()=>LA(`server`)},{name:`diff`,description:`Open diff viewer`,run:()=>nv(`explorer`)},{name:`help`,description:`Help`,run:()=>nv(`help`)}],[e,f.showReasoning,f.showTimestamps]),Be=(0,w.useMemo)(()=>new Set(c.map(e=>e.name)),[c]);function Ve(e){Be.has(e.name)?(a(`/${e.name} `),m(`/${e.name} `),Ae()):(a(``),fy(e.id))}let He=te?.model,Ue=(0,w.useMemo)(()=>He?(E.find(e=>e.enabled&&e.modelID===He.id&&e.providerID===He.providerID)?.variants?.length??0)>0:!1,[E,He]),We=(0,w.useMemo)(()=>{let t=[];for(let e of ze)e.name===`variants`&&!Ue||t.push({key:`action:${e.name}`,display:`/${e.name}`,names:[e.name,...e.aliases??[]],description:e.description,onSelect:()=>{a(``),e.run(``)}});for(let n of re)t.push({key:`slash:${n.id}`,display:`/${n.item.name}`,names:[n.item.name,...n.item.aliases??[]],description:n.item.description,onSelect:()=>{a(``),n.item.run(``,{sessionID:e})}});for(let e of c)t.push({key:`command:${e.name}`,display:`/${e.name}`,names:[e.name],description:e.description,onSelect:()=>{a(`/${e.name} `),m(`/${e.name} `),Ae()}});for(let e of u)t.push({key:`skill:${e.id}`,display:`/${e.name}`,names:[e.name],description:e.description,onSelect:()=>Ve(e)});return t.sort((e,t)=>e.display.localeCompare(t.display))},[ze,re,c,u,Be,Ue,e]),Ge=(0,w.useMemo)(()=>JW(We,Le),[We,Le]),Ke=(0,w.useMemo)(()=>{let e=i.lastIndexOf(`@`);if(e===-1)return;let t=e===0?``:i[e-1],n=i.slice(e+1);if((e===0||/\s/.test(t))&&!/\s/.test(n))return n},[i]);(0,w.useEffect)(()=>{S(!1)},[i]);let qe=(0,w.useMemo)(()=>{let e=M??[];for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`assistant`)return n}},[M]),Ye=qe?.type===`assistant`?qe.tokens:void 0,Xe=Ye?Ye.input+Ye.output+Ye.reasoning+Ye.cache.read+Ye.cache.write:void 0,Ze=(qe?.type===`assistant`?qe.cost:void 0)??te?.cost??0,Qe=E.find(e=>e.enabled&&e.modelID===He?.id&&e.providerID===He?.providerID)?.limit?.context,$e=Xe&&Qe?Math.round(Xe/Qe*100):void 0,et=[Xe===void 0?void 0:`${WW(Xe)} tok`,$e===void 0?void 0:`${$e}% ctx`,Ze>0?`$${Ze.toFixed(4)}`:void 0].filter(Boolean),nt=te?.agent;function rt(t){let n=O.filter(e=>e.mode===`primary`&&!e.hidden);if(n.length===0)return;let r=n.findIndex(e=>e.id===nt),i=n[(((r===-1?0:r)+t)%n.length+n.length)%n.length];Ny(e,i.id).then(()=>void f_(e))}function it(e,t){let n=yH(e)??`application/octet-stream`;v(r=>[...r,{id:`att_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,name:e.split(`/`).pop()||e,mime:n,uri:`data:${n};base64,${SH(t)}`}])}function ot(e){let t=i.lastIndexOf(`@`);if(t===-1)return;if(e.type===`file`&&mH(e.path)){a(i.slice(0,t)+i.slice(t+1+(Ke?.length??0))),Ae(),W.fsReadBytes(e.path,ie).then(t=>it(e.path,t)).catch(()=>void 0);return}let n=`@${e.path}`;a(i.slice(0,t)+n+` `),g(t=>[...t,{path:e.path}]),ie&&W.fsRead(e.path,ie).then(t=>g(n=>n.map(n=>n.path===e.path?{path:n.path,content:t}:n))).catch(()=>void 0),Ae()}async function st(){if(og(e))try{return await jy(i)}catch{return null}return e||null}async function ct(t){let n=i.trim();if(!(!n&&_.length===0||o)){s(!0),le(null);try{if(!C&&n.startsWith(`/`)){let t=n.slice(1).split(` `),r=t[0],i=ze.find(e=>e.name===r||e.aliases?.includes(r));if(i){i.run(t.slice(1).join(` `)),a(``),g([]),v([]);return}let o=re.find(e=>e.item.name===r||e.item.aliases?.includes(r));if(o){await o.item.run(t.slice(1).join(` `),{sessionID:e}),a(``),g([]),v([]);return}}let r=await st();if(!r)return;let i=pg().pendingEdit;if(i&&i.sessionID===r){let{commitPendingEdit:e}=await Wh(async()=>{let{commitPendingEdit:e}=await Promise.resolve().then(()=>Gh);return{commitPendingEdit:e}},void 0);await e(r)}if(C)await Zv(n.startsWith(`!`)?n.slice(1):n);else if(n.startsWith(`!`))await Zv(n.slice(1));else if(n.startsWith(`/`)){let e=n.slice(1).split(` `),t=e[0];await Xv(t,e.slice(1).join(` `)||void 0)}else if(h.length>0||_.length>0){let e=pg().draftWorkspace,i=ie??e??void 0,a=[];for(let e of h){if(!i)continue;let t=`@${e.path}`,r=n.indexOf(t);a.push({uri:`file://${encodeURI(`${i.replace(/\/+$/,``)}/${e.path}`)}`,name:e.path,mention:r===-1?void 0:{start:r,end:r+t.length,text:t}})}for(let e of _)a.push(vH(e));a.length>0?await Qv(n,a):await Fv(r,n,t)}else await Fv(r,n,t);a(``),g([]),v([])}catch{a(n)}finally{s(!1),Ae()}}}let lt=C?`bash — esc to exit`:ee?`Agent is working… — ↵ steers · ctrl+↵ queues`:A?`Waiting for the agent… — ↵ steers · ctrl+↵ queues`:`Message the agent…`,ut=C?(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--surface-brand-base)]`,children:`Shell`}),` · esc to exit`]}):ee&&j?(0,L.jsx)(`p`,{className:`font-medium text-[color:var(--surface-warning-strong)]`,children:`Press esc again to interrupt`}):ee||A?(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(lb,{className:`size-3`}),ee?`Working… · esc to interrupt`:`Waiting…`,i.trim()?` · ↵ steer · ctrl+↵ queue`:``]}):(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`Tab`}),` agent,`,` `,(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`/`}),` commands,`,` `,(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`@`}),` files,`,` `,(0,L.jsx)(`span`,{className:`font-medium text-[color:var(--text-weak)]`,children:`!`}),` bash`]}),dt=ie?.split(`/`).filter(Boolean).pop();return(0,L.jsxs)(`div`,{className:`border-t border-[color:var(--border-weak-base)] px-3 pb-2.5 pt-2`,children:[(0,L.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,L.jsx)(`div`,{className:`relative`,children:Ce&&(0,L.jsxs)(`div`,{ref:Te,className:`absolute bottom-full left-0 z-40 mb-2 max-h-80 w-[min(26rem,calc(100vw-2rem))] overflow-y-auto rounded-lg border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] p-1 shadow-xl`,children:[u.length===0&&(0,L.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-[color:var(--text-weaker)]`,children:`No skills available`}),u.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{we(!1),Ve(e)},className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-[color:var(--surface-base-hover)]`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-[color:var(--text-strong)]`,children:[`/`,e.name]}),e.description&&(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-[color:var(--text-weaker)]`,children:e.description})]},e.id))]})}),(0,L.jsxs)(IW,{open:Ie,children:[(0,L.jsx)(RW,{asChild:!0,children:(0,L.jsxs)(`div`,{"data-oc-composer":!0,onDragEnter:e=>{Array.from(e.dataTransfer.types).includes(`Files`)&&b(e=>e+1)},onDragOver:e=>{Array.from(e.dataTransfer.types).includes(`Files`)&&e.preventDefault()},onDragLeave:()=>b(e=>Math.max(0,e-1)),onDrop:e=>{b(0),e.dataTransfer.files.length!==0&&(e.preventDefault(),_H(e.dataTransfer.files).then(e=>{e.length>0&&v(t=>[...t,...e])}))},className:`rounded-lg border bg-[color:var(--input-base)] p-2 transition-colors focus-within:border-[color:var(--border-selected)] ${y>0||C?`border-[color:var(--surface-brand-base)]`:`border-[color:var(--border-base)]`}`,children:[ke&&Oe&&(0,L.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1.5 text-xs`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium text-amber-700 dark:text-amber-300`,children:[(0,L.jsx)(Re,{className:`size-3`}),` Editing`]}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[var(--text-weaker)]`,title:Oe.originalText,children:Oe.originalText.slice(0,80).replace(/\s+/g,` `)||`(empty)`}),(0,L.jsx)(`span`,{className:`hidden text-[10px] text-[var(--text-weaker)] sm:inline`,children:`will revert on send`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{Wh(()=>Promise.resolve().then(()=>Gh).then(e=>e.clearPendingEdit()),void 0)},title:`Dismiss edit — next send is a normal message`,className:`ml-auto flex size-6 cursor-pointer items-center justify-center rounded-md hover:bg-black/10 dark:hover:bg-white/10`,children:(0,L.jsx)(at,{className:`size-3`})})]}),_.length>0&&(0,L.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-start gap-2 border-b border-[color:var(--border-weak-base)] pb-1.5`,children:[_.map(e=>(0,L.jsxs)(`span`,{className:`relative inline-block`,title:`${e.name} (${e.mime})`,children:[(0,L.jsx)(`img`,{src:e.uri,alt:e.name,draggable:!1,className:`size-12 rounded-md border border-[color:var(--border-weak-base)] object-cover`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>v(t=>t.filter(t=>t.id!==e.id)),title:`Remove attachment`,className:`absolute -right-1.5 -top-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full border border-[color:var(--border-weak-base)] bg-[color:var(--surface-float-base)] text-[color:var(--text-weak)] transition-colors hover:text-[color:var(--text-strong)]`,children:(0,L.jsx)(at,{className:`size-2.5`})})]},e.id)),(0,L.jsxs)(`span`,{className:`self-center text-[11px] text-[color:var(--text-weaker)]`,children:[`image`,_.length===1?``:`s`,` attached`]})]}),(0,L.jsx)(zW,{open:Ke!==void 0&&!x&&!Ie,query:Ke??``,location:ie,onOpenChange:S,onPick:ot,children:(0,L.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,L.jsx)(Fm,{id:`composer-input-${t}`,"data-oc-composer-input":!0,ref:ae,value:i,placeholder:lt,className:`max-h-40 min-h-0 flex-1 resize-none border-0 bg-transparent px-1.5 py-1 text-sm placeholder:text-[color:var(--text-weaker)] focus-visible:ring-0 ${C?`font-mono`:``}`,onChange:e=>{le(null),a(e.target.value),oe(e.currentTarget)},onSelect:e=>oe(e.currentTarget),onClick:e=>oe(e.currentTarget),onKeyUp:e=>oe(e.currentTarget),onPaste:e=>{let t=[];for(let n of Array.from(e.clipboardData?.items??[])){if(n.kind!==`file`)continue;let e=n.getAsFile();e&&t.push(e)}t.some(e=>e.type.startsWith(`image/`)||mH(e.name))&&(e.preventDefault(),_H(t).then(e=>{e.length>0&&v(t=>[...t,...e])}))},onKeyDown:t=>{if(Ie){if(t.key===`Escape`){t.preventDefault(),Pe===i.length&&!i.endsWith(` `)?a(``):m(Fe);return}if(t.key===`ArrowDown`){t.preventDefault(),Hm(1);return}if(t.key===`ArrowUp`){t.preventDefault(),Hm(-1);return}if(t.key===`Enter`){t.preventDefault(),Um();return}if(t.key===`Tab`){t.preventDefault(),Um();return}}if(Ke!==void 0&&!x&&!Ie&&document.querySelector(`[data-slot="command-item"]`)){if(t.key===`ArrowDown`){t.preventDefault(),Hm(1);return}if(t.key===`ArrowUp`){t.preventDefault(),Hm(-1);return}if(t.key===`Enter`&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey&&!t.altKey){t.preventDefault(),Um();return}}if(Ce&&t.key===`Escape`){t.preventDefault(),we(!1);return}if(!Ie&&Ke===void 0&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.shiftKey){if(t.key===`ArrowUp`){let e=t.currentTarget;if(e.selectionStart===0&&e.selectionEnd===0&&se.length>0){t.preventDefault(),ce===null&&(ue.current=i);let n=ce===null?0:Math.min(ce+1,se.length-1);le(n);let r=se[n]??``;a(r),I(0),requestAnimationFrame(()=>e.setSelectionRange(0,0))}return}if(t.key===`ArrowDown`){let e=t.currentTarget;if(e.selectionStart===i.length&&e.selectionEnd===i.length){if(ce===null)t.preventDefault(),rv();else if(ce<=0)t.preventDefault(),le(null),a(ue.current),I(ue.current.length),requestAnimationFrame(()=>e.setSelectionRange(ue.current.length,ue.current.length));else{t.preventDefault();let n=Math.min(ce-1,se.length-1);le(n);let r=se[Math.max(n,0)]??``;a(r),I(r.length),requestAnimationFrame(()=>e.setSelectionRange(r.length,r.length))}}return}}if(t.key.toLowerCase()===`b`&&t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.shiftKey){Ie||(t.preventDefault(),(ee||A)&&vy(e));return}if(t.key===`Escape`){if(t.preventDefault(),C){T(!1);return}if(ee){_y();return}return}if(t.key===`Tab`){t.preventDefault(),rt(t.shiftKey?-1:1);return}if(t.key===`Backspace`&&!i&&ne){t.preventDefault(),r(ne);return}if(t.key===`Enter`&&!t.shiftKey&&!t.altKey&&(t.ctrlKey||t.metaKey)&&!Ie&&Ke===void 0){t.preventDefault(),ct(C?void 0:{delivery:`queue`});return}t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),ct())}}),(0,L.jsx)(Ct,{id:`composer.sendActions`,sessionID:e,appendDraft:Me}),o?(0,L.jsx)(lb,{className:`mb-1.5 mr-2`}):(0,L.jsxs)(H,{variant:`default`,size:`sm`,"data-oc-composer-send":!0,disabled:!i.trim()&&_.length===0,onClick:()=>void ct(),title:ee?`Send (↵ steer · ctrl+↵ queue)`:`Send (Enter)`,children:[(0,L.jsx)(Je,{}),`Send`]})]})}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 border-t border-[color:var(--border-weak-base)] px-1 pt-1`,children:[(0,L.jsxs)(`button`,{type:`button`,"data-runs-panel-trigger":!0,onClick:()=>Se?iv():rv(),title:Se?`Close subagents & shells (↓)`:`Subagents & shells — opens the runs panel (↓)`,className:`flex h-6 cursor-pointer items-center gap-1 rounded-md px-1.5 font-mono text-[11px] transition-colors ${xe?`text-[color:var(--surface-brand-base)] hover:bg-[color:var(--surface-base-hover)]`:`text-[color:var(--text-weaker)] hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-weak)]`}`,children:[(0,L.jsx)(je,{className:`size-3`}),be]}),(0,L.jsx)(`button`,{type:`button`,title:`Shell mode (! command)`,onClick:()=>T(e=>!e),className:`flex size-6 cursor-pointer items-center justify-center rounded-md transition-colors ${C?`bg-[color:var(--surface-brand-weak)] text-[color:var(--surface-brand-strong)]`:`text-[color:var(--text-weaker)] hover:bg-[color:var(--surface-base-hover)] hover:text-[color:var(--text-weak)]`}`,children:(0,L.jsx)(tt,{className:`size-3.5`})}),(0,L.jsx)(FW,{sessionID:e,openUp:!0,align:`left`}),(0,L.jsx)(NW,{sessionID:e,openUp:!0,align:`left`}),(0,L.jsx)(PW,{sessionID:e,openUp:!0,align:`left`}),(0,L.jsx)(Ct,{id:`composer.contextReadout`,parts:et})]})]})}),(0,L.jsx)(LW,{side:`top`,align:`start`,sideOffset:8,className:`w-[min(26rem,calc(100vw-2rem))] p-0`,onOpenAutoFocus:e=>e.preventDefault(),children:(0,L.jsx)(Gm,{children:(0,L.jsxs)(Jm,{children:[Ge.map(e=>(0,L.jsxs)(Qm,{value:e.key,onSelect:e.onSelect,children:[(0,L.jsx)(`span`,{className:`font-mono text-[color:var(--text-base)]`,children:e.display}),e.description&&(0,L.jsx)(`span`,{className:`ml-auto max-w-[55%] truncate pl-3 text-xs text-[color:var(--text-weaker)]`,children:e.description})]},e.key)),Ge.length===0&&(0,L.jsx)(Ym,{children:`No matching items`})]})})})]}),(0,L.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between px-1 text-[11px] text-[color:var(--text-weaker)]`,children:[ut,dt&&(0,L.jsx)(`p`,{className:`hidden truncate font-mono sm:block`,children:dt})]})]}),Ee&&(0,L.jsx)(eG,{sessionID:e,currentDirectory:ie,onClose:()=>De(!1),onMoved:t=>{De(!1),window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Moved to ${t}`}})),f_(e),kg()}})]})}function eG({sessionID:e,currentDirectory:t,onClose:n,onMoved:r}){let[i,a]=(0,w.useState)([]),[o,s]=(0,w.useState)(``),[c,l]=(0,w.useState)(!0);(0,w.useEffect)(()=>{let e=!1;return(async()=>{try{let[n,r]=await Promise.all([W.projectList().catch(()=>[]),W.location().catch(()=>null)]);if(e)return;let i=new Set;for(let e of n){let t=e.directory;t&&i.add(t)}r?.directory&&i.add(r.directory),t&&i.add(t),a([...i].sort())}catch{}e||l(!1)})(),()=>{e=!0}},[t]);let u=t=>{let n=t.trim();n&&W.moveSession(e,n).then(()=>r(n)).catch(e=>{let t=e instanceof Error?e.message:String(e);window.dispatchEvent(new CustomEvent(`opencode:notify`,{detail:{title:`Move failed: ${t}`,variant:`destructive`}}))})};return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,onClick:n,children:(0,L.jsxs)(`div`,{className:`w-full max-w-lg rounded-lg border border-[var(--border-weak-base)] bg-[var(--surface-float-base)] p-4 shadow-xl`,onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-[var(--text-strong)]`,children:`Move session`}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-[var(--text-weaker)]`,children:`Pick a workspace or enter a path. Mirrors the TUI picker.`}),c?(0,L.jsx)(`p`,{className:`mt-4 text-xs text-[var(--text-weaker)]`,children:`Loading workspaces…`}):(0,L.jsxs)(`div`,{className:`mt-3 max-h-56 overflow-y-auto rounded-md border border-[var(--border-weak-base)]`,children:[i.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-xs hover:bg-[var(--surface-base-hover)] ${e===t?`bg-[var(--surface-raised-base-active)] font-medium`:``}`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[var(--text-strong)]`,children:e.replace(/^\/(home|Users)\/[^/]+/,`~`)}),e===t&&(0,L.jsx)(`span`,{className:`ml-2 text-[10px] text-[var(--text-weaker)]`,children:`current`})]},e)),i.length===0&&(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs text-[var(--text-weaker)]`,children:`No workspaces found`})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,L.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u(o),e.key===`Escape`&&n()},placeholder:`Custom path — e.g. /home/z/projects/foo`,className:`flex-1 rounded-md border border-[var(--border-base)] bg-[var(--input-base)] px-2.5 py-1.5 font-mono text-xs outline-none focus:border-[var(--border-selected)]`,autoFocus:!0}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(o),disabled:!o.trim(),className:`rounded-md bg-[var(--surface-brand-base)] px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50`,children:`Move`}),(0,L.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md border border-[var(--border-weak-base)] px-3 py-1.5 text-xs`,children:`Cancel`})]})]})})}function tG({parts:e}){return e.length===0?null:(0,L.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-[color:var(--text-weaker)]`,title:`Tokens used · share of model context window · session cost`,children:e.join(` · `)})}_t({composer:e=>(0,L.jsx)($W,{...e}),"composer.contextReadout":e=>(0,L.jsx)(tG,{parts:e.parts}),"composer.sendActions":()=>null});var nG=new Map;function rG(e,t){for(nG.delete(e),nG.set(e,t);nG.size>2e3;){let e=nG.keys().next().value;if(!e)break;nG.delete(e)}}function iG({part:e,stateKey:t}){let[n,r]=(0,w.useState)(ah().showToolDetails);(0,w.useEffect)(()=>sh(()=>r(ah().showToolDetails)),[]);let[,i]=(0,w.useState)(0);(0,w.useEffect)(()=>pt(()=>i(e=>e+1)),[]);let a=vt(`tool:${e.name}`);if(a.replaces.length>0||a.wraps.length>0){let t=St(`tool:${e.name}`,{part:e});if(t!=null)return(0,L.jsx)(L.Fragment,{children:t})}if(!e.state)return null;let o=e.state,s=o.status===`completed`&&o.content?.some(e=>e.type===`file`&&pG(e.mime));if(!n&&o.status===`completed`&&!s)return null;let c=o.status===`streaming`?{}:o.input??{},l=o.status===`streaming`?{}:`metadata`in o?o.metadata??{}:{},u={part:e,state:o,stateKey:t,input:c,meta:l,output:o.status===`completed`||o.status===`error`?oG(o.content):void 0,error:o.status===`error`?o.error:void 0,streamingText:o.status===`streaming`?o.input:void 0},d=(()=>{switch(e.name){case`edit`:return(0,L.jsx)(Ct,{id:`tool.edit`,...u});case`write`:return(0,L.jsx)(Ct,{id:`tool.write`,...u});case`shell`:case`bash`:return(0,L.jsx)(Ct,{id:`tool.shell`,...u});case`subagent`:case`task`:return(0,L.jsx)(Ct,{id:`tool.subagent`,...u});case`execute`:return(0,L.jsx)(Ct,{id:`tool.execute`,...u});case`read`:return(0,L.jsx)(cG,{...u,icon:`→`,pending:`Reading file…`,label:(0,L.jsxs)(L.Fragment,{children:[`Read `,(0,L.jsx)(sG,{value:c.path}),c.offset!==void 0&&(0,L.jsxs)(`span`,{className:`text-[var(--text-weaker)]`,children:[` from `,String(c.offset)]})]})});case`grep`:return(0,L.jsx)(cG,{...u,icon:`✱`,pending:`Searching content…`,label:(0,L.jsxs)(L.Fragment,{children:[`Grep "`,c.pattern,`" `,(0,L.jsx)(sG,{value:c.path,prefix:`in `}),l.matches!==void 0&&(0,L.jsxs)(`span`,{className:`text-[var(--text-weaker)]`,children:[` (`,String(l.matches),` matches)`]})]})});case`glob`:return(0,L.jsx)(cG,{...u,icon:`✱`,pending:`Finding files…`,label:(0,L.jsxs)(L.Fragment,{children:[`Glob "`,c.pattern,`" `,(0,L.jsx)(sG,{value:c.path,prefix:`in `}),l.count!==void 0&&(0,L.jsxs)(`span`,{className:`text-[var(--text-weaker)]`,children:[` (`,String(l.count),`)`]})]})});case`webfetch`:return(0,L.jsx)(cG,{...u,icon:`%`,pending:`Fetching from the web…`,label:(0,L.jsxs)(L.Fragment,{children:[e.name,` `,c.url]})});case`websearch`:return(0,L.jsx)(cG,{...u,icon:`◈`,pending:`Searching web…`,label:(0,L.jsxs)(L.Fragment,{children:[`Search "`,c.query,`"`]})});default:return(0,L.jsx)(Ct,{id:`tool.generic`,...u,name:e.name})}})();return(0,L.jsx)(`div`,{"data-oc-tool-card":!0,"data-oc-tool-name":e.name,children:d})}function aG(e){return typeof e==`string`&&e?e:void 0}function oG(e){return(e??[]).filter(e=>e.type===`text`).map(e=>e.text??``).join(`
|
|
119
119
|
`).trim()||void 0}function sG({value:e,prefix:t}){let n=aG(e);if(!n)return null;let r=n.startsWith(`/`)?n.replace(/^\/home\/[^/]+/,`~`):n;return(0,L.jsxs)(`span`,{className:`font-mono`,children:[t,r]})}function cG({icon:e,label:t,pending:n,streamingText:r,error:i,output:a,complete:o=!0,onClick:s,children:c,state:l,runningLabel:u,runningIcon:d,input:f,part:p}){let[m,h]=(0,w.useState)(!1),[g,_]=(0,w.useState)(!1),v=!!i,y=l.status===`running`||l.status===`streaming`,b=(()=>{let e=Object.entries(f??{}).filter(([,e])=>e!=null&&e!==``);if(e.length>0){let t=[];for(let[n,r]of e){if(t.length>=3)break;let e=typeof r==`string`?r:(()=>{try{return JSON.stringify(r)??String(r)}catch{return String(r)}})();!e||e===`{}`||e===`[]`||t.push(`[${n}=${fG(e,40)}]`)}if(t.length>0)return t.join(` `)}if(r&&r.trim())return fG(r,80)})(),x=y&&u!==void 0?(0,L.jsx)(`span`,{className:`text-[var(--text-base)]`,children:u}):y?(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[var(--text-base)]`,children:[(0,L.jsx)(lb,{className:`size-3`}),(0,L.jsx)(`span`,{className:`font-medium`,children:p.name}),b?(0,L.jsx)(`span`,{className:`truncate font-mono text-[var(--text-weaker)]`,children:b}):(0,L.jsx)(`span`,{className:`text-[var(--text-weaker)]`,children:n})]}):(0,L.jsx)(`span`,{className:v?``:o?`text-[var(--text-weak)]`:`text-[var(--text-base)]`,children:t??c}),S=!v&&!s&&r!==void 0&&r.trim().length>0,C=!!(s||v||S);return(0,L.jsxs)(`div`,{className:`py-0.5 pl-1 text-xs`,children:[(0,L.jsxs)(`div`,{role:C?`button`:void 0,onClick:()=>{v?h(e=>!e):S?_(e=>!e):s?.()},className:`flex min-w-0 items-center gap-2 ${C?`cursor-pointer rounded px-1 -mx-1 hover:bg-[color:var(--surface-base-hover)]`:``} ${v?`text-[color:var(--surface-critical-strong)]`:``}`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono ${v?`text-[color:var(--surface-critical-strong)]`:`text-[var(--text-weaker)]`}`,children:y&&d!==void 0?d:e}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:x}),S&&(0,L.jsx)(F,{className:`size-3 shrink-0 text-[var(--text-weaker)] transition-transform ${g?`rotate-90`:``}`})]}),v&&m&&(0,L.jsxs)(`pre`,{className:`ml-5 mt-1 max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[var(--surface-critical-weak)] p-2 font-mono text-[10px] text-[color:var(--surface-critical-strong)]`,children:[i.type,`: `,i.message]}),v&&!m&&a&&(0,L.jsx)(lG,{output:a}),S&&g&&(0,L.jsx)(`pre`,{className:`ml-5 mt-1 max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-[color-mix(in_oklch,var(--border-selected)_20%,transparent)] bg-[var(--background-strong)] p-2 font-mono text-[10px] leading-relaxed text-[var(--text-weak)]`,children:r})]})}function lG({output:e}){let t=e.split(`
|
|
120
120
|
`),n=t.slice(0,10).join(`
|
|
121
121
|
`)+(t.length>10?`
|
|
@@ -125,4 +125,4 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
125
125
|
`).trim()||void 0;if(typeof e==`string`)return e.trim()||void 0;try{let t=JSON.stringify(e,null,2);return t&&t!==`{}`?t:void 0}catch{return String(e)}}}function DG(e){if(e!=null&&e!==!1){if(typeof e==`string`)return e.trim()||void 0;if(typeof e==`object`){let t=e,n=aG(t.message)??aG(t.text);if(n){let e=aG(t.type);return e?`${e}: ${n}`:n}return EG(e)}return String(e)}}var OG=`ml-5 mt-1 max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-[color-mix(in_oklch,var(--border-selected)_20%,transparent)] bg-[var(--background-strong)] p-2 font-mono text-[10px] leading-relaxed text-[var(--text-weak)]`;function kG({call:e,index:t,stateKey:n}){let r=n?`${n}:call:${t}`:void 0,[i,a]=(0,w.useState)(()=>r?nG.get(r)??!1:!1),o=TG(e.input),s=EG(e.output??e.result),c=DG(e.error),l=!!(o||s||c);return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{role:l?`button`:void 0,onClick:l?()=>{a(e=>(r&&rG(r,!e),!e))}:void 0,className:`flex min-w-0 items-center gap-1 ${l?`-mx-1 cursor-pointer rounded px-1 transition-colors hover:bg-[color:var(--surface-base-hover)]`:``}`,children:[(0,L.jsxs)(`span`,{className:`ml-5 min-w-0 flex-1 truncate text-[var(--text-weaker)]`,children:[`↳ `,aG(e.tool)??`tool`,wG(e.input),e.status===`error`&&(0,L.jsx)(`span`,{className:`text-[color:var(--surface-critical-strong)]`,children:` (failed)`})]}),l&&(0,L.jsx)(F,{className:`size-3 shrink-0 text-[var(--text-weaker)] transition-transform ${i?`rotate-90`:``}`})]}),l&&i&&(0,L.jsxs)(L.Fragment,{children:[o&&(0,L.jsx)(`pre`,{className:OG,children:o}),s&&(0,L.jsx)(`pre`,{className:OG,children:s}),c&&(0,L.jsx)(`pre`,{className:`ml-5 mt-1 max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-[color-mix(in_oklch,var(--surface-critical-strong)_30%,transparent)] bg-[var(--surface-critical-weak)] p-2 font-mono text-[10px] text-[color:var(--surface-critical-strong)]`,children:c})]})]})}function AG(e){let t=Array.isArray(e.meta.toolCalls)?e.meta.toolCalls:[],n=typeof e.meta.error==`object`&&e.meta.error!==null?e.meta.error:void 0,r=e.meta.error===!0||!!n?.message||!!e.error,i=e.error??(n?.message?{type:n.type??`error`,message:n.message}:void 0);return(0,L.jsxs)(`div`,{className:`py-0.5 pl-1 text-xs`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono ${r?`text-[color:var(--surface-critical-strong)]`:`text-[var(--text-weaker)]`}`,children:r?`✗`:e.state.status===`completed`?`✓`:`│`}),e.state.status===`completed`?(0,L.jsx)(`span`,{className:`text-[var(--text-weak)]`,children:`execute`}):(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[var(--text-base)]`,children:[(0,L.jsx)(lb,{className:`size-3`}),` execute`]})]}),t.map((t,n)=>(0,L.jsx)(kG,{call:t,index:n,stateKey:e.stateKey},n)),i&&(0,L.jsxs)(`pre`,{className:`ml-5 mt-1 max-h-24 overflow-auto whitespace-pre-wrap font-mono text-[10px] text-[color:var(--surface-critical-strong)]`,children:[i.type,`: `,i.message]}),r&&e.output&&i===void 0&&(0,L.jsx)(`pre`,{className:`ml-5 mt-1 max-h-24 overflow-auto whitespace-pre-wrap font-mono text-[10px] text-[color:var(--surface-critical-strong)]`,children:e.output.split(`
|
|
126
126
|
`).slice(0,4).join(`
|
|
127
127
|
`)}),(0,L.jsx)(gG,{content:e.state.status===`completed`||e.state.status===`error`?e.state.content:void 0})]})}function jG(e){let t=Object.entries(e.input).filter(([,e])=>typeof e==`string`||typeof e==`number`).slice(0,2).map(([e,t])=>`${e}: ${fG(String(t),40)}`).join(` `);return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(cG,{...e,icon:`⚙`,pending:`${e.name}…`,label:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.name}),t&&(0,L.jsxs)(`span`,{className:`font-mono text-[var(--text-weaker)]`,children:[` `,t]})]})}),e.state.status===`completed`&&e.output&&(0,L.jsx)(uG,{title:`${e.name} output`,collapsible:!0,stateKey:e.stateKey,children:(0,L.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap px-2.5 py-2 font-mono text-xs leading-relaxed text-[var(--text-base)]`,children:e.output})}),(0,L.jsx)(gG,{content:e.state.status===`completed`||e.state.status===`error`?e.state.content:void 0})]})}function MG({code:e}){let t=e.split(`
|
|
128
|
-
`);return(0,L.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-xs leading-relaxed`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse`,children:(0,L.jsx)(`tbody`,{children:t.map((e,t)=>(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`td`,{className:`w-10 shrink-0 select-none border-r border-[var(--border-weak-base)] pr-2 text-right align-top text-[var(--text-weaker)]`,children:t+1}),(0,L.jsx)(`td`,{className:`whitespace-pre-wrap break-all pl-2.5 text-[var(--text-base)]`,children:e||` `})]},t))})})})}_t({"tool.card":e=>(0,L.jsx)(iG,{...e}),"tool.edit":e=>(0,L.jsx)(vG,{...e}),"tool.write":e=>(0,L.jsx)(yG,{...e}),"tool.shell":e=>(0,L.jsx)(bG,{...e}),"tool.subagent":e=>(0,L.jsx)(SG,{...e}),"tool.execute":e=>(0,L.jsx)(AG,{...e}),"tool.generic":e=>(0,L.jsx)(jG,{...e})});var NG={transcript:`data-oc-transcript`,message:`data-oc-message`,messageId:`data-oc-message-id`,messageType:`data-oc-message-type`,composer:`data-oc-composer`,composerInput:`data-oc-composer-input`,composerSend:`data-oc-composer-send`,toolCard:`data-oc-tool-card`,toolName:`data-oc-tool-name`,sessionHeader:`data-oc-session-header`,sidebar:`data-oc-sidebar`,queueStrip:`data-oc-queue-strip`,subagentStrip:`data-oc-subagent-strip`,runsPanel:`data-oc-runs-panel`},PG=new Map;function FG(e,t){let n=PG.get(e)??[];return n.push(t),PG.set(e,n),()=>{let e=n.indexOf(t);e>=0&&n.splice(e,1),t()}}function IG(e){return{foreign(t,n){let
|
|
128
|
+
`);return(0,L.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-xs leading-relaxed`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse`,children:(0,L.jsx)(`tbody`,{children:t.map((e,t)=>(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`td`,{className:`w-10 shrink-0 select-none border-r border-[var(--border-weak-base)] pr-2 text-right align-top text-[var(--text-weaker)]`,children:t+1}),(0,L.jsx)(`td`,{className:`whitespace-pre-wrap break-all pl-2.5 text-[var(--text-base)]`,children:e||` `})]},t))})})})}_t({"tool.card":e=>(0,L.jsx)(iG,{...e}),"tool.edit":e=>(0,L.jsx)(vG,{...e}),"tool.write":e=>(0,L.jsx)(yG,{...e}),"tool.shell":e=>(0,L.jsx)(bG,{...e}),"tool.subagent":e=>(0,L.jsx)(SG,{...e}),"tool.execute":e=>(0,L.jsx)(AG,{...e}),"tool.generic":e=>(0,L.jsx)(jG,{...e})});var NG={transcript:`data-oc-transcript`,message:`data-oc-message`,messageId:`data-oc-message-id`,messageType:`data-oc-message-type`,composer:`data-oc-composer`,composerInput:`data-oc-composer-input`,composerSend:`data-oc-composer-send`,toolCard:`data-oc-tool-card`,toolName:`data-oc-tool-name`,sessionHeader:`data-oc-session-header`,sidebar:`data-oc-sidebar`,queueStrip:`data-oc-queue-strip`,subagentStrip:`data-oc-subagent-strip`,runsPanel:`data-oc-runs-panel`},PG=new Map;function FG(e,t){let n=PG.get(e)??[];return n.push(t),PG.set(e,n),()=>{let e=n.indexOf(t);e>=0&&n.splice(e,1),t()}}function IG(e){return{foreign(t,n,r){let i=Array.isArray(n)?n:[n],a=r?.position??`after`,o=r?.onRemove,s=t.parentNode;if(!s)return()=>{};if(a===`before`)for(let e of i)s.insertBefore(e,t);else{let e=t.nextSibling;for(let t of i)s.insertBefore(t,e)}let c=()=>{for(let e of i)e.parentNode?.removeChild(e)},l=LG(t,()=>{if(c(),l(),o)try{o()}catch(t){console.error(`[dom-ext] onRemove "${e}" failed:`,t)}});return FG(e,()=>{l(),c()})},watch(t,n){let r=t.join(`,`),i=new MutationObserver(e=>{for(let t of e){let e=[];for(let n of Array.from(t.addedNodes))if(n instanceof HTMLElement){n.matches(r)&&e.push(n);for(let t of Array.from(n.querySelectorAll(r)))e.push(t)}e.length>0&&n(e,t)}});return i.observe(document.body,{childList:!0,subtree:!0}),FG(e,()=>i.disconnect())},styles(t){let n=document.createElement(`style`);return n.setAttribute(`data-oc-dom-ext`,e),n.textContent=t,document.head.appendChild(n),FG(e,()=>n.remove())},onStreamingSettled(t,n=800){let r=null,i=()=>{r&&clearTimeout(r),r=setTimeout(()=>{r=null,t()},n)},a=new MutationObserver(i);return a.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),i(),FG(e,()=>{r&&clearTimeout(r),a.disconnect()})}}}function LG(e,t){let n=new MutationObserver(()=>{document.body.contains(e)||t()});return n.observe(document.body,{childList:!0,subtree:!0}),()=>n.disconnect()}async function RG(e,t){zG(e),PG.set(e,[]);let n=IG(e);try{let r=await t.mount(n);typeof r==`function`&&FG(e,r)}catch(t){console.error(`[dom-ext] mount "${e}" failed:`,t),zG(e)}}function zG(e,t){let n=PG.get(e)??[];PG.delete(e);for(let t of n.splice(0))try{t()}catch(t){console.error(`[dom-ext] cleanup "${e}" failed:`,t)}try{t?.dispose?.()}catch(t){console.error(`[dom-ext] dispose "${e}" failed:`,t)}for(let t of Array.from(document.querySelectorAll(`[data-oc-dom-ext="${CSS.escape(e)}"]`)))t.remove()}function BG(e){return typeof e!=`object`||!e?!1:typeof e.mount==`function`}var VG=`webui.extkv.`,HG=new Map;function UG(){try{return typeof localStorage<`u`}catch{return!1}}function WG(e,t){if(UG())try{return localStorage.getItem(VG+e+`.`+t)??void 0}catch{}return HG.get(e)?.get(t)}function GG(e,t,n){if(UG())try{localStorage.setItem(VG+e+`.`+t,n);return}catch{}let r=HG.get(e);r||(r=new Map,HG.set(e,r)),r.set(t,n)}function KG(e,t){if(UG())try{localStorage.removeItem(VG+e+`.`+t)}catch{}HG.get(e)?.delete(t)}function qG(e){return{get(t){let n=WG(e,t);if(n!==void 0)try{return JSON.parse(n)}catch{return}},set(t,n){try{GG(e,t,JSON.stringify(n))}catch{}},delete(t){KG(e,t)},keys(){let t=new Set;if(UG())try{let n=VG+e+`.`;for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r?.startsWith(n)&&t.add(r.slice(n.length))}}catch{}for(let n of HG.get(e)?.keys()??[])t.add(n);return[...t]},clear(){for(let t of this.keys())KG(e,t)}}}function JG(){return{version:1,register:Ot,react:w,api:W,store:Gh,prefs:{getPrefs:ah,setPref:oh,subscribePrefs:sh},notify:ck,services:{getService:Tt,getServiceProviders:Et},dom:{mount:RG,dispose:zG,isModule:BG,anchors:NG,version:1},kv:{forExt:qG}}}function YG(){let e=window;return e.__opencodeUI??=JG(),e.__opencodeUI}function XG(){return YG()}var ZG=new Map,QG=new Map,$G=new Map;function eK(){YG()}var tK=!1;async function nK(e){if(eK(),!e?.force&&tK&&document.hidden)return;let t;try{let e=await fetch(`/api/webui/extensions`);if(!e.ok)return;let n=(await e.json())?.data;t=Array.isArray(n)?n:[]}catch{return}let n=new Set,r=new Set,i=new Set;for(let e of t)if(typeof e?.id==`string`){if(e.disabled){i.add(e.id);continue}if(typeof e?.url==`string`||typeof e?.domUrl==`string`){if(typeof e.url==`string`&&e.origin!==`shipped`&&(n.add(e.id),ZG.get(e.id)!==e.url)){let t=new Set(gt());try{await Wh(()=>import(e.url),[]),ZG.set(e.id,e.url);let n=gt(),r=QG.get(e.id);r||(r=new Set,QG.set(e.id,r));for(let e of n)t.has(e)||r.add(e);ch(`extension.loaded`,{id:e.id,url:e.url})}catch{}}typeof e.domUrl==`string`&&(r.add(e.id),await rK(e.id,e.domUrl))}}let a=new Set;for(let e of ZG.keys())if(!n.has(e)){let t=QG.get(e);if(t&&t.size>0)for(let e of t)a.add(e);else a.add(e);ZG.delete(e),QG.delete(e)}a.size>0&&ht([...a]),i.size>0&&ht([...i]);for(let[e,t]of $G)r.has(e)||($G.delete(e),zG(e,t.module))}async function rK(e,t){if($G.get(e)?.url===t)return;let n;try{let e=await Wh(()=>import(t),[]);if(!BG(e.default))return;n=e.default}catch{return}let r=$G.get(e);r&&zG(e,r.module),$G.set(e,{url:t,module:n}),await RG(e,n)}function iK(){let e=null;try{e=new EventSource(`/api/webui/extensions/events`)}catch{return}e.onmessage=()=>{nK({force:!0})},e.onerror=()=>{},document.addEventListener(`visibilitychange`,()=>{document.hidden||nK()})}function aK(){tK||(tK=!0,eK(),nK({force:!0}),iK())}var oK=typeof localStorage<`u`&&localStorage.getItem(`webui.debug`)===`1`;window.__WEBUI_DEBUG_CONSOLE__=oK,YG(),aK(),J_(),G(`boot`,`app render (console mirror: ${oK?`on`:`off`})`),(0,ct.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(w.StrictMode,{children:(0,L.jsx)(xk,{children:(0,L.jsx)(gk,{})})}));export{gt as n,XG as t};
|