@xfey/tutti 0.1.70 → 0.1.71

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.
@@ -7,7 +7,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
7
7
  Error generating stack: `+e.message+`
8
8
  `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(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 Ze(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=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(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 Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(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 et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function N(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function P(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-Ue(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&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function it(e,t){var n=t&-t;return n=n&42?1:at(n),(n&(e.suspendedLanes|t))===0?n:0}function at(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 ot(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function st(){var e=M.p;return e===0?(e=window.event,e===void 0?32:Cp(e.type)):e}function ct(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var lt=Math.random().toString(36).slice(2),ut=`__reactFiber$`+lt,dt=`__reactProps$`+lt,ft=`__reactContainer$`+lt,pt=`__reactEvents$`+lt,mt=`__reactListeners$`+lt,ht=`__reactHandles$`+lt,gt=`__reactResources$`+lt,_t=`__reactMarker$`+lt;function vt(e){delete e[ut],delete e[dt],delete e[pt],delete e[mt],delete e[ht]}function F(e){var t=e[ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ft]||n[ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sf(e);e!==null;){if(n=e[ut])return n;e=Sf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[ut]||e[ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[gt];return t||=e[gt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[_t]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=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]*$`),Ot={},kt={};function At(e){return Ee.call(kt,e)?!0:Ee.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(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 Mt(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 Nt(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 Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(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 Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function zt(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 Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(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=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(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=``+Pt(s):e.removeAttribute(`name`)}function Ut(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)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(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),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(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=``+Pt(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 Kt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=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 Xt(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||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(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&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(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 $t=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`]]),en=/^[\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 tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(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="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[dt]||null;if(!a)throw Error(i(90));Ht(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&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(ku(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[dt]||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 fn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,`passive`,{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.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 _n=i.slice(e,1<r?1-r:void 0)}function yn(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 bn(){return!0}function xn(){return!1}function Sn(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)?bn:xn,this.isPropagationStopped=xn,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=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=m({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=m({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,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!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),I=Sn(An),jn=Sn(m({},An,{dataTransfer:0})),Mn=Sn(m({},Tn,{relatedTarget:0})),Nn=Sn(m({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=Sn(m({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=Sn(m({},Cn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=Sn(m({},Tn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=Sn(m({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=Sn(m({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=Sn(m({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=Sn(m({},An,{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})),Kn=Sn(m({},Cn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=fn&&`CompositionEvent`in window,Yn=null;fn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=fn&&`TextEvent`in window&&!Yn,Zn=fn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=vn(),_n=gn=hn=null,nr=!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 Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Id(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){kd(e,0)}function dr(e){if(Rt(bt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(fn){var mr;if(fn){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,an(e)),un(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(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(!Ee.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(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=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(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=zt(e.document)}return t}function Ar(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 jr=fn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==zt(r)||(r=Mr,`selectionStart`in r&&Ar(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}),Pr&&Tr(Pr,r)||(Pr=r,r=Id(Nr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Rr={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},zr={},Br={};fn&&(Br=document.createElement(`div`).style,`AnimationEvent`in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),`TransitionEvent`in window||delete Rr.transitionend.transition);function Vr(e){if(zr[e])return zr[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return zr[e]=t[n];return e}var Hr=Vr(`animationend`),Ur=Vr(`animationiteration`),Wr=Vr(`animationstart`),Gr=Vr(`transitionrun`),Kr=Vr(`transitionstart`),qr=Vr(`transitioncancel`),Jr=Vr(`transitionend`),Yr=new Map,Xr=`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(` `);Xr.push(`scrollEnd`);function Zr(e,t){Yr.set(e,t),Tt(t,[e])}var Qr=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)},$r=[],ei=0,ti=0;function ni(){for(var e=ei,t=ti=ei=0;t<e;){var n=$r[t];$r[t++]=null;var r=$r[t];$r[t++]=null;var i=$r[t];$r[t++]=null;var a=$r[t];if($r[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&&ai(n,i,a)}}function ri(e,t,n,r){$r[ei++]=e,$r[ei++]=t,$r[ei++]=n,$r[ei++]=r,ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function L(e,t,n,r){return ri(e,t,n,r),oi(e)}function ii(e,t){return ri(e,null,null,t),oi(e)}function ai(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-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(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 si={};function ci(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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(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 fi(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 pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Qf(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=li(31,n,t,a),e.elementType=O,e.lanes=o,e;case y:return mi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=li(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=li(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=li(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 ee:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Ue(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,Ii=!1,Li=null,Ri=!1,zi=Error(i(519));function Bi(e){throw Ki(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),zi}function Vi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ut]=e,t[dt]=r,n){case`dialog`:H(`cancel`,t),H(`close`,t);break;case`iframe`:case`object`:case`embed`:H(`load`,t);break;case`video`:case`audio`:for(n=0;n<Dd.length;n++)H(Dd[n],t);break;case`source`:H(`error`,t);break;case`img`:case`image`:case`link`:H(`error`,t),H(`load`,t);break;case`details`:H(`toggle`,t);break;case`input`:H(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:H(`invalid`,t);break;case`textarea`:H(`invalid`,t),qt(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||Hd(t.textContent,n)?(r.popover!=null&&(H(`beforetoggle`,t),H(`toggle`,t)),r.onScroll!=null&&H(`scroll`,t),r.onScrollEnd!=null&&H(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Bi(e,!0)}function Hi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:Pi=Pi.return}}function Ui(e){if(e!==Pi)return!1;if(!Ii)return Hi(e),Ii=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||ef(e.type,e.memoizedProps)),n=!n),n&&Fi&&Bi(e),Hi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=xf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=xf(e)}else t===27?(t=Fi,lf(e.type)?(e=bf,bf=null,Fi=e):Fi=t):Fi=Pi?yf(e.stateNode.nextSibling):null;return!0}function Wi(){Fi=Pi=null,Ii=!1}function Gi(){var e=Li;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Li=null),e}function Ki(e){Li===null?Li=[e]:Li.push(e)}var qi=ce(null),Ji=null,Yi=null;function Xi(e,t,n){ue(qi,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=qi.current,le(qi)}function Qi(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 $i(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),Qi(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),Qi(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 ea(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;wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sp]:e.push(sp))}a=a.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Ji=e,Yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return R(Ji,e)}function ia(e,t){return Ji===null&&na(e),R(e,t)}function R(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Yi===null){if(e===null)throw Error(i(308));Yi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yi=Yi.next=t;return n}var aa=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()})}},oa=t.unstable_scheduleCallback,sa=t.unstable_NormalPriority,ca={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new aa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&oa(sa,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=xd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(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 va=j.S;j.S=function(e,t){lu=je(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=ce(null);function ba(){var e=ya.current;return e===null?Wl.pooledCache:e}function xa(e,t){t===null?ue(ya,ya.current):ue(ya,t.pool)}function z(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);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,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(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 La(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=di(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=hi(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===D&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Fa(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=_i(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=mi(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=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case D:return t=Oa(t),f(e,t,n)}if(ie(t)||ne(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,ia(e,t),n);Ia(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 D:return n=Oa(n),p(e,t,n,r)}if(ie(n)||ne(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,ia(e,n),r);Ia(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 D:return r=Oa(r),m(e,t,n,r,i)}if(ie(r)||ne(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,ia(t,r),i);Ia(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),Ii&&ki(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 Ii&&ki(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)}),Ii&&ki(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),Ii&&ki(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 Ii&&ki(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)}),Ii&&ki(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===D&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Fa(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}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Oa(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(ne(o)){if(l=ne(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,Pa(o),c);if(o.$$typeof===C)return b(e,r,ia(e,o),c);Ia(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=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(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 Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(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=oi(e),ai(e,null,n),t}return ri(e,r,t,n),oi(e)}function Ga(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,rt(e,n)}}function Ka(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 qa=!1;function Ja(){if(qa){var e=ma;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!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===pa&&(qa=!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:Ba=!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 Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=ce(null),$a=ce(0);function eo(e,t){e=Ql,ue($a,e),ue(Qa,t),Ql=e|t.baseLanes}function to(){ue($a,Ql),ue(Qa,Qa.current)}function no(){Ql=$a.current,le(Qa),le($a)}var ro=ce(null),io=null;function ao(e){var t=e.alternate;ue(uo,uo.current&1),ue(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){ue(uo,uo.current),ue(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(ue(uo,uo.current),ue(ro,e),io===null&&(io=e)):co(e)}function co(){ue(uo,uo.current),ue(ro,ro.current)}function lo(e){le(ro),io===e&&(io=null),le(uo)}var uo=ce(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||_f(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 po=0,B=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Hs:Us,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){j.H=Vs;var t=mo!==null&&mo.next!==null;if(po=0,ho=mo=B=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||oc||(e=e.dependencies,e!==null&&ta(e)&&(oc=!0))}function Do(e,t,n,r){B=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Ws,o=t(n,r)}while(_o);return o}function Oo(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(B.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}po=0,ho=mo=B=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?B.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?B.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?B.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Da(xo,e,t),t=B,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ra(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.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=Po(),B.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]=k;return t.index++,n}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(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?(po&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===pa&&(d=!0);else if((po&p)===p){u=u.next,p===pa&&(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,B.lanes|=p,eu|=p;f=u.action,vo&&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,B.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(oc=!0,d&&(n=ma,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 Vo(e){var t=No(),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);wr(o,t.memoizedState)||(oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=B,a=No(),o=Ii;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,oc=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),Wl===null)throw Error(i(349));o||po&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=Po(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function qo(e){var t=ii(e,2);t!==null&&wu(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Rs(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)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Ii){var n=Wl.formState;if(n!==null){a:{var r=B;if(Ii){if(Fi){b:{for(var i=Fi,a=Ri;i.nodeType!==8;){if(!a){i=null;break b}if(i=yf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=yf(i.nextSibling),r=i.data===`F!`;break a}}Bi(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,B,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,B,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Sa?wa:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=Po(),B.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 ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();B.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(B.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=Po(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(Ul&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(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 ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||po&1073741824&&!(Kl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),B.lanes|=e,eu|=e,n)}function ws(e,t,n,r){return wr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Kl&261930)?(oc=!0,e.memoizedState=n):(e=Cu(),B.lanes|=e,eu|=e,t):(e=Cs(e,n,r),wr(e,t)||(oc=!0),e)}function Ts(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Ls(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,_a(c,r),Su(e)):Is(e,t,r,Su(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,ae,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},Su())}function As(){return ra(sp)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Ua(n);var r=Wa(t,e,n);r!==null&&(wu(r,t,n),Ga(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=L(e,t,n,r),n!==null&&(wu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,Su())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(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,wr(s,o))return ri(e,t,i,0),Wl===null&&ni(),!1}catch{}if(n=L(e,t,i,r),n!==null)return wu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=L(e,n,r,2),t!==null&&wu(t,e,2)}function Rs(e){var t=e.alternate;return e===B||t!==null&&t===B}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var Vs={readContext:ra,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ra,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){He(!0);try{n(t)}finally{He(!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=Ps.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,B,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=Mo();if(Ii){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Wl===null)throw Error(i(349));Kl&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Wl.identifierPrefix;if(Ii){var n=Oi,r=Di;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ns.bind(null,B)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(Ul&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ra,use:Io,useCallback:xs,useContext:ra,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ra,use:Io,useCallback:xs,useContext:ra,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(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 Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(wu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(wu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(wu(t,e,n),Ga(t,e,n))}};function qs(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?!Tr(n,r)||!Tr(i,a):!0}function Js(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&&Ks.enqueueReplaceState(t,t.state,null)}function Ys(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 Xs(e){Qr(e)}function Zs(e){console.error(e)}function Qs(e){Qr(e)}function $s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ec(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 tc(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){$s(e,t)},n}function nc(e){return e=Ua(e),e.tag=3,e}function rc(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(){ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ec(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 ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Iu():n.alternate===null&&$l===0&&($l=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?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===Ta?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(Ii)return t=ro.current,t===null?(r!==zi&&(t=Error(i(423),{cause:r}),Ki(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=tc(e.stateNode,r,a),Ka(e,a),$l!==4&&($l=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==zi&&(e=Error(i(422),{cause:r}),Ki(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),au===null?au=[o]:au.push(o),$l!==4&&($l=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=tc(n.stateNode,r,e),Ka(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=nc(a),rc(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var ac=Error(i(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function cc(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 na(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Ii&&s&&ji(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref)if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}return vc(e,t,n,r,i)}function dc(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 pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),to(),co(t)):(xa(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),to(),so(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return Ra(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ii){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(oo(t),(e=Fi)?(e=hf(e,Ri),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(oc||ea(e,t,n,!1),a=(n&e.childLanes)!==0,oc||a){if(r=Wl,r!==null&&(s=it(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),wu(r,e,s),ac;Iu(),t=hc(e,t,n)}else e=o.treeContext,Fi=yf(s.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=mc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(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 vc(e,t,n,r,i){return na(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Ii&&r&&ji(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!oc?(Ao(e,t,a),Mc(e,t,a)):(Ii&&r&&ji(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if(na(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(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&&Ks.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),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=Ys(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ra(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)&&Js(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=Ba||qs(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,Ha(e,t),o=t.memoizedProps,u=Ys(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ra(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)&&Js(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=Ba||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(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,_c(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Wi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:z()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function Tc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ii){if(a?ao(t):co(t),(e=Fi)?(e=hf(e,Ri),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return _f(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Dc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(ao(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Dc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),_f(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ki({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||ea(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=Wl,s!==null&&(r=it(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),wu(s,e,r),ac;gf(c)||Iu(),t=Oc(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=yf(c.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(a=c.cachePool,a===null?a=z():(l=ca._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=di(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 Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return Ra(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function Ac(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 jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,ue(uo,o),sc(e,t,r,n),r=Ii?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(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&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(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&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(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=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function Pc(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Xi(t,ca,e.memoizedState.cache),Wi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ue(uo,uo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:Xi(t,ca,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}else oc=!1,Ii&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Ys(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=cc(null,t,e,r,n);break a}else if(a===ee){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ys(r,t.pendingProps),bc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,ca,r),r!==o.cache&&$i(t,[ca],n,!0),Ja(),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=xc(e,t,r,n);break a}else if(r!==a){a=yi(Error(i(424)),t),Ki(a),t=xc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=yf(e.firstChild),Pi=t,Ii=!0,Li=null,Ri=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wi(),r===a){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ii||(n=t.type,e=t.pendingProps,r=Zd(pe.current).createElement(n),r[ut]=t,r[dt]=e,Gd(r,n,e),St(r),t.stateNode=r):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Ii&&(r=t.stateNode=Cf(t.type,t.pendingProps,pe.current),Pi=t,Ri=!0,a=Fi,lf(t.type)?(bf=a,Fi=yf(r.firstChild)):Fi=a),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ii&&((a=r=Fi)&&(r=pf(r,t.type,t.pendingProps,Ri),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=yf(r.firstChild),Ri=!1,a=!0)),a||Bi(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ef(a,o)?r=null:s!==null&&ef(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),sp._currentValue=a),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&Ii&&((e=n=Fi)&&(n=mf(n,t.pendingProps,Ri),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||Bi(t)),null;case 13:return Tc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,na(t),a=ra(a),r=r(a),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(ca),e===null?(a=ba(),a===null&&(a=Wl,o=la(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Xi(t,ca,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Xi(t,ca,r),r!==a.cache&&$i(t,[ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Xi(t,ca,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ic(e){e.flags|=4}function Lc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(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 ka=Ta,Ca}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$f(t))if(Nu())e.flags|=8192;else throw ka=Ta,Ca}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,iu|=t)}function Bc(e,t){if(!Ii)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 V(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(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return V(t),null;case 1:return V(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(ca),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gi())),V(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ic(t),o===null?(V(t),Lc(t,a,null,r,n)):(V(t),Rc(t,o))):o?o===e.memoizedState?(V(t),t.flags&=-16777217):(Ic(t),V(t),Rc(t,o)):(e=e.memoizedProps,e!==r&&Ic(t),V(t),Lc(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return V(t),null}e=de.current,Ui(t)?Vi(t,e):(e=Cf(a,r,n),t.stateNode=e,Ic(t))}return V(t),null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return V(t),null}if(o=de.current,Ui(t))Vi(t,o);else{var s=Zd(pe.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[ut]=t,o[dt]=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(Gd(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&&Ic(t)}}return V(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Ui(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Hd(e.nodeValue,n)),e||Bi(t,!0)}else e=Zd(e).createTextNode(r),e[ut]=t,t.stateNode=e}return V(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ui(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[ut]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),e=!1}else n=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return V(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ui(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[ut]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),a=!1}else a=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(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),zc(t,t.updateQueue),V(t),null);case 4:return ge(),e===null&&Md(t.stateNode.containerInfo),V(t),null;case 10:return Zi(t.type),V(t),null;case 19:if(le(uo),r=t.memoizedState,r===null)return V(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Bc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return ue(uo,uo.current&1|2),Ii&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>uu&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ii)return V(t),null}else 2*je()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,Bc(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?(V(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=uo.current,ue(uo,a?n&1|2:n&1),Ii&&ki(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(V(t),t.subtreeFlags&6&&(t.flags|=8192)):V(t),n=t.updateQueue,n!==null&&zc(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&&le(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(ca),V(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(ca),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(uo),null;case 4:return ge(),null;case 10:return Zi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&le(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(ca),null;case 25:return null;default:return null}}function Uc(e,t){switch(Mi(t),t.tag){case 3:Zi(ca),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:le(uo);break;case 10:Zi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&le(ya);break;case 24:Zi(ca)}}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{Za(t,n)}catch(t){ed(e,e.return,t)}}}function qc(e,t,n){n.props=Ys(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;Kd(r,e.type,n,t),r[dt]=t}catch(t){ed(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(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&&lf(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=nn));else if(r!==4&&(r===27&&lf(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&&lf(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]);Gd(t,r,n),t[ut]=e,t[dt]=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,Yd=gp,e=kr(e),Ar(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(Xd={focusedElem:e,selectionRange:n},gp=!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=Ys(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)ff(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ff(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=Ys(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{Za(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),vf(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)!=0):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&&vt(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(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,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;lf(n.type)&&(dl=n.stateNode,fl=!1),pl(e,t,n),wf(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,uf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hp(e)):uf(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{Hp(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{Hp(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(lf(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[_t]||o[ut]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Gd(o,r,n),o[ut]=e,St(o),r=o;break a;case`link`:var s=Xf(`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),Gd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Xf(`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),Gd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ut]=e,St(o),r=o}e.stateNode=r}else Zf(a,e.type,e.stateNode);else e.stateNode=Gf(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?Zf(a,e.type,e.stateNode):Gf(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{Jt(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(Yf=null,a=bl,bl=Df(t.containerInfo),yl(t,e),bl=a,Sl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hp(t.containerInfo)}catch(t){ed(e,e.return,t)}al&&(al=!1,Cl(e));break;case 4:r=bl,bl=Df(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=je()),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?df(m,!0):df(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&&(Jt(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:wf(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)!=0,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++)Xa(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&&ua(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&&ua(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&&ua(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)!=0||!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)!=0||!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&&ep(n,bl,e.memoizedState,e.memoizedProps);break;case 5:Pl(e,t,n);break;case 3:case 4:var r=bl;bl=Df(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:ua(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=ra(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(ca).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:j.T===null?st():xd()}function Cu(){if(ru===0)if(!(Kl&536870912)||Ii){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),ru=e}else ru=536870912;return e=ro.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)),N(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)==0&&(t&e.expiredLanes)===0||Qe(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}else{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-je(),10<a)){if(Ou(r,t,ru,!Yl),Ze(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=rf(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:nn},Fl(t,a,d);var m=(a&62914560)===a?cu-je():(a&4194048)===a?lu-je():0;if(m=np(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(!wr(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-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(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,Yi=Ji=null,jo(e),Ma=null,Na=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,af(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Wl=e,Gl=n=di(e.current,null),Kl=t,ql=0,Jl=null,Yl=!1,Xl=Qe(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-Ue(r),a=1<<i;t|=e[i],r&=~a}return Ql=t,ni(),n}function Mu(e,t){B=null,j.H=Vs,t===Sa||t===wa?(t=Aa(),ql=3):t===Ca?(t=Aa(),ql=4):ql=t===ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Jl=t,Gl===null&&($l=1,$s(e,yi(t,e.current)))}function Nu(){var e=ro.current;return e===null?!0:(Kl&4194048)===Kl?io===null:(Kl&62914560)===Kl||Kl&536870912?e===io:!1}function Pu(){var e=j.H;return j.H=Vs,e===null?Vs:e}function Fu(){var e=j.A;return j.A=Vl,e}function Iu(){$l=4,Yl||(Kl&4194048)!==Kl&&ro.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:ro.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++,Yi=Ji=null,Ul=r,j.H=i,j.A=a,Gl===null&&(Wl=null,Kl=0,ni()),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=je()+500,ju(e,t)):Xl=Qe(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(Ea(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:Ea(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?$f(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 Yi=Ji=null,j.H=r,j.A=a,Ul=n,Gl===null?(Wl=null,Kl=0,ni(),$l):0}function Bu(){for(;Gl!==null&&!ke();)Vu(Gl)}function Vu(e){var t=Fc(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=yc(n,t,t.pendingProps,t.type,void 0,Kl);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,Kl);break;case 5:jo(t);default:Uc(n,t),t=Gl=fi(t,Ql),t=Fc(n,t,Ql)}e.memoizedProps=e.pendingProps,t===null?Wu(e):Gl=t}function Uu(e,t,n,r){Yi=Ji=null,jo(t),Ma=null,Na=0;var i=t.return;try{if(ic(e,i,t,n,Kl)){$l=1,$s(e,yi(n,e.current)),Gl=null;return}}catch(t){if(i!==null)throw Gl=i,t;$l=1,$s(e,yi(n,e.current)),Gl=null;return}t.flags&32768?(Ii||r===1?e=!0:Xl||Kl&536870912?e=!1:(Yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.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|=ti,P(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(Fe,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=Ul,Ul|=4;try{cl(e,t,n)}finally{Ul=s,M.p=a,j.T=r}}pu=1,qu(),Ju(),Yu()}}function qu(){if(pu===1){pu=0;var e=mu,t=hu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Ul;Ul|=4;try{xl(t,e);var a=Xd,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(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 _=Dr(s,h),v=Dr(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}}gp=!!Yd,Xd=Yd=null}finally{Ul=i,M.p=r,j.T=n}}e.current=t,pu=2}}function Ju(){if(pu===2){pu=0;var e=mu,t=hu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Ul;Ul|=4;try{ll(e,t.alternate,t)}finally{Ul=i,M.p=r,j.T=n}}pu=3}}function Yu(){if(pu===4||pu===3){pu=0,Ae();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),ot(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.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{j.T=t,M.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,ua(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=ot(gu),r=j.T,a=M.p;try{M.p=32>n?32:n,j.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),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{M.p=a,j.T=r,Xu(e,t)}}function $u(e,t,n){t=yi(n,t),t=tc(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(N(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}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=yi(n,e),n=nc(2),r=Wa(t,n,2),r!==null&&(rc(n,r,t,e),N(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>je()-cu?!(Ul&2)&&ju(e,0):nu|=n,iu===Kl&&(iu=0)),pd(e)}function rd(e,t){t===0&&(t=et()),e=ii(e,t),e!==null&&(N(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 De(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-Ue(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=Ze(r,r===Wl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(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&&nf()&&(e=fd);for(var t=je(),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-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=$e(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Wl,n=Kl,n=Ze(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&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),ot(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=vd.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(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=Ze(e,e===Wl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),_d(e,je()),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(){sf(function(){Ul&6?De(Ne,hd):gd()})}function xd(){if(fd===0){var e=pa;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),fd=e}return fd}function Sd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+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[dt]||null).action),o=r.submitter;o&&(t=(t=o[dt]||null)?Sd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new wn(`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);Ds(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),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Td=0;Td<Xr.length;Td++){var Ed=Xr[Td];Zr(Ed.toLowerCase(),`on`+(Ed[0].toUpperCase()+Ed.slice(1)))}Zr(Hr,`onAnimationEnd`),Zr(Ur,`onAnimationIteration`),Zr(Wr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Gr,`onTransitionRun`),Zr(Kr,`onTransitionStart`),Zr(qr,`onTransitionCancel`),Zr(Jr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`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)!=0;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){Qr(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){Qr(e)}i.currentTarget=null,a=c}}}}function H(e,t){var n=t[pt];n===void 0&&(n=t[pt]=new Set);var r=e+`__bubble`;n.has(r)||(Nd(t,e,2,!1),n.add(r))}function Ad(e,t,n){var r=0;t&&(r|=4),Nd(n,e,r,t)}var jd=`_reactListening`+Math.random().toString(36).slice(2);function Md(e){if(!e[jd]){e[jd]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(Od.has(t)||Ad(t,!1,e),Ad(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,Ad(`selectionchange`,!1,t))}}function Nd(e,t,n,r){switch(Cp(t)){case 2:var i=_p;break;case 8:i=vp;break;default:i=yp}n=i.bind(null,t,n,e),i=void 0,!pn||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 Pd(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=F(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}un(function(){var r=a,i=an(n),s=[];a:{var c=Yr.get(e);if(c!==void 0){var l=wn,u=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;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=I;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case Hr:case Ur:case Wr:l=Nn;break;case Jr:l=Wn;break;case`scroll`:case`scrollend`:l=En;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,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=dn(m,p),g!=null&&d.push(Fd(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!==rn&&(u=n.relatedTarget||n.fromElement)&&(F(u)||u[ft]))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?F(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=I,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,F(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=Ld,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&&Rd(s,c,l,d,!1),u!==null&&f!==null&&Rd(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=fr;else if(or(c))if(pr)v=Sr;else{v=br;var y=yr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(s,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(s,n,i)}var b;if(Jn)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 nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,nr=!0)),y=Id(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Id(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),wd(s,e,r,n,i)}kd(s,t)})}function Fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Id(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=dn(e,n),i!=null&&r.unshift(Fd(e,i,a)),i=dn(e,t),i!=null&&r.push(Fd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ld(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rd(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=dn(n,a),l!=null&&o.unshift(Fd(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(Fd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zd=/\r\n?/g,Bd=/\u0000|\uFFFD/g;function Vd(e){return(typeof e==`string`?e:``+e).replace(zd,`
9
9
  `).replace(Bd,``)}function Hd(e,t){return t=Vd(t),Vd(e)===t}function Ud(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(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=tn(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ud(e,t,`name`,a.name,a,null),Ud(e,t,`formEncType`,a.formEncType,a,null),Ud(e,t,`formMethod`,a.formMethod,a,null),Ud(e,t,`formTarget`,a.formTarget,a,null)):(Ud(e,t,`encType`,a.encType,a,null),Ud(e,t,`method`,a.method,a,null),Ud(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&H(`scroll`,e);break;case`onScrollEnd`:r!=null&&H(`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=tn(``+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`:H(`beforetoggle`,e),H(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(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=$t.get(n)||n,jt(e,n,r))}}function Wd(e,t,n,r,a,o){switch(n){case`style`:Zt(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`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&H(`scroll`,e);break;case`onScrollEnd`:r!=null&&H(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.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[dt]||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,``):jt(e,n,r)}}}function Gd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:H(`error`,e),H(`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:Ud(e,t,o,s,n,null)}}a&&Ud(e,t,`srcSet`,n.srcSet,n,null),r&&Ud(e,t,`src`,n.src,n,null);return;case`input`:H(`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:Ud(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in H(`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:Ud(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in H(`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:Ud(e,t,s,c,n,null)}qt(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:Ud(e,t,l,r,n,null)}return;case`dialog`:H(`beforetoggle`,e),H(`toggle`,e),H(`cancel`,e),H(`close`,e);break;case`iframe`:case`object`:H(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)H(Dd[r],e);break;case`image`:H(`error`,e),H(`load`,e);break;case`details`:H(`toggle`,e);break;case`embed`:case`source`:case`link`:H(`error`,e),H(`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:Ud(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Wd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ud(e,t,c,r,n,null))}function Kd(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)||Ud(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&&Ud(e,t,p,m,r,f)}}Ht(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)||Ud(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&&Ud(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(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:Ud(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&&Ud(e,t,s,a,r,o)}Kt(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:Ud(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:Ud(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)&&Ud(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:Ud(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Wd(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||Wd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ud(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||Ud(e,t,f,p,r,m)}function qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Jd(){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&&qd(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&&qd(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 Yd=null,Xd=null;function Zd(e){return e.nodeType===9?e:e.ownerDocument}function Qd(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 $d(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 ef(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 tf=null;function nf(){var e=window.event;return e&&e.type===`popstate`?e===tf?!1:(tf=e,!0):(tf=null,!1)}var rf=typeof setTimeout==`function`?setTimeout:void 0,af=typeof clearTimeout==`function`?clearTimeout:void 0,of=typeof Promise==`function`?Promise:void 0,sf=typeof queueMicrotask==`function`?queueMicrotask:of===void 0?rf:function(e){return of.resolve(null).then(e).catch(cf)};function cf(e){setTimeout(function(){throw e})}function lf(e){return e===`head`}function uf(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),Hp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[_t]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wf(e.ownerDocument.body);n=i}while(n);Hp(t)}function df(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 ff(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`:ff(n),vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pf(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[_t])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=yf(e.nextSibling),e===null)break}return null}function mf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=yf(e.nextSibling),e===null))return null;return e}function hf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=yf(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function _f(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vf(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 yf(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 bf=null;function xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return yf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sf(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 Cf(e,t,n){switch(t=Zd(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 wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var Tf=new Map,Ef=new Set;function Df(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Of=M.d;M.d={f:kf,r:Af,D:Nf,C:Pf,L:Ff,m:If,X:U,S:Lf,M:Rf};function kf(){var e=Of.f(),t=ku();return e||t}function Af(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):Of.r(e)}var jf=typeof document>`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Gd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=W(e);break;case`script`:a=Uf(e)}Tf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Gd(t,`link`,e),St(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Tf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Gd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=xt(r).hoistableStyles,a=W(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);St(c),Gd(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,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function U(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=xt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0},t),(t=Tf.get(i))&&Jf(e,t),a=n.createElement(`script`),St(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=xt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Jf(e,t),a=n.createElement(`script`),St(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t,n,r){var a=(a=pe.current)?Df(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=W(n.href),n=xt(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=W(n.href);var o=xt(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(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.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},Tf.set(e,n),o||Hf(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=Uf(n),n=xt(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 W(e){return`href="`+Vt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(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}),Gd(t,`link`,n),St(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Vt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(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`),St(r),Gd(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=W(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Vf(n),(a=Tf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Gd(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,St(a),a):(r=n,(a=Tf.get(o))&&(r=m({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),Gd(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,Kf(r,n.precedence,e));return t.instance}function Kf(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 qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Yf=null;function Xf(e,t,n){if(Yf===null){var r=new Map,i=Yf=new Map;i.set(n,r)}else i=Yf,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[_t]||a[ut]||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 Zf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qf(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 $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(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=W(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Tf.get(i))&&qf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Gd(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=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&tp===0&&(tp=62500*Jd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ap(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.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=rp.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 sp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function cp(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=tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tt(0),this.hiddenUpdates=tt(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 lp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new cp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function up(e){return e?(e=si,e):si}function dp(e,t,n,r,i,a){i=up(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(wu(n,e,t),Ga(n,e,t))}function fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pp(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function mp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&wu(t,e,67108864),pp(e,67108864)}}function hp(e){if(e.tag===13||e.tag===31){var t=Su();t=at(t);var n=ii(e,t);n!==null&&wu(n,e,t),pp(e,t)}}var gp=!0;function _p(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,yp(e,t,n,r)}finally{M.p=a,j.T=i}}function vp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,yp(e,t,n,r)}finally{M.p=a,j.T=i}}function yp(e,t,n,r){if(gp){var i=bp(r);if(i===null)Pd(e,t,r,xp,n),Mp(e,r);else if(Pp(i,e,t,n,r))r.stopPropagation();else if(Mp(e,r),t&4&&-1<jp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Ul&6)&&(uu=je()+500,md(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&wu(s,a,2),ku(),pp(a,2)}if(a=bp(r),a===null&&Pd(e,t,r,xp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pd(e,t,r,null,n)}}function bp(e){return e=an(e),Sp(e)}var xp=null;function Sp(e){if(xp=null,e=F(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 xp=e,null}function Cp(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(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var wp=!1,Tp=null,Ep=null,Dp=null,Op=new Map,kp=new Map,Ap=[],jp=`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 Mp(e,t){switch(e){case`focusin`:case`focusout`:Tp=null;break;case`dragenter`:case`dragleave`:Ep=null;break;case`mouseover`:case`mouseout`:Dp=null;break;case`pointerover`:case`pointerout`:Op.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kp.delete(t.pointerId)}}function Np(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=yt(t),t!==null&&mp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pp(e,t,n,r,i){switch(t){case`focusin`:return Tp=Np(Tp,e,t,n,r,i),!0;case`dragenter`:return Ep=Np(Ep,e,t,n,r,i),!0;case`mouseover`:return Dp=Np(Dp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Op.set(a,Np(Op.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kp.set(a,Np(kp.get(a)||null,e,t,n,r,i)),!0}return!1}function Fp(e){var t=F(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,ct(e.priority,function(){hp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ct(e.priority,function(){hp(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 Ip(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=yt(n),t!==null&&mp(t),e.blockedOn=n,!1;t.shift()}return!0}function Lp(e,t,n){Ip(e)&&n.delete(t)}function Rp(){wp=!1,Tp!==null&&Ip(Tp)&&(Tp=null),Ep!==null&&Ip(Ep)&&(Ep=null),Dp!==null&&Ip(Dp)&&(Dp=null),Op.forEach(Lp),kp.forEach(Lp)}function zp(e,n){e.blockedOn===n&&(e.blockedOn=null,wp||(wp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rp)))}var Bp=null;function Vp(e){Bp!==e&&(Bp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bp===e&&(Bp=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(Sp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hp(e){function t(t){return zp(t,e)}Tp!==null&&zp(Tp,e),Ep!==null&&zp(Ep,e),Dp!==null&&zp(Dp,e),Op.forEach(t),kp.forEach(t);for(var n=0;n<Ap.length;n++){var r=Ap[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ap.length&&(n=Ap[0],n.blockedOn===null);)Fp(n),n.blockedOn===null&&Ap.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[dt]||null;if(typeof a==`function`)o||Vp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[dt]||null)s=o.formAction;else if(Sp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vp(n)}}}function Up(){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 Wp(e){this._internalRoot=e}Gp.prototype.render=Wp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dp(n,Su(),e,t,null,null)},Gp.prototype.unmount=Wp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dp(e.current,2,null,e,null,null),ku(),t[ft]=null}};function Gp(e){this._internalRoot=e}Gp.prototype.unstable_scheduleHydration=function(e){if(e){var t=st();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ap.length&&t!==0&&t<Ap[n].priority;n++);Ap.splice(n,0,e),n===0&&Fp(e)}};var Kp=n.version;if(Kp!==`19.2.5`)throw Error(i(527,Kp,`19.2.5`));M.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 qp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{Be=Jp.inject(qp),Ve=Jp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Xs,s=Zs,c=Qs;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=lp(e,1,!1,null,null,n,r,null,o,s,c,Up),e[ft]=t.current,Md(e),new Wp(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=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y=new class extends v{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},b={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=b;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function S(e){setTimeout(e,0)}var C=typeof window>`u`||`Deno`in globalThis;function w(){}function T(e,t){return typeof e==`function`?e(t):e}function E(e){return typeof e==`number`&&e>=0&&e!==1/0}function ee(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ne(o,t.options))return!1}else if(!re(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function te(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!re(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ne(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>oe(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function re(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>re(e[n],t[n])):!1}var ie=Object.prototype.hasOwnProperty;function j(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ae(e)&&ae(t);if(!r&&!(oe(e)&&oe(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ie.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=j(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function M(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ae(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function oe(e){if(!se(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!se(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function se(e){return Object.prototype.toString.call(e)===`[object Object]`}function ce(e){return new Promise(t=>{x.setTimeout(t,e)})}function le(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:j(e,t)}function ue(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function de(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fe=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===fe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function me(e,t){return typeof e==`function`?e(...t):!!e}function he(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ge=(()=>{let e=()=>C;return{isServer(){return e()},setIsServer(t){e=t}}})();function _e(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ve=S;function ye(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ve,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var be=ye(),xe=new class extends v{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Se(e){return Math.min(1e3*2**e,3e4)}function Ce(e){return(e??`online`)===`online`?xe.isOnline():!0}var we=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Te(e){let t=!1,n=0,r,i=_e(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new we(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>y.isFocused()&&(e.networkMode===`always`||xe.isOnline())&&e.canRun(),u=()=>Ce(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ge.isServer()?0:3),o=e.retryDelay??Se,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ce(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ee=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ge.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function De(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{he(e,()=>t.signal,()=>n=!0)},u=pe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?de:ue;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ke:Oe,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Oe(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Oe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ke(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ae(e,t){return t?Oe(e,t)!=null:!1}function je(e,t){return!t||!e.getPreviousPageParam?!1:ke(e,t)!=null}var Me=class extends Ee{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fe(this.options);e.data!==void 0&&(this.setState(Pe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=le(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>D(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ee(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=pe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?De(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Te({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof we&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof we){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ne(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),be.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ne(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ce(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ie=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=_e(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Re(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ze(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ze(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof O(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!M(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Be(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return He(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#g(){this.#b();let e=D(this.options.staleTime,this.#t);if(ge.isServer()||this.#r.isStale||!E(e))return;let t=ee(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ge.isServer()||O(this.options.enabled,this.#t)===!1||!E(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Re(e,t),o=i&&Be(e,n,t,r);(a||o)&&(l={...l,...Ne(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=le(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=le(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ve(e,t),refetch:this.refetch,promise:this.#o,isEnabled:O(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=_e())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!M(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){be.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Le(e,t){return O(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&O(t.retryOnMount,e)===!1)}function Re(e,t){return Le(e,t)||e.state.data!==void 0&&ze(e,t,t.refetchOnMount)}function ze(e,t,n){if(O(t.enabled,e)!==!1&&D(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ve(e,t)}return!1}function Be(e,t,n,r){return(e!==t||O(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ve(e,n)}function Ve(e,t){return O(t.enabled,e)!==!1&&e.isStaleByTime(D(t.staleTime,e))}function He(e,t){return!M(e.getCurrentResult(),t)}var Ue=class extends Ie{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ae(t,n.data),hasPreviousPage:je(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},We=class extends Ee{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ge(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Te({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),be.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ge(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ke=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new We({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=qe(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=qe(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=qe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=qe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){be.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>te(t,e))}findAll(e={}){return this.getAll().filter(t=>te(e,t))}notify(e){be.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return be.batch(()=>Promise.all(e.map(e=>e.continue().catch(w))))}};function qe(e){return e.options.scope?.id}var Je=class extends v{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),M(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&A(t.mutationKey)!==A(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ge();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){be.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Ye(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Xe(e,t,n){let r=e.slice(0);return r[t]=n,r}var Ze=class extends v{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,be.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!M(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ye(e,n).forEach(e=>{e.destroy()}),Ye(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=j(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ie(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Xe(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&be.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Qe=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ne(r,t),a=this.get(i);return a||(a=new Me({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){be.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>k(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>k(e,t)):t}notify(e){be.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){be.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){be.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},$e=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Qe,this.#t=e.mutationCache||new Ke,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=xe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(D(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=T(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return be.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;be.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return be.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=be.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(w).catch(w)}invalidateQueries(e,t={}){return be.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=be.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(w)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(w)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(D(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(w).catch(w)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(w).catch(w)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return xe.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(A(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{re(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(A(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{re(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ne(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===fe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},et=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})),tt=o(((e,t)=>{t.exports=et()})),N=l(d(),1),P=tt(),nt=N.createContext(void 0),rt=e=>{let t=N.useContext(nt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},it=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,P.jsx)(nt.Provider,{value:e,children:t})),at=N.createContext(!1),ot=()=>N.useContext(at);at.Provider;function st(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ct=N.createContext(st()),lt=()=>N.useContext(ct),ut=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?me(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},dt=e=>{N.useEffect(()=>{e.clearReset()},[e])},ft=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||me(n,[e.error,r])),pt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},mt=(e,t)=>e.isLoading&&e.isFetching&&!t,ht=(e,t)=>e?.suspense&&t.isPending,gt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _t({queries:e,...t},n){let r=rt(n),i=ot(),a=lt(),o=N.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{pt(e),ut(e,a,r.getQueryCache().get(e.queryHash))}),dt(a);let[s]=N.useState(()=>new Ze(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(e=>d?s.subscribe(be.batchCalls(e)):w,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),N.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>ht(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&ht(n,e)?gt(n,new Ie(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&ft({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function vt(e,t,n){let r=ot(),i=lt(),a=rt(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,pt(o),ut(o,i,s),dt(i);let c=!a.getQueryCache().get(o.queryHash),[l]=N.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(e=>{let t=d?l.subscribe(be.batchCalls(e)):w;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),N.useEffect(()=>{l.setOptions(o)},[o,l]),ht(o,u))throw gt(o,l,i);if(ft({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!ge.isServer()&&mt(u,r)&&(c?gt(o,l,i):s?.promise)?.catch(w).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function F(e,t){return vt(e,Ie,t)}function yt(e,t){let n=rt(t),[r]=N.useState(()=>new Je(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);let i=N.useSyncExternalStore(N.useCallback(e=>r.subscribe(be.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=N.useCallback((e,t)=>{r.mutate(e,t).catch(w)},[r]);if(i.error&&me(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function bt(e,t){return vt(e,Ue,t)}var xt=_(),St=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,Ct=32,wt=16,Tt=0xffffffffffff,Et;(function(e){e.Base32IncorrectEncoding=`B32_ENC_INVALID`,e.DecodeTimeInvalidCharacter=`DEC_TIME_CHAR`,e.DecodeTimeValueMalformed=`DEC_TIME_MALFORMED`,e.EncodeTimeNegative=`ENC_TIME_NEG`,e.EncodeTimeSizeExceeded=`ENC_TIME_SIZE_EXCEED`,e.EncodeTimeValueMalformed=`ENC_TIME_MALFORMED`,e.PRNGDetectFailure=`PRNG_DETECT`,e.ULIDInvalid=`ULID_INVALID`,e.Unexpected=`UNEXPECTED`,e.UUIDInvalid=`UUID_INVALID`})(Et||={});var Dt=class extends Error{constructor(e,t){super(`${t} (${e})`),this.name=`ULIDError`,this.code=e}};function Ot(e){let t=Math.floor(e()*Ct)%Ct;return St.charAt(t)}function kt(e){let t=At(),n=t&&(t.crypto||t.msCrypto)||null;if(typeof n?.getRandomValues==`function`)return()=>{let e=new Uint8Array(1);return n.getRandomValues(e),e[0]/256};if(typeof n?.randomBytes==`function`)return()=>n.randomBytes(1).readUInt8()/256;throw new Dt(Et.PRNGDetectFailure,`Failed to find a reliable PRNG`)}function At(){return Nt()?self:typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:null}function jt(e,t){let n=``;for(;e>0;e--)n=Ot(t)+n;return n}function Mt(e,t=10){if(isNaN(e))throw new Dt(Et.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>0xffffffffffff)throw new Dt(Et.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Tt}: ${e}`);if(e<0)throw new Dt(Et.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Dt(Et.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,r=``;for(let i=t;i>0;i--)n=e%Ct,r=St.charAt(n)+r,e=(e-n)/Ct;return r}function Nt(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function Pt(e,t){let n=t||kt();return Mt(!e||isNaN(e)?Date.now():e,10)+jt(wt,n)}var Ft=`[0-7][0-9A-HJKMNP-TV-Z]{25}`,It=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/,Lt={project:`prj_`,message:`msg_`,taskModule:`mod_`,task:`task_`,runResult:`run_result_`,recoverySummary:`recovery_`,activity:`act_`,event:`evt_`,workflowInvocation:`wf_`,clarificationThread:`clar_thread_`,clarificationRound:`clar_round_`,clarificationInteractionResponse:`clar_response_`,approvalRequest:`approval_`,idempotency:`idem_`,relayProject:`relay_project_`,relayAccount:`relay_account_`,relayMembership:`relay_member_`,relayAccountSession:`relay_account_session_`,relayClientSession:`relay_client_session_`,relayUpload:`relay_upload_`,relayAuthChallenge:`relay_auth_challenge_`,hostConnection:`host_connection_`,joinToken:`join_token_`,notice:`notice_`};function Rt(e){return`${e}${Pt()}`}function zt(e){return It.test(e)}function Bt(e,t){if(!e.startsWith(t))return null;let n=e.slice(t.length);return zt(n)?n:null}function Vt(e,t){return Bt(e,t)!==null}function Ht(e){return Bt(e,Lt.relayProject)??e.slice(Lt.relayProject.length)}function Ut(e){return Vt(e,Lt.relayProject)?e:zt(e)?`${Lt.relayProject}${e}`:null}var Wt=()=>Rt(Lt.idempotency),Gt=()=>Rt(Lt.notice);function Kt(e){return e instanceof Date?e.toISOString():e}function qt(e,t={}){let n=typeof t==`function`?{now:t}:t,r=n.issuedAt??n.issued_at??n.now?.()??new Date;return{command_id:n.commandId??n.command_id??Wt(),issued_at:Kt(r),payload:e}}var Jt=class extends Error{statusCode;code;retryable;details;constructor(e){super(e.message),this.name=`TuttiApiError`,this.statusCode=e.statusCode,this.code=e.code,this.retryable=e.retryable,e.details!==void 0&&(this.details=e.details)}};function Yt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Xt(e,t){if(Yt(t)&&Yt(t.error)){let n=t.error;return new Jt({message:typeof n.message==`string`?n.message:`Request failed`,statusCode:e,code:typeof n.code==`string`?n.code:`internal_error`,retryable:typeof n.retryable==`boolean`?n.retryable:e>=500,...n.details===void 0?{}:{details:n.details}})}return new Jt({message:`Request failed with HTTP ${e}`,statusCode:e,code:e===401?`unauthorized`:`internal_error`,retryable:e>=500})}function Zt(e,t){return e instanceof Jt&&(t===void 0||e.code===t)}function Qt(e){return e instanceof Jt&&(e.statusCode===401||e.code===`unauthorized`||e.code===`relay_session_invalid`)}function $t(e){return e.startsWith(`/`)?e:`/${e}`}function en(e,t){let n=e.replace(/\/+$/u,``),r=$t(t);return n===``?r:`${n}${r}`}function tn(e,t){if(t===void 0)return e;let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!=null&&n.set(e,String(r));let r=n.toString();return r===``?e:`${e}${e.includes(`?`)?`&`:`?`}${r}`}function nn(e,t,n){return tn(en(e,t),n)}function rn(e){return`/projects/${encodeURIComponent(Ht(e))}/workspace`}function an(e,t=``){let n=t===``?``:$t(t);return`/projects/${encodeURIComponent(e)}/host/api/v1${n}`}function on(e,t,n=``,r){return nn(e,an(t,n),r)}var sn=[`connection.ready`,`message.created`,`scratchpad.updated`,`worklist.changed`,`task.updated`,`task_detail.updated`,`clarification.changed`,`approval.changed`,`activity.event`,`execution_status.changed`,`provider_config.changed`,`workspace.recovered`,`query.invalidate`],cn=[`connection.ready`,`query.invalidate`];function ln(){let e=globalThis.EventSource;if(e===void 0)throw Error(`No EventSource implementation is available`);return e}function un(e){if(e===void 0)throw Error(`SSE event data is missing`);return JSON.parse(e)}function dn(e){return e.event_type===`connection.ready`}function fn(e,t){return tn(e,t===void 0?void 0:{after:t})}var pn=[3e3,1e4,3e4,6e4],mn=.2,hn=3e4;function gn(){return globalThis.navigator?.onLine!==!1}function _n(e){let t=e.delaysMs[Math.min(e.attempt,e.delaysMs.length-1)]??6e4,n=t*e.jitterRatio*(e.random()*2-1);return Math.max(0,Math.round(t+n))}function vn(e,t){return fn(e,t)}function yn(e,t){return fn(e,t)}function bn(e){let t=fn(e.url,e.after),n=`connecting`,r,i=!1,a,o,s,c=0,l,u=t,d=!1,f=e.reconnectDelaysMs??pn,p=e.reconnectJitterRatio??mn,m=e.reconnectResetAfterMs??hn,h=e.random??Math.random,g=e.isOnline??gn,_=t=>{n!==t&&(n=t,e.onStatusChange?.(t))},v=()=>{a!==void 0&&(clearTimeout(a),a=void 0)},y=()=>{o!==void 0&&(clearTimeout(o),o=void 0)},b=()=>{s!==void 0&&(clearTimeout(s),s=void 0)},x=()=>{v(),!(e.heartbeatTimeoutMs===void 0||i)&&(a=setTimeout(()=>{i||(_(`stale`),e.onError?.({kind:`heartbeat_timeout`}),w(l),d=!1,T(!0))},e.heartbeatTimeoutMs))},S=new Map,C=t=>{x();let n;try{n=un(t.data)}catch(n){e.onError?.({kind:`parse_error`,error:n,...t.data===void 0?{}:{raw_data:t.data}});return}r=n.event_id||t.lastEventId,e.onEvent?.(n),dn(n)&&(r=n.payload.current_event_cursor,e.onReady?.(n)),n.invalidates!==void 0&&e.onInvalidate?.(n.invalidates,n)};function w(e){let t=S.get(e);if(t!==void 0){for(let[n,r]of t)e.removeEventListener?.(n,r);S.delete(e)}e.onopen=null,e.onerror=null,e.close(),v(),b()}function T(e=!1){if(i||o!==void 0||(e||_(`reconnecting`),!g()))return;let t=_n({attempt:c,delaysMs:f,jitterRatio:p,random:h});c+=1,o=setTimeout(()=>{o=void 0,E(!1)},t)}function E(t){if(i||d)return;if(!t&&!g()){_(`reconnecting`);return}d=!0,u=fn(e.url,r??e.after);let n;try{n=new(e.eventSource??(ln()))(u,{withCredentials:e.withCredentials??!0})}catch(n){if(d=!1,e.onError?.({kind:`event_source_unavailable`,error:n}),t)throw n;T();return}l=n;let a=new Map;S.set(n,a);for(let t of e.eventTypes){let e=C;a.set(t,e),n.addEventListener(t,e)}n.onopen=()=>{i||l!==n||(d=!1,x(),_(`open`),b(),s=setTimeout(()=>{s=void 0,c=0},m))},n.onerror=t=>{i||l!==n||(e.onError?.({kind:`event_source_error`,error:t}),w(n),d=!1,T())}}let ee=()=>{i||n===`open`||d||(y(),E(!1))},D=globalThis,O=globalThis.document,k=()=>ee(),te=()=>{O?.visibilityState!==`hidden`&&ee()};D.addEventListener?.(`online`,k),D.addEventListener?.(`focus`,k),O?.addEventListener?.(`visibilitychange`,te);try{E(!0)}catch(e){throw D.removeEventListener?.(`online`,k),D.removeEventListener?.(`focus`,k),O?.removeEventListener?.(`visibilitychange`,te),e}return{get url(){return u},get source(){return l},close:()=>{i||(i=!0,v(),y(),b(),w(l),D.removeEventListener?.(`online`,k),D.removeEventListener?.(`focus`,k),O?.removeEventListener?.(`visibilitychange`,te),_(`closed`))},retryNow:ee,currentCursor:()=>r,status:()=>n}}function xn(e){return bn({...e,eventTypes:e.eventTypes??sn})}function Sn(e){return bn({...e,eventTypes:e.eventTypes??cn})}var Cn=new Set([`forwarded`,`x-real-ip`]),wn=[`x-tutti-`,`x-forwarded-`];function Tn(e){if(e!==void 0)return e;if(globalThis.fetch===void 0)throw new Jt({message:`No fetch implementation is available`,statusCode:0,code:`network_error`,retryable:!0});return globalThis.fetch.bind(globalThis)}function En(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`forEach`in e&&typeof e.forEach==`function`}function Dn(e){if(e===void 0)return[];if(En(e)){let t=[];return e.forEach((e,n)=>t.push([n,e])),t}return Array.isArray(e)?e.map(([e,t])=>[e,t]):Object.entries(e)}function On(e){let t=e.toLowerCase();return Cn.has(t)||wn.some(e=>t.startsWith(e))}function kn(...e){let t={};for(let n of e)for(let[e,r]of Dn(n))On(e)||(t[e]=r);return t}async function An(e){let t=await e.text();if(t.trim()!==``)return JSON.parse(t)}async function I(e,t,n={}){let r=kn({accept:`application/json`},e.headers,n.headers),i={method:n.method??`GET`,credentials:n.credentials??e.credentials??`include`,headers:r,...n.signal===void 0?{}:{signal:n.signal}};n.body!==void 0&&(Object.keys(r).some(e=>e.toLowerCase()===`content-type`)||(r[`content-type`]=`application/json`),i.body=JSON.stringify(n.body));let a=tn(en(e.baseUrl,t),n.query),o;try{o=await Tn(e.fetch)(a,i)}catch(e){throw new Jt({message:e instanceof Error?e.message:`Network request failed`,statusCode:0,code:`network_error`,retryable:!0})}let s=await An(o);if(!o.ok)throw Xt(o.status,s);return s}function jn(e){return{baseUrl:on(e.relayBaseUrl,e.relayProjectRef),...e.fetch===void 0?{}:{fetch:e.fetch},...e.credentials===void 0?{}:{credentials:e.credentials},...e.headers===void 0?{}:{headers:e.headers}}}function Mn(e){return e}function Nn(e){let t=`${e.baseUrl.replace(/\/+$/u,``)}/events`;return{getSession:()=>I(e,`/session`),getWorkspace:()=>I(e,`/workspace`),getBootstrap:()=>I(e,`/bootstrap`),getProviderConfig:()=>I(e,`/provider/config`),getProviderUsage:()=>I(e,`/provider/usage`),getProjectTimeline:()=>I(e,`/project-timeline`),updateProjectDisplayName:(t,n)=>I(e,`/workspace/project-display-name`,{method:`POST`,body:qt(t,n)}),updateProjectDescription:(t,n)=>I(e,`/workspace/project-description`,{method:`POST`,body:qt(t,n)}),getReadState:()=>I(e,`/read-state`),markRead:(t,n)=>I(e,`/read-state/mark-read`,{method:`POST`,body:qt(t,n)}),getMessages:t=>I(e,`/messages`,{...t===void 0?{}:{query:Mn(t)}}),sendMainChatMessage:(t,n)=>I(e,`/messages`,{method:`POST`,body:qt(t,n)}),getScratchpad:()=>I(e,`/scratchpad`),getWorklist:()=>I(e,`/worklist`),submitWorklist:(t={},n)=>I(e,`/worklist/submit`,{method:`POST`,body:qt(t,n)}),getActiveApproval:()=>I(e,`/approvals/active`),decideApproval:(t,n,r)=>I(e,`/approvals/${encodeURIComponent(t)}/decide`,{method:`POST`,body:qt(n,r)}),getActiveClarification:()=>I(e,`/clarifications/active`),getClarificationThread:t=>I(e,`/clarifications/${encodeURIComponent(t)}`),getClarificationRound:t=>I(e,`/clarifications/rounds/${encodeURIComponent(t)}`),getClarificationRoundMessages:(t,n)=>I(e,`/clarifications/rounds/${encodeURIComponent(t)}/messages`,{...n===void 0?{}:{query:Mn(n)}}),sendClarificationRoundMessage:(t,n,r)=>I(e,`/clarifications/rounds/${encodeURIComponent(t)}/messages`,{method:`POST`,body:qt(n,r)}),submitClarificationRound:(t,n={},r)=>I(e,`/clarifications/rounds/${encodeURIComponent(t)}/submit`,{method:`POST`,body:qt(n,r)}),getTask:t=>I(e,`/tasks/${encodeURIComponent(t)}`),getTaskDetail:t=>I(e,`/tasks/${encodeURIComponent(t)}/detail`),getTaskRunResults:(t,n)=>I(e,`/tasks/${encodeURIComponent(t)}/run-results`,{...n===void 0?{}:{query:Mn(n)}}),getRecoverySummaries:t=>I(e,`/recovery-summaries`,{...t===void 0?{}:{query:Mn(t)}}),getRecoverySummary:t=>I(e,`/recovery-summaries/${encodeURIComponent(t)}`),getExecutionStatus:()=>I(e,`/execution-status`),getArtifacts:()=>I(e,`/artifacts`),renewArtifactPreviewLease:()=>I(e,`/artifacts/preview/lease`,{method:`POST`}),runSchedulerNow:(t={},n)=>I(e,`/scheduler/run-now`,{method:`POST`,body:qt(t,n)}),getProjectDocs:()=>I(e,`/viewer/project-docs`),getProjectDoc:(t,n)=>I(e,`/viewer/project-docs/${encodeURIComponent(t)}`,{...n===void 0?{}:{query:Mn(n)}}),getViewerTree:t=>I(e,`/viewer/tree`,{...t===void 0?{}:{query:Mn(t)}}),getViewerFile:t=>I(e,`/viewer/files`,{query:Mn(t)}),viewerAssetUrl:t=>tn(en(e.baseUrl,`/viewer/assets`),Mn(t)),getReferenceFiles:t=>I(e,`/references/files`,{...t===void 0?{}:{query:Mn(t)}}),uploadReferenceFile:(t,n)=>I(e,`/references/files`,{method:`POST`,body:qt(t,n)}),refreshReferenceSummaries:(t={},n)=>I(e,`/references/summaries/refresh`,{method:`POST`,body:qt(t,n)}),getSkills:()=>I(e,`/skills`),getSkill:t=>I(e,`/skills/${encodeURIComponent(t)}`),importSkillZip:(t,n)=>I(e,`/skills/import`,{method:`POST`,body:qt(t,n)}),deleteSkill:(t,n)=>I(e,`/skills/delete`,{method:`POST`,body:qt(t,n)}),initializeProjectDocs:(t={},n)=>I(e,`/viewer/project-docs/init`,{method:`POST`,body:qt(t,n)}),contextSync:(t={},n)=>I(e,`/viewer/project-docs/context-sync`,{method:`POST`,body:qt(t,n)}),eventsUrl:e=>vn(t,e?.after),connectEvents:(e={})=>xn({...e,url:t})}}function Pn(e){return Nn(jn(e))}function Fn(e){let t={baseUrl:e.baseUrl,credentials:`include`,...e.fetch===void 0?{}:{fetch:e.fetch}},n=()=>{let t=e.contextToken?.();return t===void 0?{}:{"x-local-console-context":t}},r=()=>{let t=e.csrfToken?.();return{...n(),...t===void 0?{}:{"x-local-console-csrf":t}}};return{exchangeSession:e=>I(t,`/local-console/v1/session`,{method:`POST`,body:{access_token:e}}),getBootstrap:()=>I(t,`/local-console/v1/bootstrap`,{headers:n()}),heartbeat:()=>I(t,`/local-console/v1/heartbeat`,{headers:n()}),getProjects:()=>I(t,`/local-console/v1/projects`,{headers:n()}),getPackageUpdate:(e={})=>I(t,`/local-console/v1/package-update`,{headers:n(),...e.refresh===!0?{query:{refresh:`true`}}:{},...e.signal===void 0?{}:{signal:e.signal}}),startPackageUpdate:()=>I(t,`/local-console/v1/package-update`,{method:`POST`,headers:r()}),pickFolder:()=>I(t,`/local-console/v1/folders/pick`,{method:`POST`,headers:r(),body:{}}),discoverModels:e=>I(t,`/local-console/v1/providers/models`,{method:`POST`,headers:r(),body:e}),launchProject:e=>I(t,`/local-console/v1/projects/launch`,{method:`POST`,headers:r(),body:e}),openProject:e=>I(t,`/local-console/v1/projects/${encodeURIComponent(e)}/open`,{method:`POST`,headers:r(),body:{}}),refreshInvite:e=>I(t,`/local-console/v1/projects/${encodeURIComponent(e)}/invite`,{method:`POST`,headers:r(),body:{}}),stopProject:e=>I(t,`/local-console/v1/projects/${encodeURIComponent(e)}/stop`,{method:`POST`,headers:r(),body:{}})}}function In(e){return{baseUrl:e.relayBaseUrl,...e.fetch===void 0?{}:{fetch:e.fetch},...e.credentials===void 0?{}:{credentials:e.credentials},...e.headers===void 0?{}:{headers:e.headers}}}function Ln(e){return{email:e.email,...e.display_name===void 0||e.display_name.trim()===``?{}:{display_name:e.display_name}}}function Rn(e){let t=`${e.baseUrl.replace(/\/+$/u,``)}/api/v1/events`;return{getMe:()=>I(e,`/api/v1/me`),login:(t,n)=>I(e,`/api/v1/auth/login`,{method:`POST`,body:qt(Ln(t),n)}),startEmailLogin:(t,n)=>I(e,`/api/v1/auth/email/start`,{method:`POST`,body:qt({email:t.email},n)}),verifyEmailLogin:(t,n)=>I(e,`/api/v1/auth/email/verify`,{method:`POST`,body:qt(t,n)}),completeAccountProfile:(t,n)=>I(e,`/api/v1/me/profile`,{method:`POST`,body:qt(t,n)}),logout:t=>I(e,`/api/v1/auth/logout`,{method:`POST`,body:qt({},t)}),getJoinEntry:t=>I(e,`/join/${encodeURIComponent(t)}`,{query:{format:`json`}}),acceptJoin:(t,n)=>I(e,`/api/v1/join/${encodeURIComponent(t)}/accept`,{method:`POST`,body:qt({},n)}),getRecentProjects:t=>I(e,`/api/v1/projects/recent`,{...t===void 0?{}:{query:t}}),openProject:(t,n)=>I(e,`/api/v1/projects/${encodeURIComponent(t)}/open`,{method:`POST`,body:qt({},n)}),getProjectPresence:t=>I(e,`/api/v1/projects/${encodeURIComponent(t)}/presence`),issueArtifactPreviewSession:(t,n)=>I(e,`/api/v1/projects/${encodeURIComponent(t)}/artifacts/preview-session`,{method:`POST`,body:qt({},n)}),startUpload:(t,n)=>I(e,`/api/v1/projects/${encodeURIComponent(t.relay_project_ref)}/uploads/start`,{method:`POST`,body:qt(t,n)}),eventsUrl:e=>yn(t,e?.after),connectEvents:(e={})=>Sn({...e,url:t}),workspacePath:rn}}function zn(e){return Rn(In(e))}function Bn(e){return zn(e).getMe()}function Vn(e,t,n){return zn(e).startEmailLogin(t,n)}function Hn(e,t,n){return zn(e).verifyEmailLogin(t,n)}function Un(e,t,n){return zn(e).completeAccountProfile(t,n)}function Wn(e,t){return zn(e).logout(t)}function Gn(e,t){return zn(e).getJoinEntry(t)}function Kn(e,t,n){return zn(e).acceptJoin(t,n)}function qn(e,t){return zn(e).getRecentProjects(t)}function Jn(e,t,n){return zn(e).openProject(t,n)}function Yn(e,t){return zn(e).getProjectPresence(t)}var Xn=`en-US`;function Zn(e){if(e===void 0)return`Never`;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(Xn,{month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}):e}function Qn(e){if(e===void 0)return`Unknown`;let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleDateString(Xn,{month:`short`,day:`numeric`,year:`numeric`}):`Unknown`}function $n(e,t=new Date){let n=new Date(e);if(!Number.isFinite(n.getTime()))return e;if(n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()){let e=Math.max(0,Math.floor((t.getTime()-n.getTime())/6e4));return e<1?`now`:e<60?`${e}m`:`${Math.floor(e/60)}h`}return n.toLocaleString(Xn,{month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function er(e){return e.toString().padStart(2,`0`)}function tr(e){if(e===void 0)return`Never`;let t=new Date(e);return Number.isFinite(t.getTime())?`${t.getFullYear()}-${er(t.getMonth()+1)}-${er(t.getDate())} ${er(t.getHours())}:${er(t.getMinutes())}`:e}function nr(e){let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleTimeString(Xn,{hour:`2-digit`,minute:`2-digit`}):``}function rr(e){switch(e){case`online`:return`Host online`;case`offline`:return`Host offline`;case`unknown`:return`Host unknown`}}function ir(e){switch(e){case`online`:return`Online`;case`offline`:return`Offline`;case`unknown`:return`Unknown`}}function ar(e){let t=e.relay_project.host_status;return{relayProjectRef:e.relay_project.relay_project_ref,displayName:e.relay_project.display_name,hostStatus:t,hostStatusLabel:ir(t),membershipLabel:e.membership.label===`owner`?`Owner`:`Member`,lastOpenedLabel:Zn(e.last_opened_at),canOpen:t===`online`}}var or=[`green`,`blue`,`yellow`,`neutral`];function sr(e){if(typeof Intl<`u`&&`Segmenter`in Intl){let t=new Intl.Segmenter(void 0,{granularity:`grapheme`});return Array.from(t.segment(e),e=>e.segment)}return Array.from(e)}function cr(e,t){return sr(e).slice(0,t).join(``)}function lr(e){return e.trim().replace(/\s+/gu,` `)}function ur(e){return sr(e)[0]??``}function dr(e){let t=lr(e).split(` `).filter(Boolean),n=(t.length>=2?`${ur(t[0]??``)}${ur(t[t.length-1]??``)}`:cr(t[0]??e,2)).trim().toLocaleUpperCase(`en-US`);return n===``?`?`:n}function fr(e){return{kind:`initials`,initials:dr(mr(e)),color:`blue`}}function pr(e){return e.author.ref===void 0||!Vt(e.author.ref,Lt.relayAccount)?null:{kind:`image`,image_url:`/api/v1/accounts/${encodeURIComponent(e.author.ref)}/avatar`,initials:dr(mr(e)),color:`blue`}}function mr(e){return e.author.display_name??(e.author.kind===`human`?`Member`:`Tutti`)}function hr(e,t={}){if(e.author.kind===`agent`||e.author.kind===`system`)return{avatarKind:`tutti`,online:!1};if(e.author.avatar!==void 0)return{avatarKind:`member`,avatar:e.author.avatar,online:t[e.author.ref??``]?.online??!1};let n=e.author.ref===void 0?void 0:t[e.author.ref];return n===void 0?{avatarKind:`member`,avatar:pr(e)??fr(e),online:!1}:{avatarKind:`member`,avatar:n.avatar,online:n.online??!1}}function gr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function _r(e,t={}){let n={id:e.id,messageKind:e.message_kind,author:mr(e),body:e.body,createdAt:e.created_at,time:nr(e.created_at),...hr(e,t.authorProfiles)};if(e.refs?.workflow_ref!==void 0&&(n.workflowRef=e.refs.workflow_ref),e.refs?.reference_file!==void 0){let r=e.refs.reference_file;n.referenceFile={path:r.path,name:r.name,category:r.category,...r.media_type===void 0?{}:{mediaType:r.media_type},sizeBytes:r.size_bytes,...r.category===`image`&&r.blob_oid!==void 0&&t.referenceAssetUrl!==void 0?{imageUrl:t.referenceAssetUrl(r.path,`thumbnail`,r.blob_oid)}:{}}}if(e.clarification_card!==void 0&&(n.clarificationCard={threadId:e.clarification_card.thread_id,roundId:e.clarification_card.round_id,...e.clarification_card.title===void 0?{}:{title:e.clarification_card.title},summary:e.clarification_card.summary,status:e.clarification_card.status,isCurrentRound:e.clarification_card.is_current_round}),e.refs?.task_result!==void 0){let t=e.refs.task_result;n.taskResult={title:t.title,status:t.status,taskId:t.task_id,taskTitle:t.task_title,summary:t.summary,...t.module_name===void 0?{}:{moduleName:t.module_name},...t.latest_run_result_id===void 0?{}:{latestRunResultId:t.latest_run_result_id},...t.final_note===void 0?{}:{finalNote:t.final_note},...t.generated_files===void 0?{}:{generatedFiles:t.generated_files.map(e=>({path:e.path,name:e.name,meta:e.media_type===void 0?gr(e.size_bytes):`${e.media_type} · ${gr(e.size_bytes)}`,...e.group===void 0?{}:{group:e.group}}))},...t.error_code===void 0?{}:{errorCode:t.error_code}}}return n}function vr(e){return e.state===`none`?null:{threadId:e.thread.id,roundId:e.round.id,cardMessageId:e.round.card_message_id,title:e.round.request_payload.title??`Clarification`,summary:e.round.request_payload.summary,request:e.round.request_payload.request,ownerLabel:e.thread.owner.kind===`task`?`Task-bound clarification ${e.thread.owner.task_id}`:`Workflow clarification`,status:e.round.status}}function yr(e){let t=e.resolution.decided_by,n=t===void 0?``:` by ${t.display_name}`;return`${e.resolution.label}${n}`}function br(e){return e.resolution.outcome===`accepted`?{status:`resolved`,statusLabel:`resolved`}:{status:`expired`,statusLabel:e.resolution.outcome}}function xr(e){return e.reason??e.summary}function Sr(e){if(e===void 0||e.state===`none`)return null;let t=e.request;return e.state===`pending`?{approvalId:t.approval_id,title:t.title,summary:xr(t),requestedAt:t.requested_at,...t.command?.text===void 0?{}:{detailLabel:`Codex wants to run`,detail:t.command.text,detailCode:!0},status:`pending`,statusLabel:`needs approval`,decisions:t.decisions.map(e=>({decisionId:e.decision_id,label:e.label,tone:e.tone}))}:{approvalId:t.approval_id,title:t.title,summary:xr(t),requestedAt:t.requested_at,...t.command?.text===void 0?{}:{detailLabel:`Codex wants to run`,detail:t.command.text,detailCode:!0},...br(e),decisions:[],resolutionLabel:yr(e)}}function Cr(e){return e.state===`ready`?[e.topic,e.background_summary,...e.current_consensus,...e.open_questions,...e.task_changes].some(e=>e.trim().length>0):!1}function wr(e){let t=e.map(e=>e.trim()).filter(e=>e.length>0).join(`; `);return t.length===0?void 0:t}function Tr(e){return[{id:`scratchpad-confirmed`,label:`CONFIRMED`,rows:e.current_consensus.map(e=>({kind:`confirmed`,text:e}))},{id:`scratchpad-questions`,label:`OPEN QUESTIONS`,rows:e.open_questions.map(e=>({kind:`question`,text:e}))}].filter(e=>e.rows.length>0)}function Er(e){let t=wr(e.task_changes);return{key:`current:${e.updated_at??`unknown`}`,title:e.topic||`Current Scratchpad`,summary:e.background_summary||`No background summary`,submitAvailable:Cr(e),sections:Tr(e),...e.updated_at===void 0?{}:{updatedLabel:$n(e.updated_at)},...t===void 0?{}:{footerNote:{text:t,tone:`neutral`}}}}function Dr(e){return{key:`submitted:${e.submitted_by_workflow_ref??e.submitted_at??`current`}`,title:e.topic||`Current Scratchpad`,summary:e.background_summary||`No background summary`,submitAvailable:!1,sections:Tr(e),submitted:!0,updatedLabelPrefix:`Submitted`,...e.submitted_at===void 0?e.updated_at===void 0?{}:{updatedLabel:$n(e.updated_at)}:{updatedLabel:$n(e.submitted_at)}}}function Or(e){return{key:`receipt:${e.workflow_ref}`,title:e.topic||`Current Scratchpad`,summary:e.background_summary||`No background summary`,submitAvailable:!1,sections:Tr(e),submitted:!0,updatedLabelPrefix:`Submitted`,updatedLabel:$n(e.submitted_at),...e.compiled_tasks===void 0||e.compiled_tasks.length===0?{}:{compiledTasks:e.compiled_tasks.map(e=>({taskId:e.task_id,title:e.title,moduleName:e.module_name,status:e.status}))}}}function kr(e){return[...e].reverse().map(Or)}function Ar(e){let t=kr(e.receipts);return e.state===`ready`?[...t,Er(e)]:e.state===`submitted`&&t.length===0?[Dr(e)]:t}function jr(e){let t=e.refs?.scratchpad_source;return t===void 0?e.scope.kind===`main_chat`?e.message_kind===`user_text`&&e.author.kind===`human`?!0:e.message_kind===`agent_text`&&e.author.kind===`agent`?e.refs?.workflow_ref===void 0&&e.refs?.activity_ref===void 0:!1:!1:t===`include`}function Mr(e,t){let n=e.updated_at??(e.state===`submitted`?e.submitted_at:void 0);return t.some(e=>jr(e)?n===void 0||e.created_at>n:!1)}function Nr(e,t=[]){let n=Mr(e,t),r=Ar(e),i=n?r.map((e,t)=>t===r.length-1?{...e,submitAvailable:!0}:e):r;if(i.length>0){let e=i[i.length-1];if(e===void 0)throw Error(`Scratchpad pages unexpectedly empty`);return{title:e.title,summary:e.summary,submitAvailable:e.submitAvailable,sections:e.sections,...e.updatedLabel===void 0?{}:{updatedLabel:e.updatedLabel},...e.updatedLabelPrefix===void 0?{}:{updatedLabelPrefix:e.updatedLabelPrefix},...e.footerNote===void 0?{}:{footerNote:e.footerNote},pages:i}}if(e.state!==`ready`)return{title:`Current Scratchpad`,summary:`Scratchpad empty. Discuss more, tutti together!.`,sections:[],submitAvailable:n};let a=Er(e);return{...a,submitAvailable:a.submitAvailable||n}}function Pr(e,t){let n=e.modules.map(e=>({label:e.module.name,rows:e.tasks.map(e=>({id:e.id,title:e.title,status:e.status,selected:e.id===t}))})).filter(e=>e.rows.length>0);return{modules:n,taskCount:n.reduce((e,t)=>e+t.rows.length,0)}}function Fr(e){return e.modules.flatMap(e=>e.tasks)}function Ir(e){return e.replace(/\s+/gu,` `).trim()}function Lr(e,t=`None`){let n=Ir(e??``);return n.length===0?t:n}function Rr(e){let t=e.map(Ir).filter(e=>e.length>0);return t.length===0?`None`:t.join(`
10
- `)}function zr(e){return e.status===`promoted`?`promoted`:e.status===`not_promoted`?`not promoted`:`not attempted`}function Br(e){return e.result_kind===`needs_human`?`needs human`:e.result_kind===`failed`?`failed`:e.result_kind===`finished`?e.outcome??`finished`:`none`}function Vr(e){if(e.result_kind===`needs_human`)return`pending`;if(e.result_kind===`failed`)return`failed`;if(e.result_kind===`finished`)return e.outcome===`completed`?`done`:`failed`}function Hr(e){return e.result_kind===`needs_human`?`pending`:e.result_kind===`failed`?`failed`:e.outcome===`completed`?`done`:`failed`}function Ur(e){return e.result_kind===`needs_human`?`Needs human`:e.result_kind===`failed`?`Failed`:e.outcome===`completed`?`Finished`:`Finished with failure`}function Wr(e){return{id:e.id,title:Ur(e),meta:tr(e.created_at),status:Hr(e)}}function Gr(e,t){if(e===void 0)return;let n=e.detail.result,r=e.detail.contract,i=Vr(n),a=[i===void 0?{label:`STATUS`,value:Br(n)}:{label:`STATUS`,value:Br(n),status:i}];return n.updated_at!==void 0&&a.push({label:`UPDATED`,value:tr(n.updated_at)}),a.push({label:`RESULT`,value:Lr(n.summary,`No run result yet.`)}),n.checks!==void 0&&a.push({label:`CHECKS`,value:n.checks}),n.docs!==void 0&&a.push({label:`DOCS`,value:n.docs}),n.promotion!==void 0&&a.push({label:`PROMOTE`,value:zr(n.promotion)}),n.error_code!==void 0&&a.push({label:`ERROR`,value:n.error_code}),n.retryable!==void 0&&a.push({label:`RETRY`,value:n.retryable?`can retry`:`needs new scope`}),{taskId:e.task.id,title:e.task.title,status:e.task.status,summary:Lr(e.task.summary),contractRows:[{label:`GOAL`,value:r.goal||`None`},{label:`SCOPE`,value:Rr(r.scope)}],resultRows:a,evidenceRows:a,runResults:(t?.items??[]).map(Wr)}}var Kr=new Intl.DateTimeFormat(Xn,{year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});function qr(e){let t=new Date(e);return Number.isFinite(t.getTime())?Kr.format(t):e}function Jr(e,t,n){let r=[{label:`status`,value:n.status}];n.status!==`not_configured`&&r.push({label:`default_model`,value:n.default_model??`not available`},{label:`redacted_key`,value:n.redacted_key??`not available`,code:!0},{label:`validated_at`,value:n.validated_at===void 0?`not validated`:qr(n.validated_at)}),n.status===`invalid`&&n.invalid_reason_code!==void 0&&r.push({label:`invalid_reason_code`,value:n.invalid_reason_code});let i=e.relay.join_url;return{statuses:[{label:e.relay.status,tone:e.relay.status===`connected`?`live`:`warning`}],invite:{...i===void 0?{}:{joinUrl:i}},project:{displayName:e.project.display_name,description:e.project.description??``},currentMember:{displayName:t.account.display_name,avatar:t.account.avatar},sections:[{id:`settings-member`,title:`Member`,rows:[{label:`current member`,value:t.account.display_name,identity:!0},{label:`membership.label`,value:t.membership.label},{label:`joined_at`,value:qr(t.membership.joined_at)}]},{id:`settings-provider`,title:`Provider`,rows:r}]}}var Yr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Zr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Qr=e=>{let t=Zr(e);return t.charAt(0).toUpperCase()+t.slice(1)},$r={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`},ei=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ti=(0,N.createContext)({}),ni=()=>(0,N.useContext)(ti),ri=(0,N.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=``}=ni()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,N.createElement)(`svg`,{ref:c,...$r,width:t??l??$r.width,height:t??l??$r.height,stroke:e??f,strokeWidth:m,className:Yr(`lucide`,p,i),...!a&&!ei(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,N.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,N.forwardRef)(({className:n,...r},i)=>(0,N.createElement)(ri,{ref:i,iconNode:t,className:Yr(`lucide-${Xr(Qr(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Qr(e),n},ii=L(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ai=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),oi=L(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),si=L(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),ci=L(`chart-column-big`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`rect`,{x:`15`,y:`5`,width:`4`,height:`12`,rx:`1`,key:`q8uenq`}],[`rect`,{x:`7`,y:`8`,width:`4`,height:`9`,rx:`1`,key:`sr5ea`}]]),li=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ui=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),di=L(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),fi=L(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),pi=L(`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`}]]),mi=L(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),hi=L(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),gi=L(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),_i=L(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),vi=L(`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`}]]),yi=L(`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`}]]),bi=L(`file-check`,[[`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:`m9 15 2 2 4-4`,key:`1grp1n`}]]),xi=L(`file-lock`,[[`path`,{d:`M4 9.8V4a2 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 8v12a2 2 0 0 1-2 2h-3`,key:`1432pc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 17v-2a2 2 0 0 0-4 0v2`,key:`168m41`}],[`rect`,{width:`8`,height:`5`,x:`3`,y:`17`,rx:`1`,key:`o8vfew`}]]),Si=L(`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`}]]),Ci=L(`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`}]]),wi=L(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ti=L(`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`}]]),Ei=L(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Di=L(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Oi=L(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),ki=L(`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`}]]),Ai=L(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),ji=L(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Mi=L(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ni=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Pi=L(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`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`}]]),Fi=L(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),Ii=L(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Li=L(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]),Ri=L(`notepad-text`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`16`,height:`18`,x:`4`,y:`4`,rx:`2`,key:`1u9h20`}],[`path`,{d:`M8 10h6`,key:`3oa6kw`}],[`path`,{d:`M8 14h8`,key:`1fgep2`}],[`path`,{d:`M8 18h5`,key:`17enja`}]]),zi=L(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`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`}]]),Bi=L(`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`}]]),Vi=L(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Hi=L(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),Ui=L(`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`}]]),Wi=L(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Gi=L(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ki=L(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),qi=L(`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`}]]),Ji=L(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Yi=L(`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`}]]),Xi=L(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Zi=L(`square-dashed`,[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]]),Qi=L(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),$i=L(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),ea=L(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ta=L(`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`}]]),na=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ra=L(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),ia=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function R(...e){return e.filter(e=>typeof e==`string`&&e!==``).join(` `)}function aa({icon:e,watermark:t,tone:n=`neutral`,children:r,className:i,...a}){return(0,P.jsxs)(`div`,{className:R(`empty-state`,t===void 0?void 0:`has-watermark`,`is-${n}`,i),...a,children:[t===void 0?null:(0,P.jsx)(`span`,{className:`empty-state-watermark`,"aria-hidden":`true`,children:t}),e===void 0?null:(0,P.jsx)(`span`,{className:`empty-state-icon`,children:e}),(0,P.jsx)(`p`,{children:r})]})}function oa({count:e=3,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`loading-lines`,t),"aria-label":`Loading`,...n,children:Array.from({length:e}).map((e,t)=>(0,P.jsx)(`span`,{},t))})}function sa({tone:e}){switch(e){case`loading`:return(0,P.jsx)(Mi,{className:`is-spinning`,"aria-hidden":`true`});case`success`:return(0,P.jsx)(fi,{"aria-hidden":`true`});case`error`:return(0,P.jsx)(mi,{"aria-hidden":`true`});case`warning`:return(0,P.jsx)(na,{"aria-hidden":`true`});case`info`:return(0,P.jsx)(Di,{"aria-hidden":`true`})}}function ca(e){return e===`error`||e===`warning`?`alert`:`status`}function la(e,t){return e===void 0?t:{...t,"--notice-duration-ms":`${e}ms`}}function ua({tone:e,title:t,message:n,durationMs:r,persistent:i=e===`loading`,dismissible:a=e!==`loading`,dismissLabel:o=`Dismiss notification`,onDismiss:s,className:c,role:l,"aria-live":u,style:d,...f}){let p=a&&s!==void 0;return(0,P.jsxs)(`article`,{className:R(`notice-toast`,`is-${e}`,i?`is-persistent`:void 0,c),role:l??ca(e),"aria-live":u??(e===`error`||e===`warning`?`assertive`:`polite`),style:la(r,d),...f,children:[(0,P.jsx)(`span`,{className:`notice-toast-icon`,children:(0,P.jsx)(sa,{tone:e})}),(0,P.jsxs)(`span`,{className:`notice-toast-main`,children:[(0,P.jsx)(`strong`,{children:t}),n===void 0?null:(0,P.jsx)(`span`,{children:n})]}),p?(0,P.jsx)(`button`,{className:`notice-toast-close`,type:`button`,"aria-label":o,onClick:s,children:(0,P.jsx)(ia,{"aria-hidden":`true`})}):null]})}function da({notices:e,onDismiss:t,className:n,...r}){return(0,P.jsx)(`div`,{className:R(`notice-stack`,n),"aria-label":`Notifications`,...r,children:e.map(e=>(0,P.jsx)(ua,{tone:e.tone,title:e.title,...e.message===void 0?{}:{message:e.message},...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.persistent===void 0?{}:{persistent:e.persistent},...e.dismissible===void 0?{}:{dismissible:e.dismissible},...t===void 0?{}:{onDismiss:()=>t(e.id)}},e.id))})}function fa(e,t,n){return Math.min(Math.max(e,t),n)}function pa({pageCount:e,currentPage:t,maxVisible:n=7,onPageChange:r,pageAriaLabel:i,className:a,style:o,...s}){let c=Number.isFinite(e)?Math.max(0,Math.floor(e)):0;if(c===0)return null;let l=Math.min(c,Number.isFinite(n)?Math.max(1,Math.floor(n)):1),u=Number.isFinite(t)?fa(Math.floor(t),0,c-1):0,d=fa(u-Math.floor(l/2),0,c-l),f=u>0&&r!==void 0,p=u<c-1&&r!==void 0,m={...o,"--dot-pager-visible-count":l,"--dot-pager-window-start":d};return(0,P.jsxs)(`nav`,{className:R(`dot-pager`,a),style:m,...s,children:[(0,P.jsx)(`button`,{className:`dot-pager-arrow`,type:`button`,"aria-label":`Previous page`,disabled:!f,onClick:()=>r?.(u-1),children:(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`<`})}),(0,P.jsx)(`div`,{className:`dot-pager-viewport`,children:(0,P.jsx)(`div`,{className:`dot-pager-track`,children:Array.from({length:c},(e,t)=>{let n=t===u,a=t>=d&&t<d+l,o=i?.(t)??`Page ${t+1}`;return(0,P.jsx)(`button`,{className:R(`dot-pager-page`,n&&`is-current`),type:`button`,"aria-label":o,"aria-current":n?`page`:void 0,"aria-hidden":a?void 0:!0,disabled:r===void 0,tabIndex:a?0:-1,onClick:()=>r?.(t),children:(0,P.jsx)(`span`,{"aria-hidden":`true`})},t)})})}),(0,P.jsx)(`button`,{className:`dot-pager-arrow`,type:`button`,"aria-label":`Next page`,disabled:!p,onClick:()=>r?.(u+1),children:(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`>`})})]})}function ma({kicker:e,title:t,icon:n,action:r,children:i,className:a,...o}){return(0,P.jsxs)(`article`,{className:R(`panel`,a),...o,children:[(0,P.jsxs)(`header`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[n===void 0?null:(0,P.jsx)(ha,{icon:n}),(0,P.jsxs)(`div`,{children:[e===void 0?null:(0,P.jsx)(`p`,{className:`field-label`,children:e}),(0,P.jsx)(`h3`,{children:t})]})]}),r===void 0?null:(0,P.jsx)(`div`,{className:`panel-actions`,children:r})]}),i]})}function ha({icon:e,className:t,...n}){return(0,P.jsx)(`span`,{className:R(`icon-tile`,t),...n,children:e})}var ga=`modulepreload`,_a=function(e){return`/`+e},va={},ya=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_a(t,n),t in va)return;va[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ga,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ba,xa;function z(){if(ba===void 0)throw Error(`VexFlow has not been loaded`);return ba}function Sa(){return ba===void 0?(xa??=ya(()=>import(`./vexflow-bravura-DEW_BI-z.js`).then(async e=>(typeof document<`u`&&document.fonts!==void 0&&await Promise.allSettled([document.fonts.load(`30pt Bravura`),document.fonts.load(`30pt Academico`),document.fonts.load(`bold 30pt Academico`)]),e.VexFlow.setFonts(`Bravura`,`Academico`),ba=e,e)),[]).catch(e=>{throw xa=void 0,e}),xa):Promise.resolve(ba)}var Ca=12,wa=42,Ta=10,Ea=8,Da=30,Oa=18,ka=[`c`,`d`,`e`,`f`,`g`,`a`,`b`],Aa=30,ja={whole:`w`,half:`h`,quarter:`q`,eighth:`8`,sixteenth:`16`,"thirty-second":`32`},Ma={"double-flat":`bb`,flat:`b`,natural:`n`,sharp:`#`,"double-sharp":`##`},Na={[-2]:`bb`,[-1]:`b`,0:``,1:`#`,2:`##`},Pa={staccato:`a.`,tenuto:`a-`,accent:`a>`,marcato:`a^`,fermata:`a@a`},Fa=[`Cb`,`Gb`,`Db`,`Ab`,`Eb`,`Bb`,`F`,`C`,`G`,`D`,`A`,`E`,`B`,`F#`,`C#`];function Ia(e){return Math.max(-7,Math.min(7,Math.trunc(e??0)))}function La(e){return Fa[Ia(e)+7]??`C`}function Ra(e){return(e.openingBarline===void 0?0:Ca)+(e.openingClef===void 0?0:wa)+(e.keySignatureFifths===void 0?0:Ta+Math.abs(Ia(e.keySignatureFifths))*Ea)+(e.timeSignature===void 0?0:Da)}function za({units:e,edgePadding:t=20,horizontalSpacingScale:n=1,unitSpacing:r=52,openingClef:i,openingBarline:a,keySignatureFifths:o,timeSignature:s}){let c=Number.isFinite(n)&&n>0?n:1,l=e.reduce((e,t)=>e+(t.width??r)*c,0),u=Ra({openingClef:i,openingBarline:a,keySignatureFifths:o,timeSignature:s});return Math.max(t*2+u+r*c,t*2+u+l)}function Ba(e,t){return(e%t+t)%t}function Va(e){let t=Aa+Math.trunc(e.staffStep),n=ka[Ba(t,ka.length)]??`c`,r=Math.floor(t/ka.length);return`${n}${Na[e.alteration??0]}/${r}`}function Ha(e){if(e===`up`)return z().Stem.UP;if(e===`down`)return z().Stem.DOWN}function Ua(e,t){for(let n=0;n<(t??0);n+=1)z().Dot.buildAndAttach([e],{all:!0})}function Wa(e,t){e.addClass(`score-unit-mark`),e.setGroupStyle({fillStyle:`currentColor`,strokeStyle:`currentColor`}),e.setAttribute(`id`,`score-${t.replace(/[^a-zA-Z0-9_-]/gu,`-`)}-${e.getAttribute(`id`)}`)}function Ga(e,t){let n=Ha(e.stemDirection),r=new(z()).StaveNote({keys:e.pitches.map(Va),duration:ja[e.duration],dots:e.dots??0,autoStem:e.stemDirection===void 0||e.stemDirection===`auto`,clef:t,...n===void 0?{}:{stemDirection:n}});return Ua(r,e.dots),e.pitches.forEach((e,t)=>{e.displayAccidental!==void 0&&r.addModifier(new(z()).Accidental(Ma[e.displayAccidental]),t)}),e.articulations?.forEach(e=>{r.addModifier(new(z()).Articulation(Pa[e]).setPosition(z().Modifier.Position.ABOVE),0)}),r}function Ka(e,t){let n=new(z()).GraceNote({keys:e.pitches.map(Va),duration:ja[e.duration],dots:e.dots??0,clef:t,slash:!0});return Ua(n,e.dots),e.pitches.forEach((e,t)=>{e.displayAccidental!==void 0&&n.addModifier(new(z()).Accidental(Ma[e.displayAccidental]),t)}),n}function qa(e){return e===`double`?z().Barline.type.DOUBLE:e===`final`?z().Barline.type.END:e===`repeat-start`?z().Barline.type.REPEAT_BEGIN:e===`repeat-end`?z().Barline.type.REPEAT_END:z().Barline.type.SINGLE}function Ja(e,t){if(e.kind===`rest`){let n=new(z()).StaveNote({keys:[t===`bass`?`d/3`:`b/4`],duration:ja[e.duration],dots:e.dots??0,type:`r`,clef:t});return Ua(n,e.dots),n}return e.kind===`clef`?new(z()).ClefNote(e.clef,`small`):e.kind===`key-signature`?new(z()).KeySigNote(La(e.fifths)):e.kind===`time-signature`?new(z()).TimeSigNote(e.symbol===`common`?`C`:e.symbol===`cut`?`C|`:`${e.beats??4}/${e.beatType??4}`):e.kind===`dynamic`?new(z()).TextDynamics({duration:`q`,text:e.value,line:9}).setLine(9):e.kind===`text`?new(z()).TextNote({duration:`q`,text:e.text}).setLine(e.placement===`below`?9:-1):new(z()).GhostNote(`q`)}function Ya(e,t){let n=t;return e.map((e,t)=>{let r=[],i=[],a=[],o=[];if(e.symbols.forEach(e=>{if(e.kind===`note`&&e.grace===!0){let t=Ka(e,n);o.push(t),a.push(t);return}let t=e.kind===`note`?Ga(e,n):Ja(e,n);o.length>0&&t instanceof z().StaveNote&&(t.addModifier(new(z()).GraceNoteGroup(o,!1),0),o.length=0),r.push(t),a.push(t),t instanceof z().StaveNote&&!t.isRest()&&i.push(t),e.kind===`clef`&&(n=e.clef)}),r.length===0){let e=new(z()).GhostNote(`q`);r.push(e),a.push(e)}let s=[...r];if(e.barAfter!==void 0){let t=new(z()).BarNote(qa(e.barAfter));r.push(t),a.push(t)}return a.forEach(t=>Wa(t,e.id)),{unit:e,index:t,tickables:r,contentTickables:s,notes:i,elements:a}})}function Xa(e){return e===`double`?z().Barline.type.DOUBLE:e===`single`?z().Barline.type.SINGLE:z().Barline.type.NONE}function Za(e){return e===`final`?z().Barline.type.END:e===`bar`?z().Barline.type.SINGLE:z().Barline.type.NONE}function Qa(e){return e.notes[0]}function $a(e){let t=[],n=e.flatMap(e=>e.notes);return e.forEach(r=>{if(r.unit.beam===!0&&r.notes.length>1){let e=new(z()).Beam(r.notes,!0);Wa(e,r.unit.id),r.elements.push(e),t.push(e)}if(r.unit.tuplet!==void 0&&r.notes.length>1){let e=new(z()).Tuplet(r.notes,{numNotes:r.unit.tuplet,notesOccupied:2});Wa(e,r.unit.id),r.elements.push(e),t.push(e)}if(r.unit.slur===!0&&r.notes.length>1){let e=new(z()).Curve(r.notes[0],r.notes.at(-1),{position:z().Curve.Position.NEAR_TOP,positionEnd:z().Curve.Position.NEAR_TOP,openingDirection:`up`});Wa(e,r.unit.id),r.elements.push(e),t.push(e)}r.unit.symbols.forEach((e,i)=>{if(e.kind!==`note`||e.tieToNext!==!0)return;let a=r.unit.symbols.slice(0,i).filter(e=>e.kind===`note`&&e.grace!==!0).length,o=r.notes[a],s=o===void 0?-1:n.indexOf(o),c=s<0?void 0:n[s+1];if(o===void 0)return;let l=e.pitches.map((e,t)=>t),u=new(z()).StaveTie({firstNote:o,lastNote:c??null,firstIndexes:l,lastIndexes:l});Wa(u,r.unit.id),r.elements.push(u),t.push(u)}),r.unit.symbols.forEach(n=>{if(n.kind!==`hairpin`)return;let i=e.indexOf(r),a=Qa(e[Math.max(0,i-1)]??r),o=Qa(e[Math.min(e.length-1,i+1)]??r);if(a===void 0||o===void 0)return;let s=new(z()).StaveHairpin({firstNote:a,lastNote:o},n.direction===`crescendo`?z().StaveHairpin.type.CRESC:z().StaveHairpin.type.DECRESC).setPosition(z().Modifier.Position.BELOW).setRenderOptions({leftShiftPx:2,rightShiftPx:2,height:8,yShift:2});Wa(s,r.unit.id),r.elements.push(s),t.push(s)})}),t}function eo(e){return e.getSVGElement()}function to(e){e.forEach(e=>{e.elements.forEach(t=>{let n=eo(t);n!==void 0&&(n.classList.add(`score-unit-mark`),n.dataset.scoreUnitId=e.unit.id,n.dataset.scoreUnitIndex=String(e.index),n.style.setProperty(`--score-unit-index`,String(e.index)))})})}function no(e,t,n,r){let i=Math.max(r,t.getNoteStartX()-8),a=n-r,o=e.map(e=>{let t=e.tickables[0];return t===void 0?i:t.getAbsoluteX()});return e.map((e,t)=>{let n=o[t-1],r=o[t]??i,s=o[t+1],c=t===0?i:((n??r)+r)/2,l=s===void 0?a:(r+s)/2;return{unit:e,start:c,end:Math.max(c+12,l)}})}function ro(e,t,n,r,i,a,o){let s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);s.classList.add(`score-unit-hitboxes`),no(t,n,r,i).forEach(({unit:e,start:t,end:n})=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);r.classList.add(`score-unit-hitbox`),r.dataset.scoreUnitHitbox=``,r.dataset.scoreUnitId=e.unit.id,r.setAttribute(`x`,String(t)),r.setAttribute(`y`,`4`),r.setAttribute(`width`,String(n-t)),r.setAttribute(`height`,`104`),r.setAttribute(`rx`,`4`),a?(r.setAttribute(`role`,`button`),r.setAttribute(`tabindex`,`0`),r.setAttribute(`aria-label`,o?.(e.unit,e.index)??e.unit.label??`Score item ${e.index+1}`)):r.setAttribute(`aria-hidden`,`true`),s.append(r)}),e.append(s)}function io(e,t){e.querySelectorAll(`[data-score-unit-id]`).forEach(e=>{let n=t!==void 0&&e.dataset.scoreUnitId===t;e.classList.toggle(`is-current`,n),e.classList.toggle(`is-muted`,t!==void 0&&!n),e.matches(`[data-score-unit-hitbox]`)&&(n?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`))})}async function ao(e,t){if(await Sa(),t.signal?.aborted===!0)return t.width;e.replaceChildren();let n=new(z()).Renderer(e,z().Renderer.Backends.SVG);n.resize(t.width,112);let r=n.getContext(),i=e.querySelector(`svg`);if(i===null)return t.width;i.classList.add(`score-staff-svg`);let a=new(z()).Stave(t.edgePadding,0,t.width-t.edgePadding*2).setBegBarType(Xa(t.openingBarline)).setEndBarType(Za(t.ending));t.openingClef!==void 0&&a.addClef(t.openingClef),t.keySignatureFifths!==void 0&&a.addKeySignature(La(t.keySignatureFifths)),t.timeSignature!==void 0&&a.addTimeSignature(`${t.timeSignature[0]}/${t.timeSignature[1]}`),a.setStyle({strokeStyle:`var(--color-score-line)`,fillStyle:`currentColor`}),a.setDefaultLedgerLineStyle({strokeStyle:`currentColor`,lineWidth:2});let o=Ya(t.units,t.openingClef??`treble`),s=o.flatMap(e=>e.tickables),c=new(z()).Voice({numBeats:4,beatValue:4}).setMode(z().Voice.Mode.SOFT).addTickables(s).setStave(a);c.preFormat();let l=$a(o),u=o.flatMap(e=>e.contentTickables),d=u[0],f=u.at(-1),p=new(z()).Formatter().joinVoices([c]),m=Math.max(24,t.intrinsicWidth-a.getNoteStartX()-t.edgePadding),h=Math.max(m,p.preCalculateMinTotalWidth([c])),g=Math.max(t.width,Math.ceil(a.getNoteStartX()+h+t.edgePadding));g!==t.width&&(n.resize(g,112),a.setWidth(g-t.edgePadding*2)),p.format([c],h,{context:r,stave:a});let _=f?.getBoundingBox(),v=_===void 0?a.getNoteStartX():_.getX()+_.getW(),y=t.intrinsicWidth-t.edgePadding,b=d?.getBoundingBox();if(t.trimTrailingSpace&&b!==void 0&&v>b.getX()&&v+1<y){let e=b.getX(),t=(y-e)/(v-e);s.forEach(n=>{let r=n.getAbsoluteX();n.setXShift(n.getXShift()+(r-e)*(t-1))}),v=y}a.setContext(r).drawWithStyle(),c.draw(r,a),l.forEach(e=>e.setContext(r).draw());let x=Math.ceil(Math.max(a.getNoteStartX()+24,v)+Oa+t.edgePadding),S=t.trimTrailingSpace&&t.ending===`none`?Math.min(g,x):g;return n.resize(S,112),i.style.width=`100%`,i.style.height=`100%`,i.setAttribute(`viewBox`,`0 0 ${S} 112`),i.setAttribute(`preserveAspectRatio`,`xMinYMid meet`),to(o),ro(i,o,a,S,t.edgePadding,t.interactive,t.unitAriaLabel),S}function oo(e,t=20,n=52,r,i,a,o,s=1){return za({units:e,edgePadding:t,horizontalSpacingScale:s,unitSpacing:n,openingClef:r,openingBarline:i,keySignatureFifths:a,timeSignature:o})}function so(e){if(e instanceof Element)return e.closest(`[data-score-unit-hitbox]`)?.dataset.scoreUnitId}function co({units:e,activeUnitId:t,ending:n=`none`,edgePadding:r=20,horizontalSpacingScale:i=1,keySignatureFifths:a,minimumWidth:o=0,openingBarline:s,openingClef:c,reveal:l=!1,scale:u=1,trimTrailingSpace:d=!1,timeSignature:f,unitSpacing:p=52,onLayoutWidthChange:m,onUnitSelect:h,unitAriaLabel:g,className:_,style:v,onClick:y,onKeyDown:b,...x}){let S=(0,N.useRef)(null),C=(0,N.useRef)(t),w=(0,N.useRef)(m);C.current=t,w.current=m;let T=Number.isFinite(u)&&u>0?u:1,E=Number.isFinite(i)&&i>0?i:1,ee=oo(e,r,p,c,s,a,f,E),D=Math.max(ee,o/T),[O,k]=(0,N.useState)(D),te=O*T,ne=112*T,A=h!==void 0;return(0,N.useEffect)(()=>{let t=S.current;if(t===null)return;let i=new AbortController;return k(D),ao(t,{units:e,ending:n,edgePadding:r,intrinsicWidth:ee,width:D,trimTrailingSpace:d,openingBarline:s,openingClef:c,keySignatureFifths:a,timeSignature:f,interactive:A,unitAriaLabel:g,signal:i.signal}).then(e=>{i.signal.aborted||(k(e),w.current?.(e),io(t,C.current))}),()=>{i.abort(),t.replaceChildren()}},[r,n,A,ee,a,s,c,f,d,g,e,D]),(0,N.useEffect)(()=>{let e=S.current;e!==null&&io(e,t)},[t,e]),(0,P.jsx)(`div`,{className:R(`score-staff`,l&&`is-revealing`,_),"data-score-width":O,"data-score-scale":T,"data-score-horizontal-spacing-scale":E,onClick:e=>{if(y?.(e),e.defaultPrevented||h===void 0)return;let t=so(e.target);t!==void 0&&h(t)},onKeyDown:e=>{if(b?.(e),e.defaultPrevented||h===void 0||e.key!==`Enter`&&e.key!==` `)return;let t=so(e.target);t!==void 0&&(e.preventDefault(),h(t))},style:{width:te,height:ne,...v},...x,children:(0,P.jsx)(`div`,{className:`score-staff-engraving`,ref:S})})}var lo={andante:34,moderato:40,allegro:46},uo=82/112,fo=68/112,po=1/uo,B=1/fo,mo=320,ho=420,go=240,_o=640;function vo(e,t,n){return Math.min(n,Math.max(t,e))}function yo(e,t){return e===void 0||!Number.isFinite(e)||e<=0?lo[t]:vo(18+e*.3,30,60)}function bo(e,t,n,r,i,a){if(e.length===0)return 1;let o=e=>oo(e,0,void 0,n,r,i,a,po),s=o(e),c=o([...e,...e])-s;if(c<=0)return 1;let l=240*t/uo;return Math.max(1,1+Math.ceil((l-s)/c))}function xo(e,t){return Array.from({length:t},(t,n)=>e.map((t,r)=>{let{barAfter:i,...a}=t,o=r===e.length-1&&(i===`final`||i===`repeat-end`)?`single`:i;return{...a,id:`${t.id}:running-${n+1}`,...o===void 0?{}:{barAfter:o}}})).flat()}function So({units:e,state:t=`running`,tempo:n=`moderato`,playbackBpm:r,openingBarline:i=`double`,openingClef:a=`treble`,keySignatureFifths:o,timeSignature:s,label:c,className:l,style:u,...d}){let f=yo(r,n),p=(0,N.useMemo)(()=>bo(e,f,a,i,o,s),[o,i,a,f,s,e]),m=(0,N.useMemo)(()=>xo(e,p),[p,e]),h=oo(m,0,void 0,a,i,o,s,po)*uo,[g,_]=(0,N.useState)(h),v=Math.max(240,g/f),y=(0,N.useCallback)(e=>_(e*uo),[]);(0,N.useEffect)(()=>_(h),[h]);let b=e.slice(-Math.min(8,e.length)),x=e.length===0?mo:ho+go+_o,S={...u,"--score-loop-duration":`${v}s`,"--score-scroll-delay":`${x}ms`,"--score-note-reveal-delay":`${ho}ms`};return(0,P.jsx)(`div`,{className:R(`running-score`,`is-${t}`,`is-${n}`,l),role:`img`,"aria-label":c,"data-score-loop-repetitions":p,"data-score-loop-units":m.length,style:S,...d,children:t===`complete`?(0,P.jsx)(`div`,{className:`running-score-coda`,children:(0,P.jsx)(co,{units:b,edgePadding:0,ending:`final`,openingBarline:i,openingClef:a,horizontalSpacingScale:po,...o===void 0?{}:{keySignatureFifths:o},...s===void 0?{}:{timeSignature:s},scale:uo,trimTrailingSpace:!0,"aria-hidden":`true`})}):(0,P.jsxs)(`div`,{className:`running-score-track`,"aria-hidden":`true`,children:[(0,P.jsx)(co,{units:m,edgePadding:0,ending:`final`,openingBarline:i,openingClef:a,horizontalSpacingScale:po,...o===void 0?{}:{keySignatureFifths:o},...s===void 0?{}:{timeSignature:s},scale:uo,trimTrailingSpace:!0,onLayoutWidthChange:y,reveal:!0}),(0,P.jsx)(co,{units:m,edgePadding:0,ending:`final`,openingBarline:i,openingClef:a,horizontalSpacingScale:po,...o===void 0?{}:{keySignatureFifths:o},...s===void 0?{}:{timeSignature:s},scale:uo,trimTrailingSpace:!0,onLayoutWidthChange:y,reveal:!0})]})})}function Co({title:e=`Execution progress`,stageLabel:t,stageDetail:n,elapsedLabel:r,metrics:i,scoreLabel:a,units:o,state:s=`running`,tempo:c=`moderato`,playbackBpm:l,openingBarline:u=`double`,openingClef:d=`treble`,keySignatureFifths:f,timeSignature:p,showLoader:m=s===`running`||s===`handoff`,className:h,...g}){let _=s===`paused`,v=m||_;return(0,P.jsx)(ma,{title:e,icon:(0,P.jsx)(ra,{"aria-hidden":`true`}),className:R(`execution-progress-panel`,`execution-score-card`,`is-score-${s}`,h),...g,children:(0,P.jsxs)(`div`,{className:`execution-progress-body`,children:[(0,P.jsxs)(`div`,{className:R(`execution-progress-step`,`execution-score-stage`,`is-${s}`,m&&`has-loader`,v&&`has-marker`),children:[v?(0,P.jsx)(`span`,{className:R(`execution-progress-marker`,_?`is-pending`:`is-running`),"aria-hidden":`true`,children:_?(0,P.jsx)(na,{}):(0,P.jsx)(Mi,{})}):null,(0,P.jsxs)(`span`,{className:`execution-progress-step-content`,children:[(0,P.jsxs)(`span`,{className:`execution-progress-step-title`,children:[(0,P.jsx)(`span`,{className:`execution-progress-step-label`,children:t}),r===void 0?null:(0,P.jsxs)(`span`,{className:`execution-progress-step-elapsed`,children:[` (`,r,`)`]})]}),n===void 0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-detail`,children:n}),i===void 0||i.length===0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-metrics`,children:i.map(e=>(0,P.jsx)(`span`,{className:`execution-progress-step-metric`,children:e},e))})]})]}),(0,P.jsx)(So,{units:o,state:s,tempo:c,...l===void 0?{}:{playbackBpm:l},openingBarline:u,openingClef:d,...f===void 0?{}:{keySignatureFifths:f},...p===void 0?{}:{timeSignature:p},label:a,className:`execution-score-staff`})]})})}var wo={schemaVersion:3,id:`auld-lang-syne`,shortName:`Auld Lang Syne`,composer:`Traditional`,work:`Auld Lang Syne`,movement:`Traditional melody`,tempo:88,meter:[2,4],clef:`treble`,keySignatureFifths:3,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1121`,url:`https://www.mutopiaproject.org/ftp/HoretzkyF/horetzky31/horetzky31.mid`,format:`MIDI`,downloadSha256:`7451d7be42ee52f15ba8b8c9651bcb8fdd2a759531c6297b875e9a65581afb19`,retrievedOn:`2026-07-31`,sourceFile:`horetzky31.mid`,part:`upper guitar melody (track 1)`,selection:`beats 0–128`,transposeSemitones:-5},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`A5`}],duration:`eighth`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`,dots:1}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`,dots:1}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`A5`}],duration:`eighth`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`,dots:1}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]}]},To={schemaVersion:3,id:`bach-air`,shortName:`Bach Air`,composer:`Johann Sebastian Bach`,work:`Orchestral Suite No. 3 in D major, BWV 1068`,movement:`II. Air`,tempo:56,meter:[4,4],clef:`treble`,keySignatureFifths:3,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1534`,url:`https://www.mutopiaproject.org/ftp/BachJS/BWV1068/bach_air_bmv_1068/bach_air_bmv_1068.mid`,format:`MIDI`,downloadSha256:`5f7763dd4d29f309cac6d670c22aa029aca23c8c97743a0511d4b9c6d3435f1c`,retrievedOn:`2026-07-31`,sourceFile:`bach_air_bmv_1068.mid`,part:`flute melody (flute)`,selection:`beats 0–128`,transposeSemitones:-5},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`whole`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`half`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:3,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A#4`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0},{measure:4,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0},{measure:4,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`,dots:1}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`F4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`,dots:1}],beam:!0},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0},{measure:10,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`,displayAccidental:`sharp`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:14,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`,dots:1}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:16,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G5`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}]}]},Eo={schemaVersion:3,id:`beethoven-7-allegretto`,shortName:`Beethoven No. 7`,composer:`Ludwig van Beethoven`,work:`Symphony No. 7 in A major, Op. 92`,movement:`II. Allegretto`,tempo:76,meter:[2,4],clef:`treble`,keySignatureFifths:-1,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=595`,url:`https://www.mutopiaproject.org/ftp/BeethovenLv/O92/Symphony7_2/Symphony7_2.mid`,format:`MIDI`,downloadSha256:`7cf810b4625b9a272d3a0a9153d8beb5750fa3ee64122dc9f27b7661e997b903`,retrievedOn:`2026-07-31`,sourceFile:`Symphony7_2.mid`,part:`upper wind / track six (six)`,selection:`beats 128–384`,transposeSemitones:-7},units:[{measure:65,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:75,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:75,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:76,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:76,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:77,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:77,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:78,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:78,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:79,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:79,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:80,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}],barAfter:`single`},{measure:81,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:82,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:82,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:83,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:83,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:85,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:85,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:86,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:86,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:87,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:87,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:88,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:88,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:89,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:89,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:90,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:90,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:91,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:91,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:93,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:93,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:94,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:94,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:95,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:95,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:96,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:96,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:97,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:97,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:98,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:98,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:110,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`whole`}],barAfter:`single`},{measure:115,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:140,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`}]},{measure:140,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:142,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`}]},{measure:142,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:149,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0},{measure:149,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:174,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:174,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:175,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:176,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:176,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:177,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:178,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:178,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:178,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:179,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:179,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:179,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:180,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:180,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:180,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:181,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:181,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:182,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:182,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:183,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0}]},Do={schemaVersion:3,id:`beethoven-ode-to-joy`,shortName:`Ode to Joy`,composer:`Ludwig van Beethoven`,work:`Symphony No. 9 in D minor, Op. 125`,movement:`IV. Ode to Joy`,tempo:96,meter:[4,4],clef:`treble`,keySignatureFifths:1,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=528`,url:`https://www.mutopiaproject.org/ftp/BeethovenLv/ode/ode.mid`,format:`MIDI`,downloadSha256:`fb1604c08c865b275b464d74e5a7c526ff1a8acccdf9853cb92f0778daaed14b`,retrievedOn:`2026-07-31`,sourceFile:`ode.mid`,part:`soprano melody (upper)`,selection:`beats 0–128`,transposeSemitones:0},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`half`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`half`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`half`}]}]},Oo={schemaVersion:3,id:`brahms-wiegenlied`,shortName:`Brahms Wiegenlied`,composer:`Johannes Brahms`,work:`5 Lieder, Op. 49`,movement:`No. 4. Wiegenlied`,tempo:76,meter:[3,4],clef:`treble`,keySignatureFifths:-3,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/5701612`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Brahms,_Johannes/5_Lieder,_Op.49/4_Wiegenlied/lc5701612.mxl`,format:`MusicXML`,downloadSha256:`5867b883ba1d159f234a3764a0f3f467afdd78cf6ee4698bca17d52d3a4f65db`,retrievedOn:`2026-07-31`,sourceFile:`lc5701612.mxl`,part:`voice / P1 (Singstimme)`,selection:`measures 1–24`,transposeSemitones:0},units:[{measure:2,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:4,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`half`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`half`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`,grace:!0}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`half`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`half`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`half`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`,grace:!0}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`half`}]}]},ko={schemaVersion:3,id:`greensleeves`,shortName:`Greensleeves`,composer:`Traditional`,work:`Greensleeves`,movement:`Traditional melody`,tempo:84,meter:[6,8],clef:`treble`,keySignatureFifths:-4,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1247`,url:`https://www.mutopiaproject.org/ftp/Traditional/greensleeves/greensleeves.mid`,format:`MIDI`,downloadSha256:`04a6e03dd6128aa291aa75e4df757bbba40567ef885eca18d14d51d9365cb8e8`,retrievedOn:`2026-07-31`,sourceFile:`greensleeves.mid`,part:`soprano melody (upper:one)`,selection:`beats 0–128`,transposeSemitones:1},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Db5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`C4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Db5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:9,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D5`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`C4`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Db5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]}]},Ao={schemaVersion:3,id:`petzold-minuet-in-g`,shortName:`Minuet in G`,composer:`Christian Petzold`,work:`Minuet in G major, BWV Anh. 114`,movement:`Menuet`,tempo:100,meter:[3,4],clef:`treble`,keySignatureFifths:-1,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=258`,url:`https://www.mutopiaproject.org/ftp/BachJS/BWVAnh114/Minuet-xpose/Minuet-xpose.mid`,format:`MIDI`,downloadSha256:`4199c2f47ca19389f89902385acfea4237f4e58d850b2ee698af2dc8e86e8557`,retrievedOn:`2026-07-31`,sourceFile:`Minuet-xpose.mid`,part:`upper trumpet melody (staffA:)`,selection:`beats 0–128`,transposeSemitones:-2},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:1,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0},{measure:3,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`half`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A5`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A5`}],duration:`eighth`}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F5`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`quarter`}]},{measure:20,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0},{measure:20,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`eighth`}],beam:!0},{measure:21,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`quarter`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`half`,dots:1}],barAfter:`single`},{measure:25,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:25,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:25,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:26,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:26,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:26,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:27,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:27,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:27,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:28,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:28,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:28,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:29,symbols:[{kind:`note`,pitches:[{name:`C4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:29,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:30,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],beam:!0},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:31,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}],barAfter:`single`},{measure:32,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`,dots:1}]}]},jo={schemaVersion:3,id:`schubert-an-die-musik`,shortName:`An die Musik`,composer:`Franz Schubert`,work:`An die Musik, D. 547`,movement:`An die Musik`,tempo:76,meter:[2,2],clef:`treble`,keySignatureFifths:2,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/6180725`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/_/An_die_Musik,_D.547/lc6180725.mxl`,format:`MusicXML`,downloadSha256:`4c7b0331cb2785ccbd0779be5396bb2faafef2e8a47f8e0aec96e0cb8ccd4984`,retrievedOn:`2026-07-31`,sourceFile:`lc6180725.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–19`,transposeSemitones:0},units:[{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`,grace:!0}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`,dots:1}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:7,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`C#4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`C#4`}],duration:`eighth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`}],barAfter:`single`},{measure:10,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:11,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`,dots:1}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`,grace:!0}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`,grace:!0}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`}]},{measure:17,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`half`}]}]},Mo={schemaVersion:3,id:`schubert-der-lindenbaum`,shortName:`Der Lindenbaum`,composer:`Franz Schubert`,work:`Winterreise, D. 911`,movement:`No. 5. Der Lindenbaum`,tempo:80,meter:[3,4],clef:`treble`,keySignatureFifths:4,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/5016466`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/Winterreise,_D.911/5_Der_Lindenbaum/lc5016466.mxl`,format:`MusicXML`,downloadSha256:`f4312876fee5664a805aeace05621015c4be0143055bd3b58f348d039420452e`,retrievedOn:`2026-07-31`,sourceFile:`lc5016466.mxl`,part:`voice / P1 (Singstimme)`,selection:`measures 1–38`,transposeSemitones:0},units:[{measure:8,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:12,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:16,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`}]},{measure:20,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:20,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:21,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:22,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:22,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:23,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:24,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:25,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:26,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:28,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:28,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:28,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:28,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:29,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:29,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:30,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:31,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:32,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:32,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:32,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:33,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:33,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:34,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`quarter`}]},{measure:34,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:34,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:34,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:35,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:35,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:35,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:36,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:36,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:36,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:37,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:38,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:38,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:38,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}]}]},No={schemaVersion:3,id:`schubert-du-bist-die-ruh`,shortName:`Du bist die Ruh`,composer:`Franz Schubert`,work:`Du bist die Ruh, D. 776`,movement:`Du bist die Ruh`,tempo:60,meter:[3,8],clef:`treble`,keySignatureFifths:-3,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/4919879`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/Op.59/3_Du_bist_die_Ruh/lc4919879.mxl`,format:`MusicXML`,downloadSha256:`65ee78acb0a26b246e4f81d6d192b83dabc9440dbe6f08512fab521d84855150`,retrievedOn:`2026-07-31`,sourceFile:`lc4919879.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–50`,transposeSemitones:0},units:[{measure:8,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:21,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:22,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`}],beam:!0},{measure:24,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:25,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:25,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],barAfter:`single`},{measure:26,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:28,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:29,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:30,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:32,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:32,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:33,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:33,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:34,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:35,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:36,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:36,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:37,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:39,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:40,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:40,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:41,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:41,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:42,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:43,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:44,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:44,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:45,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:45,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:46,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:46,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:47,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`}],beam:!0},{measure:47,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:48,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:48,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}]}]},Po={schemaVersion:3,id:`schubert-standchen`,shortName:`Schubert Ständchen`,composer:`Franz Schubert`,work:`Schwanengesang, D. 957`,movement:`No. 4. Ständchen`,tempo:72,meter:[3,4],clef:`treble`,keySignatureFifths:-1,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/5004835`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/Schwanengesang,_D.957/4_St%C3%A4ndchen/lc5004835.mxl`,format:`MusicXML`,downloadSha256:`11f8bd4edfd11dc303d4b46d480cf110cb7015af303abf0d3848c40984c202a1`,retrievedOn:`2026-07-31`,sourceFile:`lc5004835.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–38`,transposeSemitones:0},units:[{measure:5,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`}]},{measure:8,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:9,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:10,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`,dots:1}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`,dots:1}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}]},{measure:14,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:15,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:16,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`sixteenth`}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`,dots:1}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`,dots:1}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:21,symbols:[{kind:`note`,pitches:[{name:`F#4`,displayAccidental:`sharp`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:21,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`,dots:1}]},{measure:21,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`sixteenth`}],beam:!0},{measure:23,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`,dots:1}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:24,symbols:[{kind:`note`,pitches:[{name:`F#4`,displayAccidental:`sharp`}],duration:`quarter`,dots:1}]},{measure:24,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],barAfter:`single`},{measure:25,symbols:[{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0},{measure:25,symbols:[{kind:`note`,pitches:[{name:`A#4`,displayAccidental:`sharp`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0},{measure:25,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:25,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:26,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D#5`,displayAccidental:`sharp`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0},{measure:27,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`,dots:1}]},{measure:27,symbols:[{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`eighth`}],barAfter:`single`},{measure:28,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`,dots:1}],barAfter:`single`},{measure:29,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:30,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:31,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:32,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:33,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:34,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:35,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:36,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`,dots:1}],barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`eighth`,dots:1}],beam:!0},{measure:38,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0}]},Fo={schemaVersion:3,id:`schumann-mondnacht`,shortName:`Schumann Mondnacht`,composer:`Robert Schumann`,work:`Liederkreis, Op. 39`,movement:`No. 5. Mondnacht`,tempo:60,meter:[3,8],clef:`treble`,keySignatureFifths:4,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/4987640`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schumann,_Robert/Liederkreis,_Op.39/5_Mondnacht/lc4987640.mxl`,format:`MusicXML`,downloadSha256:`05454fafdddaa39171e96fac68b27dcaab49e8221a2ab25f0163245b60fc83ba`,retrievedOn:`2026-07-31`,sourceFile:`lc4987640.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–45`,transposeSemitones:0},units:[{measure:6,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:10,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:10,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:14,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:15,symbols:[{kind:`rest`,duration:`sixteenth`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:18,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:20,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:23,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:24,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:25,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:26,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:28,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:28,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:28,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:29,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:29,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:30,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:30,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:31,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:32,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:32,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:32,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:33,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:33,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:34,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:34,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:35,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:36,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:36,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:36,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:37,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:38,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:39,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:39,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:40,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:40,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:40,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:41,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:41,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:42,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:42,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:43,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:44,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:44,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:44,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:45,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:45,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}]}]},Io={C:0,D:1,E:2,F:3,G:4,A:5,B:6},Lo=30;function Ro(e){let t=/^([A-G])(bb|##|#|b|n)?(\d)$/u.exec(e.name);if(t===null)throw Error(`Unsupported score pitch: ${e.name}`);let n=t[1]??`C`,r=t[2]??``,i=Number(t[3]??`4`),a=r===`bb`?`double-flat`:r===`b`?`flat`:r===`n`?`natural`:r===`#`?`sharp`:r===`##`?`double-sharp`:void 0;return{staffStep:i*7+(Io[n]??0)-Lo,alteration:a===`double-flat`?-2:a===`flat`?-1:a===`sharp`?1:a===`double-sharp`?2:0,...e.displayAccidental===void 0?{}:{displayAccidental:e.displayAccidental}}}function zo(e){return e.kind===`rest`?{kind:`rest`,duration:e.duration,...e.dots===void 0?{}:{dots:e.dots}}:{kind:`note`,pitches:e.pitches.map(Ro),duration:e.duration,...e.dots===void 0?{}:{dots:e.dots},...e.grace===void 0?{}:{grace:e.grace}}}function Bo(e){if(e.schemaVersion!==3)throw Error(`Unsupported score source schema: ${String(e.schemaVersion)}`);return{id:e.id,shortName:e.shortName,composer:e.composer,work:e.work,movement:e.movement,tempo:e.tempo,meter:e.meter,clef:e.clef,keySignatureFifths:e.keySignatureFifths,source:e.source,units:e.units.map((t,n)=>({id:`${e.id}:${n+1}`,symbols:t.symbols.map(zo),width:Math.max(40,18+t.symbols.length*14),label:`Measure ${t.measure}, phrase ${n+1}`,...t.beam===void 0?{}:{beam:t.beam},...t.barAfter===void 0?{}:{barAfter:t.barAfter}}))}}var Vo=[Do,Oo,Ao,Po,jo,Mo,No,Fo,Eo,ko,wo,To].map(Bo);function Ho(e){let t=Vo.find(t=>t.id===e);if(t===void 0)throw Error(`Unknown score theme: ${e}`);return t}[...[`whole`,`half`,`quarter`,`eighth`,`sixteenth`,`thirty-second`].map((e,t)=>({id:`rhythm:rest:${e}`,symbols:[{kind:`rest`,duration:e,...t===3?{dots:1}:{}}],...e===`thirty-second`?{barAfter:`final`}:{}}))],[`staccato`,`tenuto`,`accent`,`marcato`,`fermata`].map((e,t)=>({kind:`note`,pitches:[{staffStep:2+t%3*2}],duration:`quarter`,articulations:[e]}));function Uo({backgroundImageSrc:e,backgroundPattern:t,children:n,className:r,...i}){return(0,P.jsxs)(`main`,{className:R(`product-page`,t===`dots`&&`has-dot-background`,r),...i,children:[e===void 0?null:(0,P.jsx)(`img`,{alt:``,"aria-hidden":`true`,className:`product-page-decor`,decoding:`async`,draggable:!1,src:e}),n]})}function Wo({brand:e,actions:t,className:n,...r}){return(0,P.jsxs)(`div`,{className:R(`product-appbar`,n),...r,children:[e,t===void 0?null:(0,P.jsx)(`div`,{className:`product-appbar-actions`,children:t})]})}function Go({children:e,className:t,...n}){return(0,P.jsx)(`section`,{className:R(`product-shell`,t),...n,children:e})}function Ko({children:e,className:t,...n}){return(0,P.jsx)(`section`,{className:R(`auth-shell`,t),...n,children:e})}function qo({children:e,className:t,...n}){return(0,P.jsx)(`main`,{className:R(`workspace-page`,t),...n,children:e})}function Jo({sidebar:e,children:t,className:n,...r}){return(0,P.jsxs)(`div`,{className:R(`workspace-shell`,n),...r,children:[e,(0,P.jsx)(`section`,{className:`workspace-main`,children:t})]})}function Yo({label:e,imageUrl:t,initials:n,icon:r,tone:i=`neutral`,online:a=!1,plain:o=!1,count:s,className:c,...l}){let[u,d]=(0,N.useState)(!1),f=s===void 0?void 0:`+${s}`,p=t!==void 0&&!u;return(0,N.useEffect)(()=>{d(!1)},[t]),(0,P.jsx)(`span`,{"aria-label":e,title:l.title??e,className:R(`avatar`,o?`avatar-tone-plain`:`avatar-tone-${i}`,a?`is-online`:void 0,s===void 0?void 0:`is-count`,c),...l,children:f??(p?(0,P.jsx)(`img`,{className:`avatar-image`,src:t,alt:``,referrerPolicy:`no-referrer`,onError:()=>{d(!0)}}):r??(0,P.jsx)(`span`,{className:`avatar-initials`,children:n??`?`}))})}function Xo({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`avatar-stack`,t),...n,children:e})}var Zo=Object.defineProperty,Qo=(e,t)=>Zo(e,`name`,{value:t,configurable:!0});function $o(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qo($o,`setRef`);function es(...e){return t=>{let n=!1,r=e.map(e=>{let r=$o(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():$o(e[t],null)}}}}Qo(es,`composeRefs`);function ts(...e){return N.useCallback(es(...e),e)}Qo(ts,`useComposedRefs`);var ns=Object.defineProperty,rs=(e,t)=>ns(e,`name`,{value:t,configurable:!0});function is(e){let t=N.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ps(r)&&typeof _s==`function`&&(r=_s(r._payload)),N.Children.forEach(r,e=>{if(ds(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ps(n)&&typeof _s==`function`&&(n=_s(n._payload)),a=cs(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=N.cloneElement(a,void 0,s):!o&&N.Children.count(r)===1&&N.isValidElement(r)&&(a=r);let c=a?us(a):void 0,l=ts(n,c);if(!a){if(r||r===0)throw Error(o?gs(e):hs(e));return r}let u=ls(i,a.props??{});return a.type!==N.Fragment&&(u.ref=n?l:c),N.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}rs(is,`createSlot`);var as=is(`Slot`),os=Symbol.for(`radix.slottable`);function ss(e){let t=rs(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=os,t}rs(ss,`createSlottable`);var cs=rs((e,t)=>{if(`child`in e.props){let t=e.props.child;return N.isValidElement(t)?N.cloneElement(t,void 0,e.props.children(t.props.children)):null}return N.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function ls(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}}rs(ls,`mergeProps`);function us(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)}rs(us,`getElementRef`);function ds(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===os}rs(ds,`isSlottable`);var fs=Symbol.for(`react.lazy`);function ps(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===fs&&`_payload`in e&&ms(e._payload)}rs(ps,`isLazyComponent`);function ms(e){return typeof e==`object`&&!!e&&`then`in e}rs(ms,`isPromiseLike`);var hs=rs(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),gs=rs(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),_s=N.use,vs={action:`action-button`,quiet:`quiet-button`,pill:`pill-action`,icon:`quiet-button icon-button`};function ys({variant:e=`quiet`,asChild:t=!1,className:n,children:r,...i}){return(0,P.jsx)(t?as:`button`,{className:R(vs[e],n),...i,children:r})}function bs({label:e,icon:t,className:n,...r}){return(0,P.jsx)(ys,{...r,"aria-label":e,title:r.title??e,variant:`icon`,className:n,children:t})}function xs(e){return(0,P.jsx)(ys,{...e,variant:`action`})}function Ss(e){return(0,P.jsx)(ys,{...e,variant:`quiet`})}function Cs({tone:e=`neutral`,className:t,children:n,...r}){return(0,P.jsx)(`span`,{className:R(`scope-chip`,`is-${e}`,t),...r,children:n})}var ws={todo:`neutral`,running:`sync`,pending:`warning`,done:`success`,failed:`error`};function Ts({status:e,children:t,className:n,...r}){return(0,P.jsx)(Cs,{tone:ws[e],className:R(`task-tag`,`is-${e}`,n),...r,children:t})}function Es({children:e,content:t,contentId:n,disabledTrigger:r=!1,side:i=`top`,className:a,tabIndex:o,...s}){let c=(0,N.useId)(),l=n??c,u=e.props[`aria-describedby`],d=u===void 0?l:`${u} ${l}`;return(0,P.jsxs)(`span`,{className:R(`tooltip-trigger`,`is-${i}`,a),tabIndex:r?o??0:o,...r?{"aria-describedby":l}:{},...s,children:[(0,N.cloneElement)(e,{"aria-describedby":d}),(0,P.jsx)(`span`,{className:`tooltip-content`,id:l,role:`tooltip`,children:t})]})}function Ds({src:e,label:t=`Tutti`,className:n,...r}){return(0,P.jsx)(`span`,{"aria-label":t,className:R(`brand-logo`,n),role:r.role??`img`,...r,children:(0,P.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`})})}function Os({logo:e,label:t=`Tutti Project Center`,className:n,...r}){return(0,P.jsx)(`button`,{...r,"aria-label":t,className:R(`tutti-brand`,n),type:r.type??`button`,children:e})}function ks({className:e,...t}){return(0,P.jsx)(`input`,{className:R(`input-shell`,e),...t})}function As({className:e,...t}){return(0,P.jsx)(`textarea`,{className:R(`input-shell`,`textarea-shell`,e),...t})}function js({value:e,options:t,onValueChange:n,maxVisibleOptions:r=8,defaultOpen:i=!1,className:a,onBlur:o,onClick:s,onFocus:c,onKeyDown:l,...u}){let d=(0,N.useId)(),f=(0,N.useRef)(null),[p,m]=(0,N.useState)(i),[h,g]=(0,N.useState)(-1),_=e.trim().toLocaleLowerCase(),v=(0,N.useMemo)(()=>_===``||t.some(e=>e.toLocaleLowerCase()===_)?[...t]:t.filter(e=>e.toLocaleLowerCase().includes(_)),[_,t]),y=p&&v.length>0,b=Math.min(10,Math.max(1,Math.floor(r))),x=h<0?void 0:v[h];(0,N.useEffect)(()=>{if(v.length===0){g(-1);return}g(e=>Math.min(Math.max(e,0),v.length-1))},[v.length]),(0,N.useEffect)(()=>{!y||h<0||document.getElementById(`${d}-${h}`)?.scrollIntoView({block:`nearest`})},[h,d,y]);function S(e){n(e),m(!1),g(-1)}function C(e){if(l?.(e),!e.defaultPrevented)switch(e.key){case`ArrowDown`:e.preventDefault(),m(!0),g(e=>v.length===0?-1:Math.min(e+1,v.length-1));break;case`ArrowUp`:e.preventDefault(),m(!0),g(e=>v.length===0?-1:e<=0?v.length-1:e-1);break;case`Enter`:y&&x!==void 0&&(e.preventDefault(),S(x));break;case`Escape`:y&&(e.preventDefault(),e.stopPropagation(),m(!1),g(-1));break;case`Tab`:m(!1),g(-1);break}}return(0,P.jsxs)(`span`,{className:`combobox-shell`,ref:f,style:{"--combobox-visible-options":b},children:[(0,P.jsx)(ks,{...u,"aria-activedescendant":y&&h>=0?`${d}-${h}`:void 0,"aria-autocomplete":`list`,"aria-controls":d,"aria-expanded":y,className:R(`combobox-input`,a),role:`combobox`,value:e,onBlur:e=>{o?.(e),f.current?.contains(e.relatedTarget)||(m(!1),g(-1))},onChange:e=>{n(e.target.value),m(!0),g(0)},onClick:e=>{s?.(e),m(!0),g(0)},onFocus:e=>{c?.(e),m(!0),g(0)},onKeyDown:C}),y?(0,P.jsx)(`span`,{className:`combobox-listbox`,id:d,role:`listbox`,children:v.map((t,n)=>(0,P.jsx)(`span`,{"aria-selected":t===e,className:R(`combobox-option`,n===h?`is-active`:void 0),id:`${d}-${n}`,role:`option`,onClick:e=>{e.preventDefault(),S(t)},onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>g(n),children:t},t))}):null]})}function Ms({children:e,className:t,...n}){return(0,P.jsx)(`span`,{className:R(`field-label`,t),...n,children:e})}function Ns({label:e,children:t,className:n,...r}){return(0,P.jsxs)(`label`,{className:R(`form-field`,n),...r,children:[(0,P.jsx)(Ms,{children:e}),t]})}function Ps({tone:e=`error`,className:t,role:n,...r}){return(0,P.jsx)(`p`,{className:R(e===`error`?`form-error`:`form-note`,t),role:n??(e===`error`?`alert`:void 0),...r})}function Fs({icon:e,className:t,children:n,rel:r=`noopener noreferrer`,target:i=`_blank`,...a}){return(0,P.jsxs)(`a`,{className:R(`inline-help-link`,t),rel:r,target:i,...a,children:[(0,P.jsx)(`span`,{children:n}),e]})}function Is({brand:e,children:t,status:n,footer:r,mobileTitle:i,mobileMeta:a,mobileAction:o,className:s,...c}){return(0,P.jsxs)(`aside`,{className:R(`sidebar`,s),"aria-label":`Workspace navigation`,...c,children:[(0,P.jsx)(`div`,{className:`workspace-logo`,children:e}),i===void 0&&a===void 0?null:(0,P.jsxs)(`div`,{className:`workspace-mobile-context`,children:[i===void 0?null:(0,P.jsx)(`strong`,{children:i}),a===void 0?null:(0,P.jsx)(`span`,{children:a})]}),n===void 0?null:(0,P.jsx)(`nav`,{className:`sidebar-status-group`,"aria-label":`Status shortcuts`,children:n}),o===void 0?null:(0,P.jsx)(`div`,{className:`workspace-mobile-action`,children:o}),(0,P.jsx)(`nav`,{className:`sidebar-nav sidebar-primary-group`,"aria-label":`Pages`,children:t}),r===void 0?null:(0,P.jsx)(`nav`,{className:`sidebar-footer`,"aria-label":`Workspace utilities`,children:r})]})}function Ls({icon:e,label:t,className:n,...r}){return(0,P.jsx)(Es,{content:t,"data-label":t,side:`right`,children:(0,P.jsx)(`a`,{...r,"aria-label":t,"data-label":t,className:R(`sidebar-button`,n),children:e})})}function Rs({icon:e,label:t,active:n=!1,badge:r=!1,className:i,...a}){let o=typeof r==`object`?r:void 0,s=o?.label??`Unread updates`,c=o?.variant??`dot`,l=r===!1?t:`${t}, ${s}`;return(0,P.jsx)(Es,{content:t,"data-label":t,disabledTrigger:a.disabled===!0,side:`right`,children:(0,P.jsxs)(`button`,{...a,"aria-label":l,"data-label":t,className:R(`sidebar-button`,n?`is-active`:void 0,i),type:a.type??`button`,children:[e,r===!1?null:(0,P.jsx)(`span`,{className:R(`sidebar-button-badge`,c===`pill`?`is-pill`:void 0),"aria-hidden":`true`,children:c===`pill`?o?.text:null})]})})}function zs({icon:e,label:t,tone:n,className:r,...i}){return(0,P.jsx)(Es,{content:t,"data-label":t,disabledTrigger:i.disabled===!0,side:`right`,children:(0,P.jsx)(`button`,{...i,"aria-label":t,"data-label":t,className:R(`sidebar-status-entry`,`is-${n}`,r),type:i.type??`button`,children:e})})}var Bs=Object.defineProperty,Vs=(e,t)=>Bs(e,`name`,{value:t,configurable:!0}),Hs=!!(typeof window<`u`&&window.document&&window.document.createElement);function Us(e,t,{checkForDefaultPrevented:n=!0}={}){return Vs(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Vs(Us,`composeEventHandlers`);function Ws(e){if(!Hs)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Vs(Ws,`getOwnerWindow`);function Gs(e){if(!Hs)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Vs(Gs,`getOwnerDocument`);function Ks(e,t=!1){let{activeElement:n}=Gs(e);if(!n?.nodeName)return null;if(qs(n)&&n.contentDocument)return Ks(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Gs(n).getElementById(e);if(t)return t}}return n}Vs(Ks,`getActiveElement`);function qs(e){return e.tagName===`IFRAME`}Vs(qs,`isFrame`);var Js=Object.defineProperty,Ys=(e,t)=>Js(e,`name`,{value:t,configurable:!0});function Xs(e,t){let n=N.createContext(t);n.displayName=e+`Context`;let r=Ys(e=>{let{children:t,...r}=e,i=N.useMemo(()=>r,Object.values(r));return(0,P.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=N.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Ys(i,`useContext`),[r,i]}Ys(Xs,`createContext`);function Zs(e,t=[]){let n=[];function r(t,r){let i=N.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Ys(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=N.useMemo(()=>o,Object.values(o));return(0,P.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=N.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Ys(s,`useContext`),[o,s]}Ys(r,`createContext`);let i=Ys(()=>{let t=n.map(e=>N.createContext(e));return Ys(function(n){let r=n?.[e]||t;return N.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Qs(i,...t)]}Ys(Zs,`createContextScope`);function Qs(...e){let t=e[0];if(e.length===1)return t;let n=Ys(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Ys(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Ys(Qs,`composeContextScopes`);var $s=globalThis?.document?N.useLayoutEffect:()=>{},ec=Object.defineProperty,tc=(e,t)=>ec(e,`name`,{value:t,configurable:!0}),nc=N.useId||(()=>void 0),rc=0;function ic(e){let[t,n]=N.useState(nc());return $s(()=>{e||n(e=>e??String(rc++))},[e]),e||(t?`radix-${t}`:``)}tc(ic,`useId`);var ac=Object.defineProperty,oc=(e,t)=>ac(e,`name`,{value:t,configurable:!0}),sc=N.useEffectEvent,cc=N.useInsertionEffect;function lc(e){if(typeof sc==`function`)return sc(e);let t=N.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof cc==`function`?cc(()=>{t.current=e}):$s(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}oc(lc,`useEffectEvent`);var uc=Object.defineProperty,dc=(e,t)=>uc(e,`name`,{value:t,configurable:!0}),fc=N.useInsertionEffect||$s;function pc({prop:e,defaultProp:t,onChange:n=dc(()=>{},`onChange`),caller:r}){let[i,a,o]=mc({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,N.useCallback(t=>{if(s){let n=hc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}dc(pc,`useControllableState`);function mc({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return fc(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}dc(mc,`useUncontrolledState`);function hc(e){return typeof e==`function`}dc(hc,`isFunction`);var gc=Symbol(`RADIX:SYNC_STATE`);function _c(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=lc(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=N.useReducer((t,n)=>{if(n.type===gc)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=N.useRef(p);N.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=N.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return N.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:gc,state:i})},[i,d.state,c]),[h,f]}dc(_c,`useControllableStateReducer`);var vc=l(h(),1),yc=Object.defineProperty,bc=(e,t)=>yc(e,`name`,{value:t,configurable:!0}),xc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=is(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,P.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Sc(e,t){e&&vc.flushSync(()=>e.dispatchEvent(t))}bc(Sc,`dispatchDiscreteCustomEvent`);var Cc=Object.defineProperty,wc=(e,t)=>Cc(e,`name`,{value:t,configurable:!0});function Tc(e){let t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}wc(Tc,`useCallbackRef`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=`dismissableLayer.update`,kc=`dismissableLayer.pointerDownOutside`,Ac=`dismissableLayer.focusOutside`,jc,Mc=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Nc=N.forwardRef(Dc(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=N.useContext(Mc),[d,f]=N.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=N.useState({}),h=ts(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=N.useRef(!1),C=Ic(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:N.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Lc(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),T=d?y===g.length-1:!1,E=Tc(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return N.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),N.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jc=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Rc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=jc))}},[d,p,n,u]),N.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Rc())},[d,u]),N.useEffect(()=>{let e=Dc(()=>m({}),`handleUpdate`);return document.addEventListener(Oc,e),()=>document.removeEventListener(Oc,e)},[]),(0,P.jsx)(xc.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Us(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Us(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Us(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Pc(){let e=N.useContext(Mc),[t,n]=N.useState(null);return N.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Dc(Pc,`useDismissableLayerSurface`);var Fc=Dc(()=>!0,`IS_TRUE`);function Ic(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fc}=t,s=Tc(e),c=N.useRef(!1),l=N.useRef(!1),u=N.useRef(new Map),d=N.useRef(()=>{});return N.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Dc(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Dc(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)}Dc(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Dc(p,`handleInteractionBubble`);let m=Dc(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||zc(kc,s,p,{discrete:!0})};if(Dc(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:Dc(()=>c.current=!0,`onPointerDownCapture`)}}Dc(Ic,`usePointerDownOutside`);function Lc(e,t=globalThis?.document){let n=Tc(e),r=N.useRef(!1);return N.useEffect(()=>{let e=Dc(e=>{e.target&&!r.current&&zc(Ac,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Dc(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Dc(()=>r.current=!1,`onBlurCapture`)}}Dc(Lc,`useFocusOutside`);function Rc(){let e=new CustomEvent(Oc);document.dispatchEvent(e)}Dc(Rc,`dispatchUpdate`);function zc(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?Sc(i,a):i.dispatchEvent(a)}Dc(zc,`handleAndDispatchCustomEvent`);var Bc=Object.defineProperty,V=(e,t)=>Bc(e,`name`,{value:t,configurable:!0}),Vc=`focusScope.autoFocusOnMount`,Hc=`focusScope.autoFocusOnUnmount`,Uc={bubbles:!1,cancelable:!0},Wc=N.forwardRef(V(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=N.useState(null),l=Tc(i),u=Tc(a),d=N.useRef(null),f=ts(t,c),p=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Zc(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Zc(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Zc(s)};V(e,`handleFocusIn`),V(t,`handleFocusOut`),V(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]),N.useEffect(()=>{if(s){Qc.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Vc,Uc);s.addEventListener(Vc,l),s.dispatchEvent(t),t.defaultPrevented||(Gc(tl(qc(s)),{select:!0}),document.activeElement===e&&Zc(s))}return()=>{s.removeEventListener(Vc,l),setTimeout(()=>{let t=new CustomEvent(Hc,Uc);s.addEventListener(Hc,u),s.dispatchEvent(t),t.defaultPrevented||Zc(e??document.body,{select:!0}),s.removeEventListener(Hc,u),Qc.remove(p)},0)}}},[s,l,u,p]);let m=N.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]=Kc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Zc(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Zc(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,P.jsx)(xc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Gc(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Zc(r,{select:t}),document.activeElement!==n)return}V(Gc,`focusFirst`);function Kc(e){let t=qc(e);return[Jc(t,e),Jc(t.reverse(),e)]}V(Kc,`getTabbableEdges`);function qc(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:V(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}V(qc,`getTabbableCandidates`);function Jc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Yc(r,{upTo:t})))return r}V(Jc,`findVisible`);function Yc(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}V(Yc,`isHidden`);function Xc(e){return e instanceof HTMLInputElement&&`select`in e}V(Xc,`isSelectableInput`);function Zc(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xc(e)&&t&&e.select()}}V(Zc,`focus`);var Qc=$c();function $c(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=el(e,t),e.unshift(t)},remove(t){e=el(e,t),e[0]?.resume()}}}V($c,`createFocusScopesStack`);function el(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}V(el,`arrayRemove`);function tl(e){return e.filter(e=>e.tagName!==`A`)}V(tl,`removeLinks`);var nl=Object.defineProperty,rl=N.forwardRef(((e,t)=>nl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=N.useState(!1);$s(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?vc.createPortal((0,P.jsx)(xc.div,{...r,ref:t}),o):null},`Portal`)),il=Object.defineProperty,al=(e,t)=>il(e,`name`,{value:t,configurable:!0});function ol(e,t){return N.useReducer((e,n)=>t[e][n]??e,e)}al(ol,`useStateMachine`);var sl=al(e=>{let{present:t,children:n}=e,r=cl(t),i=typeof n==`function`?n({present:r.isPresent}):N.Children.only(n),a=ul(r.ref,fl(i));return typeof n==`function`||r.isPresent?N.cloneElement(i,{ref:a}):null},`Presence`);function cl(e){let[t,n]=N.useState(),r=N.useRef(null),i=N.useRef(e),a=N.useRef(`none`),o=N.useRef(void 0),[s,c]=ol(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return N.useEffect(()=>{s===`mounted`?(a.current=o.current??dl(r.current),o.current=void 0):a.current=`none`},[s]),$s(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=dl(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]),$s(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=al(a=>{let o=dl(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=al(e=>{e.target===t&&(a.current=dl(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)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:N.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=dl(t)}else r.current=null;n(e)},[])}}al(cl,`usePresence`);function ll(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}al(ll,`setRef`);function ul(...e){let t=N.useRef(e);return t.current=e,N.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ll(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():ll(n[e],null)}}},[])}al(ul,`useStableComposedRefs`);function dl(e){return e?.animationName||`none`}al(dl,`getAnimationName`);function fl(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)}al(fl,`getElementRef`);var pl=Object.defineProperty,ml=(e,t)=>pl(e,`name`,{value:t,configurable:!0}),hl=0,gl=null;function _l(e){return vl(),e.children}ml(_l,`FocusGuards`);function vl(){N.useEffect(()=>{gl||={start:yl(),end:yl()};let{start:e,end:t}=gl;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),hl++,()=>{hl===1&&(gl?.start.remove(),gl?.end.remove(),gl=null),hl=Math.max(0,hl-1)}},[])}ml(vl,`useFocusGuards`);function yl(){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}ml(yl,`createFocusGuard`);var bl=function(){return bl=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},bl.apply(this,arguments)};function xl(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 Sl(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 Cl=`right-scroll-bar-position`,wl=`width-before-scroll-bar`,Tl=`with-scroll-bars-hidden`,El=`--removed-body-scroll-bar-size`;function Dl(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ol(e,t){var n=(0,N.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 kl=typeof window<`u`?N.useLayoutEffect:N.useEffect,Al=new WeakMap;function jl(e,t){var n=Ol(t||null,function(t){return e.forEach(function(e){return Dl(e,t)})});return kl(function(){var t=Al.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Dl(e,null)}),i.forEach(function(e){r.has(e)||Dl(e,a)})}Al.set(n,e)},[e]),n}function Ml(e){return e}function Nl(e,t){t===void 0&&(t=Ml);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 Pl(e){e===void 0&&(e={});var t=Nl(null);return t.options=bl({async:!0,ssr:!1},e),t}var Fl=function(e){var t=e.sideCar,n=xl(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 N.createElement(r,bl({},n))};Fl.isSideCarExport=!0;function Il(e,t){return e.useMedium(t),Fl}var Ll=Pl(),Rl=function(){},zl=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:Rl,onWheelCapture:Rl,onTouchMoveCapture:Rl}),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=xl(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=jl([n,t]),C=bl(bl({},b),i);return N.createElement(N.Fragment,null,u&&N.createElement(x,{sideCar:Ll,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?N.cloneElement(N.Children.only(s),bl(bl({},C),{ref:S})):N.createElement(v,bl({},C,{className:c,ref:S}),s))});zl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},zl.classNames={fullWidth:wl,zeroRight:Cl};var Bl,Vl=function(){if(Bl)return Bl;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Hl(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vl();return t&&e.setAttribute(`nonce`,t),e}function Ul(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wl(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Hl())&&(Ul(t,n),Wl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kl=function(){var e=Gl();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ql=function(){var e=Kl();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jl={left:0,top:0,right:0,gap:0},Yl=function(e){return parseInt(e||``,10)||0},Xl=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[Yl(n),Yl(r),Yl(i)]},Zl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jl;var t=Xl(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])}},Ql=ql(),$l=`data-scroll-locked`,eu=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
+ `)}function zr(e){return e.status===`promoted`?`promoted`:e.status===`not_promoted`?`not promoted`:`not attempted`}function Br(e){return e.result_kind===`needs_human`?`needs human`:e.result_kind===`failed`?`failed`:e.result_kind===`finished`?e.outcome??`finished`:`none`}function Vr(e){if(e.result_kind===`needs_human`)return`pending`;if(e.result_kind===`failed`)return`failed`;if(e.result_kind===`finished`)return e.outcome===`completed`?`done`:`failed`}function Hr(e){return e.result_kind===`needs_human`?`pending`:e.result_kind===`failed`?`failed`:e.outcome===`completed`?`done`:`failed`}function Ur(e){return e.result_kind===`needs_human`?`Needs human`:e.result_kind===`failed`?`Failed`:e.outcome===`completed`?`Finished`:`Finished with failure`}function Wr(e){return{id:e.id,title:Ur(e),meta:tr(e.created_at),status:Hr(e)}}function Gr(e,t){if(e===void 0)return;let n=e.detail.result,r=e.detail.contract,i=Vr(n),a=[i===void 0?{label:`STATUS`,value:Br(n)}:{label:`STATUS`,value:Br(n),status:i}];return n.updated_at!==void 0&&a.push({label:`UPDATED`,value:tr(n.updated_at)}),a.push({label:`RESULT`,value:Lr(n.summary,`No run result yet.`)}),n.checks!==void 0&&a.push({label:`CHECKS`,value:n.checks}),n.docs!==void 0&&a.push({label:`DOCS`,value:n.docs}),n.promotion!==void 0&&a.push({label:`PROMOTE`,value:zr(n.promotion)}),n.error_code!==void 0&&a.push({label:`ERROR`,value:n.error_code}),n.retryable!==void 0&&a.push({label:`RETRY`,value:n.retryable?`can retry`:`needs new scope`}),{taskId:e.task.id,title:e.task.title,status:e.task.status,summary:Lr(e.task.summary),contractRows:[{label:`GOAL`,value:r.goal||`None`},{label:`SCOPE`,value:Rr(r.scope)}],resultRows:a,evidenceRows:a,runResults:(t?.items??[]).map(Wr)}}var Kr=new Intl.DateTimeFormat(Xn,{year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});function qr(e){let t=new Date(e);return Number.isFinite(t.getTime())?Kr.format(t):e}function Jr(e,t,n){let r=[{label:`status`,value:n.status}];n.status!==`not_configured`&&r.push({label:`default_model`,value:n.default_model??`not available`},{label:`redacted_key`,value:n.redacted_key??`not available`,code:!0},{label:`validated_at`,value:n.validated_at===void 0?`not validated`:qr(n.validated_at)}),n.status===`invalid`&&n.invalid_reason_code!==void 0&&r.push({label:`invalid_reason_code`,value:n.invalid_reason_code});let i=e.relay.join_url;return{statuses:[{label:e.relay.status,tone:e.relay.status===`connected`?`live`:`warning`}],invite:{...i===void 0?{}:{joinUrl:i}},project:{displayName:e.project.display_name,description:e.project.description??``},currentMember:{displayName:t.account.display_name,avatar:t.account.avatar},sections:[{id:`settings-member`,title:`Member`,rows:[{label:`current member`,value:t.account.display_name,identity:!0},{label:`membership.label`,value:t.membership.label},{label:`joined_at`,value:qr(t.membership.joined_at)}]},{id:`settings-provider`,title:`Provider`,rows:r}]}}var Yr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Zr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Qr=e=>{let t=Zr(e);return t.charAt(0).toUpperCase()+t.slice(1)},$r={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`},ei=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ti=(0,N.createContext)({}),ni=()=>(0,N.useContext)(ti),ri=(0,N.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=``}=ni()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,N.createElement)(`svg`,{ref:c,...$r,width:t??l??$r.width,height:t??l??$r.height,stroke:e??f,strokeWidth:m,className:Yr(`lucide`,p,i),...!a&&!ei(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,N.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,N.forwardRef)(({className:n,...r},i)=>(0,N.createElement)(ri,{ref:i,iconNode:t,className:Yr(`lucide-${Xr(Qr(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Qr(e),n},ii=L(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ai=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),oi=L(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),si=L(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),ci=L(`chart-column-big`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`rect`,{x:`15`,y:`5`,width:`4`,height:`12`,rx:`1`,key:`q8uenq`}],[`rect`,{x:`7`,y:`8`,width:`4`,height:`9`,rx:`1`,key:`sr5ea`}]]),li=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ui=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),di=L(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),fi=L(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),pi=L(`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`}]]),mi=L(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),hi=L(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),gi=L(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),_i=L(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),vi=L(`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`}]]),yi=L(`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`}]]),bi=L(`file-check`,[[`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:`m9 15 2 2 4-4`,key:`1grp1n`}]]),xi=L(`file-lock`,[[`path`,{d:`M4 9.8V4a2 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 8v12a2 2 0 0 1-2 2h-3`,key:`1432pc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 17v-2a2 2 0 0 0-4 0v2`,key:`168m41`}],[`rect`,{width:`8`,height:`5`,x:`3`,y:`17`,rx:`1`,key:`o8vfew`}]]),Si=L(`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`}]]),Ci=L(`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`}]]),wi=L(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ti=L(`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`}]]),Ei=L(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Di=L(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Oi=L(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),ki=L(`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`}]]),Ai=L(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),ji=L(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Mi=L(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ni=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Pi=L(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`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`}]]),Fi=L(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),Ii=L(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Li=L(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]),Ri=L(`notepad-text`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`16`,height:`18`,x:`4`,y:`4`,rx:`2`,key:`1u9h20`}],[`path`,{d:`M8 10h6`,key:`3oa6kw`}],[`path`,{d:`M8 14h8`,key:`1fgep2`}],[`path`,{d:`M8 18h5`,key:`17enja`}]]),zi=L(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`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`}]]),Bi=L(`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`}]]),Vi=L(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Hi=L(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),Ui=L(`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`}]]),Wi=L(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Gi=L(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ki=L(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),qi=L(`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`}]]),Ji=L(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Yi=L(`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`}]]),Xi=L(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Zi=L(`square-dashed`,[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]]),Qi=L(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),$i=L(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),ea=L(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ta=L(`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`}]]),na=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ra=L(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),ia=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function R(...e){return e.filter(e=>typeof e==`string`&&e!==``).join(` `)}function aa({icon:e,watermark:t,tone:n=`neutral`,children:r,className:i,...a}){return(0,P.jsxs)(`div`,{className:R(`empty-state`,t===void 0?void 0:`has-watermark`,`is-${n}`,i),...a,children:[t===void 0?null:(0,P.jsx)(`span`,{className:`empty-state-watermark`,"aria-hidden":`true`,children:t}),e===void 0?null:(0,P.jsx)(`span`,{className:`empty-state-icon`,children:e}),(0,P.jsx)(`p`,{children:r})]})}function oa({count:e=3,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`loading-lines`,t),"aria-label":`Loading`,...n,children:Array.from({length:e}).map((e,t)=>(0,P.jsx)(`span`,{},t))})}function sa({tone:e}){switch(e){case`loading`:return(0,P.jsx)(Mi,{className:`is-spinning`,"aria-hidden":`true`});case`success`:return(0,P.jsx)(fi,{"aria-hidden":`true`});case`error`:return(0,P.jsx)(mi,{"aria-hidden":`true`});case`warning`:return(0,P.jsx)(na,{"aria-hidden":`true`});case`info`:return(0,P.jsx)(Di,{"aria-hidden":`true`})}}function ca(e){return e===`error`||e===`warning`?`alert`:`status`}function la(e,t){return e===void 0?t:{...t,"--notice-duration-ms":`${e}ms`}}function ua({tone:e,title:t,message:n,durationMs:r,persistent:i=e===`loading`,dismissible:a=e!==`loading`,dismissLabel:o=`Dismiss notification`,onDismiss:s,className:c,role:l,"aria-live":u,style:d,...f}){let p=a&&s!==void 0;return(0,P.jsxs)(`article`,{className:R(`notice-toast`,`is-${e}`,i?`is-persistent`:void 0,c),role:l??ca(e),"aria-live":u??(e===`error`||e===`warning`?`assertive`:`polite`),style:la(r,d),...f,children:[(0,P.jsx)(`span`,{className:`notice-toast-icon`,children:(0,P.jsx)(sa,{tone:e})}),(0,P.jsxs)(`span`,{className:`notice-toast-main`,children:[(0,P.jsx)(`strong`,{children:t}),n===void 0?null:(0,P.jsx)(`span`,{children:n})]}),p?(0,P.jsx)(`button`,{className:`notice-toast-close`,type:`button`,"aria-label":o,onClick:s,children:(0,P.jsx)(ia,{"aria-hidden":`true`})}):null]})}function da({notices:e,onDismiss:t,className:n,...r}){return(0,P.jsx)(`div`,{className:R(`notice-stack`,n),"aria-label":`Notifications`,...r,children:e.map(e=>(0,P.jsx)(ua,{tone:e.tone,title:e.title,...e.message===void 0?{}:{message:e.message},...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.persistent===void 0?{}:{persistent:e.persistent},...e.dismissible===void 0?{}:{dismissible:e.dismissible},...t===void 0?{}:{onDismiss:()=>t(e.id)}},e.id))})}function fa(e,t,n){return Math.min(Math.max(e,t),n)}function pa({pageCount:e,currentPage:t,maxVisible:n=7,onPageChange:r,pageAriaLabel:i,className:a,style:o,...s}){let c=Number.isFinite(e)?Math.max(0,Math.floor(e)):0;if(c===0)return null;let l=Math.min(c,Number.isFinite(n)?Math.max(1,Math.floor(n)):1),u=Number.isFinite(t)?fa(Math.floor(t),0,c-1):0,d=fa(u-Math.floor(l/2),0,c-l),f=u>0&&r!==void 0,p=u<c-1&&r!==void 0,m={...o,"--dot-pager-visible-count":l,"--dot-pager-window-start":d};return(0,P.jsxs)(`nav`,{className:R(`dot-pager`,a),style:m,...s,children:[(0,P.jsx)(`button`,{className:`dot-pager-arrow`,type:`button`,"aria-label":`Previous page`,disabled:!f,onClick:()=>r?.(u-1),children:(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`<`})}),(0,P.jsx)(`div`,{className:`dot-pager-viewport`,children:(0,P.jsx)(`div`,{className:`dot-pager-track`,children:Array.from({length:c},(e,t)=>{let n=t===u,a=t>=d&&t<d+l,o=i?.(t)??`Page ${t+1}`;return(0,P.jsx)(`button`,{className:R(`dot-pager-page`,n&&`is-current`),type:`button`,"aria-label":o,"aria-current":n?`page`:void 0,"aria-hidden":a?void 0:!0,disabled:r===void 0,tabIndex:a?0:-1,onClick:()=>r?.(t),children:(0,P.jsx)(`span`,{"aria-hidden":`true`})},t)})})}),(0,P.jsx)(`button`,{className:`dot-pager-arrow`,type:`button`,"aria-label":`Next page`,disabled:!p,onClick:()=>r?.(u+1),children:(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`>`})})]})}function ma({kicker:e,title:t,icon:n,action:r,children:i,className:a,...o}){return(0,P.jsxs)(`article`,{className:R(`panel`,a),...o,children:[(0,P.jsxs)(`header`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[n===void 0?null:(0,P.jsx)(ha,{icon:n}),(0,P.jsxs)(`div`,{children:[e===void 0?null:(0,P.jsx)(`p`,{className:`field-label`,children:e}),(0,P.jsx)(`h3`,{children:t})]})]}),r===void 0?null:(0,P.jsx)(`div`,{className:`panel-actions`,children:r})]}),i]})}function ha({icon:e,className:t,...n}){return(0,P.jsx)(`span`,{className:R(`icon-tile`,t),...n,children:e})}var ga=`modulepreload`,_a=function(e){return`/`+e},va={},ya=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_a(t,n),t in va)return;va[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ga,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ba,xa;function z(){if(ba===void 0)throw Error(`VexFlow has not been loaded`);return ba}function Sa(){return ba===void 0?(xa??=ya(()=>import(`./vexflow-bravura-DEW_BI-z.js`).then(async e=>(typeof document<`u`&&document.fonts!==void 0&&await Promise.allSettled([document.fonts.load(`30pt Bravura`),document.fonts.load(`30pt Academico`),document.fonts.load(`bold 30pt Academico`)]),e.VexFlow.setFonts(`Bravura`,`Academico`),ba=e,e)),[]).catch(e=>{throw xa=void 0,e}),xa):Promise.resolve(ba)}var Ca=12,wa=42,Ta=10,Ea=8,Da=30,Oa=18,ka=[`c`,`d`,`e`,`f`,`g`,`a`,`b`],Aa=30,ja={whole:`w`,half:`h`,quarter:`q`,eighth:`8`,sixteenth:`16`,"thirty-second":`32`},Ma={"double-flat":`bb`,flat:`b`,natural:`n`,sharp:`#`,"double-sharp":`##`},Na={[-2]:`bb`,[-1]:`b`,0:``,1:`#`,2:`##`},Pa={staccato:`a.`,tenuto:`a-`,accent:`a>`,marcato:`a^`,fermata:`a@a`},Fa=[`Cb`,`Gb`,`Db`,`Ab`,`Eb`,`Bb`,`F`,`C`,`G`,`D`,`A`,`E`,`B`,`F#`,`C#`];function Ia(e){return Math.max(-7,Math.min(7,Math.trunc(e??0)))}function La(e){return Fa[Ia(e)+7]??`C`}function Ra(e){return(e.openingBarline===void 0?0:Ca)+(e.openingClef===void 0?0:wa)+(e.keySignatureFifths===void 0?0:Ta+Math.abs(Ia(e.keySignatureFifths))*Ea)+(e.timeSignature===void 0?0:Da)}function za({units:e,edgePadding:t=20,horizontalSpacingScale:n=1,unitSpacing:r=52,openingClef:i,openingBarline:a,keySignatureFifths:o,timeSignature:s}){let c=Number.isFinite(n)&&n>0?n:1,l=e.reduce((e,t)=>e+(t.width??r)*c,0),u=Ra({openingClef:i,openingBarline:a,keySignatureFifths:o,timeSignature:s});return Math.max(t*2+u+r*c,t*2+u+l)}function Ba(e,t){return(e%t+t)%t}function Va(e){let t=Aa+Math.trunc(e.staffStep),n=ka[Ba(t,ka.length)]??`c`,r=Math.floor(t/ka.length);return`${n}${Na[e.alteration??0]}/${r}`}function Ha(e){if(e===`up`)return z().Stem.UP;if(e===`down`)return z().Stem.DOWN}function Ua(e,t){for(let n=0;n<(t??0);n+=1)z().Dot.buildAndAttach([e],{all:!0})}function Wa(e,t){e.addClass(`score-unit-mark`),e.setGroupStyle({fillStyle:`currentColor`,strokeStyle:`currentColor`}),e.setAttribute(`id`,`score-${t.replace(/[^a-zA-Z0-9_-]/gu,`-`)}-${e.getAttribute(`id`)}`)}function Ga(e,t){let n=Ha(e.stemDirection),r=new(z()).StaveNote({keys:e.pitches.map(Va),duration:ja[e.duration],dots:e.dots??0,autoStem:e.stemDirection===void 0||e.stemDirection===`auto`,clef:t,...n===void 0?{}:{stemDirection:n}});return Ua(r,e.dots),e.pitches.forEach((e,t)=>{e.displayAccidental!==void 0&&r.addModifier(new(z()).Accidental(Ma[e.displayAccidental]),t)}),e.articulations?.forEach(e=>{r.addModifier(new(z()).Articulation(Pa[e]).setPosition(z().Modifier.Position.ABOVE),0)}),r}function Ka(e,t){let n=new(z()).GraceNote({keys:e.pitches.map(Va),duration:ja[e.duration],dots:e.dots??0,clef:t,slash:!0});return Ua(n,e.dots),e.pitches.forEach((e,t)=>{e.displayAccidental!==void 0&&n.addModifier(new(z()).Accidental(Ma[e.displayAccidental]),t)}),n}function qa(e){return e===`double`?z().Barline.type.DOUBLE:e===`final`?z().Barline.type.END:e===`repeat-start`?z().Barline.type.REPEAT_BEGIN:e===`repeat-end`?z().Barline.type.REPEAT_END:z().Barline.type.SINGLE}function Ja(e,t){if(e.kind===`rest`){let n=new(z()).StaveNote({keys:[t===`bass`?`d/3`:`b/4`],duration:ja[e.duration],dots:e.dots??0,type:`r`,clef:t});return Ua(n,e.dots),n}return e.kind===`clef`?new(z()).ClefNote(e.clef,`small`):e.kind===`key-signature`?new(z()).KeySigNote(La(e.fifths)):e.kind===`time-signature`?new(z()).TimeSigNote(e.symbol===`common`?`C`:e.symbol===`cut`?`C|`:`${e.beats??4}/${e.beatType??4}`):e.kind===`dynamic`?new(z()).TextDynamics({duration:`q`,text:e.value,line:9}).setLine(9):e.kind===`text`?new(z()).TextNote({duration:`q`,text:e.text}).setLine(e.placement===`below`?9:-1):new(z()).GhostNote(`q`)}function Ya(e,t){let n=t;return e.map((e,t)=>{let r=[],i=[],a=[],o=[];if(e.symbols.forEach(e=>{if(e.kind===`note`&&e.grace===!0){let t=Ka(e,n);o.push(t),a.push(t);return}let t=e.kind===`note`?Ga(e,n):Ja(e,n);o.length>0&&t instanceof z().StaveNote&&(t.addModifier(new(z()).GraceNoteGroup(o,!1),0),o.length=0),r.push(t),a.push(t),t instanceof z().StaveNote&&!t.isRest()&&i.push(t),e.kind===`clef`&&(n=e.clef)}),r.length===0){let e=new(z()).GhostNote(`q`);r.push(e),a.push(e)}let s=[...r];if(e.barAfter!==void 0){let t=new(z()).BarNote(qa(e.barAfter));r.push(t),a.push(t)}return a.forEach(t=>Wa(t,e.id)),{unit:e,index:t,tickables:r,contentTickables:s,notes:i,elements:a}})}function Xa(e){return e===`double`?z().Barline.type.DOUBLE:e===`single`?z().Barline.type.SINGLE:z().Barline.type.NONE}function Za(e){return e===`final`?z().Barline.type.END:e===`bar`?z().Barline.type.SINGLE:z().Barline.type.NONE}function Qa(e){return e.notes[0]}function $a(e){let t=[],n=e.flatMap(e=>e.notes);return e.forEach(r=>{if(r.unit.beam===!0&&r.notes.length>1){let e=new(z()).Beam(r.notes,!0);Wa(e,r.unit.id),r.elements.push(e),t.push(e)}if(r.unit.tuplet!==void 0&&r.notes.length>1){let e=new(z()).Tuplet(r.notes,{numNotes:r.unit.tuplet,notesOccupied:2});Wa(e,r.unit.id),r.elements.push(e),t.push(e)}if(r.unit.slur===!0&&r.notes.length>1){let e=new(z()).Curve(r.notes[0],r.notes.at(-1),{position:z().Curve.Position.NEAR_TOP,positionEnd:z().Curve.Position.NEAR_TOP,openingDirection:`up`});Wa(e,r.unit.id),r.elements.push(e),t.push(e)}r.unit.symbols.forEach((e,i)=>{if(e.kind!==`note`||e.tieToNext!==!0)return;let a=r.unit.symbols.slice(0,i).filter(e=>e.kind===`note`&&e.grace!==!0).length,o=r.notes[a],s=o===void 0?-1:n.indexOf(o),c=s<0?void 0:n[s+1];if(o===void 0)return;let l=e.pitches.map((e,t)=>t),u=new(z()).StaveTie({firstNote:o,lastNote:c??null,firstIndexes:l,lastIndexes:l});Wa(u,r.unit.id),r.elements.push(u),t.push(u)}),r.unit.symbols.forEach(n=>{if(n.kind!==`hairpin`)return;let i=e.indexOf(r),a=Qa(e[Math.max(0,i-1)]??r),o=Qa(e[Math.min(e.length-1,i+1)]??r);if(a===void 0||o===void 0)return;let s=new(z()).StaveHairpin({firstNote:a,lastNote:o},n.direction===`crescendo`?z().StaveHairpin.type.CRESC:z().StaveHairpin.type.DECRESC).setPosition(z().Modifier.Position.BELOW).setRenderOptions({leftShiftPx:2,rightShiftPx:2,height:8,yShift:2});Wa(s,r.unit.id),r.elements.push(s),t.push(s)})}),t}function eo(e){return e.getSVGElement()}function to(e){e.forEach(e=>{e.elements.forEach(t=>{let n=eo(t);n!==void 0&&(n.classList.add(`score-unit-mark`),n.dataset.scoreUnitId=e.unit.id,n.dataset.scoreUnitIndex=String(e.index),n.style.setProperty(`--score-unit-index`,String(e.index)))})})}function no(e,t,n,r){let i=Math.max(r,t.getNoteStartX()-8),a=n-r,o=e.map(e=>{let t=e.tickables[0];return t===void 0?i:t.getAbsoluteX()});return e.map((e,t)=>{let n=o[t-1],r=o[t]??i,s=o[t+1],c=t===0?i:((n??r)+r)/2,l=s===void 0?a:(r+s)/2;return{unit:e,start:c,end:Math.max(c+12,l)}})}function ro(e,t,n,r,i,a,o){let s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);s.classList.add(`score-unit-hitboxes`),no(t,n,r,i).forEach(({unit:e,start:t,end:n})=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);r.classList.add(`score-unit-hitbox`),r.dataset.scoreUnitHitbox=``,r.dataset.scoreUnitId=e.unit.id,r.setAttribute(`x`,String(t)),r.setAttribute(`y`,`4`),r.setAttribute(`width`,String(n-t)),r.setAttribute(`height`,`104`),r.setAttribute(`rx`,`4`),a?(r.setAttribute(`role`,`button`),r.setAttribute(`tabindex`,`0`),r.setAttribute(`aria-label`,o?.(e.unit,e.index)??e.unit.label??`Score item ${e.index+1}`)):r.setAttribute(`aria-hidden`,`true`),s.append(r)}),e.append(s)}function io(e,t){e.querySelectorAll(`[data-score-unit-id]`).forEach(e=>{let n=t!==void 0&&e.dataset.scoreUnitId===t;e.classList.toggle(`is-current`,n),e.classList.toggle(`is-muted`,t!==void 0&&!n),e.matches(`[data-score-unit-hitbox]`)&&(n?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`))})}async function ao(e,t){if(await Sa(),t.signal?.aborted===!0)return t.width;e.replaceChildren();let n=new(z()).Renderer(e,z().Renderer.Backends.SVG);n.resize(t.width,112);let r=n.getContext(),i=e.querySelector(`svg`);if(i===null)return t.width;i.classList.add(`score-staff-svg`);let a=new(z()).Stave(t.edgePadding,0,t.width-t.edgePadding*2).setBegBarType(Xa(t.openingBarline)).setEndBarType(Za(t.ending));t.openingClef!==void 0&&a.addClef(t.openingClef),t.keySignatureFifths!==void 0&&a.addKeySignature(La(t.keySignatureFifths)),t.timeSignature!==void 0&&a.addTimeSignature(`${t.timeSignature[0]}/${t.timeSignature[1]}`),a.setStyle({strokeStyle:`var(--color-score-line)`,fillStyle:`currentColor`}),a.setDefaultLedgerLineStyle({strokeStyle:`currentColor`,lineWidth:2});let o=Ya(t.units,t.openingClef??`treble`),s=o.flatMap(e=>e.tickables),c=new(z()).Voice({numBeats:4,beatValue:4}).setMode(z().Voice.Mode.SOFT).addTickables(s).setStave(a);c.preFormat();let l=$a(o),u=o.flatMap(e=>e.contentTickables),d=u[0],f=u.at(-1),p=new(z()).Formatter().joinVoices([c]),m=Math.max(24,t.intrinsicWidth-a.getNoteStartX()-t.edgePadding),h=Math.max(m,p.preCalculateMinTotalWidth([c])),g=Math.max(t.width,Math.ceil(a.getNoteStartX()+h+t.edgePadding));g!==t.width&&(n.resize(g,112),a.setWidth(g-t.edgePadding*2)),p.format([c],h,{context:r,stave:a});let _=f?.getBoundingBox(),v=_===void 0?a.getNoteStartX():_.getX()+_.getW(),y=t.intrinsicWidth-t.edgePadding,b=d?.getBoundingBox();if(t.trimTrailingSpace&&b!==void 0&&v>b.getX()&&v+1<y){let e=b.getX(),t=(y-e)/(v-e);s.forEach(n=>{let r=n.getAbsoluteX();n.setXShift(n.getXShift()+(r-e)*(t-1))}),v=y}a.setContext(r).drawWithStyle(),c.draw(r,a),l.forEach(e=>e.setContext(r).draw());let x=Math.ceil(Math.max(a.getNoteStartX()+24,v)+Oa+t.edgePadding),S=t.trimTrailingSpace&&t.ending===`none`?Math.min(g,x):g;return n.resize(S,112),i.style.width=`100%`,i.style.height=`100%`,i.setAttribute(`viewBox`,`0 0 ${S} 112`),i.setAttribute(`preserveAspectRatio`,`xMinYMid meet`),to(o),ro(i,o,a,S,t.edgePadding,t.interactive,t.unitAriaLabel),S}function oo(e,t=20,n=52,r,i,a,o,s=1){return za({units:e,edgePadding:t,horizontalSpacingScale:s,unitSpacing:n,openingClef:r,openingBarline:i,keySignatureFifths:a,timeSignature:o})}function so(e){if(e instanceof Element)return e.closest(`[data-score-unit-hitbox]`)?.dataset.scoreUnitId}function co({units:e,activeUnitId:t,ending:n=`none`,edgePadding:r=20,horizontalSpacingScale:i=1,keySignatureFifths:a,minimumWidth:o=0,openingBarline:s,openingClef:c,reveal:l=!1,scale:u=1,trimTrailingSpace:d=!1,timeSignature:f,unitSpacing:p=52,onLayoutWidthChange:m,onUnitSelect:h,unitAriaLabel:g,className:_,style:v,onClick:y,onKeyDown:b,...x}){let S=(0,N.useRef)(null),C=(0,N.useRef)(t),w=(0,N.useRef)(m);C.current=t,w.current=m;let T=Number.isFinite(u)&&u>0?u:1,E=Number.isFinite(i)&&i>0?i:1,ee=oo(e,r,p,c,s,a,f,E),D=Math.max(ee,o/T),[O,k]=(0,N.useState)(D),te=O*T,ne=112*T,A=h!==void 0;return(0,N.useEffect)(()=>{let t=S.current;if(t===null)return;let i=new AbortController;return k(D),ao(t,{units:e,ending:n,edgePadding:r,intrinsicWidth:ee,width:D,trimTrailingSpace:d,openingBarline:s,openingClef:c,keySignatureFifths:a,timeSignature:f,interactive:A,unitAriaLabel:g,signal:i.signal}).then(e=>{i.signal.aborted||(k(e),w.current?.(e),io(t,C.current))}),()=>{i.abort(),t.replaceChildren()}},[r,n,A,ee,a,s,c,f,d,g,e,D]),(0,N.useEffect)(()=>{let e=S.current;e!==null&&io(e,t)},[t,e]),(0,P.jsx)(`div`,{className:R(`score-staff`,l&&`is-revealing`,_),"data-score-width":O,"data-score-scale":T,"data-score-horizontal-spacing-scale":E,onClick:e=>{if(y?.(e),e.defaultPrevented||h===void 0)return;let t=so(e.target);t!==void 0&&h(t)},onKeyDown:e=>{if(b?.(e),e.defaultPrevented||h===void 0||e.key!==`Enter`&&e.key!==` `)return;let t=so(e.target);t!==void 0&&(e.preventDefault(),h(t))},style:{width:te,height:ne,...v},...x,children:(0,P.jsx)(`div`,{className:`score-staff-engraving`,ref:S})})}var lo={andante:34,moderato:40,allegro:46},uo=82/112,fo=68/112,po=1/uo,B=1/fo,mo=320,ho=420,go=240,_o=640;function vo(e,t,n){return Math.min(n,Math.max(t,e))}function yo(e,t){return e===void 0||!Number.isFinite(e)||e<=0?lo[t]:vo(18+e*.3,30,60)}function bo(e,t,n,r,i,a){if(e.length===0)return 1;let o=e=>oo(e,0,void 0,n,r,i,a,po),s=o(e),c=o([...e,...e])-s;if(c<=0)return 1;let l=240*t/uo;return Math.max(1,1+Math.ceil((l-s)/c))}function xo(e,t){return Array.from({length:t},(t,n)=>e.map((t,r)=>{let{barAfter:i,...a}=t,o=r===e.length-1&&(i===`final`||i===`repeat-end`)?`single`:i;return{...a,id:`${t.id}:running-${n+1}`,...o===void 0?{}:{barAfter:o}}})).flat()}function So({units:e,state:t=`running`,tempo:n=`moderato`,playbackBpm:r,openingBarline:i=`double`,openingClef:a=`treble`,keySignatureFifths:o,timeSignature:s,label:c,className:l,style:u,...d}){let f=yo(r,n),p=(0,N.useMemo)(()=>bo(e,f,a,i,o,s),[o,i,a,f,s,e]),m=(0,N.useMemo)(()=>xo(e,p),[p,e]),h=oo(m,0,void 0,a,i,o,s,po)*uo,[g,_]=(0,N.useState)(h),v=Math.max(240,g/f),y=(0,N.useCallback)(e=>_(e*uo),[]);(0,N.useEffect)(()=>_(h),[h]);let b=e.slice(-Math.min(8,e.length)),x=e.length===0?mo:ho+go+_o,S={...u,"--score-loop-duration":`${v}s`,"--score-scroll-delay":`${x}ms`,"--score-note-reveal-delay":`${ho}ms`};return(0,P.jsx)(`div`,{className:R(`running-score`,`is-${t}`,`is-${n}`,l),role:`img`,"aria-label":c,"data-score-loop-repetitions":p,"data-score-loop-units":m.length,style:S,...d,children:t===`complete`?(0,P.jsx)(`div`,{className:`running-score-coda`,children:(0,P.jsx)(co,{units:b,edgePadding:0,ending:`final`,openingBarline:i,openingClef:a,horizontalSpacingScale:po,...o===void 0?{}:{keySignatureFifths:o},...s===void 0?{}:{timeSignature:s},scale:uo,trimTrailingSpace:!0,"aria-hidden":`true`})}):(0,P.jsxs)(`div`,{className:`running-score-track`,"aria-hidden":`true`,children:[(0,P.jsx)(co,{units:m,edgePadding:0,ending:`final`,openingBarline:i,openingClef:a,horizontalSpacingScale:po,...o===void 0?{}:{keySignatureFifths:o},...s===void 0?{}:{timeSignature:s},scale:uo,trimTrailingSpace:!0,onLayoutWidthChange:y,reveal:!0}),(0,P.jsx)(co,{units:m,edgePadding:0,ending:`final`,openingBarline:i,openingClef:a,horizontalSpacingScale:po,...o===void 0?{}:{keySignatureFifths:o},...s===void 0?{}:{timeSignature:s},scale:uo,trimTrailingSpace:!0,onLayoutWidthChange:y,reveal:!0})]})})}function Co({title:e=`Tutti is working on`,stageLabel:t,stageDetail:n,elapsedLabel:r,metrics:i,scoreLabel:a,units:o,state:s=`running`,tempo:c=`moderato`,playbackBpm:l,openingBarline:u=`double`,openingClef:d=`treble`,keySignatureFifths:f,timeSignature:p,showLoader:m=s===`running`||s===`handoff`,className:h,...g}){let _=s===`paused`,v=m||_;return(0,P.jsx)(ma,{title:e,icon:(0,P.jsx)(ra,{"aria-hidden":`true`}),className:R(`execution-progress-panel`,`execution-score-card`,`is-score-${s}`,h),...g,children:(0,P.jsxs)(`div`,{className:`execution-progress-body`,children:[(0,P.jsxs)(`div`,{className:R(`execution-progress-step`,`execution-score-stage`,`is-${s}`,m&&`has-loader`,v&&`has-marker`),children:[v?(0,P.jsx)(`span`,{className:R(`execution-progress-marker`,_?`is-pending`:`is-running`),"aria-hidden":`true`,children:_?(0,P.jsx)(na,{}):(0,P.jsx)(Mi,{})}):null,(0,P.jsxs)(`span`,{className:`execution-progress-step-content`,children:[(0,P.jsxs)(`span`,{className:`execution-progress-step-title`,children:[(0,P.jsx)(`span`,{className:`execution-progress-step-label`,children:t}),r===void 0?null:(0,P.jsxs)(`span`,{className:`execution-progress-step-elapsed`,children:[` (`,r,`)`]})]}),n===void 0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-detail`,children:n}),i===void 0||i.length===0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-metrics`,children:i.map(e=>(0,P.jsx)(`span`,{className:`execution-progress-step-metric`,children:e},e))})]})]}),(0,P.jsx)(So,{units:o,state:s,tempo:c,...l===void 0?{}:{playbackBpm:l},openingBarline:u,openingClef:d,...f===void 0?{}:{keySignatureFifths:f},...p===void 0?{}:{timeSignature:p},label:a,className:`execution-score-staff`})]})})}var wo={schemaVersion:3,id:`auld-lang-syne`,shortName:`Auld Lang Syne`,composer:`Traditional`,work:`Auld Lang Syne`,movement:`Traditional melody`,tempo:88,meter:[2,4],clef:`treble`,keySignatureFifths:3,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1121`,url:`https://www.mutopiaproject.org/ftp/HoretzkyF/horetzky31/horetzky31.mid`,format:`MIDI`,downloadSha256:`7451d7be42ee52f15ba8b8c9651bcb8fdd2a759531c6297b875e9a65581afb19`,retrievedOn:`2026-07-31`,sourceFile:`horetzky31.mid`,part:`upper guitar melody (track 1)`,selection:`beats 0–128`,transposeSemitones:-5},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`A5`}],duration:`eighth`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`,dots:1}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`,dots:1}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`A5`}],duration:`eighth`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`,dots:1}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]}]},To={schemaVersion:3,id:`bach-air`,shortName:`Bach Air`,composer:`Johann Sebastian Bach`,work:`Orchestral Suite No. 3 in D major, BWV 1068`,movement:`II. Air`,tempo:56,meter:[4,4],clef:`treble`,keySignatureFifths:3,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1534`,url:`https://www.mutopiaproject.org/ftp/BachJS/BWV1068/bach_air_bmv_1068/bach_air_bmv_1068.mid`,format:`MIDI`,downloadSha256:`5f7763dd4d29f309cac6d670c22aa029aca23c8c97743a0511d4b9c6d3435f1c`,retrievedOn:`2026-07-31`,sourceFile:`bach_air_bmv_1068.mid`,part:`flute melody (flute)`,selection:`beats 0–128`,transposeSemitones:-5},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`whole`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`half`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:3,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A#4`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0},{measure:4,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0},{measure:4,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`,dots:1}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`F4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`,dots:1}],beam:!0},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0},{measure:10,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`,displayAccidental:`sharp`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:14,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`,dots:1}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:16,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G5`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`sixteenth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}]}]},Eo={schemaVersion:3,id:`beethoven-7-allegretto`,shortName:`Beethoven No. 7`,composer:`Ludwig van Beethoven`,work:`Symphony No. 7 in A major, Op. 92`,movement:`II. Allegretto`,tempo:76,meter:[2,4],clef:`treble`,keySignatureFifths:-1,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=595`,url:`https://www.mutopiaproject.org/ftp/BeethovenLv/O92/Symphony7_2/Symphony7_2.mid`,format:`MIDI`,downloadSha256:`7cf810b4625b9a272d3a0a9153d8beb5750fa3ee64122dc9f27b7661e997b903`,retrievedOn:`2026-07-31`,sourceFile:`Symphony7_2.mid`,part:`upper wind / track six (six)`,selection:`beats 128–384`,transposeSemitones:-7},units:[{measure:65,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:75,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:75,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:76,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:76,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:77,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:77,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:78,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:78,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:79,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:79,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:80,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}],barAfter:`single`},{measure:81,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:82,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:82,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:83,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:83,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:85,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:85,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:86,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:86,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:87,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:87,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:88,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:88,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:89,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:89,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:90,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:90,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:91,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:91,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:93,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:93,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:94,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:94,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:95,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:95,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:96,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:96,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:97,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:97,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:98,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:98,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:110,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`whole`}],barAfter:`single`},{measure:115,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:140,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`}]},{measure:140,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:142,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`}]},{measure:142,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:149,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0},{measure:149,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:174,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:174,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:175,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:176,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:176,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:177,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:178,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:178,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:178,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:179,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:179,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:179,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:180,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:180,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:180,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:181,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:181,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:182,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:182,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:183,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0}]},Do={schemaVersion:3,id:`beethoven-ode-to-joy`,shortName:`Ode to Joy`,composer:`Ludwig van Beethoven`,work:`Symphony No. 9 in D minor, Op. 125`,movement:`IV. Ode to Joy`,tempo:96,meter:[4,4],clef:`treble`,keySignatureFifths:1,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=528`,url:`https://www.mutopiaproject.org/ftp/BeethovenLv/ode/ode.mid`,format:`MIDI`,downloadSha256:`fb1604c08c865b275b464d74e5a7c526ff1a8acccdf9853cb92f0778daaed14b`,retrievedOn:`2026-07-31`,sourceFile:`ode.mid`,part:`soprano melody (upper)`,selection:`beats 0–128`,transposeSemitones:0},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`half`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`half`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`half`}]}]},Oo={schemaVersion:3,id:`brahms-wiegenlied`,shortName:`Brahms Wiegenlied`,composer:`Johannes Brahms`,work:`5 Lieder, Op. 49`,movement:`No. 4. Wiegenlied`,tempo:76,meter:[3,4],clef:`treble`,keySignatureFifths:-3,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/5701612`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Brahms,_Johannes/5_Lieder,_Op.49/4_Wiegenlied/lc5701612.mxl`,format:`MusicXML`,downloadSha256:`5867b883ba1d159f234a3764a0f3f467afdd78cf6ee4698bca17d52d3a4f65db`,retrievedOn:`2026-07-31`,sourceFile:`lc5701612.mxl`,part:`voice / P1 (Singstimme)`,selection:`measures 1–24`,transposeSemitones:0},units:[{measure:2,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:4,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`half`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`half`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`,grace:!0}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`half`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`half`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`half`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`,grace:!0}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`half`}]}]},ko={schemaVersion:3,id:`greensleeves`,shortName:`Greensleeves`,composer:`Traditional`,work:`Greensleeves`,movement:`Traditional melody`,tempo:84,meter:[6,8],clef:`treble`,keySignatureFifths:-4,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1247`,url:`https://www.mutopiaproject.org/ftp/Traditional/greensleeves/greensleeves.mid`,format:`MIDI`,downloadSha256:`04a6e03dd6128aa291aa75e4df757bbba40567ef885eca18d14d51d9365cb8e8`,retrievedOn:`2026-07-31`,sourceFile:`greensleeves.mid`,part:`soprano melody (upper:one)`,selection:`beats 0–128`,transposeSemitones:1},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Db5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`C4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Db5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:9,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D5`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`C4`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Db5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D4`,displayAccidental:`natural`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`,displayAccidental:`natural`}],duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]}]},Ao={schemaVersion:3,id:`petzold-minuet-in-g`,shortName:`Minuet in G`,composer:`Christian Petzold`,work:`Minuet in G major, BWV Anh. 114`,movement:`Menuet`,tempo:100,meter:[3,4],clef:`treble`,keySignatureFifths:-1,source:{provider:`Mutopia Project`,license:`Public Domain`,landingPageUrl:`https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=258`,url:`https://www.mutopiaproject.org/ftp/BachJS/BWVAnh114/Minuet-xpose/Minuet-xpose.mid`,format:`MIDI`,downloadSha256:`4199c2f47ca19389f89902385acfea4237f4e58d850b2ee698af2dc8e86e8557`,retrievedOn:`2026-07-31`,sourceFile:`Minuet-xpose.mid`,part:`upper trumpet melody (staffA:)`,selection:`beats 0–128`,transposeSemitones:-2},units:[{measure:1,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:1,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:1,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:2,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:2,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0},{measure:3,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`half`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A5`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A5`}],duration:`eighth`}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F5`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`quarter`}]},{measure:20,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0},{measure:20,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`eighth`}],beam:!0},{measure:21,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`quarter`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`half`,dots:1}],barAfter:`single`},{measure:25,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:25,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:25,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:26,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:26,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:26,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}],barAfter:`single`},{measure:27,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:27,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:27,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:28,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:28,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}]},{measure:28,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:29,symbols:[{kind:`note`,pitches:[{name:`C4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:29,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:30,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`quarter`}],barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],beam:!0},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`}]},{measure:31,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}],barAfter:`single`},{measure:32,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`,dots:1}]}]},jo={schemaVersion:3,id:`schubert-an-die-musik`,shortName:`An die Musik`,composer:`Franz Schubert`,work:`An die Musik, D. 547`,movement:`An die Musik`,tempo:76,meter:[2,2],clef:`treble`,keySignatureFifths:2,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/6180725`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/_/An_die_Musik,_D.547/lc6180725.mxl`,format:`MusicXML`,downloadSha256:`4c7b0331cb2785ccbd0779be5396bb2faafef2e8a47f8e0aec96e0cb8ccd4984`,retrievedOn:`2026-07-31`,sourceFile:`lc6180725.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–19`,transposeSemitones:0},units:[{measure:3,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:3,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}],barAfter:`single`},{measure:4,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`,dots:1}]},{measure:4,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:5,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`sixteenth`,grace:!0}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`,dots:1}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`rest`,duration:`half`}],barAfter:`single`},{measure:7,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`C#4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`C#4`}],duration:`eighth`}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`quarter`,dots:1}]},{measure:8,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],beam:!0},{measure:9,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`}],barAfter:`single`},{measure:10,symbols:[{kind:`rest`,duration:`whole`}],barAfter:`single`},{measure:11,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`,dots:1}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`,grace:!0}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`,dots:1}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`,grace:!0}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`}]},{measure:17,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`C#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`half`}]}]},Mo={schemaVersion:3,id:`schubert-der-lindenbaum`,shortName:`Der Lindenbaum`,composer:`Franz Schubert`,work:`Winterreise, D. 911`,movement:`No. 5. Der Lindenbaum`,tempo:80,meter:[3,4],clef:`treble`,keySignatureFifths:4,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/5016466`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/Winterreise,_D.911/5_Der_Lindenbaum/lc5016466.mxl`,format:`MusicXML`,downloadSha256:`f4312876fee5664a805aeace05621015c4be0143055bd3b58f348d039420452e`,retrievedOn:`2026-07-31`,sourceFile:`lc5016466.mxl`,part:`voice / P1 (Singstimme)`,selection:`measures 1–38`,transposeSemitones:0},units:[{measure:8,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:12,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`}],beam:!0},{measure:15,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:16,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`half`}]},{measure:20,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:20,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:21,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:22,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:22,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:23,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:24,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:25,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:26,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:28,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:28,symbols:[{kind:`rest`,duration:`quarter`}]},{measure:28,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:28,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:29,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:29,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:30,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:30,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:30,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:31,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:32,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:32,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:32,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:33,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:33,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:34,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`quarter`}]},{measure:34,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`quarter`}]},{measure:34,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:34,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:35,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:35,symbols:[{kind:`note`,pitches:[{name:`G4`,displayAccidental:`natural`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:35,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],barAfter:`single`},{measure:36,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`half`}]},{measure:36,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:36,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`quarter`}]},{measure:37,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F#4`}],duration:`eighth`}],beam:!0,barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:38,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:38,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:38,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}]}]},No={schemaVersion:3,id:`schubert-du-bist-die-ruh`,shortName:`Du bist die Ruh`,composer:`Franz Schubert`,work:`Du bist die Ruh, D. 776`,movement:`Du bist die Ruh`,tempo:60,meter:[3,8],clef:`treble`,keySignatureFifths:-3,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/4919879`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/Op.59/3_Du_bist_die_Ruh/lc4919879.mxl`,format:`MusicXML`,downloadSha256:`65ee78acb0a26b246e4f81d6d192b83dabc9440dbe6f08512fab521d84855150`,retrievedOn:`2026-07-31`,sourceFile:`lc4919879.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–50`,transposeSemitones:0},units:[{measure:8,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:10,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:14,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:21,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:22,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`}],beam:!0},{measure:24,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:25,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:25,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}],barAfter:`single`},{measure:26,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:28,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:29,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:30,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:32,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:32,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:33,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:33,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:34,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:35,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:36,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:36,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:37,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:39,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:40,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:40,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:41,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:41,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:42,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:43,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:44,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`}]},{measure:44,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:45,symbols:[{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`}],beam:!0},{measure:45,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Eb5`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`D5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:46,symbols:[{kind:`note`,pitches:[{name:`Eb5`}],duration:`quarter`}]},{measure:46,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:47,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Ab4`}],duration:`sixteenth`}],beam:!0},{measure:47,symbols:[{kind:`note`,pitches:[{name:`A4`,displayAccidental:`natural`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:48,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`}]},{measure:48,symbols:[{kind:`note`,pitches:[{name:`Eb4`}],duration:`eighth`}]}]},Po={schemaVersion:3,id:`schubert-standchen`,shortName:`Schubert Ständchen`,composer:`Franz Schubert`,work:`Schwanengesang, D. 957`,movement:`No. 4. Ständchen`,tempo:72,meter:[3,4],clef:`treble`,keySignatureFifths:-1,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/5004835`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schubert,_Franz/Schwanengesang,_D.957/4_St%C3%A4ndchen/lc5004835.mxl`,format:`MusicXML`,downloadSha256:`11f8bd4edfd11dc303d4b46d480cf110cb7015af303abf0d3848c40984c202a1`,retrievedOn:`2026-07-31`,sourceFile:`lc5004835.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–38`,transposeSemitones:0},units:[{measure:5,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:5,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:5,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],barAfter:`single`},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:6,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`}]},{measure:6,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}]},{measure:6,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`quarter`,dots:1}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`F4`}],duration:`eighth`}],beam:!0},{measure:7,symbols:[{kind:`note`,pitches:[{name:`E4`}],duration:`eighth`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`}]},{measure:8,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:9,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:10,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:11,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`,dots:1}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:12,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`,dots:1}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`}],barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`C5`}],duration:`quarter`,dots:1}]},{measure:13,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`}],beam:!0},{measure:13,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:14,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`}]},{measure:14,symbols:[{kind:`rest`,duration:`quarter`}],barAfter:`single`},{measure:15,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:16,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`sixteenth`}],beam:!0},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`,dots:1}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:18,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`quarter`,dots:1}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`C5`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`},{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],beam:!0},{measure:19,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:21,symbols:[{kind:`note`,pitches:[{name:`F#4`,displayAccidental:`sharp`}],duration:`eighth`},{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],beam:!0},{measure:21,symbols:[{kind:`note`,pitches:[{name:`Bb4`}],duration:`quarter`,dots:1}]},{measure:21,symbols:[{kind:`note`,pitches:[{name:`G4`}],duration:`eighth`}],barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`F4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:23,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`sixteenth`}],beam:!0},{measure:23,symbols:[{kind:`note`,pitches:[{name:`F5`}],duration:`quarter`,dots:1}]},{measure:23,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],barAfter:`single`},{measure:24,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`}],beam:!0},{measure:24,symbols:[{kind:`note`,pitches:[{name:`F#4`,displayAccidental:`sharp`}],duration:`quarter`,dots:1}]},{measure:24,symbols:[{kind:`note`,pitches:[{name:`D4`}],duration:`eighth`}],barAfter:`single`},{measure:25,symbols:[{kind:`note`,pitches:[{name:`B4`,displayAccidental:`natural`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`sixteenth`,grace:!0},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0},{measure:25,symbols:[{kind:`note`,pitches:[{name:`A#4`,displayAccidental:`sharp`}],duration:`eighth`},{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],beam:!0},{measure:25,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`quarter`,dots:1}]},{measure:25,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:26,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`half`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`D#5`,displayAccidental:`sharp`}],duration:`eighth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`}],beam:!0},{measure:27,symbols:[{kind:`note`,pitches:[{name:`G5`}],duration:`quarter`,dots:1}]},{measure:27,symbols:[{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`eighth`}],barAfter:`single`},{measure:28,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`,dots:1}],barAfter:`single`},{measure:29,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:30,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:31,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:32,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:33,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:34,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:35,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:36,symbols:[{kind:`rest`,duration:`half`,dots:1}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`D5`}],duration:`half`,dots:1}],barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`A4`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`A4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`C#5`,displayAccidental:`sharp`}],duration:`eighth`,dots:1}],beam:!0},{measure:38,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E5`}],duration:`eighth`,dots:1},{kind:`note`,pitches:[{name:`E5`}],duration:`sixteenth`}],beam:!0}]},Fo={schemaVersion:3,id:`schumann-mondnacht`,shortName:`Schumann Mondnacht`,composer:`Robert Schumann`,work:`Liederkreis, Op. 39`,movement:`No. 5. Mondnacht`,tempo:60,meter:[3,8],clef:`treble`,keySignatureFifths:4,source:{provider:`OpenScore Lieder Corpus`,license:`CC0 1.0`,landingPageUrl:`https://musescore.com/openscore-lieder-corpus/scores/4987640`,url:`https://raw.githubusercontent.com/OpenScore/Lieder/main/scores/Schumann,_Robert/Liederkreis,_Op.39/5_Mondnacht/lc4987640.mxl`,format:`MusicXML`,downloadSha256:`05454fafdddaa39171e96fac68b27dcaab49e8221a2ab25f0163245b60fc83ba`,retrievedOn:`2026-07-31`,sourceFile:`lc4987640.mxl`,part:`voice / P1 (Voice)`,selection:`measures 1–45`,transposeSemitones:0},units:[{measure:6,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:7,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:7,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:8,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:8,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:9,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:9,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:10,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:10,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:10,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:11,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:11,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:12,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:12,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:13,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:14,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],beam:!0},{measure:15,symbols:[{kind:`rest`,duration:`sixteenth`}]},{measure:15,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`}],barAfter:`single`},{measure:16,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:16,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:17,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:17,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:18,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:18,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:18,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:19,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:19,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:20,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:20,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:21,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:22,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:22,symbols:[{kind:`rest`,duration:`eighth`}],barAfter:`single`},{measure:23,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:24,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:25,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:26,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:27,symbols:[{kind:`rest`,duration:`quarter`,dots:1}],barAfter:`single`},{measure:28,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:28,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:28,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:29,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:29,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:30,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:30,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:31,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:31,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:32,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:32,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:32,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:33,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:33,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:34,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:34,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:35,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:36,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:36,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:36,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:37,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`quarter`}]},{measure:37,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`}],barAfter:`single`},{measure:38,symbols:[{kind:`note`,pitches:[{name:`C#5`}],duration:`eighth`},{kind:`note`,pitches:[{name:`C#5`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`D#5`}],duration:`sixteenth`}],beam:!0},{measure:38,symbols:[{kind:`note`,pitches:[{name:`E#5`,displayAccidental:`sharp`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`F#5`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:39,symbols:[{kind:`note`,pitches:[{name:`F#5`}],duration:`quarter`}]},{measure:39,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:40,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:40,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:40,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:41,symbols:[{kind:`note`,pitches:[{name:`E5`}],duration:`quarter`}]},{measure:41,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:42,symbols:[{kind:`note`,pitches:[{name:`G#4`}],duration:`quarter`}]},{measure:42,symbols:[{kind:`note`,pitches:[{name:`F#4`}],duration:`sixteenth`},{kind:`note`,pitches:[{name:`E4`}],duration:`sixteenth`}],beam:!0,barAfter:`single`},{measure:43,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`,dots:1}],barAfter:`single`},{measure:44,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:44,symbols:[{kind:`rest`,duration:`eighth`}]},{measure:44,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}],barAfter:`single`},{measure:45,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`quarter`}]},{measure:45,symbols:[{kind:`note`,pitches:[{name:`B4`}],duration:`eighth`}]}]},Io={C:0,D:1,E:2,F:3,G:4,A:5,B:6},Lo=30;function Ro(e){let t=/^([A-G])(bb|##|#|b|n)?(\d)$/u.exec(e.name);if(t===null)throw Error(`Unsupported score pitch: ${e.name}`);let n=t[1]??`C`,r=t[2]??``,i=Number(t[3]??`4`),a=r===`bb`?`double-flat`:r===`b`?`flat`:r===`n`?`natural`:r===`#`?`sharp`:r===`##`?`double-sharp`:void 0;return{staffStep:i*7+(Io[n]??0)-Lo,alteration:a===`double-flat`?-2:a===`flat`?-1:a===`sharp`?1:a===`double-sharp`?2:0,...e.displayAccidental===void 0?{}:{displayAccidental:e.displayAccidental}}}function zo(e){return e.kind===`rest`?{kind:`rest`,duration:e.duration,...e.dots===void 0?{}:{dots:e.dots}}:{kind:`note`,pitches:e.pitches.map(Ro),duration:e.duration,...e.dots===void 0?{}:{dots:e.dots},...e.grace===void 0?{}:{grace:e.grace}}}function Bo(e){if(e.schemaVersion!==3)throw Error(`Unsupported score source schema: ${String(e.schemaVersion)}`);return{id:e.id,shortName:e.shortName,composer:e.composer,work:e.work,movement:e.movement,tempo:e.tempo,meter:e.meter,clef:e.clef,keySignatureFifths:e.keySignatureFifths,source:e.source,units:e.units.map((t,n)=>({id:`${e.id}:${n+1}`,symbols:t.symbols.map(zo),width:Math.max(40,18+t.symbols.length*14),label:`Measure ${t.measure}, phrase ${n+1}`,...t.beam===void 0?{}:{beam:t.beam},...t.barAfter===void 0?{}:{barAfter:t.barAfter}}))}}var Vo=[Do,Oo,Ao,Po,jo,Mo,No,Fo,Eo,ko,wo,To].map(Bo);function Ho(e){let t=Vo.find(t=>t.id===e);if(t===void 0)throw Error(`Unknown score theme: ${e}`);return t}[...[`whole`,`half`,`quarter`,`eighth`,`sixteenth`,`thirty-second`].map((e,t)=>({id:`rhythm:rest:${e}`,symbols:[{kind:`rest`,duration:e,...t===3?{dots:1}:{}}],...e===`thirty-second`?{barAfter:`final`}:{}}))],[`staccato`,`tenuto`,`accent`,`marcato`,`fermata`].map((e,t)=>({kind:`note`,pitches:[{staffStep:2+t%3*2}],duration:`quarter`,articulations:[e]}));function Uo({backgroundImageSrc:e,backgroundPattern:t,children:n,className:r,...i}){return(0,P.jsxs)(`main`,{className:R(`product-page`,t===`dots`&&`has-dot-background`,r),...i,children:[e===void 0?null:(0,P.jsx)(`img`,{alt:``,"aria-hidden":`true`,className:`product-page-decor`,decoding:`async`,draggable:!1,src:e}),n]})}function Wo({brand:e,actions:t,className:n,...r}){return(0,P.jsxs)(`div`,{className:R(`product-appbar`,n),...r,children:[e,t===void 0?null:(0,P.jsx)(`div`,{className:`product-appbar-actions`,children:t})]})}function Go({children:e,className:t,...n}){return(0,P.jsx)(`section`,{className:R(`product-shell`,t),...n,children:e})}function Ko({children:e,className:t,...n}){return(0,P.jsx)(`section`,{className:R(`auth-shell`,t),...n,children:e})}function qo({children:e,className:t,...n}){return(0,P.jsx)(`main`,{className:R(`workspace-page`,t),...n,children:e})}function Jo({sidebar:e,children:t,className:n,...r}){return(0,P.jsxs)(`div`,{className:R(`workspace-shell`,n),...r,children:[e,(0,P.jsx)(`section`,{className:`workspace-main`,children:t})]})}function Yo({label:e,imageUrl:t,initials:n,icon:r,tone:i=`neutral`,online:a=!1,plain:o=!1,count:s,className:c,...l}){let[u,d]=(0,N.useState)(!1),f=s===void 0?void 0:`+${s}`,p=t!==void 0&&!u;return(0,N.useEffect)(()=>{d(!1)},[t]),(0,P.jsx)(`span`,{"aria-label":e,title:l.title??e,className:R(`avatar`,o?`avatar-tone-plain`:`avatar-tone-${i}`,a?`is-online`:void 0,s===void 0?void 0:`is-count`,c),...l,children:f??(p?(0,P.jsx)(`img`,{className:`avatar-image`,src:t,alt:``,referrerPolicy:`no-referrer`,onError:()=>{d(!0)}}):r??(0,P.jsx)(`span`,{className:`avatar-initials`,children:n??`?`}))})}function Xo({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`avatar-stack`,t),...n,children:e})}var Zo=Object.defineProperty,Qo=(e,t)=>Zo(e,`name`,{value:t,configurable:!0});function $o(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qo($o,`setRef`);function es(...e){return t=>{let n=!1,r=e.map(e=>{let r=$o(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():$o(e[t],null)}}}}Qo(es,`composeRefs`);function ts(...e){return N.useCallback(es(...e),e)}Qo(ts,`useComposedRefs`);var ns=Object.defineProperty,rs=(e,t)=>ns(e,`name`,{value:t,configurable:!0});function is(e){let t=N.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ps(r)&&typeof _s==`function`&&(r=_s(r._payload)),N.Children.forEach(r,e=>{if(ds(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ps(n)&&typeof _s==`function`&&(n=_s(n._payload)),a=cs(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=N.cloneElement(a,void 0,s):!o&&N.Children.count(r)===1&&N.isValidElement(r)&&(a=r);let c=a?us(a):void 0,l=ts(n,c);if(!a){if(r||r===0)throw Error(o?gs(e):hs(e));return r}let u=ls(i,a.props??{});return a.type!==N.Fragment&&(u.ref=n?l:c),N.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}rs(is,`createSlot`);var as=is(`Slot`),os=Symbol.for(`radix.slottable`);function ss(e){let t=rs(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=os,t}rs(ss,`createSlottable`);var cs=rs((e,t)=>{if(`child`in e.props){let t=e.props.child;return N.isValidElement(t)?N.cloneElement(t,void 0,e.props.children(t.props.children)):null}return N.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function ls(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}}rs(ls,`mergeProps`);function us(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)}rs(us,`getElementRef`);function ds(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===os}rs(ds,`isSlottable`);var fs=Symbol.for(`react.lazy`);function ps(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===fs&&`_payload`in e&&ms(e._payload)}rs(ps,`isLazyComponent`);function ms(e){return typeof e==`object`&&!!e&&`then`in e}rs(ms,`isPromiseLike`);var hs=rs(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),gs=rs(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),_s=N.use,vs={action:`action-button`,quiet:`quiet-button`,pill:`pill-action`,icon:`quiet-button icon-button`};function ys({variant:e=`quiet`,asChild:t=!1,className:n,children:r,...i}){return(0,P.jsx)(t?as:`button`,{className:R(vs[e],n),...i,children:r})}function bs({label:e,icon:t,className:n,...r}){return(0,P.jsx)(ys,{...r,"aria-label":e,title:r.title??e,variant:`icon`,className:n,children:t})}function xs(e){return(0,P.jsx)(ys,{...e,variant:`action`})}function Ss(e){return(0,P.jsx)(ys,{...e,variant:`quiet`})}function Cs({tone:e=`neutral`,className:t,children:n,...r}){return(0,P.jsx)(`span`,{className:R(`scope-chip`,`is-${e}`,t),...r,children:n})}var ws={todo:`neutral`,running:`sync`,pending:`warning`,done:`success`,failed:`error`};function Ts({status:e,children:t,className:n,...r}){return(0,P.jsx)(Cs,{tone:ws[e],className:R(`task-tag`,`is-${e}`,n),...r,children:t})}function Es({children:e,content:t,contentId:n,disabledTrigger:r=!1,side:i=`top`,className:a,tabIndex:o,...s}){let c=(0,N.useId)(),l=n??c,u=e.props[`aria-describedby`],d=u===void 0?l:`${u} ${l}`;return(0,P.jsxs)(`span`,{className:R(`tooltip-trigger`,`is-${i}`,a),tabIndex:r?o??0:o,...r?{"aria-describedby":l}:{},...s,children:[(0,N.cloneElement)(e,{"aria-describedby":d}),(0,P.jsx)(`span`,{className:`tooltip-content`,id:l,role:`tooltip`,children:t})]})}function Ds({src:e,label:t=`Tutti`,className:n,...r}){return(0,P.jsx)(`span`,{"aria-label":t,className:R(`brand-logo`,n),role:r.role??`img`,...r,children:(0,P.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`})})}function Os({logo:e,label:t=`Tutti Project Center`,className:n,...r}){return(0,P.jsx)(`button`,{...r,"aria-label":t,className:R(`tutti-brand`,n),type:r.type??`button`,children:e})}function ks({className:e,...t}){return(0,P.jsx)(`input`,{className:R(`input-shell`,e),...t})}function As({className:e,...t}){return(0,P.jsx)(`textarea`,{className:R(`input-shell`,`textarea-shell`,e),...t})}function js({value:e,options:t,onValueChange:n,maxVisibleOptions:r=8,defaultOpen:i=!1,className:a,onBlur:o,onClick:s,onFocus:c,onKeyDown:l,...u}){let d=(0,N.useId)(),f=(0,N.useRef)(null),[p,m]=(0,N.useState)(i),[h,g]=(0,N.useState)(-1),_=e.trim().toLocaleLowerCase(),v=(0,N.useMemo)(()=>_===``||t.some(e=>e.toLocaleLowerCase()===_)?[...t]:t.filter(e=>e.toLocaleLowerCase().includes(_)),[_,t]),y=p&&v.length>0,b=Math.min(10,Math.max(1,Math.floor(r))),x=h<0?void 0:v[h];(0,N.useEffect)(()=>{if(v.length===0){g(-1);return}g(e=>Math.min(Math.max(e,0),v.length-1))},[v.length]),(0,N.useEffect)(()=>{!y||h<0||document.getElementById(`${d}-${h}`)?.scrollIntoView({block:`nearest`})},[h,d,y]);function S(e){n(e),m(!1),g(-1)}function C(e){if(l?.(e),!e.defaultPrevented)switch(e.key){case`ArrowDown`:e.preventDefault(),m(!0),g(e=>v.length===0?-1:Math.min(e+1,v.length-1));break;case`ArrowUp`:e.preventDefault(),m(!0),g(e=>v.length===0?-1:e<=0?v.length-1:e-1);break;case`Enter`:y&&x!==void 0&&(e.preventDefault(),S(x));break;case`Escape`:y&&(e.preventDefault(),e.stopPropagation(),m(!1),g(-1));break;case`Tab`:m(!1),g(-1);break}}return(0,P.jsxs)(`span`,{className:`combobox-shell`,ref:f,style:{"--combobox-visible-options":b},children:[(0,P.jsx)(ks,{...u,"aria-activedescendant":y&&h>=0?`${d}-${h}`:void 0,"aria-autocomplete":`list`,"aria-controls":d,"aria-expanded":y,className:R(`combobox-input`,a),role:`combobox`,value:e,onBlur:e=>{o?.(e),f.current?.contains(e.relatedTarget)||(m(!1),g(-1))},onChange:e=>{n(e.target.value),m(!0),g(0)},onClick:e=>{s?.(e),m(!0),g(0)},onFocus:e=>{c?.(e),m(!0),g(0)},onKeyDown:C}),y?(0,P.jsx)(`span`,{className:`combobox-listbox`,id:d,role:`listbox`,children:v.map((t,n)=>(0,P.jsx)(`span`,{"aria-selected":t===e,className:R(`combobox-option`,n===h?`is-active`:void 0),id:`${d}-${n}`,role:`option`,onClick:e=>{e.preventDefault(),S(t)},onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>g(n),children:t},t))}):null]})}function Ms({children:e,className:t,...n}){return(0,P.jsx)(`span`,{className:R(`field-label`,t),...n,children:e})}function Ns({label:e,children:t,className:n,...r}){return(0,P.jsxs)(`label`,{className:R(`form-field`,n),...r,children:[(0,P.jsx)(Ms,{children:e}),t]})}function Ps({tone:e=`error`,className:t,role:n,...r}){return(0,P.jsx)(`p`,{className:R(e===`error`?`form-error`:`form-note`,t),role:n??(e===`error`?`alert`:void 0),...r})}function Fs({icon:e,className:t,children:n,rel:r=`noopener noreferrer`,target:i=`_blank`,...a}){return(0,P.jsxs)(`a`,{className:R(`inline-help-link`,t),rel:r,target:i,...a,children:[(0,P.jsx)(`span`,{children:n}),e]})}function Is({brand:e,children:t,status:n,footer:r,mobileTitle:i,mobileMeta:a,mobileAction:o,className:s,...c}){return(0,P.jsxs)(`aside`,{className:R(`sidebar`,s),"aria-label":`Workspace navigation`,...c,children:[(0,P.jsx)(`div`,{className:`workspace-logo`,children:e}),i===void 0&&a===void 0?null:(0,P.jsxs)(`div`,{className:`workspace-mobile-context`,children:[i===void 0?null:(0,P.jsx)(`strong`,{children:i}),a===void 0?null:(0,P.jsx)(`span`,{children:a})]}),n===void 0?null:(0,P.jsx)(`nav`,{className:`sidebar-status-group`,"aria-label":`Status shortcuts`,children:n}),o===void 0?null:(0,P.jsx)(`div`,{className:`workspace-mobile-action`,children:o}),(0,P.jsx)(`nav`,{className:`sidebar-nav sidebar-primary-group`,"aria-label":`Pages`,children:t}),r===void 0?null:(0,P.jsx)(`nav`,{className:`sidebar-footer`,"aria-label":`Workspace utilities`,children:r})]})}function Ls({icon:e,label:t,className:n,...r}){return(0,P.jsx)(Es,{content:t,"data-label":t,side:`right`,children:(0,P.jsx)(`a`,{...r,"aria-label":t,"data-label":t,className:R(`sidebar-button`,n),children:e})})}function Rs({icon:e,label:t,active:n=!1,badge:r=!1,className:i,...a}){let o=typeof r==`object`?r:void 0,s=o?.label??`Unread updates`,c=o?.variant??`dot`,l=r===!1?t:`${t}, ${s}`;return(0,P.jsx)(Es,{content:t,"data-label":t,disabledTrigger:a.disabled===!0,side:`right`,children:(0,P.jsxs)(`button`,{...a,"aria-label":l,"data-label":t,className:R(`sidebar-button`,n?`is-active`:void 0,i),type:a.type??`button`,children:[e,r===!1?null:(0,P.jsx)(`span`,{className:R(`sidebar-button-badge`,c===`pill`?`is-pill`:void 0),"aria-hidden":`true`,children:c===`pill`?o?.text:null})]})})}function zs({icon:e,label:t,tone:n,className:r,...i}){return(0,P.jsx)(Es,{content:t,"data-label":t,disabledTrigger:i.disabled===!0,side:`right`,children:(0,P.jsx)(`button`,{...i,"aria-label":t,"data-label":t,className:R(`sidebar-status-entry`,`is-${n}`,r),type:i.type??`button`,children:e})})}var Bs=Object.defineProperty,Vs=(e,t)=>Bs(e,`name`,{value:t,configurable:!0}),Hs=!!(typeof window<`u`&&window.document&&window.document.createElement);function Us(e,t,{checkForDefaultPrevented:n=!0}={}){return Vs(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Vs(Us,`composeEventHandlers`);function Ws(e){if(!Hs)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Vs(Ws,`getOwnerWindow`);function Gs(e){if(!Hs)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Vs(Gs,`getOwnerDocument`);function Ks(e,t=!1){let{activeElement:n}=Gs(e);if(!n?.nodeName)return null;if(qs(n)&&n.contentDocument)return Ks(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Gs(n).getElementById(e);if(t)return t}}return n}Vs(Ks,`getActiveElement`);function qs(e){return e.tagName===`IFRAME`}Vs(qs,`isFrame`);var Js=Object.defineProperty,Ys=(e,t)=>Js(e,`name`,{value:t,configurable:!0});function Xs(e,t){let n=N.createContext(t);n.displayName=e+`Context`;let r=Ys(e=>{let{children:t,...r}=e,i=N.useMemo(()=>r,Object.values(r));return(0,P.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=N.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Ys(i,`useContext`),[r,i]}Ys(Xs,`createContext`);function Zs(e,t=[]){let n=[];function r(t,r){let i=N.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Ys(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=N.useMemo(()=>o,Object.values(o));return(0,P.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=N.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Ys(s,`useContext`),[o,s]}Ys(r,`createContext`);let i=Ys(()=>{let t=n.map(e=>N.createContext(e));return Ys(function(n){let r=n?.[e]||t;return N.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Qs(i,...t)]}Ys(Zs,`createContextScope`);function Qs(...e){let t=e[0];if(e.length===1)return t;let n=Ys(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Ys(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Ys(Qs,`composeContextScopes`);var $s=globalThis?.document?N.useLayoutEffect:()=>{},ec=Object.defineProperty,tc=(e,t)=>ec(e,`name`,{value:t,configurable:!0}),nc=N.useId||(()=>void 0),rc=0;function ic(e){let[t,n]=N.useState(nc());return $s(()=>{e||n(e=>e??String(rc++))},[e]),e||(t?`radix-${t}`:``)}tc(ic,`useId`);var ac=Object.defineProperty,oc=(e,t)=>ac(e,`name`,{value:t,configurable:!0}),sc=N.useEffectEvent,cc=N.useInsertionEffect;function lc(e){if(typeof sc==`function`)return sc(e);let t=N.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof cc==`function`?cc(()=>{t.current=e}):$s(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}oc(lc,`useEffectEvent`);var uc=Object.defineProperty,dc=(e,t)=>uc(e,`name`,{value:t,configurable:!0}),fc=N.useInsertionEffect||$s;function pc({prop:e,defaultProp:t,onChange:n=dc(()=>{},`onChange`),caller:r}){let[i,a,o]=mc({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,N.useCallback(t=>{if(s){let n=hc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}dc(pc,`useControllableState`);function mc({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return fc(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}dc(mc,`useUncontrolledState`);function hc(e){return typeof e==`function`}dc(hc,`isFunction`);var gc=Symbol(`RADIX:SYNC_STATE`);function _c(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=lc(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=N.useReducer((t,n)=>{if(n.type===gc)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=N.useRef(p);N.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=N.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return N.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:gc,state:i})},[i,d.state,c]),[h,f]}dc(_c,`useControllableStateReducer`);var vc=l(h(),1),yc=Object.defineProperty,bc=(e,t)=>yc(e,`name`,{value:t,configurable:!0}),xc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=is(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,P.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Sc(e,t){e&&vc.flushSync(()=>e.dispatchEvent(t))}bc(Sc,`dispatchDiscreteCustomEvent`);var Cc=Object.defineProperty,wc=(e,t)=>Cc(e,`name`,{value:t,configurable:!0});function Tc(e){let t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}wc(Tc,`useCallbackRef`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=`dismissableLayer.update`,kc=`dismissableLayer.pointerDownOutside`,Ac=`dismissableLayer.focusOutside`,jc,Mc=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Nc=N.forwardRef(Dc(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=N.useContext(Mc),[d,f]=N.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=N.useState({}),h=ts(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=N.useRef(!1),C=Ic(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:N.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Lc(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),T=d?y===g.length-1:!1,E=Tc(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return N.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),N.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jc=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Rc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=jc))}},[d,p,n,u]),N.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Rc())},[d,u]),N.useEffect(()=>{let e=Dc(()=>m({}),`handleUpdate`);return document.addEventListener(Oc,e),()=>document.removeEventListener(Oc,e)},[]),(0,P.jsx)(xc.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Us(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Us(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Us(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Pc(){let e=N.useContext(Mc),[t,n]=N.useState(null);return N.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Dc(Pc,`useDismissableLayerSurface`);var Fc=Dc(()=>!0,`IS_TRUE`);function Ic(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fc}=t,s=Tc(e),c=N.useRef(!1),l=N.useRef(!1),u=N.useRef(new Map),d=N.useRef(()=>{});return N.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Dc(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Dc(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)}Dc(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Dc(p,`handleInteractionBubble`);let m=Dc(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||zc(kc,s,p,{discrete:!0})};if(Dc(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:Dc(()=>c.current=!0,`onPointerDownCapture`)}}Dc(Ic,`usePointerDownOutside`);function Lc(e,t=globalThis?.document){let n=Tc(e),r=N.useRef(!1);return N.useEffect(()=>{let e=Dc(e=>{e.target&&!r.current&&zc(Ac,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Dc(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Dc(()=>r.current=!1,`onBlurCapture`)}}Dc(Lc,`useFocusOutside`);function Rc(){let e=new CustomEvent(Oc);document.dispatchEvent(e)}Dc(Rc,`dispatchUpdate`);function zc(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?Sc(i,a):i.dispatchEvent(a)}Dc(zc,`handleAndDispatchCustomEvent`);var Bc=Object.defineProperty,V=(e,t)=>Bc(e,`name`,{value:t,configurable:!0}),Vc=`focusScope.autoFocusOnMount`,Hc=`focusScope.autoFocusOnUnmount`,Uc={bubbles:!1,cancelable:!0},Wc=N.forwardRef(V(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=N.useState(null),l=Tc(i),u=Tc(a),d=N.useRef(null),f=ts(t,c),p=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Zc(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Zc(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Zc(s)};V(e,`handleFocusIn`),V(t,`handleFocusOut`),V(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]),N.useEffect(()=>{if(s){Qc.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Vc,Uc);s.addEventListener(Vc,l),s.dispatchEvent(t),t.defaultPrevented||(Gc(tl(qc(s)),{select:!0}),document.activeElement===e&&Zc(s))}return()=>{s.removeEventListener(Vc,l),setTimeout(()=>{let t=new CustomEvent(Hc,Uc);s.addEventListener(Hc,u),s.dispatchEvent(t),t.defaultPrevented||Zc(e??document.body,{select:!0}),s.removeEventListener(Hc,u),Qc.remove(p)},0)}}},[s,l,u,p]);let m=N.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]=Kc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Zc(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Zc(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,P.jsx)(xc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Gc(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Zc(r,{select:t}),document.activeElement!==n)return}V(Gc,`focusFirst`);function Kc(e){let t=qc(e);return[Jc(t,e),Jc(t.reverse(),e)]}V(Kc,`getTabbableEdges`);function qc(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:V(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}V(qc,`getTabbableCandidates`);function Jc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Yc(r,{upTo:t})))return r}V(Jc,`findVisible`);function Yc(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}V(Yc,`isHidden`);function Xc(e){return e instanceof HTMLInputElement&&`select`in e}V(Xc,`isSelectableInput`);function Zc(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xc(e)&&t&&e.select()}}V(Zc,`focus`);var Qc=$c();function $c(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=el(e,t),e.unshift(t)},remove(t){e=el(e,t),e[0]?.resume()}}}V($c,`createFocusScopesStack`);function el(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}V(el,`arrayRemove`);function tl(e){return e.filter(e=>e.tagName!==`A`)}V(tl,`removeLinks`);var nl=Object.defineProperty,rl=N.forwardRef(((e,t)=>nl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=N.useState(!1);$s(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?vc.createPortal((0,P.jsx)(xc.div,{...r,ref:t}),o):null},`Portal`)),il=Object.defineProperty,al=(e,t)=>il(e,`name`,{value:t,configurable:!0});function ol(e,t){return N.useReducer((e,n)=>t[e][n]??e,e)}al(ol,`useStateMachine`);var sl=al(e=>{let{present:t,children:n}=e,r=cl(t),i=typeof n==`function`?n({present:r.isPresent}):N.Children.only(n),a=ul(r.ref,fl(i));return typeof n==`function`||r.isPresent?N.cloneElement(i,{ref:a}):null},`Presence`);function cl(e){let[t,n]=N.useState(),r=N.useRef(null),i=N.useRef(e),a=N.useRef(`none`),o=N.useRef(void 0),[s,c]=ol(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return N.useEffect(()=>{s===`mounted`?(a.current=o.current??dl(r.current),o.current=void 0):a.current=`none`},[s]),$s(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=dl(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]),$s(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=al(a=>{let o=dl(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=al(e=>{e.target===t&&(a.current=dl(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)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:N.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=dl(t)}else r.current=null;n(e)},[])}}al(cl,`usePresence`);function ll(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}al(ll,`setRef`);function ul(...e){let t=N.useRef(e);return t.current=e,N.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ll(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():ll(n[e],null)}}},[])}al(ul,`useStableComposedRefs`);function dl(e){return e?.animationName||`none`}al(dl,`getAnimationName`);function fl(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)}al(fl,`getElementRef`);var pl=Object.defineProperty,ml=(e,t)=>pl(e,`name`,{value:t,configurable:!0}),hl=0,gl=null;function _l(e){return vl(),e.children}ml(_l,`FocusGuards`);function vl(){N.useEffect(()=>{gl||={start:yl(),end:yl()};let{start:e,end:t}=gl;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),hl++,()=>{hl===1&&(gl?.start.remove(),gl?.end.remove(),gl=null),hl=Math.max(0,hl-1)}},[])}ml(vl,`useFocusGuards`);function yl(){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}ml(yl,`createFocusGuard`);var bl=function(){return bl=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},bl.apply(this,arguments)};function xl(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 Sl(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 Cl=`right-scroll-bar-position`,wl=`width-before-scroll-bar`,Tl=`with-scroll-bars-hidden`,El=`--removed-body-scroll-bar-size`;function Dl(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ol(e,t){var n=(0,N.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 kl=typeof window<`u`?N.useLayoutEffect:N.useEffect,Al=new WeakMap;function jl(e,t){var n=Ol(t||null,function(t){return e.forEach(function(e){return Dl(e,t)})});return kl(function(){var t=Al.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Dl(e,null)}),i.forEach(function(e){r.has(e)||Dl(e,a)})}Al.set(n,e)},[e]),n}function Ml(e){return e}function Nl(e,t){t===void 0&&(t=Ml);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 Pl(e){e===void 0&&(e={});var t=Nl(null);return t.options=bl({async:!0,ssr:!1},e),t}var Fl=function(e){var t=e.sideCar,n=xl(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 N.createElement(r,bl({},n))};Fl.isSideCarExport=!0;function Il(e,t){return e.useMedium(t),Fl}var Ll=Pl(),Rl=function(){},zl=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:Rl,onWheelCapture:Rl,onTouchMoveCapture:Rl}),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=xl(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=jl([n,t]),C=bl(bl({},b),i);return N.createElement(N.Fragment,null,u&&N.createElement(x,{sideCar:Ll,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?N.cloneElement(N.Children.only(s),bl(bl({},C),{ref:S})):N.createElement(v,bl({},C,{className:c,ref:S}),s))});zl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},zl.classNames={fullWidth:wl,zeroRight:Cl};var Bl,Vl=function(){if(Bl)return Bl;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Hl(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vl();return t&&e.setAttribute(`nonce`,t),e}function Ul(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wl(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Hl())&&(Ul(t,n),Wl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kl=function(){var e=Gl();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ql=function(){var e=Kl();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jl={left:0,top:0,right:0,gap:0},Yl=function(e){return parseInt(e||``,10)||0},Xl=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[Yl(n),Yl(r),Yl(i)]},Zl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jl;var t=Xl(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])}},Ql=ql(),$l=`data-scroll-locked`,eu=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
11
  .${Tl} {
12
12
  overflow: hidden ${r};
13
13
  padding-right: ${s}px ${r};
@@ -47,7 +47,7 @@ Error generating stack: `+e.message+`
47
47
  `},tu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},nu=function(){N.useEffect(function(){return document.body.setAttribute($l,(tu()+1).toString()),function(){var e=tu()-1;e<=0?document.body.removeAttribute($l):document.body.setAttribute($l,e.toString())}},[])},ru=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;nu();var a=N.useMemo(function(){return Zl(i)},[i]);return N.createElement(Ql,{styles:eu(a,!t,i,n?``:`!important`)})},iu=!1;if(typeof window<`u`)try{var au=Object.defineProperty({},`passive`,{get:function(){return iu=!0,!0}});window.addEventListener(`test`,au,au),window.removeEventListener(`test`,au,au)}catch{iu=!1}var ou=iu?{passive:!1}:!1,su=function(e){return e.tagName===`TEXTAREA`},cu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!su(e)&&n[t]===`visible`)},lu=function(e){return cu(e,`overflowY`)},uu=function(e){return cu(e,`overflowX`)},du=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),mu(e,r)){var i=hu(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fu=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},pu=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},mu=function(e,t){return e===`v`?lu(t):uu(t)},hu=function(e,t){return e===`v`?fu(t):pu(t)},gu=function(e,t){return e===`h`&&t===`rtl`?-1:1},_u=function(e,t,n,r,i){var a=gu(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=hu(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&mu(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},vu=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yu=function(e){return[e.deltaX,e.deltaY]},bu=function(e){return e&&`current`in e?e.current:e},xu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Su=function(e){return`
48
48
  .block-interactivity-${e} {pointer-events: none;}
49
49
  .allow-interactivity-${e} {pointer-events: all;}
50
- `},Cu=0,wu=[];function Tu(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(Cu++)[0],a=N.useState(ql)[0],o=N.useRef(e);N.useEffect(function(){o.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Sl([e.lockRef.current],(e.shards||[]).map(bu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=N.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=vu(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=du(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=du(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return _u(h,t,e,h===`h`?s:c,!0)},[]),c=N.useCallback(function(e){var n=e;if(!(!wu.length||wu[wu.length-1]!==a)){var r=`deltaY`in n?yu(n):vu(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&xu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(bu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=N.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Eu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=N.useCallback(function(e){n.current=vu(e),r.current=void 0},[]),d=N.useCallback(function(t){l(t.type,yu(t),t.target,s(t,e.lockRef.current))},[]),f=N.useCallback(function(t){l(t.type,vu(t),t.target,s(t,e.lockRef.current))},[]);N.useEffect(function(){return wu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ou),document.addEventListener(`touchmove`,c,ou),document.addEventListener(`touchstart`,u,ou),function(){wu=wu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ou),document.removeEventListener(`touchmove`,c,ou),document.removeEventListener(`touchstart`,u,ou)}},[]);var p=e.removeScrollBar,m=e.inert;return N.createElement(N.Fragment,null,m?N.createElement(a,{styles:Su(i)}):null,p?N.createElement(ru,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Eu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Du=Il(Ll,Tu),Ou=N.forwardRef(function(e,t){return N.createElement(zl,bl({},e,{ref:t,sideCar:Du}))});Ou.classNames=zl.classNames;var ku=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Au=new WeakMap,ju=new WeakMap,Mu={},Nu=0,Pu=function(e){return e&&(e.host||Pu(e.parentNode))},Fu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pu(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Iu=function(e,t,n,r){var i=Fu(t,Array.isArray(e)?e:[e]);Mu[n]||(Mu[n]=new WeakMap);var a=Mu[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Au.get(e)||0)+1,l=(a.get(e)||0)+1;Au.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ju.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Nu++,function(){o.forEach(function(e){var t=Au.get(e)-1,i=a.get(e)-1;Au.set(e,t),a.set(e,i),t||(ju.has(e)||e.removeAttribute(r),ju.delete(e)),i||e.removeAttribute(n)}),Nu--,Nu||(Au=new WeakMap,Au=new WeakMap,ju=new WeakMap,Mu={})}},Lu=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ku(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Iu(r,i,n,`aria-hidden`)):function(){return null}},Ru=Object.defineProperty,zu=(e,t)=>Ru(e,`name`,{value:t,configurable:!0}),Bu=`Dialog`,[Vu,Hu]=Zs(Bu),[Uu,Wu]=Vu(Bu),Gu=zu(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=N.useRef(null),c=N.useRef(null),[l,u]=pc({prop:r,defaultProp:i??!1,onChange:a,caller:Bu}),[d,f]=N.useState(0),[p,m]=N.useState(0);return(0,P.jsx)(Uu,{scope:t,triggerRef:s,contentRef:c,contentId:ic(),titleId:ic(),descriptionId:ic(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Ku=`DialogPortal`,[qu,Ju]=Vu(Ku,{forceMount:void 0}),Yu=zu(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wu(Ku,t);return(0,P.jsx)(qu,{scope:t,forceMount:n,children:N.Children.map(r,e=>(0,P.jsx)(sl,{present:n||a.open,children:(0,P.jsx)(rl,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Xu=`DialogOverlay`,Zu=N.forwardRef(zu(function(e,t){let n=Ju(Xu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wu(Xu,e.__scopeDialog);return a.modal?(0,P.jsx)(sl,{present:r||a.open,children:(0,P.jsx)($u,{...i,ref:t})}):null},`DialogOverlay`)),Qu=is(`DialogOverlay.RemoveScroll`),$u=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(Xu,n),a=ts(t,Pc());return(0,P.jsx)(Ou,{as:Qu,allowPinchZoom:!0,shards:[i.contentRef],children:(0,P.jsx)(xc.div,{"data-state":dd(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ed=`DialogContent`,td=N.forwardRef(zu(function(e,t){let n=Ju(ed,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wu(ed,e.__scopeDialog);return(0,P.jsx)(sl,{present:r||a.open,children:a.modal?(0,P.jsx)(nd,{...i,ref:t}):(0,P.jsx)(rd,{...i,ref:t})})},`DialogContent`)),nd=N.forwardRef(zu(function(e,t){let n=Wu(ed,e.__scopeDialog),r=N.useRef(null),i=ts(t,n.contentRef,r);return N.useEffect(()=>{let e=r.current;if(e)return Lu(e)},[]),(0,P.jsx)(id,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Us(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Us(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Us(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),rd=N.forwardRef(zu(function(e,t){let n=Wu(ed,e.__scopeDialog),r=N.useRef(!1),i=N.useRef(!1);return(0,P.jsx)(id,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),id=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Wu(ed,n);return vl(),(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(Wc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,P.jsx)(Nc,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":dd(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),ad=`DialogTitle`,od=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(ad,n),{setTitleCount:a}=i;return $s(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(xc.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),sd=`DialogDescription`,cd=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(sd,n),{setDescriptionCount:a}=i;return $s(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(xc.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ld=`DialogClose`,ud=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(ld,n);return(0,P.jsx)(xc.button,{type:`button`,...r,ref:t,onClick:Us(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function dd(e){return e?`open`:`closed`}zu(dd,`getState`);function fd({brand:e,visual:t,auth:n,mobileAuth:r,footer:i,className:a,...o}){return(0,P.jsxs)(`section`,{className:R(`homepage-entry`,a),...o,children:[(0,P.jsxs)(`div`,{className:`homepage-entry-desktop`,children:[(0,P.jsxs)(`section`,{className:`homepage-entry-visual-column`,"aria-label":`Tutti product preview`,children:[(0,P.jsx)(`div`,{className:`homepage-entry-brand`,children:e}),(0,P.jsx)(`div`,{className:`homepage-entry-visual`,children:t})]}),(0,P.jsxs)(`aside`,{className:`homepage-entry-auth-rail`,"aria-label":`Sign in to Tutti`,children:[(0,P.jsx)(`div`,{className:`homepage-entry-auth-content`,children:n}),i===void 0?null:(0,P.jsx)(`div`,{className:`homepage-entry-auth-footnote`,children:i})]})]}),(0,P.jsxs)(`section`,{className:`homepage-entry-mobile`,"aria-label":`Sign in to Tutti`,children:[(0,P.jsx)(`div`,{className:`product-appbar`,children:e}),(0,P.jsx)(`div`,{className:`auth-shell`,children:r}),i===void 0?null:(0,P.jsx)(`div`,{className:`homepage-entry-mobile-footnote`,children:i})]})]})}function pd({className:e,...t}){return(0,P.jsx)(`p`,{className:R(`product-entry-footnote`,e),...t})}function md({title:e,description:t,children:n,action:r,feedback:i,secondaryAction:a,className:o,...s}){return(0,P.jsxs)(`form`,{className:R(`product-entry-auth-form`,o),...s,children:[(0,P.jsxs)(`header`,{className:`product-entry-auth-header`,children:[(0,P.jsx)(`h1`,{children:e}),(0,P.jsx)(`p`,{children:t})]}),(0,P.jsx)(`div`,{className:`product-entry-auth-body`,children:n}),a===void 0?null:(0,P.jsx)(`div`,{className:`product-entry-auth-secondary`,children:a}),i===void 0?null:(0,P.jsx)(`div`,{className:`product-entry-auth-feedback`,children:i}),(0,P.jsx)(`footer`,{className:`product-entry-auth-footer`,children:r})]})}var hd=40.1,gd=hd+.6,_d={openingFadeEnd:1.05,chatEnd:7.45,scratchpadPanEnd:8.8,scratchpadEnd:17.8,runCursorStart:17.95,runCursorArrive:18.65,runClickStart:18.67,runEnd:18.9,executionPrepareEnd:20.35,executionImplementEnd:24.55,executionValidateEnd:26.35,executionComplete:28.15,executionEnd:28.95,fullWorkspace:30.95,artifactLive:30.55,artifactClick:32.65,artifactScroll:36.1,artifactScrollEnd:39.55,finalHoldEnd:hd,fadeEnd:gd},vd={centerX:.325,centerY:.25,scale:1.62},yd={centerX:.325,centerY:.47,scale:1.64},bd={centerX:.855,centerY:.23,scale:1.72},xd={centerX:.855,centerY:.35,scale:1.72},Sd={centerX:.855,centerY:.79,scale:1.72},Cd={centerX:.5,centerY:.5,scale:1},wd=[{start:1.35,end:5.95,from:vd,to:yd,linearPosition:!0},{start:7.45,end:8.8,from:yd,to:bd},{start:8.8,end:14.3,from:bd,to:xd,linearPosition:!0},{start:14.6,end:17.8,from:xd,to:Sd},{start:_d.executionEnd,end:_d.fullWorkspace,from:Sd,to:Cd}];function Td(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function Ed(e){return 1-(1-Td(e))**3}function Dd(e){let t=Td(e);return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function Od(e){let t=Td(e);return t<.5?16*t**5:1-(-2*t+2)**5/2}function kd(e,t,n,r=Ed){let i=Math.max(.001,n-t);return r(Td((e-t)/i))}function H(e,t,n){return e+(t-e)*n}function Ad(e,t){let n=Td((t-e.start)/Math.max(.001,e.end-e.start)),r=e.linearPosition?n:Od(n);return{centerX:H(e.from.centerX,e.to.centerX,r),centerY:H(e.from.centerY,e.to.centerY,r),scale:H(e.from.scale,e.to.scale,e.linearPosition?n:Dd(n))}}function jd(e){if(e<wd[0].start)return vd;for(let t of wd)if(e<=t.end)return e<t.start?t.from:Ad(t,e);return Cd}function Md(e){return e>=_d.executionComplete?{id:`complete`,label:`Task completed`}:e>=_d.executionValidateEnd?{id:`update`,label:`Synchronizing project`}:e>=_d.executionImplementEnd?{id:`validate`,label:`Validating result`}:e>=_d.executionPrepareEnd?{id:`implement`,label:`Implementing with Codex`}:{id:`prepare`,label:`Preparing workspace`}}function Nd(e){return kd(e,_d.artifactScroll,_d.artifactScrollEnd,Dd)}function Pd(e){return 1-kd(e,hd,gd,Dd)}var Fd=1500,Id=1e3,Ld=2.5,Rd=`(min-width: 980px) and (prefers-reduced-motion: no-preference)`,zd=(0,N.lazy)(async()=>({default:(await ya(()=>import(`./homepage-motion-scene-Dd2mciax.js`),[])).HomepageMotionScene}));function Bd(e){let[t,n]=(0,N.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!0:window.matchMedia(e).matches);return(0,N.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Vd(){return Bd(Rd)}function Hd(e,t){let[n,r]=(0,N.useState)({elapsed:0,cycle:0}),i=(0,N.useRef)(null),a=gd+t;return(0,N.useEffect)(()=>{if(!e){i.current=null;return}let t=0,n=e=>{let o=i.current??e;i.current=e;let s=Math.min(.1,(e-o)/1e3);r(e=>{let t=e.elapsed+s;return t<a?{...e,elapsed:t}:{elapsed:t%a,cycle:e.cycle+1}}),t=window.requestAnimationFrame(n)};return t=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(t)},[a,e]),{cycle:n.cycle,time:Math.min(n.elapsed,gd)}}function Ud(e,t){let[n,r]=(0,N.useState)(0),i=(0,N.useRef)(t),a=(0,N.useRef)(!1);return i.current=t,(0,N.useEffect)(()=>{if(r(0),a.current=!1,!e)return;let t=0,n=null,o=e=>{n??=e;let s=Math.min((e-n)/1e3,gd);if(r(s),s>=gd){a.current||(a.current=!0,i.current());return}t=window.requestAnimationFrame(o)};return t=window.requestAnimationFrame(o),()=>window.cancelAnimationFrame(t)},[e]),n}function Wd(e){let t=(0,N.useRef)(null),[n,r]=(0,N.useState)(0);return(0,N.useLayoutEffect)(()=>{if(!e)return;let n=t.current;if(n===null)return;let i=()=>{let e=n.getBoundingClientRect(),t=Math.min(e.width/Fd,e.height/Id);r(Number.isFinite(t)?t:0)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),()=>a.disconnect()},[e]),{frameRef:t,masterScale:n}}function Gd({assets:e,enabled:t,sceneKey:n,time:r,className:i,...a}){let{frameRef:o,masterScale:s}=Wd(t);return t?(0,P.jsx)(`div`,{ref:o,className:R(`homepage-motion-frame`,i),...a,children:(0,P.jsx)(`div`,{className:`homepage-motion-master`,style:{"--homepage-motion-scale":s},children:(0,P.jsx)(N.Suspense,{fallback:null,children:(0,P.jsx)(zd,{time:r,assets:e},n)})})}):null}function Kd({assets:e,idleSeconds:t=Ld,className:n,...r}){let i=Vd(),a=Hd(i,Math.max(0,t));return(0,P.jsx)(Gd,{...r,assets:e,enabled:i,sceneKey:a.cycle,time:a.time,className:n})}function qd({assets:e,onComplete:t,className:n,...r}){let i=Vd(),a=Ud(i,(0,N.useCallback)(()=>t(),[t]));return(0,P.jsx)(Gd,{...r,assets:e,enabled:i,time:a,className:n})}function Jd({onOpen:e,onDismiss:t,className:n,...r}){return(0,P.jsxs)(`aside`,{className:R(`product-tour-pill`,n),"aria-label":`Product tour`,...r,children:[(0,P.jsxs)(Ss,{type:`button`,className:`product-tour-pill-open`,onClick:e,children:[(0,P.jsx)(`span`,{className:`product-tour-pill-icon`,"aria-hidden":`true`,children:(0,P.jsx)(pi,{})}),(0,P.jsxs)(`span`,{className:`product-tour-pill-copy`,children:[(0,P.jsx)(`strong`,{children:`New to Tutti?`}),(0,P.jsx)(`span`,{children:`Take a tour`})]})]}),(0,P.jsx)(bs,{type:`button`,className:`product-tour-pill-dismiss`,label:`Dismiss product tour`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`}),onClick:t})]})}function Yd({assets:e,open:t,onOpenChange:n}){let r=Vd();return(0,N.useEffect)(()=>{t&&!r&&n(!1)},[r,n,t]),r?(0,P.jsx)(Gu,{open:t,onOpenChange:n,children:(0,P.jsxs)(Yu,{children:[(0,P.jsx)(Zu,{className:`product-tour-dialog-overlay`}),(0,P.jsxs)(td,{className:`product-tour-dialog-content`,onInteractOutside:e=>e.preventDefault(),onPointerDownOutside:e=>e.preventDefault(),children:[(0,P.jsx)(od,{className:`product-tour-dialog-title`,children:`Welcome to Tutti`}),(0,P.jsx)(ud,{asChild:!0,children:(0,P.jsx)(bs,{type:`button`,className:`product-tour-dialog-close`,label:`Close product tour`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`})})}),t?(0,P.jsx)(qd,{className:`product-tour-dialog-motion`,assets:e,onComplete:()=>n(!1)}):null]})]})}):null}function Xd({asChild:e=!1,className:t,...n}){return(0,P.jsx)(e?as:`section`,{className:R(`product-card`,t),...n})}function Zd({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-header`,t),...n,children:e})}function Qd({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-body`,t),...n,children:e})}function $d({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-feedback`,t),...n,children:e})}function ef({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-footer`,t),...n,children:e})}function tf({title:e,description:t,children:n,action:r,feedback:i,secondaryAction:a,size:o=`standard`,className:s,...c}){return(0,P.jsx)(Xd,{className:R(`entry-card auth-card`,o===`wide`?`is-wide`:void 0,s),asChild:!0,children:(0,P.jsxs)(`form`,{...c,children:[(0,P.jsx)(`section`,{className:`auth-card-intro`,children:(0,P.jsxs)(Zd,{className:`auth-card-header`,children:[(0,P.jsx)(`h1`,{children:e}),(0,P.jsx)(`p`,{children:t})]})}),(0,P.jsx)(`section`,{className:`auth-card-action`,children:(0,P.jsxs)(`div`,{className:`auth-card-action-content`,children:[(0,P.jsx)(Qd,{children:n}),a===void 0?null:(0,P.jsx)(`div`,{className:`auth-card-secondary`,children:a}),i===void 0?null:(0,P.jsx)($d,{children:i}),(0,P.jsx)(ef,{children:r})]})})]})})}function nf({projectName:e,hostLabel:t,hostOnline:n=!1,members:r,invitedBy:i,className:a,...o}){return(0,P.jsxs)(`section`,{className:R(`invite-summary`,a),"aria-label":`Project invitation`,...o,children:[(0,P.jsxs)(`div`,{className:`invite-project`,children:[(0,P.jsx)(`h2`,{children:e}),(0,P.jsxs)(`p`,{className:R(`project-line`,n?`is-online`:`is-offline`),children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),t]})]}),r===void 0?null:(0,P.jsx)(`div`,{className:`invite-members`,children:r}),i===void 0?null:(0,P.jsxs)(`div`,{className:`invite-meta`,children:[(0,P.jsx)(`span`,{children:`Invited by`}),(0,P.jsx)(`strong`,{children:i})]})]})}function rf({label:e,value:t,action:n,className:r,...i}){return(0,P.jsxs)(`div`,{className:R(`account-row`,r),...i,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsx)(`strong`,{children:t})]}),n]})}function af({title:e,accountName:t,accountAction:n,children:r,className:i,...a}){return(0,P.jsxs)(Xd,{className:R(`project-center-card`,i),...a,children:[(0,P.jsxs)(`header`,{className:`project-center-card-header`,children:[(0,P.jsx)(`h1`,{children:e}),t===void 0&&n===void 0?null:(0,P.jsxs)(`div`,{className:`project-center-account`,"aria-label":t===void 0?`Page actions`:`Signed in user`,children:[t===void 0?null:(0,P.jsx)(`span`,{className:`project-center-account-name`,children:t}),n]})]}),r]})}function of({action:e,description:t,descriptionId:n,disabledTrigger:r=!1,className:i,...a}){return(0,P.jsx)(`div`,{className:R(`project-center-header-action`,i),...a,children:t===void 0?e:(0,P.jsx)(Es,{content:t,disabledTrigger:r,side:`bottom`,...n===void 0?{}:{contentId:n},children:e})})}function sf({children:e,className:t,...n}){return(0,P.jsx)(`section`,{className:R(`project-entry-grid`,t),"aria-label":`Project entry options`,...n,children:e})}function cf({icon:e,title:t,description:n}){return(0,P.jsxs)(`header`,{className:`project-entry-card-header`,children:[(0,P.jsx)(`span`,{className:`project-entry-card-icon`,"aria-hidden":`true`,children:e}),(0,P.jsxs)(`div`,{className:`project-entry-card-copy`,children:[(0,P.jsx)(`h2`,{children:t}),(0,P.jsx)(`p`,{children:n})]})]})}function lf({title:e,description:t,inputLabel:n,placeholder:r,value:i,error:a,actionLabel:o=`Continue`,onValueChange:s,className:c,...l}){return(0,P.jsxs)(`form`,{className:R(`project-entry-card project-join-card`,c),...l,children:[(0,P.jsx)(cf,{icon:(0,P.jsx)(ki,{}),title:e,description:t}),(0,P.jsxs)(`div`,{className:`project-entry-card-content project-join-card-content`,children:[(0,P.jsxs)(`div`,{className:`project-join-card-form-row`,children:[(0,P.jsx)(ks,{type:`text`,"aria-label":n,value:i,onChange:e=>s(e.target.value),...r===void 0?{}:{placeholder:r}}),(0,P.jsx)(`div`,{className:`project-join-card-actions`,children:(0,P.jsxs)(xs,{type:`submit`,disabled:i.trim()===``,children:[o,(0,P.jsx)(ai,{"aria-hidden":`true`})]})})]}),a==null?null:(0,P.jsx)(Ps,{children:a})]})]})}function uf({title:e,description:t,actionHref:n,actionLabel:r=`Open Tutti`,expanded:i,statusTitle:a,statusDescription:o,command:s,onAction:c,onCopyCommand:l,className:u,...d}){let f=(0,N.useId)();return(0,P.jsxs)(`section`,{className:R(`project-entry-card project-launch-card`,i?`is-expanded`:void 0,u),...d,children:[(0,P.jsx)(cf,{icon:(0,P.jsx)(ea,{}),title:e,description:t}),(0,P.jsxs)(`div`,{className:`project-entry-card-content project-launch-card-content`,children:[i?(0,P.jsxs)(`div`,{className:`project-launch-card-status`,id:f,children:[(0,P.jsx)(`p`,{className:`project-launch-card-status-title`,role:`status`,"aria-live":`polite`,children:a}),(0,P.jsx)(`p`,{children:o}),(0,P.jsx)(df,{command:s,...l===void 0?{}:{onCopyCommand:l}})]}):null,(0,P.jsx)(`div`,{className:`project-launch-card-actions`,children:(0,P.jsx)(xs,{asChild:!0,children:(0,P.jsxs)(`a`,{href:n,"aria-expanded":i,...i?{"aria-controls":f}:{},onClick:c,children:[r,(0,P.jsx)(ai,{"aria-hidden":`true`})]})})})]})]})}function df({command:e,terminalLabel:t=`Install and start in your terminal`,copyLabel:n=`Copy`,onCopyCommand:r,className:i,...a}){return(0,P.jsxs)(`section`,{className:R(`project-launch-terminal`,i),...a,children:[(0,P.jsxs)(`div`,{className:`project-launch-terminal-bar`,children:[(0,P.jsx)(`span`,{children:t}),r===void 0?null:(0,P.jsxs)(Ss,{className:`project-launch-copy-button`,type:`button`,"aria-label":`Copy launch command`,onClick:()=>r(e),children:[(0,P.jsx)(vi,{"aria-hidden":`true`}),n]})]}),(0,P.jsx)(`pre`,{className:`project-launch-command-block`,"aria-label":`Launch command`,children:(0,P.jsx)(`code`,{children:(0,P.jsxs)(`span`,{className:`project-launch-command-line`,children:[(0,P.jsx)(`span`,{className:`project-launch-command-prompt`,"aria-hidden":`true`,children:`>`}),(0,P.jsx)(`span`,{children:e})]})})})]})}function ff({children:e,className:t,...n}){return(0,P.jsx)(`ul`,{className:R(`project-list`,t),"aria-label":`Recent projects`,...n,children:e})}function pf({title:e,children:t,listLabel:n,summaryClassName:r,className:i,...a}){return(0,P.jsxs)(`details`,{className:R(`project-list-disclosure`,i),...a,children:[(0,P.jsxs)(`summary`,{className:R(`project-list-disclosure-summary`,r),children:[(0,P.jsx)(ui,{"aria-hidden":`true`}),(0,P.jsx)(`strong`,{children:e})]}),(0,P.jsx)(ff,{...n===void 0?{}:{"aria-label":n},children:t})]})}function mf({title:e,statusLabel:t,online:n=!1,details:r,className:i,disabled:a,...o}){return(0,P.jsx)(`li`,{className:`project-list-item`,children:(0,P.jsxs)(`button`,{className:R(`project-list-row`,n?`is-online`:`is-offline`,i),type:`button`,disabled:a,...o,children:[(0,P.jsxs)(`span`,{className:`project-list-identity`,children:[(0,P.jsx)(`strong`,{children:e}),(0,P.jsxs)(`small`,{children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),t]})]}),r.map(e=>(0,P.jsxs)(`span`,{className:`project-list-detail`,children:[(0,P.jsx)(`small`,{children:e.label}),(0,P.jsx)(`strong`,{children:e.value})]},e.label)),(0,P.jsx)(ai,{"aria-hidden":`true`})]})})}function hf({children:e,className:t,...n}){return(0,P.jsx)(`li`,{className:R(`project-list-item project-list-state-row`,t),...n,children:e})}function gf({open:e,onOpenChange:t,title:n,description:r,children:i,closeDisabled:a=!1,explicitCloseOnly:o=!1,className:s}){return(0,P.jsxs)(Gu,{open:e,onOpenChange:e=>{(e||!a)&&t(e)},children:[(0,P.jsx)(Zu,{className:`product-entry-dialog-overlay`}),(0,P.jsx)(td,{asChild:!0,onEscapeKeyDown:e=>{(a||o)&&e.preventDefault()},onInteractOutside:e=>{(a||o)&&e.preventDefault()},onPointerDownOutside:e=>{(a||o)&&e.preventDefault()},children:(0,P.jsxs)(Xd,{className:R(`product-entry-dialog-card`,s),children:[(0,P.jsxs)(`header`,{className:`product-entry-dialog-header`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(od,{children:n}),r===void 0?null:(0,P.jsx)(cd,{children:r})]}),(0,P.jsx)(ud,{asChild:!0,children:(0,P.jsx)(bs,{type:`button`,label:`Close`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`}),disabled:a})})]}),i]})})]})}function _f({open:e,onOpenChange:t,steps:n,currentStep:r,children:i,action:a,backAction:o,feedback:s,closeDisabled:c=!1,explicitCloseOnly:l=!1,className:u,...d}){return(0,P.jsxs)(gf,{open:e,onOpenChange:t,title:`New project`,description:`Step ${r+1} of ${n.length}`,closeDisabled:c,explicitCloseOnly:l,className:`local-console-create-card`,children:[(0,P.jsx)(`ol`,{className:`local-console-create-steps`,"aria-label":`New project steps`,children:n.map((e,t)=>(0,P.jsxs)(`li`,{className:R(t===r?`is-current`:void 0,t<r?`is-complete`:void 0),"aria-current":t===r?`step`:void 0,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`,children:t+1}),(0,P.jsx)(`small`,{children:e})]},e))}),(0,P.jsxs)(`form`,{className:R(`local-console-create-form`,u),...d,children:[(0,P.jsx)(`div`,{className:`local-console-create-body`,children:i}),s===void 0?null:(0,P.jsx)(`div`,{className:`local-console-create-feedback`,children:s}),(0,P.jsxs)(`footer`,{className:`local-console-create-actions`,children:[(0,P.jsx)(`div`,{children:o}),(0,P.jsx)(`div`,{children:a})]})]})]})}function vf({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`local-console-form-grid`,t),...n,children:e})}function yf({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`local-console-inline-actions`,t),...n,children:e})}function bf({title:e,description:t,children:n,className:r,...i}){return(0,P.jsxs)(`section`,{className:R(`local-console-field-group`,r),...i,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`strong`,{children:e}),t===void 0?null:(0,P.jsx)(`small`,{children:t})]}),(0,P.jsx)(`div`,{className:`local-console-field-group-body`,children:n})]})}function xf({title:e,children:t,className:n,...r}){return(0,P.jsxs)(`section`,{className:R(`local-console-project-section`,n),...r,children:[(0,P.jsx)(`header`,{className:`local-console-project-section-header`,children:(0,P.jsx)(`strong`,{children:e})}),(0,P.jsx)(ff,{children:t})]})}function Sf({children:e,className:t,...n}){return(0,P.jsx)(pf,{title:`Unavailable`,className:R(`local-console-unavailable-projects`,t),summaryClassName:`local-console-project-section-header`,...n,children:e})}function Cf({title:e,statusLabel:t,online:n=!1,path:r,createdLabel:i,providerLabel:a,providerStatus:o,actions:s,className:c,...l}){return(0,P.jsx)(`li`,{className:R(`project-list-item`,`local-console-project-item`,c),...l,children:(0,P.jsxs)(`div`,{className:R(`local-console-project-row`,n?`is-online`:`is-offline`),children:[(0,P.jsxs)(`span`,{className:`project-list-identity`,children:[(0,P.jsx)(`span`,{className:`local-console-project-title`,children:(0,P.jsx)(`strong`,{children:e})}),(0,P.jsxs)(`span`,{className:`local-console-project-signals`,children:[(0,P.jsxs)(`small`,{className:`local-console-runtime-status`,children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),t]}),(0,P.jsxs)(`small`,{className:R(`local-console-provider-status`,`is-${o}`),children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),a]})]})]}),(0,P.jsxs)(`span`,{className:`local-console-project-metadata`,children:[(0,P.jsx)(`strong`,{className:`local-console-project-date`,children:i}),(0,P.jsx)(`small`,{className:`local-console-project-path`,title:typeof r==`string`?r:void 0,children:r})]}),(0,P.jsx)(`span`,{className:`local-console-project-actions`,children:s})]})})}function wf(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Tf=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ef=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Df={};function Of(e,t){return((t||Df).jsx?Ef:Tf).test(e)}var kf=/[ \t\n\f\r]/g;function Af(e){return typeof e==`object`?e.type===`text`?jf(e.value):!1:jf(e)}function jf(e){return e.replace(kf,``)===``}var Mf=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Mf.prototype.normal={},Mf.prototype.property={},Mf.prototype.space=void 0;function Nf(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Mf(n,r,t)}function Pf(e){return e.toLowerCase()}var Ff=class{constructor(e,t){this.attribute=t,this.property=e}};Ff.prototype.attribute=``,Ff.prototype.booleanish=!1,Ff.prototype.boolean=!1,Ff.prototype.commaOrSpaceSeparated=!1,Ff.prototype.commaSeparated=!1,Ff.prototype.defined=!1,Ff.prototype.mustUseProperty=!1,Ff.prototype.number=!1,Ff.prototype.overloadedBoolean=!1,Ff.prototype.property=``,Ff.prototype.spaceSeparated=!1,Ff.prototype.space=void 0;var If=s({boolean:()=>U,booleanish:()=>Rf,commaOrSpaceSeparated:()=>Hf,commaSeparated:()=>Vf,number:()=>W,overloadedBoolean:()=>zf,spaceSeparated:()=>Bf}),Lf=0,U=Uf(),Rf=Uf(),zf=Uf(),W=Uf(),Bf=Uf(),Vf=Uf(),Hf=Uf();function Uf(){return 2**++Lf}var Wf=Object.keys(If),Gf=class extends Ff{constructor(e,t,n,r){let i=-1;if(super(e,t),Kf(this,`space`,r),typeof n==`number`)for(;++i<Wf.length;){let e=Wf[i];Kf(this,Wf[i],(n&If[e])===If[e])}}};Gf.prototype.defined=!0;function Kf(e,t,n){n&&(e[t]=n)}function qf(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Gf(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pf(r)]=r,n[Pf(a.attribute)]=r}return new Mf(t,n,e.space)}var Jf=qf({properties:{ariaActiveDescendant:null,ariaAtomic:Rf,ariaAutoComplete:null,ariaBusy:Rf,ariaChecked:Rf,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:Bf,ariaCurrent:null,ariaDescribedBy:Bf,ariaDetails:null,ariaDisabled:Rf,ariaDropEffect:Bf,ariaErrorMessage:null,ariaExpanded:Rf,ariaFlowTo:Bf,ariaGrabbed:Rf,ariaHasPopup:null,ariaHidden:Rf,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bf,ariaLevel:W,ariaLive:null,ariaModal:Rf,ariaMultiLine:Rf,ariaMultiSelectable:Rf,ariaOrientation:null,ariaOwns:Bf,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Rf,ariaReadOnly:Rf,ariaRelevant:null,ariaRequired:Rf,ariaRoleDescription:Bf,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Rf,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Yf(e,t){return t in e?e[t]:t}function Xf(e,t){return Yf(e,t.toLowerCase())}var Zf=qf({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Vf,acceptCharset:Bf,accessKey:Bf,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:Bf,autoFocus:U,autoPlay:U,blocking:Bf,capture:null,charSet:null,checked:U,cite:null,className:Bf,cols:W,colSpan:null,content:null,contentEditable:Rf,controls:U,controlsList:Bf,coords:W|Vf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:zf,draggable:Rf,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:Bf,height:W,hidden:zf,high:W,href:null,hrefLang:null,htmlFor:Bf,httpEquiv:Bf,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:Bf,itemRef:Bf,itemScope:U,itemType:Bf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,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:U,optimum:W,pattern:null,ping:Bf,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:Bf,required:U,reversed:U,rows:W,rowSpan:W,sandbox:Bf,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Rf,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:Rf,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bf,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Rf,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:U,disableRemotePlayback:U,prefix:null,property:null,results:W,security:null,unselectable:null},space:`html`,transform:Xf}),Qf=qf({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Hf,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:Bf,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:Vf,g2:Vf,glyphName:Vf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:Hf,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hf,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hf,rev:Hf,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hf,requiredFeatures:Hf,requiredFonts:Hf,requiredFormats:Hf,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:Hf,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hf,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hf,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Yf}),$f=qf({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()}}),ep=qf({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Xf}),tp=qf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),np={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`},rp=/[A-Z]/g,ip=/-[a-z]/g,ap=/^data[-\w.:]+$/i;function op(e,t){let n=Pf(t),r=t,i=Ff;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ap.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ip,cp);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ip.test(e)){let n=e.replace(rp,sp);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Gf}return new i(r,t)}function sp(e){return`-`+e.toLowerCase()}function cp(e){return e.charAt(1).toUpperCase()}var lp=Nf([Jf,Zf,$f,ep,tp],`html`),up=Nf([Jf,Qf,$f,ep,tp],`svg`);function dp(e){return e.join(` `).trim()}var fp=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,u=`
50
+ `},Cu=0,wu=[];function Tu(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(Cu++)[0],a=N.useState(ql)[0],o=N.useRef(e);N.useEffect(function(){o.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Sl([e.lockRef.current],(e.shards||[]).map(bu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=N.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=vu(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=du(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=du(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return _u(h,t,e,h===`h`?s:c,!0)},[]),c=N.useCallback(function(e){var n=e;if(!(!wu.length||wu[wu.length-1]!==a)){var r=`deltaY`in n?yu(n):vu(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&xu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(bu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=N.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Eu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=N.useCallback(function(e){n.current=vu(e),r.current=void 0},[]),d=N.useCallback(function(t){l(t.type,yu(t),t.target,s(t,e.lockRef.current))},[]),f=N.useCallback(function(t){l(t.type,vu(t),t.target,s(t,e.lockRef.current))},[]);N.useEffect(function(){return wu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ou),document.addEventListener(`touchmove`,c,ou),document.addEventListener(`touchstart`,u,ou),function(){wu=wu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ou),document.removeEventListener(`touchmove`,c,ou),document.removeEventListener(`touchstart`,u,ou)}},[]);var p=e.removeScrollBar,m=e.inert;return N.createElement(N.Fragment,null,m?N.createElement(a,{styles:Su(i)}):null,p?N.createElement(ru,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Eu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Du=Il(Ll,Tu),Ou=N.forwardRef(function(e,t){return N.createElement(zl,bl({},e,{ref:t,sideCar:Du}))});Ou.classNames=zl.classNames;var ku=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Au=new WeakMap,ju=new WeakMap,Mu={},Nu=0,Pu=function(e){return e&&(e.host||Pu(e.parentNode))},Fu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pu(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Iu=function(e,t,n,r){var i=Fu(t,Array.isArray(e)?e:[e]);Mu[n]||(Mu[n]=new WeakMap);var a=Mu[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Au.get(e)||0)+1,l=(a.get(e)||0)+1;Au.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ju.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Nu++,function(){o.forEach(function(e){var t=Au.get(e)-1,i=a.get(e)-1;Au.set(e,t),a.set(e,i),t||(ju.has(e)||e.removeAttribute(r),ju.delete(e)),i||e.removeAttribute(n)}),Nu--,Nu||(Au=new WeakMap,Au=new WeakMap,ju=new WeakMap,Mu={})}},Lu=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ku(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Iu(r,i,n,`aria-hidden`)):function(){return null}},Ru=Object.defineProperty,zu=(e,t)=>Ru(e,`name`,{value:t,configurable:!0}),Bu=`Dialog`,[Vu,Hu]=Zs(Bu),[Uu,Wu]=Vu(Bu),Gu=zu(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=N.useRef(null),c=N.useRef(null),[l,u]=pc({prop:r,defaultProp:i??!1,onChange:a,caller:Bu}),[d,f]=N.useState(0),[p,m]=N.useState(0);return(0,P.jsx)(Uu,{scope:t,triggerRef:s,contentRef:c,contentId:ic(),titleId:ic(),descriptionId:ic(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Ku=`DialogPortal`,[qu,Ju]=Vu(Ku,{forceMount:void 0}),Yu=zu(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wu(Ku,t);return(0,P.jsx)(qu,{scope:t,forceMount:n,children:N.Children.map(r,e=>(0,P.jsx)(sl,{present:n||a.open,children:(0,P.jsx)(rl,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Xu=`DialogOverlay`,Zu=N.forwardRef(zu(function(e,t){let n=Ju(Xu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wu(Xu,e.__scopeDialog);return a.modal?(0,P.jsx)(sl,{present:r||a.open,children:(0,P.jsx)($u,{...i,ref:t})}):null},`DialogOverlay`)),Qu=is(`DialogOverlay.RemoveScroll`),$u=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(Xu,n),a=ts(t,Pc());return(0,P.jsx)(Ou,{as:Qu,allowPinchZoom:!0,shards:[i.contentRef],children:(0,P.jsx)(xc.div,{"data-state":dd(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ed=`DialogContent`,td=N.forwardRef(zu(function(e,t){let n=Ju(ed,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wu(ed,e.__scopeDialog);return(0,P.jsx)(sl,{present:r||a.open,children:a.modal?(0,P.jsx)(nd,{...i,ref:t}):(0,P.jsx)(rd,{...i,ref:t})})},`DialogContent`)),nd=N.forwardRef(zu(function(e,t){let n=Wu(ed,e.__scopeDialog),r=N.useRef(null),i=ts(t,n.contentRef,r);return N.useEffect(()=>{let e=r.current;if(e)return Lu(e)},[]),(0,P.jsx)(id,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Us(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Us(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Us(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),rd=N.forwardRef(zu(function(e,t){let n=Wu(ed,e.__scopeDialog),r=N.useRef(!1),i=N.useRef(!1);return(0,P.jsx)(id,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),id=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Wu(ed,n);return vl(),(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(Wc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,P.jsx)(Nc,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":dd(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),ad=`DialogTitle`,od=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(ad,n),{setTitleCount:a}=i;return $s(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(xc.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),sd=`DialogDescription`,cd=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(sd,n),{setDescriptionCount:a}=i;return $s(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(xc.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ld=`DialogClose`,ud=N.forwardRef(zu(function(e,t){let{__scopeDialog:n,...r}=e,i=Wu(ld,n);return(0,P.jsx)(xc.button,{type:`button`,...r,ref:t,onClick:Us(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function dd(e){return e?`open`:`closed`}zu(dd,`getState`);function fd({brand:e,visual:t,auth:n,mobileAuth:r,footer:i,className:a,...o}){return(0,P.jsxs)(`section`,{className:R(`homepage-entry`,a),...o,children:[(0,P.jsxs)(`div`,{className:`homepage-entry-desktop`,children:[(0,P.jsxs)(`section`,{className:`homepage-entry-visual-column`,"aria-label":`Tutti product preview`,children:[(0,P.jsx)(`div`,{className:`homepage-entry-brand`,children:e}),(0,P.jsx)(`div`,{className:`homepage-entry-visual`,children:t})]}),(0,P.jsxs)(`aside`,{className:`homepage-entry-auth-rail`,"aria-label":`Sign in to Tutti`,children:[(0,P.jsx)(`div`,{className:`homepage-entry-auth-content`,children:n}),i===void 0?null:(0,P.jsx)(`div`,{className:`homepage-entry-auth-footnote`,children:i})]})]}),(0,P.jsxs)(`section`,{className:`homepage-entry-mobile`,"aria-label":`Sign in to Tutti`,children:[(0,P.jsx)(`div`,{className:`product-appbar`,children:e}),(0,P.jsx)(`div`,{className:`auth-shell`,children:r}),i===void 0?null:(0,P.jsx)(`div`,{className:`homepage-entry-mobile-footnote`,children:i})]})]})}function pd({className:e,...t}){return(0,P.jsx)(`p`,{className:R(`product-entry-footnote`,e),...t})}function md({title:e,description:t,children:n,action:r,feedback:i,secondaryAction:a,className:o,...s}){return(0,P.jsxs)(`form`,{className:R(`product-entry-auth-form`,o),...s,children:[(0,P.jsxs)(`header`,{className:`product-entry-auth-header`,children:[(0,P.jsx)(`h1`,{children:e}),(0,P.jsx)(`p`,{children:t})]}),(0,P.jsx)(`div`,{className:`product-entry-auth-body`,children:n}),a===void 0?null:(0,P.jsx)(`div`,{className:`product-entry-auth-secondary`,children:a}),i===void 0?null:(0,P.jsx)(`div`,{className:`product-entry-auth-feedback`,children:i}),(0,P.jsx)(`footer`,{className:`product-entry-auth-footer`,children:r})]})}var hd=40.1,gd=hd+.6,_d={openingFadeEnd:1.05,chatEnd:7.45,scratchpadPanEnd:8.8,scratchpadEnd:17.8,runCursorStart:17.95,runCursorArrive:18.65,runClickStart:18.67,runEnd:18.9,executionPrepareEnd:20.35,executionImplementEnd:24.55,executionValidateEnd:26.35,executionComplete:28.15,executionEnd:28.95,fullWorkspace:30.95,artifactLive:30.55,artifactClick:32.65,artifactScroll:36.1,artifactScrollEnd:39.55,finalHoldEnd:hd,fadeEnd:gd},vd={centerX:.325,centerY:.25,scale:1.62},yd={centerX:.325,centerY:.47,scale:1.64},bd={centerX:.855,centerY:.23,scale:1.72},xd={centerX:.855,centerY:.35,scale:1.72},Sd={centerX:.855,centerY:.79,scale:1.72},Cd={centerX:.5,centerY:.5,scale:1},wd=[{start:1.35,end:5.95,from:vd,to:yd,linearPosition:!0},{start:7.45,end:8.8,from:yd,to:bd},{start:8.8,end:14.3,from:bd,to:xd,linearPosition:!0},{start:14.6,end:17.8,from:xd,to:Sd},{start:_d.executionEnd,end:_d.fullWorkspace,from:Sd,to:Cd}];function Td(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function Ed(e){return 1-(1-Td(e))**3}function Dd(e){let t=Td(e);return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function Od(e){let t=Td(e);return t<.5?16*t**5:1-(-2*t+2)**5/2}function kd(e,t,n,r=Ed){let i=Math.max(.001,n-t);return r(Td((e-t)/i))}function H(e,t,n){return e+(t-e)*n}function Ad(e,t){let n=Td((t-e.start)/Math.max(.001,e.end-e.start)),r=e.linearPosition?n:Od(n);return{centerX:H(e.from.centerX,e.to.centerX,r),centerY:H(e.from.centerY,e.to.centerY,r),scale:H(e.from.scale,e.to.scale,e.linearPosition?n:Dd(n))}}function jd(e){if(e<wd[0].start)return vd;for(let t of wd)if(e<=t.end)return e<t.start?t.from:Ad(t,e);return Cd}function Md(e){return e>=_d.executionComplete?{id:`complete`,label:`Task completed`}:e>=_d.executionValidateEnd?{id:`update`,label:`Synchronizing project`}:e>=_d.executionImplementEnd?{id:`validate`,label:`Validating result`}:e>=_d.executionPrepareEnd?{id:`implement`,label:`Implementing with Codex`}:{id:`prepare`,label:`Preparing workspace`}}function Nd(e){return kd(e,_d.artifactScroll,_d.artifactScrollEnd,Dd)}function Pd(e){return 1-kd(e,hd,gd,Dd)}var Fd=1500,Id=1e3,Ld=2.5,Rd=`(min-width: 980px) and (prefers-reduced-motion: no-preference)`,zd=(0,N.lazy)(async()=>({default:(await ya(()=>import(`./homepage-motion-scene-Bao7Xh97.js`),[])).HomepageMotionScene}));function Bd(e){let[t,n]=(0,N.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!0:window.matchMedia(e).matches);return(0,N.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Vd(){return Bd(Rd)}function Hd(e,t){let[n,r]=(0,N.useState)({elapsed:0,cycle:0}),i=(0,N.useRef)(null),a=gd+t;return(0,N.useEffect)(()=>{if(!e){i.current=null;return}let t=0,n=e=>{let o=i.current??e;i.current=e;let s=Math.min(.1,(e-o)/1e3);r(e=>{let t=e.elapsed+s;return t<a?{...e,elapsed:t}:{elapsed:t%a,cycle:e.cycle+1}}),t=window.requestAnimationFrame(n)};return t=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(t)},[a,e]),{cycle:n.cycle,time:Math.min(n.elapsed,gd)}}function Ud(e,t){let[n,r]=(0,N.useState)(0),i=(0,N.useRef)(t),a=(0,N.useRef)(!1);return i.current=t,(0,N.useEffect)(()=>{if(r(0),a.current=!1,!e)return;let t=0,n=null,o=e=>{n??=e;let s=Math.min((e-n)/1e3,gd);if(r(s),s>=gd){a.current||(a.current=!0,i.current());return}t=window.requestAnimationFrame(o)};return t=window.requestAnimationFrame(o),()=>window.cancelAnimationFrame(t)},[e]),n}function Wd(e){let t=(0,N.useRef)(null),[n,r]=(0,N.useState)(0);return(0,N.useLayoutEffect)(()=>{if(!e)return;let n=t.current;if(n===null)return;let i=()=>{let e=n.getBoundingClientRect(),t=Math.min(e.width/Fd,e.height/Id);r(Number.isFinite(t)?t:0)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),()=>a.disconnect()},[e]),{frameRef:t,masterScale:n}}function Gd({assets:e,enabled:t,sceneKey:n,time:r,className:i,...a}){let{frameRef:o,masterScale:s}=Wd(t);return t?(0,P.jsx)(`div`,{ref:o,className:R(`homepage-motion-frame`,i),...a,children:(0,P.jsx)(`div`,{className:`homepage-motion-master`,style:{"--homepage-motion-scale":s},children:(0,P.jsx)(N.Suspense,{fallback:null,children:(0,P.jsx)(zd,{time:r,assets:e},n)})})}):null}function Kd({assets:e,idleSeconds:t=Ld,className:n,...r}){let i=Vd(),a=Hd(i,Math.max(0,t));return(0,P.jsx)(Gd,{...r,assets:e,enabled:i,sceneKey:a.cycle,time:a.time,className:n})}function qd({assets:e,onComplete:t,className:n,...r}){let i=Vd(),a=Ud(i,(0,N.useCallback)(()=>t(),[t]));return(0,P.jsx)(Gd,{...r,assets:e,enabled:i,time:a,className:n})}function Jd({onOpen:e,onDismiss:t,className:n,...r}){return(0,P.jsxs)(`aside`,{className:R(`product-tour-pill`,n),"aria-label":`Product tour`,...r,children:[(0,P.jsxs)(Ss,{type:`button`,className:`product-tour-pill-open`,onClick:e,children:[(0,P.jsx)(`span`,{className:`product-tour-pill-icon`,"aria-hidden":`true`,children:(0,P.jsx)(pi,{})}),(0,P.jsxs)(`span`,{className:`product-tour-pill-copy`,children:[(0,P.jsx)(`strong`,{children:`New to Tutti?`}),(0,P.jsx)(`span`,{children:`Take a tour`})]})]}),(0,P.jsx)(bs,{type:`button`,className:`product-tour-pill-dismiss`,label:`Dismiss product tour`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`}),onClick:t})]})}function Yd({assets:e,open:t,onOpenChange:n}){let r=Vd();return(0,N.useEffect)(()=>{t&&!r&&n(!1)},[r,n,t]),r?(0,P.jsx)(Gu,{open:t,onOpenChange:n,children:(0,P.jsxs)(Yu,{children:[(0,P.jsx)(Zu,{className:`product-tour-dialog-overlay`}),(0,P.jsxs)(td,{className:`product-tour-dialog-content`,onInteractOutside:e=>e.preventDefault(),onPointerDownOutside:e=>e.preventDefault(),children:[(0,P.jsx)(od,{className:`product-tour-dialog-title`,children:`Welcome to Tutti`}),(0,P.jsx)(ud,{asChild:!0,children:(0,P.jsx)(bs,{type:`button`,className:`product-tour-dialog-close`,label:`Close product tour`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`})})}),t?(0,P.jsx)(qd,{className:`product-tour-dialog-motion`,assets:e,onComplete:()=>n(!1)}):null]})]})}):null}function Xd({asChild:e=!1,className:t,...n}){return(0,P.jsx)(e?as:`section`,{className:R(`product-card`,t),...n})}function Zd({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-header`,t),...n,children:e})}function Qd({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-body`,t),...n,children:e})}function $d({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-feedback`,t),...n,children:e})}function ef({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`product-card-footer`,t),...n,children:e})}function tf({title:e,description:t,children:n,action:r,feedback:i,secondaryAction:a,size:o=`standard`,className:s,...c}){return(0,P.jsx)(Xd,{className:R(`entry-card auth-card`,o===`wide`?`is-wide`:void 0,s),asChild:!0,children:(0,P.jsxs)(`form`,{...c,children:[(0,P.jsx)(`section`,{className:`auth-card-intro`,children:(0,P.jsxs)(Zd,{className:`auth-card-header`,children:[(0,P.jsx)(`h1`,{children:e}),(0,P.jsx)(`p`,{children:t})]})}),(0,P.jsx)(`section`,{className:`auth-card-action`,children:(0,P.jsxs)(`div`,{className:`auth-card-action-content`,children:[(0,P.jsx)(Qd,{children:n}),a===void 0?null:(0,P.jsx)(`div`,{className:`auth-card-secondary`,children:a}),i===void 0?null:(0,P.jsx)($d,{children:i}),(0,P.jsx)(ef,{children:r})]})})]})})}function nf({projectName:e,hostLabel:t,hostOnline:n=!1,members:r,invitedBy:i,className:a,...o}){return(0,P.jsxs)(`section`,{className:R(`invite-summary`,a),"aria-label":`Project invitation`,...o,children:[(0,P.jsxs)(`div`,{className:`invite-project`,children:[(0,P.jsx)(`h2`,{children:e}),(0,P.jsxs)(`p`,{className:R(`project-line`,n?`is-online`:`is-offline`),children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),t]})]}),r===void 0?null:(0,P.jsx)(`div`,{className:`invite-members`,children:r}),i===void 0?null:(0,P.jsxs)(`div`,{className:`invite-meta`,children:[(0,P.jsx)(`span`,{children:`Invited by`}),(0,P.jsx)(`strong`,{children:i})]})]})}function rf({label:e,value:t,action:n,className:r,...i}){return(0,P.jsxs)(`div`,{className:R(`account-row`,r),...i,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsx)(`strong`,{children:t})]}),n]})}function af({title:e,accountName:t,accountAction:n,children:r,className:i,...a}){return(0,P.jsxs)(Xd,{className:R(`project-center-card`,i),...a,children:[(0,P.jsxs)(`header`,{className:`project-center-card-header`,children:[(0,P.jsx)(`h1`,{children:e}),t===void 0&&n===void 0?null:(0,P.jsxs)(`div`,{className:`project-center-account`,"aria-label":t===void 0?`Page actions`:`Signed in user`,children:[t===void 0?null:(0,P.jsx)(`span`,{className:`project-center-account-name`,children:t}),n]})]}),r]})}function of({action:e,description:t,descriptionId:n,disabledTrigger:r=!1,className:i,...a}){return(0,P.jsx)(`div`,{className:R(`project-center-header-action`,i),...a,children:t===void 0?e:(0,P.jsx)(Es,{content:t,disabledTrigger:r,side:`bottom`,...n===void 0?{}:{contentId:n},children:e})})}function sf({children:e,className:t,...n}){return(0,P.jsx)(`section`,{className:R(`project-entry-grid`,t),"aria-label":`Project entry options`,...n,children:e})}function cf({icon:e,title:t,description:n}){return(0,P.jsxs)(`header`,{className:`project-entry-card-header`,children:[(0,P.jsx)(`span`,{className:`project-entry-card-icon`,"aria-hidden":`true`,children:e}),(0,P.jsxs)(`div`,{className:`project-entry-card-copy`,children:[(0,P.jsx)(`h2`,{children:t}),(0,P.jsx)(`p`,{children:n})]})]})}function lf({title:e,description:t,inputLabel:n,placeholder:r,value:i,error:a,actionLabel:o=`Continue`,onValueChange:s,className:c,...l}){return(0,P.jsxs)(`form`,{className:R(`project-entry-card project-join-card`,c),...l,children:[(0,P.jsx)(cf,{icon:(0,P.jsx)(ki,{}),title:e,description:t}),(0,P.jsxs)(`div`,{className:`project-entry-card-content project-join-card-content`,children:[(0,P.jsxs)(`div`,{className:`project-join-card-form-row`,children:[(0,P.jsx)(ks,{type:`text`,"aria-label":n,value:i,onChange:e=>s(e.target.value),...r===void 0?{}:{placeholder:r}}),(0,P.jsx)(`div`,{className:`project-join-card-actions`,children:(0,P.jsxs)(xs,{type:`submit`,disabled:i.trim()===``,children:[o,(0,P.jsx)(ai,{"aria-hidden":`true`})]})})]}),a==null?null:(0,P.jsx)(Ps,{children:a})]})]})}function uf({title:e,description:t,actionHref:n,actionLabel:r=`Local projects`,expanded:i,statusTitle:a,statusDescription:o,command:s,onAction:c,onCopyCommand:l,className:u,...d}){let f=(0,N.useId)();return(0,P.jsxs)(`section`,{className:R(`project-entry-card project-launch-card`,i?`is-expanded`:void 0,u),...d,children:[(0,P.jsx)(cf,{icon:(0,P.jsx)(ea,{}),title:e,description:t}),(0,P.jsxs)(`div`,{className:`project-entry-card-content project-launch-card-content`,children:[i?(0,P.jsxs)(`div`,{className:`project-launch-card-status`,id:f,children:[(0,P.jsx)(`p`,{className:`project-launch-card-status-title`,role:`status`,"aria-live":`polite`,children:a}),(0,P.jsx)(`p`,{children:o}),(0,P.jsx)(df,{command:s,...l===void 0?{}:{onCopyCommand:l}})]}):null,(0,P.jsx)(`div`,{className:`project-launch-card-actions`,children:(0,P.jsx)(xs,{asChild:!0,children:(0,P.jsxs)(`a`,{href:n,"aria-expanded":i,...i?{"aria-controls":f}:{},onClick:c,children:[r,(0,P.jsx)(ai,{"aria-hidden":`true`})]})})})]})]})}function df({command:e,terminalLabel:t=`Install and start in your terminal`,copyLabel:n=`Copy`,onCopyCommand:r,className:i,...a}){return(0,P.jsxs)(`section`,{className:R(`project-launch-terminal`,i),...a,children:[(0,P.jsxs)(`div`,{className:`project-launch-terminal-bar`,children:[(0,P.jsx)(`span`,{children:t}),r===void 0?null:(0,P.jsxs)(Ss,{className:`project-launch-copy-button`,type:`button`,"aria-label":`Copy launch command`,onClick:()=>r(e),children:[(0,P.jsx)(vi,{"aria-hidden":`true`}),n]})]}),(0,P.jsx)(`pre`,{className:`project-launch-command-block`,"aria-label":`Launch command`,children:(0,P.jsx)(`code`,{children:(0,P.jsxs)(`span`,{className:`project-launch-command-line`,children:[(0,P.jsx)(`span`,{className:`project-launch-command-prompt`,"aria-hidden":`true`,children:`>`}),(0,P.jsx)(`span`,{children:e})]})})})]})}function ff({children:e,className:t,...n}){return(0,P.jsx)(`ul`,{className:R(`project-list`,t),"aria-label":`Recent projects`,...n,children:e})}function pf({title:e,children:t,listLabel:n,summaryClassName:r,className:i,...a}){return(0,P.jsxs)(`details`,{className:R(`project-list-disclosure`,i),...a,children:[(0,P.jsxs)(`summary`,{className:R(`project-list-disclosure-summary`,r),children:[(0,P.jsx)(ui,{"aria-hidden":`true`}),(0,P.jsx)(`strong`,{children:e})]}),(0,P.jsx)(ff,{...n===void 0?{}:{"aria-label":n},children:t})]})}function mf({title:e,statusLabel:t,online:n=!1,details:r,className:i,disabled:a,...o}){return(0,P.jsx)(`li`,{className:`project-list-item`,children:(0,P.jsxs)(`button`,{className:R(`project-list-row`,n?`is-online`:`is-offline`,i),type:`button`,disabled:a,...o,children:[(0,P.jsxs)(`span`,{className:`project-list-identity`,children:[(0,P.jsx)(`strong`,{children:e}),(0,P.jsxs)(`small`,{children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),t]})]}),r.map(e=>(0,P.jsxs)(`span`,{className:`project-list-detail`,children:[(0,P.jsx)(`small`,{children:e.label}),(0,P.jsx)(`strong`,{children:e.value})]},e.label)),(0,P.jsx)(ai,{"aria-hidden":`true`})]})})}function hf({children:e,className:t,...n}){return(0,P.jsx)(`li`,{className:R(`project-list-item project-list-state-row`,t),...n,children:e})}function gf({open:e,onOpenChange:t,title:n,description:r,children:i,closeDisabled:a=!1,explicitCloseOnly:o=!1,className:s}){return(0,P.jsxs)(Gu,{open:e,onOpenChange:e=>{(e||!a)&&t(e)},children:[(0,P.jsx)(Zu,{className:`product-entry-dialog-overlay`}),(0,P.jsx)(td,{asChild:!0,onEscapeKeyDown:e=>{(a||o)&&e.preventDefault()},onInteractOutside:e=>{(a||o)&&e.preventDefault()},onPointerDownOutside:e=>{(a||o)&&e.preventDefault()},children:(0,P.jsxs)(Xd,{className:R(`product-entry-dialog-card`,s),children:[(0,P.jsxs)(`header`,{className:`product-entry-dialog-header`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(od,{children:n}),r===void 0?null:(0,P.jsx)(cd,{children:r})]}),(0,P.jsx)(ud,{asChild:!0,children:(0,P.jsx)(bs,{type:`button`,label:`Close`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`}),disabled:a})})]}),i]})})]})}function _f({open:e,onOpenChange:t,steps:n,currentStep:r,children:i,action:a,backAction:o,feedback:s,closeDisabled:c=!1,explicitCloseOnly:l=!1,className:u,...d}){return(0,P.jsxs)(gf,{open:e,onOpenChange:t,title:`New project`,description:`Step ${r+1} of ${n.length}`,closeDisabled:c,explicitCloseOnly:l,className:`local-console-create-card`,children:[(0,P.jsx)(`ol`,{className:`local-console-create-steps`,"aria-label":`New project steps`,children:n.map((e,t)=>(0,P.jsxs)(`li`,{className:R(t===r?`is-current`:void 0,t<r?`is-complete`:void 0),"aria-current":t===r?`step`:void 0,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`,children:t+1}),(0,P.jsx)(`small`,{children:e})]},e))}),(0,P.jsxs)(`form`,{className:R(`local-console-create-form`,u),...d,children:[(0,P.jsx)(`div`,{className:`local-console-create-body`,children:i}),s===void 0?null:(0,P.jsx)(`div`,{className:`local-console-create-feedback`,children:s}),(0,P.jsxs)(`footer`,{className:`local-console-create-actions`,children:[(0,P.jsx)(`div`,{children:o}),(0,P.jsx)(`div`,{children:a})]})]})]})}function vf({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`local-console-form-grid`,t),...n,children:e})}function yf({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`local-console-inline-actions`,t),...n,children:e})}function bf({title:e,description:t,children:n,className:r,...i}){return(0,P.jsxs)(`section`,{className:R(`local-console-field-group`,r),...i,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`strong`,{children:e}),t===void 0?null:(0,P.jsx)(`small`,{children:t})]}),(0,P.jsx)(`div`,{className:`local-console-field-group-body`,children:n})]})}function xf({title:e,children:t,className:n,...r}){return(0,P.jsxs)(`section`,{className:R(`local-console-project-section`,n),...r,children:[(0,P.jsx)(`header`,{className:`local-console-project-section-header`,children:(0,P.jsx)(`strong`,{children:e})}),(0,P.jsx)(ff,{children:t})]})}function Sf({children:e,className:t,...n}){return(0,P.jsx)(pf,{title:`Unavailable`,className:R(`local-console-unavailable-projects`,t),summaryClassName:`local-console-project-section-header`,...n,children:e})}function Cf({title:e,statusLabel:t,online:n=!1,path:r,createdLabel:i,providerLabel:a,providerStatus:o,actions:s,className:c,...l}){return(0,P.jsx)(`li`,{className:R(`project-list-item`,`local-console-project-item`,c),...l,children:(0,P.jsxs)(`div`,{className:R(`local-console-project-row`,n?`is-online`:`is-offline`),children:[(0,P.jsxs)(`span`,{className:`project-list-identity`,children:[(0,P.jsx)(`span`,{className:`local-console-project-title`,children:(0,P.jsx)(`strong`,{children:e})}),(0,P.jsxs)(`span`,{className:`local-console-project-signals`,children:[(0,P.jsxs)(`small`,{className:`local-console-runtime-status`,children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),t]}),(0,P.jsxs)(`small`,{className:R(`local-console-provider-status`,`is-${o}`),children:[(0,P.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),a]})]})]}),(0,P.jsxs)(`span`,{className:`local-console-project-metadata`,children:[(0,P.jsx)(`strong`,{className:`local-console-project-date`,children:i}),(0,P.jsx)(`small`,{className:`local-console-project-path`,title:typeof r==`string`?r:void 0,children:r})]}),(0,P.jsx)(`span`,{className:`local-console-project-actions`,children:s})]})})}function wf(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Tf=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ef=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Df={};function Of(e,t){return((t||Df).jsx?Ef:Tf).test(e)}var kf=/[ \t\n\f\r]/g;function Af(e){return typeof e==`object`?e.type===`text`?jf(e.value):!1:jf(e)}function jf(e){return e.replace(kf,``)===``}var Mf=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Mf.prototype.normal={},Mf.prototype.property={},Mf.prototype.space=void 0;function Nf(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Mf(n,r,t)}function Pf(e){return e.toLowerCase()}var Ff=class{constructor(e,t){this.attribute=t,this.property=e}};Ff.prototype.attribute=``,Ff.prototype.booleanish=!1,Ff.prototype.boolean=!1,Ff.prototype.commaOrSpaceSeparated=!1,Ff.prototype.commaSeparated=!1,Ff.prototype.defined=!1,Ff.prototype.mustUseProperty=!1,Ff.prototype.number=!1,Ff.prototype.overloadedBoolean=!1,Ff.prototype.property=``,Ff.prototype.spaceSeparated=!1,Ff.prototype.space=void 0;var If=s({boolean:()=>U,booleanish:()=>Rf,commaOrSpaceSeparated:()=>Hf,commaSeparated:()=>Vf,number:()=>W,overloadedBoolean:()=>zf,spaceSeparated:()=>Bf}),Lf=0,U=Uf(),Rf=Uf(),zf=Uf(),W=Uf(),Bf=Uf(),Vf=Uf(),Hf=Uf();function Uf(){return 2**++Lf}var Wf=Object.keys(If),Gf=class extends Ff{constructor(e,t,n,r){let i=-1;if(super(e,t),Kf(this,`space`,r),typeof n==`number`)for(;++i<Wf.length;){let e=Wf[i];Kf(this,Wf[i],(n&If[e])===If[e])}}};Gf.prototype.defined=!0;function Kf(e,t,n){n&&(e[t]=n)}function qf(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Gf(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pf(r)]=r,n[Pf(a.attribute)]=r}return new Mf(t,n,e.space)}var Jf=qf({properties:{ariaActiveDescendant:null,ariaAtomic:Rf,ariaAutoComplete:null,ariaBusy:Rf,ariaChecked:Rf,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:Bf,ariaCurrent:null,ariaDescribedBy:Bf,ariaDetails:null,ariaDisabled:Rf,ariaDropEffect:Bf,ariaErrorMessage:null,ariaExpanded:Rf,ariaFlowTo:Bf,ariaGrabbed:Rf,ariaHasPopup:null,ariaHidden:Rf,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bf,ariaLevel:W,ariaLive:null,ariaModal:Rf,ariaMultiLine:Rf,ariaMultiSelectable:Rf,ariaOrientation:null,ariaOwns:Bf,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Rf,ariaReadOnly:Rf,ariaRelevant:null,ariaRequired:Rf,ariaRoleDescription:Bf,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Rf,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Yf(e,t){return t in e?e[t]:t}function Xf(e,t){return Yf(e,t.toLowerCase())}var Zf=qf({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Vf,acceptCharset:Bf,accessKey:Bf,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:Bf,autoFocus:U,autoPlay:U,blocking:Bf,capture:null,charSet:null,checked:U,cite:null,className:Bf,cols:W,colSpan:null,content:null,contentEditable:Rf,controls:U,controlsList:Bf,coords:W|Vf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:zf,draggable:Rf,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:Bf,height:W,hidden:zf,high:W,href:null,hrefLang:null,htmlFor:Bf,httpEquiv:Bf,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:Bf,itemRef:Bf,itemScope:U,itemType:Bf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,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:U,optimum:W,pattern:null,ping:Bf,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:Bf,required:U,reversed:U,rows:W,rowSpan:W,sandbox:Bf,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Rf,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:Rf,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bf,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Rf,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:U,disableRemotePlayback:U,prefix:null,property:null,results:W,security:null,unselectable:null},space:`html`,transform:Xf}),Qf=qf({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Hf,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:Bf,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:Vf,g2:Vf,glyphName:Vf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:Hf,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hf,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hf,rev:Hf,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hf,requiredFeatures:Hf,requiredFonts:Hf,requiredFormats:Hf,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:Hf,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hf,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hf,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Yf}),$f=qf({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()}}),ep=qf({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Xf}),tp=qf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),np={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`},rp=/[A-Z]/g,ip=/-[a-z]/g,ap=/^data[-\w.:]+$/i;function op(e,t){let n=Pf(t),r=t,i=Ff;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ap.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ip,cp);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ip.test(e)){let n=e.replace(rp,sp);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Gf}return new i(r,t)}function sp(e){return`-`+e.toLowerCase()}function cp(e){return e.charAt(1).toUpperCase()}var lp=Nf([Jf,Zf,$f,ep,tp],`html`),up=Nf([Jf,Qf,$f,ep,tp],`svg`);function dp(e){return e.join(` `).trim()}var fp=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,u=`
51
51
  `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function ee(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),ee()}function _(e){return e?e.replace(l,p):p}t.exports=g})),pp=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(fp());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),mp=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),hp=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(pp()),r=mp();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),gp=vp(`end`),_p=vp(`start`);function vp(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function yp(e){let t=_p(e),n=gp(e);if(t&&n)return{start:t,end:n}}function bp(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Sp(e.position):`start`in e||`end`in e?Sp(e):`line`in e||`column`in e?xp(e):``}function xp(e){return Cp(e&&e.line)+`:`+Cp(e&&e.column)}function Sp(e){return xp(e&&e.start)+`-`+xp(e&&e.end)}function Cp(e){return e&&typeof e==`number`?e:1}var wp=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=bp(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};wp.prototype.file=``,wp.prototype.name=``,wp.prototype.reason=``,wp.prototype.message=``,wp.prototype.stack=``,wp.prototype.column=void 0,wp.prototype.line=void 0,wp.prototype.ancestors=void 0,wp.prototype.cause=void 0,wp.prototype.fatal=void 0,wp.prototype.place=void 0,wp.prototype.ruleId=void 0,wp.prototype.source=void 0;var Tp=l(hp(),1),Ep={}.hasOwnProperty,Dp=new Map,Op=/[A-Z]/g,kp=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ap=new Set([`td`,`th`]),jp=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Mp(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Up(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Hp(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?up:lp,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Np(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Np(e,t,n){if(t.type===`element`)return Pp(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Fp(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Lp(e,t,n);if(t.type===`mdxjsEsm`)return Ip(e,t);if(t.type===`root`)return Rp(e,t,n);if(t.type===`text`)return zp(e,t)}function Pp(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=up,e.schema=i),e.ancestors.push(t);let a=Yp(e,t.tagName,!1),o=Wp(e,t),s=Kp(e,t);return kp.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Af(e):!0})),Bp(e,o,a,t),Vp(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Fp(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Xp(e,t.position)}function Ip(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xp(e,t.position)}function Lp(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=up,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Yp(e,t.name,!0),o=Gp(e,t),s=Kp(e,t);return Bp(e,o,a,t),Vp(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Rp(e,t,n){let r={};return Vp(r,Kp(e,t)),e.create(t,e.Fragment,r,n)}function zp(e,t){return t.value}function Bp(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Vp(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Hp(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Up(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=_p(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Wp(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ep.call(t.properties,i)){let a=qp(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ap.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Gp(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Xp(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Xp(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Kp(e,t){let n=[],r=-1,i=e.passKeys?new Map:Dp;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Np(e,a,o);s!==void 0&&n.push(s)}return n}function qp(e,t,n){let r=op(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wf(n):dp(n)),r.property===`style`){let t=typeof n==`object`?n:Jp(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Zp(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?np[r.property]||r.property:r.attribute,n]}}function Jp(e,t){try{return(0,Tp.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new wp("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=jp+`#cannot-parse-style-attribute`,r}}function Yp(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Of(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Of(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ep.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Xp(e)}function Xp(e,t){let n=new wp("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=jp+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Zp(e){let t={},n;for(n in e)Ep.call(e,n)&&(t[Qp(n)]=e[n]);return t}function Qp(e){let t=e.replace(Op,$p);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function $p(e){return`-`+e.toLowerCase()}var em={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},tm={};function nm(e,t){let n=t||tm;return rm(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function rm(e,t,n){if(am(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return im(e.children,t,n)}return Array.isArray(e)?im(e,t,n):``}function im(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=rm(e[i],t,n);return r.join(``)}function am(e){return!!(e&&typeof e==`object`)}var om=document.createElement(`i`);function sm(e){let t=`&`+e+`;`;om.innerHTML=t;let n=om.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function cm(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function lm(e,t){return e.length>0?(cm(e,e.length,0,t),e):t}var um={}.hasOwnProperty;function dm(e){let t={},n=-1;for(;++n<e.length;)fm(t,e[n]);return t}function fm(e,t){let n;for(n in t){let r=(um.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){um.call(r,a)||(r[a]=[]);let e=i[a];pm(r[a],Array.isArray(e)?e:e?[e]:[])}}}function pm(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);cm(e,0,0,r)}function mm(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function hm(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var gm=Dm(/[A-Za-z]/),_m=Dm(/[\dA-Za-z]/),vm=Dm(/[#-'*+\--9=?A-Z^-~]/);function ym(e){return e!==null&&(e<32||e===127)}var bm=Dm(/\d/),xm=Dm(/[\dA-Fa-f]/),Sm=Dm(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function Cm(e){return e!==null&&(e<0||e===32)}function wm(e){return e===-2||e===-1||e===32}var Tm=Dm(/\p{P}|\p{S}/u),Em=Dm(/\s/);function Dm(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Om(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&_m(e.charCodeAt(n+1))&&_m(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function km(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return wm(r)?(e.enter(n),s(r)):t(r)}function s(r){return wm(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Am={tokenize:jm};function jm(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),km(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return G(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Mm={tokenize:Pm},Nm={tokenize:Fm};function Pm(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return cm(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Nm,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Nm,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return G(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;cm(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Fm(e,t,n){return km(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Im(e){if(e===null||Cm(e)||Em(e))return 1;if(Tm(e))return 2}function Lm(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Rm={name:`attention`,resolveAll:zm,tokenize:Bm};function zm(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Vm(d,-c),Vm(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=lm(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=lm(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=lm(l,Lm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=lm(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=lm(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,cm(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Bm(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Im(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Im(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Vm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Hm={name:`autolink`,tokenize:Um};function Um(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return gm(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||_m(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||_m(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ym(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):vm(t)?(e.consume(t),l):n(t)}function u(e){return _m(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||_m(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Wm={partial:!0,tokenize:Gm};function Gm(e,t,n){return r;function r(t){return wm(t)?km(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||G(e)?t(e):n(e)}}var Km={continuation:{tokenize:Jm},exit:Ym,name:`blockQuote`,tokenize:qm};function qm(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return wm(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Jm(e,t,n){let r=this;return i;function i(t){return wm(t)?km(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Km,t,n)(r)}}function Ym(e){e.exit(`blockQuote`)}var Xm={name:`characterEscape`,tokenize:Zm};function Zm(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Sm(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Qm={name:`characterReference`,tokenize:$m};function $m(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=_m,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=xm,u):(e.enter(`characterReferenceValue`),a=7,o=bm,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===_m&&!sm(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var eh={partial:!0,tokenize:rh},th={concrete:!0,name:`codeFenced`,tokenize:nh};function nh(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),wm(t)?km(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||G(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(eh,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||G(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):wm(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),km(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||G(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||G(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&wm(t)?km(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||G(t)?e.check(eh,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||G(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),wm(t)?km(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),wm(t)?km(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||G(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function rh(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var ih={name:`codeIndented`,tokenize:oh},ah={partial:!0,tokenize:sh};function oh(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),km(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):G(t)?e.attempt(ah,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||G(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function sh(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):G(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):km(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):G(e)?i(e):n(e)}}var ch={name:`codeText`,previous:uh,resolve:lh,tokenize:dh};function lh(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function uh(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function dh(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):G(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||G(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var fh=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ph(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ph(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ph(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);ph(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ph(this.left,t.reverse())}}};function ph(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function mh(e){let t={},n=-1,r,i,a,o,s,c,l,u=new fh(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,hh(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return cm(e,0,1/0,u.slice(0)),!l}function hh(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var gh={resolve:vh,tokenize:yh},_h={partial:!0,tokenize:bh};function vh(e){return mh(e),e}function yh(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):G(t)?e.check(_h,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function bh(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),km(e,a,`linePrefix`)}function a(i){if(i===null||G(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function xh(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ym(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||G(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Cm(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ym(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Sh(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):G(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||G(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!wm(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ch(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):G(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),km(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||G(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function wh(e,t){let n;return r;function r(i){return G(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):wm(i)?km(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Th={name:`definition`,tokenize:Dh},Eh={partial:!0,tokenize:Oh};function Dh(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Sh.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=hm(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Cm(t)?wh(e,l)(t):l(t)}function l(t){return xh(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Eh,d,d)(t)}function d(t){return wm(t)?km(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||G(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Oh(e,t,n){return r;function r(t){return Cm(t)?wh(e,i)(t):n(t)}function i(t){return Ch(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return wm(t)?km(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||G(e)?t(e):n(e)}}var kh={name:`hardBreakEscape`,tokenize:Ah};function Ah(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return G(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var jh={name:`headingAtx`,resolve:Mh,tokenize:Nh};function Mh(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},cm(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Nh(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Cm(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||G(n)?(e.exit(`atxHeading`),t(n)):wm(n)?km(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Cm(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ph=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Fh=[`pre`,`script`,`style`,`textarea`],Ih={concrete:!0,name:`htmlFlow`,resolveTo:zh,tokenize:Bh},Lh={partial:!0,tokenize:Hh},Rh={partial:!0,tokenize:Vh};function zh(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Bh(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):gm(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):gm(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return gm(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Cm(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Fh.includes(l)?(i=1,r.interrupt?t(s):D(s)):Ph.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||_m(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return wm(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||gm(t)?(e.consume(t),b):wm(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||_m(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):wm(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):wm(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||G(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Cm(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||wm(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||G(t)?D(t):wm(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),M):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):G(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Lh,ae,O)(t)):t===null||G(t)?(e.exit(`htmlFlowData`),O(t)):(e.consume(t),D)}function O(t){return e.check(Rh,k,ae)(t)}function k(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||G(t)?O(t):(e.enter(`htmlFlowData`),D(t))}function ne(t){return t===45?(e.consume(t),j):D(t)}function A(t){return t===47?(e.consume(t),o=``,re):D(t)}function re(t){if(t===62){let n=o.toLowerCase();return Fh.includes(n)?(e.consume(t),M):D(t)}return gm(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):D(t)}function ie(t){return t===93?(e.consume(t),j):D(t)}function j(t){return t===62?(e.consume(t),M):t===45&&i===2?(e.consume(t),j):D(t)}function M(t){return t===null||G(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),M)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function Vh(e,t,n){let r=this;return i;function i(t){return G(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Hh(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Wm,t,n)}}var Uh={name:`htmlText`,tokenize:Wh};function Wh(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):gm(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):gm(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):G(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):G(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):G(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):G(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return gm(t)?(e.consume(t),S):n(t)}function S(t){return t===45||_m(t)?(e.consume(t),S):C(t)}function C(t){return G(t)?(o=C,A(t)):wm(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||_m(t)?(e.consume(t),w):t===47||t===62||Cm(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||gm(t)?(e.consume(t),E):G(t)?(o=T,A(t)):wm(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||_m(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):G(t)?(o=ee,A(t)):wm(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,O):G(t)?(o=D,A(t)):wm(t)?(e.consume(t),D):(e.consume(t),k)}function O(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):G(t)?(o=O,A(t)):(e.consume(t),O)}function k(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Cm(t)?T(t):(e.consume(t),k)}function te(e){return e===47||e===62||Cm(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return wm(t)?km(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var Gh={name:`labelEnd`,resolveAll:Yh,resolveTo:Xh,tokenize:Zh},Kh={tokenize:Qh},qh={tokenize:$h},Jh={tokenize:eg};function Yh(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&cm(e,0,e.length,n),e}function Xh(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=lm(s,e.slice(a+1,a+r+3)),s=lm(s,[[`enter`,u,t]]),s=lm(s,Lm(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=lm(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=lm(s,e.slice(o+1)),s=lm(s,[[`exit`,c,t]]),cm(e,a,e.length,s),e}function Zh(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(hm(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Kh,u,o?u:d)(t):t===91?e.attempt(qh,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Jh,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Qh(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Cm(t)?wh(e,a)(t):a(t)}function a(t){return t===41?u(t):xh(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Cm(t)?wh(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ch(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Cm(t)?wh(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function $h(e,t,n){let r=this;return i;function i(t){return Sh.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(hm(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function eg(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var tg={name:`labelStartImage`,resolveAll:Gh.resolveAll,tokenize:ng};function ng(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var rg={name:`labelStartLink`,resolveAll:Gh.resolveAll,tokenize:ig};function ig(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ag={name:`lineEnding`,tokenize:og};function og(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),km(e,t,`linePrefix`)}}var sg={name:`thematicBreak`,tokenize:cg};function cg(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||G(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),wm(t)?km(e,s,`whitespace`)(t):s(t))}}var lg={continuation:{tokenize:pg},exit:hg,name:`list`,tokenize:fg},ug={partial:!0,tokenize:gg},dg={partial:!0,tokenize:mg};function fg(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:bm(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(sg,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return bm(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Wm,r.interrupt?n:u,e.attempt(ug,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return wm(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function pg(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Wm,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,km(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!wm(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dg,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,km(e,e.attempt(lg,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function mg(e,t,n){let r=this;return km(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function hg(e){e.exit(this.containerState.type)}function gg(e,t,n){let r=this;return km(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!wm(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var _g={name:`setextUnderline`,resolveTo:vg,tokenize:yg};function vg(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function yg(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),wm(t)?km(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||G(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var bg={tokenize:xg};function xg(e){let t=this,n=e.attempt(Wm,r,e.attempt(this.parser.constructs.flowInitial,i,km(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gh,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Sg={resolveAll:Eg()},Cg=Tg(`string`),wg=Tg(`text`);function Tg(e){return{resolveAll:Eg(e===`text`?Dg:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Eg(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Dg(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Og=s({attentionMarkers:()=>Ig,contentInitial:()=>Ag,disable:()=>Lg,document:()=>kg,flow:()=>Mg,flowInitial:()=>jg,insideSpan:()=>Fg,string:()=>Ng,text:()=>Pg}),kg={42:lg,43:lg,45:lg,48:lg,49:lg,50:lg,51:lg,52:lg,53:lg,54:lg,55:lg,56:lg,57:lg,62:Km},Ag={91:Th},jg={[-2]:ih,[-1]:ih,32:ih},Mg={35:jh,42:sg,45:[_g,sg],60:Ih,61:_g,95:sg,96:th,126:th},Ng={38:Qm,92:Xm},Pg={[-5]:ag,[-4]:ag,[-3]:ag,33:tg,38:Qm,42:Rm,60:[Hm,Uh],91:rg,92:[kh,Xm],93:Gh,95:Rm,96:ch},Fg={null:[Rm,Sg]},Ig={null:[42,95]},Lg={null:[]};function Rg(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=lm(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Lm(a,l.events,l),l.events):[]}function f(e,t){return Bg(p(e),t)}function p(e){return zg(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){G(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&cm(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zg(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Bg(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
52
52
  `;break;case-3:o=`\r
53
53
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Vg(e){let t={constructs:dm([Og,...(e||{}).extensions||[]]),content:n(Am),defined:[],document:n(Mm),flow:n(bg),lazy:{},string:n(Cg),text:n(wg)};return t;function n(e){return n;function n(n){return Rg(t,e,n)}}}function Hg(e){for(;!mh(e););return e}var Ug=/[\0\t\n\r]/g;function Wg(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Ug.lastIndex=u,c=Ug.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Gg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Kg(e){return e.replace(Gg,qg)}function qg(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return mm(n.slice(t?2:1),t?16:10)}return sm(n)||e}var Jg={}.hasOwnProperty;function Yg(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Xg(n)(Hg(Vg(n).document().write(Wg()(e,t,!0))))}function Xg(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(O),htmlFlowData:E,htmlText:c(k),htmlTextData:E,image:c(A),label:ie,labelText:re,lineEnding:ee,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:j,resourceTitleString:M,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Qg(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Jg.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||e_).call(a,void 0,e[0])}for(r.position={start:Zg(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Zg(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Zg(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||e_).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+bp({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Zg(e.end)}function u(){return nm(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=hm(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:Zg(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Zg(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Zg(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Kg(t),n.identifier=hm(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=hm(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=mm(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=sm(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=Zg(e.end)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function Zg(e){return{line:e.line,column:e.column,offset:e.offset}}function Qg(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Qg(e,r):$g(e,r)}}function $g(e,t){let n;for(n in t)if(Jg.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function e_(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+bp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bp({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+bp({start:t.start,end:t.end})+`) is still open`)}function t_(e){let t=this;t.parser=n;function n(n){return Yg(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function n_(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function r_(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -66,4 +66,4 @@ Error generating stack: `+e.message+`
66
66
  `)||T!==e.length||!t.endsWith(`
67
67
  `)||n!==t.length-1)return null;let r=e.slice(0,-1);if(!t.startsWith(r))return null;let i=t.slice(r.length,-1);return i===``?null:{nextValue:`${e}${i}`,nextCaret:e.length+i.length}},he=(e,t,n,r=!1)=>{let i=b.current;if(i===null)return{nextValue:e,nextCaret:t};let a=n??i.finalData;return a!==void 0&&(b.current={...i,finalData:a}),a!==void 0&&a!==``&&e.slice(i.start,i.start+i.data.length)===i.data&&e.slice(i.start+i.data.length,i.start+i.data.length+a.length)===a?(b.current=null,{nextValue:`${e.slice(0,i.start)}${e.slice(i.start+i.data.length)}`,nextCaret:Math.max(i.start,t-i.data.length)}):a!==void 0&&a!==``&&e.slice(i.start,i.start+a.length)===a?(b.current=null,{nextValue:e,nextCaret:t}):(r&&a!==void 0&&(b.current=null),{nextValue:e,nextCaret:t})},ge=()=>{let t=h.current,n=t===null||!ae(t)?T:se(t).end;if(vy(e,n)!==null){w(!0),E(n),D(0),le(n);return}let r=n===0?``:e[n-1]??``,i=r!==``&&hy.test(r)?` @`:`@`,a=`${e.slice(0,n)}${i}${e.slice(n)}`,o=n+i.length;w(!0),E(o),D(0),de(a,o)};(0,N.useEffect)(()=>{i===void 0||g.current===i||(g.current=i,ge())},[i]),(0,N.useEffect)(()=>{D(0)},[k?.start,k?.query]),(0,N.useLayoutEffect)(()=>{let t=h.current;if(t===null)return;let n=yy(e,k),r=Sy(n);if(!v.current){let i=M(t)!==e,a=t.querySelector(`[data-mention-value]`)!==null,o=(Cy(n)||a)&&x.current!==r;(i||o)&&wy(t,n),x.current=r,e===``&&(y.current=null,b.current=null)}_.current!==null&&(ce(t,_.current),_.current=null)},[k,e]);let _e=({clearCompositionSeedOnMiss:e=!1,compositionData:t}={})=>{let n=h.current;if(n===null)return;let r=he(M(n),se(n).end,t,e);de(r.nextValue,r.nextCaret)},ve=n=>{if(v.current||Ty(n)){f?.(n);return}if(ne){if(n.key===`ArrowDown`){n.preventDefault(),D(e=>(e+1)%te.length);return}if(n.key===`ArrowUp`){n.preventDefault(),D(e=>(e-1+te.length)%te.length);return}if(n.key===`Enter`&&!n.shiftKey&&!n.metaKey||n.key===`Tab`){let e=te[A];if(e===void 0)return;n.preventDefault(),ue(e);return}}let i=h.current;if(i!==null&&(n.key===`Backspace`||n.key===`Delete`)){let t=se(i);if(t.start!==t.end){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start)}${e.slice(t.end)}`,t.start);return}if(n.key===`Backspace`&&t.start>0&&e[t.start-1]===`
68
68
  `){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start-1)}${e.slice(t.start)}`,t.start-1);return}if(n.key===`Delete`&&e[t.start]===`
69
- `){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start)}${e.slice(t.start+1)}`,t.start);return}let r=by(e).find(r=>n.key===`Backspace`?t.start>r.start&&t.start<=r.end||t.start===r.end+1&&e[r.end]===` `:t.start>=r.start&&t.start<r.end);if(r!==void 0){n.preventDefault(),y.current=null,b.current=null;let i=n.key===`Backspace`&&t.start===r.end+1&&e[r.end]===` `?r.end+1:r.end;de(`${e.slice(0,r.start)}${e.slice(i)}`,r.start);return}if(n.key===`Backspace`&&t.start>0){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start-1)}${e.slice(t.start)}`,t.start-1);return}if(n.key===`Delete`&&t.start<e.length){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start)}${e.slice(t.start+1)}`,t.start);return}}if(t&&n.key===`Enter`){if(n.preventDefault(),r&&!n.shiftKey&&!n.metaKey){i?.closest(`form`)?.requestSubmit();return}pe();return}if(!t&&n.key===`Enter`){n.preventDefault(),i?.closest(`form`)?.requestSubmit();return}f?.(n)},ye=t=>{if(v.current||Ty(t))return;let n=h.current;if(n===null)return;let r=M(n),i=se(n).end,a=me(r,i),o=a?.nextValue??r,s=a?.nextCaret??i,c=Ey(t);if(c.inputType===`insertText`&&Dy(c.data)){let t=s-c.data.length,n=`${o.slice(0,t)}${o.slice(s)}`;y.current=t>=0&&n===e?{data:c.data,start:t,end:s,valueBefore:n,createdAt:Date.now()}:null}else y.current=null;let l=he(o,s,void 0,!0);de(l.nextValue,l.nextCaret)},be=e=>{if(v.current||Ty(e))return;let t=Ey(e);if(t.inputType===`insertParagraph`||t.inputType===`insertLineBreak`){pe()&&e.preventDefault();return}y.current=null},xe=t=>{t.preventDefault();let n=t.clipboardData.getData(`text/plain`),r=h.current;if(r===null)return;let i=se(r);de(`${e.slice(0,i.start)}${n}${e.slice(i.end)}`,i.start+n.length)},Se=()=>{let e=h.current;e===null||!ae(e)||E(se(e).end)},Ce=R(`mention-input-editor`,t?`is-multiline`:`is-singleline`,c),we=ne?(0,P.jsx)(`div`,{className:`mention-menu`,id:S,role:`listbox`,"aria-label":`Mention people`,children:te.map((e,t)=>(0,P.jsx)(`button`,{className:R(`mention-option`,t===A?`is-selected`:void 0),type:`button`,role:`option`,id:`${S}-option-${t}`,"aria-selected":t===A,onMouseEnter:()=>D(t),onMouseDown:t=>{t.preventDefault(),ue(e)},children:(0,P.jsxs)(`span`,{className:`mention-option-text`,children:[`@`,e.handle]})},e.id))}):null,Te=a?.current;return(0,P.jsxs)(`span`,{className:R(`mention-input`,t?`is-multiline`:void 0),children:[(0,P.jsx)(`div`,{className:Ce,contentEditable:!ie,role:`textbox`,"aria-label":j,"aria-multiline":t,"aria-disabled":ie,"aria-expanded":ne,...ne?{"aria-controls":S}:{},...re===void 0?{}:{"aria-activedescendant":re},"data-placeholder":m.placeholder,"data-max-rows":n,onBlur:e=>{w(!1),l?.(e)},onClick:e=>{Se(),u?.(e)},onFocus:e=>{w(!0),Se(),d?.(e)},onCompositionStart:()=>{v.current=!0;let e=h.current,t=y.current;if(y.current=null,e!==null&&t!==null&&Date.now()-t.createdAt<500&&M(e).slice(t.start,t.end)===t.data){b.current=t,_.current=null,E(t.start),s(t.valueBefore);let n=yy(t.valueBefore,null);wy(e,n),x.current=Sy(n),ce(e,t.start)}else b.current=null},onCompositionEnd:e=>{v.current=!1;let t=Ey(e);_e(t.data===null?{}:{compositionData:t.data})},onBeforeInput:be,onInput:ye,onKeyDown:ve,onKeyUp:e=>{!v.current&&!Ty(e)&&Se(),p?.(e)},onPaste:xe,ref:h,suppressContentEditableWarning:!0}),Te==null?we:(0,vc.createPortal)(we,Te)]})}function jy(e){return(0,P.jsx)(Fi,{...e})}function My({avatar:e,author:t,time:n,children:r,system:i=!1,className:a,...o}){return(0,P.jsxs)(`article`,{className:R(`message`,i?`is-system`:void 0,a),...o,children:[(0,P.jsxs)(`div`,{className:`message-byline`,children:[e,(0,P.jsxs)(`div`,{className:`message-meta`,children:[(0,P.jsx)(`span`,{className:`message-author`,children:t}),n===void 0?null:(0,P.jsx)(`span`,{className:`message-time`,children:n})]})]}),(0,P.jsx)(`div`,{className:`message-content`,children:(0,P.jsx)(`div`,{className:`message-card`,children:r})})]})}function Ny({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`message-markdown`,t),...n,children:(0,P.jsx)(iy,{components:Wy,children:e})})}function Py({children:e}){return(0,P.jsx)(`p`,{children:Oy(e)})}function Fy({children:e}){return(0,P.jsx)(`li`,{children:Oy(e)})}function Iy({children:e}){return(0,P.jsx)(`strong`,{children:Oy(e)})}function Ly({children:e}){return(0,P.jsx)(`em`,{children:Oy(e)})}function Ry({children:e}){return(0,P.jsx)(`h1`,{children:Oy(e)})}function zy({children:e}){return(0,P.jsx)(`h2`,{children:Oy(e)})}function By({children:e}){return(0,P.jsx)(`h3`,{children:Oy(e)})}function Vy({children:e}){return(0,P.jsx)(`h4`,{children:Oy(e)})}function Hy({children:e}){return(0,P.jsx)(`h5`,{children:Oy(e)})}function Uy({children:e}){return(0,P.jsx)(`h6`,{children:Oy(e)})}var Wy={p:Py,li:Fy,strong:Iy,em:Ly,h1:Ry,h2:zy,h3:By,h4:Vy,h5:Hy,h6:Uy};function Gy({name:e,category:t,imageUrl:n,className:r,"aria-label":i,...a}){let o=t===`image`&&n!==void 0;return(0,P.jsx)(`button`,{type:`button`,"aria-label":i??`Open ${t===`image`?`image`:`file`} ${e}`,className:R(`reference-message-card`,t===`image`?`is-image`:`is-file`,r),...a,children:o?(0,P.jsx)(`img`,{className:`reference-message-image`,src:n,alt:e,loading:`lazy`,decoding:`async`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`reference-message-icon`,"aria-hidden":`true`,children:t===`image`?(0,P.jsx)(Ei,{}):(0,P.jsx)(Ci,{})}),(0,P.jsx)(`span`,{className:`reference-message-main`,children:(0,P.jsx)(`strong`,{children:e})})]})})}function Ky({children:e,composer:t,empty:n,title:r=`Chat`,subtitle:i,actions:a,streamRef:o,streamOverlay:s,onStreamScroll:c,dropUploadPending:l=!1,onDropFiles:u,className:d,...f}){return(0,P.jsxs)(dy,{className:R(`panel chat-panel chat-primary`,d),"aria-label":`Group chat`,dropLabel:`Drop references to upload`,pending:l,onFilesUpload:u,...f,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(jy,{"aria-hidden":`true`})}),(0,P.jsxs)(`div`,{className:`panel-title-copy`,children:[(0,P.jsx)(`h3`,{children:r}),i===void 0?null:(0,P.jsx)(`div`,{className:`panel-subtitle`,children:i})]})]}),a===void 0?null:(0,P.jsx)(`div`,{className:`panel-actions`,children:a})]}),(0,P.jsxs)(`div`,{className:`chat-stream-frame`,children:[(0,P.jsx)(`div`,{className:`chat-stream`,ref:o,onScroll:c,children:e??n}),s===void 0?null:(0,P.jsx)(`div`,{className:`chat-stream-overlay`,children:s})]}),t]})}function qy({value:e,placeholder:t,ariaLabel:n,maxLength:r,saving:i=!1,disabled:a=!1,allowEmpty:o=!1,onUpdate:s,className:c,...l}){let u=(0,N.useRef)(null),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(e),[h,g]=(0,N.useState)(!1),_=i||h,v=!a&&!_&&s!==void 0,y=e.trim(),b=y.length===0;(0,N.useEffect)(()=>{d||m(e)},[d,e]),(0,N.useEffect)(()=>{d&&(u.current?.focus(),u.current?.select())},[d]);let x=()=>{m(e),f(!1)},S=()=>{let e=p.trim();if(!o&&e.length===0){x();return}if(e===y){f(!1);return}s===void 0||_||(g(!0),Promise.resolve(s(e)).then(()=>{f(!1)}).catch(()=>void 0).finally(()=>{g(!1)}))},C=e=>{if(e.key===`Enter`){e.preventDefault(),S();return}e.key===`Escape`&&(e.preventDefault(),x())};return(0,P.jsx)(`span`,{className:R(`inline-editable-text`,b?`is-empty`:void 0,d?`is-editing`:void 0,v?void 0:`is-disabled`,c),...l,children:d?(0,P.jsx)(`input`,{ref:u,className:`inline-editable-text-input`,"aria-label":n,value:p,maxLength:r,disabled:_,onBlur:S,onChange:e=>m(e.currentTarget.value),onKeyDown:C}):(0,P.jsx)(`button`,{className:`inline-editable-text-button`,type:`button`,"aria-label":n,disabled:!v,onClick:()=>f(!0),children:b?t:y})})}var Jy={bare:``,quiet:`quiet-button`,pill:`pill-action`,action:`action-button`};function Yy({variant:e=`pill`,label:t,pendingLabel:n=t,pending:r=!1,disabled:i=!1,iconOnly:a=!1,accept:o,icon:s,onFileUpload:c,className:l,...u}){let d=i||r||c===void 0,f=r?n:t,p=e=>{let t=e.currentTarget.files?.[0];e.currentTarget.value=``,t!==void 0&&c?.(t)};return(0,P.jsxs)(`label`,{...u,className:R(Jy[e],d?`is-disabled`:void 0,l),"aria-disabled":d,"aria-busy":r,"aria-label":u[`aria-label`]??f,title:u.title??f,children:[(0,P.jsx)(`input`,{type:`file`,accept:o,disabled:d,onChange:p}),s??(r?(0,P.jsx)(Mi,{className:`is-spinning`,"aria-hidden":`true`}):(0,P.jsx)(_i,{"aria-hidden":`true`})),a?null:(0,P.jsx)(`span`,{children:f})]})}function Xy({value:e,pending:t=!1,uploadPending:n=!1,placeholder:r=`Write a message`,mentionOptions:i,onValueChange:a,onComposerSubmit:o,onFileUpload:s,className:c,...l}){let[u,d]=(0,N.useState)(0),f=(0,N.useRef)(null);return(0,P.jsx)(`form`,{className:R(`composer`,c),"aria-label":`Message composer`,onSubmit:o,...l,children:(0,P.jsxs)(`div`,{className:`composer-input-shell`,ref:f,children:[(0,P.jsx)(Ay,{"aria-label":`Message`,placeholder:r,value:e,multiline:!0,maxRows:8,submitOnEnter:!0,mentionRequestKey:u,menuPortalTargetRef:f,...i===void 0?{}:{mentionOptions:i},onValueChange:a}),(0,P.jsxs)(`div`,{className:`composer-tools`,"aria-label":`Message tools`,children:[(0,P.jsx)(`button`,{className:`composer-tool-button composer-mention-button`,type:`button`,"aria-label":`Mention people`,title:`Mention people`,onClick:()=>d(e=>e+1),children:(0,P.jsx)(oi,{"aria-hidden":`true`})}),(0,P.jsx)(Yy,{variant:`bare`,className:`composer-tool-button composer-upload-button`,label:`Upload image`,pendingLabel:`Uploading image`,pending:n,accept:`image/*`,icon:(0,P.jsx)(Ei,{"aria-hidden":`true`}),iconOnly:!0,onFileUpload:s}),(0,P.jsx)(Yy,{variant:`bare`,className:`composer-tool-button composer-upload-button`,label:`Upload file`,pendingLabel:`Uploading file`,pending:n,icon:(0,P.jsx)(Ci,{"aria-hidden":`true`}),iconOnly:!0,onFileUpload:s}),(0,P.jsx)(`button`,{className:`composer-tool-button composer-send-button`,type:`submit`,disabled:e.trim()===``||t,"aria-label":t?`Sending message`:`Send message`,title:t?`Sending message`:`Send message`,children:(0,P.jsx)(Ki,{"aria-hidden":`true`})})]})]})})}function Zy(e){return(0,P.jsx)(Ri,{...e})}var Qy={a:{advance:504,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 94.5 L346 284 L315 126 L315 31.5 L346 0 L378 0 L441 31.5 L472 63 L536 158`]},b:{advance:441,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 220 L63 31.5 L94.5 0 L126 0 L189 31.5 L252 94.5 L284 189 L284 284 L315 158 L346 126 L410 126 L472 158`]},c:{advance:346,strokes:[`M252 220 L252 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L220 0 L315 63 L378 158`]},d:{advance:504,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 94.5 L472 662`,`M346 284 L315 126 L315 31.5 L346 0 L378 0 L441 31.5 L472 63 L536 158`]},e:{advance:315,strokes:[`M63 63 L126 94.5 L158 126 L189 189 L189 252 L158 284 L126 284 L63 252 L31.5 189 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 63 L346 158`]},f:{advance:252,strokes:[`M31.5 158 L158 315 L220 410 L252 472 L284 567 L284 630 L252 662 L189 630 L158 567 L94.5 315 L0 31.5 L-94.5 -189 L-126 -284 L-126 -346 L-94.5 -378 L-31.5 -346 L0 -252 L31.5 31.5 L63 0 L126 0 L189 31.5 L220 63 L284 158`]},g:{advance:472,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 63`,`M346 284 L284 63 L158 -284 L126 -346 L63 -378 L31.5 -346 L31.5 -284 L63 -189 L158 -94.5 L252 -31.5 L315 0 L410 63 L504 158`]},h:{advance:472,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 252 L31.5 0`,`M31.5 0 L63 94.5 L94.5 158 L158 252 L220 284 L284 284 L315 252 L315 189 L284 94.5 L284 31.5 L315 0 L346 0 L410 31.5 L441 63 L504 158`]},i:{advance:220,strokes:[`M31.5 158 L94.5 284 L31.5 94.5 L31.5 31.5 L63 0 L94.5 0 L158 31.5 L189 63 L252 158`],accents:[`M126 441 L126 410 L158 410 L158 441 L126 441`]},j:{advance:220,strokes:[`M31.5 158 L94.5 284 L-94.5 -284 L-126 -346 L-189 -378 L-220 -346 L-220 -284 L-189 -189 L-94.5 -94.5 L0 -31.5 L63 0 L158 63 L252 158`],accents:[`M126 441 L126 410 L158 410 L158 441 L126 441`]},k:{advance:441,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 252 L31.5 0`,`M31.5 0 L63 94.5 L94.5 158 L158 252 L220 284 L284 284 L315 252 L315 189 L252 158 L158 158`,`M158 158 L220 126 L252 31.5 L284 0 L315 0 L378 31.5 L410 63 L472 158`]},l:{advance:252,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 220 L63 31.5 L94.5 0 L126 0 L189 31.5 L220 63 L284 158`]},m:{advance:788,strokes:[`M31.5 158 L94.5 252 L158 284 L189 252 L189 220 L158 94.5 L126 0`,`M158 94.5 L189 158 L252 252 L315 284 L378 284 L410 252 L410 220 L378 94.5 L346 0`,`M378 94.5 L410 158 L472 252 L536 284 L598 284 L630 252 L630 189 L598 94.5 L598 31.5 L630 0 L662 0 L724 31.5 L756 63 L819 158`]},n:{advance:567,strokes:[`M31.5 158 L94.5 252 L158 284 L189 252 L189 220 L158 94.5 L126 0`,`M158 94.5 L189 158 L252 252 L315 284 L378 284 L410 252 L410 189 L378 94.5 L378 31.5 L410 0 L441 0 L504 31.5 L536 63 L598 158`]},o:{advance:441,strokes:[`M220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 63 L315 126 L315 189 L284 252 L220 284 L189 252 L189 189 L220 126 L284 94.5 L378 94.5 L441 126 L472 158`]},p:{advance:472,strokes:[`M31.5 158 L94.5 252 L126 315 L94.5 189 L-94.5 -378`,`M94.5 189 L126 252 L189 284 L252 284 L315 252 L346 189 L346 126 L315 63 L284 31.5 L220 0`,`M94.5 31.5 L158 0 L252 0 L346 31.5 L410 63 L504 158`]},q:{advance:472,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5`,`M346 284 L315 189 L252 31.5 L158 -189 L126 -284 L126 -346 L158 -378 L220 -346 L252 -252 L252 -31.5 L315 0 L410 63 L504 158`]},r:{advance:410,strokes:[`M31.5 158 L94.5 252 L126 315 L126 252 L220 252 L252 220 L252 158 L220 63 L220 31.5 L252 0 L284 0 L346 31.5 L378 63 L441 158`]},s:{advance:346,strokes:[`M31.5 158 L94.5 252 L126 315 L126 252 L189 158 L220 94.5 L220 31.5 L158 0`,`M31.5 31.5 L94.5 0 L220 0 L284 31.5 L315 63 L378 158`]},t:{advance:284,strokes:[`M31.5 158 L94.5 252 L158 378`,`M252 662 L63 94.5 L63 31.5 L94.5 0 L158 0 L220 31.5 L252 63 L315 158`],accents:[`M63 410 L284 410`]},u:{advance:472,strokes:[`M31.5 158 L94.5 284 L31.5 94.5 L31.5 31.5 L63 0 L126 0 L189 31.5 L252 94.5 L315 189`,`M346 284 L284 94.5 L284 31.5 L315 0 L346 0 L410 31.5 L441 63 L504 158`]},v:{advance:472,strokes:[`M31.5 158 L94.5 284 L63 126 L63 31.5 L94.5 0 L126 0 L220 31.5 L284 94.5 L315 189 L315 284`,`M315 284 L346 158 L378 126 L441 126 L504 158`]},w:{advance:662,strokes:[`M126 284 L63 220 L31.5 126 L31.5 63 L63 0 L126 0 L189 31.5 L252 94.5`,`M315 284 L252 94.5 L252 31.5 L284 0 L346 0 L410 31.5 L472 94.5 L504 189 L504 284`,`M504 284 L536 158 L567 126 L630 126 L693 158`]},x:{advance:504,strokes:[`M31.5 158 L94.5 252 L158 284 L220 284 L252 252 L252 31.5 L284 0 L378 0 L472 63 L536 158`,`M441 252 L410 284 L346 284 L315 252 L189 31.5 L158 0 L94.5 0 L63 31.5`]},y:{advance:472,strokes:[`M31.5 158 L94.5 284 L31.5 94.5 L31.5 31.5 L63 0 L126 0 L189 31.5 L252 94.5 L315 189`,`M346 284 L158 -284 L126 -346 L63 -378 L31.5 -346 L31.5 -284 L63 -189 L158 -94.5 L252 -31.5 L315 0 L410 63 L504 158`]},z:{advance:441,strokes:[`M31.5 158 L94.5 252 L158 284 L220 284 L284 220 L284 158 L252 94.5 L189 31.5 L94.5 0 L158 -31.5 L189 -94.5 L189 -189 L158 -284 L126 -346 L63 -378 L31.5 -346 L31.5 -284 L63 -189 L158 -94.5 L252 -31.5 L378 63 L472 158`]}},$y=[{id:`collaboration`,weight:30,words:`aligning.pairing.joining.syncing.sharing.weaving.blending.bridging.linking.merging.uniting.teaming.huddling.gathering.relaying.listening.helping.guiding.shaping.connecting.combining.supporting.assisting.exchanging.conversing.adapting.partnering.allying.chatting.consulting.conferring.responding.cooperating`.split(`.`)},{id:`context`,weight:35,words:`reading.noting.jotting.drafting.writing.mapping.sorting.sifting.grouping.capturing.recapping.reviewing.refining.distilling.curating.reflecting.outlining.planning.framing.clarifying.tracing.scanning.parsing.thinking.exploring.studying.checking.polishing.revising.editing.annotating.organizing.focusing.preparing.sketching.collecting.discerning.condensing.digesting.extracting.structuring.surfacing.orienting.grounding.noticing.pondering.considering.reasoning`.split(`.`)},{id:`music`,weight:25,words:`tuning.attuning.cueing.riffing.jamming.humming.echoing.arranging.composing.rehearsing.flowing.scoring.phrasing.voicing.conducting.playing.resonating.balancing.reprising.performing.grooving.tapping.strumming.singing.rhyming.dancing.swaying.drumming.plucking.chanting.whistling`.split(`.`)},{id:`playful`,weight:10,words:`brewing.steeping.simmering.whisking.doodling.tinkering.noodling.puzzling.sprouting.unfurling.vibing.musing.roaming.stitching.threading.blooming.glowing.buzzing.cooking.stirring.mixing.rolling.gliding.looping.twirling.dreaming.imagining.conjuring.hatching.unfolding.shuffling.percolating.scribbling.whittling.bubbling.fizzing.sparkling.whirring.wobbling.growing.ripening.wondering.inventing.crafting`.split(`.`)}];$y.reduce((e,t)=>e+t.words.length,0);function eb(e){return Math.min(.999999,Math.max(0,e()))}function tb(e,t){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(eb(t)*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}function nb(e=Math.random,t=()=>!0){let n=$y.map(e=>({...e,words:e.words.filter(t)})).filter(e=>e.words.length>0),r=n.length>0?n:$y,i=new Map,a=r.reduce((e,t)=>e+t.weight,0),o;return()=>{let t=eb(e)*a,n=r.find(e=>(t-=e.weight,t<0))??r[0],s=i.get(n.id);(s===void 0||s.length===0)&&(s=tb(n.words,e),i.set(n.id,s));let c=s.pop()??n.words[0];return c===o&&s.length>0&&(s.unshift(c),c=s.pop()??n.words[0]),o=c,c}}var rb=.078,ib=57,ab=4,ob=.1,sb=.7,cb=.84,lb=.94,ub=.012,db=1.5,fb=24;function pb(e,t,n){return Math.min(n,Math.max(t,e))}function mb(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function hb(e){return Number(e.toFixed(3)).toString()}function gb(e,t){let n=e.match(/-?\d+(?:\.\d+)?/gu)?.map(Number)??[],r=[];for(let e=0;e<n.length-1;e+=2)r.push({x:t+(n[e]??0)*rb,y:ib-(n[e+1]??0)*rb});return r}function _b(e){if(e.length===0)return``;let t=e[0],n=[`M ${hb(t.x)} ${hb(t.y)}`];for(let t of e.slice(1))n.push(`L ${hb(t.x)} ${hb(t.y)}`);return n.join(` `)}function vb(e){if(e.length<3)return[...e];let t=.22,n=[...e];for(let e=0;e<3;e+=1){let e=[n[0]];for(let r=0;r<n.length-1;r+=1){let i=n[r],a=n[r+1];e.push({x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t},{x:i.x*t+a.x*(1-t),y:i.y*t+a.y*(1-t)})}e.push(n[n.length-1]),n=e}return n}function yb(e){if(e.length<3)return _b(e);let t=.9,n=e[0],r=[`M ${hb(n.x)} ${hb(n.y)}`];for(let n=0;n<e.length-1;n+=1){let i=e[Math.max(0,n-1)],a=e[n],o=e[n+1],s=e[Math.min(e.length-1,n+2)],c={x:a.x+(o.x-i.x)*t/6,y:a.y+(o.y-i.y)*t/6},l={x:o.x-(s.x-a.x)*t/6,y:o.y-(s.y-a.y)*t/6};r.push(`C ${hb(c.x)} ${hb(c.y)} ${hb(l.x)} ${hb(l.y)} ${hb(o.x)} ${hb(o.y)}`)}return r.join(` `)}function bb(e){let t=ab,n=[],r=[],i=[];for(let[a,o]of[...e.toLowerCase()].entries()){let e=Qy[o];if(e!==void 0){for(let[r,o]of e.strokes.entries()){let e=vb(gb(o,t));i.push(...e),n.push({id:`${a}:body:${r}`,path:yb(e),role:`body`})}for(let[n,o]of(e.accents??[]).entries()){let e=gb(o,t);i.push(...e),r.push({id:`${a}:accent:${n}`,path:_b(e),role:`accent`})}t+=e.advance*rb}}if(i.length===0)return{height:fb,strokes:[],viewBox:`0 0 64 64`,width:fb};let a=i.map(e=>e.x),o=i.map(e=>e.y),s=Math.floor(Math.min(0,...a.map(e=>e-6))),c=Math.ceil(Math.max(t,...a.map(e=>e+6))),l=Math.floor(Math.min(0,...o.map(e=>e-4))),u=Math.ceil(Math.max(64,...o.map(e=>e+4))),d=c-s,f=u-l;return{height:fb,strokes:[...n,...r],viewBox:`${s} ${l} ${d} ${f}`,width:Number((d*fb/f).toFixed(2))}}var xb=nb(Math.random,e=>bb(e).width<=96);function Sb(e){for(let t of e.strokes)t.path.style.opacity=`0`,t.path.style.strokeDashoffset=`${t.length}`}function Cb(e){for(let t of e.strokes)t.path.style.opacity=`1`,t.path.style.strokeDashoffset=`0`}function wb(e,t,n){let r=t;for(let[t,i]of e.strokes.entries()){if(i.path.style.opacity=`${n}`,r<=0){i.path.style.strokeDashoffset=`${i.length}`;continue}let a=Math.min(i.length,r);if(i.path.style.strokeDashoffset=`${i.length-a}`,r-=a,a<i.length)break;if(t<e.strokes.length-1){if(r<e.transitionLength)break;r-=e.transitionLength}}}function Tb(e,t){let n=t%e.duration/e.duration;if(n<ob||n>=lb){Sb(e);return}if(n<=sb){wb(e,mb(pb((n-ob)/(sb-ob),0,1))*e.totalLength,1);return}let r=n<=cb?1:1-pb((n-cb)/(lb-cb),0,1);wb(e,e.totalLength,r)}function Eb({word:e,className:t,...n}){let[r]=(0,N.useState)(()=>e??xb()),i=e??r,a=(0,N.useMemo)(()=>bb(i),[i]),o=(0,N.useRef)(null);return(0,N.useEffect)(()=>{let e=o.current;if(e===null)return;let t=[...e.querySelectorAll(`[data-writing-stroke]`)].map(e=>{let t=e.getTotalLength();return e.style.strokeDasharray=`${t} ${t}`,e.style.strokeDashoffset=`${t}`,{length:t,path:e}});if(t.length===0)return;let n=t.reduce((e,t)=>e+t.length,0),r=n*ub,i=n+r*Math.max(0,t.length-1),a={duration:pb(4e3+i*4.4,5e3,7600)*db,strokes:t,totalLength:i,transitionLength:r},s=window.matchMedia(`(prefers-reduced-motion: reduce)`),c,l,u=()=>{c!==void 0&&(window.cancelAnimationFrame(c),c=void 0)},d=e=>{l===void 0&&(l=e-a.duration*ob),Tb(a,e-l),c=window.requestAnimationFrame(d)},f=()=>{if(u(),s.matches){Cb(a);return}Sb(a),l=void 0,c=window.requestAnimationFrame(d)};return s.addEventListener(`change`,f),f(),()=>{s.removeEventListener(`change`,f),u()}},[a]),(0,P.jsxs)(`span`,{className:R(`scratchpad-writing-indicator`,t),role:`status`,"aria-label":`Refreshing Scratchpad`,"data-writing-word":i,...n,children:[(0,P.jsx)(zi,{"aria-hidden":`true`,className:`scratchpad-writing-icon`}),(0,P.jsx)(`svg`,{"aria-hidden":`true`,className:`scratchpad-writing-canvas`,focusable:`false`,height:a.height,ref:o,viewBox:a.viewBox,width:a.width,children:a.strokes.map(e=>(0,P.jsx)(`path`,{d:e.path,"data-writing-role":e.role,"data-writing-stroke":``},e.id))})]})}var Db={confirmed:(0,P.jsx)(li,{"aria-hidden":`true`}),question:(0,P.jsx)(pi,{"aria-hidden":`true`}),"task-change":(0,P.jsx)(Zi,{"aria-hidden":`true`})};function Ob({kind:e,children:t,className:n,...r}){return(0,P.jsxs)(`div`,{className:R(`scratchpad-row`,`is-${e}`,n),...r,children:[(0,P.jsx)(`span`,{className:`scratchpad-marker`,"aria-hidden":`true`,children:Db[e]}),(0,P.jsx)(`p`,{children:t})]})}function kb({compiledTasks:e=[],onOpenCompiledTask:t}){return(0,P.jsxs)(`section`,{className:`scratchpad-submitted-receipt`,"aria-label":`Submitted to Worklist`,children:[(0,P.jsxs)(`div`,{className:`scratchpad-submitted-receipt-header`,children:[(0,P.jsx)(`strong`,{children:`Submitted to Worklist`}),(0,P.jsx)(li,{className:`scratchpad-submitted-receipt-check`,"aria-hidden":`true`})]}),e.length===0?(0,P.jsxs)(`div`,{className:`scratchpad-submitted-empty`,role:`status`,children:[(0,P.jsx)(Zi,{"aria-hidden":`true`}),(0,P.jsxs)(`span`,{className:`scratchpad-submitted-empty-copy`,children:[(0,P.jsx)(`span`,{children:`No new task created`}),(0,P.jsx)(`small`,{children:`This Scratchpad was submitted, but no Worklist task was added.`})]})]}):(0,P.jsx)(`div`,{className:`scratchpad-submitted-task-list`,children:e.map(e=>(0,P.jsxs)(`button`,{className:`scratchpad-submitted-task`,disabled:t===void 0,onClick:()=>t?.(e.taskId),type:`button`,children:[(0,P.jsxs)(`span`,{className:`scratchpad-submitted-task-copy`,children:[(0,P.jsx)(`span`,{children:e.title}),(0,P.jsx)(`small`,{children:e.moduleName})]}),(0,P.jsx)(di,{"aria-hidden":`true`})]},e.taskId))})]})}function Ab({title:e,summary:t,sections:n,updatedLabel:r,updatedLabelPrefix:i=`Updated`,footerNote:a,submitAvailable:o,pages:s,empty:c,actionsDisabled:l=!1,compact:u=!1,syncPending:d=!1,submitPending:f=!1,onSubmitScratchpad:p,onOpenCompiledTask:m,className:h,...g}){let _=s!==void 0&&s.length>0,v=(0,N.useMemo)(()=>s!==void 0&&s.length>0?s:[{key:`current`,title:e,summary:t,sections:n,...r===void 0?{}:{updatedLabel:r},updatedLabelPrefix:i,...a===void 0?{}:{footerNote:a},...o===void 0?{}:{submitAvailable:o}}],[a,s,n,o,t,e,r,i]),y=Math.max(0,v.length-1),b=v[y]?.key,[x,S]=(0,N.useState)(y);(0,N.useEffect)(()=>{S(y)},[y,b]);let C=Math.min(x,Math.max(0,v.length-1)),w=v[C]??{key:`current`,title:e,summary:t,sections:n,...r===void 0?{}:{updatedLabel:r},updatedLabelPrefix:i,...a===void 0?{}:{footerNote:a},...o===void 0?{}:{submitAvailable:o}},T=d||f,E=w.submitAvailable??w.sections.length>0,ee=l||T||!E||w.submitted===!0;return(0,P.jsx)(ma,{title:`Scratchpad`,icon:(0,P.jsx)(Zy,{"aria-hidden":`true`}),className:R(`scratchpad-panel`,u?`is-compact`:void 0,h),"aria-busy":T,...g,children:(0,P.jsxs)(`div`,{className:`scratchpad-panel-body scratchpad`,children:[!_&&w.sections.length===0?c??(0,P.jsx)(`div`,{}):(0,P.jsxs)(`div`,{className:R(`scratchpad-content`,w.submitted===!0?`is-submitted`:void 0),children:[(0,P.jsx)(`div`,{className:`scratchpad-head`,children:(0,P.jsx)(`div`,{children:(0,P.jsx)(`h4`,{children:w.title})})}),(0,P.jsx)(`p`,{className:`scratchpad-summary`,children:w.summary}),w.sections.map(e=>(0,P.jsxs)(`section`,{className:`scratchpad-section`,"aria-labelledby":e.id,children:[(0,P.jsx)(`span`,{className:`scratchpad-label`,id:e.id,children:e.label}),(0,P.jsx)(`div`,{className:`scratchpad-list`,children:e.rows.map(t=>(0,P.jsx)(Ob,{kind:t.kind,children:t.text},`${e.id}:${t.text}`))})]},e.id)),w.submitted===!0?(0,P.jsx)(kb,{compiledTasks:w.compiledTasks??[],...m===void 0?{}:{onOpenCompiledTask:m}}):null]},w.key),!u&&v.length>1?(0,P.jsx)(`div`,{className:`scratchpad-history-nav`,children:(0,P.jsx)(pa,{"aria-label":`Scratchpad history`,currentPage:C,maxVisible:7,pageAriaLabel:e=>`Scratchpad page ${e+1}`,pageCount:v.length,onPageChange:S})}):null,(0,P.jsxs)(`div`,{className:`scratchpad-footer`,children:[w.footerNote===void 0?null:(0,P.jsx)(`p`,{className:R(`scratchpad-footer-note`,w.footerNote.tone===`error`?`is-error`:void 0),title:w.footerNote.text,children:w.footerNote.text}),u&&!d?null:(0,P.jsx)(`div`,{className:`scratchpad-submit-context`,children:d?(0,P.jsx)(Eb,{}):w.updatedLabel===void 0?null:(0,P.jsxs)(`span`,{className:`scratchpad-updated-at`,children:[(0,P.jsx)(`span`,{children:w.updatedLabelPrefix??`Updated`}),(0,P.jsx)(`span`,{children:w.updatedLabel})]})}),(0,P.jsx)(`div`,{className:`scratchpad-footer-actions`,children:(0,P.jsxs)(xs,{className:R(`scratchpad-submit-button`,f?`is-submitting`:void 0),type:`button`,"aria-busy":f,disabled:ee,onClick:p,children:[f?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(Bi,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:f?`Running`:`Run`})]})})]})]})})}function jb(e){return e===`done`?(0,P.jsx)(li,{"aria-hidden":`true`}):e===`failed`?(0,P.jsx)(mi,{"aria-hidden":`true`}):e===`pending`?(0,P.jsx)(na,{"aria-hidden":`true`}):e===`running`?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(hi,{"aria-hidden":`true`})}function Mb(e){return e===`complete`?`Complete`:e===`failed`?`Failed`:e===`pending`?`Needs input`:`Running`}function Nb(e){return(0,P.jsx)(ra,{"aria-hidden":`true`,"data-tone":e})}function Pb({title:e,summary:t,tone:n,steps:r,metaLabel:i,className:a,...o}){let s=i??Mb(n),c=o[`aria-label`]??`${e}. ${s}. ${t}`;return(0,P.jsx)(ma,{title:e,icon:Nb(n),className:R(`execution-progress-panel`,`is-${n}`,a),"aria-label":c,...o,children:(0,P.jsx)(`div`,{className:`execution-progress-body`,children:(0,P.jsx)(`div`,{className:`execution-progress-list`,children:r.map(e=>(0,P.jsxs)(`div`,{className:R(`execution-progress-step`,`is-${e.status}`),children:[(0,P.jsx)(`span`,{className:R(`execution-progress-marker`,`is-${e.status}`),"aria-hidden":`true`,children:jb(e.status)}),(0,P.jsxs)(`span`,{className:`execution-progress-step-content`,children:[(0,P.jsxs)(`span`,{className:`execution-progress-step-title`,children:[(0,P.jsx)(`span`,{className:`execution-progress-step-label`,children:e.label}),e.elapsedLabel===void 0?null:(0,P.jsxs)(`span`,{className:`execution-progress-step-elapsed`,children:[` `,`(`,e.elapsedLabel,`)`]})]}),e.detail===void 0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-detail`,children:e.detail}),e.metrics===void 0||e.metrics.length===0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-metrics`,children:e.metrics.map(e=>(0,P.jsx)(`span`,{className:`execution-progress-step-metric`,children:e},e))})]})]},e.id))})})})}function Fb({tone:e=`neutral`,compact:t=!1,asChild:n=!1,className:r,...i}){return(0,P.jsx)(n?as:`div`,{className:R(`chat-event-card`,`is-${e}`,t?`is-compact`:void 0,r),...i})}function Ib({as:e=`div`,icon:t,title:n,meta:r,action:i,className:a,...o}){return(0,P.jsxs)(e,{className:R(`chat-event-card-header`,a),...o,children:[(0,P.jsx)(Lb,{children:t}),(0,P.jsxs)(`span`,{className:`chat-event-card-title`,children:[(0,P.jsx)(`strong`,{children:n}),r===void 0?null:(0,P.jsx)(`span`,{className:`chat-event-card-meta`,children:r})]}),i]})}function Lb({className:e,...t}){return(0,P.jsx)(`span`,{className:R(`chat-event-card-status-icon`,e),...t})}function Rb({className:e,...t}){return(0,P.jsx)(`div`,{className:R(`chat-event-card-body`,e),...t})}function zb({className:e,...t}){return(0,P.jsx)(`footer`,{className:R(`chat-event-card-footer`,e),...t})}function Bb(e){return e===`done`?`success`:e===`failed`?`danger`:e===`pending`?`warning`:`neutral`}function Vb(e){return e===`done`?(0,P.jsx)(li,{"aria-hidden":`true`}):e===`failed`?(0,P.jsx)(ia,{"aria-hidden":`true`}):(0,P.jsx)(Pi,{"aria-hidden":`true`})}function Hb({title:e,summary:t,request:n,messages:r,draft:i,contextLabel:a,defaultOpen:o,readOnly:s=!1,replyCount:c,status:l,statusLabel:u,mentionOptions:d,sendPending:f=!1,submitPending:p=!1,onDraftChange:m,onSendMessage:h,onSubmitRound:g,className:_,...v}){let y=t.trim()===``?n:t,b=a===void 0?y:`${y} (${a})`,[x,S]=(0,N.useState)(o??!0),C=l??(s?`done`:`pending`),w=u??(s?`submitted`:`needs input`),T=c??r.length,E=p||T===0,ee=T===0?`No replies`:`${T} ${T===1?`reply`:`replies`}`,D=Bb(C),O=`${w} · ${ee}`,k=(0,P.jsxs)(Rb,{className:`chat-clarification-card-body`,children:[(0,P.jsx)(`div`,{className:`chat-event-thread`,children:r.map(e=>(0,P.jsxs)(`article`,{className:`chat-event-message`,children:[e.avatar,(0,P.jsxs)(`div`,{className:`chat-event-message-copy`,children:[(0,P.jsxs)(`div`,{className:`message-meta`,children:[(0,P.jsx)(`span`,{className:`message-author`,children:e.author}),e.time===void 0?null:(0,P.jsx)(`span`,{className:`message-time`,children:e.time})]}),(0,P.jsx)(`p`,{children:(0,P.jsx)(ky,{children:e.body})})]})]},e.id))}),s?null:(0,P.jsx)(`form`,{className:`chat-event-composer`,"aria-label":`Round reply`,onSubmit:h,children:(0,P.jsxs)(`div`,{className:`composer-input-shell chat-event-composer-input-shell`,children:[(0,P.jsx)(Ay,{type:`text`,"aria-label":`Round message`,value:i,placeholder:`Reply in this round`,multiline:!0,maxRows:4,submitOnEnter:!0,...d===void 0?{}:{mentionOptions:d},onValueChange:m}),(0,P.jsx)(`div`,{className:`composer-tools chat-event-composer-tools`,"aria-label":`Round message tools`,children:(0,P.jsx)(`button`,{className:`composer-tool-button composer-send-button chat-event-send-button`,type:`submit`,disabled:i.trim()===``||f,"aria-label":f?`Sending round message`:`Send round message`,title:f?`Sending round message`:`Send round message`,children:(0,P.jsx)(Ki,{"aria-hidden":`true`})})})]})})]});return(0,P.jsx)(`article`,{className:R(`message is-chat-event`,_),...v,children:s?(0,P.jsx)(Fb,{tone:D,asChild:!0,children:(0,P.jsxs)(`details`,{className:`chat-clarification-card`,open:x,"aria-label":b,onToggle:e=>S(e.currentTarget.open),children:[(0,P.jsx)(Ib,{as:`summary`,icon:Vb(C),title:e,meta:O,action:(0,P.jsx)(`span`,{className:`chat-event-card-toggle`,"aria-hidden":`true`,children:(0,P.jsx)(ui,{})})}),k]})}):(0,P.jsx)(Fb,{tone:D,asChild:!0,children:(0,P.jsxs)(`section`,{className:`chat-clarification-card is-fixed-open`,"aria-label":b,children:[(0,P.jsx)(Ib,{icon:Vb(C),title:e,meta:O,tabIndex:-1,action:(0,P.jsxs)(xs,{className:`chat-event-primary-action`,type:`button`,"aria-label":T===0?`Reply before submitting round`:`Submit round`,"aria-busy":p,disabled:E,title:T===0?`Reply before submitting round`:`Submit round`,onClick:g,children:[p?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(li,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`button-label`,children:p?`Submitting`:`Submit`})]})}),k]})})})}function Ub({decision:e,disabled:t,onDecide:n}){let r=e.tone===`primary`?xs:Ss,i=e.decisionId.startsWith(`allow`)?(0,P.jsx)(li,{"aria-hidden":`true`}):(0,P.jsx)(ia,{"aria-hidden":`true`});return(0,P.jsxs)(r,{type:`button`,className:R(`chat-approval-card-decision`,e.tone===`primary`?`is-primary`:void 0,e.tone===`danger`?`is-danger`:void 0),disabled:t,onClick:()=>n(e.decisionId),children:[i,(0,P.jsx)(`span`,{className:`button-label`,children:e.label})]})}function Wb(e,t){return e===`pending`?`warning`:e===`resolved`?`success`:/expired|cancelled/iu.test(t)?`neutral`:`danger`}function Gb(e){return e===`success`?(0,P.jsx)(li,{"aria-hidden":`true`}):e===`danger`?(0,P.jsx)(ia,{"aria-hidden":`true`}):e===`neutral`?(0,P.jsx)(gi,{"aria-hidden":`true`}):(0,P.jsx)(Yi,{"aria-hidden":`true`})}function Kb({title:e,summary:t,reason:n,status:r,statusLabel:i,detailLabel:a,detail:o,detailCode:s=!1,decisions:c=[],decisionPending:l=!1,resolutionLabel:u,defaultOpen:d,onDecide:f,className:p,...m}){let[h,g]=(0,N.useState)(d??r===`pending`),_=Wb(r,i),v=[...c].sort((e,t)=>e.tone===t.tone?0:e.tone===`primary`?-1:+(t.tone===`primary`)),y=r===`pending`&&f!==void 0?(0,P.jsx)(zb,{className:`chat-approval-card-actions`,children:v.map(e=>(0,P.jsx)(Ub,{decision:e,disabled:l,onDecide:f},e.decisionId))}):null,b=(0,P.jsx)(Rb,{className:`chat-approval-card-body`,children:(0,P.jsxs)(`div`,{className:`chat-approval-card-content`,children:[(0,P.jsx)(`p`,{className:`chat-approval-card-summary`,children:t}),n===void 0?null:(0,P.jsx)(`p`,{className:`chat-approval-card-reason`,children:n}),o===void 0?null:(0,P.jsxs)(`div`,{className:`chat-approval-card-detail`,children:[a===void 0?null:(0,P.jsx)(`span`,{className:`chat-approval-card-detail-label`,children:a}),s?(0,P.jsx)(`code`,{className:`chat-approval-card-detail-code`,children:o}):(0,P.jsx)(`span`,{className:`chat-approval-card-detail-text`,children:o})]}),r===`pending`||u===void 0?null:(0,P.jsx)(`p`,{className:`chat-approval-card-resolution`,children:u})]})});return(0,P.jsx)(`article`,{className:R(`message is-chat-event`,p),...m,children:r===`pending`?(0,P.jsx)(Fb,{tone:_,asChild:!0,children:(0,P.jsxs)(`section`,{className:`chat-approval-card is-fixed-open`,"aria-label":t,children:[(0,P.jsx)(Ib,{icon:Gb(_),title:e,meta:i,tabIndex:-1}),b,y]})}):(0,P.jsx)(Fb,{tone:_,asChild:!0,children:(0,P.jsxs)(`details`,{className:`chat-approval-card`,open:h,"aria-label":t,onToggle:e=>g(e.currentTarget.open),children:[(0,P.jsx)(Ib,{as:`summary`,icon:Gb(_),title:e,meta:i,action:(0,P.jsx)(`span`,{className:`chat-event-card-toggle`,"aria-hidden":`true`,children:(0,P.jsx)(ui,{})})}),b]})})})}function qb({status:e,title:t,taskId:n,taskTitle:r,summary:i,moduleName:a,finalNote:o,generatedFiles:s=[],errorCode:c,onOpenTask:l,className:u,...d}){let f=o?.trim()??``,p=i.trim(),m=f.length>0?f:p,h=e===`completed`?`Task completed`:`Task failed`;return(0,P.jsx)(`article`,{className:R(`message is-chat-event is-task-result`,u),...d,children:(0,P.jsx)(Fb,{tone:e===`completed`?`success`:`danger`,compact:!0,asChild:!0,children:(0,P.jsxs)(`button`,{className:R(`chat-task-result-card`,`is-${e}`),disabled:l===void 0,onClick:()=>l?.(n),type:`button`,"aria-label":`${t}: ${r}`,children:[(0,P.jsx)(Lb,{"aria-hidden":`true`,children:e===`completed`?(0,P.jsx)(li,{}):(0,P.jsx)(ia,{})}),(0,P.jsxs)(`span`,{className:`chat-task-result-card-main`,children:[(0,P.jsx)(`span`,{className:`chat-task-result-card-state`,children:h}),(0,P.jsx)(`strong`,{children:r}),a===void 0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-module`,children:a}),m.length===0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-summary`,children:m}),c===void 0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-error-code`,children:c}),s.length===0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-files`,"aria-label":`Generated files`,children:s.map(e=>(0,P.jsxs)(`span`,{className:`chat-task-result-card-file`,children:[(0,P.jsx)(Ci,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:e.name})]},e.path))})]}),(0,P.jsx)(`span`,{className:`chat-task-result-card-arrow`,"aria-hidden":`true`,children:(0,P.jsx)(di,{})})]})})})}function Jb({status:e}){return e===`done`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(li,{})}):e===`pending`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(Ii,{})}):e===`failed`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(ia,{})}):e===`running`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(Mi,{})}):(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`})}function Yb({title:e,status:t,selected:n=!1,className:r,type:i=`button`,...a}){return(0,P.jsxs)(`button`,{className:R(`task-row`,n?`is-selected`:void 0,`is-${t}`,r),type:i,"aria-current":n?`true`:void 0,...a,children:[(0,P.jsx)(Jb,{status:t}),(0,P.jsx)(`div`,{className:`task-row-main`,children:(0,P.jsx)(`div`,{className:`task-title-line`,children:(0,P.jsx)(`strong`,{children:e})})})]})}function Xb({label:e,value:t,code:n=!1,status:r}){return(0,P.jsxs)(`div`,{className:`detail-row`,children:[(0,P.jsx)(`span`,{children:e}),r===void 0?n?(0,P.jsx)(`code`,{children:t}):(0,P.jsx)(`strong`,{children:t}):(0,P.jsx)(`strong`,{children:(0,P.jsx)(Ts,{status:r,children:t})})]})}function Zb({rows:e}){return(0,P.jsx)(P.Fragment,{children:e.map((e,t)=>(0,N.createElement)(Xb,{...e,key:`${e.label}-${t}`}))})}function Qb({...e}){return(0,P.jsx)(Yb,{...e})}function $b({detail:e,missingTaskId:t}){return e===void 0?(0,P.jsxs)(`aside`,{className:`task-detail-card`,"aria-label":`Selected task details`,children:[(0,P.jsx)(`div`,{className:`task-detail-head`,children:(0,P.jsx)(`h4`,{children:t===void 0?`No task selected`:`Task not found`})}),(0,P.jsx)(`p`,{children:t===void 0?`Select a task to inspect its contract, latest result, and run history.`:`No task exists for ${t}. Select another task from the Worklist.`})]}):(0,P.jsxs)(`aside`,{className:`task-detail-card`,"aria-label":`Selected task details`,children:[(0,P.jsxs)(`div`,{className:`task-detail-head`,children:[(0,P.jsx)(Ts,{status:e.status,children:e.status}),(0,P.jsx)(`h4`,{children:e.title})]}),(0,P.jsx)(`p`,{children:e.summary}),(0,P.jsxs)(`section`,{className:`task-detail-section`,"aria-label":`Task contract`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Task contract`}),(0,P.jsx)(Zb,{rows:e.contractRows})]}),(0,P.jsxs)(`section`,{className:`task-detail-section task-evidence-section`,"aria-label":`Evidence`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Evidence`}),(0,P.jsx)(Zb,{rows:e.evidenceRows??e.resultRows})]}),(0,P.jsxs)(`section`,{className:`task-detail-section`,"aria-label":`Run result history`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Run result history`}),e.runResults.length===0?(0,P.jsx)(`p`,{children:`No run result yet.`}):(0,P.jsx)(`div`,{className:`run-result-list`,children:e.runResults.map(e=>(0,P.jsx)(`article`,{className:`run-result-item`,children:(0,P.jsxs)(`div`,{className:`run-result-item-head`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:e.title}),e.meta===void 0?null:(0,P.jsx)(`small`,{children:e.meta})]}),e.status===void 0?null:(0,P.jsx)(Ts,{status:e.status,children:e.status})]})},e.id))})]})]})}function ex({modules:e,taskCount:t,detail:n,missingTaskId:r,runNote:i,onSelectTask:a,empty:o,className:s,...c}){return(0,P.jsx)(ma,{title:`Worklist`,icon:(0,P.jsx)(ji,{"aria-hidden":`true`}),action:(0,P.jsx)(`div`,{className:`worklist-header-summary`,children:(0,P.jsx)(`span`,{className:`mini-meta`,children:t===1?`1 task`:`${t} tasks`})}),className:R(`tasks worklist-page-panel`,s),...c,children:(0,P.jsxs)(`div`,{className:`worklist-page-body`,children:[i===void 0?null:(0,P.jsx)(`p`,{className:`worklist-run-note`,children:i}),e.length===0?(0,P.jsx)(`div`,{className:`worklist-page-empty`,children:o??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No compiled tasks`})}):(0,P.jsxs)(`div`,{className:`task-board-body`,children:[(0,P.jsx)(`div`,{className:`task-list`,"aria-label":`Tasks`,children:e.map(e=>(0,P.jsxs)(`div`,{className:`task-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:e.label}),e.rows.map(e=>(0,P.jsx)(Qb,{title:e.title,status:e.status,onClick:()=>a?.(e.id),...e.selected===void 0?{}:{selected:e.selected}},e.id))]},e.label))}),(0,P.jsx)($b,{...n===void 0?{}:{detail:n},...r===void 0?{}:{missingTaskId:r}})]})]})})}function tx({sections:e,statuses:t=[],className:n,...r}){return(0,P.jsxs)(`section`,{className:R(`settings-sheet`,n),"aria-labelledby":`settings-title`,...r,children:[(0,P.jsxs)(`header`,{className:`settings-sheet-head`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Ji,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{id:`settings-title`,children:`Project settings`})]}),t.length===0?null:(0,P.jsx)(`div`,{className:`panel-actions`,children:t.map(e=>(0,P.jsx)(Cs,{className:`task-tag`,tone:e.tone,children:e.label},e.label))})]}),e.map(e=>(0,P.jsxs)(`section`,{className:`settings-section`,id:e.id,"aria-label":e.title,children:[(0,P.jsx)(`div`,{className:`settings-section-title`,children:(0,P.jsx)(`h4`,{children:e.title})}),(0,P.jsx)(`div`,{className:`settings-section-body`,children:e.rows.map(e=>(0,P.jsxs)(`div`,{className:`settings-row`,children:[(0,P.jsx)(`span`,{className:`field-label`,children:e.label}),e.value===void 0?(0,P.jsx)(`span`,{}):e.plain===!0?(0,P.jsx)(`div`,{className:`settings-row-value`,children:e.value}):e.code===!0?(0,P.jsx)(`code`,{children:e.value}):(0,P.jsx)(`strong`,{children:e.value})]},e.label))})]},e.id))]})}function nx({row:e}){return e.category===`image`?(0,P.jsx)(Ei,{"aria-hidden":`true`}):e.canPreview===!1?(0,P.jsx)(xi,{"aria-hidden":`true`}):e.selected===!0?(0,P.jsx)(bi,{"aria-hidden":`true`}):e.extension===`md`||e.extension===`txt`?(0,P.jsx)(Si,{"aria-hidden":`true`}):(0,P.jsx)(Ci,{"aria-hidden":`true`})}function rx({row:e,onSelectFile:t}){return(0,P.jsxs)(`button`,{className:R(`reference-row`,e.selected===!0?`is-selected`:void 0),type:`button`,"aria-current":e.selected===!0?`true`:void 0,onClick:()=>t?.(e.path),children:[(0,P.jsx)(`span`,{className:`reference-file-icon`,"aria-hidden":`true`,children:(0,P.jsx)(nx,{row:e})}),(0,P.jsxs)(`span`,{className:`reference-row-main`,children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(`span`,{children:e.meta})]})]})}function ix({name:e,rows:t,onSelectFile:n}){return(0,P.jsxs)(`details`,{className:`reference-folder-group`,children:[(0,P.jsxs)(`summary`,{className:`reference-folder-head`,children:[(0,P.jsx)(`span`,{className:`reference-file-icon`,"aria-hidden":`true`,children:(0,P.jsx)(Ti,{})}),(0,P.jsxs)(`span`,{className:`reference-row-main`,children:[(0,P.jsx)(`strong`,{children:e}),(0,P.jsxs)(`span`,{children:[t.length,` `,t.length===1?`file`:`files`]})]})]}),(0,P.jsx)(`div`,{className:`reference-folder-files`,children:t.map(e=>(0,P.jsx)(rx,{row:e,...n===void 0?{}:{onSelectFile:n}},e.path))})]})}function ax(e){let t=new Map;for(let n of e){if(n.source!==`tutti_output`||n.generatedGroup===void 0)continue;let e=t.get(n.generatedGroup)??[];e.push(n),t.set(n.generatedGroup,e)}return[...t.entries()].map(([e,t])=>({name:e,rows:t}))}function ox({files:e,detail:t,uploadPending:n=!1,fileSortMode:r=`time`,empty:i,onSelectFile:a,onUploadFile:o,onDropFiles:s,onFileSortModeChange:c,className:l,...u}){let d=e.filter(e=>e.category===`image`&&e.source!==`tutti_output`),f=e.filter(e=>!(e.category===`image`&&e.source!==`tutti_output`)),p=f.filter(e=>e.source!==`tutti_output`||e.generatedGroup===void 0),m=ax(f),h=e=>(0,P.jsx)(`div`,{className:`reference-image-strip`,role:`list`,"aria-label":`Reference images`,onWheel:e=>{Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(e.currentTarget.scrollLeft+=e.deltaY,e.preventDefault())},children:e.map(e=>(0,P.jsxs)(`button`,{className:R(`reference-image-tile`,e.selected===!0?`is-selected`:void 0),type:`button`,"aria-current":e.selected===!0?`true`:void 0,"aria-label":`Open ${e.name}`,onClick:()=>a?.(e.path),children:[e.thumbnailUrl===void 0?(0,P.jsx)(`span`,{className:`reference-image-tile-fallback`,"aria-hidden":`true`,children:(0,P.jsx)(Ei,{})}):(0,P.jsx)(`img`,{src:e.thumbnailUrl,alt:e.name,loading:`lazy`,decoding:`async`}),(0,P.jsx)(`span`,{children:e.name})]},e.path))}),g=e=>e.map(e=>(0,P.jsx)(rx,{row:e,...a===void 0?{}:{onSelectFile:a}},e.path)),_=s??(o===void 0?void 0:e=>{for(let t of e)o(t)});return(0,P.jsxs)(dy,{className:R(`panel references-panel`,l),"aria-label":`References`,dropLabel:`Drop reference files to upload`,pending:n,onFilesUpload:_,...u,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Si,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{children:`References`})]}),(0,P.jsx)(`div`,{className:`panel-actions`,children:(0,P.jsx)(Yy,{variant:`action`,className:`reference-upload-button`,label:`Upload`,pendingLabel:`Uploading`,pending:n,onFileUpload:o})})]}),(0,P.jsx)(`div`,{className:`reference-board-body`,children:e.length===0?(0,P.jsx)(`div`,{className:`reference-board-empty`,children:i??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No reference files`})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-list`,"aria-label":`Reference file list`,children:[d.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`reference-section-label`,children:`Images`}),h(d)]}),f.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-files-head`,children:[(0,P.jsx)(`div`,{className:`reference-section-label`,children:`Files`}),(0,P.jsxs)(`div`,{className:`reference-list-toolbar`,role:`toolbar`,"aria-label":`Sort files`,children:[(0,P.jsx)(`button`,{className:R(`reference-sort-button`,r===`time`?`is-active`:void 0),type:`button`,"aria-label":`Sort files by upload time`,"aria-pressed":r===`time`,onClick:()=>c?.(`time`),children:(0,P.jsx)(gi,{"aria-hidden":`true`})}),(0,P.jsx)(`button`,{className:R(`reference-sort-button`,r===`type`?`is-active`:void 0),type:`button`,"aria-label":`Sort files by type`,"aria-pressed":r===`type`,onClick:()=>c?.(`type`),children:(0,P.jsx)($i,{"aria-hidden":`true`})})]})]}),g(p),m.map(e=>(0,P.jsx)(ix,{name:e.name,rows:e.rows,...a===void 0?{}:{onSelectFile:a}},e.name))]})]}),(0,P.jsxs)(`aside`,{className:`reference-detail-card`,"aria-label":`Selected reference content`,children:[(0,P.jsxs)(`div`,{className:`reference-detail-head`,children:[(0,P.jsx)(`h4`,{children:t?.title??`No file selected`}),t?.meta===void 0?null:(0,P.jsx)(`p`,{children:t.meta})]}),(0,P.jsxs)(`div`,{className:`reference-detail-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Summary`}),(0,P.jsx)(`p`,{className:`reference-summary`,children:t?.summary??`Summary not available yet`}),t?.summaryStatus===void 0?null:(0,P.jsx)(`p`,{className:`reference-summary-status`,children:t.summaryStatus})]}),(0,P.jsxs)(`div`,{className:`reference-detail-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Content`}),t?.content===void 0?t?.imageUrl===void 0?(0,P.jsx)(`p`,{className:`reference-content`,children:t?.unavailableReason??`Select a reference file`}):(0,P.jsx)(`img`,{className:`reference-image-preview`,src:t.imageUrl,alt:t.title,decoding:`async`}):(0,P.jsx)(`pre`,{className:`reference-content`,children:(0,P.jsx)(`code`,{children:t.content})})]})]})]})})]})}function sx(e){return e.status===`loading`?{status:`running`,label:`Loading`}:e.status===`not_declared`?{status:`todo`,label:`No artifact`}:e.status===`invalid`?{status:`failed`,label:`Invalid`}:e.status===`updating`?{status:`running`,label:`Updating`}:e.previewStatus===`ready`?{status:`done`,label:`Ready`}:e.previewStatus===`starting`?{status:`running`,label:`Starting`}:e.previewStatus===`failed`?{status:`failed`,label:`Failed`}:{status:`todo`,label:`Idle`}}function cx({state:e,empty:t,emptyWatermark:n}){if(e.status===`declared`&&e.previewStatus===`ready`&&e.previewUrl!==void 0)return(0,P.jsx)(`iframe`,{className:`artifact-iframe`,src:e.previewUrl,title:`${e.title} artifact preview`,sandbox:`allow-scripts allow-forms allow-same-origin`,referrerPolicy:`no-referrer`});let r,i=`neutral`;return e.status===`loading`?r=`Loading artifact`:e.status===`updating`?r=`Artifact is updating`:e.status===`not_declared`?r=`No artifact`:e.status===`invalid`?(i=`error`,r=`Invalid artifact. ${e.message}`):e.previewStatus===`starting`?r=`Preview is starting`:e.previewStatus===`failed`?(i=`error`,r=e.errorMessage??`Preview failed`):r=`Preview is idle`,(0,P.jsx)(`div`,{className:`artifact-empty-preview`,role:e.status===`invalid`?`alert`:void 0,children:t??(0,P.jsx)(aa,{tone:i,watermark:n,children:r})})}function lx({state:e,error:t=null,empty:n,emptyWatermark:r,className:i,...a}){let o=t===null?e:{status:`invalid`,message:t},s=sx(o);return(0,P.jsxs)(`section`,{className:R(`panel artifacts-panel`,i),"aria-label":`Artifacts`,...a,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Li,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{children:`Artifacts`})]}),(0,P.jsx)(`div`,{className:`panel-actions`,children:(0,P.jsx)(Ts,{status:s.status,children:s.label})})]}),(0,P.jsx)(`div`,{className:`artifact-board-body`,children:(0,P.jsx)(`div`,{className:`artifact-preview-frame`,"aria-label":`Current artifact`,children:(0,P.jsx)(cx,{state:o,empty:n,emptyWatermark:r})})})]})}function ux({row:e}){return e.selected===!0?(0,P.jsx)(bi,{"aria-hidden":`true`}):(0,P.jsx)(Xi,{"aria-hidden":`true`})}function dx({skills:e,communityLinks:t=[],detail:n,uploadPending:r=!1,deletePending:i=!1,empty:a,onSelectSkill:o,onUploadSkill:s,onDeleteSkill:c,className:l,...u}){let d=e.find(e=>e.selected===!0)?.name,f=t.length>0;return(0,P.jsxs)(`section`,{className:R(`panel references-panel skills-panel`,l),"aria-label":`Skills`,...u,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Xi,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{children:`Skills`})]}),(0,P.jsx)(`div`,{className:`panel-actions`,children:(0,P.jsx)(Yy,{variant:`action`,className:`reference-upload-button`,label:`Upload`,pendingLabel:`Uploading`,pending:r,accept:`.zip,application/zip,application/x-zip-compressed`,onFileUpload:s})})]}),(0,P.jsx)(`div`,{className:`reference-board-body`,children:e.length===0&&!f?(0,P.jsx)(`div`,{className:`reference-board-empty`,children:a??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No skills`})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-list`,"aria-label":`Skill list`,children:[f?(0,P.jsxs)(`div`,{className:`skill-community-section`,"aria-label":`Skill communities`,children:[(0,P.jsx)(`div`,{className:`reference-section-label`,children:`Skill communities`}),(0,P.jsx)(`div`,{className:`skill-community-grid`,children:t.map(e=>(0,P.jsxs)(`a`,{className:`skill-community-card`,href:e.href,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(`span`,{className:`skill-community-card-icon`,"aria-hidden":`true`,children:(0,P.jsx)(Ai,{})}),(0,P.jsx)(`span`,{className:`skill-community-card-main`,children:(0,P.jsx)(`strong`,{children:e.title})})]},e.href))})]}):null,e.length===0?null:(0,P.jsx)(`div`,{className:`reference-section-label`,children:`User skills`}),e.map(e=>(0,P.jsxs)(`button`,{className:R(`reference-row`,e.selected===!0?`is-selected`:void 0),type:`button`,"aria-label":`Select skill ${e.name}`,"aria-current":e.selected===!0?`true`:void 0,onClick:()=>o?.(e.name),children:[(0,P.jsx)(`span`,{className:`reference-file-icon`,"aria-hidden":`true`,children:(0,P.jsx)(ux,{row:e})}),(0,P.jsxs)(`span`,{className:`reference-row-main`,children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(`span`,{children:e.shortDescription??e.description})]})]},e.name))]}),(0,P.jsx)(`aside`,{className:`reference-detail-card`,"aria-label":`Selected skill content`,children:e.length===0?(0,P.jsx)(`div`,{className:`reference-board-empty`,children:a??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No skills`})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-detail-head skill-detail-head`,children:[(0,P.jsxs)(`div`,{className:`skill-detail-title`,children:[(0,P.jsx)(`h4`,{children:n?.title??`No skill selected`}),n?.description===void 0?null:(0,P.jsx)(`p`,{children:n.description}),n?.updatedLabel===void 0?null:(0,P.jsx)(`p`,{children:n.updatedLabel})]}),d===void 0||c===void 0?null:(0,P.jsxs)(Ss,{className:`skill-delete-button`,type:`button`,disabled:i,"aria-busy":i,onClick:()=>c(d),children:[(0,P.jsx)(ta,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:i?`Deleting`:`Delete`})]})]}),(0,P.jsxs)(`div`,{className:`reference-detail-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`SKILL.md`}),n?.skillMd===void 0?(0,P.jsx)(`p`,{className:`reference-content`,children:n?.unavailableReason??`Select a skill`}):(0,P.jsx)(`pre`,{className:`reference-content`,children:(0,P.jsx)(`code`,{"aria-label":`Skill markdown for ${n.title}`,children:n.skillMd})})]})]})})]})})]})}function fx({label:e,children:t}){return(0,P.jsxs)(`section`,{className:`timeline-trace-section`,children:[(0,P.jsx)(`span`,{className:`timeline-trace-label`,children:e}),(0,P.jsx)(`div`,{className:`timeline-trace-section-body`,children:t})]})}function px(e){return e.replaceAll(`_`,` `)}function mx(e){return e===`passed`?`success`:e===`failed`?`error`:`warning`}function hx(e){return e.status===`promoted`?`success`:e.status===`not_promoted`?`error`:`neutral`}function gx(e){if(e.skipReasonSummary!==void 0)return e.skipReasonSummary;switch(e.checks){case`passed`:return`All validation checks passed.`;case`failed`:return`Validation checks failed.`;case`skipped`:return`Validation was skipped.`}}function _x(e){if(e.summary!==void 0)return e.summary;switch(e.status){case`promoted`:return`Changes were promoted after verification.`;case`not_promoted`:return`Changes were not promoted.`;case`not_attempted`:return`Promotion was not attempted.`}}function vx(e){switch(e){case`added`:return`+`;case`modified`:return`~`;case`deleted`:return`-`;case`renamed`:return`~`;case`unknown`:return`?`}}var yx=3;function bx({expanded:e,collapsedLabel:t,expandedLabel:n,onClick:r}){return(0,P.jsxs)(`button`,{"aria-expanded":e,className:R(`timeline-trace-more`,e&&`is-expanded`),onClick:r,type:`button`,children:[(0,P.jsx)(`span`,{children:e?n:t}),(0,P.jsx)(ui,{"aria-hidden":`true`})]})}function xx({expanded:e,hiddenCount:t,label:n,onClick:r}){return t<=0?null:(0,P.jsx)(bx,{collapsedLabel:`Show ${t} more ${n}${t===1?``:`s`}`,expanded:e,expandedLabel:`Show fewer ${n}s`,onClick:r})}function Sx(e){let t=[];return(e.origin!==void 0||e.decisions!==void 0||e.clarification!==void 0)&&t.push({id:`context`,label:`Context`,tone:`neutral`}),e.contract!==void 0&&t.push({id:`contract`,label:`Contract`,tone:`neutral`}),(e.result!==void 0||e.changes!==void 0)&&t.push({id:`result`,label:`Result`,tone:e.tone}),e.verification!==void 0&&t.push({id:`checks`,label:`Checks`,tone:mx(e.verification.checks)}),e.promotion!==void 0&&t.push({id:`promotion`,label:`Promotion`,tone:hx(e.promotion)}),e.checkpoint!==void 0&&t.push({id:`checkpoint`,label:`Checkpoint`,tone:e.tone}),t}function Cx({trace:e}){let t=Sx(e),n=e.links.filter(e=>e.onClick!==void 0),[r,i]=(0,N.useState)(()=>new Set),a=r.has(`origin`),o=r.has(`decisions`),s=r.has(`clarification-answers`),c=r.has(`scope`),l=r.has(`changes`),u=r.has(`checkpoint`),d=r.has(`generated-files`),f=e.origin?.snippets??[],p=e.decisions===void 0||o?e.decisions??[]:e.decisions.slice(0,yx),m=e.clarification?.answers===void 0||s?e.clarification?.answers??[]:e.clarification.answers.slice(0,yx),h=e.contract===void 0||c?e.contract?.scope??[]:e.contract.scope.slice(0,yx),g=e.checkpoint===void 0||u?e.checkpoint?.items??[]:e.checkpoint.items.slice(0,yx),_=e.checkpoint?.generatedFiles===void 0||d?e.checkpoint?.generatedFiles??[]:e.checkpoint.generatedFiles.slice(0,yx);function v(e){i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,P.jsxs)(`div`,{className:R(`timeline-trace-card`,`is-${e.tone}`),children:[e.summary===void 0||e.result!==void 0?null:(0,P.jsx)(`p`,{className:`timeline-trace-summary`,children:e.summary}),t.length===0?null:(0,P.jsx)(`ol`,{className:`timeline-trace-path`,"aria-label":`Recorded task trace`,children:t.map(e=>(0,P.jsxs)(`li`,{className:`is-${e.tone}`,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`}),(0,P.jsx)(`strong`,{children:e.label})]},e.id))}),e.origin===void 0?null:(0,P.jsxs)(fx,{label:`Origin`,children:[e.origin.title===void 0?null:(0,P.jsx)(`strong`,{className:`timeline-trace-title`,children:e.origin.title}),e.origin.summary===void 0?null:(0,P.jsx)(`p`,{children:e.origin.summary}),e.origin.unavailableReason===void 0?null:(0,P.jsx)(`small`,{className:`timeline-trace-muted`,children:e.origin.unavailableReason}),f.length>0?(0,P.jsx)(bx,{collapsedLabel:`Show ${f.length} source message${f.length===1?``:`s`}`,expanded:a,expandedLabel:`Show fewer source messages`,onClick:()=>v(`origin`)}):e.origin.sourceCount===void 0?null:(0,P.jsxs)(`small`,{className:`timeline-trace-muted`,children:[e.origin.sourceCount,` source message`,e.origin.sourceCount===1?``:`s`]}),!a||f.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-snippet-list`,children:f.map(e=>(0,P.jsx)(`li`,{className:`timeline-trace-snippet`,children:e.onClick===void 0?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]}):(0,P.jsxs)(`button`,{className:`timeline-trace-snippet-button`,onClick:e.onClick,type:`button`,children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]})},e.id))})]}),e.decisions===void 0||e.decisions.length===0?null:(0,P.jsxs)(fx,{label:`Accepted Context`,children:[(0,P.jsx)(`ul`,{className:`timeline-trace-list`,children:p.map(e=>(0,P.jsxs)(`li`,{children:[e.title===void 0?null:(0,P.jsx)(Cs,{tone:`neutral`,children:e.title}),(0,P.jsx)(`span`,{children:e.summary})]},e.id))}),(0,P.jsx)(xx,{expanded:o,hiddenCount:Math.max(e.decisions.length-yx,0),label:`context item`,onClick:()=>v(`decisions`)})]}),e.clarification===void 0?null:(0,P.jsxs)(fx,{label:`Clarification`,children:[e.clarification.title===void 0?null:(0,P.jsx)(`strong`,{className:`timeline-trace-title`,children:e.clarification.title}),e.clarification.summary===void 0?null:(0,P.jsx)(`p`,{children:e.clarification.summary}),e.clarification.request===void 0?null:(0,P.jsx)(`p`,{children:e.clarification.request}),e.clarification.status===void 0&&e.clarification.answerCount===void 0?null:(0,P.jsxs)(`div`,{className:`timeline-trace-inline`,children:[e.clarification.status===void 0?null:(0,P.jsx)(Cs,{tone:e.clarification.status===`active`?`warning`:`success`,children:e.clarification.status===`active`?`needs input`:`resolved`}),e.clarification.answerCount===void 0?null:(0,P.jsxs)(`small`,{className:`timeline-trace-muted`,children:[e.clarification.answerCount,` answer`,e.clarification.answerCount===1?``:`s`]})]}),e.clarification.answers===void 0||e.clarification.answers.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-snippet-list`,children:m.map(e=>(0,P.jsx)(`li`,{className:`timeline-trace-snippet`,children:e.onClick===void 0?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]}):(0,P.jsxs)(`button`,{className:`timeline-trace-snippet-button`,onClick:e.onClick,type:`button`,children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]})},e.id))}),e.clarification.answers===void 0?null:(0,P.jsx)(xx,{expanded:s,hiddenCount:Math.max(e.clarification.answers.length-yx,0),label:`answer`,onClick:()=>v(`clarification-answers`)})]}),e.contract===void 0?null:(0,P.jsxs)(fx,{label:`Contract`,children:[(0,P.jsx)(`p`,{children:e.contract.goal}),h.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-list is-bulleted`,children:h.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`span`,{children:e})},`scope-${t}`))}),(0,P.jsx)(xx,{expanded:c,hiddenCount:Math.max(e.contract.scope.length-yx,0),label:`scope item`,onClick:()=>v(`scope`)}),c&&e.contract.truncated===!0?(0,P.jsx)(`small`,{className:`timeline-trace-muted`,children:`Additional scope items are outside this bounded audit preview.`}):null]}),e.result===void 0?null:(0,P.jsxs)(fx,{label:`Result`,children:[(0,P.jsx)(`p`,{children:e.result.summary}),e.result.errorCode===void 0?null:(0,P.jsx)(`code`,{className:`timeline-trace-code`,children:e.result.errorCode})]}),e.changes===void 0?null:(0,P.jsxs)(fx,{label:`Changes`,children:[e.changes.items.length===0?(0,P.jsx)(`p`,{className:`timeline-trace-muted`,children:`No repo changes recorded.`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(bx,{collapsedLabel:`Show ${e.changes.items.length} file change${e.changes.items.length===1?``:`s`}`,expanded:l,expandedLabel:`Show fewer file changes`,onClick:()=>v(`changes`)}),l?(0,P.jsx)(`ul`,{className:`timeline-trace-diff-list`,children:e.changes.items.map(e=>(0,P.jsxs)(`li`,{className:`is-${e.status}`,children:[(0,P.jsx)(`span`,{className:`timeline-trace-diff-mark`,children:vx(e.status)}),(0,P.jsx)(`code`,{children:e.previousPath===void 0?e.path:`${e.previousPath} -> ${e.path}`})]},`${e.status}:${e.path}`))}):null]}),l&&e.changes.totalCount>e.changes.items.length?(0,P.jsxs)(`small`,{className:`timeline-trace-muted`,children:[e.changes.totalCount-e.changes.items.length,` additional files are outside this bounded audit preview.`]}):null]}),e.verification===void 0?null:(0,P.jsx)(fx,{label:`Verification`,children:(0,P.jsxs)(`div`,{className:`timeline-trace-inline`,children:[(0,P.jsx)(Cs,{tone:mx(e.verification.checks),children:px(e.verification.checks)}),(0,P.jsx)(`p`,{children:gx(e.verification)})]})}),e.promotion===void 0?null:(0,P.jsx)(fx,{label:`Promotion`,children:(0,P.jsxs)(`div`,{className:`timeline-trace-inline`,children:[(0,P.jsx)(Cs,{tone:hx(e.promotion),children:px(e.promotion.status)}),(0,P.jsx)(`p`,{children:_x(e.promotion)})]})}),e.checkpoint===void 0?null:(0,P.jsxs)(fx,{label:`Checkpoint`,children:[(0,P.jsxs)(`div`,{className:`timeline-trace-counters`,children:[(0,P.jsxs)(`span`,{children:[e.checkpoint.counters.completed,` completed`]}),(0,P.jsxs)(`span`,{children:[e.checkpoint.counters.failed,` failed`]}),(0,P.jsxs)(`span`,{children:[e.checkpoint.counters.remaining,` remaining`]})]}),(0,P.jsx)(`ul`,{className:`timeline-trace-list`,children:g.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(Cs,{tone:e.status===`done`?`success`:`error`,children:e.status===`done`?`done`:`failed`}),(0,P.jsx)(`strong`,{children:e.title}),(0,P.jsx)(`span`,{children:e.summary})]},e.id))}),(0,P.jsx)(xx,{expanded:u,hiddenCount:Math.max(e.checkpoint.items.length-yx,0),label:`checkpoint item`,onClick:()=>v(`checkpoint`)}),e.checkpoint.generatedFiles===void 0||e.checkpoint.generatedFiles.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-file-list`,children:_.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(`code`,{children:e.path})]},e.id))}),e.checkpoint.generatedFiles===void 0?null:(0,P.jsx)(xx,{expanded:d,hiddenCount:Math.max(e.checkpoint.generatedFiles.length-yx,0),label:`generated file`,onClick:()=>v(`generated-files`)}),(u||d)&&e.checkpoint.truncated===!0?(0,P.jsx)(`small`,{className:`timeline-trace-muted`,children:`Additional checkpoint evidence is outside this bounded audit preview.`}):null]}),n.length===0?null:(0,P.jsx)(fx,{label:`Links`,children:(0,P.jsx)(`div`,{className:`timeline-trace-links`,children:n.map(e=>(0,P.jsxs)(Ss,{className:`timeline-trace-link`,onClick:e.onClick,type:`button`,children:[(0,P.jsx)(yi,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:e.label})]},e.id))})})]})}function wx({item:e,expanded:t,active:n,onActivate:r,onToggle:i}){let a=e.trace,o=a!==void 0,s=e.tone??`neutral`,c=s===`error`?(0,P.jsx)(ia,{"aria-hidden":`true`}):s===`warning`?(0,P.jsx)(Ii,{"aria-hidden":`true`}):s===`sync`?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(li,{"aria-hidden":`true`});return(0,P.jsxs)(`li`,{className:R(`timeline-event-item`,o?`has-trace`:void 0,t?`is-expanded`:void 0,n?`is-current`:void 0,e.tone===void 0?void 0:`is-${e.tone}`),id:`timeline-event-${e.id}`,children:[(0,P.jsx)(`time`,{className:`timeline-event-time`,children:e.occurredAt}),(0,P.jsx)(`div`,{className:`timeline-event-marker`,"aria-hidden":`true`}),(0,P.jsxs)(`div`,{className:`timeline-event-main`,children:[(0,P.jsxs)(`button`,{"aria-expanded":o?t:void 0,className:`timeline-event-toggle`,disabled:!o,onClick:()=>{r(),i()},type:`button`,children:[(0,P.jsx)(`span`,{className:R(`timeline-event-status-icon`,`is-${s}`),"aria-hidden":`true`,children:c}),(0,P.jsxs)(`span`,{className:`timeline-event-copy`,children:[(0,P.jsx)(`span`,{className:`timeline-event-stage`,children:e.stageLabel??(e.kind===`checkpoint`?`Checkpoint`:`Task event`)}),(0,P.jsxs)(`span`,{className:`timeline-event-title-line`,children:[(0,P.jsx)(`h4`,{children:e.taskTitle??e.title}),e.tokenLabel===void 0?null:(0,P.jsx)(`span`,{className:`timeline-event-token`,children:e.tokenLabel})]})]}),o?(0,P.jsx)(ui,{className:`timeline-event-chevron`,"aria-hidden":`true`}):null]}),a!==void 0&&t?(0,P.jsx)(Cx,{trace:a}):null]})]})}function Tx(e){let t=new Map;for(let n of e){let e=n.taskId===void 0?`event:${n.id}`:`task:${n.taskId}`,r=t.get(e);r===void 0?t.set(e,{id:e,title:n.taskTitle??n.title,...n.taskId===void 0?{}:{taskId:n.taskId},items:[n]}):r.items.push(n)}return[...t.values()]}function Ex({tokenOverview:e,items:t,scoreUnits:n=[],empty:r,defaultExpandedItemIds:i,className:a,...o}){let[s,c]=(0,N.useState)(()=>new Set(i??[])),[l,u]=(0,N.useState)(()=>n.at(-1)?.id),[d,f]=(0,N.useState)(0),p=(0,N.useRef)(null),m=Tx(t),h=new Set(t.flatMap(e=>e.taskId===void 0?[]:[e.taskId])).size;(0,N.useEffect)(()=>{if(n.length===0){u(void 0);return}(l===void 0||!n.some(e=>e.id===l))&&u(n.at(-1)?.id)},[l,n]),(0,N.useEffect)(()=>{let e=p.current;if(e===null)return;let t=e;t.scrollLeft=t.scrollWidth;function n(e){if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let n=Math.max(0,t.scrollWidth-t.clientWidth),r=Math.min(n,Math.max(0,t.scrollLeft+e.deltaY));r!==t.scrollLeft&&(e.preventDefault(),t.scrollLeft=r)}return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[n.length]),(0,N.useEffect)(()=>{let e=p.current;if(e===null)return;let t=()=>f(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[n.length]);function g(e,t=!1){u(e),t&&(c(t=>new Set(t).add(e)),window.requestAnimationFrame(()=>{document.getElementById(`timeline-event-${e}`)?.scrollIntoView({behavior:`smooth`,block:`center`})}))}function _(e){c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,P.jsx)(ma,{className:R(`timeline-panel`,a),title:`Timeline`,icon:(0,P.jsx)(ci,{"aria-hidden":`true`}),...o,children:(0,P.jsxs)(`div`,{className:`timeline-board-body`,children:[(0,P.jsxs)(`section`,{className:`timeline-events`,"aria-label":`Project timeline`,children:[(0,P.jsx)(`div`,{className:`timeline-audit-header`,children:(0,P.jsxs)(`div`,{className:`timeline-audit-intro`,children:[(0,P.jsx)(`h4`,{children:`Task traceability`}),(0,P.jsxs)(`div`,{className:`timeline-audit-meta`,"aria-label":`Timeline record summary`,children:[(0,P.jsx)(`span`,{children:h===1?`1 task`:`${h} tasks`}),(0,P.jsx)(`span`,{children:t.length===1?`1 record`:`${t.length} records`})]})]})}),t.length===0?r:(0,P.jsx)(`div`,{className:`timeline-task-groups`,children:m.map(e=>(0,P.jsxs)(`section`,{className:`timeline-task-group`,"aria-label":e.title,children:[(0,P.jsxs)(`header`,{className:`timeline-task-group-head`,children:[(0,P.jsx)(`span`,{children:e.taskId===void 0?`Project record`:`Task trace`}),(0,P.jsx)(`strong`,{children:e.title})]}),(0,P.jsx)(`ol`,{className:`timeline-event-list`,children:e.items.map(e=>(0,P.jsx)(wx,{active:l===e.id,expanded:s.has(e.id),item:e,onActivate:()=>g(e.id),onToggle:()=>_(e.id)},e.id))})]},e.id))})]}),(0,P.jsxs)(`section`,{className:`timeline-overview`,"aria-label":`Timeline score and token usage`,children:[n.length===0?null:(0,P.jsx)(`div`,{className:`timeline-score-index`,ref:p,role:`group`,"aria-label":`Timeline score index`,children:(0,P.jsx)(co,{"aria-label":`Timeline event score`,...l===void 0?{}:{activeUnitId:l},edgePadding:0,minimumWidth:d,onUnitSelect:e=>g(e,!0),openingBarline:`double`,openingClef:`treble`,horizontalSpacingScale:B,reveal:!0,scale:fo,units:n})}),(0,P.jsxs)(`div`,{className:`timeline-overview-token`,"aria-label":`Total tokens`,children:[(0,P.jsx)(`span`,{children:`Total tokens`}),(0,P.jsx)(`strong`,{children:e.totalLabel})]})]})]})})}var Dx=new Intl.NumberFormat(`en-US`),Ox=Ho(`beethoven-ode-to-joy`);function kx(e){return[...e].reverse().map((e,t)=>{let n=Ox.units[t%Ox.units.length];if(n===void 0)throw Error(`Timeline score theme unexpectedly has no units`);return{...n,id:e.id,label:`Open ${e.stageLabel??e.title}`}})}function Ax(e){return Dx.format(e)}function jx(e){if(e!==void 0)switch(e){case`completed`:return`success`;case`failed`:return`error`;case`needs_human`:return`warning`}}function Mx(e){if(e.kind===`task_accepted`)return`Task accepted`;if(e.kind===`checkpoint`)return`Checkpoint`;switch(e.update_state){case`completed`:return`Task completed`;case`failed`:return`Task failed`;case`needs_input`:return`Needs input`;default:return`Task update`}}function Nx(e,t){let n=Date.parse(e.occurred_at),r=Date.parse(t.occurred_at),i=Number.isFinite(n)&&Number.isFinite(r)?r-n:t.occurred_at.localeCompare(e.occurred_at);return i===0?t.id.localeCompare(e.id):i}function Px(e,t={}){let n=e.token_usage?.total_tokens??0,r=jx(e.status),i={id:e.id,title:e.task_title??e.title,occurredAt:tr(e.occurred_at),kind:e.kind,stageLabel:Mx(e)};return r!==void 0&&(i.tone=r),n>0&&(i.tokenLabel=`${Ax(n)} tokens`),e.task_id!==void 0&&(i.taskId=e.task_id),e.task_title!==void 0&&(i.taskTitle=e.task_title),e.trace_card!==void 0&&(i.trace=Ix(e.trace_card,t)),i}function Fx(e,t){if(e.kind===`worklist_task`&&e.task_id!==void 0){let n=t.onOpenWorklistTask,r=e.task_id;return n===void 0?void 0:()=>n(r)}if(e.kind===`chat_message`&&e.message_id!==void 0){let n=t.onOpenChatMessage,r=e.message_id;return n===void 0?void 0:()=>n(r)}if(e.kind===`reference_file`&&e.path!==void 0){let n=t.onOpenReferenceFile,r=e.path;return n===void 0?void 0:()=>n(r)}}function Ix(e,t={}){return{tone:e.tone,...e.summary===void 0?{}:{summary:e.summary},...e.origin===void 0?{}:{origin:{...e.origin.title===void 0?{}:{title:e.origin.title},...e.origin.summary===void 0?{}:{summary:e.origin.summary},...e.origin.unavailable_reason===void 0?{}:{unavailableReason:e.origin.unavailable_reason},...e.origin.source_count===void 0?{}:{sourceCount:e.origin.source_count},...e.origin.snippets===void 0?{}:{snippets:e.origin.snippets.map(e=>({id:e.message_id,author:e.author,body:e.body,createdAt:tr(e.created_at),...t.onOpenChatMessage===void 0?{}:{onClick:()=>t.onOpenChatMessage?.(e.message_id)}}))}}},...e.decisions===void 0?{}:{decisions:e.decisions.map((e,t)=>({id:`${t}:${e.source??`decision`}`,...e.title===void 0?{}:{title:e.title},summary:e.summary}))},...e.clarification===void 0?{}:{clarification:{...e.clarification.title===void 0?{}:{title:e.clarification.title},...e.clarification.summary===void 0?{}:{summary:e.clarification.summary},...e.clarification.request===void 0?{}:{request:e.clarification.request},...e.clarification.status===void 0?{}:{status:e.clarification.status},...e.clarification.answer_count===void 0?{}:{answerCount:e.clarification.answer_count},...e.clarification.answers===void 0?{}:{answers:e.clarification.answers.map(e=>({id:e.message_id,author:e.author,body:e.body,createdAt:tr(e.created_at),...t.onOpenChatMessage===void 0?{}:{onClick:()=>t.onOpenChatMessage?.(e.message_id)}}))}}},...e.contract===void 0?{}:{contract:{goal:e.contract.goal,scope:e.contract.scope,...e.contract.truncated===void 0?{}:{truncated:e.contract.truncated}}},...e.result===void 0?{}:{result:{summary:e.result.summary,...e.result.error_code===void 0?{}:{errorCode:e.result.error_code}}},...e.changes===void 0?{}:{changes:{items:e.changes.items.map(e=>({status:e.status,path:e.path,...e.previous_path===void 0?{}:{previousPath:e.previous_path}})),totalCount:e.changes.total_count,truncated:e.changes.truncated}},...e.verification===void 0?{}:{verification:{checks:e.verification.checks,...e.verification.skip_reason_code===void 0?{}:{skipReasonCode:e.verification.skip_reason_code},...e.verification.skip_reason_summary===void 0?{}:{skipReasonSummary:e.verification.skip_reason_summary}}},...e.promotion===void 0?{}:{promotion:{status:e.promotion.status,...e.promotion.commit_short_oid===void 0?{}:{commitShortOid:e.promotion.commit_short_oid},...e.promotion.summary===void 0?{}:{summary:e.promotion.summary},...e.promotion.reason_code===void 0?{}:{reasonCode:e.promotion.reason_code}}},...e.checkpoint===void 0?{}:{checkpoint:{counters:e.checkpoint.counters,items:e.checkpoint.items.map(e=>({id:e.task_id,title:e.title,status:e.status,summary:e.summary})),...e.checkpoint.generated_files===void 0?{}:{generatedFiles:e.checkpoint.generated_files.map(e=>({id:e.path,name:e.name,path:e.path}))},...e.checkpoint.truncated===void 0?{}:{truncated:e.checkpoint.truncated}}},links:e.links.flatMap(e=>{let n=e.task_id??e.message_id??e.path,r=Fx(e,t);return r===void 0?[]:[{id:`${e.kind}:${n??e.label}`,label:e.label,onClick:r}]})}}function Lx(e,t={}){let n=e.usage_overview,r=[...e.items].sort(Nx).map(e=>Px(e,t));return{tokenOverview:{totalLabel:Ax(n.total_tokens)},items:r,scoreUnits:kx(r)}}var Rx=[{id:`prepare`,label:`Preparing workspace`},{id:`implement`,label:`Implementing with Codex`},{id:`validate`,label:`Validating result`},{id:`save`,label:`Saving result`}],zx=[{id:`workspace_inspect`,summary:`inspecting the persistent project workspace`,displayStageId:`prepare`},{id:`artifact_candidate_validate`,summary:`validating the candidate Artifact preview`,displayStageId:`validate`},{id:`provider_task_run`,summary:`running Codex task implementation`,displayStageId:`implement`},{id:`provider_retry`,summary:`retrying Codex task after a transient provider failure`,displayStageId:`implement`},{id:`candidate_diff_collect`,summary:`collecting candidate changes`,displayStageId:`validate`},{id:`checks`,summary:`running project checks`,displayStageId:`validate`},{id:`post_checks_diff_collect`,summary:`rechecking candidate changes after checks`,displayStageId:`validate`},{id:`accepted_checkpoint`,summary:`saving the validated project state as an accepted checkpoint`,displayStageId:`save`},{id:`promotion_reconcile`,summary:`reconciling promotion after mainline changed`,displayStageId:`save`},{id:`self_correction`,summary:`retrying task implementation after pipeline feedback`,displayStageId:`implement`}],Bx={scratchpad_refresh:{key:`scratchpad_refresh`,label:`Refreshing Scratchpad`,target:{kind:`scratchpad`}},project_context_bootstrap:{key:`project_context_bootstrap`,label:`Preparing project context`,target:{kind:`scratchpad`}},task_compile:{key:`task_compile`,label:`Compiling Worklist tasks`,target:{kind:`scratchpad`}},context_sync:{key:`context_sync`,label:`Synchronizing project context`,target:{kind:`worklist`}},reference_summary_refresh:{key:`reference_summary_refresh`,label:`Processing reference`,target:{kind:`references`}},recovery_check:{key:`recovery_check`,label:`Recovering workspace`,target:{kind:`worklist`}},follow_up_check:{key:`follow_up_check`,label:`Checking follow-up`,target:{kind:`worklist`}}},Vx=`Execution progress`,Hx=new Set([`scratchpad_refresh`]),Ux=`task_compile`,Wx=`project_context_bootstrap`,Gx={reading_context:`Codex is reading project context`,planning:`Codex is planning changes`,editing_files:`Codex is editing files`,running_command:`Codex is running a command`,using_tool:`Codex is using a tool`,waiting_for_approval:`Codex is waiting for approval`,finalizing:`Codex is finalizing the result`};function Kx(e){if(e===void 0)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;if(e instanceof Date)return e.getTime();let t=Date.parse(e);return Number.isNaN(t)?null:t}function qx(e){return Kx(e.now)??Date.now()}function Jx(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;if(t<60)return`${t}m${n}s`;let r=Math.floor(t/60),i=t%60;return`${r}h${String(i).padStart(2,`0`)}m`}function Yx(e,t){let n=Kx(e);if(n!==null)return Jx(Math.max(0,Math.floor((qx(t)-n)/1e3)))}function Xx(e,t){return Yx(e.active_activity?.started_at??e.runtime?.started_at,t)}function Zx(e){let t=e.runtime;if(t===void 0)return;let n=e.active_activity?.activity_ref;if(!(n!==void 0&&t.activity_ref!==n))return t}function Qx(e){if(e<1e3)return String(e);if(e<1e6){let t=e/1e3;return`${e<1e5?t.toFixed(1).replace(/\.0$/u,``):String(Math.round(t))}k`}return`${(e/1e6).toFixed(1).replace(/\.0$/u,``)}m`}function $x(e){let t=e?.token_usage?.total_tokens;return t===void 0?[]:[`${Qx(t)} tokens`]}function eS(e){let t=e?.token_usage?.total_tokens;return t===void 0?void 0:`${Qx(t)} tokens`}function tS(e){let t=e?.current_action;return t===void 0?void 0:Gx[t]}function nS(e){let t=tS(e);if(t===void 0)return;let n=eS(e);return n===void 0?t:`${t} (${n})`}function rS(e){let t={};return e.active_activity?.activity_ref!==void 0&&(t.activityRef=e.active_activity.activity_ref),e.active_activity?.workflow_ref!==void 0&&(t.workflowRef=e.active_activity.workflow_ref),e.active_task?.id!==void 0&&(t.taskId=e.active_task.id),Object.keys(t).length===0?void 0:t}function iS(e,t,n){return e===`context_sync`&&t.last_conclusion?.task_id!==void 0?{kind:`task`,taskId:t.last_conclusion.task_id}:n.target}function aS(e){return zx[dS(e)]??zx[0]}function oS(e){return Rx.findIndex(t=>t.id===e)}function sS(e){return Rx[oS(aS(e).displayStageId)]??Rx[0]}function cS(e){if(e.status!==`running`||e.active_activity?.activity_kind!==`procedure`)return null;let t=e.active_activity.workflow_kind;if(t===void 0||Hx.has(t))return null;let n=Bx[t],r=iS(t,e,n);return{key:`procedure:${n.key}`,label:n.label,title:n.label,tone:`running`,target:r}}function lS(e,t){if(e.status!==`running`||e.active_activity?.activity_kind!==`procedure`)return null;let n=e.active_activity.workflow_kind;if(n===void 0||Hx.has(n))return null;let r=Bx[n],i=iS(n,e,r),a=rS(e),o=Zx(e),s=n===Ux?$x(o):[],c=n===Wx?`Creating project context for the first time`:void 0,l=Yx(e.active_activity?.started_at??o?.started_at,t);return{key:`procedure:${r.key}`,title:Vx,summary:e.summary,tone:`running`,metaLabel:r.label,completionTarget:i,...a===void 0?{}:{completionSource:a},steps:[{id:`procedure:${r.key}:active`,label:r.label,status:`running`,...l===void 0?{}:{elapsedLabel:l},...c===void 0?{}:{detail:c},...s.length===0?{}:{metrics:s}}]}}function uS(e){let t=e.indexOf(` - `);return t===-1?``:e.slice(t+3).trim().replace(/\.$/u,``)}function dS(e){let t=uS(e).toLocaleLowerCase();if(t===``)return 0;let n=zx.findIndex(e=>t.includes(e.summary.toLocaleLowerCase()));return n===-1?0:n}function fS(e,t){if(e.status!==`running`||e.active_task===void 0)return null;let n=oS(aS(e.summary).displayStageId),r=sS(e.summary),i=rS(e),a=Zx(e),o=Xx(e,t);return{key:`run:${e.active_task.id}`,title:Vx,summary:e.active_task.title,tone:`running`,metaLabel:r.label,completionTarget:{kind:`task`,taskId:e.active_task.id},...i===void 0?{}:{completionSource:i},steps:Rx.map((e,t)=>{let r=t<n?`done`:t===n?`running`:`waiting`,i=t===n,s=e.id===`implement`,c=i&&s?nS(a):void 0,l=s&&c===void 0?$x(a):[];return{id:e.id,label:e.label,status:r,...i&&o!==void 0?{elapsedLabel:o}:{},...c===void 0?{}:{detail:c},...l.length>0?{metrics:l}:{}}})}}function pS(e,t){if(e.status!==`running`||e.active_activity?.workflow_kind!==`context_sync`||e.last_conclusion?.kind!==`completed`||e.last_conclusion.task_id===void 0)return null;let n=rS(e),r=Xx(e,t);return{key:`context-sync:${e.last_conclusion.task_id}`,title:Vx,summary:e.summary,tone:`running`,metaLabel:`Synchronizing context`,completionTarget:{kind:`task`,taskId:e.last_conclusion.task_id},...n===void 0?{}:{completionSource:n},steps:[{id:`task_complete`,label:`Task completed`,status:`done`},{id:`context_sync`,label:`Synchronizing project context`,status:`running`,...r===void 0?{}:{elapsedLabel:r}}]}}function mS(e){let t=e.blocked_by?.kind===`approval`?{kind:`approval`}:{kind:`clarification`};return{key:`pending:${e.blocked_by?.kind===`approval`?e.blocked_by.approval_id:e.blocked_by?.kind===`clarification`?e.blocked_by.round_id:e.updated_at}`,title:Vx,summary:e.summary,tone:`pending`,metaLabel:`Needs input`,completionTarget:t,steps:[{id:`waiting_for_input`,label:`Needs input`,status:`pending`}]}}function hS(e){let t=e.last_conclusion?.task_id??(e.status===`failed`?e.active_task?.id:void 0);return t===void 0&&e.status!==`failed`?null:{key:`failed:${t??e.updated_at}`,title:Vx,summary:e.last_conclusion?.summary??e.summary,tone:`failed`,metaLabel:`Failed`,...t===void 0?{}:{completionTarget:{kind:`task`,taskId:t}},steps:[{id:`run_failed`,label:`Run failed`,status:`failed`}]}}function gS(e,t={}){let n=fS(e,t);if(n!==null)return n;let r=pS(e,t);if(r!==null)return r;let i=lS(e,t);return i===null?e.status===`pending`?mS(e):e.status===`failed`?hS(e):null:i}function _S(e){let t=e.activeTaskCompileClarification&&!e.activeScratchpadRefreshFromSubmit&&!e.activeProjectContextBootstrap&&!e.activeTaskCompile,n=[],r=Yx(e.startedAt,e);if(e.activeProjectContextBootstrap)n.push({id:`scratchpad_submit:project_context`,label:`Preparing project context`,status:`running`,...r===void 0?{}:{elapsedLabel:r},detail:`Creating project context for the first time`});else if(e.activeTaskCompile||e.activeScratchpadRefreshFromSubmit){let t=e.activeTaskCompile?$x(e.runtime):[];n.push({id:`scratchpad_submit:task_compile`,label:`Compiling Worklist tasks`,status:`running`,...r===void 0?{}:{elapsedLabel:r},...t.length===0?{}:{metrics:t}})}else n.push({id:`scratchpad_submit:task_compile`,label:`Compiling Worklist tasks`,status:t?`done`:`running`});t&&n.push({id:`scratchpad_submit:needs_input`,label:`Needs input`,status:`pending`});let i=n.find(e=>e.status===`running`||e.status===`pending`)?.label??`Compiling Worklist tasks`;return{key:`scratchpad-submit`,title:Vx,summary:t?`Task compilation needs a decision before Worklist can update.`:`Preparing the Scratchpad for formal tasks.`,tone:t?`pending`:`running`,metaLabel:t?`Needs input`:i,completionTarget:t?{kind:`clarification`}:{kind:`scratchpad`},steps:n}}function vS(e,t){return{...e,key:`${e.key}:complete`,title:Vx,summary:t,tone:`complete`,metaLabel:`Complete`,steps:e.steps.map(e=>({...e,status:`done`}))}}function yS(e,t){let n=e.completionSource;return n===void 0?!0:n.activityRef===void 0?n.workflowRef===void 0?n.taskId===void 0?!0:t.task_id===n.taskId:t.workflow_ref===n.workflowRef:t.activity_ref===n.activityRef}function bS(e){if(e.status===`idle`)return[];let t=[];if(e.status===`pending`){let n=e.blocked_by?.kind===`approval`?{kind:`approval`}:{kind:`clarification`};t.push({key:`pending`,label:`Needs input`,title:`Needs input`,tone:`pending`,target:n})}let n=e.last_conclusion?.kind===`failed`?e.last_conclusion.task_id:e.status===`failed`?e.active_task?.id??e.last_conclusion?.task_id:void 0;if(n!==void 0&&t.push({key:`failed`,label:`Run failed`,tone:`failed`,target:{kind:`task`,taskId:n}}),e.status===`running`&&e.active_task!==void 0){let n=sS(e.summary);t.push({key:`running`,label:n.label,title:n.label,tone:`running`,target:{kind:`task`,taskId:e.active_task.id}})}let r=cS(e);return r!==null&&t.push(r),t}var xS=`/assets/beethoven-symphony-5-opening-ypVy5SB4.svg`,SS=`/assets/beethoven-symphony-7-allegretto-B3bc-cZD.svg`,CS=`/assets/dvorak-symphony-9-largo-BEgNL3HB.svg`,wS=`/assets/mozart-symphony-18-allegro-B5-MrLL1.svg`,TS=`/assets/Tutti-square-BqFU7F0D.png`,ES=`/assets/Tutti-B7gEyTp1.png`,DS=`/assets/tutti_avatar-_0Yc-cMJ.png`,OS=`/assets/avatar-avery-CkLXb185.svg`,kS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2080%2080'%20fill='none'%20shape-rendering='auto'%20aria-hidden='true'%3e%3c!--%20Generated%20by%20DiceBear%20(https://dicebear.com)%20--%3e%3cmetadata%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:dcterms='http://purl.org/dc/terms/'%3e%3crdf:RDF%3e%3crdf:Description%3e%3cdc:title%3eDylan!%20The%20Avatar%20Generator%3c/dc:title%3e%3cdc:creator%3eNatalia%20Spivak%3c/dc:creator%3e%3cdc:source%20xsi:type='dcterms:URI'%3ehttps://www.figma.com/community/file/1356575240759683500%3c/dc:source%3e%3cdcterms:license%20xsi:type='dcterms:URI'%3ehttps://creativecommons.org/licenses/by/4.0/%3c/dcterms:license%3e%3cdc:rights%3eRemix%20of%20“Dylan!%20The%20Avatar%20Generator”%20(https://www.figma.com/community/file/1356575240759683500)%20by%20“Natalia%20Spivak”,%20licensed%20under%20“CC%20BY%204.0”%20(https://creativecommons.org/licenses/by/4.0/)%3c/dc:rights%3e%3c/rdf:Description%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%3e%3cg%20id='mood-happy-7dff0831'%3e%3cpath%20d='M.04%2017.04c2.41%209.29%2015.16%2012.28%2022.34%206.67a14%2014%200%200%200%204.7-7.22c.36-1.28-1.57-1.8-1.93-.57-1.24%204.23-4.33%207.4-8.68%208.33-3.77.8-8.03-.1-11.05-2.52a10%2010%200%200%201-3.45-5.26c-.32-1.25-2.25-.72-1.93.53'%20fill='black'/%3e%3c/g%3e%3cg%20id='hair-shortCurls-7dff0831'%3e%3cpath%20d='m15.3%2027.49%201.58%204.38%201.06-9.52s2.27%201.27%203.44-.26.16-3.47.16-3.47%201.81.55%203.31-.8c1.87-1.67%201.26-3.46%201.26-3.46s1.71%201.9%204.5%201.1c2.77-.8%203.14-2.76%203.14-2.76s.56%202.18%203.4%202.12%203.2-2.01%203.2-2.01%200%202.43%202.43%203.14%203.43-1.24%203.43-1.24c0%20.02-.9%202.39.66%203.76%201.44%201.26%203.5.35%203.5.35s-.73%202.3.77%203.62c1.6%201.4%203.48.6%203.48.6l.77%208.34%201.8-3.8s1.4-.13%202.72.15c0%20.01%202.58-2.78%201.15-5.9s-3.64-2.86-3.64-2.86%201.95-3.05.13-5.65-4.94-1.96-4.94-1.96%201.18-3.52-1.68-5.27-5.92.46-5.92.46-.1-3.7-3.2-4.16c-3.26-.48-4.58%202.66-4.58%202.66s-1.35-2.89-4.14-2.44c-2.8.44-3.32%203.53-3.32%203.53S27.32%203.57%2024.92%205s-1.8%204.51-1.8%204.51-2.98-2.24-5.32-.23-.14%205.1-.14%205.1-3.87-1.12-5.04%201.8%201.66%204.95%201.66%204.95-5.35%201.16-2.82%207.33c0%200%20.6-.27%202.02-.62s1.8-.38%201.8-.38z'%20fill='%23000000'/%3e%3c/g%3e%3cclipPath%20id='clip-7dff0831'%3e%3crect%20width='80'%20height='80'%20rx='0'%20ry='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23clip-7dff0831)'%3e%3crect%20width='80'%20height='80'%20fill='%23e5f4ec'/%3e%3cpath%20d='M19.07%2030.47s1.57-20.23%2021.59-20.23S62.3%2030.55%2062.3%2030.55s9.43-.8%209.43%207.6c0%208.42-9.28%207.13-9.28%207.13S60.9%2067.15%2042.03%2067.15c-21.11%200-23.4-20.8-23.4-20.8s-9%20.72-9.93-6.25c-1.08-8.2%2010.37-9.64%2010.37-9.64'%20fill='%23c26450'/%3e%3cpath%20d='m64.3%2039.49.46-.41.1-.09c.12-.1-.13.1-.02.02l.24-.17q.5-.35%201.06-.62l.26-.12.05-.02.05-.02.58-.21q.6-.18%201.2-.28c.52-.08.85-.76.7-1.23-.18-.56-.67-.8-1.23-.7a9.3%209.3%200%200%200-4.87%202.43c-.38.36-.4%201.06%200%201.4.4.36%201%20.4%201.4%200zm-51.8-1.16.14.01c-.27-.02-.11-.01-.04%200l.3.05.52.14.28.09.12.05c.02%200%20.22.09.06.02-.14-.1%200-.04.03-.03l.15.06.26.13.47.3.27.22q.47.38.83.83c.33.4%201.07.37%201.41%200%20.4-.43.36-.98%200-1.4a7.3%207.3%200%200%200-4.84-2.53c-.52-.06-1.02.5-1%201%20.03.59.44.94%201%201m18.3-1.9v4.54c0%20.52.46%201.02%201%201s1-.44%201-1V36.4c0-.52-.46-1.02-1-1s-1%20.44-1%201M49.2%2036l-.15%204.81a1%201%200%200%200%201%201c.56-.02.98-.44%201-1l.15-4.8a1%201%200%200%200-1-1%201%201%200%200%200-1%201'%20fill='black'/%3e%3cuse%20transform='translate(27.82%2026.75)'%20href='%23mood-happy-7dff0831'/%3e%3cuse%20transform='translate(3.78%202.95)'%20href='%23hair-shortCurls-7dff0831'/%3e%3c/g%3e%3c/svg%3e`,AS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2080%2080'%20fill='none'%20shape-rendering='auto'%20aria-hidden='true'%3e%3c!--%20Generated%20by%20DiceBear%20(https://dicebear.com)%20--%3e%3cmetadata%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:dcterms='http://purl.org/dc/terms/'%3e%3crdf:RDF%3e%3crdf:Description%3e%3cdc:title%3eDylan!%20The%20Avatar%20Generator%3c/dc:title%3e%3cdc:creator%3eNatalia%20Spivak%3c/dc:creator%3e%3cdc:source%20xsi:type='dcterms:URI'%3ehttps://www.figma.com/community/file/1356575240759683500%3c/dc:source%3e%3cdcterms:license%20xsi:type='dcterms:URI'%3ehttps://creativecommons.org/licenses/by/4.0/%3c/dcterms:license%3e%3cdc:rights%3eRemix%20of%20“Dylan!%20The%20Avatar%20Generator”%20(https://www.figma.com/community/file/1356575240759683500)%20by%20“Natalia%20Spivak”,%20licensed%20under%20“CC%20BY%204.0”%20(https://creativecommons.org/licenses/by/4.0/)%3c/dc:rights%3e%3c/rdf:Description%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%3e%3cg%20id='mood-happy-46c131e2'%3e%3cpath%20d='M.04%2017.04c2.41%209.29%2015.16%2012.28%2022.34%206.67a14%2014%200%200%200%204.7-7.22c.36-1.28-1.57-1.8-1.93-.57-1.24%204.23-4.33%207.4-8.68%208.33-3.77.8-8.03-.1-11.05-2.52a10%2010%200%200%201-3.45-5.26c-.32-1.25-2.25-.72-1.93.53'%20fill='black'/%3e%3c/g%3e%3cg%20id='hair-fluffy-46c131e2'%3e%3cpath%20d='M16.45%2029.48s13.74%2023.53%203.86%2028.24C9.05%2063.08-1.2%2048.01.1%2036.77s10.96-16.35%2010.96-16.35-.58-9.5%209.2-15.04c9.78-5.55%2016.64.44%2016.64.44s8.06-5.9%2015.5-1.37c7.46%204.53%207.26%2014.68%207.26%2014.68s13.74-.56%2013.65%2016.47c-.08%2015.17-10.03%2022.94-16.8%2021.6-10.45-2.07%201.27-29.22%201.27-29.22s-14.4%201.04-20.14-9.75c0%200-4%205.95-9.7%208.62a32%2032%200%200%201-11.47%202.64z'%20fill='%231d5dff'/%3e%3c/g%3e%3cclipPath%20id='clip-46c131e2'%3e%3crect%20width='80'%20height='80'%20rx='0'%20ry='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23clip-46c131e2)'%3e%3crect%20width='80'%20height='80'%20fill='%23fbf0d1'/%3e%3cpath%20d='M19.07%2030.47s1.57-20.23%2021.59-20.23S62.3%2030.55%2062.3%2030.55s9.43-.8%209.43%207.6c0%208.42-9.28%207.13-9.28%207.13S60.9%2067.15%2042.03%2067.15c-21.11%200-23.4-20.8-23.4-20.8s-9%20.72-9.93-6.25c-1.08-8.2%2010.37-9.64%2010.37-9.64'%20fill='%23c26450'/%3e%3cpath%20d='m64.3%2039.49.46-.41.1-.09c.12-.1-.13.1-.02.02l.24-.17q.5-.35%201.06-.62l.26-.12.05-.02.05-.02.58-.21q.6-.18%201.2-.28c.52-.08.85-.76.7-1.23-.18-.56-.67-.8-1.23-.7a9.3%209.3%200%200%200-4.87%202.43c-.38.36-.4%201.06%200%201.4.4.36%201%20.4%201.4%200zm-51.8-1.16.14.01c-.27-.02-.11-.01-.04%200l.3.05.52.14.28.09.12.05c.02%200%20.22.09.06.02-.14-.1%200-.04.03-.03l.15.06.26.13.47.3.27.22q.47.38.83.83c.33.4%201.07.37%201.41%200%20.4-.43.36-.98%200-1.4a7.3%207.3%200%200%200-4.84-2.53c-.52-.06-1.02.5-1%201%20.03.59.44.94%201%201m18.3-1.9v4.54c0%20.52.46%201.02%201%201s1-.44%201-1V36.4c0-.52-.46-1.02-1-1s-1%20.44-1%201M49.2%2036l-.15%204.81a1%201%200%200%200%201%201c.56-.02.98-.44%201-1l.15-4.8a1%201%200%200%200-1-1%201%201%200%200%200-1%201'%20fill='black'/%3e%3cuse%20transform='translate(27.82%2026.75)'%20href='%23mood-happy-46c131e2'/%3e%3cuse%20transform='translate(3.78%202.95)'%20href='%23hair-fluffy-46c131e2'/%3e%3c/g%3e%3c/svg%3e`,jS=`/assets/ode-to-joy-SNBUPr3-.svg`,MS=TS,NS=ES,PS=DS,FS={logoSrc:ES,tuttiAvatarSrc:DS,scoreSrc:jS,humanAvatars:{fey:kS,avery:OS,jun:AS}};function IS({onClick:e}){let t=(0,P.jsx)(Ds,{src:NS,label:`Tutti`});return e===void 0?t:(0,P.jsx)(Os,{logo:t,label:`Tutti Project Center`,onClick:e})}function LS({onClick:e}){return(0,P.jsx)(Os,{logo:(0,P.jsx)(Ds,{src:NS,className:`tutti-logo`}),onClick:e})}var RS=`https://lets.tutti.now`,zS=`${RS}/start/create-a-project#connect-a-provider-and-choose-a-model`,BS={href:RS,target:`_blank`,rel:`noopener noreferrer`};function VS(){return(0,P.jsxs)(pd,{children:[`New to Tutti?`,` `,(0,P.jsx)(`a`,{...BS,"aria-label":`Read the Tutti documentation (opens in a new tab)`,children:`Read the docs`}),`.`]})}function HS(){return(0,P.jsx)(Ls,{...BS,label:`Support Center`,icon:(0,P.jsx)(pi,{"aria-hidden":`true`})})}var US=[xS,SS,CS,wS];function WS(){return US[Math.min(US.length-1,Math.floor(Math.random()*US.length))]}function GS({backgroundPattern:e,children:t,...n}){let[r]=(0,N.useState)(WS);return(0,P.jsx)(Uo,{...e===void 0?{backgroundImageSrc:r}:{backgroundPattern:e},...n,children:t})}function KS({actions:e,children:t,onBrandClick:n}){return(0,P.jsxs)(GS,{children:[(0,P.jsx)(Wo,{brand:(0,P.jsx)(LS,{onClick:n}),actions:e}),t]})}function qS({children:e,label:t,onBrandClick:n}){return(0,P.jsx)(KS,{onBrandClick:n,children:(0,P.jsx)(Ko,{"aria-label":t,children:e})})}function JS({auth:e,mobileAuth:t,onBrandClick:n}){return(0,P.jsx)(GS,{backgroundPattern:`dots`,className:`homepage-entry-page`,children:(0,P.jsx)(fd,{brand:(0,P.jsx)(LS,{onClick:n}),visual:(0,P.jsx)(Kd,{assets:FS}),auth:e,mobileAuth:t,footer:(0,P.jsx)(VS,{})})})}function YS({phase:e,form:t,onChange:n}){return e===`code`?(0,P.jsx)(`div`,{className:`form-stack`,children:(0,P.jsx)(Ns,{label:`Email verification code`,children:(0,P.jsx)(ks,{autoComplete:`one-time-code`,inputMode:`numeric`,type:`text`,value:t.code,onChange:e=>n({code:e.target.value}),placeholder:`Enter email code`,maxLength:6})})}):e===`profile`?(0,P.jsxs)(`div`,{className:`form-stack`,children:[(0,P.jsx)(Ns,{label:`Display name`,children:(0,P.jsx)(ks,{autoComplete:`name`,type:`text`,value:t.displayName,onChange:e=>n({displayName:e.target.value}),placeholder:`username`})}),(0,P.jsx)(`p`,{className:`form-note`,children:`This name cannot be changed yet.`})]}):(0,P.jsx)(`div`,{className:`form-stack`,children:(0,P.jsx)(Ns,{label:`Email`,children:(0,P.jsx)(ks,{autoComplete:`email`,type:`email`,value:t.email,onChange:e=>n({email:e.target.value}),placeholder:`alex@example.com`})})})}function XS({surface:e,phase:t,form:n,pending:r,error:i,submitDisabled:a,submitLabel:o,pendingLabel:s,onChange:c,onSubmit:l,onBack:u}){let d={title:t===`profile`?`Choose display name`:`Sign in`,description:t===`profile`?`Set the name your teammates will see.`:t===`code`?`Enter your email verification code.`:`Use your email to continue.`,onSubmit:l,action:(0,P.jsxs)(xs,{type:`submit`,disabled:a||r,children:[r?s??(t===`profile`?`Saving`:t===`code`?`Verifying`:`Sending code`):o??(t===`profile`?`Save name`:t===`code`?`Verify email code`:`Send code`),(0,P.jsx)(ai,{"aria-hidden":`true`})]}),secondaryAction:t===`code`&&u!==void 0?(0,P.jsxs)(Ss,{type:`button`,onClick:u,disabled:r,children:[(0,P.jsx)(ii,{"aria-hidden":`true`}),`Change email`]}):void 0,feedback:i===null?void 0:(0,P.jsx)(Ps,{children:i}),children:(0,P.jsx)(YS,{phase:t,form:n,onChange:c})};return e===`card`?(0,P.jsx)(tf,{...d}):(0,P.jsx)(md,{...d})}function ZS(e){return(0,P.jsx)(XS,{...e,surface:`card`})}function QS(e){return(0,P.jsx)(XS,{...e,surface:`rail`})}function $S({onBrandClick:e,...t}){return(0,P.jsx)(JS,{onBrandClick:e,auth:(0,P.jsx)(QS,{...t}),mobileAuth:(0,P.jsx)(ZS,{...t})})}function eC({nextKind:e,actionPending:t,loginForm:n,onRetry:r,onAccept:i,onOpen:a}){if(e===`loading`)return(0,P.jsx)(Ss,{type:`button`,disabled:!0,children:`Loading`});if(e===`error`)return(0,P.jsx)(Ss,{type:`button`,onClick:r,children:`Retry`});if(e===`invalid_or_expired`)return(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(na,{"aria-hidden":`true`}),`Invalid invite`]});if(e===`login_required`){let e=n?.phase===`profile`?`Save name`:n?.phase===`code`?`Verify email code`:`Send code`,r=n?.phase===`profile`?`Saving`:n?.phase===`code`?`Verifying`:`Sending code`;return(0,P.jsxs)(xs,{type:`submit`,disabled:t||n?.submitDisabled===!0,children:[t?r:e,(0,P.jsx)(ai,{"aria-hidden":`true`})]})}return e===`accept_join`?(0,P.jsxs)(xs,{type:`button`,disabled:t,onClick:i,children:[t?`Joining`:`Accept and open workspace`,(0,P.jsx)(ai,{"aria-hidden":`true`})]}):e===`open_workspace`?(0,P.jsxs)(xs,{type:`button`,disabled:t,onClick:a,children:[t?`Opening`:`Open workspace`,(0,P.jsx)(ai,{"aria-hidden":`true`})]}):(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(Hi,{"aria-hidden":`true`}),`Host offline`]})}function tC({nextKind:e,error:t}){return e===`loading`?null:e===`error`?(0,P.jsx)(aa,{tone:`error`,icon:(0,P.jsx)(na,{"aria-hidden":`true`}),children:t??`Invite unavailable`}):e===`invalid_or_expired`?(0,P.jsx)(aa,{tone:`error`,icon:(0,P.jsx)(na,{"aria-hidden":`true`}),children:`Join token is invalid or expired`}):e===`host_offline`?(0,P.jsx)(aa,{tone:`warning`,icon:(0,P.jsx)(Hi,{"aria-hidden":`true`}),children:`Host is offline`}):null}function nC({projectName:e,description:t,hostLabel:n,hostOnline:r,nextKind:i,accountLabel:a,membershipLabel:o,actionPending:s,error:c,loginForm:l,onBrandClick:u,onRetry:d,onAccept:f,onOpen:p}){let m=i===`login_required`&&l!==void 0;return(0,P.jsx)(qS,{label:`Join project`,onBrandClick:u,children:(0,P.jsxs)(tf,{title:`Join project`,description:t,onSubmit:e=>{if(m){l.onSubmit(e);return}e.preventDefault()},action:(0,P.jsx)(eC,{nextKind:i,actionPending:m?l.pending:s,...m?{loginForm:l}:{},onAccept:f,onOpen:p,...d===void 0?{}:{onRetry:d}}),secondaryAction:m&&l.phase===`code`&&l.onBack!==void 0?(0,P.jsxs)(Ss,{type:`button`,onClick:l.onBack,disabled:l.pending,children:[(0,P.jsx)(ii,{"aria-hidden":`true`}),`Change email`]}):void 0,feedback:(0,P.jsxs)(P.Fragment,{children:[m&&l.error!==null?(0,P.jsx)(Ps,{children:l.error}):null,(0,P.jsx)(tC,{nextKind:i,error:c}),c===null||i===`error`?null:(0,P.jsx)(Ps,{children:c})]}),children:[(0,P.jsx)(nf,{projectName:e,hostLabel:n,hostOnline:r}),m?(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(YS,{phase:l.phase,form:l.form,onChange:l.onChange})}):(0,P.jsx)(rf,{label:a===null?`Account`:`Signed in as`,value:a??`Sign in required`,action:o===null?null:(0,P.jsx)(`span`,{className:`quiet-link`,children:o})})]})})}function rC(e){switch(e.status){case`online`:return`Online`;case`reconnecting`:return`Reconnecting`;case`relay-unavailable`:return`Relay unavailable`;case`stale`:return`Needs restart`;case`stopped`:return`Stopped`;case`workspace-missing`:return`Folder missing`;case`workspace-replaced`:return`Folder changed`;case`invalid`:return`Needs attention`}}function iC(e){return(e.status===`online`||e.status===`reconnecting`)&&e.provider_status===`configured`}function aC(e){return(e.status===`stopped`||e.status===`stale`||e.status===`relay-unavailable`)&&e.provider_status===`configured`}function oC(e,t){let n=Date.parse(e.activity_at??``),r=Date.parse(t.activity_at??``),i=Number.isNaN(n)?0:n;return(Number.isNaN(r)?0:r)-i||e.display_name.localeCompare(t.display_name,`en`)||e.project_id.localeCompare(t.project_id,`en`)}function sC(e){return e.provider_status===`configured`?e.provider_model?.trim()||`Provider ready`:e.provider_status===`invalid`?`Provider issue`:`Provider needed`}function cC({project:e,pending:t,onLaunch:n,onOpen:r,onCopyInvite:i,onStop:a}){return e.status===`online`||e.status===`reconnecting`?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(xs,{type:`button`,disabled:t||e.open_url===void 0,onClick:r,children:[(0,P.jsx)(yi,{"aria-hidden":`true`}),`Open`]}),(0,P.jsxs)(Ss,{type:`button`,disabled:t,onClick:i,children:[(0,P.jsx)(Ai,{"aria-hidden":`true`}),`Invite`]}),(0,P.jsxs)(Ss,{type:`button`,disabled:t,onClick:a,children:[(0,P.jsx)(Qi,{"aria-hidden":`true`}),`Stop`]})]}):(0,P.jsxs)(Ss,{type:`button`,disabled:t||!aC(e),onClick:n,children:[(0,P.jsx)(Wi,{"aria-hidden":`true`}),`Resume`]})}function lC({form:e,models:t,projects:n,projectsLoading:r,sessionLoading:i,sessionError:a,createOpen:o,createStep:s,modelDiscoveryPending:c,launchPending:l,projectActionPending:u,packageUpdateAction:d,onChange:f,onCreateOpenChange:p,onCreateSubmit:m,onCreateBack:h,onChooseFolder:g,onRefresh:_,onLaunchExisting:v,onOpenProject:y,onCopyInvite:b,onStopProject:x,onPackageUpdate:S}){let C=[`Folder`,`Details`,`Provider`,`Model`],w=C.findIndex(e=>e.toLowerCase()===s),T=c||l,E=s===`folder`?e.workspacePath.trim()!==``:s===`details`?e.displayName.trim()!==``:s===`provider`?e.baseUrl.trim()!==``&&e.apiKey.trim()!==``:t.length>0&&e.model.trim()!==``,ee=n.filter(iC).sort(oC),D=n.filter(aC).sort(oC),O=n.filter(e=>!iC(e)&&!aC(e)).sort(oC),k=e=>(0,P.jsx)(Cf,{title:e.display_name,statusLabel:rC(e),online:e.status===`online`,path:e.workspace_path,createdLabel:Qn(e.created_at),providerLabel:sC(e),providerStatus:e.provider_status,actions:(0,P.jsx)(cC,{project:e,pending:u===e.project_id,onLaunch:()=>v(e),onOpen:()=>y(e),onCopyInvite:()=>b(e),onStop:()=>x(e)})},e.project_id);return(0,P.jsx)(KS,{onBrandClick:_,children:(0,P.jsxs)(Go,{children:[(0,P.jsxs)(af,{className:`local-console-card`,title:`Local projects`,accountAction:(0,P.jsxs)(P.Fragment,{children:[d===void 0?null:(0,P.jsx)(of,{description:d.description,descriptionId:`local-console-package-update-description`,disabledTrigger:d.disabled,"aria-live":`polite`,action:(0,P.jsx)(Ss,{type:`button`,disabled:d.disabled,onClick:S,children:d.label})}),(0,P.jsx)(bs,{type:`button`,label:`Refresh projects`,icon:(0,P.jsx)(Ui,{"aria-hidden":`true`}),disabled:r,onClick:_}),(0,P.jsxs)(xs,{type:`button`,disabled:i||a!==null,onClick:()=>p(!0),children:[(0,P.jsx)(Vi,{"aria-hidden":`true`}),`New project`]})]}),"aria-label":`Tutti Local Console`,children:[r||i?(0,P.jsx)(ff,{"aria-label":`Machine projects`,children:(0,P.jsx)(hf,{"aria-label":`Loading local projects`,children:(0,P.jsx)(oa,{})})}):a===null?n.length===0?(0,P.jsx)(ff,{"aria-label":`Machine projects`,children:(0,P.jsx)(hf,{children:(0,P.jsx)(aa,{children:`Create your first local project.`})})}):null:(0,P.jsx)(ff,{"aria-label":`Machine projects`,children:(0,P.jsx)(hf,{children:(0,P.jsx)(aa,{children:a})})}),r||i||n.length===0?null:(0,P.jsxs)(P.Fragment,{children:[ee.length===0?null:(0,P.jsx)(xf,{title:`Available`,"aria-label":`Available projects`,children:ee.map(k)}),D.length===0?null:(0,P.jsx)(xf,{title:`Ready to resume`,"aria-label":`Projects ready to resume`,children:D.map(k)}),O.length===0?null:(0,P.jsx)(Sf,{children:O.map(k)})]})]}),(0,P.jsxs)(_f,{open:o,onOpenChange:p,steps:C,currentStep:Math.max(0,w),closeDisabled:T,explicitCloseOnly:!0,onSubmit:m,backAction:s===`folder`?void 0:(0,P.jsxs)(Ss,{type:`button`,disabled:T,onClick:h,children:[(0,P.jsx)(ii,{"aria-hidden":`true`}),`Back`]}),action:(0,P.jsxs)(xs,{type:`submit`,disabled:!E||T||i,children:[s===`model`?(0,P.jsx)(Wi,{"aria-hidden":`true`}):(0,P.jsx)(ai,{"aria-hidden":`true`}),s===`provider`&&c?`Checking provider`:s===`model`?l?`Launching`:`Launch and continue`:`Continue`]}),children:[s===`folder`?(0,P.jsx)(bf,{title:`Project folder`,description:`Choose an existing folder on this machine. It can be empty or contain an existing project.`,children:(0,P.jsxs)(yf,{children:[(0,P.jsx)(ks,{"aria-label":`Project folder`,autoComplete:`off`,value:e.workspacePath,onChange:e=>f({workspacePath:e.target.value}),placeholder:`Enter an absolute project folder path`,autoFocus:!0}),(0,P.jsxs)(Ss,{type:`button`,onClick:g,children:[(0,P.jsx)(wi,{"aria-hidden":`true`}),`Choose folder`]})]})}):null,s===`details`?(0,P.jsx)(bf,{title:`Project details`,description:`Describe what you want to build with this project.`,children:(0,P.jsxs)(vf,{children:[(0,P.jsx)(Ns,{label:`Project name`,className:`local-console-field-wide`,children:(0,P.jsx)(ks,{autoComplete:`off`,value:e.displayName,maxLength:80,onChange:e=>f({displayName:e.target.value}),placeholder:`Enter a project name`,autoFocus:!0})}),(0,P.jsx)(Ns,{label:`Project description (optional)`,className:`local-console-field-wide`,children:(0,P.jsx)(As,{value:e.description,maxLength:160,onChange:e=>f({description:e.target.value}),placeholder:`A short project description helps Tutti produce better code`})})]})}):null,s===`provider`?(0,P.jsx)(bf,{title:`Provider`,description:(0,P.jsxs)(P.Fragment,{children:[`Enter an endpoint compatible with the`,` `,(0,P.jsx)(Fs,{href:zS,"aria-label":`Tutti Responses API provider guide (opens in a new tab)`,icon:(0,P.jsx)(pi,{"aria-hidden":`true`}),children:`OpenAI Responses API`}),`. Credentials stay only on this machine.`]}),children:(0,P.jsxs)(vf,{children:[(0,P.jsx)(Ns,{label:`Base URL`,children:(0,P.jsx)(ks,{autoComplete:`off`,inputMode:`url`,type:`url`,value:e.baseUrl,onChange:e=>f({baseUrl:e.target.value}),placeholder:`Enter Provider Base URL`,autoFocus:!0})}),(0,P.jsx)(Ns,{label:`API key`,children:(0,P.jsx)(ks,{autoComplete:`off`,type:`password`,value:e.apiKey,onChange:e=>f({apiKey:e.target.value}),placeholder:`Enter API key`})})]})}):null,s===`model`?(0,P.jsx)(bf,{title:`Model`,description:`Choose an available model or type another model name.`,children:(0,P.jsx)(Ns,{label:`Model`,children:(0,P.jsx)(js,{autoComplete:`off`,value:e.model,options:t,maxVisibleOptions:8,onValueChange:e=>f({model:e}),placeholder:`Choose or enter a model`,autoFocus:!0})})}):null]})]})})}function uC({onBrandClick:e,sessionError:t=null,...n}){let r={...n,error:n.error??t};return(0,P.jsx)(JS,{onBrandClick:e,auth:(0,P.jsx)(QS,{...r}),mobileAuth:(0,P.jsx)(ZS,{...r})})}function dC({account:e,projects:t,loading:n,error:r,openPending:i,logoutPending:a,joinLinkForm:o,launchExpanded:s,onLaunch:c,onCopyLaunchCommand:l,onBrandClick:u,onLogout:d,onOpenProject:f}){let p=t.filter(e=>e.hostStatus===`offline`),m=t.filter(e=>e.hostStatus!==`offline`),h=e=>(0,P.jsx)(mf,{title:e.displayName,statusLabel:`Host ${e.hostStatusLabel.toLowerCase()}`,online:e.canOpen,details:[{label:`Role`,value:e.membershipLabel},{label:`Opened`,value:e.lastOpenedLabel}],disabled:!e.canOpen||i,onClick:()=>f(e.relayProjectRef)},e.relayProjectRef);return(0,P.jsx)(KS,{onBrandClick:u,children:(0,P.jsx)(Go,{children:(0,P.jsxs)(af,{title:`Projects`,...e===null?{}:{accountName:e.displayName,accountAction:(0,P.jsxs)(Ss,{type:`button`,onClick:d,disabled:a,children:[(0,P.jsx)(Ni,{"aria-hidden":`true`}),`Sign out`]})},"aria-label":`Project Center`,children:[(0,P.jsxs)(sf,{children:[(0,P.jsx)(lf,{title:`Join a project`,description:`Paste an invitation link or the full invitation message.`,inputLabel:`Invitation link or message`,placeholder:`Paste an invitation link or message`,value:o.value,error:o.error,onValueChange:o.onChange,"aria-label":`Join a project`,onSubmit:e=>{e.preventDefault(),o.onSubmit()}}),(0,P.jsx)(uf,{title:`Launch from your computer`,description:`Open Tutti on this computer to create or manage local projects.`,actionHref:`tutti://projects`,expanded:s,statusTitle:`Opening the Tutti app…`,statusDescription:`If Tutti is not installed, copy this command and run it in Terminal:`,command:`npm install -g @xfey/tutti && tutti`,onAction:c,onCopyCommand:l,"aria-label":`Launch a project from your computer`})]}),n?(0,P.jsx)(ff,{children:(0,P.jsx)(hf,{"aria-label":`Loading projects`,children:(0,P.jsx)(oa,{})})}):r===null?(0,P.jsxs)(P.Fragment,{children:[m.length===0?(0,P.jsx)(ff,{children:(0,P.jsx)(hf,{"aria-label":`No available projects`,children:(0,P.jsx)(aa,{children:`No available projects`})})}):(0,P.jsx)(ff,{children:m.map(h)}),p.length===0?null:(0,P.jsx)(pf,{title:`Offline Projects`,listLabel:`Offline projects`,className:`project-center-offline-projects`,children:p.map(h)})]}):(0,P.jsx)(ff,{children:(0,P.jsx)(hf,{"aria-label":`Project Center error`,children:(0,P.jsx)(aa,{tone:`error`,children:r})})})]})})})}function fC({form:e,pending:t,tokenMissing:n,onChange:r}){return(0,P.jsxs)(`div`,{className:`form-stack`,children:[(0,P.jsx)(Ns,{label:`Project name`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`text`,value:e.projectName,onChange:e=>r({projectName:e.target.value}),placeholder:`tutti-default`})}),(0,P.jsx)(Ns,{label:`OpenAI API key`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`password`,value:e.apiKey,onChange:e=>r({apiKey:e.target.value}),placeholder:`sk-...`})}),(0,P.jsx)(Ns,{label:`Base URL`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`url`,value:e.baseUrl,onChange:e=>r({baseUrl:e.target.value}),placeholder:`https://api.openai.com/v1`})}),(0,P.jsx)(Ns,{label:`Default model`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`text`,value:e.defaultModel,onChange:e=>r({defaultModel:e.target.value}),placeholder:`gpt-5.5`})})]})}function pC({form:e,statusLabel:t,configured:n,loading:r,pending:i,openProjectPending:a=!1,tokenMissing:o,error:s,success:c,onChange:l,onSubmit:u,onRetry:d,onBrandClick:f}){let p=i||a;return(0,P.jsx)(qS,{label:`Project setup`,onBrandClick:f,children:(0,P.jsxs)(tf,{title:`Project setup`,description:`Configure the provider for this project.`,size:`wide`,onSubmit:u,action:o?(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(na,{"aria-hidden":`true`}),`Missing token`]}):s!==null&&r?(0,P.jsx)(Ss,{type:`button`,onClick:d,children:`Retry`}):a?(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(ai,{"aria-hidden":`true`}),`Opening project`]}):(0,P.jsxs)(xs,{type:`submit`,disabled:i||e.apiKey.trim()===``||e.projectName.trim()===``,children:[i?`Saving`:`Save provider`,(0,P.jsx)(Gi,{"aria-hidden":`true`})]}),feedback:(0,P.jsxs)(P.Fragment,{children:[c===null?null:(0,P.jsx)(aa,{icon:(0,P.jsx)(fi,{"aria-hidden":`true`}),children:c}),s===null?null:(0,P.jsx)(Ps,{children:s})]}),children:[(0,P.jsx)(nf,{projectName:`OpenAI provider`,hostLabel:t,hostOnline:n,members:(0,P.jsx)(Oi,{"aria-hidden":`true`})}),(0,P.jsx)(rf,{label:`Status`,value:r?`Loading`:t,action:n?(0,P.jsx)(fi,{"aria-hidden":`true`}):null}),(0,P.jsx)(fC,{form:e,pending:p,tokenMissing:o,onChange:l})]})})}var mC=`http://127.0.0.1:4370`;function hC(){let e=`https://tutti.now`;return typeof e==`string`?e:typeof window<`u`&&window.location.port!==`4372`?window.location.origin:mC}function gC(e){try{return new URL(e,hC()).toString()}catch{return e}}function _C({avatar:e,label:t,plain:n=!1,online:r=!1}){return(0,P.jsx)(Yo,{label:t,tone:e.color,plain:n,online:r,initials:e.initials,...e.kind===`image`?{imageUrl:gC(e.image_url)}:{}})}function vC({label:e=`Tutti`}){return(0,P.jsx)(Yo,{label:e,tone:`green`,className:`is-system`,imageUrl:PS,icon:(0,P.jsx)(si,{"aria-hidden":`true`})})}function yC({tone:e}){return e===`pending`?(0,P.jsx)(na,{"aria-hidden":`true`}):e===`failed`?(0,P.jsx)(mi,{"aria-hidden":`true`}):e===`done`?(0,P.jsx)(li,{"aria-hidden":`true`}):(0,P.jsx)(Mi,{"aria-hidden":`true`})}function bC({members:e}){return e===void 0||e.length===0?null:(0,P.jsx)(Xo,{"aria-label":`Members`,children:e.map(e=>(0,P.jsx)(_C,{avatar:e.avatar,label:e.displayName},e.key))})}function xC({activePage:e,statusShortcuts:t,unread:n,artifactSignal:r,mobileContext:i,children:a,onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenArtifacts:u,onOpenSkills:d,onOpenTimeline:f,onOpenSettings:p,onActivateStatusShortcut:m,getStatusShortcutAriaControls:h}){let g=e!==`chat`&&n?.chat===!0,_=e!==`worklist`&&n?.worklist===!0,v=r?.available===!0,y=e!==`references`&&n?.references===!0,b=e!==`skills`&&n?.skills===!0;return(0,P.jsx)(qo,{children:(0,P.jsx)(Jo,{className:`is-headerless`,sidebar:(0,P.jsxs)(Is,{brand:(0,P.jsx)(IS,{...o===void 0?{}:{onClick:o}}),mobileTitle:i.title,...i.meta===void 0?{}:{mobileMeta:i.meta},...i.action===void 0?{}:{mobileAction:i.action},...t.length===0?{}:{status:t.map(e=>(0,N.createElement)(zs,{icon:(0,P.jsx)(yC,{tone:e.tone}),label:e.label,tone:e.tone,onClick:()=>m?.(e),...h?.(e)===void 0?{}:{"aria-controls":h(e)},key:e.key}))},footer:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(HS,{}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(qi,{"aria-hidden":`true`}),label:`Settings`,active:e===`settings`,onClick:e===`settings`?void 0:p})]}),children:[(0,P.jsx)(Rs,{icon:(0,P.jsx)(jy,{"aria-hidden":`true`}),label:`Chat`,active:e===`chat`,badge:g?{label:`Unread messages`}:!1,onClick:e===`chat`?void 0:s}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(ji,{"aria-hidden":`true`}),label:`Worklist`,active:e===`worklist`,badge:_?{label:`Unread worklist updates`}:!1,onClick:e===`worklist`?void 0:c}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(Li,{"aria-hidden":`true`}),label:`Artifacts`,active:e===`artifacts`,badge:v?{label:`Artifacts available`,text:`Live`,variant:`pill`}:!1,onClick:e===`artifacts`?void 0:u}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(Si,{"aria-hidden":`true`}),label:`References`,active:e===`references`,badge:y?{label:`New reference files`}:!1,onClick:e===`references`?void 0:l}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(Xi,{"aria-hidden":`true`}),label:`Skills`,active:e===`skills`,badge:b?{label:`New skill updates`}:!1,onClick:e===`skills`?void 0:d}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(ci,{"aria-hidden":`true`}),label:`Timeline`,active:e===`timeline`,onClick:e===`timeline`?void 0:f})]}),children:a})})}function SC(){return(0,P.jsx)(Ds,{src:NS,className:`empty-state-brand-logo`})}function CC(e){return(0,P.jsx)(aa,{watermark:(0,P.jsx)(SC,{}),...e})}var wC=`tutti.execution-score-themes.v1`,TC=40,EC={assignments:[],bag:[]};function DC(){return{assignments:[],bag:[]}}function OC(){try{return typeof window>`u`?null:window.sessionStorage}catch{return null}}function kC(e,t){if(typeof e!=`object`||!e)return null;let n=e;if(!Array.isArray(n.assignments)||!Array.isArray(n.bag))return null;let r=n.assignments.filter(e=>typeof e==`object`&&!!e&&typeof e.identity==`string`&&t.has(String(e.themeId))),i=n.bag.filter(e=>typeof e==`string`&&t.has(e)),a=typeof n.recent==`string`&&t.has(n.recent)?n.recent:void 0;return{assignments:r,bag:i,...a===void 0?{}:{recent:a}}}function AC(e,t){if(e===null)return EC;try{let n=e.getItem(wC);return n===null?DC():kC(JSON.parse(n),t)??DC()}catch{return EC}}function jC(e,t){if(EC=t,e!==null)try{e.setItem(wC,JSON.stringify(t))}catch{}}function MC(e,t,n){let r=e.map(e=>e.id);for(let e=r.length-1;e>0;--e){let t=Math.min(e,Math.max(0,Math.floor(n()*(e+1))));[r[e],r[t]]=[r[t],r[e]]}if(r.length>1&&r[0]===t){let e=r.findIndex(e=>e!==t);[r[0],r[e]]=[r[e],r[0]]}return r}function NC(e,t={}){let n=t.themes??Vo;if(n.length===0)throw Error(`Execution score themes are unavailable`);let r=new Map(n.map(e=>[e.id,e])),i=new Set(r.keys()),a=t.storage===void 0?OC():t.storage,o=AC(a,i),s=o.assignments.find(t=>t.identity===e),c=s===void 0?void 0:r.get(s.themeId);if(c!==void 0)return c;let l=t.random??Math.random,u=o.bag.length>0?[...o.bag]:MC(n,o.recent,l),d=u.shift(),f=d===void 0?void 0:r.get(d);if(f===void 0)throw Error(`Execution score themes are unavailable`);return jC(a,{assignments:[...o.assignments,{identity:e,themeId:f.id}].slice(-TC),bag:u,recent:f.id}),f}function PC(e){return`round-card-${e}`}function FC(e){return`approval-card-${e}`}function IC(e){return`chat-message-${e}`}var LC=`workspace-scratchpad`,RC=720,zC=80,BC=160,VC=96,HC=160,UC=2;function WC(e){return e.completionSource?.activityRef??e.completionSource?.workflowRef??e.completionSource?.taskId??e.key}function GC({progress:e}){let t=WC(e),[n]=(0,N.useState)(()=>NC(t)),r=(0,N.useRef)(t),i=(0,N.useRef)(e.tone),[a,o]=(0,N.useState)(null);if((0,N.useEffect)(()=>{let n=r.current,a=i.current;if(r.current=t,i.current=e.tone,e.tone!==`running`||a===`pending`||n===t){o(null);return}o(t);let s=window.setTimeout(()=>{o(e=>e===t?null:e)},RC);return()=>{window.clearTimeout(s)}},[e.tone,t]),e.tone===`running`||e.tone===`pending`||e.tone===`complete`){let r=e.tone===`running`&&a===t,i=e.steps.find(e=>e.status===`running`||e.status===`pending`)??e.steps.at(-1),o=e.completionTarget?.kind===`task`?`Task completed`:`Procedure completed`,s=e.tone===`complete`?void 0:i?.detail??(e.tone===`pending`?e.summary:void 0),c=e.tone===`complete`?void 0:i?.elapsedLabel,l=e.tone===`complete`?void 0:i?.metrics;return(0,P.jsx)(Co,{stageLabel:r?`Loading the next movement…`:e.tone===`complete`?o:i?.label??e.summary,...r||s===void 0?{}:{stageDetail:s},...r||c===void 0?{}:{elapsedLabel:c},...r||l===void 0?{}:{metrics:l},scoreLabel:r?`Loading the next movement score`:e.tone===`complete`?`${o} score cadence`:e.tone===`pending`?`Execution score paused while waiting for input`:`${i?.label??`Execution`} running score using ${n.shortName}`,state:r?`handoff`:e.tone===`complete`?`complete`:e.tone===`pending`?`paused`:`running`,units:n.units,playbackBpm:n.tempo,openingClef:n.clef,keySignatureFifths:n.keySignatureFifths,timeSignature:n.meter})}return(0,P.jsx)(Pb,{title:e.title,summary:e.summary,tone:e.tone,steps:e.steps,...e.metaLabel===void 0?{}:{metaLabel:e.metaLabel}})}function KC(e){if(e===void 0)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function qC(e,t){if(e===null)return null;let n=KC(e.requestedAt);if(n===null)return t.length;let r=t.findIndex(e=>{let t=KC(e.createdAt);return t!==null&&t>n});return r===-1?t.length:r}function JC(e,{focusSelector:t}={}){let n=typeof document>`u`?null:document.getElementById(e);n!==null&&(n.scrollIntoView({block:`center`}),t!==void 0&&n.querySelector(t)?.focus({preventScroll:!0}))}function YC(e){return e.messageKind===`system_notice`&&e.workflowRef!==void 0&&(e.body.startsWith(`Worklist updated with `)||e.body===`Worklist is already covered by existing tasks.`)}function XC(e,t){if(t===void 0)return;let n=t.label.trim(),r=t.handle?.trim()??n;if(n===``||r===``)return;let i=r.toLocaleLowerCase();e.has(i)||e.set(i,{id:t.id,label:n,handle:r})}function ZC({members:e,messages:t,clarificationMessagesByRoundId:n}){let r=new Map;XC(r,{id:`tutti`,label:`Tutti`,handle:`tutti`});for(let t of e)XC(r,{id:t.key,label:t.displayName});for(let e of t)XC(r,{id:`message:${e.author}`,label:e.author,...e.avatarKind===`tutti`?{handle:`tutti`}:{}});for(let e of Object.values(n))for(let t of e)XC(r,{id:`round-message:${t.author}`,label:t.author,...t.avatarKind===`tutti`?{handle:`tutti`}:{}});return[...r.values()]}function QC({message:e}){return e.avatarKind===`tutti`?(0,P.jsx)(vC,{label:e.author}):(0,P.jsx)(_C,{avatar:e.avatar??{kind:`initials`,initials:dr(e.author),color:`blue`},label:e.author,online:e.online})}function $C({projectName:e,projectDescription:t=``,members:n,messages:r,scratchpad:i,executionProgress:a=null,activeApproval:o=null,activeClarification:s,clarificationMessagesByRoundId:c,statusShortcuts:l,unread:u,artifactSignal:d,draft:f,roundDraft:p,sendPending:m,scratchpadSyncPending:h=!1,scratchpadActionsDisabled:g=!1,scratchpadSubmitPending:_=!1,referenceUploadPending:v=!1,focusMessageId:y=null,messageHistoryIdentity:b=`latest`,initialMessagePosition:x=y===null?`latest`:`focus`,hasOlderMessages:S=!1,hasNewerMessages:C=!1,loadingOlderMessages:w=!1,loadingNewerMessages:T=!1,historyConnectedToLatest:E=!0,roundSendPending:ee=!1,roundSubmitPending:D=!1,submittedRoundId:O=null,approvalDecisionPending:k=!1,projectNameSaving:te=!1,projectDescriptionSaving:ne=!1,loading:A=!1,unavailable:re=!1,onDraftChange:ie,onMessageFocused:j,onInitialMessagePositioned:M,onLoadOlderMessages:ae,onLoadNewerMessages:oe,onJumpToLatest:se,onUploadReferenceFile:ce,onOpenReferenceFile:le,onRoundDraftChange:ue,onSendMessage:de,onSendRoundMessage:fe,onSubmitRound:pe,onDecideApproval:me,onSubmitScratchpad:he,onUpdateProjectDisplayName:ge,onUpdateProjectDescription:_e,onOpenProjectCenter:ve,onOpenWorklist:ye,onOpenWorklistTask:be,onOpenReferences:xe,onOpenArtifacts:Se,onOpenSkills:Ce,onOpenTimeline:we,onOpenSettings:Te,onActivateStatusShortcut:Ee}){let[De,Oe]=(0,N.useState)(!1),ke=(0,N.useRef)(null),Ae=(0,N.useRef)(!1),je=(0,N.useRef)(null),Me=(0,N.useRef)(null),Ne=(0,N.useRef)(!0),Pe=(0,N.useRef)(void 0),Fe=(0,N.useRef)(b),Ie=(0,N.useRef)(null),Le=(0,P.jsx)(qy,{className:`chat-project-title-edit`,value:e,placeholder:`Untitled project`,ariaLabel:`Edit project name`,maxLength:zC,saving:te,disabled:A,...ge===void 0?{}:{onUpdate:ge}}),Re=(0,P.jsx)(qy,{className:`chat-project-description-edit`,value:t,placeholder:`Add a project description`,ariaLabel:`Edit project description`,maxLength:BC,allowEmpty:!0,saving:ne,disabled:A,..._e===void 0?{}:{onUpdate:_e}}),ze=s!==null&&r.some(e=>e.id===s.cardMessageId),Be=new Map;for(let e of r)e.clarificationCard!==void 0&&e.workflowRef!==void 0&&Be.set(e.workflowRef,e.clarificationCard.roundId);let Ve=new Map;for(let e of r){if(!YC(e)||e.workflowRef===void 0)continue;let t=Be.get(e.workflowRef);t!==void 0&&Ve.set(t,{...e,id:`round-result:${e.id}`,messageKind:`agent_text`,author:`Tutti`,avatarKind:`tutti`,online:!1})}let He=e=>{let t=c[e]??[],n=Ve.get(e);return n===void 0||t.some(e=>e.body===n.body)?t:[...t,n]},Ue=ZC({members:n,messages:r,clarificationMessagesByRoundId:c}),We=ce===void 0?void 0:e=>{for(let t of e)ce(t)};(0,N.useLayoutEffect)(()=>{Fe.current!==b&&(Fe.current=b,Ae.current=!1,je.current=null,Pe.current=void 0)},[b]),(0,N.useLayoutEffect)(()=>{let e=je.current;if(e!==null){if(r[0]?.id!==e.firstMessageId){let t=ke.current;t!==null&&(t.scrollTop=e.scrollTop+Math.max(0,t.scrollHeight-e.scrollHeight),Ne.current=t.scrollHeight-t.clientHeight-t.scrollTop<=UC),je.current=null;return}w||(je.current=null)}},[w,r]),(0,N.useEffect)(()=>{if(y===null||!r.some(e=>e.id===y))return;Ae.current=!0,JC(IC(y));let e=ke.current;e!==null&&(Ne.current=e.scrollHeight-e.clientHeight-e.scrollTop<=UC),j?.()},[y,r,j]),(0,N.useEffect)(()=>{if(Ae.current||A||re||x!==`latest`||y!==null||r.length===0&&s===null&&o===null)return;let e=ke.current;if(e===null)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight,Ne.current=!0,Ae.current=!0});return()=>window.cancelAnimationFrame(t)},[o,s,y,A,r,re]),(0,N.useEffect)(()=>{if(Ae.current||A||re||x!==`start`||y!==null)return;let e=ke.current;if(e===null)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=0,Ne.current=e.scrollHeight<=e.clientHeight+UC,Ae.current=!0,M?.()});return()=>window.cancelAnimationFrame(t)},[y,x,A,r,M,re]);let Ge=()=>{if(!S||w||je.current!==null||ae===void 0)return;let e=ke.current;e!==null&&(je.current={firstMessageId:r[0]?.id,scrollHeight:e.scrollHeight,scrollTop:e.scrollTop},ae())},Ke=()=>{!C||T||oe===void 0||oe()},qe=e=>{let t=e.currentTarget;Ne.current=t.scrollHeight-t.clientHeight-t.scrollTop<=UC,Me.current!==null&&window.cancelAnimationFrame(Me.current),Me.current=window.requestAnimationFrame(()=>{if(Me.current=null,t.scrollTop<=VC){Ge();return}t.scrollHeight-t.clientHeight-t.scrollTop<=HC&&Ke()})};(0,N.useEffect)(()=>()=>{Me.current!==null&&window.cancelAnimationFrame(Me.current)},[]),(0,N.useEffect)(()=>{if(A||re||w||T||!Ae.current)return;let e=ke.current;if(e===null||e.scrollHeight>e.clientHeight+UC)return;let t=window.requestAnimationFrame(()=>{S?Ge():C&&Ke()});return()=>window.cancelAnimationFrame(t)},[C,S,A,T,w,r,re]);let Je=r.at(-1)?.id;(0,N.useEffect)(()=>{let e=Pe.current;if(Pe.current=Je,e===void 0||e===Je||!E||!Ne.current||!Ae.current||je.current!==null)return;let t=ke.current;if(t===null)return;let n=window.requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight,Ne.current=!0});return()=>window.cancelAnimationFrame(n)},[E,Je]);let Ye=({key:e,roundId:t,title:n,summary:r,request:i,contextLabel:a,writable:o})=>{let s=He(t),c=s.filter(e=>e.messageKind===`user_text`).length;return(0,P.jsx)(Hb,{id:PC(t),tabIndex:-1,title:n,summary:r,request:i,...a===void 0?{}:{contextLabel:a},messages:s.map(e=>({id:e.id,author:e.author,body:e.body,time:e.time,avatar:(0,P.jsx)(QC,{message:e})})),replyCount:c,draft:o?p:``,defaultOpen:!0,readOnly:!o,status:o?`pending`:`done`,statusLabel:o?`needs input`:`submitted`,mentionOptions:Ue,sendPending:o&&ee,submitPending:o&&D,onDraftChange:ue,onSendMessage:fe,onSubmitRound:pe},`${e}:${o?`writable`:`sealed`}`)},Xe=e=>{if(e.target.kind===`approval`&&o!==null){if(!E){Ie.current=e,se?.();return}JC(FC(o.approvalId),{focusSelector:`.chat-event-card-header`});return}if(e.target.kind===`clarification`&&s!==null){if(!E&&!ze){Ie.current=e,se?.();return}JC(PC(s.roundId),{focusSelector:`.chat-event-card-header`});return}if(e.target.kind===`scratchpad`){JC(LC);return}Ee?.(e)};(0,N.useEffect)(()=>{let e=Ie.current;if(!E||A||e===null)return;Ie.current=null;let t=window.requestAnimationFrame(()=>{e.target.kind===`approval`&&o!==null?JC(FC(o.approvalId),{focusSelector:`.chat-event-card-header`}):e.target.kind===`clarification`&&s!==null&&JC(PC(s.roundId),{focusSelector:`.chat-event-card-header`})});return()=>window.cancelAnimationFrame(t)},[o,s,E,A,r]);let Ze=e=>s===null?null:Ye({key:e,roundId:s.roundId,title:s.title,summary:s.summary,request:s.request,contextLabel:s.ownerLabel,writable:s.status===`writable`&&s.roundId!==O}),Qe=()=>o===null?null:(0,P.jsx)(Kb,{id:FC(o.approvalId),tabIndex:-1,title:o.title,summary:o.summary,...o.reason===void 0?{}:{reason:o.reason},...o.detail===void 0?{}:{detail:o.detail,...o.detailLabel===void 0?{}:{detailLabel:o.detailLabel},...o.detailCode===void 0?{}:{detailCode:o.detailCode}},status:o.status,statusLabel:o.statusLabel,decisions:o.decisions,decisionPending:k,...o.resolutionLabel===void 0?{}:{resolutionLabel:o.resolutionLabel},onDecide:e=>me?.(o.approvalId,e)},`approval:${o.approvalId}:${o.status}`),$e=e=>{let t=e.clarificationCard;if(t===void 0)return null;let n=s!==null&&s.roundId===t.roundId;return Ye({key:e.id,roundId:t.roundId,title:n&&s!==null?s.title:t.title??`Clarification round ${t.roundId.slice(-4)}`,summary:n&&s!==null?s.summary:t.summary,request:n&&s!==null?s.request:t.summary,...n&&s!==null?{contextLabel:s.ownerLabel}:{},writable:n&&t.status===`writable`&&t.roundId!==O})},et=e=>{if(YC(e)&&Be.has(e.workflowRef??``))return null;if(e.messageKind===`clarification_card`)return $e(e);if(s!==null&&e.id===s.cardMessageId)return Ze(e.id);if(e.taskResult!==void 0)return(0,P.jsx)(qb,{id:IC(e.id),tabIndex:-1,className:e.id===y?`is-focused`:void 0,title:e.taskResult.title,status:e.taskResult.status,taskId:e.taskResult.taskId,taskTitle:e.taskResult.taskTitle,summary:e.taskResult.summary,...e.taskResult.moduleName===void 0?{}:{moduleName:e.taskResult.moduleName},...e.taskResult.finalNote===void 0?{}:{finalNote:e.taskResult.finalNote},...e.taskResult.generatedFiles===void 0?{}:{generatedFiles:e.taskResult.generatedFiles},...e.taskResult.errorCode===void 0?{}:{errorCode:e.taskResult.errorCode},...be===void 0?{}:{onOpenTask:be}},e.id);let t=e.referenceFile;return(0,P.jsx)(My,{id:IC(e.id),tabIndex:-1,author:e.author,time:e.time,avatar:(0,P.jsx)(QC,{message:e}),className:e.id===y?`is-focused`:void 0,children:t===void 0?e.messageKind===`agent_text`?(0,P.jsx)(Ny,{children:e.body}):(0,P.jsx)(`p`,{children:(0,P.jsx)(ky,{children:e.body})}):(0,P.jsx)(Gy,{name:t.name,category:t.category,...t.imageUrl===void 0?{}:{imageUrl:t.imageUrl},onClick:()=>le?.(t.path)})},e.id)},tt=E?qC(o,r):null,nt=()=>{let e=s!==null&&(ze||E)||o!==null&&E;return r.length===0&&!e&&!w&&!T?(0,P.jsx)(CC,{children:`No messages yet`}):(0,P.jsxs)(P.Fragment,{children:[w?(0,P.jsx)(`div`,{className:`chat-history-status`,role:`status`,children:`Loading earlier messages…`}):null,!E||ze?null:Ze(`active-round`),r.map((e,t)=>(0,P.jsxs)(N.Fragment,{children:[tt===t?Qe():null,et(e)]},`timeline:${e.id}`)),tt===r.length?Qe():null,T?(0,P.jsx)(`div`,{className:`chat-history-status`,role:`status`,children:`Loading newer messages…`}):null]})},rt=(e,t=!1)=>(0,P.jsx)(Ab,{id:e,tabIndex:-1,compact:t,title:i.title,summary:i.summary,sections:i.sections,submitAvailable:i.submitAvailable,...i.pages===void 0?{}:{pages:i.pages},...i.footerNote===void 0?{}:{footerNote:i.footerNote},...i.updatedLabelPrefix===void 0?{}:{updatedLabelPrefix:i.updatedLabelPrefix},syncPending:h,actionsDisabled:g,submitPending:_,onSubmitScratchpad:he,...be===void 0?{}:{onOpenCompiledTask:be},empty:(0,P.jsx)(CC,{children:`Scratchpad empty. Discuss more, tutti together!`}),...i.updatedLabel===void 0?{}:{updatedLabel:i.updatedLabel}}),it=(0,P.jsx)(`div`,{className:`chat-panel-actions`,children:(0,P.jsx)(bC,{members:n})});return(0,P.jsxs)(xC,{activePage:`chat`,statusShortcuts:l,mobileContext:{title:e,action:(0,P.jsx)(Rs,{className:h?`mobile-scratchpad-trigger is-syncing`:`mobile-scratchpad-trigger`,type:`button`,label:De?`Close Scratchpad`:`Open Scratchpad`,active:De,"aria-expanded":De,"aria-controls":`${LC}-mobile-sheet`,icon:(0,P.jsx)(Zy,{"aria-hidden":`true`}),onClick:()=>Oe(e=>!e)})},...u===void 0?{}:{unread:u},...d===void 0?{}:{artifactSignal:d},onOpenProjectCenter:ve,onOpenWorklist:ye,onOpenReferences:xe,onOpenArtifacts:Se,onOpenSkills:Ce,onOpenTimeline:we,onOpenSettings:Te,onActivateStatusShortcut:Xe,getStatusShortcutAriaControls:e=>e.target.kind===`approval`&&o!==null&&E?FC(o.approvalId):e.target.kind===`clarification`&&s!==null&&(E||ze)?PC(s.roundId):e.target.kind===`scratchpad`?LC:void 0,children:[(0,P.jsxs)(`section`,{className:`workspace-grid is-tutti chat-workspace-grid`,"aria-label":`Chat workspace`,children:[A?(0,P.jsx)(Ky,{title:Le,subtitle:Re,actions:it,children:(0,P.jsx)(oa,{})}):re?(0,P.jsx)(Ky,{title:Le,subtitle:Re,actions:it,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):(0,P.jsx)(Ky,{title:Le,subtitle:Re,actions:it,streamRef:ke,onStreamScroll:qe,streamOverlay:C&&se!==void 0?(0,P.jsx)(Ss,{className:`chat-jump-latest`,type:`button`,onClick:se,children:`Jump to latest`}):void 0,dropUploadPending:v,...We===void 0?{}:{onDropFiles:We},composer:(0,P.jsx)(Xy,{value:f,pending:m,uploadPending:v,mentionOptions:Ue,onValueChange:ie,onComposerSubmit:de,...ce===void 0?{}:{onFileUpload:ce}}),empty:(0,P.jsx)(CC,{children:`No messages yet`}),children:nt()}),(0,P.jsxs)(`div`,{className:a===null?`chat-side-column`:`chat-side-column has-progress`,children:[rt(LC),a===null?null:(0,P.jsx)(GC,{progress:a})]})]}),De?(0,P.jsxs)(`div`,{className:`mobile-scratchpad-layer is-open`,id:`${LC}-mobile-sheet`,children:[(0,P.jsx)(`button`,{className:`mobile-scratchpad-backdrop`,type:`button`,"aria-label":`Close Scratchpad`,onClick:()=>Oe(!1)}),(0,P.jsxs)(`section`,{className:`mobile-scratchpad-card`,role:`dialog`,"aria-modal":`true`,"aria-label":`Scratchpad`,children:[(0,P.jsxs)(`div`,{className:`mobile-scratchpad-card-head`,children:[(0,P.jsx)(`h2`,{children:`Scratchpad`}),(0,P.jsx)(bs,{className:`mobile-scratchpad-close`,type:`button`,label:`Close Scratchpad`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`}),onClick:()=>Oe(!1)})]}),(0,P.jsx)(`div`,{className:`mobile-scratchpad-card-body`,children:rt(`${LC}-mobile`,!0)})]})]}):null]})}function ew({statusShortcuts:e,unread:t,artifactSignal:n,state:r,loading:i=!1,unavailable:a=!1,onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenSkills:u,onOpenTimeline:d,onOpenSettings:f,onActivateStatusShortcut:p}){let m=i?{status:`loading`}:a?{status:`not_declared`}:r;return(0,P.jsx)(xC,{activePage:`artifacts`,statusShortcuts:e,mobileContext:{title:m.status===`declared`?m.title:`Artifacts`},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenSkills:u,onOpenTimeline:d,onOpenSettings:f,onActivateStatusShortcut:p,children:(0,P.jsx)(`section`,{className:`workspace-grid artifacts-workspace-grid`,"aria-label":`Artifacts`,children:(0,P.jsx)(lx,{state:m,...a?{empty:(0,P.jsx)(CC,{children:`Workspace unavailable`})}:{},emptyWatermark:(0,P.jsx)(SC,{})})})})}function tw({statusShortcuts:e,unread:t,artifactSignal:n,files:r,detail:i,uploadPending:a=!1,fileSortMode:o=`time`,loading:s=!1,unavailable:c=!1,onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,onSelectFile:_,onUploadFile:v,onFileSortModeChange:y}){let b=s||c;return(0,P.jsx)(xC,{activePage:`references`,statusShortcuts:e,mobileContext:{title:`References`,action:(0,P.jsx)(Yy,{variant:`bare`,className:`sidebar-button reference-upload-button`,label:`Upload reference`,pendingLabel:`Uploading reference`,pending:a,iconOnly:!0,onFileUpload:v})},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,children:(0,P.jsx)(`section`,{className:`workspace-grid references-workspace-grid`,"aria-label":`Reference files`,children:(0,P.jsx)(ox,{files:b?[]:r,...s?{detail:{title:`Loading`,unavailableReason:`Loading`}}:c?{detail:{title:`References unavailable`,unavailableReason:`Workspace unavailable`}}:i===void 0?{}:{detail:i},uploadPending:a,fileSortMode:o,empty:s?(0,P.jsx)(CC,{children:`Loading reference files`}):c?(0,P.jsx)(CC,{children:`Workspace unavailable`}):(0,P.jsx)(CC,{children:`No reference files`}),onSelectFile:_,onUploadFile:v,...y===void 0?{}:{onFileSortModeChange:y}})})})}var nw=6,rw=`......`,iw=80,aw=160;function ow(e){let t=document.createElement(`canvas`).getContext(`2d`);if(t===null)return null;let n=window.getComputedStyle(e);return t.font=[n.fontStyle,n.fontVariant,n.fontWeight,n.fontSize,n.fontFamily].join(` `),e=>t.measureText(e).width}function sw(e,t,n){if(n(e)<=t)return e;let r=e.slice(-nw),i=Math.max(0,e.length-r.length),a=0,o=i;for(;a<o;){let i=Math.ceil((a+o)/2);n(`${e.slice(0,i)}${rw}${r}`)<=t?a=i:o=i-1}return`${e.slice(0,a)}${rw}${r}`}function cw({value:e}){let t=(0,N.useRef)(null),[n,r]=(0,N.useState)(e);return(0,N.useEffect)(()=>{let n=t.current;if(n===null)return;let i=()=>{let t=ow(n),i=n.getBoundingClientRect().width;if(t===null||i<=0){r(e);return}let a=sw(e,i,t);r(e=>e===a?e:a)};i();let a=typeof ResizeObserver>`u`?null:new ResizeObserver(i);return a?.observe(n),window.addEventListener(`resize`,i),()=>{a?.disconnect(),window.removeEventListener(`resize`,i)}},[e]),(0,P.jsx)(`code`,{ref:t,className:`settings-masked-link`,title:e,"aria-label":e,children:n})}function lw({value:e,onCopy:t}){return t===void 0?(0,P.jsx)(cw,{value:e}):(0,P.jsx)(`button`,{className:`settings-value-button settings-link-copy-button`,type:`button`,"aria-label":`Copy invite link`,onClick:t,children:(0,P.jsx)(cw,{value:e})})}function uw(e,t){return e.map(e=>({id:e.id,title:e.title,rows:e.rows.map(e=>({label:e.label,value:e.identity===!0?(0,P.jsxs)(`div`,{className:`settings-identity`,children:[(0,P.jsx)(_C,{avatar:t.currentMember.avatar,label:t.currentMember.displayName}),(0,P.jsx)(`strong`,{children:t.currentMember.displayName})]}):e.value,...e.identity===!0?{plain:!0}:{},...e.code===void 0?{}:{code:e.code}}))}))}function dw({settings:e,onCopyJoinUrl:t}){let n=e.invite;return n===void 0?null:{label:`invite link`,value:n.joinUrl===void 0?`not recoverable`:(0,P.jsx)(lw,{value:n.joinUrl,onCopy:t}),...n.joinUrl===void 0?{}:{plain:!0}}}function fw({settings:e,statusShortcuts:t,unread:n,artifactSignal:r,loading:i=!1,unavailable:a=!1,projectNameSaving:o=!1,projectDescriptionSaving:s=!1,onOpenProjectCenter:c,onOpenChat:l,onOpenWorklist:u,onOpenReferences:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onActivateStatusShortcut:h,onCopyJoinUrl:g,onUpdateProjectDisplayName:_,onUpdateProjectDescription:v}){let y=e?.statuses??[],b=e===void 0?null:dw({settings:e,onCopyJoinUrl:g});return(0,P.jsx)(xC,{activePage:`settings`,statusShortcuts:t,mobileContext:{title:`Settings`},...n===void 0?{}:{unread:n},...r===void 0?{}:{artifactSignal:r},onOpenProjectCenter:c,onOpenChat:l,onOpenWorklist:u,onOpenReferences:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onActivateStatusShortcut:h,children:(0,P.jsx)(`section`,{className:`workspace-grid settings-workspace-grid`,"aria-label":`Project settings`,children:(0,P.jsx)(`div`,{className:`settings-page-grid`,children:i?(0,P.jsx)(`section`,{className:`settings-sheet`,"aria-label":`Loading settings`,children:(0,P.jsx)(CC,{children:`Loading settings`})}):a?(0,P.jsx)(`section`,{className:`settings-sheet`,"aria-label":`Settings unavailable`,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):e===void 0?(0,P.jsx)(`section`,{className:`settings-sheet`,"aria-label":`Settings unavailable`,children:(0,P.jsx)(CC,{children:`Settings unavailable`})}):(0,P.jsx)(tx,{statuses:y,sections:[{id:`settings-project`,title:`Project`,rows:[{label:`display_name`,plain:!0,value:(0,P.jsx)(qy,{value:e.project.displayName,placeholder:`Untitled project`,ariaLabel:`Project display name`,maxLength:iw,saving:o,..._===void 0?{}:{onUpdate:_}})},{label:`description`,plain:!0,value:(0,P.jsx)(qy,{value:e.project.description,placeholder:`Add a project description`,ariaLabel:`Project description`,maxLength:aw,allowEmpty:!0,saving:s,...v===void 0?{}:{onUpdate:v}})},...b===null?[]:[b]]},...uw(e.sections,e)]})})})})}var pw=[{title:`Awesome GitHub Copilot Skills`,href:`https://awesome-copilot.github.com/skills/`},{title:`Anthropic official skills`,href:`https://github.com/anthropics/skills`},{title:`Claude Skills Marketplace`,href:`https://claudeskills.info/skills/`}];function mw({statusShortcuts:e,unread:t,artifactSignal:n,skills:r,detail:i,uploadPending:a=!1,deletePending:o=!1,loading:s=!1,unavailable:c=!1,onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenReferences:f,onOpenArtifacts:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,onSelectSkill:_,onUploadSkill:v,onDeleteSkill:y}){let b=s||c;return(0,P.jsx)(xC,{activePage:`skills`,statusShortcuts:e,mobileContext:{title:`Skills`,action:(0,P.jsx)(Yy,{variant:`bare`,className:`sidebar-button reference-upload-button`,label:`Upload skill`,pendingLabel:`Uploading skill`,pending:a,accept:`.zip,application/zip,application/x-zip-compressed`,iconOnly:!0,onFileUpload:v})},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenReferences:f,onOpenArtifacts:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,children:(0,P.jsx)(`section`,{className:`workspace-grid references-workspace-grid`,"aria-label":`Skills`,children:(0,P.jsx)(dx,{skills:b?[]:r,communityLinks:b?[]:pw,...s?{detail:{title:`Loading`,unavailableReason:`Loading`}}:c?{detail:{title:`Skills unavailable`,unavailableReason:`Workspace unavailable`}}:i===void 0?{}:{detail:i},uploadPending:a,deletePending:o,empty:s?(0,P.jsx)(CC,{children:`Loading skills`}):c?(0,P.jsx)(CC,{children:`Workspace unavailable`}):(0,P.jsx)(CC,{children:`No skills`}),onSelectSkill:_,onUploadSkill:v,onDeleteSkill:y})})})}function hw({timeline:e,statusShortcuts:t,unread:n,artifactSignal:r,loading:i=!1,unavailable:a=!1,onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenArtifacts:u,onOpenSkills:d,onOpenSettings:f,onActivateStatusShortcut:p}){return(0,P.jsx)(xC,{activePage:`timeline`,statusShortcuts:t,mobileContext:{title:`Timeline`},...n===void 0?{}:{unread:n},...r===void 0?{}:{artifactSignal:r},onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenArtifacts:u,onOpenSkills:d,onOpenSettings:f,onActivateStatusShortcut:p,children:(0,P.jsx)(`section`,{className:`workspace-grid timeline-workspace-grid`,"aria-label":`Timeline workspace`,children:i?(0,P.jsx)(`section`,{className:`panel timeline-panel`,"aria-label":`Loading timeline`,children:(0,P.jsx)(CC,{children:`Loading timeline`})}):a?(0,P.jsx)(`section`,{className:`panel timeline-panel`,"aria-label":`Timeline unavailable`,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):e===void 0?(0,P.jsx)(`section`,{className:`panel timeline-panel`,"aria-label":`Timeline unavailable`,children:(0,P.jsx)(CC,{children:`Timeline unavailable`})}):(0,P.jsx)(Ex,{tokenOverview:e.tokenOverview,items:e.items,scoreUnits:e.scoreUnits,empty:(0,P.jsx)(CC,{children:`No timeline events yet`})})})})}function gw({statusShortcuts:e,unread:t,artifactSignal:n,modules:r,taskCount:i,detail:a,missingTaskId:o,runNote:s,loading:c=!1,unavailable:l=!1,onOpenProjectCenter:u,onOpenChat:d,onOpenReferences:f,onOpenArtifacts:p,onOpenSkills:m,onOpenTimeline:h,onOpenSettings:g,onActivateStatusShortcut:_,onSelectTask:v}){return(0,P.jsx)(xC,{activePage:`worklist`,statusShortcuts:e,mobileContext:{title:`Worklist`,meta:i===1?`1 task`:`${i} tasks`},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:u,onOpenChat:d,onOpenReferences:f,onOpenArtifacts:p,onOpenSkills:m,onOpenTimeline:h,onOpenSettings:g,onActivateStatusShortcut:_,children:(0,P.jsx)(`section`,{className:`workspace-grid worklist-workspace-grid`,"aria-label":`Worklist workspace`,children:c?(0,P.jsx)(`section`,{className:`panel tasks worklist-page-panel`,"aria-label":`Loading Worklist`,children:(0,P.jsx)(CC,{children:`Loading Worklist`})}):l?(0,P.jsx)(`section`,{className:`panel tasks worklist-page-panel`,"aria-label":`Worklist unavailable`,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):(0,P.jsx)(ex,{modules:r,taskCount:i,...a===void 0?{}:{detail:a},...o===void 0?{}:{missingTaskId:o},...s==null?{}:{runNote:s},onSelectTask:v,empty:(0,P.jsx)(CC,{children:`No compiled tasks`})})})})}function _w(e){return Ew(e)&&!vw(e)&&!Aw(e)&&Symbol.asyncIterator in e}function vw(e){return Array.isArray(e)}function yw(e){return typeof e==`bigint`}function bw(e){return typeof e==`boolean`}function xw(e){return e instanceof globalThis.Date}function Sw(e){return typeof e==`function`}function Cw(e){return Ew(e)&&!vw(e)&&!Aw(e)&&Symbol.iterator in e}function ww(e){return e===null}function Tw(e){return typeof e==`number`}function Ew(e){return typeof e==`object`&&!!e}function Dw(e){return e instanceof globalThis.RegExp}function Ow(e){return typeof e==`string`}function kw(e){return typeof e==`symbol`}function Aw(e){return e instanceof globalThis.Uint8Array}function jw(e){return e===void 0}function Mw(e){return e.map(e=>Lw(e))}function Nw(e){return new Date(e.getTime())}function Pw(e){return new Uint8Array(e)}function Fw(e){return new RegExp(e.source,e.flags)}function Iw(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Lw(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Lw(e[n]);return t}function Lw(e){return vw(e)?Mw(e):xw(e)?Nw(e):Aw(e)?Pw(e):Dw(e)?Fw(e):Ew(e)?Iw(e):e}function Rw(e){return Lw(e)}function zw(e,t){return Rw(t===void 0?e:{...t,...e})}function Bw(e){return typeof e==`object`&&!!e}function Vw(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function Hw(e){return e===void 0}function Uw(e){return typeof e==`number`}var Ww;(function(e){e.InstanceMode=`default`,e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(t,n){return e.ExactOptionalPropertyTypes?n in t:t[n]!==void 0}e.IsExactOptionalProperty=t;function n(t){let n=Bw(t);return e.AllowArrayObject?n:n&&!Vw(t)}e.IsObjectLike=n;function r(e){return n(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)}e.IsRecordLike=r;function i(t){return e.AllowNaN?Uw(t):Number.isFinite(t)}e.IsNumberLike=i;function a(t){let n=Hw(t);return e.AllowNullVoid?n||t===null:n}e.IsVoidLike=a})(Ww||={});function Gw(e){return globalThis.Object.freeze(e).map(e=>Xw(e))}function Kw(e){return e}function qw(e){return e}function Jw(e){return e}function Yw(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Xw(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Xw(e[n]);return globalThis.Object.freeze(t)}function Xw(e){return vw(e)?Gw(e):xw(e)?Kw(e):Aw(e)?qw(e):Dw(e)?Jw(e):Ew(e)?Yw(e):e}function K(e,t){let n=t===void 0?e:{...t,...e};switch(Ww.InstanceMode){case`freeze`:return Xw(n);case`clone`:return Rw(n);default:return n}}var Zw=class extends Error{constructor(e){super(e)}},Qw=Symbol.for(`TypeBox.Transform`),$w=Symbol.for(`TypeBox.Readonly`),eT=Symbol.for(`TypeBox.Optional`),tT=Symbol.for(`TypeBox.Hint`),q=Symbol.for(`TypeBox.Kind`);function nT(e){return Ew(e)&&e[$w]===`Readonly`}function rT(e){return Ew(e)&&e[eT]===`Optional`}function iT(e){return _T(e,`Any`)}function aT(e){return _T(e,`Argument`)}function oT(e){return _T(e,`Array`)}function sT(e){return _T(e,`AsyncIterator`)}function cT(e){return _T(e,`BigInt`)}function lT(e){return _T(e,`Boolean`)}function uT(e){return _T(e,`Computed`)}function dT(e){return _T(e,`Constructor`)}function fT(e){return _T(e,`Date`)}function pT(e){return _T(e,`Function`)}function mT(e){return _T(e,`Integer`)}function hT(e){return _T(e,`Intersect`)}function gT(e){return _T(e,`Iterator`)}function _T(e,t){return Ew(e)&&q in e&&e[q]===t}function vT(e){return bw(e)||Tw(e)||Ow(e)}function yT(e){return _T(e,`Literal`)}function bT(e){return _T(e,`MappedKey`)}function xT(e){return _T(e,`MappedResult`)}function ST(e){return _T(e,`Never`)}function CT(e){return _T(e,`Not`)}function wT(e){return _T(e,`Null`)}function TT(e){return _T(e,`Number`)}function ET(e){return _T(e,`Object`)}function DT(e){return _T(e,`Promise`)}function OT(e){return _T(e,`Record`)}function kT(e){return _T(e,`Ref`)}function AT(e){return _T(e,`RegExp`)}function jT(e){return _T(e,`String`)}function MT(e){return _T(e,`Symbol`)}function NT(e){return _T(e,`TemplateLiteral`)}function PT(e){return _T(e,`This`)}function FT(e){return Ew(e)&&Qw in e}function IT(e){return _T(e,`Tuple`)}function LT(e){return _T(e,`Undefined`)}function RT(e){return _T(e,`Union`)}function zT(e){return _T(e,`Uint8Array`)}function BT(e){return _T(e,`Unknown`)}function VT(e){return _T(e,`Unsafe`)}function HT(e){return _T(e,`Void`)}function UT(e){return Ew(e)&&q in e&&Ow(e[q])}function WT(e){return iT(e)||aT(e)||oT(e)||lT(e)||cT(e)||sT(e)||uT(e)||dT(e)||fT(e)||pT(e)||mT(e)||hT(e)||gT(e)||yT(e)||bT(e)||xT(e)||ST(e)||CT(e)||wT(e)||TT(e)||ET(e)||DT(e)||OT(e)||kT(e)||AT(e)||jT(e)||MT(e)||NT(e)||PT(e)||IT(e)||LT(e)||RT(e)||zT(e)||BT(e)||VT(e)||HT(e)||UT(e)}var GT=`Argument.Any.Array.AsyncIterator.BigInt.Boolean.Computed.Constructor.Date.Enum.Function.Integer.Intersect.Iterator.Literal.MappedKey.MappedResult.Not.Null.Number.Object.Promise.Record.Ref.RegExp.String.Symbol.TemplateLiteral.This.Tuple.Undefined.Union.Uint8Array.Unknown.Void`.split(`.`);function KT(e){try{return new RegExp(e),!0}catch{return!1}}function qT(e){if(!Ow(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function JT(e){return ZT(e)||qE(e)}function YT(e){return jw(e)||yw(e)}function XT(e){return jw(e)||Tw(e)}function ZT(e){return jw(e)||bw(e)}function QT(e){return jw(e)||Ow(e)}function $T(e){return jw(e)||Ow(e)&&qT(e)&&KT(e)}function eE(e){return jw(e)||Ow(e)&&qT(e)}function tE(e){return jw(e)||qE(e)}function nE(e){return Ew(e)&&e[eT]===`Optional`}function rE(e){return _E(e,`Any`)&&QT(e.$id)}function iE(e){return _E(e,`Argument`)&&Tw(e.index)}function aE(e){return _E(e,`Array`)&&e.type===`array`&&QT(e.$id)&&qE(e.items)&&XT(e.minItems)&&XT(e.maxItems)&&ZT(e.uniqueItems)&&tE(e.contains)&&XT(e.minContains)&&XT(e.maxContains)}function oE(e){return _E(e,`AsyncIterator`)&&e.type===`AsyncIterator`&&QT(e.$id)&&qE(e.items)}function sE(e){return _E(e,`BigInt`)&&e.type===`bigint`&&QT(e.$id)&&YT(e.exclusiveMaximum)&&YT(e.exclusiveMinimum)&&YT(e.maximum)&&YT(e.minimum)&&YT(e.multipleOf)}function cE(e){return _E(e,`Boolean`)&&e.type===`boolean`&&QT(e.$id)}function lE(e){return _E(e,`Computed`)&&Ow(e.target)&&vw(e.parameters)&&e.parameters.every(e=>qE(e))}function uE(e){return _E(e,`Constructor`)&&e.type===`Constructor`&&QT(e.$id)&&vw(e.parameters)&&e.parameters.every(e=>qE(e))&&qE(e.returns)}function dE(e){return _E(e,`Date`)&&e.type===`Date`&&QT(e.$id)&&XT(e.exclusiveMaximumTimestamp)&&XT(e.exclusiveMinimumTimestamp)&&XT(e.maximumTimestamp)&&XT(e.minimumTimestamp)&&XT(e.multipleOfTimestamp)}function fE(e){return _E(e,`Function`)&&e.type===`Function`&&QT(e.$id)&&vw(e.parameters)&&e.parameters.every(e=>qE(e))&&qE(e.returns)}function pE(e){return _E(e,`Integer`)&&e.type===`integer`&&QT(e.$id)&&XT(e.exclusiveMaximum)&&XT(e.exclusiveMinimum)&&XT(e.maximum)&&XT(e.minimum)&&XT(e.multipleOf)}function mE(e){return Ew(e)&&Object.entries(e).every(([e,t])=>qT(e)&&qE(t))}function hE(e){return _E(e,`Intersect`)&&!(Ow(e.type)&&e.type!==`object`)&&vw(e.allOf)&&e.allOf.every(e=>qE(e)&&!RE(e))&&QT(e.type)&&(ZT(e.unevaluatedProperties)||tE(e.unevaluatedProperties))&&QT(e.$id)}function gE(e){return _E(e,`Iterator`)&&e.type===`Iterator`&&QT(e.$id)&&qE(e.items)}function _E(e,t){return Ew(e)&&q in e&&e[q]===t}function vE(e){return xE(e)&&Ow(e.const)}function yE(e){return xE(e)&&Tw(e.const)}function bE(e){return xE(e)&&bw(e.const)}function xE(e){return _E(e,`Literal`)&&QT(e.$id)&&SE(e.const)}function SE(e){return bw(e)||Tw(e)||Ow(e)}function CE(e){return _E(e,`MappedKey`)&&vw(e.keys)&&e.keys.every(e=>Tw(e)||Ow(e))}function wE(e){return _E(e,`MappedResult`)&&mE(e.properties)}function TE(e){return _E(e,`Never`)&&Ew(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function EE(e){return _E(e,`Not`)&&qE(e.not)}function DE(e){return _E(e,`Null`)&&e.type===`null`&&QT(e.$id)}function OE(e){return _E(e,`Number`)&&e.type===`number`&&QT(e.$id)&&XT(e.exclusiveMaximum)&&XT(e.exclusiveMinimum)&&XT(e.maximum)&&XT(e.minimum)&&XT(e.multipleOf)}function kE(e){return _E(e,`Object`)&&e.type===`object`&&QT(e.$id)&&mE(e.properties)&&JT(e.additionalProperties)&&XT(e.minProperties)&&XT(e.maxProperties)}function AE(e){return _E(e,`Promise`)&&e.type===`Promise`&&QT(e.$id)&&qE(e.item)}function jE(e){return _E(e,`Record`)&&e.type===`object`&&QT(e.$id)&&JT(e.additionalProperties)&&Ew(e.patternProperties)&&(e=>{let t=Object.getOwnPropertyNames(e.patternProperties);return t.length===1&&KT(t[0])&&Ew(e.patternProperties)&&qE(e.patternProperties[t[0]])})(e)}function ME(e){return _E(e,`Ref`)&&QT(e.$id)&&Ow(e.$ref)}function NE(e){return _E(e,`RegExp`)&&QT(e.$id)&&Ow(e.source)&&Ow(e.flags)&&XT(e.maxLength)&&XT(e.minLength)}function PE(e){return _E(e,`String`)&&e.type===`string`&&QT(e.$id)&&XT(e.minLength)&&XT(e.maxLength)&&$T(e.pattern)&&eE(e.format)}function FE(e){return _E(e,`Symbol`)&&e.type===`symbol`&&QT(e.$id)}function IE(e){return _E(e,`TemplateLiteral`)&&e.type===`string`&&Ow(e.pattern)&&e.pattern[0]===`^`&&e.pattern[e.pattern.length-1]===`$`}function LE(e){return _E(e,`This`)&&QT(e.$id)&&Ow(e.$ref)}function RE(e){return Ew(e)&&Qw in e}function zE(e){return _E(e,`Tuple`)&&e.type===`array`&&QT(e.$id)&&Tw(e.minItems)&&Tw(e.maxItems)&&e.minItems===e.maxItems&&(jw(e.items)&&jw(e.additionalItems)&&e.minItems===0||vw(e.items)&&e.items.every(e=>qE(e)))}function BE(e){return _E(e,`Undefined`)&&e.type===`undefined`&&QT(e.$id)}function VE(e){return _E(e,`Union`)&&QT(e.$id)&&Ew(e)&&vw(e.anyOf)&&e.anyOf.every(e=>qE(e))}function HE(e){return _E(e,`Uint8Array`)&&e.type===`Uint8Array`&&QT(e.$id)&&XT(e.minByteLength)&&XT(e.maxByteLength)}function UE(e){return _E(e,`Unknown`)&&QT(e.$id)}function WE(e){return _E(e,`Unsafe`)}function GE(e){return _E(e,`Void`)&&e.type===`void`&&QT(e.$id)}function KE(e){return Ew(e)&&q in e&&Ow(e[q])&&!GT.includes(e[q])}function qE(e){return Ew(e)&&(rE(e)||iE(e)||aE(e)||cE(e)||sE(e)||oE(e)||lE(e)||uE(e)||dE(e)||fE(e)||pE(e)||hE(e)||gE(e)||xE(e)||CE(e)||wE(e)||TE(e)||EE(e)||DE(e)||OE(e)||kE(e)||AE(e)||jE(e)||ME(e)||NE(e)||PE(e)||FE(e)||IE(e)||LE(e)||zE(e)||BE(e)||VE(e)||HE(e)||UE(e)||WE(e)||GE(e)||KE(e))}var JE=`(true|false)`,YE=`(0|[1-9][0-9]*)`,XE=`(.*)`,ZE=`(?!.*)`;`${JE}`;var QE=`^${YE}$`,$E=`^${XE}$`,eD=`^${ZE}$`;function tD(e,t){return e.includes(t)}function nD(e){return[...new Set(e)]}function rD(e,t){return e.filter(e=>t.includes(e))}function iD(e,t){return e.reduce((e,t)=>rD(e,t),t)}function aD(e){return e.length===1?e[0]:e.length>1?iD(e.slice(1),e[0]):[]}function oD(e){let t=[];for(let n of e)t.push(...n);return t}function sD(e){return K({[q]:`Any`},e)}function cD(e,t){return K({[q]:`Array`,type:`array`,items:e},t)}function lD(e){return K({[q]:`Argument`,index:e})}function uD(e,t){return K({[q]:`AsyncIterator`,type:`AsyncIterator`,items:e},t)}function dD(e,t,n){return K({[q]:`Computed`,target:e,parameters:t},n)}function fD(e,t){let{[t]:n,...r}=e;return r}function pD(e,t){return t.reduce((e,t)=>fD(e,t),e)}function mD(e){return K({[q]:`Never`,not:{}},e)}function hD(e){return K({[q]:`MappedResult`,properties:e})}function gD(e,t,n){return K({[q]:`Constructor`,type:`Constructor`,parameters:e,returns:t},n)}function _D(e,t,n){return K({[q]:`Function`,type:`Function`,parameters:e,returns:t},n)}function vD(e,t){return K({[q]:`Union`,anyOf:e},t)}function yD(e){return e.some(e=>rT(e))}function bD(e){return e.map(e=>rT(e)?xD(e):e)}function xD(e){return pD(e,[eT])}function SD(e,t){return yD(e)?ck(vD(bD(e),t)):vD(bD(e),t)}function CD(e,t){return e.length===1?K(e[0],t):e.length===0?mD(t):SD(e,t)}function wD(e,t){return e.length===0?mD(t):e.length===1?K(e[0],t):vD(e,t)}var TD=class extends Zw{};function ED(e){return e.replace(/\\\$/g,`$`).replace(/\\\*/g,`*`).replace(/\\\^/g,`^`).replace(/\\\|/g,`|`).replace(/\\\(/g,`(`).replace(/\\\)/g,`)`)}function DD(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function OD(e,t){return DD(e,t,`(`)}function kD(e,t){return DD(e,t,`)`)}function AD(e,t){return DD(e,t,`|`)}function jD(e){if(!(OD(e,0)&&kD(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(OD(e,n)&&(t+=1),kD(e,n)&&--t,t===0&&n!==e.length-1)return!1;return!0}function MD(e){return e.slice(1,e.length-1)}function ND(e){let t=0;for(let n=0;n<e.length;n++)if(OD(e,n)&&(t+=1),kD(e,n)&&--t,AD(e,n)&&t===0)return!0;return!1}function PD(e){for(let t=0;t<e.length;t++)if(OD(e,t))return!0;return!1}function FD(e){let[t,n]=[0,0],r=[];for(let i=0;i<e.length;i++)if(OD(e,i)&&(t+=1),kD(e,i)&&--t,AD(e,i)&&t===0){let t=e.slice(n,i);t.length>0&&r.push(LD(t)),n=i+1}let i=e.slice(n);return i.length>0&&r.push(LD(i)),r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`or`,expr:r}}function ID(e){function t(e,t){if(!OD(e,t))throw new TD(`TemplateLiteralParser: Index must point to open parens`);let n=0;for(let r=t;r<e.length;r++)if(OD(e,r)&&(n+=1),kD(e,r)&&--n,n===0)return[t,r];throw new TD(`TemplateLiteralParser: Unclosed group parens in expression`)}function n(e,t){for(let n=t;n<e.length;n++)if(OD(e,n))return[t,n];return[t,e.length]}let r=[];for(let i=0;i<e.length;i++)if(OD(e,i)){let[n,a]=t(e,i),o=e.slice(n,a+1);r.push(LD(o)),i=a}else{let[t,a]=n(e,i),o=e.slice(t,a);o.length>0&&r.push(LD(o)),i=a-1}return r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`and`,expr:r}}function LD(e){return jD(e)?LD(MD(e)):ND(e)?FD(e):PD(e)?ID(e):{type:`const`,const:ED(e)}}function RD(e){return LD(e.slice(1,e.length-1))}var zD=class extends Zw{};function BD(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`0`&&e.expr[1].type===`const`&&e.expr[1].const===`[1-9][0-9]*`}function VD(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`true`&&e.expr[1].type===`const`&&e.expr[1].const===`false`}function HD(e){return e.type===`const`&&e.const===`.*`}function UD(e){return BD(e)||HD(e)?!1:VD(e)?!0:e.type===`and`||e.type===`or`?e.expr.every(e=>UD(e)):e.type===`const`?!0:(()=>{throw new zD(`Unknown expression type`)})()}function WD(e){return UD(RD(e.pattern))}var GD=class extends Zw{};function*KD(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of KD(e.slice(1)))yield`${t}${n}`}function*qD(e){return yield*KD(e.expr.map(e=>[...XD(e)]))}function*JD(e){for(let t of e.expr)yield*XD(t)}function*YD(e){return yield e.const}function*XD(e){return e.type===`and`?yield*qD(e):e.type===`or`?yield*JD(e):e.type===`const`?yield*YD(e):(()=>{throw new GD(`Unknown expression`)})()}function ZD(e){let t=RD(e.pattern);return UD(t)?[...XD(t)]:[]}function QD(e,t){return K({[q]:`Literal`,const:e,type:typeof e},t)}function $D(e){return K({[q]:`Boolean`,type:`boolean`},e)}function eO(e){return K({[q]:`BigInt`,type:`bigint`},e)}function tO(e){return K({[q]:`Number`,type:`number`},e)}function nO(e){return K({[q]:`String`,type:`string`},e)}function*rO(e){let t=e.trim().replace(/"|'/g,``);return t===`boolean`?yield $D():t===`number`?yield tO():t===`bigint`?yield eO():t===`string`?yield nO():yield(()=>{let e=t.split(`|`).map(e=>QD(e.trim()));return e.length===0?mD():e.length===1?e[0]:CD(e)})()}function*iO(e){if(e[1]!==`{`)return yield*[QD(`$`),...aO(e.slice(1))];for(let t=2;t<e.length;t++)if(e[t]===`}`){let n=rO(e.slice(2,t)),r=aO(e.slice(t+1));return yield*[...n,...r]}yield QD(e)}function*aO(e){for(let t=0;t<e.length;t++)if(e[t]===`$`)return yield*[QD(e.slice(0,t)),...iO(e.slice(t))];yield QD(e)}function oO(e){return[...aO(e)]}var sO=class extends Zw{};function cO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function lO(e,t){return NT(e)?e.pattern.slice(1,e.pattern.length-1):RT(e)?`(${e.anyOf.map(e=>lO(e,t)).join(`|`)})`:TT(e)||mT(e)||cT(e)?`${t}${YE}`:jT(e)?`${t}${XE}`:yT(e)?`${t}${cO(e.const.toString())}`:lT(e)?`${t}${JE}`:(()=>{throw new sO(`Unexpected Kind '${e[q]}'`)})()}function uO(e){return`^${e.map(e=>lO(e,``)).join(``)}\$`}function dO(e){return CD(ZD(e).map(e=>QD(e)))}function fO(e,t){let n=Ow(e)?uO(oO(e)):uO(e);return K({[q]:`TemplateLiteral`,type:`string`,pattern:n},t)}function pO(e){return ZD(e).map(e=>e.toString())}function mO(e){let t=[];for(let n of e)t.push(...gO(n));return t}function hO(e){return[e.toString()]}function gO(e){return[...new Set(NT(e)?pO(e):RT(e)?mO(e.anyOf):yT(e)?hO(e.const):TT(e)||mT(e)?[`[number]`]:[])]}function _O(e,t,n){let r={};for(let i of Object.getOwnPropertyNames(t))r[i]=jO(e,gO(t[i]),n);return r}function vO(e,t,n){return _O(e,t.properties,n)}function yO(e,t,n){return hD(vO(e,t,n))}function bO(e,t){return e.map(e=>OO(e,t))}function xO(e){return e.filter(e=>!ST(e))}function SO(e,t){return _k(xO(bO(e,t)))}function CO(e){return e.some(e=>ST(e))?[]:e}function wO(e,t){return CD(CO(bO(e,t)))}function TO(e,t){return t in e?e[t]:t===`[number]`?CD(e):mD()}function EO(e,t){return t===`[number]`?e:mD()}function DO(e,t){return t in e?e[t]:mD()}function OO(e,t){return hT(e)?SO(e.allOf,t):RT(e)?wO(e.anyOf,t):IT(e)?TO(e.items??[],t):oT(e)?EO(e.items,t):ET(e)?DO(e.properties,t):mD()}function kO(e,t){return t.map(t=>OO(e,t))}function AO(e,t){return CD(kO(e,t))}function jO(e,t,n){if(kT(e)||kT(t)){if(!WT(e)||!WT(t))throw new Zw(`Index types using Ref parameters require both Type and Key to be of TSchema`);return dD(`Index`,[e,t])}return xT(t)?yO(e,t,n):bT(t)?FO(e,t,n):K(WT(t)?AO(e,gO(t)):AO(e,t),n)}function MO(e,t,n){return{[t]:jO(e,[t],Rw(n))}}function NO(e,t,n){return t.reduce((t,r)=>({...t,...MO(e,r,n)}),{})}function PO(e,t,n){return NO(e,t.keys,n)}function FO(e,t,n){return hD(PO(e,t,n))}function IO(e,t){return K({[q]:`Iterator`,type:`Iterator`,items:e},t)}function LO(e){return globalThis.Object.keys(e).filter(t=>!rT(e[t]))}function RO(e,t){let n=LO(e);return K(n.length>0?{[q]:`Object`,type:`object`,required:n,properties:e}:{[q]:`Object`,type:`object`,properties:e},t)}var zO=RO;function BO(e,t){return K({[q]:`Promise`,type:`Promise`,item:e},t)}function VO(e){return K(pD(e,[$w]))}function HO(e){return K({...e,[$w]:`Readonly`})}function UO(e,t){return t===!1?VO(e):HO(e)}function WO(e,t){let n=t??!0;return xT(e)?qO(e,n):UO(e,n)}function GO(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=WO(e[r],t);return n}function KO(e,t){return GO(e.properties,t)}function qO(e,t){return hD(KO(e,t))}function JO(e,t){return K(e.length>0?{[q]:`Tuple`,type:`array`,items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[q]:`Tuple`,type:`array`,minItems:e.length,maxItems:e.length},t)}function YO(e,t){return e in t?nk(e,t[e]):hD(t)}function XO(e){return{[e]:QD(e)}}function ZO(e){let t={};for(let n of e)t[n]=QD(n);return t}function QO(e,t){return tD(t,e)?XO(e):ZO(t)}function $O(e,t){return YO(e,QO(e,t))}function ek(e,t){return t.map(t=>nk(e,t))}function tk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=nk(e,t[r]);return n}function nk(e,t){let n={...t};return rT(t)?ck(nk(e,pD(t,[eT]))):nT(t)?WO(nk(e,pD(t,[$w]))):xT(t)?YO(e,t.properties):bT(t)?$O(e,t.keys):dT(t)?gD(ek(e,t.parameters),nk(e,t.returns),n):pT(t)?_D(ek(e,t.parameters),nk(e,t.returns),n):sT(t)?uD(nk(e,t.items),n):gT(t)?IO(nk(e,t.items),n):hT(t)?vk(ek(e,t.allOf),n):RT(t)?wD(ek(e,t.anyOf),n):IT(t)?JO(ek(e,t.items??[]),n):ET(t)?zO(tk(e,t.properties),n):oT(t)?cD(nk(e,t.items),n):DT(t)?BO(nk(e,t.item),n):t}function rk(e,t){let n={};for(let r of e)n[r]=nk(r,t);return n}function ik(e,t,n){let r=WT(e)?gO(e):e;return zO(rk(r,t({[q]:`MappedKey`,keys:r})),n)}function ak(e){return K(pD(e,[eT]))}function ok(e){return K({...e,[eT]:`Optional`})}function sk(e,t){return t===!1?ak(e):ok(e)}function ck(e,t){let n=t??!0;return xT(e)?dk(e,n):sk(e,n)}function lk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=ck(e[r],t);return n}function uk(e,t){return lk(e.properties,t)}function dk(e,t){return hD(uk(e,t))}function fk(e,t={}){let n=e.every(e=>ET(e)),r=WT(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return K(t.unevaluatedProperties===!1||WT(t.unevaluatedProperties)||n?{...r,[q]:`Intersect`,type:`object`,allOf:e}:{...r,[q]:`Intersect`,allOf:e},t)}function pk(e){return e.every(e=>rT(e))}function mk(e){return pD(e,[eT])}function hk(e){return e.map(e=>rT(e)?mk(e):e)}function gk(e,t){return pk(e)?ck(fk(hk(e),t)):fk(hk(e),t)}function _k(e,t={}){if(e.length===1)return K(e[0],t);if(e.length===0)return mD(t);if(e.some(e=>FT(e)))throw Error(`Cannot intersect transform types`);return gk(e,t)}function vk(e,t){if(e.length===1)return K(e[0],t);if(e.length===0)return mD(t);if(e.some(e=>FT(e)))throw Error(`Cannot intersect transform types`);return fk(e,t)}function yk(...e){let[t,n]=typeof e[0]==`string`?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!=`string`)throw new Zw(`Ref: $ref must be a string`);return K({[q]:`Ref`,$ref:t},n)}function bk(e,t){return dD(`Awaited`,[dD(e,t)])}function xk(e){return dD(`Awaited`,[yk(e)])}function Sk(e){return vk(Tk(e))}function Ck(e){return wD(Tk(e))}function wk(e){return Ek(e)}function Tk(e){return e.map(e=>Ek(e))}function Ek(e,t){return K(uT(e)?bk(e.target,e.parameters):hT(e)?Sk(e.allOf):RT(e)?Ck(e.anyOf):DT(e)?wk(e.item):kT(e)?xk(e.$ref):e,t)}function Dk(e){let t=[];for(let n of e)t.push(Pk(n));return t}function Ok(e){return oD(Dk(e))}function kk(e){return aD(Dk(e))}function Ak(e){return e.map((e,t)=>t.toString())}function jk(e){return[`[number]`]}function Mk(e){return globalThis.Object.getOwnPropertyNames(e)}function Nk(e){return Fk?globalThis.Object.getOwnPropertyNames(e).map(e=>e[0]===`^`&&e[e.length-1]===`$`?e.slice(1,e.length-1):e):[]}function Pk(e){return hT(e)?Ok(e.allOf):RT(e)?kk(e.anyOf):IT(e)?Ak(e.items??[]):oT(e)?jk(e.items):ET(e)?Mk(e.properties):OT(e)?Nk(e.patternProperties):[]}var Fk=!1;function Ik(e,t){return dD(`KeyOf`,[dD(e,t)])}function Lk(e){return dD(`KeyOf`,[yk(e)])}function Rk(e,t){return K(CD(zk(Pk(e))),t)}function zk(e){return e.map(e=>e===`[number]`?tO():QD(e))}function Bk(e,t){return uT(e)?Ik(e.target,e.parameters):kT(e)?Lk(e.$ref):xT(e)?Uk(e,t):Rk(e,t)}function Vk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Bk(e[r],Rw(t));return n}function Hk(e,t){return Vk(e.properties,t)}function Uk(e,t){return hD(Hk(e,t))}function Wk(e){let t=[];for(let n of e)t.push(...Pk(n));return nD(t)}function Gk(e){return e.filter(e=>!ST(e))}function Kk(e,t){let n=[];for(let r of e)n.push(...kO(r,[t]));return Gk(n)}function qk(e,t){let n={};for(let r of t)n[r]=_k(Kk(e,r));return n}function Jk(e,t){return zO(qk(e,Wk(e)),t)}function Yk(e){return K({[q]:`Date`,type:`Date`},e)}function Xk(e){return K({[q]:`Null`,type:`null`},e)}function Zk(e){return K({[q]:`Symbol`,type:`symbol`},e)}function Qk(e){return K({[q]:`Undefined`,type:`undefined`},e)}function $k(e){return K({[q]:`Uint8Array`,type:`Uint8Array`},e)}function eA(e){return K({[q]:`Unknown`},e)}function tA(e){return e.map(e=>iA(e,!1))}function nA(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=WO(iA(e[n],!1));return t}function rA(e,t){return t===!0?e:WO(e)}function iA(e,t){return _w(e)||Cw(e)?rA(sD(),t):vw(e)?WO(JO(tA(e))):Aw(e)?$k():xw(e)?Yk():Ew(e)?rA(zO(nA(e)),t):Sw(e)?rA(_D([],eA()),t):jw(e)?Qk():ww(e)?Xk():kw(e)?Zk():yw(e)?eO():Tw(e)||bw(e)||Ow(e)?QD(e):zO({})}function aA(e,t){return K(iA(e,!0),t)}function oA(e,t){return dT(e)?JO(e.parameters,t):mD(t)}function sA(e,t){if(jw(e))throw Error(`Enum undefined or empty`);let n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return wD([...new Set(n)].map(e=>QD(e)),{...t,[tT]:`Enum`})}var cA=class extends Zw{},J;(function(e){e[e.Union=0]=`Union`,e[e.True=1]=`True`,e[e.False=2]=`False`})(J||={});function lA(e){return e===J.False?e:J.True}function uA(e){throw new cA(e)}function dA(e){return TE(e)||hE(e)||VE(e)||UE(e)||rE(e)}function fA(e,t){return TE(t)?AA(e,t):hE(t)?EA(e,t):VE(t)?pj(e,t):UE(t)?hj(e,t):rE(t)?pA(e,t):uA(`StructuralRight`)}function pA(e,t){return J.True}function mA(e,t){return hE(t)?EA(e,t):VE(t)&&t.anyOf.some(e=>rE(e)||UE(e))?J.True:VE(t)?J.Union:UE(t)||rE(t)?J.True:J.Union}function hA(e,t){return UE(e)?J.False:rE(e)?J.Union:TE(e)?J.True:J.False}function gA(e,t){return kE(t)&&qA(t)?J.True:dA(t)?fA(e,t):aE(t)?lA(yj(e.items,t.items)):J.False}function _A(e,t){return dA(t)?fA(e,t):oE(t)?lA(yj(e.items,t.items)):J.False}function vA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):sE(t)?J.True:J.False}function yA(e,t){return bE(e)||cE(e)?J.True:J.False}function bA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):cE(t)?J.True:J.False}function xA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):uE(t)?e.parameters.length>t.parameters.length?J.False:e.parameters.every((e,n)=>lA(yj(t.parameters[n],e))===J.True)?lA(yj(e.returns,t.returns)):J.False:J.False}function SA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):dE(t)?J.True:J.False}function CA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):fE(t)?e.parameters.length>t.parameters.length?J.False:e.parameters.every((e,n)=>lA(yj(t.parameters[n],e))===J.True)?lA(yj(e.returns,t.returns)):J.False:J.False}function wA(e,t){return xE(e)&&Tw(e.const)||OE(e)||pE(e)?J.True:J.False}function TA(e,t){return pE(t)||OE(t)?J.True:dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):J.False}function EA(e,t){return t.allOf.every(t=>yj(e,t)===J.True)?J.True:J.False}function DA(e,t){return e.allOf.some(e=>yj(e,t)===J.True)?J.True:J.False}function OA(e,t){return dA(t)?fA(e,t):gE(t)?lA(yj(e.items,t.items)):J.False}function kA(e,t){return xE(t)&&t.const===e.const?J.True:dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):PE(t)?ij(e,t):OE(t)?FA(e,t):pE(t)?wA(e,t):cE(t)?yA(e,t):J.False}function AA(e,t){return J.False}function jA(e,t){return J.True}function MA(e){let[t,n]=[e,0];for(;EE(t);)t=t.not,n+=1;return n%2==0?t:eA()}function NA(e,t){return EE(e)?yj(MA(e),t):EE(t)?yj(e,MA(t)):uA(`Invalid fallthrough for Not`)}function PA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):DE(t)?J.True:J.False}function FA(e,t){return yE(e)||OE(e)||pE(e)?J.True:J.False}function IA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):pE(t)||OE(t)?J.True:J.False}function LA(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function RA(e){return qA(e)}function zA(e){return LA(e,0)||LA(e,1)&&`description`in e.properties&&VE(e.properties.description)&&e.properties.description.anyOf.length===2&&(PE(e.properties.description.anyOf[0])&&BE(e.properties.description.anyOf[1])||PE(e.properties.description.anyOf[1])&&BE(e.properties.description.anyOf[0]))}function BA(e){return LA(e,0)}function VA(e){return LA(e,0)}function HA(e){return LA(e,0)}function UA(e){return LA(e,0)}function WA(e){return qA(e)}function GA(e){let t=tO();return LA(e,0)||LA(e,1)&&`length`in e.properties&&lA(yj(e.properties.length,t))===J.True}function KA(e){return LA(e,0)}function qA(e){let t=tO();return LA(e,0)||LA(e,1)&&`length`in e.properties&&lA(yj(e.properties.length,t))===J.True}function JA(e){let t=_D([sD()],sD());return LA(e,0)||LA(e,1)&&`then`in e.properties&&lA(yj(e.properties.then,t))===J.True}function YA(e,t){return yj(e,t)===J.False||nE(e)&&!nE(t)?J.False:J.True}function XA(e,t){return UE(e)?J.False:rE(e)?J.Union:TE(e)||vE(e)&&RA(t)||yE(e)&&BA(t)||bE(e)&&VA(t)||FE(e)&&zA(t)||sE(e)&&HA(t)||PE(e)&&RA(t)||FE(e)&&zA(t)||OE(e)&&BA(t)||pE(e)&&BA(t)||cE(e)&&VA(t)||HE(e)&&WA(t)||dE(e)&&UA(t)||uE(e)&&KA(t)||fE(e)&&GA(t)?J.True:jE(e)&&PE($A(e))?t[tT]===`Record`?J.True:J.False:jE(e)&&OE($A(e))&&LA(t,0)?J.True:J.False}function ZA(e,t){return dA(t)?fA(e,t):jE(t)?tj(e,t):kE(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!nE(t.properties[n]))return J.False;if(nE(t.properties[n]))return J.True;if(YA(e.properties[n],t.properties[n])===J.False)return J.False}return J.True})():J.False}function QA(e,t){return dA(t)?fA(e,t):kE(t)&&JA(t)?J.True:AE(t)?lA(yj(e.item,t.item)):J.False}function $A(e){return QE in e.patternProperties?tO():$E in e.patternProperties?nO():uA(`Unknown record key pattern`)}function ej(e){return QE in e.patternProperties?e.patternProperties[QE]:$E in e.patternProperties?e.patternProperties[$E]:uA(`Unable to get record value schema`)}function tj(e,t){let[n,r]=[$A(t),ej(t)];return vE(e)&&OE(n)&&lA(yj(e,r))===J.True?J.True:HE(e)&&OE(n)||PE(e)&&OE(n)||aE(e)&&OE(n)?yj(e,r):kE(e)?(()=>{for(let t of Object.getOwnPropertyNames(e.properties))if(YA(r,e.properties[t])===J.False)return J.False;return J.True})():J.False}function nj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?yj(ej(e),ej(t)):J.False}function rj(e,t){return yj(NE(e)?nO():e,NE(t)?nO():t)}function ij(e,t){return xE(e)&&Ow(e.const)||PE(e)?J.True:J.False}function aj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):PE(t)?J.True:J.False}function oj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):FE(t)?J.True:J.False}function sj(e,t){return IE(e)?yj(dO(e),t):IE(t)?yj(e,dO(t)):uA(`Invalid fallthrough for TemplateLiteral`)}function cj(e,t){return aE(t)&&e.items!==void 0&&e.items.every(e=>yj(e,t.items)===J.True)}function lj(e,t){return TE(e)?J.True:UE(e)?J.False:rE(e)?J.Union:J.False}function uj(e,t){return dA(t)?fA(e,t):kE(t)&&qA(t)||aE(t)&&cj(e,t)?J.True:zE(t)?jw(e.items)&&!jw(t.items)||!jw(e.items)&&jw(t.items)?J.False:jw(e.items)&&!jw(t.items)||e.items.every((e,n)=>yj(e,t.items[n])===J.True)?J.True:J.False:J.False}function dj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):HE(t)?J.True:J.False}function fj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):GE(t)?_j(e,t):BE(t)?J.True:J.False}function pj(e,t){return t.anyOf.some(t=>yj(e,t)===J.True)?J.True:J.False}function mj(e,t){return e.anyOf.every(e=>yj(e,t)===J.True)?J.True:J.False}function hj(e,t){return J.True}function gj(e,t){return TE(t)?AA(e,t):hE(t)?EA(e,t):VE(t)?pj(e,t):rE(t)?pA(e,t):PE(t)?ij(e,t):OE(t)?FA(e,t):pE(t)?wA(e,t):cE(t)?yA(e,t):aE(t)?hA(e,t):zE(t)?lj(e,t):kE(t)?XA(e,t):UE(t)?J.True:J.False}function _j(e,t){return BE(e)||BE(e)?J.True:J.False}function vj(e,t){return hE(t)?EA(e,t):VE(t)?pj(e,t):UE(t)?hj(e,t):rE(t)?pA(e,t):kE(t)?XA(e,t):GE(t)?J.True:J.False}function yj(e,t){return IE(e)||IE(t)?sj(e,t):NE(e)||NE(t)?rj(e,t):EE(e)||EE(t)?NA(e,t):rE(e)?mA(e,t):aE(e)?gA(e,t):sE(e)?vA(e,t):cE(e)?bA(e,t):oE(e)?_A(e,t):uE(e)?xA(e,t):dE(e)?SA(e,t):fE(e)?CA(e,t):pE(e)?TA(e,t):hE(e)?DA(e,t):gE(e)?OA(e,t):xE(e)?kA(e,t):TE(e)?jA(e,t):DE(e)?PA(e,t):OE(e)?IA(e,t):kE(e)?ZA(e,t):jE(e)?nj(e,t):PE(e)?aj(e,t):FE(e)?oj(e,t):zE(e)?uj(e,t):AE(e)?QA(e,t):HE(e)?dj(e,t):BE(e)?fj(e,t):VE(e)?mj(e,t):UE(e)?gj(e,t):GE(e)?vj(e,t):uA(`Unknown left type operand '${e[q]}'`)}function bj(e,t){return yj(e,t)}function xj(e,t,n,r,i){let a={};for(let o of globalThis.Object.getOwnPropertyNames(e))a[o]=Tj(e[o],t,n,r,Rw(i));return a}function Sj(e,t,n,r,i){return xj(e.properties,t,n,r,i)}function Cj(e,t,n,r,i){return hD(Sj(e,t,n,r,i))}function wj(e,t,n,r){let i=bj(e,t);return i===J.Union?wD([n,r]):i===J.True?n:r}function Tj(e,t,n,r,i){return xT(e)?Cj(e,t,n,r,i):bT(e)?K(kj(e,t,n,r,i)):K(wj(e,t,n,r),i)}function Ej(e,t,n,r,i){return{[e]:Tj(QD(e),t,n,r,Rw(i))}}function Dj(e,t,n,r,i){return e.reduce((e,a)=>({...e,...Ej(a,t,n,r,i)}),{})}function Oj(e,t,n,r,i){return Dj(e.keys,t,n,r,i)}function kj(e,t,n,r,i){return hD(Oj(e,t,n,r,i))}function Aj(e,t){return Mj(dO(e),t)}function jj(e,t){let n=e.filter(e=>bj(e,t)===J.False);return n.length===1?n[0]:wD(n)}function Mj(e,t,n={}){return NT(e)?K(Aj(e,t),n):xT(e)?K(Fj(e,t),n):K(RT(e)?jj(e.anyOf,t):bj(e,t)===J.False?e:mD(),n)}function Nj(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Mj(e[r],t);return n}function Pj(e,t){return Nj(e.properties,t)}function Fj(e,t){return hD(Pj(e,t))}function Ij(e,t){return Rj(dO(e),t)}function Lj(e,t){let n=e.filter(e=>bj(e,t)!==J.False);return n.length===1?n[0]:wD(n)}function Rj(e,t,n){return NT(e)?K(Ij(e,t),n):xT(e)?K(Vj(e,t),n):K(RT(e)?Lj(e.anyOf,t):bj(e,t)===J.False?mD():e,n)}function zj(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Rj(e[r],t);return n}function Bj(e,t){return zj(e.properties,t)}function Vj(e,t){return hD(Bj(e,t))}function Hj(e,t){return dT(e)?K(e.returns,t):mD(t)}function Uj(e){return WO(ck(e))}function Wj(e,t,n){return K({[q]:`Record`,type:`object`,patternProperties:{[e]:t}},n)}function Gj(e,t,n){let r={};for(let n of e)r[n]=t;return zO(r,{...n,[tT]:`Record`})}function Kj(e,t,n){return WD(e)?Gj(gO(e),t,n):Wj(e.pattern,t,n)}function qj(e,t,n){return Gj(gO(wD(e)),t,n)}function Jj(e,t,n){return Gj([e.toString()],t,n)}function Yj(e,t,n){return Wj(e.source,t,n)}function Xj(e,t,n){return Wj(jw(e.pattern)?$E:e.pattern,t,n)}function Zj(e,t,n){return Wj($E,t,n)}function Qj(e,t,n){return Wj(eD,t,n)}function $j(e,t,n){return zO({true:t,false:t},n)}function eM(e,t,n){return Wj(QE,t,n)}function tM(e,t,n){return Wj(QE,t,n)}function nM(e,t,n={}){return RT(e)?qj(e.anyOf,t,n):NT(e)?Kj(e,t,n):yT(e)?Jj(e.const,t,n):lT(e)?$j(e,t,n):mT(e)?eM(e,t,n):TT(e)?tM(e,t,n):AT(e)?Yj(e,t,n):jT(e)?Xj(e,t,n):iT(e)?Zj(e,t,n):ST(e)?Qj(e,t,n):mD(n)}function rM(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function iM(e){let t=rM(e);return t===$E?nO():t===QE?tO():nO({pattern:t})}function aM(e){return e.patternProperties[rM(e)]}function oM(e,t){return t.parameters=bM(e,t.parameters),t.returns=xM(e,t.returns),t}function sM(e,t){return t.parameters=bM(e,t.parameters),t.returns=xM(e,t.returns),t}function cM(e,t){return t.allOf=bM(e,t.allOf),t}function lM(e,t){return t.anyOf=bM(e,t.anyOf),t}function uM(e,t){return jw(t.items)||(t.items=bM(e,t.items)),t}function dM(e,t){return t.items=xM(e,t.items),t}function fM(e,t){return t.items=xM(e,t.items),t}function pM(e,t){return t.items=xM(e,t.items),t}function mM(e,t){return t.item=xM(e,t.item),t}function hM(e,t){let n=yM(e,t.properties);return{...t,...zO(n)}}function gM(e,t){let n=nM(xM(e,iM(t)),xM(e,aM(t)));return{...t,...n}}function _M(e,t){return t.index in e?e[t.index]:eA()}function vM(e,t){let n=nT(t),r=rT(t),i=xM(e,t);return n&&r?Uj(i):n&&!r?WO(i):!n&&r?ck(i):i}function yM(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:vM(e,t[r])}),{})}function bM(e,t){return t.map(t=>xM(e,t))}function xM(e,t){return dT(t)?oM(e,t):pT(t)?sM(e,t):hT(t)?cM(e,t):RT(t)?lM(e,t):IT(t)?uM(e,t):oT(t)?dM(e,t):sT(t)?fM(e,t):gT(t)?pM(e,t):DT(t)?mM(e,t):ET(t)?hM(e,t):OT(t)?gM(e,t):aT(t)?_M(e,t):t}function SM(e,t){return xM(t,zw(e))}function CM(e){return K({[q]:`Integer`,type:`integer`},e)}function wM(e,t,n){return{[e]:FM(QD(e),t,Rw(n))}}function TM(e,t,n){return e.reduce((e,r)=>({...e,...wM(r,t,n)}),{})}function EM(e,t,n){return TM(e.keys,t,n)}function DM(e,t,n){return hD(EM(e,t,n))}function OM(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join(``)}function kM(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join(``)}function AM(e){return e.toUpperCase()}function jM(e){return e.toLowerCase()}function MM(e,t,n){let r=RD(e.pattern);return UD(r)?fO([wD(PM([...XD(r)].map(e=>QD(e)),t))],n):{...e,pattern:NM(e.pattern,t)}}function NM(e,t){return typeof e==`string`?t===`Uncapitalize`?OM(e):t===`Capitalize`?kM(e):t===`Uppercase`?AM(e):t===`Lowercase`?jM(e):e:e.toString()}function PM(e,t){return e.map(e=>FM(e,t))}function FM(e,t,n={}){return bT(e)?DM(e,t,n):NT(e)?MM(e,t,n):RT(e)?wD(PM(e.anyOf,t),n):yT(e)?QD(NM(e.const,t),n):K(e,n)}function IM(e,t={}){return FM(e,`Capitalize`,t)}function LM(e,t={}){return FM(e,`Lowercase`,t)}function RM(e,t={}){return FM(e,`Uncapitalize`,t)}function zM(e,t={}){return FM(e,`Uppercase`,t)}function BM(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=XM(e[i],t,Rw(n));return r}function VM(e,t,n){return BM(e.properties,t,n)}function HM(e,t,n){return hD(VM(e,t,n))}function UM(e,t){return e.map(e=>YM(e,t))}function WM(e,t){return e.map(e=>YM(e,t))}function GM(e,t){let{[t]:n,...r}=e;return r}function KM(e,t){return t.reduce((e,t)=>GM(e,t),e)}function qM(e,t,n){let r=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(KM(n,t),r)}function JM(e){return wD(e.reduce((e,t)=>vT(t)?[...e,QD(t)]:e,[]))}function YM(e,t){return hT(e)?vk(UM(e.allOf,t)):RT(e)?wD(WM(e.anyOf,t)):ET(e)?qM(e,t,e.properties):zO({})}function XM(e,t,n){let r=vw(t)?JM(t):t,i=WT(t)?gO(t):t,a=kT(e),o=kT(t);return xT(e)?HM(e,i,n):bT(t)?eN(e,t,n):a&&o||!a&&o||a&&!o?dD(`Omit`,[e,r],n):K({...YM(e,i),...n})}function ZM(e,t,n){return{[t]:XM(e,[t],Rw(n))}}function QM(e,t,n){return t.reduce((t,r)=>({...t,...ZM(e,r,n)}),{})}function $M(e,t,n){return QM(e,t.keys,n)}function eN(e,t,n){return hD($M(e,t,n))}function tN(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=uN(e[i],t,Rw(n));return r}function nN(e,t,n){return tN(e.properties,t,n)}function rN(e,t,n){return hD(nN(e,t,n))}function iN(e,t){return e.map(e=>lN(e,t))}function aN(e,t){return e.map(e=>lN(e,t))}function oN(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function sN(e,t,n){let r=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(oN(n,t),r)}function cN(e){return wD(e.reduce((e,t)=>vT(t)?[...e,QD(t)]:e,[]))}function lN(e,t){return hT(e)?vk(iN(e.allOf,t)):RT(e)?wD(aN(e.anyOf,t)):ET(e)?sN(e,t,e.properties):zO({})}function uN(e,t,n){let r=vw(t)?cN(t):t,i=WT(t)?gO(t):t,a=kT(e),o=kT(t);return xT(e)?rN(e,i,n):bT(t)?mN(e,t,n):a&&o||!a&&o||a&&!o?dD(`Pick`,[e,r],n):K({...lN(e,i),...n})}function dN(e,t,n){return{[t]:uN(e,[t],Rw(n))}}function fN(e,t,n){return t.reduce((t,r)=>({...t,...dN(e,r,n)}),{})}function pN(e,t,n){return fN(e,t.keys,n)}function mN(e,t,n){return hD(pN(e,t,n))}function hN(e,t){return dD(`Partial`,[dD(e,t)])}function gN(e){return dD(`Partial`,[yk(e)])}function _N(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=ck(e[n]);return t}function vN(e,t){let n=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(_N(t),n)}function yN(e){return e.map(e=>bN(e))}function bN(e){return uT(e)?hN(e.target,e.parameters):kT(e)?gN(e.$ref):hT(e)?vk(yN(e.allOf)):RT(e)?wD(yN(e.anyOf)):ET(e)?vN(e,e.properties):cT(e)||lT(e)||mT(e)||yT(e)||wT(e)||TT(e)||jT(e)||MT(e)||LT(e)?e:zO({})}function xN(e,t){return xT(e)?wN(e,t):K({...bN(e),...t})}function SN(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=xN(e[r],Rw(t));return n}function CN(e,t){return SN(e.properties,t)}function wN(e,t){return hD(CN(e,t))}function TN(e,t){return dD(`Required`,[dD(e,t)])}function EN(e){return dD(`Required`,[yk(e)])}function DN(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=pD(e[n],[eT]);return t}function ON(e,t){let n=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(DN(t),n)}function kN(e){return e.map(e=>AN(e))}function AN(e){return uT(e)?TN(e.target,e.parameters):kT(e)?EN(e.$ref):hT(e)?vk(kN(e.allOf)):RT(e)?wD(kN(e.anyOf)):ET(e)?ON(e,e.properties):cT(e)||lT(e)||mT(e)||yT(e)||wT(e)||TT(e)||jT(e)||MT(e)||LT(e)?e:zO({})}function jN(e,t){return xT(e)?PN(e,t):K({...AN(e),...t})}function MN(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=jN(e[r],t);return n}function NN(e,t){return MN(e.properties,t)}function PN(e,t){return hD(NN(e,t))}function FN(e,t){return t.map(t=>kT(t)?IN(e,t.$ref):rP(e,t))}function IN(e,t){return t in e?kT(e[t])?IN(e,e[t].$ref):rP(e,e[t]):mD()}function LN(e){return Ek(e[0])}function RN(e){return jO(e[0],e[1])}function zN(e){return Bk(e[0])}function BN(e){return xN(e[0])}function VN(e){return XM(e[0],e[1])}function HN(e){return uN(e[0],e[1])}function UN(e){return jN(e[0])}function WN(e,t,n){let r=FN(e,n);return t===`Awaited`?LN(r):t===`Index`?RN(r):t===`KeyOf`?zN(r):t===`Partial`?BN(r):t===`Omit`?VN(r):t===`Pick`?HN(r):t===`Required`?UN(r):mD()}function GN(e,t){return cD(rP(e,t))}function KN(e,t){return uD(rP(e,t))}function qN(e,t,n){return gD(nP(e,t),rP(e,n))}function JN(e,t,n){return _D(nP(e,t),rP(e,n))}function YN(e,t){return vk(nP(e,t))}function XN(e,t){return IO(rP(e,t))}function ZN(e,t){return zO(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:rP(e,t[r])}),{}))}function QN(e,t){let[n,r]=[rP(e,aM(t)),rM(t)],i=zw(t);return i.patternProperties[r]=n,i}function $N(e,t){return kT(t)?{...IN(e,t.$ref),[Qw]:t[Qw]}:t}function eP(e,t){return JO(nP(e,t))}function tP(e,t){return wD(nP(e,t))}function nP(e,t){return t.map(t=>rP(e,t))}function rP(e,t){return rT(t)?K(rP(e,pD(t,[eT])),t):nT(t)?K(rP(e,pD(t,[$w])),t):FT(t)?K($N(e,t),t):oT(t)?K(GN(e,t.items),t):sT(t)?K(KN(e,t.items),t):uT(t)?K(WN(e,t.target,t.parameters)):dT(t)?K(qN(e,t.parameters,t.returns),t):pT(t)?K(JN(e,t.parameters,t.returns),t):hT(t)?K(YN(e,t.allOf),t):gT(t)?K(XN(e,t.items),t):ET(t)?K(ZN(e,t.properties),t):OT(t)?K(QN(e,t)):IT(t)?K(eP(e,t.items||[]),t):RT(t)?K(tP(e,t.anyOf),t):t}function iP(e,t){return t in e?rP(e,e[t]):mD()}function aP(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:iP(e,n)}),{})}var oP=class{constructor(e){let t=aP(e),n=this.WithIdentifiers(t);this.$defs=n}Import(e,t){let n={...this.$defs,[e]:K(this.$defs[e],t)};return K({[q]:`Import`,$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}};function sP(e){return new oP(e)}function cP(e,t){return K({[q]:`Not`,not:e},t)}function lP(e,t){return pT(e)?JO(e.parameters,t):mD()}var uP=0;function dP(e,t={}){jw(t.$id)&&(t.$id=`T${uP++}`);let n=zw(e({[q]:`This`,$ref:`${t.$id}`}));return n.$id=t.$id,K({[tT]:`Recursive`,...n},t)}function fP(e,t){let n=Ow(e)?new globalThis.RegExp(e):e;return K({[q]:`RegExp`,type:`RegExp`,source:n.source,flags:n.flags},t)}function pP(e){return hT(e)?e.allOf:RT(e)?e.anyOf:IT(e)?e.items??[]:[]}function mP(e){return pP(e)}function hP(e,t){return pT(e)?K(e.returns,t):mD(t)}var gP=class{constructor(e){this.schema=e}Decode(e){return new _P(this.schema,e)}},_P=class{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){let n={Encode:n=>t[Qw].Encode(e(n)),Decode:e=>this.decode(t[Qw].Decode(e))};return{...t,[Qw]:n}}EncodeSchema(e,t){let n={Decode:this.decode,Encode:e};return{...t,[Qw]:n}}Encode(e){return FT(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function vP(e){return new gP(e)}function yP(e={}){return K({[q]:e[q]??`Unsafe`},e)}function bP(e){return K({[q]:`Void`,type:`void`},e)}var Y=s({Any:()=>sD,Argument:()=>lD,Array:()=>cD,AsyncIterator:()=>uD,Awaited:()=>Ek,BigInt:()=>eO,Boolean:()=>$D,Capitalize:()=>IM,Composite:()=>Jk,Const:()=>aA,Constructor:()=>gD,ConstructorParameters:()=>oA,Date:()=>Yk,Enum:()=>sA,Exclude:()=>Mj,Extends:()=>Tj,Extract:()=>Rj,Function:()=>_D,Index:()=>jO,InstanceType:()=>Hj,Instantiate:()=>SM,Integer:()=>CM,Intersect:()=>vk,Iterator:()=>IO,KeyOf:()=>Bk,Literal:()=>QD,Lowercase:()=>LM,Mapped:()=>ik,Module:()=>sP,Never:()=>mD,Not:()=>cP,Null:()=>Xk,Number:()=>tO,Object:()=>zO,Omit:()=>XM,Optional:()=>ck,Parameters:()=>lP,Partial:()=>xN,Pick:()=>uN,Promise:()=>BO,Readonly:()=>WO,ReadonlyOptional:()=>Uj,Record:()=>nM,Recursive:()=>dP,Ref:()=>yk,RegExp:()=>fP,Required:()=>jN,Rest:()=>mP,ReturnType:()=>hP,String:()=>nO,Symbol:()=>Zk,TemplateLiteral:()=>fO,Transform:()=>vP,Tuple:()=>JO,Uint8Array:()=>$k,Uncapitalize:()=>RM,Undefined:()=>Qk,Union:()=>wD,Unknown:()=>eA,Unsafe:()=>yP,Uppercase:()=>zM,Void:()=>bP});function xP(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function SP(e,t){return Y.String({pattern:`^${xP(e)}${Ft}$`,...t===void 0?{}:{description:t}})}var X=Y.String({minLength:1,description:`ISO 8601 date-time string`}),CP=Y.String({minLength:1});SP(Lt.project,`ProjectId`);var wP=SP(Lt.message,`MessageId`),TP=SP(Lt.taskModule,`TaskModuleId`),EP=SP(Lt.task,`TaskId`),DP=SP(Lt.runResult,`RunResultId`),OP=SP(Lt.recoverySummary,`RecoverySummaryId`),kP=SP(Lt.activity,`ActivityRef`),AP=SP(Lt.event,`EventRef`),jP=SP(Lt.workflowInvocation,`WorkflowInvocationRef`),MP=SP(Lt.clarificationThread,`ClarificationThreadRef`),NP=SP(Lt.clarificationRound,`ClarificationRoundRef`);SP(Lt.clarificationInteractionResponse,`ClarificationInteractionResponseId`);var PP=SP(Lt.approvalRequest,`ApprovalRequestId`),FP=SP(Lt.idempotency,`IdempotencyKey`),IP=SP(Lt.relayProject,`RelayProjectRef`);SP(Lt.relayAccount,`RelayAccountRef`),SP(Lt.relayMembership,`RelayMembershipRef`),SP(Lt.relayAccountSession,`RelayAccountSessionRef`),SP(Lt.relayClientSession,`RelayClientSessionId`);var LP=SP(Lt.relayUpload,`RelayUploadRef`);SP(Lt.relayAuthChallenge,`RelayAuthChallengeRef`),SP(Lt.hostConnection,`HostConnectionRef`),SP(Lt.joinToken,`JoinTokenRef`);var RP=Y.Union([Y.Literal(`project_context_bootstrap`),Y.Literal(`scratchpad_refresh`),Y.Literal(`task_compile`),Y.Literal(`context_sync`),Y.Literal(`reference_summary_refresh`),Y.Literal(`recovery_check`),Y.Literal(`follow_up_check`)]);Y.Object({cursor:Y.Optional(CP),limit:Y.Optional(Y.Integer({minimum:1,maximum:200,default:50}))},{additionalProperties:!1});function zP(e){return Y.Object({items:Y.Array(e),page:Y.Object({next_cursor:Y.Optional(CP),has_more:Y.Boolean(),limit:Y.Integer({minimum:1,maximum:200})},{additionalProperties:!1})},{additionalProperties:!1})}function BP(e){return Y.Object({items:Y.Array(e),window:Y.Object({older_cursor:Y.Optional(CP),newer_cursor:Y.Optional(CP),has_older:Y.Boolean(),has_newer:Y.Boolean(),limit:Y.Integer({minimum:1,maximum:200})},{additionalProperties:!1})},{additionalProperties:!1})}var VP=Y.Union([Y.Object({kind:Y.Literal(`all`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`workspace`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`session`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`bootstrap`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`messages`),scope:Y.Literal(`main_chat`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`messages`),scope:Y.Literal(`clarification_round`),round_id:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`scratchpad`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`worklist`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`read_state`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task_detail`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task_run_results`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`clarification`),thread_id:Y.Optional(MP),round_id:Y.Optional(NP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`execution_status`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`activity`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_config`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_usage`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`project_timeline`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`skills`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`artifacts`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`approval`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`viewer`),path:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`recovery_summaries`)},{additionalProperties:!1})]);Y.Object({kind:Y.String({minLength:1})});var HP=Y.Object({kind:Y.Literal(`interrupted`),retry_with_new_command_id:Y.Literal(!0)},{additionalProperties:!1});function UP(e){return Y.Object({command_id:FP,issued_at:X,payload:e},{additionalProperties:!1})}function WP(e){return Y.Object({command_id:FP,disposition:e,invalidates:Y.Optional(Y.Array(VP))},{additionalProperties:!1})}function GP(e,t){return Y.Object({command_id:FP,disposition:e,result:Y.Optional(t),invalidates:Y.Optional(Y.Array(VP))},{additionalProperties:!1})}var KP=Y.Union([Y.Literal(`bad_request`),Y.Literal(`unauthorized`),Y.Literal(`forbidden`),Y.Literal(`not_found`),Y.Literal(`conflict`),Y.Literal(`validation_failed`),Y.Literal(`provider_not_configured`),Y.Literal(`provider_auth_invalid`),Y.Literal(`provider_quota_or_billing_required`),Y.Literal(`provider_rate_limited`),Y.Literal(`provider_model_unavailable`),Y.Literal(`provider_network_error`),Y.Literal(`relay_session_invalid`),Y.Literal(`command_replay_mismatch`),Y.Literal(`repo_snapshot_unavailable`),Y.Literal(`host_unavailable`),Y.Literal(`internal_error`)]);Y.Object({error:Y.Object({code:KP,message:Y.String({minLength:1}),retryable:Y.Boolean(),details:Y.Optional(Y.Unknown())},{additionalProperties:!1})},{additionalProperties:!1}),Y.Union([Y.Literal(`connection.ready`),Y.Literal(`message.created`),Y.Literal(`scratchpad.updated`),Y.Literal(`worklist.changed`),Y.Literal(`task.updated`),Y.Literal(`task_detail.updated`),Y.Literal(`clarification.changed`),Y.Literal(`approval.changed`),Y.Literal(`activity.event`),Y.Literal(`execution_status.changed`),Y.Literal(`provider_config.changed`),Y.Literal(`workspace.recovered`),Y.Literal(`query.invalidate`)]),Y.Union([Y.Object({kind:Y.Literal(`all`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`me`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`recent_projects`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`join_entries`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`project_presence`),relay_project_ref:IP},{additionalProperties:!1})]),Y.Union([Y.Literal(`connection.ready`),Y.Literal(`query.invalidate`)]);var qP=Y.Object({retention_seconds:Y.Literal(300),max_events:Y.Literal(1e3)},{additionalProperties:!1}),Z=Y.String({minLength:1}),JP=Y.Union([Y.Literal(`provider_auth_invalid`),Y.Literal(`provider_quota_or_billing_required`),Y.Literal(`provider_rate_limited`),Y.Literal(`provider_model_unavailable`),Y.Literal(`provider_network_error`),Y.Literal(`unknown`)]),YP=JP,XP=Y.Union([Y.Object({status:Y.Literal(`not_configured`)},{additionalProperties:!1}),Y.Object({status:Y.Literal(`configured`),provider:Y.Literal(`openai`),auth_kind:Y.Literal(`api_key`),redacted_key:Z,default_model:Z,validated_at:X},{additionalProperties:!1}),Y.Object({status:Y.Literal(`invalid`),provider:Y.Optional(Y.Literal(`openai`)),auth_kind:Y.Optional(Y.Literal(`api_key`)),redacted_key:Y.Optional(Z),default_model:Y.Optional(Z),validated_at:Y.Optional(X),invalid_reason_code:Y.Optional(JP)},{additionalProperties:!1})]),ZP=Y.Union([Y.Literal(`implementation`),Y.Literal(`planning`),Y.Literal(`context`),Y.Literal(`qna`),Y.Literal(`other`)]),QP=Y.Object({input_tokens:Y.Integer({minimum:0}),cached_input_tokens:Y.Integer({minimum:0}),output_tokens:Y.Integer({minimum:0}),reasoning_output_tokens:Y.Integer({minimum:0}),total_tokens:Y.Integer({minimum:0}),event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),$P=Y.Object({source:Y.String({minLength:1}),label:Y.String({minLength:1}),category:ZP,input_tokens:Y.Integer({minimum:0}),cached_input_tokens:Y.Integer({minimum:0}),output_tokens:Y.Integer({minimum:0}),reasoning_output_tokens:Y.Integer({minimum:0}),total_tokens:Y.Integer({minimum:0}),event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),eF=Y.Object({model:Y.String({minLength:1}),input_tokens:Y.Integer({minimum:0}),cached_input_tokens:Y.Integer({minimum:0}),output_tokens:Y.Integer({minimum:0}),reasoning_output_tokens:Y.Integer({minimum:0}),total_tokens:Y.Integer({minimum:0}),event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),tF=Y.Object({total_tokens:Y.Integer({minimum:0}),totals:QP,by_source:Y.Array($P),by_model:Y.Array(eF),recent_windows:Y.Object({today:QP,last_7_days:QP,last_30_days:QP},{additionalProperties:!1})},{additionalProperties:!1}),nF=Y.Union([Y.Literal(`task_accepted`),Y.Literal(`task_update`),Y.Literal(`checkpoint`)]),rF=Y.Union([Y.Literal(`completed`),Y.Literal(`failed`),Y.Literal(`needs_human`)]),iF=Y.Union([Y.Literal(`needs_input`),Y.Literal(`completed`),Y.Literal(`failed`)]),aF=Y.Union([Y.Literal(`neutral`),Y.Literal(`success`),Y.Literal(`warning`),Y.Literal(`error`)]),oF=Y.Object({kind:Y.Union([Y.Literal(`worklist_task`),Y.Literal(`chat_message`),Y.Literal(`reference_file`),Y.Literal(`repo_path`)]),label:Y.String({minLength:1}),task_id:Y.Optional(EP),message_id:Y.Optional(wP),path:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1}),sF=Y.Object({message_id:wP,author:Y.String({minLength:1}),body:Y.String(),created_at:X},{additionalProperties:!1}),cF=Y.Object({title:Y.Optional(Y.String({minLength:1})),summary:Y.String({minLength:1}),source:Y.Optional(Y.Union([Y.Literal(`scratchpad`),Y.Literal(`clarification`),Y.Literal(`contract`)]))},{additionalProperties:!1}),lF=Y.Object({title:Y.Optional(Y.String({minLength:1})),summary:Y.Optional(Y.String()),request:Y.Optional(Y.String()),status:Y.Optional(Y.Union([Y.Literal(`active`),Y.Literal(`resolved`)])),answer_count:Y.Optional(Y.Integer({minimum:0})),answers:Y.Optional(Y.Array(sF))},{additionalProperties:!1}),uF=Y.Union([Y.Literal(`added`),Y.Literal(`modified`),Y.Literal(`deleted`),Y.Literal(`renamed`),Y.Literal(`unknown`)]),dF=Y.Object({tone:aF,summary:Y.Optional(Y.String()),origin:Y.Optional(Y.Object({title:Y.Optional(Y.String({minLength:1})),summary:Y.Optional(Y.String()),snippets:Y.Optional(Y.Array(sF)),source_count:Y.Optional(Y.Integer({minimum:0})),unavailable_reason:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),decisions:Y.Optional(Y.Array(cF)),clarification:Y.Optional(lF),contract:Y.Optional(Y.Object({goal:Y.String(),scope:Y.Array(Y.String()),truncated:Y.Optional(Y.Boolean())},{additionalProperties:!1})),result:Y.Optional(Y.Object({summary:Y.String(),error_code:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),changes:Y.Optional(Y.Object({items:Y.Array(Y.Object({status:uF,path:Y.String({minLength:1}),previous_path:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),total_count:Y.Integer({minimum:0}),truncated:Y.Boolean()},{additionalProperties:!1})),verification:Y.Optional(Y.Object({checks:Y.Union([Y.Literal(`passed`),Y.Literal(`failed`),Y.Literal(`skipped`)]),skip_reason_code:Y.Optional(Y.String({minLength:1})),skip_reason_summary:Y.Optional(Y.String())},{additionalProperties:!1})),promotion:Y.Optional(Y.Object({status:Y.Union([Y.Literal(`promoted`),Y.Literal(`not_promoted`),Y.Literal(`not_attempted`)]),commit_oid:Y.Optional(Y.String({minLength:1})),commit_short_oid:Y.Optional(Y.String({minLength:1})),summary:Y.Optional(Y.String()),reason_code:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),checkpoint:Y.Optional(Y.Object({counters:Y.Object({completed:Y.Integer({minimum:0}),failed:Y.Integer({minimum:0}),remaining:Y.Integer({minimum:0})},{additionalProperties:!1}),items:Y.Array(Y.Object({task_id:EP,title:Y.String({minLength:1}),status:Y.Union([Y.Literal(`done`),Y.Literal(`failed`)]),summary:Y.String()},{additionalProperties:!1})),generated_files:Y.Optional(Y.Array(Y.Object({path:Y.String({minLength:1}),name:Y.String({minLength:1})},{additionalProperties:!1}))),truncated:Y.Optional(Y.Boolean())},{additionalProperties:!1})),links:Y.Array(oF)},{additionalProperties:!1}),fF=Y.Object({id:Y.String({minLength:1}),kind:nF,occurred_at:X,title:Y.String({minLength:1}),summary:Y.Optional(Y.String()),task_id:Y.Optional(EP),task_title:Y.Optional(Y.String({minLength:1})),activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),run_result_id:Y.Optional(DP),message_id:Y.Optional(wP),status:Y.Optional(rF),update_state:Y.Optional(iF),token_usage:Y.Optional(QP),usage_sources:Y.Optional(Y.Array($P)),usage_models:Y.Optional(Y.Array(eF)),trace_card:Y.Optional(dF)},{additionalProperties:!1});Y.Object({generated_at:X,usage_overview:tF,items:Y.Array(fF)},{additionalProperties:!1});var pF=10*1024*1024,mF=50*1024*1024,hF=mF,gF=Y.Union([Y.Literal(`reference_file`),Y.Literal(`skill_zip`)]),_F=Y.String({pattern:`^sha256:[a-f0-9]{64}$`});function vF(e){return{upload_id:LP,file_name:Z,size_bytes:Y.Integer({minimum:1,maximum:e}),sha256:_F,media_type:Y.Optional(Z)}}function yF(e){return e===`skill_zip`?mF:pF}var bF=vF(hF),xF=vF(pF),SF=vF(mF),CF={relay_project_ref:IP,file_name:Z,sha256:_F,media_type:Y.Optional(Z)},wF=Y.Object({...CF,purpose:Y.Literal(`reference_file`),size_bytes:Y.Integer({minimum:1,maximum:pF})},{additionalProperties:!1}),TF=Y.Object({...CF,purpose:Y.Literal(`skill_zip`),size_bytes:Y.Integer({minimum:1,maximum:mF})},{additionalProperties:!1});Y.Object(bF,{additionalProperties:!1});var EF=Y.Union([wF,TF]),DF=Y.Object({upload_id:LP,relay_project_ref:IP,purpose:gF,file_name:Z,size_bytes:Y.Integer({minimum:1,maximum:hF}),sha256:_F,media_type:Y.Optional(Z),expires_at:X},{additionalProperties:!1}),OF=Y.Object({method:Y.Literal(`PUT`),url:Y.String({minLength:1}),headers:Y.Optional(Y.Record(Y.String({minLength:1}),Y.String()))},{additionalProperties:!1}),kF=Y.Union([Y.Object({kind:Y.Literal(`started`)},{additionalProperties:!1})]),AF=Y.Object({upload:DF,put:OF},{additionalProperties:!1});UP(EF),GP(kF,AF);var jF=Y.Union([Y.Literal(`chat`),Y.Literal(`worklist`),Y.Literal(`references`),Y.Literal(`skills`)]),MF=Y.Object({scope:jF,latest_event_cursor:Y.Integer({minimum:0}),read_event_cursor:Y.Integer({minimum:0}),has_unread:Y.Boolean(),updated_at:Y.Optional(X)},{additionalProperties:!1}),NF=Y.Object({generated_at:X,scopes:Y.Object({chat:MF,worklist:MF,references:MF,skills:MF},{additionalProperties:!1})},{additionalProperties:!1}),PF=Y.Object({scope:jF,up_to_event_cursor:Y.Optional(Y.Integer({minimum:0}))},{additionalProperties:!1}),FF=Y.Union([Y.Object({kind:Y.Literal(`marked`)},{additionalProperties:!1}),HP]),IF=Y.Object({read_state:NF},{additionalProperties:!1});UP(PF),GP(FF,IF);var LF=Y.Object({attempt:Y.Integer({minimum:1}),kind:Y.Union([Y.Literal(`initial`),Y.Literal(`continuation`),Y.Literal(`retry`)]),parent_activity_ref:Y.Optional(kP),root_activity_ref:Y.Optional(kP)},{additionalProperties:!1}),RF=Y.Union([Y.Object({kind:Y.Literal(`task`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`workflow`),workflow_ref:jP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`project`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`clarification_round`),clarification_round_ref:NP},{additionalProperties:!1})]),zF=Y.Union([Y.Literal(`todo`),Y.Literal(`running`),Y.Literal(`pending`),Y.Literal(`done`),Y.Literal(`failed`)]),BF=Y.Object({task_id:EP,title:Z,summary:Y.String(),status:zF,module_id:TP,module_name:Z},{additionalProperties:!1}),VF=Y.Object({workflow_ref:jP,activity_ref:kP,topic:Y.String(),background_summary:Y.String(),current_consensus:Y.Array(Y.String()),open_questions:Y.Array(Y.String()),task_changes:Y.Array(Y.String()),submitted_at:X,compiled_tasks:Y.Optional(Y.Array(BF))},{additionalProperties:!1}),HF=Y.Object({id:Y.Literal(`current`),state:Y.Union([Y.Literal(`empty`),Y.Literal(`ready`),Y.Literal(`submitted`)]),topic:Y.String(),background_summary:Y.String(),current_consensus:Y.Array(Y.String()),open_questions:Y.Array(Y.String()),task_changes:Y.Array(Y.String()),updated_by_activity_ref:Y.Optional(kP),updated_at:Y.Optional(X),submitted_by_activity_ref:Y.Optional(kP),submitted_by_workflow_ref:Y.Optional(jP),submitted_at:Y.Optional(X),receipts:Y.Array(VF)},{additionalProperties:!1}),UF=Y.Object({id:TP,name:Z,summary:Y.Optional(Y.String()),order:Y.Integer(),archived:Y.Boolean(),created_at:X,updated_at:Y.Optional(X)},{additionalProperties:!1}),WF=Y.Object({id:EP,module_id:TP,title:Z,summary:Y.String(),status:zF,order:Y.Integer(),current_activity_ref:Y.Optional(kP),active_clarification_thread_ref:Y.Optional(MP),latest_run_result_id:Y.Optional(DP),created_from_workflow_ref:jP,created_at:X,updated_at:X},{additionalProperties:!1});Y.Object({modules:Y.Array(Y.Object({module:UF,tasks:Y.Array(WF)},{additionalProperties:!1})),updated_at:Y.Optional(X)},{additionalProperties:!1});var GF=Y.Object({goal:Y.String(),scope:Y.Array(Y.String())},{additionalProperties:!1}),KF=Y.Union([Y.Literal(`no_validation_command_found`),Y.Literal(`project_has_no_test_setup`),Y.Literal(`validation_not_applicable`),Y.Literal(`command_prerequisite_missing`),Y.Literal(`command_requires_external_service`),Y.Literal(`command_requires_secret`),Y.Literal(`command_requires_interactive_input`),Y.Literal(`command_too_expensive_for_mvp`),Y.Literal(`unsafe_command_blocked`),Y.Literal(`known_failing_baseline`)]),qF=Y.Object({status:Y.Union([Y.Literal(`succeeded`),Y.Literal(`failed`),Y.Literal(`unknown`)]),target:Y.Optional(Z),redacted_summary:Y.String(),started_at:Y.Optional(X),finished_at:Y.Optional(X)},{additionalProperties:!1}),JF=Y.Object({latest_run_result_id:Y.Optional(DP),result_kind:Y.Optional(Y.Union([Y.Literal(`needs_human`),Y.Literal(`finished`),Y.Literal(`failed`)])),run_lineage:Y.Optional(LF),clarification_thread_ref:Y.Optional(MP),outcome:Y.Optional(Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)])),summary:Y.Optional(Y.String()),checks:Y.Optional(Y.Union([Y.Literal(`passed`),Y.Literal(`failed`),Y.Literal(`skipped`)])),docs:Y.Optional(Y.Union([Y.Literal(`updated`),Y.Literal(`checked_no_change`),Y.Literal(`not_checked`),Y.Literal(`sync_deferred`)])),skip_reason_code:Y.Optional(KF),skip_reason_summary:Y.Optional(Y.String()),external_side_effects:Y.Optional(Y.Array(qF)),changed_paths:Y.Optional(Y.Array(Y.String())),user_note_candidate:Y.Optional(Y.String()),promotion:Y.Optional(Y.Object({status:Y.Union([Y.Literal(`promoted`),Y.Literal(`not_promoted`),Y.Literal(`not_attempted`)]),summary:Y.Optional(Y.String()),reason_code:Y.Optional(Z),commit_oid:Y.Optional(Z)},{additionalProperties:!1})),error_code:Y.Optional(Z),retryable:Y.Optional(Y.Boolean()),updated_at:Y.Optional(X)},{additionalProperties:!1}),YF=Y.Object({task:WF,detail:Y.Object({task_id:EP,contract:GF,result:JF,frozen_contract_since_activity_ref:Y.Optional(kP),updated_at:X},{additionalProperties:!1})},{additionalProperties:!1});zP(Y.Union([Y.Object({id:DP,activity_ref:kP,task_id:EP,run_lineage:LF,result_kind:Y.Literal(`needs_human`),summary:Y.String(),clarification_thread_ref:MP,created_at:X},{additionalProperties:!1}),Y.Object({id:DP,activity_ref:kP,task_id:EP,run_lineage:LF,result_kind:Y.Literal(`finished`),outcome:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)]),summary:Y.String(),user_note_candidate:Y.Optional(Y.String()),checks:Y.Union([Y.Literal(`passed`),Y.Literal(`failed`),Y.Literal(`skipped`)]),docs:Y.Union([Y.Literal(`updated`),Y.Literal(`checked_no_change`),Y.Literal(`not_checked`),Y.Literal(`sync_deferred`)]),skip_reason_code:Y.Optional(KF),skip_reason_summary:Y.Optional(Y.String()),external_side_effects:Y.Optional(Y.Array(qF)),created_at:X},{additionalProperties:!1}),Y.Object({id:DP,activity_ref:kP,task_id:EP,run_lineage:LF,result_kind:Y.Literal(`failed`),summary:Y.String(),error_code:Z,retryable:Y.Boolean(),created_at:X},{additionalProperties:!1})]));var XF=Y.Object({recovery_summary_id:OP,summary:Y.String({minLength:1}),affected_activities:Y.Array(kP),affected_activity_count:Y.Integer({minimum:0}),created_at:X},{additionalProperties:!1});zP(XF),Y.Object({recovery_summary:XF},{additionalProperties:!1});var ZF=Y.Union(or.map(e=>Y.Literal(e))),QF=Y.Union([Y.Object({kind:Y.Literal(`initials`),initials:Y.String({minLength:1}),color:ZF},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`image`),image_url:Y.String({minLength:1}),initials:Y.String({minLength:1}),color:ZF},{additionalProperties:!1})]),$F=Y.Union([Y.Object({kind:Y.Literal(`main_chat`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`clarification_round`),clarification_round_ref:NP},{additionalProperties:!1})]),eI=Y.Object({kind:Y.Union([Y.Literal(`human`),Y.Literal(`system`),Y.Literal(`agent`)]),ref:Y.Optional(Z),display_name:Y.Optional(Z),avatar:Y.Optional(QF)},{additionalProperties:!1}),tI=Y.Union([Y.Literal(`user_text`),Y.Literal(`agent_text`),Y.Literal(`system_notice`),Y.Literal(`clarification_request`),Y.Literal(`clarification_card`)]),nI=Y.Union([Y.Literal(`file`),Y.Literal(`image`)]),rI=Y.Object({path:Y.String({minLength:1}),name:Z,source:Y.Union([Y.Literal(`human_upload`),Y.Literal(`tutti_output`)]),category:nI,blob_oid:Y.Optional(Z),media_type:Y.Optional(Z),size_bytes:Y.Integer({minimum:0}),text_read:Y.Object({can_read:Y.Boolean(),blocked_reason:Y.Optional(Y.Union([Y.Literal(`binary`),Y.Literal(`too_large`),Y.Literal(`unsupported_encoding`),Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`unknown`)]))},{additionalProperties:!1})},{additionalProperties:!1}),iI=Y.Object({task_id:EP,title:Z,status:Y.Union([Y.Literal(`done`),Y.Literal(`failed`)]),summary:Y.String(),module_name:Y.Optional(Z),latest_run_result_id:Y.Optional(DP)},{additionalProperties:!1}),aI=Y.Object({path:Y.String({minLength:1}),name:Z,group:Y.Optional(Z),size_bytes:Y.Integer({minimum:0}),media_type:Y.Optional(Z)},{additionalProperties:!1}),oI=Y.Object({kind:Y.Literal(`worklist_terminal`),status:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)]),reason:Y.Union([Y.Literal(`all_tasks_done`),Y.Literal(`run_failed`)]),title:Z,feedback_key:Z,counters:Y.Object({completed:Y.Integer({minimum:0}),failed:Y.Integer({minimum:0}),remaining:Y.Integer({minimum:0})},{additionalProperties:!1}),items:Y.Array(iI),final_note:Y.Optional(Y.String()),generated_files:Y.Optional(Y.Array(aI)),primary_task_id:Y.Optional(EP)},{additionalProperties:!1}),sI=Y.Object({kind:Y.Literal(`task_result`),status:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)]),title:Z,task_id:EP,task_title:Z,result_key:Z,summary:Y.String(),module_name:Y.Optional(Z),latest_run_result_id:Y.Optional(DP),activity_ref:Y.Optional(kP),final_note:Y.Optional(Y.String()),generated_files:Y.Optional(Y.Array(aI)),error_code:Y.Optional(Z)},{additionalProperties:!1}),cI=Y.Object({kind:Y.Literal(`worklist_compile`),workflow_ref:jP,title:Z,task_count:Y.Integer({minimum:0}),tasks:Y.Array(BF)},{additionalProperties:!1}),lI=Y.Object({kind:Y.Literal(`artifact_preview`),title:Z,status:Y.Union([Y.Literal(`available`),Y.Literal(`updated`)]),task_id:Y.Optional(EP),run_result_id:Y.Optional(DP)},{additionalProperties:!1}),uI=Y.Object({task_id:Y.Optional(EP),activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),clarification_thread_ref:Y.Optional(MP),clarification_round_ref:Y.Optional(NP),scratchpad_source:Y.Optional(Y.Union([Y.Literal(`include`),Y.Literal(`exclude`)])),reference_file:Y.Optional(rI),worklist_compile:Y.Optional(cI),worklist_feedback:Y.Optional(oI),task_result:Y.Optional(sI),artifact_preview:Y.Optional(lI)},{additionalProperties:!1}),dI=Y.Object({id:wP,scope:$F,author:eI,message_kind:tI,body:Y.String(),refs:Y.Optional(uI),clarification_card:Y.Optional(Y.Object({thread_id:MP,round_id:NP,title:Y.Optional(Z),summary:Z,status:Y.Union([Y.Literal(`writable`),Y.Literal(`sealed`)]),is_current_round:Y.Boolean()},{additionalProperties:!1})),created_at:X},{additionalProperties:!1});BP(dI);var fI=Y.Object({body:Y.String({minLength:1,maxLength:8e3})},{additionalProperties:!1}),pI=Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),mI=Y.Union([pI,HP]),hI=Y.Object({message:dI},{additionalProperties:!1});Y.Object({limit:Y.Optional(Y.Integer({minimum:1,maximum:200,default:50})),anchor:Y.Optional(Y.Union([Y.Literal(`latest`),Y.Literal(`start`)])),before:Y.Optional(CP),after:Y.Optional(CP),around:Y.Optional(wP)},{additionalProperties:!1}),UP(fI),GP(mI,hI),Y.Object({message:dI},{additionalProperties:!1});var gI=Y.Union([Y.Literal(`command_execution`),Y.Literal(`file_change`),Y.Literal(`permissions`),Y.Literal(`legacy_exec_command`),Y.Literal(`legacy_apply_patch`)]),_I=Y.Union([Y.Literal(`allow_once`),Y.Literal(`allow_session`),Y.Literal(`deny`),Y.Literal(`cancel`)]),vI=Y.Union([Y.Literal(`primary`),Y.Literal(`neutral`),Y.Literal(`danger`)]),yI=Y.Object({decision_id:Z,kind:_I,label:Z,tone:vI},{additionalProperties:!1}),bI=Y.Object({text:Z,cwd_label:Y.Optional(Z),actions:Y.Optional(Y.Array(Y.Object({label:Z,detail:Y.Optional(Z)},{additionalProperties:!1}))),network:Y.Optional(Y.Object({host:Z,protocol:Z},{additionalProperties:!1}))},{additionalProperties:!1}),xI=Y.Object({grant_root_label:Y.Optional(Z),paths:Y.Optional(Y.Array(Z))},{additionalProperties:!1}),SI=Y.Object({network:Y.Optional(Y.Object({enabled:Y.Boolean()},{additionalProperties:!1})),filesystem:Y.Optional(Y.Object({read:Y.Optional(Y.Array(Z)),write:Y.Optional(Y.Array(Z))},{additionalProperties:!1}))},{additionalProperties:!1}),CI=Y.Object({approval_id:PP,request_kind:gI,title:Z,summary:Z,reason:Y.Optional(Z),requested_at:X,expires_at:Y.Optional(X),task_id:Y.Optional(EP),activity_ref:Y.Optional(kP),command:Y.Optional(bI),file_change:Y.Optional(xI),permissions:Y.Optional(SI),decisions:Y.Array(yI,{minItems:1})},{additionalProperties:!1}),wI=Y.Union([Y.Literal(`accepted`),Y.Literal(`declined`),Y.Literal(`cancelled`),Y.Literal(`expired`)]),TI=Y.Object({decision_id:Z,label:Z,outcome:wI,decided_at:X,decided_by:Y.Optional(Y.Object({account_ref:Z,display_name:Z},{additionalProperties:!1}))},{additionalProperties:!1}),EI=Y.Union([Y.Object({state:Y.Literal(`none`)},{additionalProperties:!1}),Y.Object({state:Y.Literal(`pending`),request:CI},{additionalProperties:!1}),Y.Object({state:Y.Literal(`resolved`),request:CI,resolution:TI},{additionalProperties:!1})]),DI=Y.Object({decision_id:Z},{additionalProperties:!1}),OI=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_approval`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`decision_unavailable`)},{additionalProperties:!1}),HP]),kI=Y.Object({approval:Y.Optional(EI)},{additionalProperties:!1});UP(DI),GP(OI,kI);var AI=Y.Union([Y.Object({ref_kind:Y.Literal(`project_doc`),path:Z},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`directory_readme`),path:Z},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`task_detail`),task_id:EP},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`worklist`),module_id:Y.Optional(TP),task_id:Y.Optional(EP)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`scratchpad`),id:Y.Literal(`current`)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`clarification_round`),clarification_round_ref:NP},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`chat_messages`),message_refs:Y.Array(wP)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`repo_paths`),paths:Y.Array(Z)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`recovery_summary`),recovery_summary_id:OP},{additionalProperties:!1})]),jI=Y.Object({kind:Y.Literal(`freeform`),purpose:Y.Union([Y.Literal(`clarify_requirement`),Y.Literal(`confirm_risk`)]),prompt:Y.Object({title:Y.Optional(Z),summary:Z,request:Z},{additionalProperties:!1}),subject:Y.Optional(Y.Object({kind:Y.Union([Y.Literal(`task`),Y.Literal(`deployment_target`),Y.Literal(`project_context`)]),ref:Y.Optional(Z),summary:Z},{additionalProperties:!1})),expires_when:Y.Optional(Y.Union([Y.Literal(`current_run_only`),Y.Literal(`until_task_contract_changes`)]))},{additionalProperties:!1});Y.Object({summary:Z,request:Z,interaction:Y.Optional(jI)},{additionalProperties:!1});var MI=Y.Object({summary:Z,request:Z,interaction:Y.Optional(jI),title:Y.Optional(Z),related_refs:Y.Optional(Y.Array(AI))},{additionalProperties:!1}),NI=Y.Union([Y.Object({kind:Y.Literal(`task_compile`),workflow_ref:jP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task`),task_id:EP},{additionalProperties:!1})]),PI=Y.Object({id:MP,owner:NI,status:Y.Union([Y.Literal(`active`),Y.Literal(`closed`)]),current_round_id:Y.Optional(NP),created_from_activity_ref:Y.Optional(kP),closed_reason:Y.Optional(Y.Union([Y.Literal(`resolved`),Y.Literal(`contract_changed`),Y.Literal(`cancelled`)])),created_at:X,updated_at:X},{additionalProperties:!1}),FI=Y.Union([Y.Object({kind:Y.Literal(`next_round`),clarification_round_ref:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`run`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`chain_closed`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`proposal_applied`),workflow_ref:jP},{additionalProperties:!1})]),II=Y.Object({id:NP,thread_id:MP,round_index:Y.Integer({minimum:1}),status:Y.Union([Y.Literal(`writable`),Y.Literal(`sealed`)]),request_payload:MI,card_message_id:wP,opening_message_id:wP,submitted_at:Y.Optional(X),submitted_message_refs:Y.Optional(Y.Array(wP)),successor_status:Y.Union([Y.Literal(`not_materialized`),Y.Literal(`materialized`)]),successor_ref:Y.Optional(FI),capabilities:Y.Object({send_message:Y.Boolean(),submit:Y.Boolean()},{additionalProperties:!1}),created_at:X,updated_at:X},{additionalProperties:!1});Y.Union([Y.Object({state:Y.Literal(`none`)},{additionalProperties:!1}),Y.Object({state:Y.Literal(`active`),thread:PI,round:II},{additionalProperties:!1})]);var LI=Y.Object({id:NP,thread_id:MP,round_index:Y.Integer({minimum:1}),status:Y.Union([Y.Literal(`writable`),Y.Literal(`sealed`)]),title:Y.Optional(Z),summary:Z,submitted_at:Y.Optional(X),successor_status:Y.Union([Y.Literal(`not_materialized`),Y.Literal(`materialized`)]),created_at:X,updated_at:X},{additionalProperties:!1});Y.Object({thread:PI,rounds:Y.Array(LI)},{additionalProperties:!1}),Y.Object({thread:PI,round:II},{additionalProperties:!1}),Y.Object({limit:Y.Optional(Y.Integer({minimum:1,maximum:200,default:50})),anchor:Y.Optional(Y.Union([Y.Literal(`start`),Y.Literal(`latest`)])),before:Y.Optional(CP),after:Y.Optional(CP)},{additionalProperties:!1});var RI=Y.Object({body:Y.String({minLength:1,maxLength:8e3})},{additionalProperties:!1}),zI=Y.Union([Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_round`),current_round_id:Y.Optional(NP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`chain_closed`)},{additionalProperties:!1}),HP]),BI=Y.Object({message:Y.Optional(dI)},{additionalProperties:!1});UP(RI),GP(zI,BI);var VI=Y.Object({},{additionalProperties:!1}),HI=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_submitted`),successor_status:Y.Union([Y.Literal(`not_materialized`),Y.Literal(`materialized`)]),successor_ref:Y.Optional(FI)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_round`),current_round_id:Y.Optional(NP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`chain_closed`)},{additionalProperties:!1}),HP]),UI=Y.Object({round:Y.Optional(II),materialization:Y.Optional(Y.Object({status:Y.Union([Y.Literal(`queued`),Y.Literal(`already_materialized`)]),successor_ref:Y.Optional(FI)},{additionalProperties:!1}))},{additionalProperties:!1});UP(VI),GP(HI,UI),Y.Object({reason:Y.Union([Y.Literal(`round_opened`),Y.Literal(`round_message_created`),Y.Literal(`round_submitted`),Y.Literal(`successor_materialized`),Y.Literal(`chain_closed`),Y.Literal(`recovered`)]),thread_id:MP,round_id:Y.Optional(NP),successor_ref:Y.Optional(FI)},{additionalProperties:!1});var WI=Y.String(),GI=Y.Object({source:Y.Literal(`mainline`),branch:Y.Literal(`tutti/mainline`),head:Y.Optional(Y.Object({oid:Z,short_oid:Z},{additionalProperties:!1})),mainline_clean:Y.Boolean(),generated_at:X},{additionalProperties:!1}),KI=Y.Union([Y.Literal(`product`),Y.Literal(`tech`),Y.Literal(`structure`),Y.Literal(`architecture_principles`)]),qI=Y.Union([Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`binary`),Y.Literal(`unsupported_encoding`),Y.Literal(`too_large`)]),JI=Y.Object({doc_key:KI,path:WI,status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`),Y.Literal(`unreadable`)]),unreadable_reason:Y.Optional(qI),size_bytes:Y.Optional(Y.Integer({minimum:0})),blob_oid:Y.Optional(Z),last_commit:Y.Optional(Y.Object({oid:Z,short_oid:Z,committed_at:X,title:Y.Optional(Z)},{additionalProperties:!1}))},{additionalProperties:!1}),YI=Y.Union([Y.Literal(`directory`),Y.Literal(`symlink`),Y.Literal(`submodule`),Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`binary`),Y.Literal(`too_large`),Y.Literal(`unknown`)]),XI=Y.Object({path:WI,name:Y.String(),kind:Y.Union([Y.Literal(`directory`),Y.Literal(`file`),Y.Literal(`symlink`),Y.Literal(`submodule`)]),depth:Y.Integer({minimum:0}),parent_path:Y.Optional(WI),size_bytes:Y.Optional(Y.Integer({minimum:0})),blob_oid:Y.Optional(Z),extension:Y.Optional(Z),language_hint:Y.Optional(Z),has_children:Y.Optional(Y.Boolean()),project_doc_key:Y.Optional(KI),text_read:Y.Object({can_read:Y.Boolean(),blocked_reason:Y.Optional(YI)},{additionalProperties:!1})},{additionalProperties:!1}),ZI=Y.Union([Y.Object({kind:Y.Literal(`text`),encoding:Y.Literal(`utf-8`),text:Y.String(),truncated:Y.Boolean(),bytes_returned:Y.Integer({minimum:0}),total_bytes:Y.Integer({minimum:0}),line_count:Y.Optional(Y.Integer({minimum:0}))},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`omitted`),reason:Y.Union([Y.Literal(`binary`),Y.Literal(`unsupported_encoding`),Y.Literal(`too_large`)]),total_bytes:Y.Integer({minimum:0})},{additionalProperties:!1})]),QI=Y.Object({path:WI,name:Z,kind:Y.Literal(`file`),size_bytes:Y.Integer({minimum:0}),blob_oid:Y.Optional(Z),extension:Y.Optional(Z),language_hint:Y.Optional(Z),media_type:Y.Optional(Z)},{additionalProperties:!1});Y.Object({snapshot:GI,docs:Y.Array(JI)},{additionalProperties:!1}),Y.Object({doc_key:KI},{additionalProperties:!1}),Y.Object({max_bytes:Y.Optional(Y.Integer({minimum:1,maximum:1048576}))},{additionalProperties:!1}),Y.Object({snapshot:GI,doc:JI,content:ZI},{additionalProperties:!1}),Y.Object({path:Y.Optional(WI),depth:Y.Optional(Y.Integer({minimum:1,maximum:3})),limit:Y.Optional(Y.Integer({minimum:1,maximum:1e3})),cursor:Y.Optional(CP)},{additionalProperties:!1});var $I=Y.Object({next_cursor:Y.Optional(CP),has_more:Y.Boolean(),limit:Y.Integer({minimum:1,maximum:1e3})},{additionalProperties:!1});Y.Object({snapshot:GI,root:XI,items:Y.Array(XI),page:$I},{additionalProperties:!1}),Y.Object({path:WI,max_bytes:Y.Optional(Y.Integer({minimum:1,maximum:1048576}))},{additionalProperties:!1});var eL=Y.Union([Y.Literal(`thumbnail`),Y.Literal(`preview`),Y.Literal(`original`)]);Y.Object({path:WI,variant:eL,v:Z},{additionalProperties:!1}),Y.Object({snapshot:GI,file:QI,content:ZI},{additionalProperties:!1});var tL=Y.Object({path:Y.Literal(`docs/reference`),status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`)]),index_path:Y.Literal(`docs/reference/README.md`),files_path:Y.Literal(`docs/reference/files`),images_path:Y.Literal(`docs/reference/images`),tutti_path:Y.Literal(`docs/reference/tutti`),index_status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`),Y.Literal(`unreadable`)]),index_unreadable_reason:Y.Optional(qI)},{additionalProperties:!1}),nL=Y.Union([Y.Literal(`binary`),Y.Literal(`too_large`),Y.Literal(`unsupported_encoding`),Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`unknown`)]),rL=Y.Object({status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`),Y.Literal(`stale`),Y.Literal(`unavailable`)]),text:Y.Optional(Y.String()),generated_at:Y.Optional(X),source_blob_oid:Y.Optional(Z),unavailable_reason:Y.Optional(Y.String()),read_paths:Y.Optional(Y.Array(WI))},{additionalProperties:!1}),iL=Y.Object({path:WI,name:Z,source:Y.Union([Y.Literal(`human_upload`),Y.Literal(`tutti_output`)]),category:nI,size_bytes:Y.Integer({minimum:0}),media_type:Y.Optional(Z),extension:Y.Optional(Z),language_hint:Y.Optional(Z),blob_oid:Y.Optional(Z),text_read:Y.Object({can_read:Y.Boolean(),blocked_reason:Y.Optional(nL)},{additionalProperties:!1}),summary:Y.Optional(rL)},{additionalProperties:!1});Y.Object({include_index:Y.Optional(Y.Boolean()),limit:Y.Optional(Y.Integer({minimum:1,maximum:1e3})),cursor:Y.Optional(CP)},{additionalProperties:!1}),Y.Object({snapshot:GI,directory:tL,items:Y.Array(iL),page:$I},{additionalProperties:!1});var aL=Y.Object({...xF,note:Y.Optional(Y.String())},{additionalProperties:!1}),oL=Y.Union([Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),HP]),sL=Y.Object({file:iL,message:dI,index_path:Y.Literal(`docs/reference/README.md`)},{additionalProperties:!1});UP(aL),GP(oL,sL);var cL=Y.Object({paths:Y.Optional(Y.Array(WI))},{additionalProperties:!1}),lL=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`no_targets`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:Y.Union([Y.Literal(`provider_auth_invalid`),Y.Literal(`provider_quota_or_billing_required`),Y.Literal(`provider_rate_limited`),Y.Literal(`provider_model_unavailable`),Y.Literal(`provider_network_error`)]),retryable:Y.Boolean()},{additionalProperties:!1}),HP]),uL=Y.Object({activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),target_count:Y.Optional(Y.Integer({minimum:0}))},{additionalProperties:!1});UP(cL),GP(lL,uL);var dL=Y.Union([Y.Literal(`static`),Y.Literal(`server`)]),fL=Y.String({minLength:1,maxLength:120,pattern:`\\S`}),pL=Y.String({minLength:1}),mL=Y.Object({title:fL,kind:Y.Literal(`static`),root:pL,entry:pL,network:Y.Boolean()},{additionalProperties:!1}),hL=Y.Object({title:fL,kind:Y.Literal(`server`),cwd:pL,entry:Y.String({minLength:1,maxLength:256,pattern:`^/`}),network:Y.Boolean()},{additionalProperties:!1});Y.Object({version:Y.Literal(1),artifact:Y.Union([mL,hL])},{additionalProperties:!1});var gL=Y.Union([Y.Literal(`ready`),Y.Literal(`starting`),Y.Literal(`idle`),Y.Literal(`failed`)]),_L=Y.Object({title:fL,kind:dL,network:Y.Boolean()},{additionalProperties:!1}),vL=Y.Object({status:gL,url:Y.Optional(Y.String({minLength:1})),error_message:Y.Optional(Z)},{additionalProperties:!1}),yL=Y.Union([Y.Object({status:Y.Literal(`not_declared`)},{additionalProperties:!1}),Y.Object({status:Y.Literal(`invalid`),error:Y.Object({code:Z,message:Z},{additionalProperties:!1})},{additionalProperties:!1}),Y.Object({status:Y.Literal(`declared`),preview_generation:Z,artifact:_L,preview:vL},{additionalProperties:!1})]);Y.Object({artifact:yL},{additionalProperties:!1});var bL=Y.Object({},{additionalProperties:!1}),xL=Y.Union([Y.Object({kind:Y.Literal(`issued`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`not_declared`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`invalid_manifest`),message:Z},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`preview_not_ready`),status:Y.Union([Y.Literal(`starting`),Y.Literal(`idle`),Y.Literal(`failed`)]),message:Y.Optional(Z)},{additionalProperties:!1}),HP]),SL=Y.Object({bootstrap_url:Y.String({minLength:1}),expires_at:X},{additionalProperties:!1});UP(bL),GP(xL,SL);var CL=Y.String({minLength:1,maxLength:96,pattern:`^[a-z0-9_-]+$`}),wL=Y.Object({name:CL,description:Z,short_description:Y.Optional(Z),enabled:Y.Boolean(),source:Y.Literal(`user`),updated_at:Y.Optional(X)},{additionalProperties:!1}),TL=Y.Object({name:CL,description:Z,short_description:Y.Optional(Z),enabled:Y.Boolean(),source:Y.Literal(`user`),updated_at:Y.Optional(X),skill_md:Y.String({minLength:1})},{additionalProperties:!1});Y.Object({items:Y.Array(wL)},{additionalProperties:!1}),Y.Object({skill_name:CL},{additionalProperties:!1}),Y.Object({skill:TL},{additionalProperties:!1});var EL=Y.Object(SF,{additionalProperties:!1}),DL=Y.Union([Y.Object({kind:Y.Literal(`created`),skill_name:CL},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`replaced`),skill_name:CL},{additionalProperties:!1}),HP]),OL=Y.Object({skill:TL},{additionalProperties:!1});UP(EL),GP(DL,OL);var kL=Y.Object({skill_name:CL},{additionalProperties:!1}),AL=Y.Union([Y.Object({kind:Y.Literal(`deleted`),skill_name:CL},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`not_found`),skill_name:CL},{additionalProperties:!1}),HP]);UP(kL),WP(AL);var jL=Y.Union([Y.Literal(`idle`),Y.Literal(`running`),Y.Literal(`pending`),Y.Literal(`failed`)]),ML=Y.Union([Y.Literal(`foreground`),Y.Literal(`scratchpad_background`)]),NL=Y.Object({activity_ref:kP,activity_kind:Y.Union([Y.Literal(`run`),Y.Literal(`procedure`)]),workflow_ref:Y.Optional(jP),workflow_kind:Y.Optional(RP),lane:Y.Optional(ML),started_at:Y.Optional(X)},{additionalProperties:!1}),PL=Y.Union([Y.Literal(`reading_context`),Y.Literal(`planning`),Y.Literal(`editing_files`),Y.Literal(`running_command`),Y.Literal(`using_tool`),Y.Literal(`waiting_for_approval`),Y.Literal(`finalizing`)]),FL=Y.Object({input_tokens:Y.Optional(Y.Integer({minimum:0})),cached_input_tokens:Y.Optional(Y.Integer({minimum:0})),output_tokens:Y.Optional(Y.Integer({minimum:0})),reasoning_output_tokens:Y.Optional(Y.Integer({minimum:0})),total_tokens:Y.Integer({minimum:0})},{additionalProperties:!1}),IL=Y.Object({activity_ref:kP,stage_id:Y.Optional(Y.String()),started_at:Y.Optional(X),updated_at:Y.Optional(X),token_usage:Y.Optional(FL),current_action:Y.Optional(PL)},{additionalProperties:!1}),LL=Y.Object({status:jL,summary:Y.String(),active_task:Y.Optional(WF),active_activity:Y.Optional(NL),active_activities:Y.Optional(Y.Array(NL)),runtime:Y.Optional(IL),blocked_by:Y.Optional(Y.Union([Y.Object({kind:Y.Literal(`clarification`),thread_id:MP,round_id:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`approval`),approval_id:PP},{additionalProperties:!1})])),last_conclusion:Y.Optional(Y.Object({kind:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`),Y.Literal(`needs_human`),Y.Literal(`recovered`)]),summary:Y.String(),task_id:Y.Optional(EP),activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),occurred_at:X},{additionalProperties:!1})),updated_at:X},{additionalProperties:!1}),RL=Y.Object({activity_ref:kP,activity_kind:Y.Union([Y.Literal(`run`),Y.Literal(`procedure`)]),status:Y.Union([Y.Literal(`running`),Y.Literal(`needs_human`),Y.Literal(`finished`),Y.Literal(`failed`),Y.Literal(`interrupted`)]),title:Z,summary:Y.String(),task_id:Y.Optional(EP),workflow_ref:Y.Optional(jP),workflow_kind:Y.Optional(RP),lane:Y.Optional(ML),run_lineage:Y.Optional(LF),started_at:Y.Optional(X),ended_at:Y.Optional(X),latest_event_ref:Y.Optional(AP),result_anchor:Y.Optional(RF)},{additionalProperties:!1}),zL=Y.Object({event_ref:AP,activity_ref:kP,event_kind:Y.Union([Y.Literal(`started`),Y.Literal(`progress`),Y.Literal(`needs_human`),Y.Literal(`artifact_snapshot`),Y.Literal(`finished`),Y.Literal(`failed`)]),occurred_at:X,summary:Y.String(),payload:Y.Optional(Y.Object({progress:Y.Optional(Y.Object({message:Y.String(),phase:Y.Optional(Y.String())},{additionalProperties:!1})),artifact:Y.Optional(Y.Object({artifact_kind:Y.Union([Y.Literal(`scratchpad_snapshot`),Y.Literal(`task_compile_proposal`),Y.Literal(`context_sync_findings`),Y.Literal(`recovery_summary`),Y.Literal(`run_changed_paths`)]),summary:Y.String()},{additionalProperties:!1})),terminal:Y.Optional(Y.Object({result_kind:Y.Union([Y.Literal(`needs_human`),Y.Literal(`finished`),Y.Literal(`failed`)]),summary:Y.String()},{additionalProperties:!1}))},{additionalProperties:!1}))},{additionalProperties:!1});Y.Object({server_time:X,current_event_cursor:Z,replay:Y.Object({requested_cursor:Y.Optional(Z),status:Y.Union([Y.Literal(`not_requested`),Y.Literal(`replayed`),Y.Literal(`missed`)]),replayed_event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),retry_after_ms:Y.Integer({minimum:0}),replay_window:qP},{additionalProperties:!1}),Y.Object({reason:Y.Union([Y.Literal(`replay_missed`),Y.Literal(`bulk_state_change`),Y.Literal(`workspace_recovered`),Y.Literal(`viewer_changed`)]),message:Y.Optional(Y.String())},{additionalProperties:!1}),Y.Object({execution_status:LL},{additionalProperties:!1}),Y.Object({approval:EI},{additionalProperties:!1}),Y.Object({activity:RL,event:zL},{additionalProperties:!1}),Y.Object({reason:Y.Union([Y.Literal(`task_compile_applied`),Y.Literal(`task_state_changed`),Y.Literal(`task_result_recorded`),Y.Literal(`workspace_recovered`)]),workflow_ref:Y.Optional(jP),activity_ref:Y.Optional(kP),changed_module_ids:Y.Optional(Y.Array(TP)),changed_task_ids:Y.Optional(Y.Array(EP))},{additionalProperties:!1}),Y.Object({task:WF},{additionalProperties:!1}),Y.Object({task_id:EP,task:Y.Optional(WF),detail:Y.Optional(YF),latest_run_result_id:Y.Optional(DP)},{additionalProperties:!1}),Y.Object({scratchpad:HF,activity_ref:Y.Optional(kP)},{additionalProperties:!1}),Y.Object({provider_config:XP},{additionalProperties:!1}),Y.Object({recovery_summary_id:OP,summary:Y.String(),affected_activities:Y.Array(kP),replayed_round_ids:Y.Optional(Y.Array(NP))},{additionalProperties:!1}),Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`no_source_messages`)},{additionalProperties:!1}),HP]),Y.Object({activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),scratchpad:Y.Optional(HF)},{additionalProperties:!1});var BL=Y.Object({expected_scratchpad_updated_at:Y.Optional(X)},{additionalProperties:!1}),VL=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`scratchpad_empty`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_scratchpad`),current_scratchpad:HF},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),HP]),HL=Y.Object({activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP)},{additionalProperties:!1});UP(BL),GP(VL,HL);var UL=Y.Object({scope:Y.Optional(Y.Object({kind:Y.Literal(`worklist`)},{additionalProperties:!1}))},{additionalProperties:!1}),WL=Y.Union([Y.Object({kind:Y.Literal(`scheduled`),task_id:EP,activity_ref:kP,queued_task_ids:Y.Array(EP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP,activity_kind:Y.Union([Y.Literal(`run`),Y.Literal(`procedure`)])},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`blocked_by_clarification`),thread_id:MP,round_id:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`nothing_to_run`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`mainline_not_clean`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),HP]);UP(UL),WP(WL);var GL=Y.Object({display_name:Y.String({minLength:1,maxLength:80})},{additionalProperties:!1}),KL=Y.Union([Y.Object({kind:Y.Literal(`updated`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`unchanged`)},{additionalProperties:!1}),HP]),qL=Y.Object({project:Y.Object({display_name:Y.String({minLength:1,maxLength:80})},{additionalProperties:!1})},{additionalProperties:!1});UP(GL),GP(KL,qL);var JL=Y.Object({description:Y.String({maxLength:160})},{additionalProperties:!1}),YL=Y.Union([Y.Object({kind:Y.Literal(`updated`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`unchanged`)},{additionalProperties:!1}),HP]),XL=Y.Object({project:Y.Object({description:Y.String({maxLength:160})},{additionalProperties:!1})},{additionalProperties:!1});UP(JL),GP(YL,XL);var ZL=Y.Object({},{additionalProperties:!1}),QL=Y.Union([Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_initialized`)},{additionalProperties:!1}),HP]),$L=Y.Object({activity_ref:kP,workflow_ref:jP},{additionalProperties:!1}),eR=Y.Object({docs:Y.Array(JI),created_paths:Y.Array(WI),commit_oid:Y.Optional(Z)},{additionalProperties:!1});UP(ZL),GP(QL,eR);var tR=Y.Object({},{additionalProperties:!1}),nR=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),HP]),rR=$L;UP(tR),GP(nR,rR);function iR(e){try{return decodeURIComponent(e)}catch{return e}}function aR(e){return Ut(iR(e))}function oR(e,t=``){if(/^\/$/u.test(e))return{kind:`home`};if(/^\/console\/?$/u.test(e))return{kind:`local_console`};if(/^\/setup\/?$/u.test(e))return{kind:`setup`};if(/^\/projects\/?$/u.test(e)){let e=new URLSearchParams(t).get(`open`);if(e!==null){let t=aR(e);if(t!==null)return{kind:`project_open`,relayProjectRef:t}}return{kind:`project_center`}}let n=/^\/join\/([^/]+)\/?$/u.exec(e);if(n?.[1]!==void 0)return{kind:`join`,joinToken:iR(n[1])};let r=/^\/projects\/([^/]+)\/workspace\/?$/u.exec(e);if(r?.[1]!==void 0){let e=aR(r[1]);return e===null?{kind:`project_center`}:{kind:`workspace`,relayProjectRef:e}}let i=/^\/projects\/([^/]+)\/references\/?$/u.exec(e);if(i?.[1]!==void 0){let e=aR(i[1]);return e===null?{kind:`project_center`}:{kind:`references`,relayProjectRef:e}}let a=/^\/projects\/([^/]+)\/artifacts\/?$/u.exec(e);if(a?.[1]!==void 0){let e=aR(a[1]);return e===null?{kind:`project_center`}:{kind:`artifacts`,relayProjectRef:e}}let o=/^\/projects\/([^/]+)\/worklist\/?$/u.exec(e);if(o?.[1]!==void 0){let e=aR(o[1]);return e===null?{kind:`project_center`}:{kind:`worklist`,relayProjectRef:e}}let s=/^\/projects\/([^/]+)\/skills\/?$/u.exec(e);if(s?.[1]!==void 0){let e=aR(s[1]);return e===null?{kind:`project_center`}:{kind:`skills`,relayProjectRef:e}}let c=/^\/projects\/([^/]+)\/timeline\/?$/u.exec(e);if(c?.[1]!==void 0){let e=aR(c[1]);return e===null?{kind:`project_center`}:{kind:`timeline`,relayProjectRef:e}}let l=/^\/projects\/([^/]+)\/settings\/?$/u.exec(e);if(l?.[1]!==void 0){let e=aR(l[1]);return e===null?{kind:`project_center`}:{kind:`settings`,relayProjectRef:e}}return{kind:`project_center`}}var sR={success:3e3,error:9e3,warning:6e3,info:4500},cR=5,lR=(0,N.createContext)(null);function uR(e){return e.persistent===!0||e.tone===`loading`?e.durationMs:e.durationMs??sR[e.tone]}function dR(e){return e.persistent??e.tone===`loading`}function fR(e){return e.dismissible??e.tone!==`loading`}function pR(e,t){let n=uR(t);return{id:e,tone:t.tone,title:t.title,persistent:dR(t),dismissible:fR(t),...t.message===void 0?{}:{message:t.message},...n===void 0?{}:{durationMs:n}}}function mR(e,t){let n=t.tone===void 0,r={tone:t.tone??e.tone,title:t.title??e.title,...t.message===void 0?e.message===void 0?{}:{message:e.message}:{message:t.message},...t.durationMs===void 0?!n||e.durationMs===void 0?{}:{durationMs:e.durationMs}:{durationMs:t.durationMs},...t.persistent===void 0?!n||e.persistent===void 0?{}:{persistent:e.persistent}:{persistent:t.persistent},...t.dismissible===void 0?!n||e.dismissible===void 0?{}:{dismissible:e.dismissible}:{dismissible:t.dismissible}};return pR(e.id,r)}function hR(e){return[e.id,e.tone,e.title,e.message??``,e.durationMs??``,e.persistent===!0?`persistent`:`timed`].join(`:`)}function gR({children:e}){let[t,n]=(0,N.useState)([]),r=(0,N.useRef)(new Map),i=(0,N.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),a=(0,N.useCallback)(e=>{let t=Gt(),r=pR(t,e);return n(e=>[...e,r].slice(-cR)),t},[]),o=(0,N.useCallback)((e,t)=>{if(e===void 0){a(t);return}n(n=>n.map(n=>n.id===e?mR(n,t):n))},[a]);(0,N.useEffect)(()=>{let e=new Set(t.map(e=>e.id));for(let[t,n]of r.current)e.has(t)||(window.clearTimeout(n.timeout),r.current.delete(t));for(let e of t){let t=r.current.get(e.id),n=hR(e);if(t!==void 0&&t.key!==n&&(window.clearTimeout(t.timeout),r.current.delete(e.id)),e.persistent===!0||e.durationMs===void 0||r.current.has(e.id))continue;let a=window.setTimeout(()=>i(e.id),e.durationMs);r.current.set(e.id,{key:n,timeout:a})}},[i,t]),(0,N.useEffect)(()=>()=>{for(let e of r.current.values())window.clearTimeout(e.timeout);r.current.clear()},[]);let s=(0,N.useMemo)(()=>({notify:a,update:o,dismiss:i}),[i,a,o]);return(0,P.jsxs)(lR.Provider,{value:s,children:[e,(0,P.jsx)(da,{notices:t,onDismiss:i})]})}function _R(){let e=(0,N.useContext)(lR);if(e===null)throw Error(`useNotify must be used inside NotificationProvider`);return e}var vR=`http://127.0.0.1:4370`;function yR(){return typeof window<`u`?window.location.origin:vR}function bR(){let e=`https://tutti.now`;return typeof e==`string`?e:yR()}var xR=bR(),SR={relayBaseUrl:xR},CR=3e4,Q={relayRoot:[`relay`],me:[`relay`,`me`],recentProjects:[`relay`,`projects`,`recent`],projectPresence:e=>[`relay`,`projects`,e,`presence`],relayJoinRoot:[`relay`,`join`],join:e=>[`relay`,`join`,e],bootstrap:e=>[`host`,e,`bootstrap`],hostRoot:e=>[`host`,e],hostSession:e=>[`host`,e,`session`],hostWorkspace:e=>[`host`,e,`workspace`],messages:e=>[`host`,e,`messages`,`main_chat`],messagesWindow:(e,t)=>[...Q.messages(e),{limit:t}],messagesAround:(e,t,n)=>[...Q.messages(e),{around:t,limit:n}],messageHistory:(e,t,n)=>[...Q.messages(e),{history:t,limit:n}],scratchpad:e=>[`host`,e,`scratchpad`],worklist:e=>[`host`,e,`worklist`],readState:e=>[`host`,e,`read-state`],activeClarification:e=>[`host`,e,`clarification`,`active`],activeApproval:e=>[`host`,e,`approval`,`active`],noActiveClarificationRoundMessages:e=>[`host`,e,`clarification-round-messages`,`none`],clarificationRoundMessages:(e,t)=>[`host`,e,`clarification-round-messages`,t],task:(e,t)=>[`host`,e,`task`,t],taskDetail:(e,t)=>[`host`,e,`task-detail`,t],taskRunResults:(e,t)=>[`host`,e,`task-run-results`,t],executionStatus:e=>[`host`,e,`execution-status`],providerConfig:e=>[`host`,e,`provider-config`],providerUsage:e=>[`host`,e,`provider-usage`],projectTimeline:e=>[`host`,e,`project-timeline`],viewerRoot:e=>[`host`,e,`viewer`],viewerFile:(e,t)=>[`host`,e,`viewer`,`file`,t],referenceFiles:e=>[`host`,e,`references`,`files`],artifacts:e=>[`host`,e,`artifacts`],artifactPreviewSession:(e,t)=>[`relay`,e,`artifact-preview-session`,t],skills:e=>[`host`,e,`skills`],skillDetail:(e,t)=>[`host`,e,`skills`,t]};function wR(){return`${window.location.pathname}${window.location.search}${window.location.hash}`}function $(e,t={}){t.replace===!0?window.history.replaceState(null,``,e):window.history.pushState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))}function TR(e){let t=new URL(e,window.location.origin);$(`${t.pathname}${t.search}${t.hash}`)}function ER(){let[e,t]=(0,N.useState)(wR);return(0,N.useEffect)(()=>{let e=()=>{t(wR())};return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e)}},[]),(0,N.useMemo)(()=>{let t=new URL(e,window.location.origin);return oR(t.pathname,t.search)},[e])}function DR(e){return e instanceof Error?e.message:`Request failed`}function OR(e){e.invalidateQueries({queryKey:Q.me}),e.invalidateQueries({queryKey:Q.recentProjects})}function kR(e,t){if(t!==void 0)for(let n of t)switch(n.kind){case`all`:e.invalidateQueries({queryKey:Q.relayRoot});break;case`me`:e.invalidateQueries({queryKey:Q.me});break;case`recent_projects`:e.invalidateQueries({queryKey:Q.recentProjects});break;case`join_entries`:e.invalidateQueries({queryKey:Q.relayJoinRoot});break;case`project_presence`:Vt(n.relay_project_ref,Lt.relayProject)&&e.invalidateQueries({queryKey:Q.projectPresence(n.relay_project_ref)});break}}function AR(e){let t=rt(),n=(0,N.useMemo)(()=>zn(SR),[]);(0,N.useEffect)(()=>{if(e)try{let e=n.connectEvents({onReady:e=>{e.payload.replay.status===`missed`&&t.invalidateQueries({queryKey:Q.relayRoot})},onInvalidate:e=>{kR(t,e)}});return()=>{e.close()}}catch{return}},[e,t,n])}function jR(e,t,n){if(n!==void 0)for(let r of n)switch(r.kind){case`all`:e.invalidateQueries({queryKey:Q.hostRoot(t)});break;case`workspace`:e.invalidateQueries({queryKey:Q.hostWorkspace(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`session`:e.invalidateQueries({queryKey:Q.hostSession(t)});break;case`bootstrap`:e.invalidateQueries({queryKey:Q.bootstrap(t)});break;case`messages`:r.scope===`main_chat`?e.invalidateQueries({queryKey:Q.messages(t)}):e.invalidateQueries({queryKey:Q.clarificationRoundMessages(t,r.round_id)});break;case`scratchpad`:e.invalidateQueries({queryKey:Q.scratchpad(t)});break;case`worklist`:e.invalidateQueries({queryKey:Q.worklist(t)});break;case`read_state`:e.invalidateQueries({queryKey:Q.readState(t)});break;case`task`:e.invalidateQueries({queryKey:Q.task(t,r.task_id)});break;case`task_detail`:e.invalidateQueries({queryKey:Q.taskDetail(t,r.task_id)});break;case`task_run_results`:e.invalidateQueries({queryKey:Q.taskRunResults(t,r.task_id)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`execution_status`:e.invalidateQueries({queryKey:Q.executionStatus(t)});break;case`approval`:e.invalidateQueries({queryKey:Q.activeApproval(t)});break;case`provider_config`:e.invalidateQueries({queryKey:Q.providerConfig(t)});break;case`provider_usage`:e.invalidateQueries({queryKey:Q.providerUsage(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`project_timeline`:e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`viewer`:e.invalidateQueries({queryKey:Q.viewerRoot(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)}),(r.path===void 0||r.path.startsWith(`docs/reference`))&&e.invalidateQueries({queryKey:Q.referenceFiles(t)}),r.path!==void 0&&e.invalidateQueries({queryKey:Q.viewerFile(t,r.path)});break;case`skills`:e.invalidateQueries({queryKey:Q.skills(t)});break;case`artifacts`:e.invalidateQueries({queryKey:Q.artifacts(t)});break;case`recovery_summaries`:e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`activity`:break;case`clarification`:e.invalidateQueries({queryKey:Q.activeClarification(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)}),r.round_id!==void 0&&e.invalidateQueries({queryKey:Q.clarificationRoundMessages(t,r.round_id)});break}}function MR(){return{items:[],window:{has_older:!1,has_newer:!1,limit:50}}}function NR(){return{modules:[]}}function PR(){return{id:`current`,state:`empty`,topic:``,background_summary:``,current_consensus:[],open_questions:[],task_changes:[],receipts:[]}}function FR(e){return{chat:e?.scopes.chat.has_unread===!0,worklist:e?.scopes.worklist.has_unread===!0,references:e?.scopes.references.has_unread===!0,skills:e?.scopes.skills.has_unread===!0}}function IR(e){return e?.artifact.status===`declared`?{available:!0}:{available:!1}}function LR({enabled:e,hostClient:t,relayProjectRef:n,readState:r,scope:i}){let a=rt(),o=(0,N.useRef)(null),s=yt({mutationFn:e=>t.markRead({scope:i,up_to_event_cursor:e}),onSuccess:e=>{jR(a,n,e.invalidates)},onError:()=>{o.current=null}});(0,N.useEffect)(()=>{if(!e||r===void 0)return;let t=r.scopes[i];if(!t.has_unread){t.read_event_cursor>=t.latest_event_cursor&&(o.current=null);return}let n=`${i}:${t.latest_event_cursor}`;o.current===n||s.isPending||(o.current=n,s.mutate(t.latest_event_cursor))},[e,s,r,i])}function RR(){return{state:`none`}}function zR(e){return{status:`idle`,summary:`Idle`,updated_at:e}}function BR(e){return e.active_activities??(e.active_activity===void 0?[]:[e.active_activity])}function VR(e,t,n){return BR(e).some(e=>e.workflow_kind===t?n===void 0||(e.lane??`foreground`)===n:!1)}function HR(e,t){let n=`/projects/${encodeURIComponent(Ht(e))}/references`;return t===void 0?n:`${n}?path=${encodeURIComponent(t)}`}function UR(e){return`/projects/${encodeURIComponent(Ht(e))}/artifacts`}function WR(e,t){let n=`/projects/${encodeURIComponent(Ht(e))}/worklist`;return t===void 0?n:`${n}?task=${encodeURIComponent(t)}`}function GR(e,t){return`${rn(e)}?message=${encodeURIComponent(t)}`}function KR(e){return`/projects/${encodeURIComponent(Ht(e))}/settings`}function qR(e){return`/projects/${encodeURIComponent(Ht(e))}/timeline`}function JR(e,t){let n=`/projects/${encodeURIComponent(Ht(e))}/skills`;return t===void 0?n:`${n}?skill=${encodeURIComponent(t)}`}function YR(e,t){switch(t.target.kind){case`approval`:case`clarification`:case`scratchpad`:return rn(e);case`worklist`:return WR(e);case`references`:return HR(e);case`task`:return WR(e,t.target.taskId)}}function XR(e,t){$(YR(e,t))}function ZR(e,t){let n=Fr(e);if(t!==void 0&&n.some(e=>e.id===t))return t;for(let e of[`running`,`pending`,`failed`,`todo`,`done`]){let t=n.find(t=>t.status===e);if(t!==void 0)return t.id}}function QR(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $R(e){switch(e){case`binary`:return`Binary file`;case`too_large`:return`File too large`;case`unsupported_encoding`:return`Unsupported encoding`;case`restricted_path`:case`secret_like`:return`Restricted file`;default:return`Preview unavailable`}}function ez(e){if(!(e===void 0||e.kind===`text`))return $R(e.reason)}function tz(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function nz(e){if(globalThis.crypto?.subtle===void 0)throw Error(`This browser does not support file upload hashing.`);return`sha256:${tz(await globalThis.crypto.subtle.digest(`SHA-256`,await e.arrayBuffer()))}`}async function rz(e){if(e.file.size<=0)throw Error(`Upload file cannot be empty.`);let t=yF(e.purpose);if(e.file.size>t)throw Error(`Upload file cannot exceed ${QR(t)}.`);let n=await nz(e.file),r=e.file.type===``?void 0:e.file.type,i=zn(SR),a=e.purpose===`skill_zip`?{relay_project_ref:e.relayProjectRef,purpose:`skill_zip`,file_name:e.file.name,size_bytes:e.file.size,sha256:n,...r===void 0?{}:{media_type:r}}:{relay_project_ref:e.relayProjectRef,purpose:`reference_file`,file_name:e.file.name,size_bytes:e.file.size,sha256:n,...r===void 0?{}:{media_type:r}},o=await i.startUpload(a);if(o.result===void 0)throw Error(`Upload session could not be started.`);let s=new Headers(o.result.put.headers??{});r!==void 0&&!s.has(`content-type`)&&s.set(`content-type`,r);let c;try{c=await fetch(o.result.put.url,{method:o.result.put.method,headers:s,body:e.file})}catch{throw Error(`File upload failed while sending the file to upload storage. Check that R2 CORS allows PUT from this Web origin.`)}if(!c.ok)throw Error(`File upload failed while sending the file to upload storage (${c.status}).`);return{upload_id:o.result.upload.upload_id,file_name:o.result.upload.file_name,size_bytes:o.result.upload.size_bytes,sha256:o.result.upload.sha256,...o.result.upload.media_type===void 0?{}:{media_type:o.result.upload.media_type}}}function iz(e){let t=rt(),n=_R(),[r,i]=(0,N.useState)(`identity`),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)({email:``,displayName:``,code:``}),l=yt({mutationFn:async()=>{let e=s.email.trim(),t=await Vn(SR,{email:e});if(t.result===void 0)throw Error(`Login challenge was not returned`);return{challenge:t.result.challenge,disposition:t.disposition,email:e}},onSuccess:({challenge:e,disposition:t,email:r})=>{o(e),c(e=>({...e,code:``})),i(`code`),n.notify({tone:`success`,title:t.kind===`otp_already_pending`?`Verification email already sent`:`Verification email sent`,message:t.kind===`otp_already_pending`?`Verification email already sent to ${r}.`:`Verification email sent to ${r}.`})}}),u=yt({mutationFn:async()=>{if(a===null)throw Error(`Login challenge is missing`);let e=await Hn(SR,{challenge_ref:a.challenge_ref,code:s.code.trim()});if(e.result===void 0)throw Error(`Login response was not returned`);return e.result},onSuccess:n=>{if(!n.account.profile_complete){t.invalidateQueries({queryKey:Q.me}),c(e=>({...e,displayName:``})),i(`profile`);return}OR(t),e?.()}}),d=yt({mutationFn:async()=>{let e=await Un(SR,{display_name:s.displayName.trim()});if(e.result===void 0)throw Error(`Profile response was not returned`);return e.result.account},onSuccess:()=>{OR(t),e?.()}}),f=e=>{if(e.preventDefault(),r===`identity`&&s.email.trim()!==``){l.mutate();return}if(r===`code`&&a!==null&&s.code.trim()!==``){u.mutate();return}r===`profile`&&s.displayName.trim()!==``&&d.mutate()},p=l.isPending||u.isPending||d.isPending,m=r===`identity`?l.error:r===`code`?u.error??l.error:d.error;return{phase:r,form:s,pending:p,submitDisabled:r===`identity`?s.email.trim()===``:r===`code`?a===null||s.code.replace(/\s+/gu,``).length!==6:s.displayName.trim()===``,challengeEmailHint:a?.email_hint??null,error:m===null?null:DR(m),onChange:e=>{c(t=>({...t,...e,...e.code===void 0?{}:{code:e.code.replace(/\D/gu,``).slice(0,6)}}))},onSubmit:f,onBack:()=>{l.reset(),u.reset(),d.reset(),o(null),c(e=>({...e,code:``})),i(`identity`)}}}function az(e){let t=rt(),[n,r]=(0,N.useState)({email:``,displayName:``,code:``}),i=yt({mutationFn:async()=>{let e=await Un(SR,{display_name:n.displayName.trim()});if(e.result===void 0)throw Error(`Profile response was not returned`);return e.result.account},onSuccess:()=>{OR(t),e?.()}});return{phase:`profile`,form:n,pending:i.isPending,submitDisabled:n.displayName.trim()===``,challengeEmailHint:null,error:i.error===null?null:DR(i.error),onChange:e=>{r(t=>({...t,...e,...e.code===void 0?{}:{code:e.code.replace(/\D/gu,``).slice(0,6)}}))},onSubmit:e=>{e.preventDefault(),n.displayName.trim()!==``&&i.mutate()}}}var oz=`tutti.workspace-onboarding.v1`,sz={version:1,start_chat_pending:!1,tour_pending:!1};function cz(){try{return typeof window>`u`?null:window.sessionStorage}catch{return null}}function lz(e){return e.storage===void 0?cz():e.storage}function uz(e,t){return`${oz}:${e}:${t}`}function dz(e){if(typeof e!=`object`||!e)return null;let t=e;return t.version===1&&typeof t.start_chat_pending==`boolean`&&typeof t.tour_pending==`boolean`?{version:1,start_chat_pending:t.start_chat_pending,tour_pending:t.tour_pending}:null}function fz(e,t,n){if(e!==null)try{if(!n.start_chat_pending&&!n.tour_pending){e.removeItem(t);return}e.setItem(t,JSON.stringify(n))}catch{}}function pz(e,t,n={}){let r=lz(n);if(r===null)return{...sz};try{let n=r.getItem(uz(e,t));return n===null?{...sz}:dz(JSON.parse(n))??{...sz}}catch{return{...sz}}}function mz(e,t,n={}){fz(lz(n),uz(e,t),{version:1,start_chat_pending:!0,tour_pending:!0})}function hz(e,t,n,r){let i=lz(r),a=pz(e,t,{storage:i});a[n]&&fz(i,uz(e,t),{...a,[n]:!1})}function gz(e,t,n={}){hz(e,t,`start_chat_pending`,n)}function _z(e,t,n={}){hz(e,t,`tour_pending`,n)}function vz({joinToken:e}){let t=rt(),n=F({queryKey:Q.join(e),queryFn:()=>Gn(SR,e)}),r=iz(()=>{n.refetch()}),i=az(()=>{n.refetch()}),a=yt({mutationFn:()=>Kn(SR,e),onSuccess:n=>{OR(t),t.invalidateQueries({queryKey:Q.join(e)}),n.disposition.kind===`joined`&&n.result!==void 0&&mz(n.result.account.account_ref,n.result.relay_project.relay_project_ref),n.result?.relay_project.host_status===`online`&&$(rn(n.result.relay_project.relay_project_ref))}}),o=yt({mutationFn:e=>Jn(SR,e),onSuccess:e=>{OR(t),e.disposition.kind===`opened`&&e.result?.open_url!==void 0&&TR(e.result.open_url)}}),s=n.data;AR(s?.account!==void 0);let c=s?.relay_project?.display_name??`Project`,l=s?.relay_project?.host_status??`unknown`,u=s?.account?.profile_complete===!1,d=u?`login_required`:n.isLoading?`loading`:n.error===null?s?.next.kind??`invalid_or_expired`:`error`;return(0,P.jsx)(nC,{projectName:c,description:d===`invalid_or_expired`?`This invite can no longer be used.`:`You have been invited to join ${c}.`,hostLabel:rr(l),hostOnline:l===`online`,nextKind:d,accountLabel:s?.account?.display_name??null,membershipLabel:s?.membership?.label??null,actionPending:a.isPending||o.isPending,error:n.error===null?a.error===null?o.error===null?null:DR(o.error):DR(a.error):DR(n.error),onBrandClick:()=>$(`/`),onRetry:()=>void n.refetch(),onAccept:()=>a.mutate(),onOpen:()=>{s?.next.kind===`open_workspace`&&o.mutate(s.next.relay_project_ref)},...d===`login_required`?{loginForm:u?i:r}:{}})}function yz(){$(`/projects`,{replace:!0})}function bz(){let e=F({queryKey:Q.me,queryFn:()=>Bn(SR)}),t=iz(yz);return(0,N.useEffect)(()=>{e.data!==void 0&&yz()},[e.data]),e.isLoading||e.data!==void 0?null:(0,P.jsx)(uC,{...t,onBrandClick:()=>$(`/`),sessionError:e.error===null||Qt(e.error)?null:`Tutti could not check your current session. You can still try signing in.`})}function xz(e){let t=e.trim().replace(/[\\/]+$/u,``);return t===``?``:t.slice(Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`))+1)}function Sz(e=``){return{workspacePath:e,displayName:xz(e),description:``,baseUrl:``,apiKey:``,model:``}}function Cz(e,t,n){return{...e,workspacePath:t,...n?{}:{displayName:xz(t)}}}function wz(e){switch(e){case`console_busy`:return`Wait for the current Local Console action to finish.`;case`host_busy`:return`Wait for active project work or questions to finish.`;case`host_identity_unverified`:return`Stop or reopen the affected project before updating.`;case`update_in_progress`:return`Another Tutti update is already in progress.`;case`update_recovery_required`:return`Run tutti again after closing this page to recover the interrupted update.`;case`global_prefix_read_only`:return`Use your normal terminal installation environment to update Tutti.`;case`npm_install_failed`:return`The npm installation failed. Refresh to check whether it can be retried.`;case`post_install_validation_failed`:return`The installed package could not be verified. Run tutti again to recover.`;case`completion_start_failed`:case`completion_failed`:case`worker_crashed`:return`The update was interrupted. Run tutti again to recover.`;case`host_restore_failed`:return`Tutti updated, but one or more local projects could not restart.`;case`installation_not_global`:case`custom_home`:case`npm_unavailable`:case`npm_global_root_mismatch`:case`npm_version_unsupported`:case`registry_unavailable`:case void 0:return`Tutti cannot update from this Local Console.`}}function Tz(e){if(e.status!==`updating`)return e.status===`blocked`||e.status===`failed`?wz(e.reason_code):void 0;switch(e.phase){case`stopping_hosts`:return`Safely stopping online projects.`;case`installing`:return`Installing the new Tutti version.`;case`restarting`:return`Restarting local projects.`;case`preparing`:case void 0:return`Preparing the update.`}}function Ez(e){let t=e.update;if(t===null||t.status===`up_to_date`||t.latest_version===void 0&&t.status!==`updating`&&t.status!==`failed`)return;let n=e.checking&&t.status===`ready`?`Checking update readiness.`:Tz(t);return{label:t.status===`updating`?`Updating…`:`Restart and Update`,disabled:t.status!==`ready`||!t.can_update||e.checking||e.starting,...n===void 0?{}:{description:n}}}function Dz(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length===0?t:n}function Oz({inviterName:e,projectName:t,joinUrl:n}){return`${Dz(e,`A teammate`)} invited you to join the Tutti project “${Dz(t,`Untitled project`)}”.\n\nOpen the invitation link:\n${n.trim()}`}var kz=Sz();function Az(){let e=window.location.hash.startsWith(`#`)?window.location.hash.slice(1):window.location.hash;return new URLSearchParams(e).get(`access_token`)}function jz(){window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}`)}function Mz(e){return window.open(e,`_blank`,`noopener,noreferrer`)}function Nz(){let e=window.open(`about:blank`,`_blank`);return e!==null&&(e.opener=null),e}function Pz(){let e=_R(),t=(0,N.useRef)(void 0),n=(0,N.useRef)(void 0),r=(0,N.useRef)(!1),i=(0,N.useRef)(null),a=(0,N.useRef)(!1),o=(0,N.useRef)(null),s=(0,N.useRef)(!1),c=(0,N.useMemo)(()=>Fn({baseUrl:window.location.origin,csrfToken:()=>t.current,contextToken:()=>n.current}),[]),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(null),[p,m]=(0,N.useState)(kz),h=(0,N.useRef)(!1),g=(0,N.useRef)({baseUrl:``,apiKey:``}),[_,v]=(0,N.useState)([]),[y,b]=(0,N.useState)(!1),[x,S]=(0,N.useState)(`folder`),[C,w]=(0,N.useState)([]),[T,E]=(0,N.useState)(!0),[ee,D]=(0,N.useState)(!1),[O,k]=(0,N.useState)(!1),[te,ne]=(0,N.useState)(null),[A,re]=(0,N.useState)(null),[ie,j]=(0,N.useState)(!1),[M,ae]=(0,N.useState)(!1);async function oe(){if(t.current!==void 0){E(!0);try{w((await c.getProjects()).projects)}catch(t){e.notify({tone:`error`,title:`Projects unavailable`,message:DR(t)})}finally{E(!1)}}}async function se(e={}){i.current?.abort();let t=new AbortController;i.current=t,j(!0);try{re(await c.getPackageUpdate({refresh:e.refresh===!0,signal:t.signal}))}catch{}finally{i.current===t&&(i.current=null,j(!1))}}(0,N.useEffect)(()=>{r.current||(r.current=!0,(async()=>{try{let e=Az();if(e!==null&&e.trim()!==``){jz();let r=await c.exchangeSession(e);t.current=r.csrf_token,n.current=r.context_token}let r=await c.getBootstrap();t.current=r.csrf_token,u(r),f(null),await Promise.all([oe(),se()])}catch(e){E(!1),f(DR(e))}})())},[c]),(0,N.useEffect)(()=>()=>{i.current?.abort()},[]),(0,N.useEffect)(()=>{if(l===null)return;let e=window.setInterval(()=>{c.heartbeat().catch(()=>void 0)},6e4);return()=>window.clearInterval(e)},[l,c]),(0,N.useEffect)(()=>{if(l===null||A?.latest_version===void 0||A.status===`up_to_date`||A.status===`failed`)return;let e=window.setInterval(()=>void se(),A.status===`updating`?2e3:15e3);return()=>window.clearInterval(e)},[l,A?.latest_version,A?.status]),(0,N.useEffect)(()=>{let t=l?.package_update_completion;t===void 0||s.current||(s.current=!0,e.notify(t.restart_failure_count===0?{tone:`success`,title:`Tutti updated to ${t.target_version}`}:{tone:`warning`,title:`Tutti updated to ${t.target_version}`,message:`${t.restart_failure_count} local project${t.restart_failure_count===1?``:`s`} could not restart.`}))},[l,e]),(0,N.useEffect)(()=>{if(A?.status!==`failed`)return;let t=A.reason_code??`update_failed`;o.current!==t&&(o.current=t,e.notify({tone:`error`,title:`Tutti update did not complete`,message:wz(A.reason_code)}))},[e,A]);async function ce(){try{let t=await c.pickFolder();t.kind===`selected`?ge({workspacePath:t.path}):t.kind===`unavailable`&&e.notify({tone:`info`,title:`Use a folder path`,message:t.message})}catch(t){e.notify({tone:`error`,title:`Folder picker unavailable`,message:DR(t)})}}async function le(){let t={baseUrl:p.baseUrl.trim(),apiKey:p.apiKey.trim()},n=()=>g.current.baseUrl.trim()===t.baseUrl&&g.current.apiKey.trim()===t.apiKey;D(!0);try{let r=await c.discoverModels({base_url:t.baseUrl,api_key:t.apiKey});if(!n())return;r.kind===`ok`?(v(r.models),m(e=>({...e,model:``})),S(`model`)):(v([]),e.notify({tone:`error`,title:`Provider check failed`,message:r.reason===`model_list_empty`?`The endpoint did not return any available models.`:`Check the Base URL and API key, then try again.`}))}catch(t){if(!n())return;v([]),e.notify({tone:`error`,title:`Provider check failed`,message:DR(t)})}finally{D(!1)}}async function ue(){k(!0);try{let e=await c.launchProject({workspace_path:p.workspacePath.trim(),project:{display_name:p.displayName.trim(),...p.description.trim()===``?{}:{description:p.description.trim()}},provider:{base_url:p.baseUrl.trim(),api_key:p.apiKey.trim(),model:p.model.trim()}});_e(),window.location.assign(e.join_url)}catch(t){e.notify({tone:`error`,title:`Launch failed`,message:DR(t)})}finally{k(!1)}}async function de(t){ne(t.project_id);try{await c.launchProject({workspace_path:t.workspace_path}),await oe(),e.notify({tone:`success`,title:`${t.display_name} is ready`})}catch(t){let n=t instanceof Jt&&t.code===`provider_configuration_required`;e.notify({tone:n?`warning`:`error`,title:n?`Provider required`:`Launch failed`,message:n?`Use New project with this folder to update its Provider configuration.`:DR(t)})}finally{ne(null)}}async function fe(t){ne(t.project_id);try{let n=await c.refreshInvite(t.project_id);await navigator.clipboard.writeText(Oz({inviterName:``,projectName:t.display_name,joinUrl:n.join_url})),w(e=>e.map(e=>e.project_id===t.project_id?{...e,join_url:n.join_url}:e)),e.notify({tone:`success`,title:`Invitation copied`})}catch(t){e.notify({tone:`error`,title:`Invite unavailable`,message:DR(t)})}finally{ne(null)}}async function pe(t){if(t.open_url===void 0)return;if(t.update_required!==!0){Mz(t.open_url);return}let n=Nz();ne(t.project_id);try{let r=await c.openProject(t.project_id);w(e=>e.map(e=>e.project_id===r.project.project_id?r.project:e)),n===null?window.location.assign(r.open_url):n.location.replace(r.open_url),r.disposition===`updated`?e.notify({tone:`success`,title:`${t.display_name} updated`}):r.disposition===`deferred_busy`?e.notify({tone:`info`,title:`Opened without updating`,message:`Try Open again after the current project activity finishes.`}):r.disposition===`deferred_unsupported`?e.notify({tone:`info`,title:`Opened with the current Host`,message:`Stop and Resume this project once to enable safe automatic updates.`}):r.disposition===`deferred_unavailable`&&e.notify({tone:`warning`,title:`Update deferred`,message:`The current Host could not be safely restarted, so the project opened as-is.`})}catch(t){n?.close(),e.notify({tone:`error`,title:`Open failed`,message:DR(t)})}finally{ne(null)}}async function me(t){ne(t.project_id);try{await c.stopProject(t.project_id),await Promise.all([oe(),se()]),e.notify({tone:`success`,title:`${t.display_name} stopped`})}catch(t){e.notify({tone:`error`,title:`Stop failed`,message:DR(t)})}finally{ne(null)}}async function he(){if(!(a.current||A?.status!==`ready`||!A.can_update)){a.current=!0,ae(!0);try{re(await c.startPackageUpdate())}catch(t){t instanceof Jt&&t.statusCode===0?re({...A,status:`updating`,can_update:!1,phase:`preparing`}):(e.notify({tone:`error`,title:`Update not started`,message:DR(t)}),await se())}finally{a.current=!1,ae(!1)}}}function ge(e){e.displayName!==void 0&&(h.current=!0);let t=e.baseUrl!==void 0&&e.baseUrl!==p.baseUrl||e.apiKey!==void 0&&e.apiKey!==p.apiKey;t&&(v([]),g.current={baseUrl:e.baseUrl??p.baseUrl,apiKey:e.apiKey??p.apiKey}),m(n=>({...e.workspacePath===void 0?n:Cz(n,e.workspacePath,h.current),...e,...t?{model:``}:{}}))}function _e(){b(!1),S(`folder`),v([]),g.current={baseUrl:``,apiKey:``},h.current=!1,m(Sz())}function ve(e){if(!e){!ee&&!O&&_e();return}let t=l?.invocation.source===`terminal`?l.invocation.current_directory:``;h.current=!1,g.current={baseUrl:``,apiKey:``},v([]),m(Sz(t)),S(`folder`),b(!0)}function ye(e){if(e.preventDefault(),x===`folder`){S(`details`);return}if(x===`details`){S(`provider`);return}if(x===`provider`){le();return}ue()}function be(){S(e=>{switch(e){case`folder`:return`folder`;case`details`:return`folder`;case`provider`:return`details`;case`model`:return`provider`}})}let xe=Ez({update:A,checking:ie,starting:M});return(0,P.jsx)(lC,{form:p,models:_,projects:C,projectsLoading:T,sessionLoading:l===null&&d===null,sessionError:d,createOpen:y,createStep:x,modelDiscoveryPending:ee,launchPending:O,projectActionPending:te,...xe===void 0?{}:{packageUpdateAction:xe},onChange:ge,onCreateOpenChange:ve,onCreateSubmit:ye,onCreateBack:be,onChooseFolder:()=>void ce(),onRefresh:()=>void Promise.all([oe(),se({refresh:!0})]),onLaunchExisting:e=>void de(e),onOpenProject:e=>void pe(e),onCopyInvite:e=>void fe(e),onStopProject:e=>void me(e),onPackageUpdate:()=>void he()})}var Fz=/^[A-Za-z0-9_-]{8,256}$/u,Iz=/https?:\/\/[^\s<>"'`“”‘’]+/giu,Lz=/(?:^|[\s("'“‘])((?:\/)?join\/[A-Za-z0-9_-]{8,256})(?=$|[\s?#.,;:!'"”’)\]}])/giu,Rz=/[.,;:!?)}\]]+$/u;function zz(e){let t;try{t=decodeURIComponent(e)}catch{return null}return Fz.test(t)?t:null}function Bz(e){let t=e.split(`/`).filter(Boolean);return t.length!==2||t[0]!==`join`?null:zz(t[1]??``)}function Vz(e,t){let n=Bz(t);n!==null&&e.add(`/join/${encodeURIComponent(n)}`)}function Hz(e,t){try{Vz(e,new URL(t.replace(Rz,``)).pathname)}catch{}}function Uz(e){let t=e.trim();if(t===``)return{kind:`empty`};let n=new Set;for(let e of t.matchAll(Iz))Hz(n,e[0]);for(let e of t.matchAll(Lz)){let t=e[1];if(t!==void 0)try{Vz(n,new URL(t,`https://tutti.invalid`).pathname)}catch{}}let r=zz(t);return r!==null&&n.add(`/join/${encodeURIComponent(r)}`),n.size===0?{kind:`invalid`}:n.size>1?{kind:`ambiguous`}:{kind:`matched`,route:[...n][0]}}function Wz({requestedOpenProjectRef:e}){let t=rt(),n=_R(),r=iz(),i=az(),[a,o]=(0,N.useState)(``),[s,c]=(0,N.useState)(null),[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f=F({queryKey:Q.me,queryFn:()=>Bn(SR)}),p=F({queryKey:Q.recentProjects,queryFn:()=>qn(SR),enabled:f.isSuccess});AR(f.isSuccess);let m=yt({mutationFn:e=>Jn(SR,e),onSuccess:e=>{if(OR(t),e.disposition.kind===`opened`&&e.result?.open_url!==void 0){TR(e.result.open_url);return}n.notify({tone:`warning`,title:`Host is offline`})},onError:e=>{n.notify({tone:`error`,title:`Project open failed`,message:DR(e)})}}),h=m.mutate;(0,N.useEffect)(()=>{e===void 0||f.data?.account.profile_complete!==!0||d.current===e||(d.current=e,h(e))},[f.data?.account.profile_complete,h,e]);let g=yt({mutationFn:()=>Wn(SR),onSuccess:()=>{t.invalidateQueries({queryKey:Q.relayRoot}),t.invalidateQueries({queryKey:Q.me}),t.invalidateQueries({queryKey:Q.recentProjects})},onError:e=>{n.notify({tone:`error`,title:`Sign out failed`,message:DR(e)})}});if(f.error!==null&&Qt(f.error))return(0,P.jsx)($S,{...r,onBrandClick:()=>$(`/`)});let _=f.data?.account;if(_!==void 0&&!_.profile_complete)return(0,P.jsx)($S,{...i,onBrandClick:()=>$(`/`)});let v=(p.data?.projects??[]).map(ar);return(0,P.jsx)(dC,{account:_===void 0?null:{displayName:_.display_name},projects:v,loading:f.isLoading||p.isLoading,error:f.error===null?p.error===null?null:DR(p.error):DR(f.error),openPending:m.isPending,logoutPending:g.isPending,joinLinkForm:{value:a,error:s,onChange:e=>{o(e),c(null)},onSubmit:()=>{let e=Uz(a);if(e.kind!==`matched`){c(e.kind===`ambiguous`?`Paste one Tutti invitation at a time.`:`Paste a valid Tutti invitation.`);return}$(e.route)}},launchExpanded:l,onLaunch:()=>u(!0),onCopyLaunchCommand:e=>{navigator.clipboard.writeText(e).then(()=>{n.notify({tone:`success`,title:`Command copied`})}).catch(()=>{n.notify({tone:`error`,title:`Copy failed`,message:`The browser could not copy the launch command.`})})},onBrandClick:()=>$(`/`),onOpenProject:e=>m.mutate(e),onLogout:()=>g.mutate()})}function Gz(e){let t=e?.relay;if(t?.join_url_visibility===`visible_once`&&t.join_url!==void 0&&t.join_url.trim()!==``)return t.join_url}function Kz(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return!1}}function qz(e,t){let n=Gz(e);if(n!==void 0)return{kind:`join`,joinUrl:n};let r=e?.relay?.relay_project_ref;return r===void 0?{kind:`unavailable`,message:`Relay project is unavailable`}:Kz(t.currentOrigin,t.relayBaseUrl)?{kind:`relay_open`,relayProjectRef:r}:{kind:`unavailable`,message:`Open the latest Join URL printed by tutti launch.`}}var Jz=`gpt-5.5`,Yz=`/host-local/v1`;function Xz(){return new URL(window.location.href).searchParams.get(`token`)?.trim()??``}function Zz(e){return{baseUrl:Yz,credentials:`same-origin`,headers:{authorization:`Bearer ${e}`}}}function Qz(e){return I(Zz(e),`/provider/config`)}function $z(e){return I(Zz(e),`/launch-status`)}function eB(e){return I(Zz(e),`/project`)}function tB(e,t){return I(Zz(e),`/project`,{method:`POST`,body:t})}function nB(e,t){return I(Zz(e),`/provider/config`,{method:`POST`,body:t})}function rB(e){return e===void 0?`loading`:e.status===`configured`?`configured`:e.status===`invalid`?`invalid`:`not configured`}function iB(e){let t=e instanceof Error&&`code`in e?String(e.code):``;return t.startsWith(`provider_`)?t:DR(e)}function aB(){let e=Xz(),t=e===``,[n,r]=(0,N.useState)({projectName:``,apiKey:``,baseUrl:``,defaultModel:Jz}),[i,a]=(0,N.useState)(null),[o,s]=(0,N.useState)(null),c=(0,N.useRef)(!1),l=F({queryKey:[`host-local`,`provider-config`,e],queryFn:()=>Qz(e),enabled:!t}),u=F({queryKey:[`host-local`,`launch-status`,e],queryFn:()=>$z(e),enabled:!t}),d=F({queryKey:[`host-local`,`project`,e],queryFn:()=>eB(e),enabled:!t}),f=u.data,p=yt({mutationFn:e=>Jn(SR,e.relayProjectRef),onSuccess:e=>{if(e.disposition.kind===`opened`&&e.result?.open_url!==void 0){TR(e.result.open_url);return}s(`Host is offline`)},onError:e=>{s(DR(e))}}),m=yt({mutationFn:async()=>{let t=n.projectName.trim(),r=d.data?.display_name.trim()??``;t!==``&&t!==r&&await tB(e,{display_name:t});let i={api_key:n.apiKey.trim()},a=n.baseUrl.trim(),o=n.defaultModel.trim();return a!==``&&(i.base_url=a),o!==``&&(i.default_model=o),await nB(e,i)},onSuccess:()=>{a(`Provider saved.`),r(e=>({...e,apiKey:``})),d.refetch(),l.refetch(),v()}}),h=l.data;(0,N.useEffect)(()=>{let e=d.data?.display_name;e!==void 0&&r(t=>t.projectName.trim()===``?{...t,projectName:e}:t)},[d.data?.display_name]),(0,N.useEffect)(()=>{t||h?.status!==`configured`||v()},[h?.status,t]);let g=t?`Setup token is missing.`:d.error===null?l.error===null?m.error===null?o:iB(m.error):iB(l.error):iB(d.error);function _(e){e.preventDefault(),a(null),s(null),c.current=!1,!t&&n.apiKey.trim()!==``&&n.projectName.trim()!==``&&m.mutate()}async function v(){if(c.current)return;c.current=!0;let e=qz(f??(await u.refetch()).data,{currentOrigin:window.location.origin,relayBaseUrl:xR});if(e.kind===`join`){window.location.assign(e.joinUrl);return}if(e.kind===`unavailable`){s(e.message);return}p.mutate({relayProjectRef:e.relayProjectRef})}return(0,P.jsx)(pC,{form:n,statusLabel:rB(h),configured:h?.status===`configured`,loading:l.isLoading||d.isLoading,pending:m.isPending,tokenMissing:t,error:g,success:i,openProjectPending:p.isPending,onChange:e=>r(t=>({...t,...e})),onSubmit:_,onRetry:()=>void l.refetch(),onBrandClick:()=>$(`/`)})}function oB(e){return`${e.created_at}:${e.id}`}function sB(e){return{kind:`initial`,entry:e}}function cB(e,t=50){if(e.kind===`older`)return{before:e.before,limit:t};if(e.kind===`newer`)return{after:e.after,limit:t};switch(e.entry.kind){case`latest`:return{limit:t};case`start`:return{anchor:`start`,limit:t};case`around`:return{around:e.entry.messageId,limit:t}}}function lB(e){let t=e.window.older_cursor;return e.window.has_older&&t!==void 0?{kind:`older`,before:t}:void 0}function uB(e){let t=e.window.newer_cursor;return e.window.has_newer&&t!==void 0?{kind:`newer`,after:t}:void 0}function dB(e,t=50){let n=e[0],r=e.at(-1);if(n===void 0||r===void 0)return{items:[],window:{has_older:!1,has_newer:!1,limit:t}};let i=new Map;for(let t of e)for(let e of t.items)i.set(e.id,e);let a=[...i.values()].sort((e,t)=>oB(e).localeCompare(oB(t))),o={has_older:n.window.has_older,has_newer:r.window.has_newer,limit:n.window.limit};return o.has_older&&n.window.older_cursor!==void 0&&(o.older_cursor=n.window.older_cursor),o.has_newer&&r.window.newer_cursor!==void 0&&(o.newer_cursor=r.window.newer_cursor),{items:a,window:o}}var fB=5400,pB=1500;function mB(e){let t=e.completionSource;return t?.activityRef??t?.workflowRef??t?.taskId??e.key}function hB(e){switch(e.kind){case`accepted`:case`already_running`:return null;case`scratchpad_empty`:return{label:`Scratchpad is empty. Let it refresh before running.`,tone:`error`};case`stale_scratchpad`:return{label:`Scratchpad changed. Review the latest snapshot and run again.`,tone:`error`};case`provider_not_configured`:return{label:`Provider is not configured yet.`,tone:`error`};case`provider_unavailable`:return{label:`Provider unavailable: ${e.reason}.`,tone:`error`};case`interrupted`:return{label:`Run was interrupted. Try again.`,tone:`error`}}}function gB(e,t){t.displayName.trim()===``||e.has(t.key)||e.set(t.key,t)}function _B(e){if(e.author.kind!==`human`)return null;let t=e.author.display_name?.trim()||`Member`;return{key:e.author.ref===void 0?`message-author:${t.toLocaleLowerCase()}`:e.author.ref,displayName:t,avatar:e.author.avatar??{kind:`initials`,initials:dr(t),color:`blue`}}}function vB({account:e,presence:t,messages:n=[]}){let r=new Map;e!==void 0&&gB(r,{key:e.account_ref,displayName:e.display_name,avatar:e.avatar});for(let e of t?.sample_members??[])gB(r,{key:e.account_ref,displayName:e.display_name,avatar:e.avatar});for(let e of t?.members??[])gB(r,{key:e.account_ref,displayName:e.display_name,avatar:e.avatar});for(let e of n){let t=_B(e);t!==null&&gB(r,t)}return[...r.values()]}function yB({account:e,presence:t}){let n={},r=(e,t)=>{let r=n[e];n[e]={avatar:t.avatar,online:r?.online===!0||t.online}};for(let e of t?.members??[])r(e.account_ref,{avatar:e.avatar,online:e.online});for(let e of t?.sample_members??[])r(e.account_ref,{avatar:e.avatar,online:!0});return e!==void 0&&r(e.account_ref,{avatar:e.avatar,online:!0}),n}function bB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),[i,a]=(0,N.useState)(``),[o,s]=(0,N.useState)(``),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)(()=>Date.now()),[g,_]=(0,N.useState)(null),v=new URL(wR(),window.location.origin).searchParams.get(`message`),y=v!==null&&Vt(v,Lt.message)?v:void 0,[b,x]=(0,N.useState)(()=>y===void 0?{kind:`latest`}:{kind:`around`,messageId:y}),S=(0,N.useRef)(null),C=(0,N.useRef)(null),w=(0,N.useRef)(null),[T,E]=(0,N.useState)(null),ee=u!==null;(0,N.useEffect)(()=>{y!==void 0&&(b.kind!==`around`||b.messageId!==y)&&x({kind:`around`,messageId:y})},[b,y]);let D=(t=null)=>{x({kind:`latest`}),_(t),y!==void 0&&$(rn(e),{replace:!0})},O=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap(),staleTime:CR}),k=O.data?.session.account.account_ref,te=k===void 0?null:`${k}:${e}`,ne=y!==void 0||te!==null&&T===te;(0,N.useEffect)(()=>{te===null||T===te||(y===void 0&&k!==void 0&&x(pz(k,e).start_chat_pending?{kind:`start`}:{kind:`latest`}),E(te))},[k,te,e,y,T]);let A=bt({queryKey:Q.messageHistory(e,b,50),queryFn:({pageParam:e})=>r.getMessages(cB(e)),initialPageParam:sB(b),getPreviousPageParam:e=>lB(e),getNextPageParam:e=>uB(e),enabled:O.isSuccess&&ne,staleTime:CR}),re=F({queryKey:Q.scratchpad(e),queryFn:()=>r.getScratchpad(),enabled:O.isSuccess,staleTime:CR,refetchInterval:ee?pB:!1}),ie=F({queryKey:Q.activeClarification(e),queryFn:()=>r.getActiveClarification(),enabled:O.isSuccess,staleTime:CR,refetchInterval:ee?pB:!1}),j=F({queryKey:Q.activeApproval(e),queryFn:()=>r.getActiveApproval(),enabled:O.isSuccess,staleTime:CR}),M=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:O.isSuccess,staleTime:CR,refetchInterval:ee?pB:!1}),ae=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:O.isSuccess,staleTime:CR}),oe=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:O.isSuccess,staleTime:CR}),se=F({queryKey:Q.projectPresence(e),queryFn:()=>Yn(SR,e),enabled:O.isSuccess,staleTime:CR,refetchInterval:6e4});AR(O.isSuccess);let ce=yt({mutationFn:e=>r.updateProjectDisplayName({display_name:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project name`,message:e}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project name saved`,message:i})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project name save failed`,message:`${t}: ${DR(e)}`})}}),le=yt({mutationFn:e=>r.updateProjectDescription({description:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project description`,...e.length===0?{}:{message:e}}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project description saved`,...i.length===0?{}:{message:i}})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project description save failed`,message:DR(e)})}}),ue=yt({mutationFn:({body:e,commandId:t})=>r.sendMainChatMessage({body:e},{commandId:t}),onSuccess:(n,r)=>{S.current=null,a(e=>e.trim()===r.body?``:e),n.result?.message!==void 0&&(b.kind===`latest`&&!A.hasNextPage?_(n.result.message.id):D(n.result.message.id)),jR(t,e,n.invalidates)},onError:e=>{n.notify({tone:`error`,title:`Message send failed`,message:DR(e)})}}),de=yt({mutationFn:async t=>{let n=await rz({relayProjectRef:e,purpose:`reference_file`,file:t});return r.uploadReferenceFile(n)},onMutate:e=>n.notify({tone:`loading`,title:`Uploading reference`,message:e.name}),onSuccess:(r,i,a)=>{let o=r.result?.message;o!==void 0&&(b.kind===`latest`&&!A.hasNextPage?_(o.id):D(o.id)),jR(t,e,r.invalidates),n.update(a,{tone:`success`,title:`Reference uploaded`,message:r.result?.file.name??i.name})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Reference upload failed`,message:DR(e)})}}),fe=yt({mutationFn:e=>r.submitWorklist(e===void 0?{}:{expected_scratchpad_updated_at:e}),onMutate:()=>(d({kind:`request`}),n.notify({tone:`loading`,title:`Running Scratchpad`})),onSuccess:(r,i,a)=>{if(r.disposition.kind===`accepted`){let e=r.result?.activity_ref;d(e===void 0?null:{kind:`activity`,activityRef:e,...r.result?.workflow_ref===void 0?{}:{workflowRef:r.result.workflow_ref}}),n.update(a,{tone:`success`,title:`Scratchpad run started`,message:`Tutti is preparing Worklist tasks.`})}else if(r.disposition.kind===`already_running`)d(null),n.update(a,{tone:`info`,title:`Already running`,message:`Tutti is already processing work.`});else{d(null);let e=hB(r.disposition);n.update(a,{tone:e?.tone??`warning`,title:`Scratchpad run blocked`,...e?.label===void 0?{}:{message:e.label}})}jR(t,e,r.invalidates)},onError:(e,t,r)=>{d(null),n.update(r,{tone:`error`,title:`Scratchpad run failed`,message:DR(e)})}}),pe=O.data,me=yB({account:pe?.session.account,presence:se.data?.presence}),he=pe?.generated_at??new Date(0).toISOString(),ge=A.data===void 0?void 0:dB(A.data.pages,50),_e=ge??(ne&&b.kind===`latest`?pe?.snapshots.main_chat:void 0)??MR(),ve=A.data!==void 0&&A.hasPreviousPage===!0,ye=A.data!==void 0&&A.hasNextPage===!0,be=b.kind===`latest`||b.kind===`start`&&!ye||b.kind===`around`&&_e.items.length>0&&!ye,xe=b.kind===`around`?`around:${b.messageId}`:b.kind,Se=b.kind===`around`?`focus`:b.kind===`start`?`start`:`latest`,Ce=pe!==void 0&&(!ne||ge===void 0&&A.isLoading&&(b.kind!==`latest`||pe.snapshots.main_chat===void 0)),we=re.data??pe?.snapshots.scratchpad??PR(),Te=ae.data??pe?.snapshots.read_state;LR({enabled:O.isSuccess,hostClient:r,relayProjectRef:e,readState:Te,scope:`chat`});let Ee=ie.data??pe?.snapshots.active_clarification??RR(),De=j.data??pe?.snapshots.active_approval??{state:`none`},Oe=Ee.state===`active`?Ee.round.id:void 0;(0,N.useEffect)(()=>{c!==null&&(Oe===void 0||c!==Oe)&&l(null)},[Oe,c]);let ke=Ee.state===`active`&&Ee.thread.owner.kind===`task_compile`,Ae=(0,N.useMemo)(()=>{let e=new Set;for(let t of _e.items)t.clarification_card!==void 0&&e.add(t.clarification_card.round_id);return Oe!==void 0&&e.add(Oe),[...e]},[Oe,_e.items]),je=_t({queries:Ae.map(t=>({queryKey:Q.clarificationRoundMessages(e,t),queryFn:()=>r.getClarificationRoundMessages(t,{anchor:`start`,limit:50}),enabled:O.isSuccess}))}),Me=yt({mutationFn:({roundId:e,body:t})=>r.sendClarificationRoundMessage(e,{body:t}),onSuccess:n=>{s(``),jR(t,e,n.invalidates)},onError:e=>{n.notify({tone:`error`,title:`Reply send failed`,message:DR(e)})}}),Ne=yt({mutationFn:e=>r.submitClarificationRound(e),onMutate:e=>(l(e),n.notify({tone:`loading`,title:`Submitting reply`})),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates),n.update(a,{tone:`success`,title:`Reply submitted`})},onError:(e,t,r)=>{l(e=>e===t?null:e),n.update(r,{tone:`error`,title:`Reply submit failed`,message:DR(e)})}}),Pe=yt({mutationFn:({approvalId:e,decisionId:t})=>r.decideApproval(e,{decision_id:t}),onMutate:()=>n.notify({tone:`loading`,title:`Sending decision`}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates),n.update(a,{tone:`success`,title:`Decision sent`})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Decision failed`,message:DR(e)})}}),Fe=Object.fromEntries(Ae.map((e,t)=>[e,(je[t]?.data??MR()).items.map(e=>_r(e,{authorProfiles:me}))])),Ie=vB({account:pe?.session.account,presence:se.data?.presence,messages:[..._e.items,...je.flatMap(e=>e.data?.items??[])]}),Le=M.data??pe?.snapshots.execution_status??zR(he),Re=BR(Le),ze=VR(Le,`scratchpad_refresh`),Be=VR(Le,`scratchpad_refresh`,`foreground`),Ve=VR(Le,`task_compile`,`foreground`),He=VR(Le,`project_context_bootstrap`,`foreground`),Ue=u?.kind===`activity`?u.activityRef:void 0,We=u?.kind===`activity`?u.workflowRef:void 0;(0,N.useEffect)(()=>{if(u===null)return;if(we.state===`submitted`){d(null);return}if(we.state===`empty`){d(null);return}if(Le.status===`pending`){ke||d(null);return}let e=Le.last_conclusion,t=We!==void 0&&e?.workflow_ref===We,r=Ue!==void 0&&e?.activity_ref===Ue;if(!(!t&&!r)){if(d(null),e?.kind===`failed`){n.notify({tone:`error`,title:`Scratchpad run failed`,message:e.summary});return}if(e?.kind===`needs_human`){n.notify({tone:`warning`,title:`Scratchpad needs input`,message:e.summary});return}}},[Le.last_conclusion?.activity_ref,Le.last_conclusion?.kind,Le.last_conclusion?.summary,Le.last_conclusion?.workflow_ref,Le.status,Le.summary,ke,n,we.state,u,Ue,We]);let Ge=Ue!==void 0&&Re.some(e=>e.activity_ref===Ue),Ke=Ge&&Re.some(e=>e.activity_ref===Ue&&e.workflow_kind===`scratchpad_refresh`)||u!==null&&Be,qe=Ve||He||Ke||Ge||ke,Je=ze,Ye=fe.isPending||qe||u!==null&&Le.status===`idle`,Xe=Le.status!==`idle`||Ye||f!==null;(0,N.useEffect)(()=>{if(!Xe)return;h(Date.now());let e=window.setInterval(()=>{h(Date.now())},1e3);return()=>{window.clearInterval(e)}},[Xe]);let Ze=Re.some(e=>e.activity_kind===`procedure`&&(e.lane??`foreground`)===`foreground`)&&!Je&&!Ye,Qe=bS(Le),$e={key:`scratchpad-submit`,label:ke?`Needs input`:Ke?`Compiling Worklist tasks`:He?`Preparing project context`:Ve?`Compiling Worklist tasks`:`Preparing Worklist`,title:ke?`Needs input`:`Preparing Scratchpad for Worklist.`,tone:ke?`pending`:`running`,target:ke?{kind:`clarification`}:{kind:`scratchpad`}},et=Ye&&Qe.length===0?[$e]:Qe,tt=gS(Le,{now:m}),nt=Re.find(e=>(e.lane??`foreground`)===`foreground`?e.workflow_kind===`project_context_bootstrap`&&He||e.workflow_kind===`task_compile`&&Ve||e.workflow_kind===`scratchpad_refresh`&&Ke?!0:Ue!==void 0&&e.activity_ref===Ue:!1),it=(Ye?_S({activeScratchpadRefreshFromSubmit:Ke,activeProjectContextBootstrap:He,activeTaskCompile:Ve,activeTaskCompileClarification:ke,now:m,...nt?.started_at===void 0?{}:{startedAt:nt.started_at},...Le.runtime===void 0?{}:{runtime:Le.runtime}}):null)??tt;(0,N.useEffect)(()=>{it!==null&&(C.current=it,p(null))},[it]),(0,N.useEffect)(()=>{if(!ze||it!==null)return;let e=C.current;if(e?.completionSource===void 0)return;let t=`hidden:${mB(e)}`;if(w.current===t)return;w.current=t;let n=vS(e,e.summary);p(n),C.current=null;let r=window.setTimeout(()=>{p(e=>e?.key===n.key?null:e)},fB);return()=>{window.clearTimeout(r)}},[it,ze]),(0,N.useEffect)(()=>{if(it!==null||Le.status!==`idle`)return;let e=Le.last_conclusion;if(e?.kind!==`completed`)return;let t=e.activity_ref??`${e.kind}:${e.task_id??`none`}:${e.occurred_at}`;if(w.current===t)return;let n=C.current;if(n===null)return;if(!yS(n,e)){C.current=null;return}w.current=t;let r=vS(n,e.summary);p(r);let i=window.setTimeout(()=>{p(e=>e?.key===r.key?null:e),C.current=null},fB);return()=>{window.clearTimeout(i)}},[it,Le.last_conclusion?.activity_ref,Le.last_conclusion?.kind,Le.last_conclusion?.occurred_at,Le.last_conclusion?.summary,Le.last_conclusion?.task_id,Le.status]);let at=it??f,ot=f===null?null:{key:`completed`,label:`Completed`,tone:`done`,target:f.completionTarget??{kind:`scratchpad`}},st=ot===null?et:[ot,...et],ct=e=>{e.preventDefault();let t=i.trim();if(t!==``&&!ue.isPending){let e=S.current?.body===t?S.current:{body:t,commandId:Wt()};S.current=e,ue.mutate(e)}},lt=e=>{e.preventDefault();let t=o.trim();t!==``&&Oe!==void 0&&!Me.isPending&&Me.mutate({roundId:Oe,body:t})},ut=ne&&ge===void 0&&A.error!==null&&(b.kind!==`latest`||pe?.snapshots.main_chat===void 0),dt=pe===void 0&&O.error!==null||ut;return(0,N.useEffect)(()=>{y!==void 0&&_(y)},[y]),(0,P.jsx)($C,{projectName:pe?.workspace.project.display_name??`Workspace`,projectDescription:pe?.workspace.project.description??``,members:Ie,messages:_e.items.map(e=>_r(e,{authorProfiles:me,referenceAssetUrl:(e,t,n)=>r.viewerAssetUrl({path:e,variant:t,v:n})})),scratchpad:Nr(we,_e.items),executionProgress:at,activeApproval:Sr(De),activeClarification:vr(Ee),clarificationMessagesByRoundId:Fe,statusShortcuts:st,unread:FR(Te),artifactSignal:IR(oe.data),draft:i,roundDraft:o,sendPending:ue.isPending,focusMessageId:g,messageHistoryIdentity:xe,initialMessagePosition:Se,hasOlderMessages:ve,hasNewerMessages:ye,loadingOlderMessages:A.isFetchingPreviousPage,loadingNewerMessages:A.isFetchingNextPage,historyConnectedToLatest:be,submittedRoundId:c,referenceUploadPending:de.isPending,scratchpadSyncPending:Je,scratchpadActionsDisabled:Ze,scratchpadSubmitPending:Ye,roundSendPending:Me.isPending,roundSubmitPending:Ne.isPending,approvalDecisionPending:Pe.isPending,projectNameSaving:ce.isPending,projectDescriptionSaving:le.isPending,loading:pe===void 0&&O.isLoading||Ce,unavailable:dt,onDraftChange:e=>{S.current?.body!==e.trim()&&(S.current=null),a(e)},onMessageFocused:()=>_(null),onInitialMessagePositioned:()=>{b.kind===`start`&&A.isSuccess&&k!==void 0&&gz(k,e)},onLoadOlderMessages:()=>{A.fetchPreviousPage()},onLoadNewerMessages:()=>{A.fetchNextPage()},onJumpToLatest:()=>D(),onUploadReferenceFile:e=>de.mutate(e),onOpenReferenceFile:t=>$(HR(e,t)),onRoundDraftChange:s,onSendMessage:ct,onSendRoundMessage:lt,onSubmitRound:()=>{Oe!==void 0&&Ne.mutate(Oe)},onDecideApproval:(e,t)=>Pe.mutate({approvalId:e,decisionId:t}),onSubmitScratchpad:()=>fe.mutate(we.updated_at),onUpdateProjectDisplayName:async e=>{await ce.mutateAsync(e)},onUpdateProjectDescription:async e=>{await le.mutateAsync(e)},onOpenProjectCenter:()=>$(`/projects`),onOpenWorklist:()=>$(WR(e)),onOpenWorklistTask:t=>$(WR(e,t)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t)})}function xB(e){return Qt(e)?Zt(e,`relay_session_invalid`)?`client_session`:`account_session`:null}function SB(e){return e===`client_session`?{title:`Workspace session expired`,message:`Open the project again from Project Center.`}:{title:`Sign in required`,message:`Sign in to Tutti before opening this workspace.`}}function CB(e){return e===`client_session`?`/projects`:`/`}function wB({relayProjectRef:e,children:t}){let n=rt(),r=_R(),i=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),a=(0,N.useRef)(void 0),o=(0,N.useRef)(null),s=F({queryKey:Q.bootstrap(e),queryFn:()=>i.getBootstrap(),staleTime:CR}),c=xB(s.error),l=c===null&&s.data?.workspace.capabilities.sse===!0;return a.current===void 0&&s.data!==void 0&&(a.current=s.data.event_cursor),(0,N.useEffect)(()=>{if(c===null)return;let t=`${e}:${c}`;o.current!==t&&(o.current=t,r.notify({tone:`warning`,...SB(c)}),$(CB(c),{replace:!0}))},[c,r,e]),(0,N.useEffect)(()=>{if(!l)return;let t=i.connectEvents({...a.current===void 0?{}:{after:a.current},onReady:t=>{t.payload.replay.status===`missed`&&n.invalidateQueries({queryKey:Q.hostRoot(e)})},onInvalidate:t=>{jR(n,e,t)},onError:()=>void 0});return()=>t.close()},[i,n,e,l]),c===null?t:null}function TB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap(),staleTime:CR}).data?.session.account.account_ref,r=n===void 0?null:`${n}:${e}`,[i,a]=(0,N.useState)({identity:null,pending:!1}),[o,s]=(0,N.useState)(!1),c=Vd();(0,N.useEffect)(()=>{n===void 0||r===null||i.identity===r||a({identity:r,pending:pz(n,e).tour_pending})},[n,r,i.identity,e]);let l=t=>{_z(t,e),a({identity:r,pending:!1})};return(0,P.jsxs)(P.Fragment,{children:[c&&r!==null&&i.identity===r&&i.pending&&n!==void 0&&typeof document<`u`?(0,vc.createPortal)((0,P.jsx)(Jd,{onOpen:()=>{l(n),s(!0)},onDismiss:()=>l(n)}),document.body):null,(0,P.jsx)(Yd,{assets:FS,open:o,onOpenChange:s})]})}var EB=2e4,DB=3e4;function OB(e){let t=e.intervalMs??EB,n=e.setIntervalFn??window.setInterval.bind(window),r=e.clearIntervalFn??window.clearInterval.bind(window),i=!0,a=!1,o=!1,s=()=>{!i||a||(a=!0,e.renew().then(()=>{i&&!o&&(o=!0,e.onInitialRenewed?.())}).catch(()=>void 0).finally(()=>{a=!1}))};s();let c=n(s,t);return()=>{i=!1,r(c)}}function kB(e,t,n={}){let r=n.runActive??!1;if(e===void 0)return r?{status:`updating`}:{status:`loading`};if(e.status===`not_declared`)return r?{status:`updating`}:{status:`not_declared`};if(e.status===`invalid`)return r?{status:`updating`}:{status:`invalid`,message:e.error.message};let i={status:`declared`,title:e.artifact.title,previewStatus:e.preview.status,...e.preview.error_message===void 0?{}:{errorMessage:e.preview.error_message}};return e.preview.status===`ready`?t.previewUrl===void 0?r?{status:`updating`}:t.errorMessage===void 0?{...i,previewStatus:t.pending?`starting`:`failed`,...t.pending?{}:{errorMessage:`Preview session is unavailable`}}:{...i,previewStatus:`failed`,errorMessage:t.errorMessage}:{...i,previewUrl:t.previewUrl}:r?{status:`updating`}:i}function AB(e){if(!(e===void 0||e.disposition.kind===`issued`))return e.disposition.kind===`invalid_manifest`?e.disposition.message:e.disposition.kind===`preview_not_ready`?e.disposition.message??`Preview is not ready`:e.disposition.kind===`not_declared`?`Artifact is no longer declared`:`Preview session expired before it could be opened`}function jB(e){return e===void 0?!1:e.disposition.kind!==`issued`||e.result===void 0?e.disposition.kind===`preview_not_ready`||e.disposition.kind===`interrupted`?1e3:!1:Math.max(1e3,Date.parse(e.result.expires_at)-Date.now()-DB)}function MB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=(0,N.useMemo)(()=>zn(SR),[]),r=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap(),staleTime:CR}),i=F({queryKey:Q.artifacts(e),queryFn:()=>t.getArtifacts(),enabled:r.isSuccess,staleTime:CR}),a=F({queryKey:Q.executionStatus(e),queryFn:()=>t.getExecutionStatus(),enabled:r.isSuccess,staleTime:CR}),o=F({queryKey:Q.readState(e),queryFn:()=>t.getReadState(),enabled:r.isSuccess,staleTime:CR}),s=r.data,c=s?.generated_at??new Date(0).toISOString(),l=o.data??s?.snapshots.read_state,u=a.data??s?.snapshots.execution_status??zR(c),d=u.active_activity?.activity_kind===`run`||u.active_activities?.some(e=>e.activity_kind===`run`)===!0,f=i.data?.artifact,p=f?.status===`declared`&&f.preview.status===`ready`&&f.preview.url!==void 0?f.preview.url:null,m=F({queryKey:Q.artifactPreviewSession(e,p??`not-ready`),queryFn:()=>n.issueArtifactPreviewSession(e),enabled:p!==null,staleTime:1/0,retry:1,refetchInterval:e=>jB(e.state.data)}),h=m.data,g=h?.disposition.kind===`issued`?h.result?.bootstrap_url:void 0,_=m.error===null?AB(h):DR(m.error);(0,N.useEffect)(()=>{if(r.isSuccess)return OB({renew:()=>t.renewArtifactPreviewLease(),onInitialRenewed:()=>{i.refetch()}})},[i.refetch,r.isSuccess,t]);let v=i.data!==void 0,y=!v&&(r.error!==null||i.error!==null);return(0,P.jsx)(ew,{statusShortcuts:bS(u),unread:FR(l),artifactSignal:IR(i.data),state:kB(i.data?.artifact,{...g===void 0?{}:{previewUrl:g},pending:p!==null&&g===void 0&&_===void 0,..._===void 0?{}:{errorMessage:_}},{runActive:d}),loading:!v&&(r.isLoading||i.isLoading),unavailable:y,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t)})}function NB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),i=new URL(wR(),window.location.origin).searchParams.get(`path`)??void 0,[a,o]=(0,N.useState)(i),[s,c]=(0,N.useState)(`time`),l=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap(),staleTime:CR}),u=F({queryKey:Q.referenceFiles(e),queryFn:()=>r.getReferenceFiles({limit:200}),enabled:l.isSuccess,staleTime:CR}),d=F({queryKey:Q.messagesWindow(e,200),queryFn:()=>r.getMessages({limit:200}),enabled:l.isSuccess,staleTime:CR}),f=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:l.isSuccess,staleTime:CR}),p=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:l.isSuccess,staleTime:CR}),m=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:l.isSuccess,staleTime:CR}),h=u.data?.items??[],g=(0,N.useMemo)(()=>{let e=new Map;for(let t of d.data?.items??[]){let n=t.refs?.reference_file;if(n===void 0)continue;let r=e.get(n.path);(r===void 0||t.created_at>r)&&e.set(n.path,t.created_at)}return e},[d.data?.items]),_=(0,N.useMemo)(()=>{let e=(e,t)=>e.name.localeCompare(t.name),t=(t,n)=>{let r=g.get(t.path)??``,i=g.get(n.path)??``;return r===i?e(t,n):i.localeCompare(r)},n=(e,n)=>{let r=e.extension??e.media_type??`file`,i=n.extension??n.media_type??`file`;return r===i?t(e,n):r.localeCompare(i)},r=[...h.filter(e=>e.category===`image`&&e.source===`human_upload`)].sort(t),i=[...h.filter(e=>!(e.category===`image`&&e.source===`human_upload`))].sort(s===`time`?t:n);return[...r,...i]},[s,h,g]);(0,N.useEffect)(()=>{if(_.length===0){a!==void 0&&o(void 0);return}if(i!==void 0&&_.some(e=>e.path===i)){a!==i&&o(i);return}(a===void 0||!_.some(e=>e.path===a))&&o(_[0]?.path)},[_,i,a]);let v=h.find(e=>e.path===a),y=v?.category===`image`,b=v?.text_read.can_read===!0,x=F({queryKey:a===void 0?Q.viewerFile(e,`none`):Q.viewerFile(e,a),queryFn:()=>r.getViewerFile({path:a,max_bytes:204800}),enabled:l.isSuccess&&a!==void 0&&b&&!y,staleTime:CR}),S=yt({mutationFn:async t=>{let n=await rz({relayProjectRef:e,purpose:`reference_file`,file:t});return r.uploadReferenceFile(n)},onMutate:e=>n.notify({tone:`loading`,title:`Uploading reference`,message:e.name}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates),r.result?.file.path!==void 0&&(o(r.result.file.path),$(HR(e,r.result.file.path))),n.update(a,{tone:`success`,title:`Reference uploaded`,message:r.result?.file.name??i.name})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Reference upload failed`,message:DR(e)||t.name})}}),C=l.data,w=C?.generated_at??new Date(0).toISOString(),T=p.data??C?.snapshots.read_state;LR({enabled:l.isSuccess,hostClient:r,relayProjectRef:e,readState:T,scope:`references`});let E=f.data??C?.snapshots.execution_status??zR(w),ee=_.map(e=>{let t=IB(e,u.data?.directory.tutti_path);return{path:e.path,name:e.name,meta:FB(e),source:e.source,...t===void 0?{}:{generatedGroup:t},selected:e.path===a,canPreview:e.text_read.can_read,category:e.category,...e.category===`image`&&e.source===`human_upload`?{...e.blob_oid===void 0?{}:{thumbnailUrl:r.viewerAssetUrl({path:e.path,variant:`thumbnail`,v:e.blob_oid})}}:{},...e.extension===void 0?{}:{extension:e.extension}}}),D=x.data?.content,O=(()=>{if(v===void 0)return{title:h.length===0?`No reference files`:`No file selected`,unavailableReason:h.length===0?`No reference files`:`Select a reference file`};if(D?.kind===`text`)return{title:v.name,meta:QR(v.size_bytes),...PB(v),content:D.text};if(y&&a!==void 0)return v.blob_oid===void 0?{title:v.name,meta:QR(v.size_bytes),...PB(v),unavailableReason:`Image version unavailable`}:{title:v.name,meta:QR(v.size_bytes),...PB(v),imageUrl:r.viewerAssetUrl({path:a,variant:`preview`,v:v.blob_oid})};let e=b&&x.isLoading?`Loading`:ez(D)??(b?void 0:$R(v.text_read.blocked_reason));return e===void 0?{title:v.name,meta:QR(v.size_bytes),...PB(v)}:{title:v.name,meta:QR(v.size_bytes),...PB(v),unavailableReason:e}})(),k=u.data!==void 0,te=!k&&(l.error!==null||u.error!==null);return(0,P.jsx)(tw,{statusShortcuts:bS(E),unread:FR(T),artifactSignal:IR(m.data),files:ee,detail:O,uploadPending:S.isPending,fileSortMode:s,loading:!k&&(l.isLoading||u.isLoading),unavailable:te,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t),onSelectFile:t=>{o(t),$(HR(e,t))},onUploadFile:e=>S.mutate(e),onFileSortModeChange:c})}function PB(e){let t=e.summary;return t===void 0||t.status===`missing`?{summaryStatus:`Summary not available yet`}:t.status===`stale`?{...t.text===void 0?{}:{summary:t.text},summaryStatus:`Summary may be out of date`}:t.status===`unavailable`?{...t.text===void 0?{}:{summary:t.text},summaryStatus:`Summary could not be generated`}:t.text===void 0?{summaryStatus:`Summary unavailable`}:{summary:t.text}}function FB(e){let t=e.source===`tutti_output`?`Tutti`:`Uploaded`;if(e.category===`image`)return[t,e.media_type??`Image`,QR(e.size_bytes)].join(` · `);let n=[t,QR(e.size_bytes)];return e.text_read.can_read||n.push($R(e.text_read.blocked_reason)),n.join(` · `)}function IB(e,t){if(e.source!==`tutti_output`||t===void 0)return;let n=`${t}/`;if(!e.path.startsWith(n))return;let[r,i]=e.path.slice(n.length).split(`/`);if(!(r===void 0||r.length===0||i===void 0))return r}function LB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),i=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap()}),a=F({queryKey:Q.hostWorkspace(e),queryFn:()=>r.getWorkspace(),enabled:i.isSuccess}),o=F({queryKey:Q.hostSession(e),queryFn:()=>r.getSession(),enabled:i.isSuccess}),s=F({queryKey:Q.providerConfig(e),queryFn:()=>r.getProviderConfig(),enabled:i.isSuccess}),c=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:i.isSuccess}),l=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:i.isSuccess}),u=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:i.isSuccess}),d=yt({mutationFn:e=>r.updateProjectDisplayName({display_name:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project name`,message:e}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project name saved`,message:i})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project name save failed`,message:`${t}: ${DR(e)}`})}}),f=yt({mutationFn:e=>r.updateProjectDescription({description:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project description`,...e.length===0?{}:{message:e}}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project description saved`,...i.length===0?{}:{message:i}})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project description save failed`,message:DR(e)})}}),p=i.data,m=p?.generated_at??new Date(0).toISOString(),h=l.data??p?.snapshots.read_state,g=a.data??p?.workspace,_=o.data??p?.session,v=s.data??p?.provider_config,y=c.data??p?.snapshots.execution_status??zR(m),b=g===void 0||_===void 0||v===void 0?void 0:Jr(g,_,v),x=b===void 0&&(i.error!==null||a.error!==null||o.error!==null||s.error!==null),S=g?.relay.join_url,C=S===void 0||g===void 0||_===void 0?void 0:Oz({inviterName:_.account.display_name,projectName:g.project.display_name,joinUrl:S});return(0,P.jsx)(fw,{...b===void 0?{}:{settings:b},statusShortcuts:bS(y),unread:FR(h),artifactSignal:IR(u.data),loading:b===void 0&&(i.isLoading||a.isLoading||o.isLoading||s.isLoading),unavailable:x,projectNameSaving:d.isPending,projectDescriptionSaving:f.isPending,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onActivateStatusShortcut:t=>XR(e,t),...C===void 0?{}:{onCopyJoinUrl:()=>{navigator.clipboard.writeText(C).then(()=>{n.notify({tone:`success`,title:`Invitation copied`})}).catch(()=>{n.notify({tone:`error`,title:`Copy failed`,message:`The browser could not copy the invite link.`})})}},onUpdateProjectDisplayName:async e=>{await d.mutateAsync(e)},onUpdateProjectDescription:async e=>{await f.mutateAsync(e)}})}function RB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),i=new URL(wR(),window.location.origin).searchParams.get(`skill`)??void 0,[a,o]=(0,N.useState)(i),s=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap(),staleTime:CR}),c=F({queryKey:Q.skills(e),queryFn:()=>r.getSkills(),enabled:s.isSuccess,staleTime:CR}),l=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:s.isSuccess,staleTime:CR}),u=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:s.isSuccess,staleTime:CR}),d=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:s.isSuccess,staleTime:CR}),f=c.data?.items??[];(0,N.useEffect)(()=>{if(f.length===0){a!==void 0&&o(void 0);return}if(i!==void 0&&f.some(e=>e.name===i)){a!==i&&o(i);return}(a===void 0||!f.some(e=>e.name===a))&&o(f[0]?.name)},[i,a,f]);let p=F({queryKey:a===void 0?Q.skillDetail(e,`none`):Q.skillDetail(e,a),queryFn:()=>r.getSkill(a),enabled:s.isSuccess&&a!==void 0,staleTime:CR}),m=yt({mutationFn:async t=>{let n=await rz({relayProjectRef:e,purpose:`skill_zip`,file:t});return r.importSkillZip(n)},onMutate:e=>n.notify({tone:`loading`,title:`Uploading skill`,message:e.name}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates);let s=r.result?.skill.name??(r.disposition.kind===`created`||r.disposition.kind===`replaced`?r.disposition.skill_name:void 0);s!==void 0&&(o(s),$(JR(e,s))),n.update(a,{tone:`success`,title:`Skill installed`,message:s??i.name})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Skill upload failed`,message:DR(e)})}}),h=yt({mutationFn:e=>r.deleteSkill({skill_name:e}),onMutate:e=>n.notify({tone:`loading`,title:`Deleting skill`,message:e}),onSuccess:(r,i,s)=>{jR(t,e,r.invalidates);let c=r.disposition.kind===`deleted`||r.disposition.kind===`not_found`?r.disposition.skill_name:a,l=f.find(e=>e.name!==c);o(l?.name),$(l===void 0?JR(e):JR(e,l.name)),n.update(s,{tone:`success`,title:`Skill deleted`,message:c??i})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Skill delete failed`,message:`${t}: ${DR(e)}`})}}),g=s.data,_=g?.generated_at??new Date(0).toISOString(),v=u.data??g?.snapshots.read_state;LR({enabled:s.isSuccess,hostClient:r,relayProjectRef:e,readState:v,scope:`skills`});let y=l.data??g?.snapshots.execution_status??zR(_),b=f.map(e=>({name:e.name,description:e.description,...e.short_description===void 0?{}:{shortDescription:e.short_description},selected:e.name===a,...e.updated_at===void 0?{}:{updatedLabel:`Updated ${Zn(e.updated_at)}`}})),x=f.find(e=>e.name===a),S=(()=>{let e=p.data?.skill;return e===void 0?a===void 0?{title:f.length===0?`No skills`:`No skill selected`,unavailableReason:f.length===0?`No user skills`:`Select a skill`}:{title:x?.name??a,...x?.description===void 0?{}:{description:x.description},unavailableReason:p.isLoading?`Loading`:`Skill unavailable`}:{title:e.name,description:e.description,...e.updated_at===void 0?{}:{updatedLabel:`Updated ${Zn(e.updated_at)}`},skillMd:e.skill_md}})(),C=c.data!==void 0,w=!C&&(s.error!==null||c.error!==null);return(0,P.jsx)(mw,{statusShortcuts:bS(y),unread:FR(v),artifactSignal:IR(d.data),skills:b,detail:S,uploadPending:m.isPending,deletePending:h.isPending,loading:!C&&(s.isLoading||c.isLoading),unavailable:w,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t),onSelectSkill:t=>{o(t),$(JR(e,t))},onUploadSkill:e=>m.mutate(e),onDeleteSkill:e=>h.mutate(e)})}function zB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap(),staleTime:CR}),r=F({queryKey:Q.projectTimeline(e),queryFn:()=>t.getProjectTimeline(),enabled:n.isSuccess,staleTime:CR}),i=F({queryKey:Q.executionStatus(e),queryFn:()=>t.getExecutionStatus(),enabled:n.isSuccess,staleTime:CR}),a=F({queryKey:Q.readState(e),queryFn:()=>t.getReadState(),enabled:n.isSuccess,staleTime:CR}),o=F({queryKey:Q.artifacts(e),queryFn:()=>t.getArtifacts(),enabled:n.isSuccess,staleTime:CR}),s=n.data,c=s?.generated_at??new Date(0).toISOString(),l=a.data??s?.snapshots.read_state,u=i.data??s?.snapshots.execution_status??zR(c),d=r.data===void 0&&(n.error!==null||r.error!==null);return(0,P.jsx)(hw,{...r.data===void 0?{}:{timeline:Lx(r.data,{onOpenWorklistTask:t=>$(WR(e,t)),onOpenChatMessage:t=>$(GR(e,t)),onOpenReferenceFile:t=>$(HR(e,t))})},statusShortcuts:bS(u),unread:FR(l),artifactSignal:IR(o.data),loading:r.data===void 0&&(n.isLoading||r.isLoading),unavailable:d,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t)})}function BB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=new URL(wR(),window.location.origin).searchParams.get(`task`)??void 0,[r,i]=(0,N.useState)(void 0),a=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap()}),o=F({queryKey:Q.worklist(e),queryFn:()=>t.getWorklist(),enabled:a.isSuccess}),s=F({queryKey:Q.executionStatus(e),queryFn:()=>t.getExecutionStatus(),enabled:a.isSuccess}),c=F({queryKey:Q.readState(e),queryFn:()=>t.getReadState(),enabled:a.isSuccess}),l=F({queryKey:Q.artifacts(e),queryFn:()=>t.getArtifacts(),enabled:a.isSuccess}),u=a.data,d=u?.generated_at??new Date(0).toISOString(),f=o.data??u?.snapshots.worklist??NR(),p=c.data??u?.snapshots.read_state;LR({enabled:a.isSuccess,hostClient:t,relayProjectRef:e,readState:p,scope:`worklist`});let m=(0,N.useMemo)(()=>Fr(f),[f]),h=n!==void 0&&m.some(e=>e.id===n),g=n!==void 0&&!h?n:void 0;(0,N.useEffect)(()=>{if(n!==void 0){i(h?e=>e===n?e:n:void 0);return}if(m.length===0){i(void 0);return}(r===void 0||!m.some(e=>e.id===r))&&i(ZR(f,void 0))},[h,n,r,m,f]);let _=F({queryKey:r===void 0?Q.taskDetail(e,`none`):Q.taskDetail(e,r),queryFn:()=>t.getTaskDetail(r),enabled:a.isSuccess&&r!==void 0}),v=F({queryKey:r===void 0?Q.taskRunResults(e,`none`):Q.taskRunResults(e,r),queryFn:()=>t.getTaskRunResults(r,{limit:50}),enabled:a.isSuccess&&r!==void 0}),y=s.data??u?.snapshots.execution_status??zR(d),b=Pr(f,r),x=Gr(_.data,v.data),S=o.data!==void 0||u?.snapshots.worklist!==void 0,C=!S&&(a.error!==null||o.error!==null);return(0,P.jsx)(gw,{statusShortcuts:bS(y),unread:FR(p),artifactSignal:IR(l.data),modules:b.modules,taskCount:b.taskCount,...x===void 0?{}:{detail:x},...g===void 0?{}:{missingTaskId:g},loading:!S&&(a.isLoading||o.isLoading),unavailable:C,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t),onSelectTask:t=>{i(t),$(WR(e,t))}})}var VB=`is-scrollbar-active`,HB=1e3;function UB(e,t){let n=e.target;return n instanceof Element?n:t.scrollingElement??t.documentElement}function WB(e){let t=new Map,n=e=>{let n=t.get(e);n!==void 0&&(window.clearTimeout(n),t.delete(e)),e.classList.remove(VB)},r=e=>{let r=t.get(e);r!==void 0&&window.clearTimeout(r),e.classList.add(VB);let i=window.setTimeout(()=>n(e),HB);t.set(e,i)},i=t=>{r(UB(t,e))};return e.addEventListener(`scroll`,i,{capture:!0,passive:!0}),()=>{e.removeEventListener(`scroll`,i,!0);for(let[e,n]of t)window.clearTimeout(n),e.classList.remove(VB);t.clear()}}var GB=`--tutti-viewport-height`,KB=`--tutti-viewport-offset-top`;function qB(e,t=window){let n=e.documentElement,r=t.visualViewport,i=()=>{let e=r?.height??t.innerHeight,i=r?.offsetTop??0;n.style.setProperty(GB,`${Math.max(0,e)}px`),n.style.setProperty(KB,`${Math.max(0,i)}px`)};return i(),t.addEventListener(`resize`,i),t.addEventListener(`orientationchange`,i),r?.addEventListener(`resize`,i),r?.addEventListener(`scroll`,i),()=>{t.removeEventListener(`resize`,i),t.removeEventListener(`orientationchange`,i),r?.removeEventListener(`resize`,i),r?.removeEventListener(`scroll`,i),n.style.removeProperty(GB),n.style.removeProperty(KB)}}var JB=new $e({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function YB(){let e=ER();if(e.kind===`local_console`)return(0,P.jsx)(Pz,{});if(e.kind===`home`)return(0,P.jsx)(bz,{});if(e.kind===`join`)return(0,P.jsx)(vz,{joinToken:e.joinToken});if(e.kind===`setup`)return(0,P.jsx)(aB,{});if(e.kind===`project_open`)return(0,P.jsx)(Wz,{requestedOpenProjectRef:e.relayProjectRef});if(e.kind===`workspace`||e.kind===`worklist`||e.kind===`references`||e.kind===`artifacts`||e.kind===`skills`||e.kind===`timeline`||e.kind===`settings`){let t=e.kind===`workspace`?(0,P.jsx)(bB,{relayProjectRef:e.relayProjectRef}):e.kind===`worklist`?(0,P.jsx)(BB,{relayProjectRef:e.relayProjectRef}):e.kind===`references`?(0,P.jsx)(NB,{relayProjectRef:e.relayProjectRef}):e.kind===`artifacts`?(0,P.jsx)(MB,{relayProjectRef:e.relayProjectRef}):e.kind===`skills`?(0,P.jsx)(RB,{relayProjectRef:e.relayProjectRef}):e.kind===`timeline`?(0,P.jsx)(zB,{relayProjectRef:e.relayProjectRef}):(0,P.jsx)(LB,{relayProjectRef:e.relayProjectRef});return(0,P.jsxs)(wB,{relayProjectRef:e.relayProjectRef,children:[t,(0,P.jsx)(TB,{relayProjectRef:e.relayProjectRef})]},e.relayProjectRef)}return(0,P.jsx)(Wz,{})}function XB(){return(0,N.useEffect)(()=>{let e=WB(document),t=qB(document);return()=>{e(),t()}},[]),(0,P.jsx)(it,{client:JB,children:(0,P.jsx)(gR,{children:(0,P.jsx)(YB,{})})})}function ZB(e){let t=document.querySelector(`link[rel="icon"]`),n=t??document.createElement(`link`);n.rel=`icon`,n.type=`image/png`,n.sizes=`1204x1204`,n.href=e,t===null&&document.head.append(n)}ZB(MS),(0,xt.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(N.StrictMode,{children:(0,P.jsx)(XB,{})}));export{L as C,ci as S,Mi as _,Td as a,di as b,Pd as c,Zi as d,Xi as f,Fi as g,Li as h,jd as i,kd as l,Bi as m,_d as n,Dd as o,qi as p,Nd as r,Md as s,Zy as t,ra as u,ji as v,tt as w,li as x,Si as y};
69
+ `){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start)}${e.slice(t.start+1)}`,t.start);return}let r=by(e).find(r=>n.key===`Backspace`?t.start>r.start&&t.start<=r.end||t.start===r.end+1&&e[r.end]===` `:t.start>=r.start&&t.start<r.end);if(r!==void 0){n.preventDefault(),y.current=null,b.current=null;let i=n.key===`Backspace`&&t.start===r.end+1&&e[r.end]===` `?r.end+1:r.end;de(`${e.slice(0,r.start)}${e.slice(i)}`,r.start);return}if(n.key===`Backspace`&&t.start>0){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start-1)}${e.slice(t.start)}`,t.start-1);return}if(n.key===`Delete`&&t.start<e.length){n.preventDefault(),y.current=null,b.current=null,de(`${e.slice(0,t.start)}${e.slice(t.start+1)}`,t.start);return}}if(t&&n.key===`Enter`){if(n.preventDefault(),r&&!n.shiftKey&&!n.metaKey){i?.closest(`form`)?.requestSubmit();return}pe();return}if(!t&&n.key===`Enter`){n.preventDefault(),i?.closest(`form`)?.requestSubmit();return}f?.(n)},ye=t=>{if(v.current||Ty(t))return;let n=h.current;if(n===null)return;let r=M(n),i=se(n).end,a=me(r,i),o=a?.nextValue??r,s=a?.nextCaret??i,c=Ey(t);if(c.inputType===`insertText`&&Dy(c.data)){let t=s-c.data.length,n=`${o.slice(0,t)}${o.slice(s)}`;y.current=t>=0&&n===e?{data:c.data,start:t,end:s,valueBefore:n,createdAt:Date.now()}:null}else y.current=null;let l=he(o,s,void 0,!0);de(l.nextValue,l.nextCaret)},be=e=>{if(v.current||Ty(e))return;let t=Ey(e);if(t.inputType===`insertParagraph`||t.inputType===`insertLineBreak`){pe()&&e.preventDefault();return}y.current=null},xe=t=>{t.preventDefault();let n=t.clipboardData.getData(`text/plain`),r=h.current;if(r===null)return;let i=se(r);de(`${e.slice(0,i.start)}${n}${e.slice(i.end)}`,i.start+n.length)},Se=()=>{let e=h.current;e===null||!ae(e)||E(se(e).end)},Ce=R(`mention-input-editor`,t?`is-multiline`:`is-singleline`,c),we=ne?(0,P.jsx)(`div`,{className:`mention-menu`,id:S,role:`listbox`,"aria-label":`Mention people`,children:te.map((e,t)=>(0,P.jsx)(`button`,{className:R(`mention-option`,t===A?`is-selected`:void 0),type:`button`,role:`option`,id:`${S}-option-${t}`,"aria-selected":t===A,onMouseEnter:()=>D(t),onMouseDown:t=>{t.preventDefault(),ue(e)},children:(0,P.jsxs)(`span`,{className:`mention-option-text`,children:[`@`,e.handle]})},e.id))}):null,Te=a?.current;return(0,P.jsxs)(`span`,{className:R(`mention-input`,t?`is-multiline`:void 0),children:[(0,P.jsx)(`div`,{className:Ce,contentEditable:!ie,role:`textbox`,"aria-label":j,"aria-multiline":t,"aria-disabled":ie,"aria-expanded":ne,...ne?{"aria-controls":S}:{},...re===void 0?{}:{"aria-activedescendant":re},"data-placeholder":m.placeholder,"data-max-rows":n,onBlur:e=>{w(!1),l?.(e)},onClick:e=>{Se(),u?.(e)},onFocus:e=>{w(!0),Se(),d?.(e)},onCompositionStart:()=>{v.current=!0;let e=h.current,t=y.current;if(y.current=null,e!==null&&t!==null&&Date.now()-t.createdAt<500&&M(e).slice(t.start,t.end)===t.data){b.current=t,_.current=null,E(t.start),s(t.valueBefore);let n=yy(t.valueBefore,null);wy(e,n),x.current=Sy(n),ce(e,t.start)}else b.current=null},onCompositionEnd:e=>{v.current=!1;let t=Ey(e);_e(t.data===null?{}:{compositionData:t.data})},onBeforeInput:be,onInput:ye,onKeyDown:ve,onKeyUp:e=>{!v.current&&!Ty(e)&&Se(),p?.(e)},onPaste:xe,ref:h,suppressContentEditableWarning:!0}),Te==null?we:(0,vc.createPortal)(we,Te)]})}function jy(e){return(0,P.jsx)(Fi,{...e})}function My({avatar:e,author:t,time:n,children:r,system:i=!1,className:a,...o}){return(0,P.jsxs)(`article`,{className:R(`message`,i?`is-system`:void 0,a),...o,children:[(0,P.jsxs)(`div`,{className:`message-byline`,children:[e,(0,P.jsxs)(`div`,{className:`message-meta`,children:[(0,P.jsx)(`span`,{className:`message-author`,children:t}),n===void 0?null:(0,P.jsx)(`span`,{className:`message-time`,children:n})]})]}),(0,P.jsx)(`div`,{className:`message-content`,children:(0,P.jsx)(`div`,{className:`message-card`,children:r})})]})}function Ny({children:e,className:t,...n}){return(0,P.jsx)(`div`,{className:R(`message-markdown`,t),...n,children:(0,P.jsx)(iy,{components:Wy,children:e})})}function Py({children:e}){return(0,P.jsx)(`p`,{children:Oy(e)})}function Fy({children:e}){return(0,P.jsx)(`li`,{children:Oy(e)})}function Iy({children:e}){return(0,P.jsx)(`strong`,{children:Oy(e)})}function Ly({children:e}){return(0,P.jsx)(`em`,{children:Oy(e)})}function Ry({children:e}){return(0,P.jsx)(`h1`,{children:Oy(e)})}function zy({children:e}){return(0,P.jsx)(`h2`,{children:Oy(e)})}function By({children:e}){return(0,P.jsx)(`h3`,{children:Oy(e)})}function Vy({children:e}){return(0,P.jsx)(`h4`,{children:Oy(e)})}function Hy({children:e}){return(0,P.jsx)(`h5`,{children:Oy(e)})}function Uy({children:e}){return(0,P.jsx)(`h6`,{children:Oy(e)})}var Wy={p:Py,li:Fy,strong:Iy,em:Ly,h1:Ry,h2:zy,h3:By,h4:Vy,h5:Hy,h6:Uy};function Gy({name:e,category:t,imageUrl:n,className:r,"aria-label":i,...a}){let o=t===`image`&&n!==void 0;return(0,P.jsx)(`button`,{type:`button`,"aria-label":i??`Open ${t===`image`?`image`:`file`} ${e}`,className:R(`reference-message-card`,t===`image`?`is-image`:`is-file`,r),...a,children:o?(0,P.jsx)(`img`,{className:`reference-message-image`,src:n,alt:e,loading:`lazy`,decoding:`async`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`reference-message-icon`,"aria-hidden":`true`,children:t===`image`?(0,P.jsx)(Ei,{}):(0,P.jsx)(Ci,{})}),(0,P.jsx)(`span`,{className:`reference-message-main`,children:(0,P.jsx)(`strong`,{children:e})})]})})}function Ky({children:e,composer:t,empty:n,title:r=`Chat`,subtitle:i,actions:a,streamRef:o,streamOverlay:s,onStreamScroll:c,dropUploadPending:l=!1,onDropFiles:u,className:d,...f}){return(0,P.jsxs)(dy,{className:R(`panel chat-panel chat-primary`,d),"aria-label":`Group chat`,dropLabel:`Drop references to upload`,pending:l,onFilesUpload:u,...f,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(jy,{"aria-hidden":`true`})}),(0,P.jsxs)(`div`,{className:`panel-title-copy`,children:[(0,P.jsx)(`h3`,{children:r}),i===void 0?null:(0,P.jsx)(`div`,{className:`panel-subtitle`,children:i})]})]}),a===void 0?null:(0,P.jsx)(`div`,{className:`panel-actions`,children:a})]}),(0,P.jsxs)(`div`,{className:`chat-stream-frame`,children:[(0,P.jsx)(`div`,{className:`chat-stream`,ref:o,onScroll:c,children:e??n}),s===void 0?null:(0,P.jsx)(`div`,{className:`chat-stream-overlay`,children:s})]}),t]})}function qy({value:e,placeholder:t,ariaLabel:n,maxLength:r,saving:i=!1,disabled:a=!1,allowEmpty:o=!1,onUpdate:s,className:c,...l}){let u=(0,N.useRef)(null),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(e),[h,g]=(0,N.useState)(!1),_=i||h,v=!a&&!_&&s!==void 0,y=e.trim(),b=y.length===0;(0,N.useEffect)(()=>{d||m(e)},[d,e]),(0,N.useEffect)(()=>{d&&(u.current?.focus(),u.current?.select())},[d]);let x=()=>{m(e),f(!1)},S=()=>{let e=p.trim();if(!o&&e.length===0){x();return}if(e===y){f(!1);return}s===void 0||_||(g(!0),Promise.resolve(s(e)).then(()=>{f(!1)}).catch(()=>void 0).finally(()=>{g(!1)}))},C=e=>{if(e.key===`Enter`){e.preventDefault(),S();return}e.key===`Escape`&&(e.preventDefault(),x())};return(0,P.jsx)(`span`,{className:R(`inline-editable-text`,b?`is-empty`:void 0,d?`is-editing`:void 0,v?void 0:`is-disabled`,c),...l,children:d?(0,P.jsx)(`input`,{ref:u,className:`inline-editable-text-input`,"aria-label":n,value:p,maxLength:r,disabled:_,onBlur:S,onChange:e=>m(e.currentTarget.value),onKeyDown:C}):(0,P.jsx)(`button`,{className:`inline-editable-text-button`,type:`button`,"aria-label":n,disabled:!v,onClick:()=>f(!0),children:b?t:y})})}var Jy={bare:``,quiet:`quiet-button`,pill:`pill-action`,action:`action-button`};function Yy({variant:e=`pill`,label:t,pendingLabel:n=t,pending:r=!1,disabled:i=!1,iconOnly:a=!1,accept:o,icon:s,onFileUpload:c,className:l,...u}){let d=i||r||c===void 0,f=r?n:t,p=e=>{let t=e.currentTarget.files?.[0];e.currentTarget.value=``,t!==void 0&&c?.(t)};return(0,P.jsxs)(`label`,{...u,className:R(Jy[e],d?`is-disabled`:void 0,l),"aria-disabled":d,"aria-busy":r,"aria-label":u[`aria-label`]??f,title:u.title??f,children:[(0,P.jsx)(`input`,{type:`file`,accept:o,disabled:d,onChange:p}),s??(r?(0,P.jsx)(Mi,{className:`is-spinning`,"aria-hidden":`true`}):(0,P.jsx)(_i,{"aria-hidden":`true`})),a?null:(0,P.jsx)(`span`,{children:f})]})}function Xy({value:e,pending:t=!1,uploadPending:n=!1,placeholder:r=`Write a message`,mentionOptions:i,onValueChange:a,onComposerSubmit:o,onFileUpload:s,className:c,...l}){let[u,d]=(0,N.useState)(0),f=(0,N.useRef)(null);return(0,P.jsx)(`form`,{className:R(`composer`,c),"aria-label":`Message composer`,onSubmit:o,...l,children:(0,P.jsxs)(`div`,{className:`composer-input-shell`,ref:f,children:[(0,P.jsx)(Ay,{"aria-label":`Message`,placeholder:r,value:e,multiline:!0,maxRows:8,submitOnEnter:!0,mentionRequestKey:u,menuPortalTargetRef:f,...i===void 0?{}:{mentionOptions:i},onValueChange:a}),(0,P.jsxs)(`div`,{className:`composer-tools`,"aria-label":`Message tools`,children:[(0,P.jsx)(`button`,{className:`composer-tool-button composer-mention-button`,type:`button`,"aria-label":`Mention people`,title:`Mention people`,onClick:()=>d(e=>e+1),children:(0,P.jsx)(oi,{"aria-hidden":`true`})}),(0,P.jsx)(Yy,{variant:`bare`,className:`composer-tool-button composer-upload-button`,label:`Upload image`,pendingLabel:`Uploading image`,pending:n,accept:`image/*`,icon:(0,P.jsx)(Ei,{"aria-hidden":`true`}),iconOnly:!0,onFileUpload:s}),(0,P.jsx)(Yy,{variant:`bare`,className:`composer-tool-button composer-upload-button`,label:`Upload file`,pendingLabel:`Uploading file`,pending:n,icon:(0,P.jsx)(Ci,{"aria-hidden":`true`}),iconOnly:!0,onFileUpload:s}),(0,P.jsx)(`button`,{className:`composer-tool-button composer-send-button`,type:`submit`,disabled:e.trim()===``||t,"aria-label":t?`Sending message`:`Send message`,title:t?`Sending message`:`Send message`,children:(0,P.jsx)(Ki,{"aria-hidden":`true`})})]})]})})}function Zy(e){return(0,P.jsx)(Ri,{...e})}var Qy={a:{advance:504,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 94.5 L346 284 L315 126 L315 31.5 L346 0 L378 0 L441 31.5 L472 63 L536 158`]},b:{advance:441,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 220 L63 31.5 L94.5 0 L126 0 L189 31.5 L252 94.5 L284 189 L284 284 L315 158 L346 126 L410 126 L472 158`]},c:{advance:346,strokes:[`M252 220 L252 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L220 0 L315 63 L378 158`]},d:{advance:504,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 94.5 L472 662`,`M346 284 L315 126 L315 31.5 L346 0 L378 0 L441 31.5 L472 63 L536 158`]},e:{advance:315,strokes:[`M63 63 L126 94.5 L158 126 L189 189 L189 252 L158 284 L126 284 L63 252 L31.5 189 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 63 L346 158`]},f:{advance:252,strokes:[`M31.5 158 L158 315 L220 410 L252 472 L284 567 L284 630 L252 662 L189 630 L158 567 L94.5 315 L0 31.5 L-94.5 -189 L-126 -284 L-126 -346 L-94.5 -378 L-31.5 -346 L0 -252 L31.5 31.5 L63 0 L126 0 L189 31.5 L220 63 L284 158`]},g:{advance:472,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 63`,`M346 284 L284 63 L158 -284 L126 -346 L63 -378 L31.5 -346 L31.5 -284 L63 -189 L158 -94.5 L252 -31.5 L315 0 L410 63 L504 158`]},h:{advance:472,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 252 L31.5 0`,`M31.5 0 L63 94.5 L94.5 158 L158 252 L220 284 L284 284 L315 252 L315 189 L284 94.5 L284 31.5 L315 0 L346 0 L410 31.5 L441 63 L504 158`]},i:{advance:220,strokes:[`M31.5 158 L94.5 284 L31.5 94.5 L31.5 31.5 L63 0 L94.5 0 L158 31.5 L189 63 L252 158`],accents:[`M126 441 L126 410 L158 410 L158 441 L126 441`]},j:{advance:220,strokes:[`M31.5 158 L94.5 284 L-94.5 -284 L-126 -346 L-189 -378 L-220 -346 L-220 -284 L-189 -189 L-94.5 -94.5 L0 -31.5 L63 0 L158 63 L252 158`],accents:[`M126 441 L126 410 L158 410 L158 441 L126 441`]},k:{advance:441,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 252 L31.5 0`,`M31.5 0 L63 94.5 L94.5 158 L158 252 L220 284 L284 284 L315 252 L315 189 L252 158 L158 158`,`M158 158 L220 126 L252 31.5 L284 0 L315 0 L378 31.5 L410 63 L472 158`]},l:{advance:252,strokes:[`M31.5 158 L94.5 252 L189 410 L220 472 L252 567 L252 630 L220 662 L158 630 L126 567 L94.5 441 L63 220 L63 31.5 L94.5 0 L126 0 L189 31.5 L220 63 L284 158`]},m:{advance:788,strokes:[`M31.5 158 L94.5 252 L158 284 L189 252 L189 220 L158 94.5 L126 0`,`M158 94.5 L189 158 L252 252 L315 284 L378 284 L410 252 L410 220 L378 94.5 L346 0`,`M378 94.5 L410 158 L472 252 L536 284 L598 284 L630 252 L630 189 L598 94.5 L598 31.5 L630 0 L662 0 L724 31.5 L756 63 L819 158`]},n:{advance:567,strokes:[`M31.5 158 L94.5 252 L158 284 L189 252 L189 220 L158 94.5 L126 0`,`M158 94.5 L189 158 L252 252 L315 284 L378 284 L410 252 L410 189 L378 94.5 L378 31.5 L410 0 L441 0 L504 31.5 L536 63 L598 158`]},o:{advance:441,strokes:[`M220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5 L284 63 L315 126 L315 189 L284 252 L220 284 L189 252 L189 189 L220 126 L284 94.5 L378 94.5 L441 126 L472 158`]},p:{advance:472,strokes:[`M31.5 158 L94.5 252 L126 315 L94.5 189 L-94.5 -378`,`M94.5 189 L126 252 L189 284 L252 284 L315 252 L346 189 L346 126 L315 63 L284 31.5 L220 0`,`M94.5 31.5 L158 0 L252 0 L346 31.5 L410 63 L504 158`]},q:{advance:472,strokes:[`M315 189 L284 252 L220 284 L158 284 L94.5 252 L63 220 L31.5 158 L31.5 94.5 L63 31.5 L126 0 L189 0 L252 31.5`,`M346 284 L315 189 L252 31.5 L158 -189 L126 -284 L126 -346 L158 -378 L220 -346 L252 -252 L252 -31.5 L315 0 L410 63 L504 158`]},r:{advance:410,strokes:[`M31.5 158 L94.5 252 L126 315 L126 252 L220 252 L252 220 L252 158 L220 63 L220 31.5 L252 0 L284 0 L346 31.5 L378 63 L441 158`]},s:{advance:346,strokes:[`M31.5 158 L94.5 252 L126 315 L126 252 L189 158 L220 94.5 L220 31.5 L158 0`,`M31.5 31.5 L94.5 0 L220 0 L284 31.5 L315 63 L378 158`]},t:{advance:284,strokes:[`M31.5 158 L94.5 252 L158 378`,`M252 662 L63 94.5 L63 31.5 L94.5 0 L158 0 L220 31.5 L252 63 L315 158`],accents:[`M63 410 L284 410`]},u:{advance:472,strokes:[`M31.5 158 L94.5 284 L31.5 94.5 L31.5 31.5 L63 0 L126 0 L189 31.5 L252 94.5 L315 189`,`M346 284 L284 94.5 L284 31.5 L315 0 L346 0 L410 31.5 L441 63 L504 158`]},v:{advance:472,strokes:[`M31.5 158 L94.5 284 L63 126 L63 31.5 L94.5 0 L126 0 L220 31.5 L284 94.5 L315 189 L315 284`,`M315 284 L346 158 L378 126 L441 126 L504 158`]},w:{advance:662,strokes:[`M126 284 L63 220 L31.5 126 L31.5 63 L63 0 L126 0 L189 31.5 L252 94.5`,`M315 284 L252 94.5 L252 31.5 L284 0 L346 0 L410 31.5 L472 94.5 L504 189 L504 284`,`M504 284 L536 158 L567 126 L630 126 L693 158`]},x:{advance:504,strokes:[`M31.5 158 L94.5 252 L158 284 L220 284 L252 252 L252 31.5 L284 0 L378 0 L472 63 L536 158`,`M441 252 L410 284 L346 284 L315 252 L189 31.5 L158 0 L94.5 0 L63 31.5`]},y:{advance:472,strokes:[`M31.5 158 L94.5 284 L31.5 94.5 L31.5 31.5 L63 0 L126 0 L189 31.5 L252 94.5 L315 189`,`M346 284 L158 -284 L126 -346 L63 -378 L31.5 -346 L31.5 -284 L63 -189 L158 -94.5 L252 -31.5 L315 0 L410 63 L504 158`]},z:{advance:441,strokes:[`M31.5 158 L94.5 252 L158 284 L220 284 L284 220 L284 158 L252 94.5 L189 31.5 L94.5 0 L158 -31.5 L189 -94.5 L189 -189 L158 -284 L126 -346 L63 -378 L31.5 -346 L31.5 -284 L63 -189 L158 -94.5 L252 -31.5 L378 63 L472 158`]}},$y=[{id:`collaboration`,weight:30,words:`aligning.pairing.joining.syncing.sharing.weaving.blending.bridging.linking.merging.uniting.teaming.huddling.gathering.relaying.listening.helping.guiding.shaping.connecting.combining.supporting.assisting.exchanging.conversing.adapting.partnering.allying.chatting.consulting.conferring.responding.cooperating`.split(`.`)},{id:`context`,weight:35,words:`reading.noting.jotting.drafting.writing.mapping.sorting.sifting.grouping.capturing.recapping.reviewing.refining.distilling.curating.reflecting.outlining.planning.framing.clarifying.tracing.scanning.parsing.thinking.exploring.studying.checking.polishing.revising.editing.annotating.organizing.focusing.preparing.sketching.collecting.discerning.condensing.digesting.extracting.structuring.surfacing.orienting.grounding.noticing.pondering.considering.reasoning`.split(`.`)},{id:`music`,weight:25,words:`tuning.attuning.cueing.riffing.jamming.humming.echoing.arranging.composing.rehearsing.flowing.scoring.phrasing.voicing.conducting.playing.resonating.balancing.reprising.performing.grooving.tapping.strumming.singing.rhyming.dancing.swaying.drumming.plucking.chanting.whistling`.split(`.`)},{id:`playful`,weight:10,words:`brewing.steeping.simmering.whisking.doodling.tinkering.noodling.puzzling.sprouting.unfurling.vibing.musing.roaming.stitching.threading.blooming.glowing.buzzing.cooking.stirring.mixing.rolling.gliding.looping.twirling.dreaming.imagining.conjuring.hatching.unfolding.shuffling.percolating.scribbling.whittling.bubbling.fizzing.sparkling.whirring.wobbling.growing.ripening.wondering.inventing.crafting`.split(`.`)}];$y.reduce((e,t)=>e+t.words.length,0);function eb(e){return Math.min(.999999,Math.max(0,e()))}function tb(e,t){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(eb(t)*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}function nb(e=Math.random,t=()=>!0){let n=$y.map(e=>({...e,words:e.words.filter(t)})).filter(e=>e.words.length>0),r=n.length>0?n:$y,i=new Map,a=r.reduce((e,t)=>e+t.weight,0),o;return()=>{let t=eb(e)*a,n=r.find(e=>(t-=e.weight,t<0))??r[0],s=i.get(n.id);(s===void 0||s.length===0)&&(s=tb(n.words,e),i.set(n.id,s));let c=s.pop()??n.words[0];return c===o&&s.length>0&&(s.unshift(c),c=s.pop()??n.words[0]),o=c,c}}var rb=.078,ib=57,ab=4,ob=.1,sb=.7,cb=.84,lb=.94,ub=.012,db=1.5,fb=24;function pb(e,t,n){return Math.min(n,Math.max(t,e))}function mb(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function hb(e){return Number(e.toFixed(3)).toString()}function gb(e,t){let n=e.match(/-?\d+(?:\.\d+)?/gu)?.map(Number)??[],r=[];for(let e=0;e<n.length-1;e+=2)r.push({x:t+(n[e]??0)*rb,y:ib-(n[e+1]??0)*rb});return r}function _b(e){if(e.length===0)return``;let t=e[0],n=[`M ${hb(t.x)} ${hb(t.y)}`];for(let t of e.slice(1))n.push(`L ${hb(t.x)} ${hb(t.y)}`);return n.join(` `)}function vb(e){if(e.length<3)return[...e];let t=.22,n=[...e];for(let e=0;e<3;e+=1){let e=[n[0]];for(let r=0;r<n.length-1;r+=1){let i=n[r],a=n[r+1];e.push({x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t},{x:i.x*t+a.x*(1-t),y:i.y*t+a.y*(1-t)})}e.push(n[n.length-1]),n=e}return n}function yb(e){if(e.length<3)return _b(e);let t=.9,n=e[0],r=[`M ${hb(n.x)} ${hb(n.y)}`];for(let n=0;n<e.length-1;n+=1){let i=e[Math.max(0,n-1)],a=e[n],o=e[n+1],s=e[Math.min(e.length-1,n+2)],c={x:a.x+(o.x-i.x)*t/6,y:a.y+(o.y-i.y)*t/6},l={x:o.x-(s.x-a.x)*t/6,y:o.y-(s.y-a.y)*t/6};r.push(`C ${hb(c.x)} ${hb(c.y)} ${hb(l.x)} ${hb(l.y)} ${hb(o.x)} ${hb(o.y)}`)}return r.join(` `)}function bb(e){let t=ab,n=[],r=[],i=[];for(let[a,o]of[...e.toLowerCase()].entries()){let e=Qy[o];if(e!==void 0){for(let[r,o]of e.strokes.entries()){let e=vb(gb(o,t));i.push(...e),n.push({id:`${a}:body:${r}`,path:yb(e),role:`body`})}for(let[n,o]of(e.accents??[]).entries()){let e=gb(o,t);i.push(...e),r.push({id:`${a}:accent:${n}`,path:_b(e),role:`accent`})}t+=e.advance*rb}}if(i.length===0)return{height:fb,strokes:[],viewBox:`0 0 64 64`,width:fb};let a=i.map(e=>e.x),o=i.map(e=>e.y),s=Math.floor(Math.min(0,...a.map(e=>e-6))),c=Math.ceil(Math.max(t,...a.map(e=>e+6))),l=Math.floor(Math.min(0,...o.map(e=>e-4))),u=Math.ceil(Math.max(64,...o.map(e=>e+4))),d=c-s,f=u-l;return{height:fb,strokes:[...n,...r],viewBox:`${s} ${l} ${d} ${f}`,width:Number((d*fb/f).toFixed(2))}}var xb=nb(Math.random,e=>bb(e).width<=96);function Sb(e){for(let t of e.strokes)t.path.style.opacity=`0`,t.path.style.strokeDashoffset=`${t.length}`}function Cb(e){for(let t of e.strokes)t.path.style.opacity=`1`,t.path.style.strokeDashoffset=`0`}function wb(e,t,n){let r=t;for(let[t,i]of e.strokes.entries()){if(i.path.style.opacity=`${n}`,r<=0){i.path.style.strokeDashoffset=`${i.length}`;continue}let a=Math.min(i.length,r);if(i.path.style.strokeDashoffset=`${i.length-a}`,r-=a,a<i.length)break;if(t<e.strokes.length-1){if(r<e.transitionLength)break;r-=e.transitionLength}}}function Tb(e,t){let n=t%e.duration/e.duration;if(n<ob||n>=lb){Sb(e);return}if(n<=sb){wb(e,mb(pb((n-ob)/(sb-ob),0,1))*e.totalLength,1);return}let r=n<=cb?1:1-pb((n-cb)/(lb-cb),0,1);wb(e,e.totalLength,r)}function Eb({word:e,className:t,...n}){let[r]=(0,N.useState)(()=>e??xb()),i=e??r,a=(0,N.useMemo)(()=>bb(i),[i]),o=(0,N.useRef)(null);return(0,N.useEffect)(()=>{let e=o.current;if(e===null)return;let t=[...e.querySelectorAll(`[data-writing-stroke]`)].map(e=>{let t=e.getTotalLength();return e.style.strokeDasharray=`${t} ${t}`,e.style.strokeDashoffset=`${t}`,{length:t,path:e}});if(t.length===0)return;let n=t.reduce((e,t)=>e+t.length,0),r=n*ub,i=n+r*Math.max(0,t.length-1),a={duration:pb(4e3+i*4.4,5e3,7600)*db,strokes:t,totalLength:i,transitionLength:r},s=window.matchMedia(`(prefers-reduced-motion: reduce)`),c,l,u=()=>{c!==void 0&&(window.cancelAnimationFrame(c),c=void 0)},d=e=>{l===void 0&&(l=e-a.duration*ob),Tb(a,e-l),c=window.requestAnimationFrame(d)},f=()=>{if(u(),s.matches){Cb(a);return}Sb(a),l=void 0,c=window.requestAnimationFrame(d)};return s.addEventListener(`change`,f),f(),()=>{s.removeEventListener(`change`,f),u()}},[a]),(0,P.jsxs)(`span`,{className:R(`scratchpad-writing-indicator`,t),role:`status`,"aria-label":`Refreshing Scratchpad`,"data-writing-word":i,...n,children:[(0,P.jsx)(zi,{"aria-hidden":`true`,className:`scratchpad-writing-icon`}),(0,P.jsx)(`svg`,{"aria-hidden":`true`,className:`scratchpad-writing-canvas`,focusable:`false`,height:a.height,ref:o,viewBox:a.viewBox,width:a.width,children:a.strokes.map(e=>(0,P.jsx)(`path`,{d:e.path,"data-writing-role":e.role,"data-writing-stroke":``},e.id))})]})}var Db={confirmed:(0,P.jsx)(li,{"aria-hidden":`true`}),question:(0,P.jsx)(pi,{"aria-hidden":`true`}),"task-change":(0,P.jsx)(Zi,{"aria-hidden":`true`})};function Ob({kind:e,children:t,className:n,...r}){return(0,P.jsxs)(`div`,{className:R(`scratchpad-row`,`is-${e}`,n),...r,children:[(0,P.jsx)(`span`,{className:`scratchpad-marker`,"aria-hidden":`true`,children:Db[e]}),(0,P.jsx)(`p`,{children:t})]})}function kb({compiledTasks:e=[],onOpenCompiledTask:t}){return(0,P.jsxs)(`section`,{className:`scratchpad-submitted-receipt`,"aria-label":`Submitted to Worklist`,children:[(0,P.jsxs)(`div`,{className:`scratchpad-submitted-receipt-header`,children:[(0,P.jsx)(`strong`,{children:`Submitted to Worklist`}),(0,P.jsx)(li,{className:`scratchpad-submitted-receipt-check`,"aria-hidden":`true`})]}),e.length===0?(0,P.jsxs)(`div`,{className:`scratchpad-submitted-empty`,role:`status`,children:[(0,P.jsx)(Zi,{"aria-hidden":`true`}),(0,P.jsxs)(`span`,{className:`scratchpad-submitted-empty-copy`,children:[(0,P.jsx)(`span`,{children:`No new task created`}),(0,P.jsx)(`small`,{children:`This Scratchpad was submitted, but no Worklist task was added.`})]})]}):(0,P.jsx)(`div`,{className:`scratchpad-submitted-task-list`,children:e.map(e=>(0,P.jsxs)(`button`,{className:`scratchpad-submitted-task`,disabled:t===void 0,onClick:()=>t?.(e.taskId),type:`button`,children:[(0,P.jsxs)(`span`,{className:`scratchpad-submitted-task-copy`,children:[(0,P.jsx)(`span`,{children:e.title}),(0,P.jsx)(`small`,{children:e.moduleName})]}),(0,P.jsx)(di,{"aria-hidden":`true`})]},e.taskId))})]})}function Ab({title:e,summary:t,sections:n,updatedLabel:r,updatedLabelPrefix:i=`Updated`,footerNote:a,submitAvailable:o,pages:s,empty:c,actionsDisabled:l=!1,compact:u=!1,syncPending:d=!1,submitPending:f=!1,onSubmitScratchpad:p,onOpenCompiledTask:m,className:h,...g}){let _=s!==void 0&&s.length>0,v=(0,N.useMemo)(()=>s!==void 0&&s.length>0?s:[{key:`current`,title:e,summary:t,sections:n,...r===void 0?{}:{updatedLabel:r},updatedLabelPrefix:i,...a===void 0?{}:{footerNote:a},...o===void 0?{}:{submitAvailable:o}}],[a,s,n,o,t,e,r,i]),y=Math.max(0,v.length-1),b=v[y]?.key,[x,S]=(0,N.useState)(y);(0,N.useEffect)(()=>{S(y)},[y,b]);let C=Math.min(x,Math.max(0,v.length-1)),w=v[C]??{key:`current`,title:e,summary:t,sections:n,...r===void 0?{}:{updatedLabel:r},updatedLabelPrefix:i,...a===void 0?{}:{footerNote:a},...o===void 0?{}:{submitAvailable:o}},T=d||f,E=w.submitAvailable??w.sections.length>0,ee=l||T||!E||w.submitted===!0;return(0,P.jsx)(ma,{title:`Scratchpad`,icon:(0,P.jsx)(Zy,{"aria-hidden":`true`}),className:R(`scratchpad-panel`,u?`is-compact`:void 0,h),"aria-busy":T,...g,children:(0,P.jsxs)(`div`,{className:`scratchpad-panel-body scratchpad`,children:[!_&&w.sections.length===0?c??(0,P.jsx)(`div`,{}):(0,P.jsxs)(`div`,{className:R(`scratchpad-content`,w.submitted===!0?`is-submitted`:void 0),children:[(0,P.jsx)(`div`,{className:`scratchpad-head`,children:(0,P.jsx)(`div`,{children:(0,P.jsx)(`h4`,{children:w.title})})}),(0,P.jsx)(`p`,{className:`scratchpad-summary`,children:w.summary}),w.sections.map(e=>(0,P.jsxs)(`section`,{className:`scratchpad-section`,"aria-labelledby":e.id,children:[(0,P.jsx)(`span`,{className:`scratchpad-label`,id:e.id,children:e.label}),(0,P.jsx)(`div`,{className:`scratchpad-list`,children:e.rows.map(t=>(0,P.jsx)(Ob,{kind:t.kind,children:t.text},`${e.id}:${t.text}`))})]},e.id)),w.submitted===!0?(0,P.jsx)(kb,{compiledTasks:w.compiledTasks??[],...m===void 0?{}:{onOpenCompiledTask:m}}):null]},w.key),!u&&v.length>1?(0,P.jsx)(`div`,{className:`scratchpad-history-nav`,children:(0,P.jsx)(pa,{"aria-label":`Scratchpad history`,currentPage:C,maxVisible:7,pageAriaLabel:e=>`Scratchpad page ${e+1}`,pageCount:v.length,onPageChange:S})}):null,(0,P.jsxs)(`div`,{className:`scratchpad-footer`,children:[w.footerNote===void 0?null:(0,P.jsx)(`p`,{className:R(`scratchpad-footer-note`,w.footerNote.tone===`error`?`is-error`:void 0),title:w.footerNote.text,children:w.footerNote.text}),u&&!d?null:(0,P.jsx)(`div`,{className:`scratchpad-submit-context`,children:d?(0,P.jsx)(Eb,{}):w.updatedLabel===void 0?null:(0,P.jsxs)(`span`,{className:`scratchpad-updated-at`,children:[(0,P.jsx)(`span`,{children:w.updatedLabelPrefix??`Updated`}),(0,P.jsx)(`span`,{children:w.updatedLabel})]})}),(0,P.jsx)(`div`,{className:`scratchpad-footer-actions`,children:(0,P.jsxs)(xs,{className:R(`scratchpad-submit-button`,f?`is-submitting`:void 0),type:`button`,"aria-busy":f,disabled:ee,onClick:p,children:[f?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(Bi,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:f?`Running`:`Run`})]})})]})]})})}function jb(e){return e===`done`?(0,P.jsx)(li,{"aria-hidden":`true`}):e===`failed`?(0,P.jsx)(mi,{"aria-hidden":`true`}):e===`pending`?(0,P.jsx)(na,{"aria-hidden":`true`}):e===`running`?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(hi,{"aria-hidden":`true`})}function Mb(e){return e===`complete`?`Complete`:e===`failed`?`Failed`:e===`pending`?`Needs input`:`Running`}function Nb(e){return(0,P.jsx)(ra,{"aria-hidden":`true`,"data-tone":e})}function Pb({title:e,summary:t,tone:n,steps:r,metaLabel:i,className:a,...o}){let s=i??Mb(n),c=o[`aria-label`]??`${e}. ${s}. ${t}`;return(0,P.jsx)(ma,{title:e,icon:Nb(n),className:R(`execution-progress-panel`,`is-${n}`,a),"aria-label":c,...o,children:(0,P.jsx)(`div`,{className:`execution-progress-body`,children:(0,P.jsx)(`div`,{className:`execution-progress-list`,children:r.map(e=>(0,P.jsxs)(`div`,{className:R(`execution-progress-step`,`is-${e.status}`),children:[(0,P.jsx)(`span`,{className:R(`execution-progress-marker`,`is-${e.status}`),"aria-hidden":`true`,children:jb(e.status)}),(0,P.jsxs)(`span`,{className:`execution-progress-step-content`,children:[(0,P.jsxs)(`span`,{className:`execution-progress-step-title`,children:[(0,P.jsx)(`span`,{className:`execution-progress-step-label`,children:e.label}),e.elapsedLabel===void 0?null:(0,P.jsxs)(`span`,{className:`execution-progress-step-elapsed`,children:[` `,`(`,e.elapsedLabel,`)`]})]}),e.detail===void 0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-detail`,children:e.detail}),e.metrics===void 0||e.metrics.length===0?null:(0,P.jsx)(`span`,{className:`execution-progress-step-metrics`,children:e.metrics.map(e=>(0,P.jsx)(`span`,{className:`execution-progress-step-metric`,children:e},e))})]})]},e.id))})})})}function Fb({tone:e=`neutral`,compact:t=!1,asChild:n=!1,className:r,...i}){return(0,P.jsx)(n?as:`div`,{className:R(`chat-event-card`,`is-${e}`,t?`is-compact`:void 0,r),...i})}function Ib({as:e=`div`,icon:t,title:n,meta:r,action:i,className:a,...o}){return(0,P.jsxs)(e,{className:R(`chat-event-card-header`,a),...o,children:[(0,P.jsx)(Lb,{children:t}),(0,P.jsxs)(`span`,{className:`chat-event-card-title`,children:[(0,P.jsx)(`strong`,{children:n}),r===void 0?null:(0,P.jsx)(`span`,{className:`chat-event-card-meta`,children:r})]}),i]})}function Lb({className:e,...t}){return(0,P.jsx)(`span`,{className:R(`chat-event-card-status-icon`,e),...t})}function Rb({className:e,...t}){return(0,P.jsx)(`div`,{className:R(`chat-event-card-body`,e),...t})}function zb({className:e,...t}){return(0,P.jsx)(`footer`,{className:R(`chat-event-card-footer`,e),...t})}function Bb(e){return e===`done`?`success`:e===`failed`?`danger`:e===`pending`?`warning`:`neutral`}function Vb(e){return e===`done`?(0,P.jsx)(li,{"aria-hidden":`true`}):e===`failed`?(0,P.jsx)(ia,{"aria-hidden":`true`}):(0,P.jsx)(Pi,{"aria-hidden":`true`})}function Hb({title:e,summary:t,request:n,messages:r,draft:i,contextLabel:a,defaultOpen:o,readOnly:s=!1,replyCount:c,status:l,statusLabel:u,mentionOptions:d,sendPending:f=!1,submitPending:p=!1,onDraftChange:m,onSendMessage:h,onSubmitRound:g,className:_,...v}){let y=t.trim()===``?n:t,b=a===void 0?y:`${y} (${a})`,[x,S]=(0,N.useState)(o??!0),C=l??(s?`done`:`pending`),w=u??(s?`submitted`:`needs input`),T=c??r.length,E=p||T===0,ee=T===0?`No replies`:`${T} ${T===1?`reply`:`replies`}`,D=Bb(C),O=`${w} · ${ee}`,k=(0,P.jsxs)(Rb,{className:`chat-clarification-card-body`,children:[(0,P.jsx)(`div`,{className:`chat-event-thread`,children:r.map(e=>(0,P.jsxs)(`article`,{className:`chat-event-message`,children:[e.avatar,(0,P.jsxs)(`div`,{className:`chat-event-message-copy`,children:[(0,P.jsxs)(`div`,{className:`message-meta`,children:[(0,P.jsx)(`span`,{className:`message-author`,children:e.author}),e.time===void 0?null:(0,P.jsx)(`span`,{className:`message-time`,children:e.time})]}),(0,P.jsx)(`p`,{children:(0,P.jsx)(ky,{children:e.body})})]})]},e.id))}),s?null:(0,P.jsx)(`form`,{className:`chat-event-composer`,"aria-label":`Round reply`,onSubmit:h,children:(0,P.jsxs)(`div`,{className:`composer-input-shell chat-event-composer-input-shell`,children:[(0,P.jsx)(Ay,{type:`text`,"aria-label":`Round message`,value:i,placeholder:`Reply in this round`,multiline:!0,maxRows:4,submitOnEnter:!0,...d===void 0?{}:{mentionOptions:d},onValueChange:m}),(0,P.jsx)(`div`,{className:`composer-tools chat-event-composer-tools`,"aria-label":`Round message tools`,children:(0,P.jsx)(`button`,{className:`composer-tool-button composer-send-button chat-event-send-button`,type:`submit`,disabled:i.trim()===``||f,"aria-label":f?`Sending round message`:`Send round message`,title:f?`Sending round message`:`Send round message`,children:(0,P.jsx)(Ki,{"aria-hidden":`true`})})})]})})]});return(0,P.jsx)(`article`,{className:R(`message is-chat-event`,_),...v,children:s?(0,P.jsx)(Fb,{tone:D,asChild:!0,children:(0,P.jsxs)(`details`,{className:`chat-clarification-card`,open:x,"aria-label":b,onToggle:e=>S(e.currentTarget.open),children:[(0,P.jsx)(Ib,{as:`summary`,icon:Vb(C),title:e,meta:O,action:(0,P.jsx)(`span`,{className:`chat-event-card-toggle`,"aria-hidden":`true`,children:(0,P.jsx)(ui,{})})}),k]})}):(0,P.jsx)(Fb,{tone:D,asChild:!0,children:(0,P.jsxs)(`section`,{className:`chat-clarification-card is-fixed-open`,"aria-label":b,children:[(0,P.jsx)(Ib,{icon:Vb(C),title:e,meta:O,tabIndex:-1,action:(0,P.jsxs)(xs,{className:`chat-event-primary-action`,type:`button`,"aria-label":T===0?`Reply before submitting round`:`Submit round`,"aria-busy":p,disabled:E,title:T===0?`Reply before submitting round`:`Submit round`,onClick:g,children:[p?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(li,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`button-label`,children:p?`Submitting`:`Submit`})]})}),k]})})})}function Ub({decision:e,disabled:t,onDecide:n}){let r=e.tone===`primary`?xs:Ss,i=e.decisionId.startsWith(`allow`)?(0,P.jsx)(li,{"aria-hidden":`true`}):(0,P.jsx)(ia,{"aria-hidden":`true`});return(0,P.jsxs)(r,{type:`button`,className:R(`chat-approval-card-decision`,e.tone===`primary`?`is-primary`:void 0,e.tone===`danger`?`is-danger`:void 0),disabled:t,onClick:()=>n(e.decisionId),children:[i,(0,P.jsx)(`span`,{className:`button-label`,children:e.label})]})}function Wb(e,t){return e===`pending`?`warning`:e===`resolved`?`success`:/expired|cancelled/iu.test(t)?`neutral`:`danger`}function Gb(e){return e===`success`?(0,P.jsx)(li,{"aria-hidden":`true`}):e===`danger`?(0,P.jsx)(ia,{"aria-hidden":`true`}):e===`neutral`?(0,P.jsx)(gi,{"aria-hidden":`true`}):(0,P.jsx)(Yi,{"aria-hidden":`true`})}function Kb({title:e,summary:t,reason:n,status:r,statusLabel:i,detailLabel:a,detail:o,detailCode:s=!1,decisions:c=[],decisionPending:l=!1,resolutionLabel:u,defaultOpen:d,onDecide:f,className:p,...m}){let[h,g]=(0,N.useState)(d??r===`pending`),_=Wb(r,i),v=[...c].sort((e,t)=>e.tone===t.tone?0:e.tone===`primary`?-1:+(t.tone===`primary`)),y=r===`pending`&&f!==void 0?(0,P.jsx)(zb,{className:`chat-approval-card-actions`,children:v.map(e=>(0,P.jsx)(Ub,{decision:e,disabled:l,onDecide:f},e.decisionId))}):null,b=(0,P.jsx)(Rb,{className:`chat-approval-card-body`,children:(0,P.jsxs)(`div`,{className:`chat-approval-card-content`,children:[(0,P.jsx)(`p`,{className:`chat-approval-card-summary`,children:t}),n===void 0?null:(0,P.jsx)(`p`,{className:`chat-approval-card-reason`,children:n}),o===void 0?null:(0,P.jsxs)(`div`,{className:`chat-approval-card-detail`,children:[a===void 0?null:(0,P.jsx)(`span`,{className:`chat-approval-card-detail-label`,children:a}),s?(0,P.jsx)(`code`,{className:`chat-approval-card-detail-code`,children:o}):(0,P.jsx)(`span`,{className:`chat-approval-card-detail-text`,children:o})]}),r===`pending`||u===void 0?null:(0,P.jsx)(`p`,{className:`chat-approval-card-resolution`,children:u})]})});return(0,P.jsx)(`article`,{className:R(`message is-chat-event`,p),...m,children:r===`pending`?(0,P.jsx)(Fb,{tone:_,asChild:!0,children:(0,P.jsxs)(`section`,{className:`chat-approval-card is-fixed-open`,"aria-label":t,children:[(0,P.jsx)(Ib,{icon:Gb(_),title:e,meta:i,tabIndex:-1}),b,y]})}):(0,P.jsx)(Fb,{tone:_,asChild:!0,children:(0,P.jsxs)(`details`,{className:`chat-approval-card`,open:h,"aria-label":t,onToggle:e=>g(e.currentTarget.open),children:[(0,P.jsx)(Ib,{as:`summary`,icon:Gb(_),title:e,meta:i,action:(0,P.jsx)(`span`,{className:`chat-event-card-toggle`,"aria-hidden":`true`,children:(0,P.jsx)(ui,{})})}),b]})})})}function qb({status:e,title:t,taskId:n,taskTitle:r,summary:i,moduleName:a,finalNote:o,generatedFiles:s=[],errorCode:c,onOpenTask:l,className:u,...d}){let f=o?.trim()??``,p=i.trim(),m=f.length>0?f:p,h=e===`completed`?`Task completed`:`Task failed`;return(0,P.jsx)(`article`,{className:R(`message is-chat-event is-task-result`,u),...d,children:(0,P.jsx)(Fb,{tone:e===`completed`?`success`:`danger`,compact:!0,asChild:!0,children:(0,P.jsxs)(`button`,{className:R(`chat-task-result-card`,`is-${e}`),disabled:l===void 0,onClick:()=>l?.(n),type:`button`,"aria-label":`${t}: ${r}`,children:[(0,P.jsx)(Lb,{"aria-hidden":`true`,children:e===`completed`?(0,P.jsx)(li,{}):(0,P.jsx)(ia,{})}),(0,P.jsxs)(`span`,{className:`chat-task-result-card-main`,children:[(0,P.jsx)(`span`,{className:`chat-task-result-card-state`,children:h}),(0,P.jsx)(`strong`,{children:r}),a===void 0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-module`,children:a}),m.length===0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-summary`,children:m}),c===void 0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-error-code`,children:c}),s.length===0?null:(0,P.jsx)(`span`,{className:`chat-task-result-card-files`,"aria-label":`Generated files`,children:s.map(e=>(0,P.jsxs)(`span`,{className:`chat-task-result-card-file`,children:[(0,P.jsx)(Ci,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:e.name})]},e.path))})]}),(0,P.jsx)(`span`,{className:`chat-task-result-card-arrow`,"aria-hidden":`true`,children:(0,P.jsx)(di,{})})]})})})}function Jb({status:e}){return e===`done`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(li,{})}):e===`pending`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(Ii,{})}):e===`failed`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(ia,{})}):e===`running`?(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`,children:(0,P.jsx)(Mi,{})}):(0,P.jsx)(`span`,{className:`task-check`,"aria-hidden":`true`})}function Yb({title:e,status:t,selected:n=!1,className:r,type:i=`button`,...a}){return(0,P.jsxs)(`button`,{className:R(`task-row`,n?`is-selected`:void 0,`is-${t}`,r),type:i,"aria-current":n?`true`:void 0,...a,children:[(0,P.jsx)(Jb,{status:t}),(0,P.jsx)(`div`,{className:`task-row-main`,children:(0,P.jsx)(`div`,{className:`task-title-line`,children:(0,P.jsx)(`strong`,{children:e})})})]})}function Xb({label:e,value:t,code:n=!1,status:r}){return(0,P.jsxs)(`div`,{className:`detail-row`,children:[(0,P.jsx)(`span`,{children:e}),r===void 0?n?(0,P.jsx)(`code`,{children:t}):(0,P.jsx)(`strong`,{children:t}):(0,P.jsx)(`strong`,{children:(0,P.jsx)(Ts,{status:r,children:t})})]})}function Zb({rows:e}){return(0,P.jsx)(P.Fragment,{children:e.map((e,t)=>(0,N.createElement)(Xb,{...e,key:`${e.label}-${t}`}))})}function Qb({...e}){return(0,P.jsx)(Yb,{...e})}function $b({detail:e,missingTaskId:t}){return e===void 0?(0,P.jsxs)(`aside`,{className:`task-detail-card`,"aria-label":`Selected task details`,children:[(0,P.jsx)(`div`,{className:`task-detail-head`,children:(0,P.jsx)(`h4`,{children:t===void 0?`No task selected`:`Task not found`})}),(0,P.jsx)(`p`,{children:t===void 0?`Select a task to inspect its contract, latest result, and run history.`:`No task exists for ${t}. Select another task from the Worklist.`})]}):(0,P.jsxs)(`aside`,{className:`task-detail-card`,"aria-label":`Selected task details`,children:[(0,P.jsxs)(`div`,{className:`task-detail-head`,children:[(0,P.jsx)(Ts,{status:e.status,children:e.status}),(0,P.jsx)(`h4`,{children:e.title})]}),(0,P.jsx)(`p`,{children:e.summary}),(0,P.jsxs)(`section`,{className:`task-detail-section`,"aria-label":`Task contract`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Task contract`}),(0,P.jsx)(Zb,{rows:e.contractRows})]}),(0,P.jsxs)(`section`,{className:`task-detail-section task-evidence-section`,"aria-label":`Evidence`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Evidence`}),(0,P.jsx)(Zb,{rows:e.evidenceRows??e.resultRows})]}),(0,P.jsxs)(`section`,{className:`task-detail-section`,"aria-label":`Run result history`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Run result history`}),e.runResults.length===0?(0,P.jsx)(`p`,{children:`No run result yet.`}):(0,P.jsx)(`div`,{className:`run-result-list`,children:e.runResults.map(e=>(0,P.jsx)(`article`,{className:`run-result-item`,children:(0,P.jsxs)(`div`,{className:`run-result-item-head`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:e.title}),e.meta===void 0?null:(0,P.jsx)(`small`,{children:e.meta})]}),e.status===void 0?null:(0,P.jsx)(Ts,{status:e.status,children:e.status})]})},e.id))})]})]})}function ex({modules:e,taskCount:t,detail:n,missingTaskId:r,runNote:i,onSelectTask:a,empty:o,className:s,...c}){return(0,P.jsx)(ma,{title:`Worklist`,icon:(0,P.jsx)(ji,{"aria-hidden":`true`}),action:(0,P.jsx)(`div`,{className:`worklist-header-summary`,children:(0,P.jsx)(`span`,{className:`mini-meta`,children:t===1?`1 task`:`${t} tasks`})}),className:R(`tasks worklist-page-panel`,s),...c,children:(0,P.jsxs)(`div`,{className:`worklist-page-body`,children:[i===void 0?null:(0,P.jsx)(`p`,{className:`worklist-run-note`,children:i}),e.length===0?(0,P.jsx)(`div`,{className:`worklist-page-empty`,children:o??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No compiled tasks`})}):(0,P.jsxs)(`div`,{className:`task-board-body`,children:[(0,P.jsx)(`div`,{className:`task-list`,"aria-label":`Tasks`,children:e.map(e=>(0,P.jsxs)(`div`,{className:`task-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:e.label}),e.rows.map(e=>(0,P.jsx)(Qb,{title:e.title,status:e.status,onClick:()=>a?.(e.id),...e.selected===void 0?{}:{selected:e.selected}},e.id))]},e.label))}),(0,P.jsx)($b,{...n===void 0?{}:{detail:n},...r===void 0?{}:{missingTaskId:r}})]})]})})}function tx({sections:e,statuses:t=[],className:n,...r}){return(0,P.jsxs)(`section`,{className:R(`settings-sheet`,n),"aria-labelledby":`settings-title`,...r,children:[(0,P.jsxs)(`header`,{className:`settings-sheet-head`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Ji,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{id:`settings-title`,children:`Project settings`})]}),t.length===0?null:(0,P.jsx)(`div`,{className:`panel-actions`,children:t.map(e=>(0,P.jsx)(Cs,{className:`task-tag`,tone:e.tone,children:e.label},e.label))})]}),e.map(e=>(0,P.jsxs)(`section`,{className:`settings-section`,id:e.id,"aria-label":e.title,children:[(0,P.jsx)(`div`,{className:`settings-section-title`,children:(0,P.jsx)(`h4`,{children:e.title})}),(0,P.jsx)(`div`,{className:`settings-section-body`,children:e.rows.map(e=>(0,P.jsxs)(`div`,{className:`settings-row`,children:[(0,P.jsx)(`span`,{className:`field-label`,children:e.label}),e.value===void 0?(0,P.jsx)(`span`,{}):e.plain===!0?(0,P.jsx)(`div`,{className:`settings-row-value`,children:e.value}):e.code===!0?(0,P.jsx)(`code`,{children:e.value}):(0,P.jsx)(`strong`,{children:e.value})]},e.label))})]},e.id))]})}function nx({row:e}){return e.category===`image`?(0,P.jsx)(Ei,{"aria-hidden":`true`}):e.canPreview===!1?(0,P.jsx)(xi,{"aria-hidden":`true`}):e.selected===!0?(0,P.jsx)(bi,{"aria-hidden":`true`}):e.extension===`md`||e.extension===`txt`?(0,P.jsx)(Si,{"aria-hidden":`true`}):(0,P.jsx)(Ci,{"aria-hidden":`true`})}function rx({row:e,onSelectFile:t}){return(0,P.jsxs)(`button`,{className:R(`reference-row`,e.selected===!0?`is-selected`:void 0),type:`button`,"aria-current":e.selected===!0?`true`:void 0,onClick:()=>t?.(e.path),children:[(0,P.jsx)(`span`,{className:`reference-file-icon`,"aria-hidden":`true`,children:(0,P.jsx)(nx,{row:e})}),(0,P.jsxs)(`span`,{className:`reference-row-main`,children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(`span`,{children:e.meta})]})]})}function ix({name:e,rows:t,onSelectFile:n}){return(0,P.jsxs)(`details`,{className:`reference-folder-group`,children:[(0,P.jsxs)(`summary`,{className:`reference-folder-head`,children:[(0,P.jsx)(`span`,{className:`reference-file-icon`,"aria-hidden":`true`,children:(0,P.jsx)(Ti,{})}),(0,P.jsxs)(`span`,{className:`reference-row-main`,children:[(0,P.jsx)(`strong`,{children:e}),(0,P.jsxs)(`span`,{children:[t.length,` `,t.length===1?`file`:`files`]})]})]}),(0,P.jsx)(`div`,{className:`reference-folder-files`,children:t.map(e=>(0,P.jsx)(rx,{row:e,...n===void 0?{}:{onSelectFile:n}},e.path))})]})}function ax(e){let t=new Map;for(let n of e){if(n.source!==`tutti_output`||n.generatedGroup===void 0)continue;let e=t.get(n.generatedGroup)??[];e.push(n),t.set(n.generatedGroup,e)}return[...t.entries()].map(([e,t])=>({name:e,rows:t}))}function ox({files:e,detail:t,uploadPending:n=!1,fileSortMode:r=`time`,empty:i,onSelectFile:a,onUploadFile:o,onDropFiles:s,onFileSortModeChange:c,className:l,...u}){let d=e.filter(e=>e.category===`image`&&e.source!==`tutti_output`),f=e.filter(e=>!(e.category===`image`&&e.source!==`tutti_output`)),p=f.filter(e=>e.source!==`tutti_output`||e.generatedGroup===void 0),m=ax(f),h=e=>(0,P.jsx)(`div`,{className:`reference-image-strip`,role:`list`,"aria-label":`Reference images`,onWheel:e=>{Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(e.currentTarget.scrollLeft+=e.deltaY,e.preventDefault())},children:e.map(e=>(0,P.jsxs)(`button`,{className:R(`reference-image-tile`,e.selected===!0?`is-selected`:void 0),type:`button`,"aria-current":e.selected===!0?`true`:void 0,"aria-label":`Open ${e.name}`,onClick:()=>a?.(e.path),children:[e.thumbnailUrl===void 0?(0,P.jsx)(`span`,{className:`reference-image-tile-fallback`,"aria-hidden":`true`,children:(0,P.jsx)(Ei,{})}):(0,P.jsx)(`img`,{src:e.thumbnailUrl,alt:e.name,loading:`lazy`,decoding:`async`}),(0,P.jsx)(`span`,{children:e.name})]},e.path))}),g=e=>e.map(e=>(0,P.jsx)(rx,{row:e,...a===void 0?{}:{onSelectFile:a}},e.path)),_=s??(o===void 0?void 0:e=>{for(let t of e)o(t)});return(0,P.jsxs)(dy,{className:R(`panel references-panel`,l),"aria-label":`References`,dropLabel:`Drop reference files to upload`,pending:n,onFilesUpload:_,...u,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Si,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{children:`References`})]}),(0,P.jsx)(`div`,{className:`panel-actions`,children:(0,P.jsx)(Yy,{variant:`action`,className:`reference-upload-button`,label:`Upload`,pendingLabel:`Uploading`,pending:n,onFileUpload:o})})]}),(0,P.jsx)(`div`,{className:`reference-board-body`,children:e.length===0?(0,P.jsx)(`div`,{className:`reference-board-empty`,children:i??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No reference files`})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-list`,"aria-label":`Reference file list`,children:[d.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`reference-section-label`,children:`Images`}),h(d)]}),f.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-files-head`,children:[(0,P.jsx)(`div`,{className:`reference-section-label`,children:`Files`}),(0,P.jsxs)(`div`,{className:`reference-list-toolbar`,role:`toolbar`,"aria-label":`Sort files`,children:[(0,P.jsx)(`button`,{className:R(`reference-sort-button`,r===`time`?`is-active`:void 0),type:`button`,"aria-label":`Sort files by upload time`,"aria-pressed":r===`time`,onClick:()=>c?.(`time`),children:(0,P.jsx)(gi,{"aria-hidden":`true`})}),(0,P.jsx)(`button`,{className:R(`reference-sort-button`,r===`type`?`is-active`:void 0),type:`button`,"aria-label":`Sort files by type`,"aria-pressed":r===`type`,onClick:()=>c?.(`type`),children:(0,P.jsx)($i,{"aria-hidden":`true`})})]})]}),g(p),m.map(e=>(0,P.jsx)(ix,{name:e.name,rows:e.rows,...a===void 0?{}:{onSelectFile:a}},e.name))]})]}),(0,P.jsxs)(`aside`,{className:`reference-detail-card`,"aria-label":`Selected reference content`,children:[(0,P.jsxs)(`div`,{className:`reference-detail-head`,children:[(0,P.jsx)(`h4`,{children:t?.title??`No file selected`}),t?.meta===void 0?null:(0,P.jsx)(`p`,{children:t.meta})]}),(0,P.jsxs)(`div`,{className:`reference-detail-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Summary`}),(0,P.jsx)(`p`,{className:`reference-summary`,children:t?.summary??`Summary not available yet`}),t?.summaryStatus===void 0?null:(0,P.jsx)(`p`,{className:`reference-summary-status`,children:t.summaryStatus})]}),(0,P.jsxs)(`div`,{className:`reference-detail-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`Content`}),t?.content===void 0?t?.imageUrl===void 0?(0,P.jsx)(`p`,{className:`reference-content`,children:t?.unavailableReason??`Select a reference file`}):(0,P.jsx)(`img`,{className:`reference-image-preview`,src:t.imageUrl,alt:t.title,decoding:`async`}):(0,P.jsx)(`pre`,{className:`reference-content`,children:(0,P.jsx)(`code`,{children:t.content})})]})]})]})})]})}function sx(e){return e.status===`loading`?{status:`running`,label:`Loading`}:e.status===`not_declared`?{status:`todo`,label:`No artifact`}:e.status===`invalid`?{status:`failed`,label:`Invalid`}:e.status===`updating`?{status:`running`,label:`Updating`}:e.previewStatus===`ready`?{status:`done`,label:`Ready`}:e.previewStatus===`starting`?{status:`running`,label:`Starting`}:e.previewStatus===`failed`?{status:`failed`,label:`Failed`}:{status:`todo`,label:`Idle`}}function cx({state:e,empty:t,emptyWatermark:n}){if(e.status===`declared`&&e.previewStatus===`ready`&&e.previewUrl!==void 0)return(0,P.jsx)(`iframe`,{className:`artifact-iframe`,src:e.previewUrl,title:`${e.title} artifact preview`,sandbox:`allow-scripts allow-forms allow-same-origin`,referrerPolicy:`no-referrer`});let r,i=`neutral`;return e.status===`loading`?r=`Loading artifact`:e.status===`updating`?r=`Artifact is updating`:e.status===`not_declared`?r=`No artifact`:e.status===`invalid`?(i=`error`,r=`Invalid artifact. ${e.message}`):e.previewStatus===`starting`?r=`Preview is starting`:e.previewStatus===`failed`?(i=`error`,r=e.errorMessage??`Preview failed`):r=`Preview is idle`,(0,P.jsx)(`div`,{className:`artifact-empty-preview`,role:e.status===`invalid`?`alert`:void 0,children:t??(0,P.jsx)(aa,{tone:i,watermark:n,children:r})})}function lx({state:e,error:t=null,empty:n,emptyWatermark:r,className:i,...a}){let o=t===null?e:{status:`invalid`,message:t},s=sx(o);return(0,P.jsxs)(`section`,{className:R(`panel artifacts-panel`,i),"aria-label":`Artifacts`,...a,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Li,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{children:`Artifacts`})]}),(0,P.jsx)(`div`,{className:`panel-actions`,children:(0,P.jsx)(Ts,{status:s.status,children:s.label})})]}),(0,P.jsx)(`div`,{className:`artifact-board-body`,children:(0,P.jsx)(`div`,{className:`artifact-preview-frame`,"aria-label":`Current artifact`,children:(0,P.jsx)(cx,{state:o,empty:n,emptyWatermark:r})})})]})}function ux({row:e}){return e.selected===!0?(0,P.jsx)(bi,{"aria-hidden":`true`}):(0,P.jsx)(Xi,{"aria-hidden":`true`})}function dx({skills:e,communityLinks:t=[],detail:n,uploadPending:r=!1,deletePending:i=!1,empty:a,onSelectSkill:o,onUploadSkill:s,onDeleteSkill:c,className:l,...u}){let d=e.find(e=>e.selected===!0)?.name,f=t.length>0;return(0,P.jsxs)(`section`,{className:R(`panel references-panel skills-panel`,l),"aria-label":`Skills`,...u,children:[(0,P.jsxs)(`div`,{className:`panel-header`,children:[(0,P.jsxs)(`div`,{className:`panel-title`,children:[(0,P.jsx)(ha,{icon:(0,P.jsx)(Xi,{"aria-hidden":`true`})}),(0,P.jsx)(`h3`,{children:`Skills`})]}),(0,P.jsx)(`div`,{className:`panel-actions`,children:(0,P.jsx)(Yy,{variant:`action`,className:`reference-upload-button`,label:`Upload`,pendingLabel:`Uploading`,pending:r,accept:`.zip,application/zip,application/x-zip-compressed`,onFileUpload:s})})]}),(0,P.jsx)(`div`,{className:`reference-board-body`,children:e.length===0&&!f?(0,P.jsx)(`div`,{className:`reference-board-empty`,children:a??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No skills`})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-list`,"aria-label":`Skill list`,children:[f?(0,P.jsxs)(`div`,{className:`skill-community-section`,"aria-label":`Skill communities`,children:[(0,P.jsx)(`div`,{className:`reference-section-label`,children:`Skill communities`}),(0,P.jsx)(`div`,{className:`skill-community-grid`,children:t.map(e=>(0,P.jsxs)(`a`,{className:`skill-community-card`,href:e.href,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(`span`,{className:`skill-community-card-icon`,"aria-hidden":`true`,children:(0,P.jsx)(Ai,{})}),(0,P.jsx)(`span`,{className:`skill-community-card-main`,children:(0,P.jsx)(`strong`,{children:e.title})})]},e.href))})]}):null,e.length===0?null:(0,P.jsx)(`div`,{className:`reference-section-label`,children:`User skills`}),e.map(e=>(0,P.jsxs)(`button`,{className:R(`reference-row`,e.selected===!0?`is-selected`:void 0),type:`button`,"aria-label":`Select skill ${e.name}`,"aria-current":e.selected===!0?`true`:void 0,onClick:()=>o?.(e.name),children:[(0,P.jsx)(`span`,{className:`reference-file-icon`,"aria-hidden":`true`,children:(0,P.jsx)(ux,{row:e})}),(0,P.jsxs)(`span`,{className:`reference-row-main`,children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(`span`,{children:e.shortDescription??e.description})]})]},e.name))]}),(0,P.jsx)(`aside`,{className:`reference-detail-card`,"aria-label":`Selected skill content`,children:e.length===0?(0,P.jsx)(`div`,{className:`reference-board-empty`,children:a??(0,P.jsx)(`div`,{className:`reference-empty`,children:`No skills`})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`reference-detail-head skill-detail-head`,children:[(0,P.jsxs)(`div`,{className:`skill-detail-title`,children:[(0,P.jsx)(`h4`,{children:n?.title??`No skill selected`}),n?.description===void 0?null:(0,P.jsx)(`p`,{children:n.description}),n?.updatedLabel===void 0?null:(0,P.jsx)(`p`,{children:n.updatedLabel})]}),d===void 0||c===void 0?null:(0,P.jsxs)(Ss,{className:`skill-delete-button`,type:`button`,disabled:i,"aria-busy":i,onClick:()=>c(d),children:[(0,P.jsx)(ta,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:i?`Deleting`:`Delete`})]})]}),(0,P.jsxs)(`div`,{className:`reference-detail-section`,children:[(0,P.jsx)(`span`,{className:`task-section-label`,children:`SKILL.md`}),n?.skillMd===void 0?(0,P.jsx)(`p`,{className:`reference-content`,children:n?.unavailableReason??`Select a skill`}):(0,P.jsx)(`pre`,{className:`reference-content`,children:(0,P.jsx)(`code`,{"aria-label":`Skill markdown for ${n.title}`,children:n.skillMd})})]})]})})]})})]})}function fx({label:e,children:t}){return(0,P.jsxs)(`section`,{className:`timeline-trace-section`,children:[(0,P.jsx)(`span`,{className:`timeline-trace-label`,children:e}),(0,P.jsx)(`div`,{className:`timeline-trace-section-body`,children:t})]})}function px(e){return e.replaceAll(`_`,` `)}function mx(e){return e===`passed`?`success`:e===`failed`?`error`:`warning`}function hx(e){return e.status===`promoted`?`success`:e.status===`not_promoted`?`error`:`neutral`}function gx(e){if(e.skipReasonSummary!==void 0)return e.skipReasonSummary;switch(e.checks){case`passed`:return`All validation checks passed.`;case`failed`:return`Validation checks failed.`;case`skipped`:return`Validation was skipped.`}}function _x(e){if(e.summary!==void 0)return e.summary;switch(e.status){case`promoted`:return`Changes were promoted after verification.`;case`not_promoted`:return`Changes were not promoted.`;case`not_attempted`:return`Promotion was not attempted.`}}function vx(e){switch(e){case`added`:return`+`;case`modified`:return`~`;case`deleted`:return`-`;case`renamed`:return`~`;case`unknown`:return`?`}}var yx=3;function bx({expanded:e,collapsedLabel:t,expandedLabel:n,onClick:r}){return(0,P.jsxs)(`button`,{"aria-expanded":e,className:R(`timeline-trace-more`,e&&`is-expanded`),onClick:r,type:`button`,children:[(0,P.jsx)(`span`,{children:e?n:t}),(0,P.jsx)(ui,{"aria-hidden":`true`})]})}function xx({expanded:e,hiddenCount:t,label:n,onClick:r}){return t<=0?null:(0,P.jsx)(bx,{collapsedLabel:`Show ${t} more ${n}${t===1?``:`s`}`,expanded:e,expandedLabel:`Show fewer ${n}s`,onClick:r})}function Sx(e){let t=[];return(e.origin!==void 0||e.decisions!==void 0||e.clarification!==void 0)&&t.push({id:`context`,label:`Context`,tone:`neutral`}),e.contract!==void 0&&t.push({id:`contract`,label:`Contract`,tone:`neutral`}),(e.result!==void 0||e.changes!==void 0)&&t.push({id:`result`,label:`Result`,tone:e.tone}),e.verification!==void 0&&t.push({id:`checks`,label:`Checks`,tone:mx(e.verification.checks)}),e.promotion!==void 0&&t.push({id:`promotion`,label:`Promotion`,tone:hx(e.promotion)}),e.checkpoint!==void 0&&t.push({id:`checkpoint`,label:`Checkpoint`,tone:e.tone}),t}function Cx({trace:e}){let t=Sx(e),n=e.links.filter(e=>e.onClick!==void 0),[r,i]=(0,N.useState)(()=>new Set),a=r.has(`origin`),o=r.has(`decisions`),s=r.has(`clarification-answers`),c=r.has(`scope`),l=r.has(`changes`),u=r.has(`checkpoint`),d=r.has(`generated-files`),f=e.origin?.snippets??[],p=e.decisions===void 0||o?e.decisions??[]:e.decisions.slice(0,yx),m=e.clarification?.answers===void 0||s?e.clarification?.answers??[]:e.clarification.answers.slice(0,yx),h=e.contract===void 0||c?e.contract?.scope??[]:e.contract.scope.slice(0,yx),g=e.checkpoint===void 0||u?e.checkpoint?.items??[]:e.checkpoint.items.slice(0,yx),_=e.checkpoint?.generatedFiles===void 0||d?e.checkpoint?.generatedFiles??[]:e.checkpoint.generatedFiles.slice(0,yx);function v(e){i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,P.jsxs)(`div`,{className:R(`timeline-trace-card`,`is-${e.tone}`),children:[e.summary===void 0||e.result!==void 0?null:(0,P.jsx)(`p`,{className:`timeline-trace-summary`,children:e.summary}),t.length===0?null:(0,P.jsx)(`ol`,{className:`timeline-trace-path`,"aria-label":`Recorded task trace`,children:t.map(e=>(0,P.jsxs)(`li`,{className:`is-${e.tone}`,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`}),(0,P.jsx)(`strong`,{children:e.label})]},e.id))}),e.origin===void 0?null:(0,P.jsxs)(fx,{label:`Origin`,children:[e.origin.title===void 0?null:(0,P.jsx)(`strong`,{className:`timeline-trace-title`,children:e.origin.title}),e.origin.summary===void 0?null:(0,P.jsx)(`p`,{children:e.origin.summary}),e.origin.unavailableReason===void 0?null:(0,P.jsx)(`small`,{className:`timeline-trace-muted`,children:e.origin.unavailableReason}),f.length>0?(0,P.jsx)(bx,{collapsedLabel:`Show ${f.length} source message${f.length===1?``:`s`}`,expanded:a,expandedLabel:`Show fewer source messages`,onClick:()=>v(`origin`)}):e.origin.sourceCount===void 0?null:(0,P.jsxs)(`small`,{className:`timeline-trace-muted`,children:[e.origin.sourceCount,` source message`,e.origin.sourceCount===1?``:`s`]}),!a||f.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-snippet-list`,children:f.map(e=>(0,P.jsx)(`li`,{className:`timeline-trace-snippet`,children:e.onClick===void 0?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]}):(0,P.jsxs)(`button`,{className:`timeline-trace-snippet-button`,onClick:e.onClick,type:`button`,children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]})},e.id))})]}),e.decisions===void 0||e.decisions.length===0?null:(0,P.jsxs)(fx,{label:`Accepted Context`,children:[(0,P.jsx)(`ul`,{className:`timeline-trace-list`,children:p.map(e=>(0,P.jsxs)(`li`,{children:[e.title===void 0?null:(0,P.jsx)(Cs,{tone:`neutral`,children:e.title}),(0,P.jsx)(`span`,{children:e.summary})]},e.id))}),(0,P.jsx)(xx,{expanded:o,hiddenCount:Math.max(e.decisions.length-yx,0),label:`context item`,onClick:()=>v(`decisions`)})]}),e.clarification===void 0?null:(0,P.jsxs)(fx,{label:`Clarification`,children:[e.clarification.title===void 0?null:(0,P.jsx)(`strong`,{className:`timeline-trace-title`,children:e.clarification.title}),e.clarification.summary===void 0?null:(0,P.jsx)(`p`,{children:e.clarification.summary}),e.clarification.request===void 0?null:(0,P.jsx)(`p`,{children:e.clarification.request}),e.clarification.status===void 0&&e.clarification.answerCount===void 0?null:(0,P.jsxs)(`div`,{className:`timeline-trace-inline`,children:[e.clarification.status===void 0?null:(0,P.jsx)(Cs,{tone:e.clarification.status===`active`?`warning`:`success`,children:e.clarification.status===`active`?`needs input`:`resolved`}),e.clarification.answerCount===void 0?null:(0,P.jsxs)(`small`,{className:`timeline-trace-muted`,children:[e.clarification.answerCount,` answer`,e.clarification.answerCount===1?``:`s`]})]}),e.clarification.answers===void 0||e.clarification.answers.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-snippet-list`,children:m.map(e=>(0,P.jsx)(`li`,{className:`timeline-trace-snippet`,children:e.onClick===void 0?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]}):(0,P.jsxs)(`button`,{className:`timeline-trace-snippet-button`,onClick:e.onClick,type:`button`,children:[(0,P.jsxs)(`span`,{children:[e.author,` · `,e.createdAt]}),(0,P.jsx)(`p`,{children:e.body})]})},e.id))}),e.clarification.answers===void 0?null:(0,P.jsx)(xx,{expanded:s,hiddenCount:Math.max(e.clarification.answers.length-yx,0),label:`answer`,onClick:()=>v(`clarification-answers`)})]}),e.contract===void 0?null:(0,P.jsxs)(fx,{label:`Contract`,children:[(0,P.jsx)(`p`,{children:e.contract.goal}),h.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-list is-bulleted`,children:h.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`span`,{children:e})},`scope-${t}`))}),(0,P.jsx)(xx,{expanded:c,hiddenCount:Math.max(e.contract.scope.length-yx,0),label:`scope item`,onClick:()=>v(`scope`)}),c&&e.contract.truncated===!0?(0,P.jsx)(`small`,{className:`timeline-trace-muted`,children:`Additional scope items are outside this bounded audit preview.`}):null]}),e.result===void 0?null:(0,P.jsxs)(fx,{label:`Result`,children:[(0,P.jsx)(`p`,{children:e.result.summary}),e.result.errorCode===void 0?null:(0,P.jsx)(`code`,{className:`timeline-trace-code`,children:e.result.errorCode})]}),e.changes===void 0?null:(0,P.jsxs)(fx,{label:`Changes`,children:[e.changes.items.length===0?(0,P.jsx)(`p`,{className:`timeline-trace-muted`,children:`No repo changes recorded.`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(bx,{collapsedLabel:`Show ${e.changes.items.length} file change${e.changes.items.length===1?``:`s`}`,expanded:l,expandedLabel:`Show fewer file changes`,onClick:()=>v(`changes`)}),l?(0,P.jsx)(`ul`,{className:`timeline-trace-diff-list`,children:e.changes.items.map(e=>(0,P.jsxs)(`li`,{className:`is-${e.status}`,children:[(0,P.jsx)(`span`,{className:`timeline-trace-diff-mark`,children:vx(e.status)}),(0,P.jsx)(`code`,{children:e.previousPath===void 0?e.path:`${e.previousPath} -> ${e.path}`})]},`${e.status}:${e.path}`))}):null]}),l&&e.changes.totalCount>e.changes.items.length?(0,P.jsxs)(`small`,{className:`timeline-trace-muted`,children:[e.changes.totalCount-e.changes.items.length,` additional files are outside this bounded audit preview.`]}):null]}),e.verification===void 0?null:(0,P.jsx)(fx,{label:`Verification`,children:(0,P.jsxs)(`div`,{className:`timeline-trace-inline`,children:[(0,P.jsx)(Cs,{tone:mx(e.verification.checks),children:px(e.verification.checks)}),(0,P.jsx)(`p`,{children:gx(e.verification)})]})}),e.promotion===void 0?null:(0,P.jsx)(fx,{label:`Promotion`,children:(0,P.jsxs)(`div`,{className:`timeline-trace-inline`,children:[(0,P.jsx)(Cs,{tone:hx(e.promotion),children:px(e.promotion.status)}),(0,P.jsx)(`p`,{children:_x(e.promotion)})]})}),e.checkpoint===void 0?null:(0,P.jsxs)(fx,{label:`Checkpoint`,children:[(0,P.jsxs)(`div`,{className:`timeline-trace-counters`,children:[(0,P.jsxs)(`span`,{children:[e.checkpoint.counters.completed,` completed`]}),(0,P.jsxs)(`span`,{children:[e.checkpoint.counters.failed,` failed`]}),(0,P.jsxs)(`span`,{children:[e.checkpoint.counters.remaining,` remaining`]})]}),(0,P.jsx)(`ul`,{className:`timeline-trace-list`,children:g.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(Cs,{tone:e.status===`done`?`success`:`error`,children:e.status===`done`?`done`:`failed`}),(0,P.jsx)(`strong`,{children:e.title}),(0,P.jsx)(`span`,{children:e.summary})]},e.id))}),(0,P.jsx)(xx,{expanded:u,hiddenCount:Math.max(e.checkpoint.items.length-yx,0),label:`checkpoint item`,onClick:()=>v(`checkpoint`)}),e.checkpoint.generatedFiles===void 0||e.checkpoint.generatedFiles.length===0?null:(0,P.jsx)(`ul`,{className:`timeline-trace-file-list`,children:_.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(`code`,{children:e.path})]},e.id))}),e.checkpoint.generatedFiles===void 0?null:(0,P.jsx)(xx,{expanded:d,hiddenCount:Math.max(e.checkpoint.generatedFiles.length-yx,0),label:`generated file`,onClick:()=>v(`generated-files`)}),(u||d)&&e.checkpoint.truncated===!0?(0,P.jsx)(`small`,{className:`timeline-trace-muted`,children:`Additional checkpoint evidence is outside this bounded audit preview.`}):null]}),n.length===0?null:(0,P.jsx)(fx,{label:`Links`,children:(0,P.jsx)(`div`,{className:`timeline-trace-links`,children:n.map(e=>(0,P.jsxs)(Ss,{className:`timeline-trace-link`,onClick:e.onClick,type:`button`,children:[(0,P.jsx)(yi,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:e.label})]},e.id))})})]})}function wx({item:e,expanded:t,active:n,onActivate:r,onToggle:i}){let a=e.trace,o=a!==void 0,s=e.tone??`neutral`,c=s===`error`?(0,P.jsx)(ia,{"aria-hidden":`true`}):s===`warning`?(0,P.jsx)(Ii,{"aria-hidden":`true`}):s===`sync`?(0,P.jsx)(Mi,{"aria-hidden":`true`}):(0,P.jsx)(li,{"aria-hidden":`true`});return(0,P.jsxs)(`li`,{className:R(`timeline-event-item`,o?`has-trace`:void 0,t?`is-expanded`:void 0,n?`is-current`:void 0,e.tone===void 0?void 0:`is-${e.tone}`),id:`timeline-event-${e.id}`,children:[(0,P.jsx)(`time`,{className:`timeline-event-time`,children:e.occurredAt}),(0,P.jsx)(`div`,{className:`timeline-event-marker`,"aria-hidden":`true`}),(0,P.jsxs)(`div`,{className:`timeline-event-main`,children:[(0,P.jsxs)(`button`,{"aria-expanded":o?t:void 0,className:`timeline-event-toggle`,disabled:!o,onClick:()=>{r(),i()},type:`button`,children:[(0,P.jsx)(`span`,{className:R(`timeline-event-status-icon`,`is-${s}`),"aria-hidden":`true`,children:c}),(0,P.jsxs)(`span`,{className:`timeline-event-copy`,children:[(0,P.jsx)(`span`,{className:`timeline-event-stage`,children:e.stageLabel??(e.kind===`checkpoint`?`Checkpoint`:`Task event`)}),(0,P.jsxs)(`span`,{className:`timeline-event-title-line`,children:[(0,P.jsx)(`h4`,{children:e.taskTitle??e.title}),e.tokenLabel===void 0?null:(0,P.jsx)(`span`,{className:`timeline-event-token`,children:e.tokenLabel})]})]}),o?(0,P.jsx)(ui,{className:`timeline-event-chevron`,"aria-hidden":`true`}):null]}),a!==void 0&&t?(0,P.jsx)(Cx,{trace:a}):null]})]})}function Tx(e){let t=new Map;for(let n of e){let e=n.taskId===void 0?`event:${n.id}`:`task:${n.taskId}`,r=t.get(e);r===void 0?t.set(e,{id:e,title:n.taskTitle??n.title,...n.taskId===void 0?{}:{taskId:n.taskId},items:[n]}):r.items.push(n)}return[...t.values()]}function Ex({tokenOverview:e,items:t,scoreUnits:n=[],empty:r,defaultExpandedItemIds:i,className:a,...o}){let[s,c]=(0,N.useState)(()=>new Set(i??[])),[l,u]=(0,N.useState)(()=>n.at(-1)?.id),[d,f]=(0,N.useState)(0),p=(0,N.useRef)(null),m=Tx(t),h=new Set(t.flatMap(e=>e.taskId===void 0?[]:[e.taskId])).size;(0,N.useEffect)(()=>{if(n.length===0){u(void 0);return}(l===void 0||!n.some(e=>e.id===l))&&u(n.at(-1)?.id)},[l,n]),(0,N.useEffect)(()=>{let e=p.current;if(e===null)return;let t=e;t.scrollLeft=t.scrollWidth;function n(e){if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let n=Math.max(0,t.scrollWidth-t.clientWidth),r=Math.min(n,Math.max(0,t.scrollLeft+e.deltaY));r!==t.scrollLeft&&(e.preventDefault(),t.scrollLeft=r)}return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[n.length]),(0,N.useEffect)(()=>{let e=p.current;if(e===null)return;let t=()=>f(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[n.length]);function g(e,t=!1){u(e),t&&(c(t=>new Set(t).add(e)),window.requestAnimationFrame(()=>{document.getElementById(`timeline-event-${e}`)?.scrollIntoView({behavior:`smooth`,block:`center`})}))}function _(e){c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,P.jsx)(ma,{className:R(`timeline-panel`,a),title:`Timeline`,icon:(0,P.jsx)(ci,{"aria-hidden":`true`}),...o,children:(0,P.jsxs)(`div`,{className:`timeline-board-body`,children:[(0,P.jsxs)(`section`,{className:`timeline-events`,"aria-label":`Project timeline`,children:[(0,P.jsx)(`div`,{className:`timeline-audit-header`,children:(0,P.jsxs)(`div`,{className:`timeline-audit-intro`,children:[(0,P.jsx)(`h4`,{children:`Task traceability`}),(0,P.jsxs)(`div`,{className:`timeline-audit-meta`,"aria-label":`Timeline record summary`,children:[(0,P.jsx)(`span`,{children:h===1?`1 task`:`${h} tasks`}),(0,P.jsx)(`span`,{children:t.length===1?`1 record`:`${t.length} records`})]})]})}),t.length===0?r:(0,P.jsx)(`div`,{className:`timeline-task-groups`,children:m.map(e=>(0,P.jsxs)(`section`,{className:`timeline-task-group`,"aria-label":e.title,children:[(0,P.jsxs)(`header`,{className:`timeline-task-group-head`,children:[(0,P.jsx)(`span`,{children:e.taskId===void 0?`Project record`:`Task trace`}),(0,P.jsx)(`strong`,{children:e.title})]}),(0,P.jsx)(`ol`,{className:`timeline-event-list`,children:e.items.map(e=>(0,P.jsx)(wx,{active:l===e.id,expanded:s.has(e.id),item:e,onActivate:()=>g(e.id),onToggle:()=>_(e.id)},e.id))})]},e.id))})]}),(0,P.jsxs)(`section`,{className:`timeline-overview`,"aria-label":`Timeline score and token usage`,children:[n.length===0?null:(0,P.jsx)(`div`,{className:`timeline-score-index`,ref:p,role:`group`,"aria-label":`Timeline score index`,children:(0,P.jsx)(co,{"aria-label":`Timeline event score`,...l===void 0?{}:{activeUnitId:l},edgePadding:0,minimumWidth:d,onUnitSelect:e=>g(e,!0),openingBarline:`double`,openingClef:`treble`,horizontalSpacingScale:B,reveal:!0,scale:fo,units:n})}),(0,P.jsxs)(`div`,{className:`timeline-overview-token`,"aria-label":`Total tokens`,children:[(0,P.jsx)(`span`,{children:`Total tokens`}),(0,P.jsx)(`strong`,{children:e.totalLabel})]})]})]})})}var Dx=new Intl.NumberFormat(`en-US`),Ox=Ho(`beethoven-ode-to-joy`);function kx(e){return[...e].reverse().map((e,t)=>{let n=Ox.units[t%Ox.units.length];if(n===void 0)throw Error(`Timeline score theme unexpectedly has no units`);return{...n,id:e.id,label:`Open ${e.stageLabel??e.title}`}})}function Ax(e){return Dx.format(e)}function jx(e){if(e!==void 0)switch(e){case`completed`:return`success`;case`failed`:return`error`;case`needs_human`:return`warning`}}function Mx(e){if(e.kind===`task_accepted`)return`Task accepted`;if(e.kind===`checkpoint`)return`Checkpoint`;switch(e.update_state){case`completed`:return`Task completed`;case`failed`:return`Task failed`;case`needs_input`:return`Needs input`;default:return`Task update`}}function Nx(e,t){let n=Date.parse(e.occurred_at),r=Date.parse(t.occurred_at),i=Number.isFinite(n)&&Number.isFinite(r)?r-n:t.occurred_at.localeCompare(e.occurred_at);return i===0?t.id.localeCompare(e.id):i}function Px(e,t={}){let n=e.token_usage?.total_tokens??0,r=jx(e.status),i={id:e.id,title:e.task_title??e.title,occurredAt:tr(e.occurred_at),kind:e.kind,stageLabel:Mx(e)};return r!==void 0&&(i.tone=r),n>0&&(i.tokenLabel=`${Ax(n)} tokens`),e.task_id!==void 0&&(i.taskId=e.task_id),e.task_title!==void 0&&(i.taskTitle=e.task_title),e.trace_card!==void 0&&(i.trace=Ix(e.trace_card,t)),i}function Fx(e,t){if(e.kind===`worklist_task`&&e.task_id!==void 0){let n=t.onOpenWorklistTask,r=e.task_id;return n===void 0?void 0:()=>n(r)}if(e.kind===`chat_message`&&e.message_id!==void 0){let n=t.onOpenChatMessage,r=e.message_id;return n===void 0?void 0:()=>n(r)}if(e.kind===`reference_file`&&e.path!==void 0){let n=t.onOpenReferenceFile,r=e.path;return n===void 0?void 0:()=>n(r)}}function Ix(e,t={}){return{tone:e.tone,...e.summary===void 0?{}:{summary:e.summary},...e.origin===void 0?{}:{origin:{...e.origin.title===void 0?{}:{title:e.origin.title},...e.origin.summary===void 0?{}:{summary:e.origin.summary},...e.origin.unavailable_reason===void 0?{}:{unavailableReason:e.origin.unavailable_reason},...e.origin.source_count===void 0?{}:{sourceCount:e.origin.source_count},...e.origin.snippets===void 0?{}:{snippets:e.origin.snippets.map(e=>({id:e.message_id,author:e.author,body:e.body,createdAt:tr(e.created_at),...t.onOpenChatMessage===void 0?{}:{onClick:()=>t.onOpenChatMessage?.(e.message_id)}}))}}},...e.decisions===void 0?{}:{decisions:e.decisions.map((e,t)=>({id:`${t}:${e.source??`decision`}`,...e.title===void 0?{}:{title:e.title},summary:e.summary}))},...e.clarification===void 0?{}:{clarification:{...e.clarification.title===void 0?{}:{title:e.clarification.title},...e.clarification.summary===void 0?{}:{summary:e.clarification.summary},...e.clarification.request===void 0?{}:{request:e.clarification.request},...e.clarification.status===void 0?{}:{status:e.clarification.status},...e.clarification.answer_count===void 0?{}:{answerCount:e.clarification.answer_count},...e.clarification.answers===void 0?{}:{answers:e.clarification.answers.map(e=>({id:e.message_id,author:e.author,body:e.body,createdAt:tr(e.created_at),...t.onOpenChatMessage===void 0?{}:{onClick:()=>t.onOpenChatMessage?.(e.message_id)}}))}}},...e.contract===void 0?{}:{contract:{goal:e.contract.goal,scope:e.contract.scope,...e.contract.truncated===void 0?{}:{truncated:e.contract.truncated}}},...e.result===void 0?{}:{result:{summary:e.result.summary,...e.result.error_code===void 0?{}:{errorCode:e.result.error_code}}},...e.changes===void 0?{}:{changes:{items:e.changes.items.map(e=>({status:e.status,path:e.path,...e.previous_path===void 0?{}:{previousPath:e.previous_path}})),totalCount:e.changes.total_count,truncated:e.changes.truncated}},...e.verification===void 0?{}:{verification:{checks:e.verification.checks,...e.verification.skip_reason_code===void 0?{}:{skipReasonCode:e.verification.skip_reason_code},...e.verification.skip_reason_summary===void 0?{}:{skipReasonSummary:e.verification.skip_reason_summary}}},...e.promotion===void 0?{}:{promotion:{status:e.promotion.status,...e.promotion.commit_short_oid===void 0?{}:{commitShortOid:e.promotion.commit_short_oid},...e.promotion.summary===void 0?{}:{summary:e.promotion.summary},...e.promotion.reason_code===void 0?{}:{reasonCode:e.promotion.reason_code}}},...e.checkpoint===void 0?{}:{checkpoint:{counters:e.checkpoint.counters,items:e.checkpoint.items.map(e=>({id:e.task_id,title:e.title,status:e.status,summary:e.summary})),...e.checkpoint.generated_files===void 0?{}:{generatedFiles:e.checkpoint.generated_files.map(e=>({id:e.path,name:e.name,path:e.path}))},...e.checkpoint.truncated===void 0?{}:{truncated:e.checkpoint.truncated}}},links:e.links.flatMap(e=>{let n=e.task_id??e.message_id??e.path,r=Fx(e,t);return r===void 0?[]:[{id:`${e.kind}:${n??e.label}`,label:e.label,onClick:r}]})}}function Lx(e,t={}){let n=e.usage_overview,r=[...e.items].sort(Nx).map(e=>Px(e,t));return{tokenOverview:{totalLabel:Ax(n.total_tokens)},items:r,scoreUnits:kx(r)}}var Rx=[{id:`prepare`,label:`Preparing workspace`},{id:`implement`,label:`Implementing with Codex`},{id:`validate`,label:`Validating result`},{id:`save`,label:`Saving result`}],zx=[{id:`workspace_inspect`,summary:`inspecting the persistent project workspace`,displayStageId:`prepare`},{id:`artifact_candidate_validate`,summary:`validating the candidate Artifact preview`,displayStageId:`validate`},{id:`provider_task_run`,summary:`running Codex task implementation`,displayStageId:`implement`},{id:`provider_retry`,summary:`retrying Codex task after a transient provider failure`,displayStageId:`implement`},{id:`candidate_diff_collect`,summary:`collecting candidate changes`,displayStageId:`validate`},{id:`checks`,summary:`running project checks`,displayStageId:`validate`},{id:`post_checks_diff_collect`,summary:`rechecking candidate changes after checks`,displayStageId:`validate`},{id:`accepted_checkpoint`,summary:`saving the validated project state as an accepted checkpoint`,displayStageId:`save`},{id:`promotion_reconcile`,summary:`reconciling promotion after mainline changed`,displayStageId:`save`},{id:`self_correction`,summary:`retrying task implementation after pipeline feedback`,displayStageId:`implement`}],Bx={scratchpad_refresh:{key:`scratchpad_refresh`,label:`Refreshing Scratchpad`,target:{kind:`scratchpad`}},project_context_bootstrap:{key:`project_context_bootstrap`,label:`Preparing project context`,target:{kind:`scratchpad`}},task_compile:{key:`task_compile`,label:`Compiling Worklist tasks`,target:{kind:`scratchpad`}},context_sync:{key:`context_sync`,label:`Synchronizing project context`,target:{kind:`worklist`}},reference_summary_refresh:{key:`reference_summary_refresh`,label:`Processing reference`,target:{kind:`references`}},recovery_check:{key:`recovery_check`,label:`Recovering workspace`,target:{kind:`worklist`}},follow_up_check:{key:`follow_up_check`,label:`Checking follow-up`,target:{kind:`worklist`}}},Vx=`Tutti is working on`,Hx=new Set([`scratchpad_refresh`]),Ux=`task_compile`,Wx=`project_context_bootstrap`,Gx={reading_context:`Codex is reading project context`,planning:`Codex is planning changes`,editing_files:`Codex is editing files`,running_command:`Codex is running a command`,using_tool:`Codex is using a tool`,waiting_for_approval:`Codex is waiting for approval`,finalizing:`Codex is finalizing the result`};function Kx(e){if(e===void 0)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;if(e instanceof Date)return e.getTime();let t=Date.parse(e);return Number.isNaN(t)?null:t}function qx(e){return Kx(e.now)??Date.now()}function Jx(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;if(t<60)return`${t}m${n}s`;let r=Math.floor(t/60),i=t%60;return`${r}h${String(i).padStart(2,`0`)}m`}function Yx(e,t){let n=Kx(e);if(n!==null)return Jx(Math.max(0,Math.floor((qx(t)-n)/1e3)))}function Xx(e,t){return Yx(e.active_activity?.started_at??e.runtime?.started_at,t)}function Zx(e){let t=e.runtime;if(t===void 0)return;let n=e.active_activity?.activity_ref;if(!(n!==void 0&&t.activity_ref!==n))return t}function Qx(e){if(e<1e3)return String(e);if(e<1e6){let t=e/1e3;return`${e<1e5?t.toFixed(1).replace(/\.0$/u,``):String(Math.round(t))}k`}return`${(e/1e6).toFixed(1).replace(/\.0$/u,``)}m`}function $x(e){let t=e?.token_usage?.total_tokens;return t===void 0?[]:[`${Qx(t)} tokens`]}function eS(e){let t=e?.token_usage?.total_tokens;return t===void 0?void 0:`${Qx(t)} tokens`}function tS(e){let t=e?.current_action;return t===void 0?void 0:Gx[t]}function nS(e){let t=tS(e);if(t===void 0)return;let n=eS(e);return n===void 0?t:`${t} (${n})`}function rS(e){let t={};return e.active_activity?.activity_ref!==void 0&&(t.activityRef=e.active_activity.activity_ref),e.active_activity?.workflow_ref!==void 0&&(t.workflowRef=e.active_activity.workflow_ref),e.active_task?.id!==void 0&&(t.taskId=e.active_task.id),Object.keys(t).length===0?void 0:t}function iS(e,t,n){return e===`context_sync`&&t.last_conclusion?.task_id!==void 0?{kind:`task`,taskId:t.last_conclusion.task_id}:n.target}function aS(e){return zx[dS(e)]??zx[0]}function oS(e){return Rx.findIndex(t=>t.id===e)}function sS(e){return Rx[oS(aS(e).displayStageId)]??Rx[0]}function cS(e){if(e.status!==`running`||e.active_activity?.activity_kind!==`procedure`)return null;let t=e.active_activity.workflow_kind;if(t===void 0||Hx.has(t))return null;let n=Bx[t],r=iS(t,e,n);return{key:`procedure:${n.key}`,label:n.label,title:n.label,tone:`running`,target:r}}function lS(e,t){if(e.status!==`running`||e.active_activity?.activity_kind!==`procedure`)return null;let n=e.active_activity.workflow_kind;if(n===void 0||Hx.has(n))return null;let r=Bx[n],i=iS(n,e,r),a=rS(e),o=Zx(e),s=n===Ux?$x(o):[],c=n===Wx?`Creating project context for the first time`:void 0,l=Yx(e.active_activity?.started_at??o?.started_at,t);return{key:`procedure:${r.key}`,title:Vx,summary:e.summary,tone:`running`,metaLabel:r.label,completionTarget:i,...a===void 0?{}:{completionSource:a},steps:[{id:`procedure:${r.key}:active`,label:r.label,status:`running`,...l===void 0?{}:{elapsedLabel:l},...c===void 0?{}:{detail:c},...s.length===0?{}:{metrics:s}}]}}function uS(e){let t=e.indexOf(` - `);return t===-1?``:e.slice(t+3).trim().replace(/\.$/u,``)}function dS(e){let t=uS(e).toLocaleLowerCase();if(t===``)return 0;let n=zx.findIndex(e=>t.includes(e.summary.toLocaleLowerCase()));return n===-1?0:n}function fS(e,t){if(e.status!==`running`||e.active_task===void 0)return null;let n=oS(aS(e.summary).displayStageId),r=sS(e.summary),i=rS(e),a=Zx(e),o=Xx(e,t);return{key:`run:${e.active_task.id}`,title:Vx,summary:e.active_task.title,tone:`running`,metaLabel:r.label,completionTarget:{kind:`task`,taskId:e.active_task.id},...i===void 0?{}:{completionSource:i},steps:Rx.map((e,t)=>{let r=t<n?`done`:t===n?`running`:`waiting`,i=t===n,s=e.id===`implement`,c=i&&s?nS(a):void 0,l=s&&c===void 0?$x(a):[];return{id:e.id,label:e.label,status:r,...i&&o!==void 0?{elapsedLabel:o}:{},...c===void 0?{}:{detail:c},...l.length>0?{metrics:l}:{}}})}}function pS(e,t){if(e.status!==`running`||e.active_activity?.workflow_kind!==`context_sync`||e.last_conclusion?.kind!==`completed`||e.last_conclusion.task_id===void 0)return null;let n=rS(e),r=Xx(e,t);return{key:`context-sync:${e.last_conclusion.task_id}`,title:Vx,summary:e.summary,tone:`running`,metaLabel:`Synchronizing context`,completionTarget:{kind:`task`,taskId:e.last_conclusion.task_id},...n===void 0?{}:{completionSource:n},steps:[{id:`task_complete`,label:`Task completed`,status:`done`},{id:`context_sync`,label:`Synchronizing project context`,status:`running`,...r===void 0?{}:{elapsedLabel:r}}]}}function mS(e){let t=e.blocked_by?.kind===`approval`?{kind:`approval`}:{kind:`clarification`};return{key:`pending:${e.blocked_by?.kind===`approval`?e.blocked_by.approval_id:e.blocked_by?.kind===`clarification`?e.blocked_by.round_id:e.updated_at}`,title:Vx,summary:e.summary,tone:`pending`,metaLabel:`Needs input`,completionTarget:t,steps:[{id:`waiting_for_input`,label:`Needs input`,status:`pending`}]}}function hS(e){let t=e.last_conclusion?.task_id??(e.status===`failed`?e.active_task?.id:void 0);return t===void 0&&e.status!==`failed`?null:{key:`failed:${t??e.updated_at}`,title:Vx,summary:e.last_conclusion?.summary??e.summary,tone:`failed`,metaLabel:`Failed`,...t===void 0?{}:{completionTarget:{kind:`task`,taskId:t}},steps:[{id:`run_failed`,label:`Run failed`,status:`failed`}]}}function gS(e,t={}){let n=fS(e,t);if(n!==null)return n;let r=pS(e,t);if(r!==null)return r;let i=lS(e,t);return i===null?e.status===`pending`?mS(e):e.status===`failed`?hS(e):null:i}function _S(e){let t=e.activeTaskCompileClarification&&!e.activeScratchpadRefreshFromSubmit&&!e.activeProjectContextBootstrap&&!e.activeTaskCompile,n=[],r=Yx(e.startedAt,e);if(e.activeProjectContextBootstrap)n.push({id:`scratchpad_submit:project_context`,label:`Preparing project context`,status:`running`,...r===void 0?{}:{elapsedLabel:r},detail:`Creating project context for the first time`});else if(e.activeTaskCompile||e.activeScratchpadRefreshFromSubmit){let t=e.activeTaskCompile?$x(e.runtime):[];n.push({id:`scratchpad_submit:task_compile`,label:`Compiling Worklist tasks`,status:`running`,...r===void 0?{}:{elapsedLabel:r},...t.length===0?{}:{metrics:t}})}else n.push({id:`scratchpad_submit:task_compile`,label:`Compiling Worklist tasks`,status:t?`done`:`running`});t&&n.push({id:`scratchpad_submit:needs_input`,label:`Needs input`,status:`pending`});let i=n.find(e=>e.status===`running`||e.status===`pending`)?.label??`Compiling Worklist tasks`;return{key:`scratchpad-submit`,title:Vx,summary:t?`Task compilation needs a decision before Worklist can update.`:`Preparing the Scratchpad for formal tasks.`,tone:t?`pending`:`running`,metaLabel:t?`Needs input`:i,completionTarget:t?{kind:`clarification`}:{kind:`scratchpad`},steps:n}}function vS(e,t){return{...e,key:`${e.key}:complete`,title:Vx,summary:t,tone:`complete`,metaLabel:`Complete`,steps:e.steps.map(e=>({...e,status:`done`}))}}function yS(e,t){let n=e.completionSource;return n===void 0?!0:n.activityRef===void 0?n.workflowRef===void 0?n.taskId===void 0?!0:t.task_id===n.taskId:t.workflow_ref===n.workflowRef:t.activity_ref===n.activityRef}function bS(e){if(e.status===`idle`)return[];let t=[];if(e.status===`pending`){let n=e.blocked_by?.kind===`approval`?{kind:`approval`}:{kind:`clarification`};t.push({key:`pending`,label:`Needs input`,title:`Needs input`,tone:`pending`,target:n})}let n=e.last_conclusion?.kind===`failed`?e.last_conclusion.task_id:e.status===`failed`?e.active_task?.id??e.last_conclusion?.task_id:void 0;if(n!==void 0&&t.push({key:`failed`,label:`Run failed`,tone:`failed`,target:{kind:`task`,taskId:n}}),e.status===`running`&&e.active_task!==void 0){let n=sS(e.summary);t.push({key:`running`,label:n.label,title:n.label,tone:`running`,target:{kind:`task`,taskId:e.active_task.id}})}let r=cS(e);return r!==null&&t.push(r),t}var xS=`/assets/beethoven-symphony-5-opening-ypVy5SB4.svg`,SS=`/assets/beethoven-symphony-7-allegretto-B3bc-cZD.svg`,CS=`/assets/dvorak-symphony-9-largo-BEgNL3HB.svg`,wS=`/assets/mozart-symphony-18-allegro-B5-MrLL1.svg`,TS=`/assets/Tutti-square-BqFU7F0D.png`,ES=`/assets/Tutti-B7gEyTp1.png`,DS=`/assets/tutti_avatar-_0Yc-cMJ.png`,OS=`/assets/avatar-avery-CkLXb185.svg`,kS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2080%2080'%20fill='none'%20shape-rendering='auto'%20aria-hidden='true'%3e%3c!--%20Generated%20by%20DiceBear%20(https://dicebear.com)%20--%3e%3cmetadata%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:dcterms='http://purl.org/dc/terms/'%3e%3crdf:RDF%3e%3crdf:Description%3e%3cdc:title%3eDylan!%20The%20Avatar%20Generator%3c/dc:title%3e%3cdc:creator%3eNatalia%20Spivak%3c/dc:creator%3e%3cdc:source%20xsi:type='dcterms:URI'%3ehttps://www.figma.com/community/file/1356575240759683500%3c/dc:source%3e%3cdcterms:license%20xsi:type='dcterms:URI'%3ehttps://creativecommons.org/licenses/by/4.0/%3c/dcterms:license%3e%3cdc:rights%3eRemix%20of%20“Dylan!%20The%20Avatar%20Generator”%20(https://www.figma.com/community/file/1356575240759683500)%20by%20“Natalia%20Spivak”,%20licensed%20under%20“CC%20BY%204.0”%20(https://creativecommons.org/licenses/by/4.0/)%3c/dc:rights%3e%3c/rdf:Description%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%3e%3cg%20id='mood-happy-7dff0831'%3e%3cpath%20d='M.04%2017.04c2.41%209.29%2015.16%2012.28%2022.34%206.67a14%2014%200%200%200%204.7-7.22c.36-1.28-1.57-1.8-1.93-.57-1.24%204.23-4.33%207.4-8.68%208.33-3.77.8-8.03-.1-11.05-2.52a10%2010%200%200%201-3.45-5.26c-.32-1.25-2.25-.72-1.93.53'%20fill='black'/%3e%3c/g%3e%3cg%20id='hair-shortCurls-7dff0831'%3e%3cpath%20d='m15.3%2027.49%201.58%204.38%201.06-9.52s2.27%201.27%203.44-.26.16-3.47.16-3.47%201.81.55%203.31-.8c1.87-1.67%201.26-3.46%201.26-3.46s1.71%201.9%204.5%201.1c2.77-.8%203.14-2.76%203.14-2.76s.56%202.18%203.4%202.12%203.2-2.01%203.2-2.01%200%202.43%202.43%203.14%203.43-1.24%203.43-1.24c0%20.02-.9%202.39.66%203.76%201.44%201.26%203.5.35%203.5.35s-.73%202.3.77%203.62c1.6%201.4%203.48.6%203.48.6l.77%208.34%201.8-3.8s1.4-.13%202.72.15c0%20.01%202.58-2.78%201.15-5.9s-3.64-2.86-3.64-2.86%201.95-3.05.13-5.65-4.94-1.96-4.94-1.96%201.18-3.52-1.68-5.27-5.92.46-5.92.46-.1-3.7-3.2-4.16c-3.26-.48-4.58%202.66-4.58%202.66s-1.35-2.89-4.14-2.44c-2.8.44-3.32%203.53-3.32%203.53S27.32%203.57%2024.92%205s-1.8%204.51-1.8%204.51-2.98-2.24-5.32-.23-.14%205.1-.14%205.1-3.87-1.12-5.04%201.8%201.66%204.95%201.66%204.95-5.35%201.16-2.82%207.33c0%200%20.6-.27%202.02-.62s1.8-.38%201.8-.38z'%20fill='%23000000'/%3e%3c/g%3e%3cclipPath%20id='clip-7dff0831'%3e%3crect%20width='80'%20height='80'%20rx='0'%20ry='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23clip-7dff0831)'%3e%3crect%20width='80'%20height='80'%20fill='%23e5f4ec'/%3e%3cpath%20d='M19.07%2030.47s1.57-20.23%2021.59-20.23S62.3%2030.55%2062.3%2030.55s9.43-.8%209.43%207.6c0%208.42-9.28%207.13-9.28%207.13S60.9%2067.15%2042.03%2067.15c-21.11%200-23.4-20.8-23.4-20.8s-9%20.72-9.93-6.25c-1.08-8.2%2010.37-9.64%2010.37-9.64'%20fill='%23c26450'/%3e%3cpath%20d='m64.3%2039.49.46-.41.1-.09c.12-.1-.13.1-.02.02l.24-.17q.5-.35%201.06-.62l.26-.12.05-.02.05-.02.58-.21q.6-.18%201.2-.28c.52-.08.85-.76.7-1.23-.18-.56-.67-.8-1.23-.7a9.3%209.3%200%200%200-4.87%202.43c-.38.36-.4%201.06%200%201.4.4.36%201%20.4%201.4%200zm-51.8-1.16.14.01c-.27-.02-.11-.01-.04%200l.3.05.52.14.28.09.12.05c.02%200%20.22.09.06.02-.14-.1%200-.04.03-.03l.15.06.26.13.47.3.27.22q.47.38.83.83c.33.4%201.07.37%201.41%200%20.4-.43.36-.98%200-1.4a7.3%207.3%200%200%200-4.84-2.53c-.52-.06-1.02.5-1%201%20.03.59.44.94%201%201m18.3-1.9v4.54c0%20.52.46%201.02%201%201s1-.44%201-1V36.4c0-.52-.46-1.02-1-1s-1%20.44-1%201M49.2%2036l-.15%204.81a1%201%200%200%200%201%201c.56-.02.98-.44%201-1l.15-4.8a1%201%200%200%200-1-1%201%201%200%200%200-1%201'%20fill='black'/%3e%3cuse%20transform='translate(27.82%2026.75)'%20href='%23mood-happy-7dff0831'/%3e%3cuse%20transform='translate(3.78%202.95)'%20href='%23hair-shortCurls-7dff0831'/%3e%3c/g%3e%3c/svg%3e`,AS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2080%2080'%20fill='none'%20shape-rendering='auto'%20aria-hidden='true'%3e%3c!--%20Generated%20by%20DiceBear%20(https://dicebear.com)%20--%3e%3cmetadata%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:dcterms='http://purl.org/dc/terms/'%3e%3crdf:RDF%3e%3crdf:Description%3e%3cdc:title%3eDylan!%20The%20Avatar%20Generator%3c/dc:title%3e%3cdc:creator%3eNatalia%20Spivak%3c/dc:creator%3e%3cdc:source%20xsi:type='dcterms:URI'%3ehttps://www.figma.com/community/file/1356575240759683500%3c/dc:source%3e%3cdcterms:license%20xsi:type='dcterms:URI'%3ehttps://creativecommons.org/licenses/by/4.0/%3c/dcterms:license%3e%3cdc:rights%3eRemix%20of%20“Dylan!%20The%20Avatar%20Generator”%20(https://www.figma.com/community/file/1356575240759683500)%20by%20“Natalia%20Spivak”,%20licensed%20under%20“CC%20BY%204.0”%20(https://creativecommons.org/licenses/by/4.0/)%3c/dc:rights%3e%3c/rdf:Description%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%3e%3cg%20id='mood-happy-46c131e2'%3e%3cpath%20d='M.04%2017.04c2.41%209.29%2015.16%2012.28%2022.34%206.67a14%2014%200%200%200%204.7-7.22c.36-1.28-1.57-1.8-1.93-.57-1.24%204.23-4.33%207.4-8.68%208.33-3.77.8-8.03-.1-11.05-2.52a10%2010%200%200%201-3.45-5.26c-.32-1.25-2.25-.72-1.93.53'%20fill='black'/%3e%3c/g%3e%3cg%20id='hair-fluffy-46c131e2'%3e%3cpath%20d='M16.45%2029.48s13.74%2023.53%203.86%2028.24C9.05%2063.08-1.2%2048.01.1%2036.77s10.96-16.35%2010.96-16.35-.58-9.5%209.2-15.04c9.78-5.55%2016.64.44%2016.64.44s8.06-5.9%2015.5-1.37c7.46%204.53%207.26%2014.68%207.26%2014.68s13.74-.56%2013.65%2016.47c-.08%2015.17-10.03%2022.94-16.8%2021.6-10.45-2.07%201.27-29.22%201.27-29.22s-14.4%201.04-20.14-9.75c0%200-4%205.95-9.7%208.62a32%2032%200%200%201-11.47%202.64z'%20fill='%231d5dff'/%3e%3c/g%3e%3cclipPath%20id='clip-46c131e2'%3e%3crect%20width='80'%20height='80'%20rx='0'%20ry='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23clip-46c131e2)'%3e%3crect%20width='80'%20height='80'%20fill='%23fbf0d1'/%3e%3cpath%20d='M19.07%2030.47s1.57-20.23%2021.59-20.23S62.3%2030.55%2062.3%2030.55s9.43-.8%209.43%207.6c0%208.42-9.28%207.13-9.28%207.13S60.9%2067.15%2042.03%2067.15c-21.11%200-23.4-20.8-23.4-20.8s-9%20.72-9.93-6.25c-1.08-8.2%2010.37-9.64%2010.37-9.64'%20fill='%23c26450'/%3e%3cpath%20d='m64.3%2039.49.46-.41.1-.09c.12-.1-.13.1-.02.02l.24-.17q.5-.35%201.06-.62l.26-.12.05-.02.05-.02.58-.21q.6-.18%201.2-.28c.52-.08.85-.76.7-1.23-.18-.56-.67-.8-1.23-.7a9.3%209.3%200%200%200-4.87%202.43c-.38.36-.4%201.06%200%201.4.4.36%201%20.4%201.4%200zm-51.8-1.16.14.01c-.27-.02-.11-.01-.04%200l.3.05.52.14.28.09.12.05c.02%200%20.22.09.06.02-.14-.1%200-.04.03-.03l.15.06.26.13.47.3.27.22q.47.38.83.83c.33.4%201.07.37%201.41%200%20.4-.43.36-.98%200-1.4a7.3%207.3%200%200%200-4.84-2.53c-.52-.06-1.02.5-1%201%20.03.59.44.94%201%201m18.3-1.9v4.54c0%20.52.46%201.02%201%201s1-.44%201-1V36.4c0-.52-.46-1.02-1-1s-1%20.44-1%201M49.2%2036l-.15%204.81a1%201%200%200%200%201%201c.56-.02.98-.44%201-1l.15-4.8a1%201%200%200%200-1-1%201%201%200%200%200-1%201'%20fill='black'/%3e%3cuse%20transform='translate(27.82%2026.75)'%20href='%23mood-happy-46c131e2'/%3e%3cuse%20transform='translate(3.78%202.95)'%20href='%23hair-fluffy-46c131e2'/%3e%3c/g%3e%3c/svg%3e`,jS=`/assets/ode-to-joy-SNBUPr3-.svg`,MS=TS,NS=ES,PS=DS,FS={logoSrc:ES,tuttiAvatarSrc:DS,scoreSrc:jS,humanAvatars:{fey:kS,avery:OS,jun:AS}};function IS({onClick:e}){let t=(0,P.jsx)(Ds,{src:NS,label:`Tutti`});return e===void 0?t:(0,P.jsx)(Os,{logo:t,label:`Tutti Project Center`,onClick:e})}function LS({onClick:e}){return(0,P.jsx)(Os,{logo:(0,P.jsx)(Ds,{src:NS,className:`tutti-logo`}),onClick:e})}var RS=`https://lets.tutti.now`,zS=`${RS}/start/create-a-project#connect-a-provider-and-choose-a-model`,BS={href:RS,target:`_blank`,rel:`noopener noreferrer`};function VS(){return(0,P.jsxs)(pd,{children:[`New to Tutti?`,` `,(0,P.jsx)(`a`,{...BS,"aria-label":`Read the Tutti documentation (opens in a new tab)`,children:`Read the docs`}),`.`]})}function HS(){return(0,P.jsx)(Ls,{...BS,label:`Support Center`,icon:(0,P.jsx)(pi,{"aria-hidden":`true`})})}var US=[xS,SS,CS,wS];function WS(){return US[Math.min(US.length-1,Math.floor(Math.random()*US.length))]}function GS({backgroundPattern:e,children:t,...n}){let[r]=(0,N.useState)(WS);return(0,P.jsx)(Uo,{...e===void 0?{backgroundImageSrc:r}:{backgroundPattern:e},...n,children:t})}function KS({actions:e,children:t,onBrandClick:n}){return(0,P.jsxs)(GS,{children:[(0,P.jsx)(Wo,{brand:(0,P.jsx)(LS,{onClick:n}),actions:e}),t]})}function qS({children:e,label:t,onBrandClick:n}){return(0,P.jsx)(KS,{onBrandClick:n,children:(0,P.jsx)(Ko,{"aria-label":t,children:e})})}function JS({auth:e,mobileAuth:t,onBrandClick:n}){return(0,P.jsx)(GS,{backgroundPattern:`dots`,className:`homepage-entry-page`,children:(0,P.jsx)(fd,{brand:(0,P.jsx)(LS,{onClick:n}),visual:(0,P.jsx)(Kd,{assets:FS}),auth:e,mobileAuth:t,footer:(0,P.jsx)(VS,{})})})}function YS({phase:e,form:t,onChange:n}){return e===`code`?(0,P.jsx)(`div`,{className:`form-stack`,children:(0,P.jsx)(Ns,{label:`Email verification code`,children:(0,P.jsx)(ks,{autoComplete:`one-time-code`,inputMode:`numeric`,type:`text`,value:t.code,onChange:e=>n({code:e.target.value}),placeholder:`Enter email code`,maxLength:6})})}):e===`profile`?(0,P.jsxs)(`div`,{className:`form-stack`,children:[(0,P.jsx)(Ns,{label:`Display name`,children:(0,P.jsx)(ks,{autoComplete:`name`,type:`text`,value:t.displayName,onChange:e=>n({displayName:e.target.value}),placeholder:`username`})}),(0,P.jsx)(`p`,{className:`form-note`,children:`This name cannot be changed yet.`})]}):(0,P.jsx)(`div`,{className:`form-stack`,children:(0,P.jsx)(Ns,{label:`Email`,children:(0,P.jsx)(ks,{autoComplete:`email`,type:`email`,value:t.email,onChange:e=>n({email:e.target.value}),placeholder:`alex@example.com`})})})}function XS({surface:e,phase:t,form:n,pending:r,error:i,submitDisabled:a,submitLabel:o,pendingLabel:s,onChange:c,onSubmit:l,onBack:u}){let d={title:t===`profile`?`Choose display name`:`Sign in`,description:t===`profile`?`Set the name your teammates will see.`:t===`code`?`Enter your email verification code.`:`Use your email to continue.`,onSubmit:l,action:(0,P.jsxs)(xs,{type:`submit`,disabled:a||r,children:[r?s??(t===`profile`?`Saving`:t===`code`?`Verifying`:`Sending code`):o??(t===`profile`?`Save name`:t===`code`?`Verify email code`:`Send code`),(0,P.jsx)(ai,{"aria-hidden":`true`})]}),secondaryAction:t===`code`&&u!==void 0?(0,P.jsxs)(Ss,{type:`button`,onClick:u,disabled:r,children:[(0,P.jsx)(ii,{"aria-hidden":`true`}),`Change email`]}):void 0,feedback:i===null?void 0:(0,P.jsx)(Ps,{children:i}),children:(0,P.jsx)(YS,{phase:t,form:n,onChange:c})};return e===`card`?(0,P.jsx)(tf,{...d}):(0,P.jsx)(md,{...d})}function ZS(e){return(0,P.jsx)(XS,{...e,surface:`card`})}function QS(e){return(0,P.jsx)(XS,{...e,surface:`rail`})}function $S({onBrandClick:e,...t}){return(0,P.jsx)(JS,{onBrandClick:e,auth:(0,P.jsx)(QS,{...t}),mobileAuth:(0,P.jsx)(ZS,{...t})})}function eC({nextKind:e,actionPending:t,loginForm:n,onRetry:r,onAccept:i,onOpen:a}){if(e===`loading`)return(0,P.jsx)(Ss,{type:`button`,disabled:!0,children:`Loading`});if(e===`error`)return(0,P.jsx)(Ss,{type:`button`,onClick:r,children:`Retry`});if(e===`invalid_or_expired`)return(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(na,{"aria-hidden":`true`}),`Invalid invite`]});if(e===`login_required`){let e=n?.phase===`profile`?`Save name`:n?.phase===`code`?`Verify email code`:`Send code`,r=n?.phase===`profile`?`Saving`:n?.phase===`code`?`Verifying`:`Sending code`;return(0,P.jsxs)(xs,{type:`submit`,disabled:t||n?.submitDisabled===!0,children:[t?r:e,(0,P.jsx)(ai,{"aria-hidden":`true`})]})}return e===`accept_join`?(0,P.jsxs)(xs,{type:`button`,disabled:t,onClick:i,children:[t?`Joining`:`Accept and open workspace`,(0,P.jsx)(ai,{"aria-hidden":`true`})]}):e===`open_workspace`?(0,P.jsxs)(xs,{type:`button`,disabled:t,onClick:a,children:[t?`Opening`:`Open workspace`,(0,P.jsx)(ai,{"aria-hidden":`true`})]}):(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(Hi,{"aria-hidden":`true`}),`Host offline`]})}function tC({nextKind:e,error:t}){return e===`loading`?null:e===`error`?(0,P.jsx)(aa,{tone:`error`,icon:(0,P.jsx)(na,{"aria-hidden":`true`}),children:t??`Invite unavailable`}):e===`invalid_or_expired`?(0,P.jsx)(aa,{tone:`error`,icon:(0,P.jsx)(na,{"aria-hidden":`true`}),children:`Join token is invalid or expired`}):e===`host_offline`?(0,P.jsx)(aa,{tone:`warning`,icon:(0,P.jsx)(Hi,{"aria-hidden":`true`}),children:`Host is offline`}):null}function nC({projectName:e,description:t,hostLabel:n,hostOnline:r,nextKind:i,accountLabel:a,membershipLabel:o,actionPending:s,error:c,loginForm:l,onBrandClick:u,onRetry:d,onAccept:f,onOpen:p}){let m=i===`login_required`&&l!==void 0;return(0,P.jsx)(qS,{label:`Join project`,onBrandClick:u,children:(0,P.jsxs)(tf,{title:`Join project`,description:t,onSubmit:e=>{if(m){l.onSubmit(e);return}e.preventDefault()},action:(0,P.jsx)(eC,{nextKind:i,actionPending:m?l.pending:s,...m?{loginForm:l}:{},onAccept:f,onOpen:p,...d===void 0?{}:{onRetry:d}}),secondaryAction:m&&l.phase===`code`&&l.onBack!==void 0?(0,P.jsxs)(Ss,{type:`button`,onClick:l.onBack,disabled:l.pending,children:[(0,P.jsx)(ii,{"aria-hidden":`true`}),`Change email`]}):void 0,feedback:(0,P.jsxs)(P.Fragment,{children:[m&&l.error!==null?(0,P.jsx)(Ps,{children:l.error}):null,(0,P.jsx)(tC,{nextKind:i,error:c}),c===null||i===`error`?null:(0,P.jsx)(Ps,{children:c})]}),children:[(0,P.jsx)(nf,{projectName:e,hostLabel:n,hostOnline:r}),m?(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(YS,{phase:l.phase,form:l.form,onChange:l.onChange})}):(0,P.jsx)(rf,{label:a===null?`Account`:`Signed in as`,value:a??`Sign in required`,action:o===null?null:(0,P.jsx)(`span`,{className:`quiet-link`,children:o})})]})})}function rC(e){switch(e.status){case`online`:return`Online`;case`reconnecting`:return`Reconnecting`;case`relay-unavailable`:return`Relay unavailable`;case`stale`:return`Needs restart`;case`stopped`:return`Stopped`;case`workspace-missing`:return`Folder missing`;case`workspace-replaced`:return`Folder changed`;case`invalid`:return`Needs attention`}}function iC(e){return(e.status===`online`||e.status===`reconnecting`)&&e.provider_status===`configured`}function aC(e){return(e.status===`stopped`||e.status===`stale`||e.status===`relay-unavailable`)&&e.provider_status===`configured`}function oC(e,t){let n=Date.parse(e.activity_at??``),r=Date.parse(t.activity_at??``),i=Number.isNaN(n)?0:n;return(Number.isNaN(r)?0:r)-i||e.display_name.localeCompare(t.display_name,`en`)||e.project_id.localeCompare(t.project_id,`en`)}function sC(e){return e.provider_status===`configured`?e.provider_model?.trim()||`Provider ready`:e.provider_status===`invalid`?`Provider issue`:`Provider needed`}function cC({project:e,pending:t,onLaunch:n,onOpen:r,onCopyInvite:i,onStop:a}){return e.status===`online`||e.status===`reconnecting`?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(xs,{type:`button`,disabled:t||e.open_url===void 0,onClick:r,children:[(0,P.jsx)(yi,{"aria-hidden":`true`}),`Open`]}),(0,P.jsxs)(Ss,{type:`button`,disabled:t,onClick:i,children:[(0,P.jsx)(Ai,{"aria-hidden":`true`}),`Invite`]}),(0,P.jsxs)(Ss,{type:`button`,disabled:t,onClick:a,children:[(0,P.jsx)(Qi,{"aria-hidden":`true`}),`Stop`]})]}):(0,P.jsxs)(Ss,{type:`button`,disabled:t||!aC(e),onClick:n,children:[(0,P.jsx)(Wi,{"aria-hidden":`true`}),`Resume`]})}function lC({form:e,models:t,projects:n,projectsLoading:r,sessionLoading:i,sessionError:a,createOpen:o,createStep:s,modelDiscoveryPending:c,launchPending:l,projectActionPending:u,packageUpdateAction:d,onChange:f,onCreateOpenChange:p,onCreateSubmit:m,onCreateBack:h,onChooseFolder:g,onRefresh:_,onLaunchExisting:v,onOpenProject:y,onCopyInvite:b,onStopProject:x,onPackageUpdate:S}){let C=[`Folder`,`Details`,`Provider`,`Model`],w=C.findIndex(e=>e.toLowerCase()===s),T=c||l,E=s===`folder`?e.workspacePath.trim()!==``:s===`details`?e.displayName.trim()!==``:s===`provider`?e.baseUrl.trim()!==``&&e.apiKey.trim()!==``:t.length>0&&e.model.trim()!==``,ee=n.filter(iC).sort(oC),D=n.filter(aC).sort(oC),O=n.filter(e=>!iC(e)&&!aC(e)).sort(oC),k=e=>(0,P.jsx)(Cf,{title:e.display_name,statusLabel:rC(e),online:e.status===`online`,path:e.workspace_path,createdLabel:Qn(e.created_at),providerLabel:sC(e),providerStatus:e.provider_status,actions:(0,P.jsx)(cC,{project:e,pending:u===e.project_id,onLaunch:()=>v(e),onOpen:()=>y(e),onCopyInvite:()=>b(e),onStop:()=>x(e)})},e.project_id);return(0,P.jsx)(KS,{onBrandClick:_,children:(0,P.jsxs)(Go,{children:[(0,P.jsxs)(af,{className:`local-console-card`,title:`Local projects`,accountAction:(0,P.jsxs)(P.Fragment,{children:[d===void 0?null:(0,P.jsx)(of,{description:d.description,descriptionId:`local-console-package-update-description`,disabledTrigger:d.disabled,"aria-live":`polite`,action:(0,P.jsx)(Ss,{type:`button`,disabled:d.disabled,onClick:S,children:d.label})}),(0,P.jsx)(bs,{type:`button`,label:`Refresh projects`,icon:(0,P.jsx)(Ui,{"aria-hidden":`true`}),disabled:r,onClick:_}),(0,P.jsxs)(xs,{type:`button`,disabled:i||a!==null,onClick:()=>p(!0),children:[(0,P.jsx)(Vi,{"aria-hidden":`true`}),`New project`]})]}),"aria-label":`Tutti Local Console`,children:[r||i?(0,P.jsx)(ff,{"aria-label":`Machine projects`,children:(0,P.jsx)(hf,{"aria-label":`Loading local projects`,children:(0,P.jsx)(oa,{})})}):a===null?n.length===0?(0,P.jsx)(ff,{"aria-label":`Machine projects`,children:(0,P.jsx)(hf,{children:(0,P.jsx)(aa,{children:`Create your first local project.`})})}):null:(0,P.jsx)(ff,{"aria-label":`Machine projects`,children:(0,P.jsx)(hf,{children:(0,P.jsx)(aa,{children:a})})}),r||i||n.length===0?null:(0,P.jsxs)(P.Fragment,{children:[ee.length===0?null:(0,P.jsx)(xf,{title:`Available`,"aria-label":`Available projects`,children:ee.map(k)}),D.length===0?null:(0,P.jsx)(xf,{title:`Ready to resume`,"aria-label":`Projects ready to resume`,children:D.map(k)}),O.length===0?null:(0,P.jsx)(Sf,{children:O.map(k)})]})]}),(0,P.jsxs)(_f,{open:o,onOpenChange:p,steps:C,currentStep:Math.max(0,w),closeDisabled:T,explicitCloseOnly:!0,onSubmit:m,backAction:s===`folder`?void 0:(0,P.jsxs)(Ss,{type:`button`,disabled:T,onClick:h,children:[(0,P.jsx)(ii,{"aria-hidden":`true`}),`Back`]}),action:(0,P.jsxs)(xs,{type:`submit`,disabled:!E||T||i,children:[s===`model`?(0,P.jsx)(Wi,{"aria-hidden":`true`}):(0,P.jsx)(ai,{"aria-hidden":`true`}),s===`provider`&&c?`Checking provider`:s===`model`?l?`Launching`:`Launch and continue`:`Continue`]}),children:[s===`folder`?(0,P.jsx)(bf,{title:`Project folder`,description:`Choose an existing folder on this machine. It can be empty or contain an existing project.`,children:(0,P.jsxs)(yf,{children:[(0,P.jsx)(ks,{"aria-label":`Project folder`,autoComplete:`off`,value:e.workspacePath,onChange:e=>f({workspacePath:e.target.value}),placeholder:`Enter an absolute project folder path`,autoFocus:!0}),(0,P.jsxs)(Ss,{type:`button`,onClick:g,children:[(0,P.jsx)(wi,{"aria-hidden":`true`}),`Choose folder`]})]})}):null,s===`details`?(0,P.jsx)(bf,{title:`Project details`,description:`Describe what you want to build with this project.`,children:(0,P.jsxs)(vf,{children:[(0,P.jsx)(Ns,{label:`Project name`,className:`local-console-field-wide`,children:(0,P.jsx)(ks,{autoComplete:`off`,value:e.displayName,maxLength:80,onChange:e=>f({displayName:e.target.value}),placeholder:`Enter a project name`,autoFocus:!0})}),(0,P.jsx)(Ns,{label:`Project description (optional)`,className:`local-console-field-wide`,children:(0,P.jsx)(As,{value:e.description,maxLength:160,onChange:e=>f({description:e.target.value}),placeholder:`A short project description helps Tutti produce better code`})})]})}):null,s===`provider`?(0,P.jsx)(bf,{title:`Provider`,description:(0,P.jsxs)(P.Fragment,{children:[`Enter an endpoint compatible with the`,` `,(0,P.jsx)(Fs,{href:zS,"aria-label":`Tutti Responses API provider guide (opens in a new tab)`,icon:(0,P.jsx)(pi,{"aria-hidden":`true`}),children:`OpenAI Responses API`}),`. Credentials stay only on this machine.`]}),children:(0,P.jsxs)(vf,{children:[(0,P.jsx)(Ns,{label:`Base URL`,children:(0,P.jsx)(ks,{autoComplete:`off`,inputMode:`url`,type:`url`,value:e.baseUrl,onChange:e=>f({baseUrl:e.target.value}),placeholder:`Enter Provider Base URL`,autoFocus:!0})}),(0,P.jsx)(Ns,{label:`API key`,children:(0,P.jsx)(ks,{autoComplete:`off`,type:`password`,value:e.apiKey,onChange:e=>f({apiKey:e.target.value}),placeholder:`Enter API key`})})]})}):null,s===`model`?(0,P.jsx)(bf,{title:`Model`,description:`Choose an available model or type another model name.`,children:(0,P.jsx)(Ns,{label:`Model`,children:(0,P.jsx)(js,{autoComplete:`off`,value:e.model,options:t,maxVisibleOptions:8,onValueChange:e=>f({model:e}),placeholder:`Choose or enter a model`,autoFocus:!0})})}):null]})]})})}function uC({onBrandClick:e,sessionError:t=null,...n}){let r={...n,error:n.error??t};return(0,P.jsx)(JS,{onBrandClick:e,auth:(0,P.jsx)(QS,{...r}),mobileAuth:(0,P.jsx)(ZS,{...r})})}function dC({account:e,projects:t,loading:n,error:r,openPending:i,logoutPending:a,joinLinkForm:o,launchExpanded:s,onLaunch:c,onCopyLaunchCommand:l,onBrandClick:u,onLogout:d,onOpenProject:f}){let p=t.filter(e=>e.hostStatus===`offline`),m=t.filter(e=>e.hostStatus!==`offline`),h=e=>(0,P.jsx)(mf,{title:e.displayName,statusLabel:`Host ${e.hostStatusLabel.toLowerCase()}`,online:e.canOpen,details:[{label:`Role`,value:e.membershipLabel},{label:`Opened`,value:e.lastOpenedLabel}],disabled:!e.canOpen||i,onClick:()=>f(e.relayProjectRef)},e.relayProjectRef);return(0,P.jsx)(KS,{onBrandClick:u,children:(0,P.jsx)(Go,{children:(0,P.jsxs)(af,{title:`Projects`,...e===null?{}:{accountName:e.displayName,accountAction:(0,P.jsxs)(Ss,{type:`button`,onClick:d,disabled:a,children:[(0,P.jsx)(Ni,{"aria-hidden":`true`}),`Sign out`]})},"aria-label":`Project Center`,children:[(0,P.jsxs)(sf,{children:[(0,P.jsx)(lf,{title:`Join a project`,description:`Paste an invitation link or the full invitation message.`,inputLabel:`Invitation link or message`,placeholder:`Paste an invitation link or message`,value:o.value,error:o.error,onValueChange:o.onChange,"aria-label":`Join a project`,onSubmit:e=>{e.preventDefault(),o.onSubmit()}}),(0,P.jsx)(uf,{title:`Launch from your computer`,description:`Open Tutti on this computer to create or manage local projects.`,actionHref:`tutti://projects`,expanded:s,statusTitle:`Opening the Tutti app…`,statusDescription:`If Tutti is not installed, copy this command and run it in Terminal:`,command:`npm install -g @xfey/tutti && tutti`,onAction:c,onCopyCommand:l,"aria-label":`Launch a project from your computer`})]}),n?(0,P.jsx)(ff,{children:(0,P.jsx)(hf,{"aria-label":`Loading projects`,children:(0,P.jsx)(oa,{})})}):r===null?(0,P.jsxs)(P.Fragment,{children:[m.length===0?(0,P.jsx)(ff,{children:(0,P.jsx)(hf,{"aria-label":`No available projects`,children:(0,P.jsx)(aa,{children:`No available projects`})})}):(0,P.jsx)(ff,{children:m.map(h)}),p.length===0?null:(0,P.jsx)(pf,{title:`Offline Projects`,listLabel:`Offline projects`,className:`project-center-offline-projects`,children:p.map(h)})]}):(0,P.jsx)(ff,{children:(0,P.jsx)(hf,{"aria-label":`Project Center error`,children:(0,P.jsx)(aa,{tone:`error`,children:r})})})]})})})}function fC({form:e,pending:t,tokenMissing:n,onChange:r}){return(0,P.jsxs)(`div`,{className:`form-stack`,children:[(0,P.jsx)(Ns,{label:`Project name`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`text`,value:e.projectName,onChange:e=>r({projectName:e.target.value}),placeholder:`tutti-default`})}),(0,P.jsx)(Ns,{label:`OpenAI API key`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`password`,value:e.apiKey,onChange:e=>r({apiKey:e.target.value}),placeholder:`sk-...`})}),(0,P.jsx)(Ns,{label:`Base URL`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`url`,value:e.baseUrl,onChange:e=>r({baseUrl:e.target.value}),placeholder:`https://api.openai.com/v1`})}),(0,P.jsx)(Ns,{label:`Default model`,children:(0,P.jsx)(ks,{autoComplete:`off`,disabled:t||n,type:`text`,value:e.defaultModel,onChange:e=>r({defaultModel:e.target.value}),placeholder:`gpt-5.5`})})]})}function pC({form:e,statusLabel:t,configured:n,loading:r,pending:i,openProjectPending:a=!1,tokenMissing:o,error:s,success:c,onChange:l,onSubmit:u,onRetry:d,onBrandClick:f}){let p=i||a;return(0,P.jsx)(qS,{label:`Project setup`,onBrandClick:f,children:(0,P.jsxs)(tf,{title:`Project setup`,description:`Configure the provider for this project.`,size:`wide`,onSubmit:u,action:o?(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(na,{"aria-hidden":`true`}),`Missing token`]}):s!==null&&r?(0,P.jsx)(Ss,{type:`button`,onClick:d,children:`Retry`}):a?(0,P.jsxs)(Ss,{type:`button`,disabled:!0,children:[(0,P.jsx)(ai,{"aria-hidden":`true`}),`Opening project`]}):(0,P.jsxs)(xs,{type:`submit`,disabled:i||e.apiKey.trim()===``||e.projectName.trim()===``,children:[i?`Saving`:`Save provider`,(0,P.jsx)(Gi,{"aria-hidden":`true`})]}),feedback:(0,P.jsxs)(P.Fragment,{children:[c===null?null:(0,P.jsx)(aa,{icon:(0,P.jsx)(fi,{"aria-hidden":`true`}),children:c}),s===null?null:(0,P.jsx)(Ps,{children:s})]}),children:[(0,P.jsx)(nf,{projectName:`OpenAI provider`,hostLabel:t,hostOnline:n,members:(0,P.jsx)(Oi,{"aria-hidden":`true`})}),(0,P.jsx)(rf,{label:`Status`,value:r?`Loading`:t,action:n?(0,P.jsx)(fi,{"aria-hidden":`true`}):null}),(0,P.jsx)(fC,{form:e,pending:p,tokenMissing:o,onChange:l})]})})}var mC=`http://127.0.0.1:4370`;function hC(){let e=`https://tutti.now`;return typeof e==`string`?e:typeof window<`u`&&window.location.port!==`4372`?window.location.origin:mC}function gC(e){try{return new URL(e,hC()).toString()}catch{return e}}function _C({avatar:e,label:t,plain:n=!1,online:r=!1}){return(0,P.jsx)(Yo,{label:t,tone:e.color,plain:n,online:r,initials:e.initials,...e.kind===`image`?{imageUrl:gC(e.image_url)}:{}})}function vC({label:e=`Tutti`}){return(0,P.jsx)(Yo,{label:e,tone:`green`,className:`is-system`,imageUrl:PS,icon:(0,P.jsx)(si,{"aria-hidden":`true`})})}function yC({tone:e}){return e===`pending`?(0,P.jsx)(na,{"aria-hidden":`true`}):e===`failed`?(0,P.jsx)(mi,{"aria-hidden":`true`}):e===`done`?(0,P.jsx)(li,{"aria-hidden":`true`}):(0,P.jsx)(Mi,{"aria-hidden":`true`})}function bC({members:e}){return e===void 0||e.length===0?null:(0,P.jsx)(Xo,{"aria-label":`Members`,children:e.map(e=>(0,P.jsx)(_C,{avatar:e.avatar,label:e.displayName},e.key))})}function xC({activePage:e,statusShortcuts:t,unread:n,artifactSignal:r,mobileContext:i,children:a,onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenArtifacts:u,onOpenSkills:d,onOpenTimeline:f,onOpenSettings:p,onActivateStatusShortcut:m,getStatusShortcutAriaControls:h}){let g=e!==`chat`&&n?.chat===!0,_=e!==`worklist`&&n?.worklist===!0,v=r?.available===!0,y=e!==`references`&&n?.references===!0,b=e!==`skills`&&n?.skills===!0;return(0,P.jsx)(qo,{children:(0,P.jsx)(Jo,{className:`is-headerless`,sidebar:(0,P.jsxs)(Is,{brand:(0,P.jsx)(IS,{...o===void 0?{}:{onClick:o}}),mobileTitle:i.title,...i.meta===void 0?{}:{mobileMeta:i.meta},...i.action===void 0?{}:{mobileAction:i.action},...t.length===0?{}:{status:t.map(e=>(0,N.createElement)(zs,{icon:(0,P.jsx)(yC,{tone:e.tone}),label:e.label,tone:e.tone,onClick:()=>m?.(e),...h?.(e)===void 0?{}:{"aria-controls":h(e)},key:e.key}))},footer:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(HS,{}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(qi,{"aria-hidden":`true`}),label:`Settings`,active:e===`settings`,onClick:e===`settings`?void 0:p})]}),children:[(0,P.jsx)(Rs,{icon:(0,P.jsx)(jy,{"aria-hidden":`true`}),label:`Chat`,active:e===`chat`,badge:g?{label:`Unread messages`}:!1,onClick:e===`chat`?void 0:s}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(ji,{"aria-hidden":`true`}),label:`Worklist`,active:e===`worklist`,badge:_?{label:`Unread worklist updates`}:!1,onClick:e===`worklist`?void 0:c}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(Li,{"aria-hidden":`true`}),label:`Artifacts`,active:e===`artifacts`,badge:v?{label:`Artifacts available`,text:`Live`,variant:`pill`}:!1,onClick:e===`artifacts`?void 0:u}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(Si,{"aria-hidden":`true`}),label:`References`,active:e===`references`,badge:y?{label:`New reference files`}:!1,onClick:e===`references`?void 0:l}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(Xi,{"aria-hidden":`true`}),label:`Skills`,active:e===`skills`,badge:b?{label:`New skill updates`}:!1,onClick:e===`skills`?void 0:d}),(0,P.jsx)(Rs,{icon:(0,P.jsx)(ci,{"aria-hidden":`true`}),label:`Timeline`,active:e===`timeline`,onClick:e===`timeline`?void 0:f})]}),children:a})})}function SC(){return(0,P.jsx)(Ds,{src:NS,className:`empty-state-brand-logo`})}function CC(e){return(0,P.jsx)(aa,{watermark:(0,P.jsx)(SC,{}),...e})}var wC=`tutti.execution-score-themes.v1`,TC=40,EC={assignments:[],bag:[]};function DC(){return{assignments:[],bag:[]}}function OC(){try{return typeof window>`u`?null:window.sessionStorage}catch{return null}}function kC(e,t){if(typeof e!=`object`||!e)return null;let n=e;if(!Array.isArray(n.assignments)||!Array.isArray(n.bag))return null;let r=n.assignments.filter(e=>typeof e==`object`&&!!e&&typeof e.identity==`string`&&t.has(String(e.themeId))),i=n.bag.filter(e=>typeof e==`string`&&t.has(e)),a=typeof n.recent==`string`&&t.has(n.recent)?n.recent:void 0;return{assignments:r,bag:i,...a===void 0?{}:{recent:a}}}function AC(e,t){if(e===null)return EC;try{let n=e.getItem(wC);return n===null?DC():kC(JSON.parse(n),t)??DC()}catch{return EC}}function jC(e,t){if(EC=t,e!==null)try{e.setItem(wC,JSON.stringify(t))}catch{}}function MC(e,t,n){let r=e.map(e=>e.id);for(let e=r.length-1;e>0;--e){let t=Math.min(e,Math.max(0,Math.floor(n()*(e+1))));[r[e],r[t]]=[r[t],r[e]]}if(r.length>1&&r[0]===t){let e=r.findIndex(e=>e!==t);[r[0],r[e]]=[r[e],r[0]]}return r}function NC(e,t={}){let n=t.themes??Vo;if(n.length===0)throw Error(`Execution score themes are unavailable`);let r=new Map(n.map(e=>[e.id,e])),i=new Set(r.keys()),a=t.storage===void 0?OC():t.storage,o=AC(a,i),s=o.assignments.find(t=>t.identity===e),c=s===void 0?void 0:r.get(s.themeId);if(c!==void 0)return c;let l=t.random??Math.random,u=o.bag.length>0?[...o.bag]:MC(n,o.recent,l),d=u.shift(),f=d===void 0?void 0:r.get(d);if(f===void 0)throw Error(`Execution score themes are unavailable`);return jC(a,{assignments:[...o.assignments,{identity:e,themeId:f.id}].slice(-TC),bag:u,recent:f.id}),f}function PC(e){return`round-card-${e}`}function FC(e){return`approval-card-${e}`}function IC(e){return`chat-message-${e}`}var LC=`workspace-scratchpad`,RC=720,zC=80,BC=160,VC=96,HC=160,UC=2;function WC(e){return e.completionSource?.activityRef??e.completionSource?.workflowRef??e.completionSource?.taskId??e.key}function GC({progress:e}){let t=WC(e),[n]=(0,N.useState)(()=>NC(t)),r=(0,N.useRef)(t),i=(0,N.useRef)(e.tone),[a,o]=(0,N.useState)(null);if((0,N.useEffect)(()=>{let n=r.current,a=i.current;if(r.current=t,i.current=e.tone,e.tone!==`running`||a===`pending`||n===t){o(null);return}o(t);let s=window.setTimeout(()=>{o(e=>e===t?null:e)},RC);return()=>{window.clearTimeout(s)}},[e.tone,t]),e.tone===`running`||e.tone===`pending`||e.tone===`complete`){let r=e.tone===`running`&&a===t,i=e.steps.find(e=>e.status===`running`||e.status===`pending`)??e.steps.at(-1),o=e.completionTarget?.kind===`task`?`Task completed`:`Procedure completed`,s=e.tone===`complete`?void 0:i?.detail??(e.tone===`pending`?e.summary:void 0),c=e.tone===`complete`?void 0:i?.elapsedLabel,l=e.tone===`complete`?void 0:i?.metrics;return(0,P.jsx)(Co,{stageLabel:r?`Loading the next movement…`:e.tone===`complete`?o:i?.label??e.summary,...r||s===void 0?{}:{stageDetail:s},...r||c===void 0?{}:{elapsedLabel:c},...r||l===void 0?{}:{metrics:l},scoreLabel:r?`Loading the next movement score`:e.tone===`complete`?`${o} score cadence`:e.tone===`pending`?`Execution score paused while waiting for input`:`${i?.label??`Execution`} running score using ${n.shortName}`,state:r?`handoff`:e.tone===`complete`?`complete`:e.tone===`pending`?`paused`:`running`,units:n.units,playbackBpm:n.tempo,openingClef:n.clef,keySignatureFifths:n.keySignatureFifths,timeSignature:n.meter})}return(0,P.jsx)(Pb,{title:e.title,summary:e.summary,tone:e.tone,steps:e.steps,...e.metaLabel===void 0?{}:{metaLabel:e.metaLabel}})}function KC(e){if(e===void 0)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function qC(e,t){if(e===null)return null;let n=KC(e.requestedAt);if(n===null)return t.length;let r=t.findIndex(e=>{let t=KC(e.createdAt);return t!==null&&t>n});return r===-1?t.length:r}function JC(e,{focusSelector:t}={}){let n=typeof document>`u`?null:document.getElementById(e);n!==null&&(n.scrollIntoView({block:`center`}),t!==void 0&&n.querySelector(t)?.focus({preventScroll:!0}))}function YC(e){return e.messageKind===`system_notice`&&e.workflowRef!==void 0&&(e.body.startsWith(`Worklist updated with `)||e.body===`Worklist is already covered by existing tasks.`)}function XC(e,t){if(t===void 0)return;let n=t.label.trim(),r=t.handle?.trim()??n;if(n===``||r===``)return;let i=r.toLocaleLowerCase();e.has(i)||e.set(i,{id:t.id,label:n,handle:r})}function ZC({members:e,messages:t,clarificationMessagesByRoundId:n}){let r=new Map;XC(r,{id:`tutti`,label:`Tutti`,handle:`tutti`});for(let t of e)XC(r,{id:t.key,label:t.displayName});for(let e of t)XC(r,{id:`message:${e.author}`,label:e.author,...e.avatarKind===`tutti`?{handle:`tutti`}:{}});for(let e of Object.values(n))for(let t of e)XC(r,{id:`round-message:${t.author}`,label:t.author,...t.avatarKind===`tutti`?{handle:`tutti`}:{}});return[...r.values()]}function QC({message:e}){return e.avatarKind===`tutti`?(0,P.jsx)(vC,{label:e.author}):(0,P.jsx)(_C,{avatar:e.avatar??{kind:`initials`,initials:dr(e.author),color:`blue`},label:e.author,online:e.online})}function $C({projectName:e,projectDescription:t=``,members:n,messages:r,scratchpad:i,executionProgress:a=null,activeApproval:o=null,activeClarification:s,clarificationMessagesByRoundId:c,statusShortcuts:l,unread:u,artifactSignal:d,draft:f,roundDraft:p,sendPending:m,scratchpadSyncPending:h=!1,scratchpadActionsDisabled:g=!1,scratchpadSubmitPending:_=!1,referenceUploadPending:v=!1,focusMessageId:y=null,messageHistoryIdentity:b=`latest`,initialMessagePosition:x=y===null?`latest`:`focus`,hasOlderMessages:S=!1,hasNewerMessages:C=!1,loadingOlderMessages:w=!1,loadingNewerMessages:T=!1,historyConnectedToLatest:E=!0,roundSendPending:ee=!1,roundSubmitPending:D=!1,submittedRoundId:O=null,approvalDecisionPending:k=!1,projectNameSaving:te=!1,projectDescriptionSaving:ne=!1,loading:A=!1,unavailable:re=!1,onDraftChange:ie,onMessageFocused:j,onInitialMessagePositioned:M,onLoadOlderMessages:ae,onLoadNewerMessages:oe,onJumpToLatest:se,onUploadReferenceFile:ce,onOpenReferenceFile:le,onRoundDraftChange:ue,onSendMessage:de,onSendRoundMessage:fe,onSubmitRound:pe,onDecideApproval:me,onSubmitScratchpad:he,onUpdateProjectDisplayName:ge,onUpdateProjectDescription:_e,onOpenProjectCenter:ve,onOpenWorklist:ye,onOpenWorklistTask:be,onOpenReferences:xe,onOpenArtifacts:Se,onOpenSkills:Ce,onOpenTimeline:we,onOpenSettings:Te,onActivateStatusShortcut:Ee}){let[De,Oe]=(0,N.useState)(!1),ke=(0,N.useRef)(null),Ae=(0,N.useRef)(!1),je=(0,N.useRef)(null),Me=(0,N.useRef)(null),Ne=(0,N.useRef)(!0),Pe=(0,N.useRef)(void 0),Fe=(0,N.useRef)(b),Ie=(0,N.useRef)(null),Le=(0,P.jsx)(qy,{className:`chat-project-title-edit`,value:e,placeholder:`Untitled project`,ariaLabel:`Edit project name`,maxLength:zC,saving:te,disabled:A,...ge===void 0?{}:{onUpdate:ge}}),Re=(0,P.jsx)(qy,{className:`chat-project-description-edit`,value:t,placeholder:`Add a project description`,ariaLabel:`Edit project description`,maxLength:BC,allowEmpty:!0,saving:ne,disabled:A,..._e===void 0?{}:{onUpdate:_e}}),ze=s!==null&&r.some(e=>e.id===s.cardMessageId),Be=new Map;for(let e of r)e.clarificationCard!==void 0&&e.workflowRef!==void 0&&Be.set(e.workflowRef,e.clarificationCard.roundId);let Ve=new Map;for(let e of r){if(!YC(e)||e.workflowRef===void 0)continue;let t=Be.get(e.workflowRef);t!==void 0&&Ve.set(t,{...e,id:`round-result:${e.id}`,messageKind:`agent_text`,author:`Tutti`,avatarKind:`tutti`,online:!1})}let He=e=>{let t=c[e]??[],n=Ve.get(e);return n===void 0||t.some(e=>e.body===n.body)?t:[...t,n]},Ue=ZC({members:n,messages:r,clarificationMessagesByRoundId:c}),We=ce===void 0?void 0:e=>{for(let t of e)ce(t)};(0,N.useLayoutEffect)(()=>{Fe.current!==b&&(Fe.current=b,Ae.current=!1,je.current=null,Pe.current=void 0)},[b]),(0,N.useLayoutEffect)(()=>{let e=je.current;if(e!==null){if(r[0]?.id!==e.firstMessageId){let t=ke.current;t!==null&&(t.scrollTop=e.scrollTop+Math.max(0,t.scrollHeight-e.scrollHeight),Ne.current=t.scrollHeight-t.clientHeight-t.scrollTop<=UC),je.current=null;return}w||(je.current=null)}},[w,r]),(0,N.useEffect)(()=>{if(y===null||!r.some(e=>e.id===y))return;Ae.current=!0,JC(IC(y));let e=ke.current;e!==null&&(Ne.current=e.scrollHeight-e.clientHeight-e.scrollTop<=UC),j?.()},[y,r,j]),(0,N.useEffect)(()=>{if(Ae.current||A||re||x!==`latest`||y!==null||r.length===0&&s===null&&o===null)return;let e=ke.current;if(e===null)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight,Ne.current=!0,Ae.current=!0});return()=>window.cancelAnimationFrame(t)},[o,s,y,A,r,re]),(0,N.useEffect)(()=>{if(Ae.current||A||re||x!==`start`||y!==null)return;let e=ke.current;if(e===null)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=0,Ne.current=e.scrollHeight<=e.clientHeight+UC,Ae.current=!0,M?.()});return()=>window.cancelAnimationFrame(t)},[y,x,A,r,M,re]);let Ge=()=>{if(!S||w||je.current!==null||ae===void 0)return;let e=ke.current;e!==null&&(je.current={firstMessageId:r[0]?.id,scrollHeight:e.scrollHeight,scrollTop:e.scrollTop},ae())},Ke=()=>{!C||T||oe===void 0||oe()},qe=e=>{let t=e.currentTarget;Ne.current=t.scrollHeight-t.clientHeight-t.scrollTop<=UC,Me.current!==null&&window.cancelAnimationFrame(Me.current),Me.current=window.requestAnimationFrame(()=>{if(Me.current=null,t.scrollTop<=VC){Ge();return}t.scrollHeight-t.clientHeight-t.scrollTop<=HC&&Ke()})};(0,N.useEffect)(()=>()=>{Me.current!==null&&window.cancelAnimationFrame(Me.current)},[]),(0,N.useEffect)(()=>{if(A||re||w||T||!Ae.current)return;let e=ke.current;if(e===null||e.scrollHeight>e.clientHeight+UC)return;let t=window.requestAnimationFrame(()=>{S?Ge():C&&Ke()});return()=>window.cancelAnimationFrame(t)},[C,S,A,T,w,r,re]);let Je=r.at(-1)?.id;(0,N.useEffect)(()=>{let e=Pe.current;if(Pe.current=Je,e===void 0||e===Je||!E||!Ne.current||!Ae.current||je.current!==null)return;let t=ke.current;if(t===null)return;let n=window.requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight,Ne.current=!0});return()=>window.cancelAnimationFrame(n)},[E,Je]);let Ye=({key:e,roundId:t,title:n,summary:r,request:i,contextLabel:a,writable:o})=>{let s=He(t),c=s.filter(e=>e.messageKind===`user_text`).length;return(0,P.jsx)(Hb,{id:PC(t),tabIndex:-1,title:n,summary:r,request:i,...a===void 0?{}:{contextLabel:a},messages:s.map(e=>({id:e.id,author:e.author,body:e.body,time:e.time,avatar:(0,P.jsx)(QC,{message:e})})),replyCount:c,draft:o?p:``,defaultOpen:!0,readOnly:!o,status:o?`pending`:`done`,statusLabel:o?`needs input`:`submitted`,mentionOptions:Ue,sendPending:o&&ee,submitPending:o&&D,onDraftChange:ue,onSendMessage:fe,onSubmitRound:pe},`${e}:${o?`writable`:`sealed`}`)},Xe=e=>{if(e.target.kind===`approval`&&o!==null){if(!E){Ie.current=e,se?.();return}JC(FC(o.approvalId),{focusSelector:`.chat-event-card-header`});return}if(e.target.kind===`clarification`&&s!==null){if(!E&&!ze){Ie.current=e,se?.();return}JC(PC(s.roundId),{focusSelector:`.chat-event-card-header`});return}if(e.target.kind===`scratchpad`){JC(LC);return}Ee?.(e)};(0,N.useEffect)(()=>{let e=Ie.current;if(!E||A||e===null)return;Ie.current=null;let t=window.requestAnimationFrame(()=>{e.target.kind===`approval`&&o!==null?JC(FC(o.approvalId),{focusSelector:`.chat-event-card-header`}):e.target.kind===`clarification`&&s!==null&&JC(PC(s.roundId),{focusSelector:`.chat-event-card-header`})});return()=>window.cancelAnimationFrame(t)},[o,s,E,A,r]);let Ze=e=>s===null?null:Ye({key:e,roundId:s.roundId,title:s.title,summary:s.summary,request:s.request,contextLabel:s.ownerLabel,writable:s.status===`writable`&&s.roundId!==O}),Qe=()=>o===null?null:(0,P.jsx)(Kb,{id:FC(o.approvalId),tabIndex:-1,title:o.title,summary:o.summary,...o.reason===void 0?{}:{reason:o.reason},...o.detail===void 0?{}:{detail:o.detail,...o.detailLabel===void 0?{}:{detailLabel:o.detailLabel},...o.detailCode===void 0?{}:{detailCode:o.detailCode}},status:o.status,statusLabel:o.statusLabel,decisions:o.decisions,decisionPending:k,...o.resolutionLabel===void 0?{}:{resolutionLabel:o.resolutionLabel},onDecide:e=>me?.(o.approvalId,e)},`approval:${o.approvalId}:${o.status}`),$e=e=>{let t=e.clarificationCard;if(t===void 0)return null;let n=s!==null&&s.roundId===t.roundId;return Ye({key:e.id,roundId:t.roundId,title:n&&s!==null?s.title:t.title??`Clarification round ${t.roundId.slice(-4)}`,summary:n&&s!==null?s.summary:t.summary,request:n&&s!==null?s.request:t.summary,...n&&s!==null?{contextLabel:s.ownerLabel}:{},writable:n&&t.status===`writable`&&t.roundId!==O})},et=e=>{if(YC(e)&&Be.has(e.workflowRef??``))return null;if(e.messageKind===`clarification_card`)return $e(e);if(s!==null&&e.id===s.cardMessageId)return Ze(e.id);if(e.taskResult!==void 0)return(0,P.jsx)(qb,{id:IC(e.id),tabIndex:-1,className:e.id===y?`is-focused`:void 0,title:e.taskResult.title,status:e.taskResult.status,taskId:e.taskResult.taskId,taskTitle:e.taskResult.taskTitle,summary:e.taskResult.summary,...e.taskResult.moduleName===void 0?{}:{moduleName:e.taskResult.moduleName},...e.taskResult.finalNote===void 0?{}:{finalNote:e.taskResult.finalNote},...e.taskResult.generatedFiles===void 0?{}:{generatedFiles:e.taskResult.generatedFiles},...e.taskResult.errorCode===void 0?{}:{errorCode:e.taskResult.errorCode},...be===void 0?{}:{onOpenTask:be}},e.id);let t=e.referenceFile;return(0,P.jsx)(My,{id:IC(e.id),tabIndex:-1,author:e.author,time:e.time,avatar:(0,P.jsx)(QC,{message:e}),className:e.id===y?`is-focused`:void 0,children:t===void 0?e.messageKind===`agent_text`?(0,P.jsx)(Ny,{children:e.body}):(0,P.jsx)(`p`,{children:(0,P.jsx)(ky,{children:e.body})}):(0,P.jsx)(Gy,{name:t.name,category:t.category,...t.imageUrl===void 0?{}:{imageUrl:t.imageUrl},onClick:()=>le?.(t.path)})},e.id)},tt=E?qC(o,r):null,nt=()=>{let e=s!==null&&(ze||E)||o!==null&&E;return r.length===0&&!e&&!w&&!T?(0,P.jsx)(CC,{children:`No messages yet`}):(0,P.jsxs)(P.Fragment,{children:[w?(0,P.jsx)(`div`,{className:`chat-history-status`,role:`status`,children:`Loading earlier messages…`}):null,!E||ze?null:Ze(`active-round`),r.map((e,t)=>(0,P.jsxs)(N.Fragment,{children:[tt===t?Qe():null,et(e)]},`timeline:${e.id}`)),tt===r.length?Qe():null,T?(0,P.jsx)(`div`,{className:`chat-history-status`,role:`status`,children:`Loading newer messages…`}):null]})},rt=(e,t=!1)=>(0,P.jsx)(Ab,{id:e,tabIndex:-1,compact:t,title:i.title,summary:i.summary,sections:i.sections,submitAvailable:i.submitAvailable,...i.pages===void 0?{}:{pages:i.pages},...i.footerNote===void 0?{}:{footerNote:i.footerNote},...i.updatedLabelPrefix===void 0?{}:{updatedLabelPrefix:i.updatedLabelPrefix},syncPending:h,actionsDisabled:g,submitPending:_,onSubmitScratchpad:he,...be===void 0?{}:{onOpenCompiledTask:be},empty:(0,P.jsx)(CC,{children:`Scratchpad empty. Discuss more, tutti together!`}),...i.updatedLabel===void 0?{}:{updatedLabel:i.updatedLabel}}),it=(0,P.jsx)(`div`,{className:`chat-panel-actions`,children:(0,P.jsx)(bC,{members:n})});return(0,P.jsxs)(xC,{activePage:`chat`,statusShortcuts:l,mobileContext:{title:e,action:(0,P.jsx)(Rs,{className:h?`mobile-scratchpad-trigger is-syncing`:`mobile-scratchpad-trigger`,type:`button`,label:De?`Close Scratchpad`:`Open Scratchpad`,active:De,"aria-expanded":De,"aria-controls":`${LC}-mobile-sheet`,icon:(0,P.jsx)(Zy,{"aria-hidden":`true`}),onClick:()=>Oe(e=>!e)})},...u===void 0?{}:{unread:u},...d===void 0?{}:{artifactSignal:d},onOpenProjectCenter:ve,onOpenWorklist:ye,onOpenReferences:xe,onOpenArtifacts:Se,onOpenSkills:Ce,onOpenTimeline:we,onOpenSettings:Te,onActivateStatusShortcut:Xe,getStatusShortcutAriaControls:e=>e.target.kind===`approval`&&o!==null&&E?FC(o.approvalId):e.target.kind===`clarification`&&s!==null&&(E||ze)?PC(s.roundId):e.target.kind===`scratchpad`?LC:void 0,children:[(0,P.jsxs)(`section`,{className:`workspace-grid is-tutti chat-workspace-grid`,"aria-label":`Chat workspace`,children:[A?(0,P.jsx)(Ky,{title:Le,subtitle:Re,actions:it,children:(0,P.jsx)(oa,{})}):re?(0,P.jsx)(Ky,{title:Le,subtitle:Re,actions:it,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):(0,P.jsx)(Ky,{title:Le,subtitle:Re,actions:it,streamRef:ke,onStreamScroll:qe,streamOverlay:C&&se!==void 0?(0,P.jsx)(Ss,{className:`chat-jump-latest`,type:`button`,onClick:se,children:`Jump to latest`}):void 0,dropUploadPending:v,...We===void 0?{}:{onDropFiles:We},composer:(0,P.jsx)(Xy,{value:f,pending:m,uploadPending:v,mentionOptions:Ue,onValueChange:ie,onComposerSubmit:de,...ce===void 0?{}:{onFileUpload:ce}}),empty:(0,P.jsx)(CC,{children:`No messages yet`}),children:nt()}),(0,P.jsxs)(`div`,{className:a===null?`chat-side-column`:`chat-side-column has-progress`,children:[rt(LC),a===null?null:(0,P.jsx)(GC,{progress:a})]})]}),De?(0,P.jsxs)(`div`,{className:`mobile-scratchpad-layer is-open`,id:`${LC}-mobile-sheet`,children:[(0,P.jsx)(`button`,{className:`mobile-scratchpad-backdrop`,type:`button`,"aria-label":`Close Scratchpad`,onClick:()=>Oe(!1)}),(0,P.jsxs)(`section`,{className:`mobile-scratchpad-card`,role:`dialog`,"aria-modal":`true`,"aria-label":`Scratchpad`,children:[(0,P.jsxs)(`div`,{className:`mobile-scratchpad-card-head`,children:[(0,P.jsx)(`h2`,{children:`Scratchpad`}),(0,P.jsx)(bs,{className:`mobile-scratchpad-close`,type:`button`,label:`Close Scratchpad`,icon:(0,P.jsx)(ia,{"aria-hidden":`true`}),onClick:()=>Oe(!1)})]}),(0,P.jsx)(`div`,{className:`mobile-scratchpad-card-body`,children:rt(`${LC}-mobile`,!0)})]})]}):null]})}function ew({statusShortcuts:e,unread:t,artifactSignal:n,state:r,loading:i=!1,unavailable:a=!1,onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenSkills:u,onOpenTimeline:d,onOpenSettings:f,onActivateStatusShortcut:p}){let m=i?{status:`loading`}:a?{status:`not_declared`}:r;return(0,P.jsx)(xC,{activePage:`artifacts`,statusShortcuts:e,mobileContext:{title:m.status===`declared`?m.title:`Artifacts`},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenSkills:u,onOpenTimeline:d,onOpenSettings:f,onActivateStatusShortcut:p,children:(0,P.jsx)(`section`,{className:`workspace-grid artifacts-workspace-grid`,"aria-label":`Artifacts`,children:(0,P.jsx)(lx,{state:m,...a?{empty:(0,P.jsx)(CC,{children:`Workspace unavailable`})}:{},emptyWatermark:(0,P.jsx)(SC,{})})})})}function tw({statusShortcuts:e,unread:t,artifactSignal:n,files:r,detail:i,uploadPending:a=!1,fileSortMode:o=`time`,loading:s=!1,unavailable:c=!1,onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,onSelectFile:_,onUploadFile:v,onFileSortModeChange:y}){let b=s||c;return(0,P.jsx)(xC,{activePage:`references`,statusShortcuts:e,mobileContext:{title:`References`,action:(0,P.jsx)(Yy,{variant:`bare`,className:`sidebar-button reference-upload-button`,label:`Upload reference`,pendingLabel:`Uploading reference`,pending:a,iconOnly:!0,onFileUpload:v})},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,children:(0,P.jsx)(`section`,{className:`workspace-grid references-workspace-grid`,"aria-label":`Reference files`,children:(0,P.jsx)(ox,{files:b?[]:r,...s?{detail:{title:`Loading`,unavailableReason:`Loading`}}:c?{detail:{title:`References unavailable`,unavailableReason:`Workspace unavailable`}}:i===void 0?{}:{detail:i},uploadPending:a,fileSortMode:o,empty:s?(0,P.jsx)(CC,{children:`Loading reference files`}):c?(0,P.jsx)(CC,{children:`Workspace unavailable`}):(0,P.jsx)(CC,{children:`No reference files`}),onSelectFile:_,onUploadFile:v,...y===void 0?{}:{onFileSortModeChange:y}})})})}var nw=6,rw=`......`,iw=80,aw=160;function ow(e){let t=document.createElement(`canvas`).getContext(`2d`);if(t===null)return null;let n=window.getComputedStyle(e);return t.font=[n.fontStyle,n.fontVariant,n.fontWeight,n.fontSize,n.fontFamily].join(` `),e=>t.measureText(e).width}function sw(e,t,n){if(n(e)<=t)return e;let r=e.slice(-nw),i=Math.max(0,e.length-r.length),a=0,o=i;for(;a<o;){let i=Math.ceil((a+o)/2);n(`${e.slice(0,i)}${rw}${r}`)<=t?a=i:o=i-1}return`${e.slice(0,a)}${rw}${r}`}function cw({value:e}){let t=(0,N.useRef)(null),[n,r]=(0,N.useState)(e);return(0,N.useEffect)(()=>{let n=t.current;if(n===null)return;let i=()=>{let t=ow(n),i=n.getBoundingClientRect().width;if(t===null||i<=0){r(e);return}let a=sw(e,i,t);r(e=>e===a?e:a)};i();let a=typeof ResizeObserver>`u`?null:new ResizeObserver(i);return a?.observe(n),window.addEventListener(`resize`,i),()=>{a?.disconnect(),window.removeEventListener(`resize`,i)}},[e]),(0,P.jsx)(`code`,{ref:t,className:`settings-masked-link`,title:e,"aria-label":e,children:n})}function lw({value:e,onCopy:t}){return t===void 0?(0,P.jsx)(cw,{value:e}):(0,P.jsx)(`button`,{className:`settings-value-button settings-link-copy-button`,type:`button`,"aria-label":`Copy invite link`,onClick:t,children:(0,P.jsx)(cw,{value:e})})}function uw(e,t){return e.map(e=>({id:e.id,title:e.title,rows:e.rows.map(e=>({label:e.label,value:e.identity===!0?(0,P.jsxs)(`div`,{className:`settings-identity`,children:[(0,P.jsx)(_C,{avatar:t.currentMember.avatar,label:t.currentMember.displayName}),(0,P.jsx)(`strong`,{children:t.currentMember.displayName})]}):e.value,...e.identity===!0?{plain:!0}:{},...e.code===void 0?{}:{code:e.code}}))}))}function dw({settings:e,onCopyJoinUrl:t}){let n=e.invite;return n===void 0?null:{label:`invite link`,value:n.joinUrl===void 0?`not recoverable`:(0,P.jsx)(lw,{value:n.joinUrl,onCopy:t}),...n.joinUrl===void 0?{}:{plain:!0}}}function fw({settings:e,statusShortcuts:t,unread:n,artifactSignal:r,loading:i=!1,unavailable:a=!1,projectNameSaving:o=!1,projectDescriptionSaving:s=!1,onOpenProjectCenter:c,onOpenChat:l,onOpenWorklist:u,onOpenReferences:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onActivateStatusShortcut:h,onCopyJoinUrl:g,onUpdateProjectDisplayName:_,onUpdateProjectDescription:v}){let y=e?.statuses??[],b=e===void 0?null:dw({settings:e,onCopyJoinUrl:g});return(0,P.jsx)(xC,{activePage:`settings`,statusShortcuts:t,mobileContext:{title:`Settings`},...n===void 0?{}:{unread:n},...r===void 0?{}:{artifactSignal:r},onOpenProjectCenter:c,onOpenChat:l,onOpenWorklist:u,onOpenReferences:d,onOpenArtifacts:f,onOpenSkills:p,onOpenTimeline:m,onActivateStatusShortcut:h,children:(0,P.jsx)(`section`,{className:`workspace-grid settings-workspace-grid`,"aria-label":`Project settings`,children:(0,P.jsx)(`div`,{className:`settings-page-grid`,children:i?(0,P.jsx)(`section`,{className:`settings-sheet`,"aria-label":`Loading settings`,children:(0,P.jsx)(CC,{children:`Loading settings`})}):a?(0,P.jsx)(`section`,{className:`settings-sheet`,"aria-label":`Settings unavailable`,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):e===void 0?(0,P.jsx)(`section`,{className:`settings-sheet`,"aria-label":`Settings unavailable`,children:(0,P.jsx)(CC,{children:`Settings unavailable`})}):(0,P.jsx)(tx,{statuses:y,sections:[{id:`settings-project`,title:`Project`,rows:[{label:`display_name`,plain:!0,value:(0,P.jsx)(qy,{value:e.project.displayName,placeholder:`Untitled project`,ariaLabel:`Project display name`,maxLength:iw,saving:o,..._===void 0?{}:{onUpdate:_}})},{label:`description`,plain:!0,value:(0,P.jsx)(qy,{value:e.project.description,placeholder:`Add a project description`,ariaLabel:`Project description`,maxLength:aw,allowEmpty:!0,saving:s,...v===void 0?{}:{onUpdate:v}})},...b===null?[]:[b]]},...uw(e.sections,e)]})})})})}var pw=[{title:`Awesome GitHub Copilot Skills`,href:`https://awesome-copilot.github.com/skills/`},{title:`Anthropic official skills`,href:`https://github.com/anthropics/skills`},{title:`Claude Skills Marketplace`,href:`https://claudeskills.info/skills/`}];function mw({statusShortcuts:e,unread:t,artifactSignal:n,skills:r,detail:i,uploadPending:a=!1,deletePending:o=!1,loading:s=!1,unavailable:c=!1,onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenReferences:f,onOpenArtifacts:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,onSelectSkill:_,onUploadSkill:v,onDeleteSkill:y}){let b=s||c;return(0,P.jsx)(xC,{activePage:`skills`,statusShortcuts:e,mobileContext:{title:`Skills`,action:(0,P.jsx)(Yy,{variant:`bare`,className:`sidebar-button reference-upload-button`,label:`Upload skill`,pendingLabel:`Uploading skill`,pending:a,accept:`.zip,application/zip,application/x-zip-compressed`,iconOnly:!0,onFileUpload:v})},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:l,onOpenChat:u,onOpenWorklist:d,onOpenReferences:f,onOpenArtifacts:p,onOpenTimeline:m,onOpenSettings:h,onActivateStatusShortcut:g,children:(0,P.jsx)(`section`,{className:`workspace-grid references-workspace-grid`,"aria-label":`Skills`,children:(0,P.jsx)(dx,{skills:b?[]:r,communityLinks:b?[]:pw,...s?{detail:{title:`Loading`,unavailableReason:`Loading`}}:c?{detail:{title:`Skills unavailable`,unavailableReason:`Workspace unavailable`}}:i===void 0?{}:{detail:i},uploadPending:a,deletePending:o,empty:s?(0,P.jsx)(CC,{children:`Loading skills`}):c?(0,P.jsx)(CC,{children:`Workspace unavailable`}):(0,P.jsx)(CC,{children:`No skills`}),onSelectSkill:_,onUploadSkill:v,onDeleteSkill:y})})})}function hw({timeline:e,statusShortcuts:t,unread:n,artifactSignal:r,loading:i=!1,unavailable:a=!1,onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenArtifacts:u,onOpenSkills:d,onOpenSettings:f,onActivateStatusShortcut:p}){return(0,P.jsx)(xC,{activePage:`timeline`,statusShortcuts:t,mobileContext:{title:`Timeline`},...n===void 0?{}:{unread:n},...r===void 0?{}:{artifactSignal:r},onOpenProjectCenter:o,onOpenChat:s,onOpenWorklist:c,onOpenReferences:l,onOpenArtifacts:u,onOpenSkills:d,onOpenSettings:f,onActivateStatusShortcut:p,children:(0,P.jsx)(`section`,{className:`workspace-grid timeline-workspace-grid`,"aria-label":`Timeline workspace`,children:i?(0,P.jsx)(`section`,{className:`panel timeline-panel`,"aria-label":`Loading timeline`,children:(0,P.jsx)(CC,{children:`Loading timeline`})}):a?(0,P.jsx)(`section`,{className:`panel timeline-panel`,"aria-label":`Timeline unavailable`,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):e===void 0?(0,P.jsx)(`section`,{className:`panel timeline-panel`,"aria-label":`Timeline unavailable`,children:(0,P.jsx)(CC,{children:`Timeline unavailable`})}):(0,P.jsx)(Ex,{tokenOverview:e.tokenOverview,items:e.items,scoreUnits:e.scoreUnits,empty:(0,P.jsx)(CC,{children:`No timeline events yet`})})})})}function gw({statusShortcuts:e,unread:t,artifactSignal:n,modules:r,taskCount:i,detail:a,missingTaskId:o,runNote:s,loading:c=!1,unavailable:l=!1,onOpenProjectCenter:u,onOpenChat:d,onOpenReferences:f,onOpenArtifacts:p,onOpenSkills:m,onOpenTimeline:h,onOpenSettings:g,onActivateStatusShortcut:_,onSelectTask:v}){return(0,P.jsx)(xC,{activePage:`worklist`,statusShortcuts:e,mobileContext:{title:`Worklist`,meta:i===1?`1 task`:`${i} tasks`},...t===void 0?{}:{unread:t},...n===void 0?{}:{artifactSignal:n},onOpenProjectCenter:u,onOpenChat:d,onOpenReferences:f,onOpenArtifacts:p,onOpenSkills:m,onOpenTimeline:h,onOpenSettings:g,onActivateStatusShortcut:_,children:(0,P.jsx)(`section`,{className:`workspace-grid worklist-workspace-grid`,"aria-label":`Worklist workspace`,children:c?(0,P.jsx)(`section`,{className:`panel tasks worklist-page-panel`,"aria-label":`Loading Worklist`,children:(0,P.jsx)(CC,{children:`Loading Worklist`})}):l?(0,P.jsx)(`section`,{className:`panel tasks worklist-page-panel`,"aria-label":`Worklist unavailable`,children:(0,P.jsx)(CC,{children:`Workspace unavailable`})}):(0,P.jsx)(ex,{modules:r,taskCount:i,...a===void 0?{}:{detail:a},...o===void 0?{}:{missingTaskId:o},...s==null?{}:{runNote:s},onSelectTask:v,empty:(0,P.jsx)(CC,{children:`No compiled tasks`})})})})}function _w(e){return Ew(e)&&!vw(e)&&!Aw(e)&&Symbol.asyncIterator in e}function vw(e){return Array.isArray(e)}function yw(e){return typeof e==`bigint`}function bw(e){return typeof e==`boolean`}function xw(e){return e instanceof globalThis.Date}function Sw(e){return typeof e==`function`}function Cw(e){return Ew(e)&&!vw(e)&&!Aw(e)&&Symbol.iterator in e}function ww(e){return e===null}function Tw(e){return typeof e==`number`}function Ew(e){return typeof e==`object`&&!!e}function Dw(e){return e instanceof globalThis.RegExp}function Ow(e){return typeof e==`string`}function kw(e){return typeof e==`symbol`}function Aw(e){return e instanceof globalThis.Uint8Array}function jw(e){return e===void 0}function Mw(e){return e.map(e=>Lw(e))}function Nw(e){return new Date(e.getTime())}function Pw(e){return new Uint8Array(e)}function Fw(e){return new RegExp(e.source,e.flags)}function Iw(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Lw(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Lw(e[n]);return t}function Lw(e){return vw(e)?Mw(e):xw(e)?Nw(e):Aw(e)?Pw(e):Dw(e)?Fw(e):Ew(e)?Iw(e):e}function Rw(e){return Lw(e)}function zw(e,t){return Rw(t===void 0?e:{...t,...e})}function Bw(e){return typeof e==`object`&&!!e}function Vw(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function Hw(e){return e===void 0}function Uw(e){return typeof e==`number`}var Ww;(function(e){e.InstanceMode=`default`,e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(t,n){return e.ExactOptionalPropertyTypes?n in t:t[n]!==void 0}e.IsExactOptionalProperty=t;function n(t){let n=Bw(t);return e.AllowArrayObject?n:n&&!Vw(t)}e.IsObjectLike=n;function r(e){return n(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)}e.IsRecordLike=r;function i(t){return e.AllowNaN?Uw(t):Number.isFinite(t)}e.IsNumberLike=i;function a(t){let n=Hw(t);return e.AllowNullVoid?n||t===null:n}e.IsVoidLike=a})(Ww||={});function Gw(e){return globalThis.Object.freeze(e).map(e=>Xw(e))}function Kw(e){return e}function qw(e){return e}function Jw(e){return e}function Yw(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Xw(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Xw(e[n]);return globalThis.Object.freeze(t)}function Xw(e){return vw(e)?Gw(e):xw(e)?Kw(e):Aw(e)?qw(e):Dw(e)?Jw(e):Ew(e)?Yw(e):e}function K(e,t){let n=t===void 0?e:{...t,...e};switch(Ww.InstanceMode){case`freeze`:return Xw(n);case`clone`:return Rw(n);default:return n}}var Zw=class extends Error{constructor(e){super(e)}},Qw=Symbol.for(`TypeBox.Transform`),$w=Symbol.for(`TypeBox.Readonly`),eT=Symbol.for(`TypeBox.Optional`),tT=Symbol.for(`TypeBox.Hint`),q=Symbol.for(`TypeBox.Kind`);function nT(e){return Ew(e)&&e[$w]===`Readonly`}function rT(e){return Ew(e)&&e[eT]===`Optional`}function iT(e){return _T(e,`Any`)}function aT(e){return _T(e,`Argument`)}function oT(e){return _T(e,`Array`)}function sT(e){return _T(e,`AsyncIterator`)}function cT(e){return _T(e,`BigInt`)}function lT(e){return _T(e,`Boolean`)}function uT(e){return _T(e,`Computed`)}function dT(e){return _T(e,`Constructor`)}function fT(e){return _T(e,`Date`)}function pT(e){return _T(e,`Function`)}function mT(e){return _T(e,`Integer`)}function hT(e){return _T(e,`Intersect`)}function gT(e){return _T(e,`Iterator`)}function _T(e,t){return Ew(e)&&q in e&&e[q]===t}function vT(e){return bw(e)||Tw(e)||Ow(e)}function yT(e){return _T(e,`Literal`)}function bT(e){return _T(e,`MappedKey`)}function xT(e){return _T(e,`MappedResult`)}function ST(e){return _T(e,`Never`)}function CT(e){return _T(e,`Not`)}function wT(e){return _T(e,`Null`)}function TT(e){return _T(e,`Number`)}function ET(e){return _T(e,`Object`)}function DT(e){return _T(e,`Promise`)}function OT(e){return _T(e,`Record`)}function kT(e){return _T(e,`Ref`)}function AT(e){return _T(e,`RegExp`)}function jT(e){return _T(e,`String`)}function MT(e){return _T(e,`Symbol`)}function NT(e){return _T(e,`TemplateLiteral`)}function PT(e){return _T(e,`This`)}function FT(e){return Ew(e)&&Qw in e}function IT(e){return _T(e,`Tuple`)}function LT(e){return _T(e,`Undefined`)}function RT(e){return _T(e,`Union`)}function zT(e){return _T(e,`Uint8Array`)}function BT(e){return _T(e,`Unknown`)}function VT(e){return _T(e,`Unsafe`)}function HT(e){return _T(e,`Void`)}function UT(e){return Ew(e)&&q in e&&Ow(e[q])}function WT(e){return iT(e)||aT(e)||oT(e)||lT(e)||cT(e)||sT(e)||uT(e)||dT(e)||fT(e)||pT(e)||mT(e)||hT(e)||gT(e)||yT(e)||bT(e)||xT(e)||ST(e)||CT(e)||wT(e)||TT(e)||ET(e)||DT(e)||OT(e)||kT(e)||AT(e)||jT(e)||MT(e)||NT(e)||PT(e)||IT(e)||LT(e)||RT(e)||zT(e)||BT(e)||VT(e)||HT(e)||UT(e)}var GT=`Argument.Any.Array.AsyncIterator.BigInt.Boolean.Computed.Constructor.Date.Enum.Function.Integer.Intersect.Iterator.Literal.MappedKey.MappedResult.Not.Null.Number.Object.Promise.Record.Ref.RegExp.String.Symbol.TemplateLiteral.This.Tuple.Undefined.Union.Uint8Array.Unknown.Void`.split(`.`);function KT(e){try{return new RegExp(e),!0}catch{return!1}}function qT(e){if(!Ow(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function JT(e){return ZT(e)||qE(e)}function YT(e){return jw(e)||yw(e)}function XT(e){return jw(e)||Tw(e)}function ZT(e){return jw(e)||bw(e)}function QT(e){return jw(e)||Ow(e)}function $T(e){return jw(e)||Ow(e)&&qT(e)&&KT(e)}function eE(e){return jw(e)||Ow(e)&&qT(e)}function tE(e){return jw(e)||qE(e)}function nE(e){return Ew(e)&&e[eT]===`Optional`}function rE(e){return _E(e,`Any`)&&QT(e.$id)}function iE(e){return _E(e,`Argument`)&&Tw(e.index)}function aE(e){return _E(e,`Array`)&&e.type===`array`&&QT(e.$id)&&qE(e.items)&&XT(e.minItems)&&XT(e.maxItems)&&ZT(e.uniqueItems)&&tE(e.contains)&&XT(e.minContains)&&XT(e.maxContains)}function oE(e){return _E(e,`AsyncIterator`)&&e.type===`AsyncIterator`&&QT(e.$id)&&qE(e.items)}function sE(e){return _E(e,`BigInt`)&&e.type===`bigint`&&QT(e.$id)&&YT(e.exclusiveMaximum)&&YT(e.exclusiveMinimum)&&YT(e.maximum)&&YT(e.minimum)&&YT(e.multipleOf)}function cE(e){return _E(e,`Boolean`)&&e.type===`boolean`&&QT(e.$id)}function lE(e){return _E(e,`Computed`)&&Ow(e.target)&&vw(e.parameters)&&e.parameters.every(e=>qE(e))}function uE(e){return _E(e,`Constructor`)&&e.type===`Constructor`&&QT(e.$id)&&vw(e.parameters)&&e.parameters.every(e=>qE(e))&&qE(e.returns)}function dE(e){return _E(e,`Date`)&&e.type===`Date`&&QT(e.$id)&&XT(e.exclusiveMaximumTimestamp)&&XT(e.exclusiveMinimumTimestamp)&&XT(e.maximumTimestamp)&&XT(e.minimumTimestamp)&&XT(e.multipleOfTimestamp)}function fE(e){return _E(e,`Function`)&&e.type===`Function`&&QT(e.$id)&&vw(e.parameters)&&e.parameters.every(e=>qE(e))&&qE(e.returns)}function pE(e){return _E(e,`Integer`)&&e.type===`integer`&&QT(e.$id)&&XT(e.exclusiveMaximum)&&XT(e.exclusiveMinimum)&&XT(e.maximum)&&XT(e.minimum)&&XT(e.multipleOf)}function mE(e){return Ew(e)&&Object.entries(e).every(([e,t])=>qT(e)&&qE(t))}function hE(e){return _E(e,`Intersect`)&&!(Ow(e.type)&&e.type!==`object`)&&vw(e.allOf)&&e.allOf.every(e=>qE(e)&&!RE(e))&&QT(e.type)&&(ZT(e.unevaluatedProperties)||tE(e.unevaluatedProperties))&&QT(e.$id)}function gE(e){return _E(e,`Iterator`)&&e.type===`Iterator`&&QT(e.$id)&&qE(e.items)}function _E(e,t){return Ew(e)&&q in e&&e[q]===t}function vE(e){return xE(e)&&Ow(e.const)}function yE(e){return xE(e)&&Tw(e.const)}function bE(e){return xE(e)&&bw(e.const)}function xE(e){return _E(e,`Literal`)&&QT(e.$id)&&SE(e.const)}function SE(e){return bw(e)||Tw(e)||Ow(e)}function CE(e){return _E(e,`MappedKey`)&&vw(e.keys)&&e.keys.every(e=>Tw(e)||Ow(e))}function wE(e){return _E(e,`MappedResult`)&&mE(e.properties)}function TE(e){return _E(e,`Never`)&&Ew(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function EE(e){return _E(e,`Not`)&&qE(e.not)}function DE(e){return _E(e,`Null`)&&e.type===`null`&&QT(e.$id)}function OE(e){return _E(e,`Number`)&&e.type===`number`&&QT(e.$id)&&XT(e.exclusiveMaximum)&&XT(e.exclusiveMinimum)&&XT(e.maximum)&&XT(e.minimum)&&XT(e.multipleOf)}function kE(e){return _E(e,`Object`)&&e.type===`object`&&QT(e.$id)&&mE(e.properties)&&JT(e.additionalProperties)&&XT(e.minProperties)&&XT(e.maxProperties)}function AE(e){return _E(e,`Promise`)&&e.type===`Promise`&&QT(e.$id)&&qE(e.item)}function jE(e){return _E(e,`Record`)&&e.type===`object`&&QT(e.$id)&&JT(e.additionalProperties)&&Ew(e.patternProperties)&&(e=>{let t=Object.getOwnPropertyNames(e.patternProperties);return t.length===1&&KT(t[0])&&Ew(e.patternProperties)&&qE(e.patternProperties[t[0]])})(e)}function ME(e){return _E(e,`Ref`)&&QT(e.$id)&&Ow(e.$ref)}function NE(e){return _E(e,`RegExp`)&&QT(e.$id)&&Ow(e.source)&&Ow(e.flags)&&XT(e.maxLength)&&XT(e.minLength)}function PE(e){return _E(e,`String`)&&e.type===`string`&&QT(e.$id)&&XT(e.minLength)&&XT(e.maxLength)&&$T(e.pattern)&&eE(e.format)}function FE(e){return _E(e,`Symbol`)&&e.type===`symbol`&&QT(e.$id)}function IE(e){return _E(e,`TemplateLiteral`)&&e.type===`string`&&Ow(e.pattern)&&e.pattern[0]===`^`&&e.pattern[e.pattern.length-1]===`$`}function LE(e){return _E(e,`This`)&&QT(e.$id)&&Ow(e.$ref)}function RE(e){return Ew(e)&&Qw in e}function zE(e){return _E(e,`Tuple`)&&e.type===`array`&&QT(e.$id)&&Tw(e.minItems)&&Tw(e.maxItems)&&e.minItems===e.maxItems&&(jw(e.items)&&jw(e.additionalItems)&&e.minItems===0||vw(e.items)&&e.items.every(e=>qE(e)))}function BE(e){return _E(e,`Undefined`)&&e.type===`undefined`&&QT(e.$id)}function VE(e){return _E(e,`Union`)&&QT(e.$id)&&Ew(e)&&vw(e.anyOf)&&e.anyOf.every(e=>qE(e))}function HE(e){return _E(e,`Uint8Array`)&&e.type===`Uint8Array`&&QT(e.$id)&&XT(e.minByteLength)&&XT(e.maxByteLength)}function UE(e){return _E(e,`Unknown`)&&QT(e.$id)}function WE(e){return _E(e,`Unsafe`)}function GE(e){return _E(e,`Void`)&&e.type===`void`&&QT(e.$id)}function KE(e){return Ew(e)&&q in e&&Ow(e[q])&&!GT.includes(e[q])}function qE(e){return Ew(e)&&(rE(e)||iE(e)||aE(e)||cE(e)||sE(e)||oE(e)||lE(e)||uE(e)||dE(e)||fE(e)||pE(e)||hE(e)||gE(e)||xE(e)||CE(e)||wE(e)||TE(e)||EE(e)||DE(e)||OE(e)||kE(e)||AE(e)||jE(e)||ME(e)||NE(e)||PE(e)||FE(e)||IE(e)||LE(e)||zE(e)||BE(e)||VE(e)||HE(e)||UE(e)||WE(e)||GE(e)||KE(e))}var JE=`(true|false)`,YE=`(0|[1-9][0-9]*)`,XE=`(.*)`,ZE=`(?!.*)`;`${JE}`;var QE=`^${YE}$`,$E=`^${XE}$`,eD=`^${ZE}$`;function tD(e,t){return e.includes(t)}function nD(e){return[...new Set(e)]}function rD(e,t){return e.filter(e=>t.includes(e))}function iD(e,t){return e.reduce((e,t)=>rD(e,t),t)}function aD(e){return e.length===1?e[0]:e.length>1?iD(e.slice(1),e[0]):[]}function oD(e){let t=[];for(let n of e)t.push(...n);return t}function sD(e){return K({[q]:`Any`},e)}function cD(e,t){return K({[q]:`Array`,type:`array`,items:e},t)}function lD(e){return K({[q]:`Argument`,index:e})}function uD(e,t){return K({[q]:`AsyncIterator`,type:`AsyncIterator`,items:e},t)}function dD(e,t,n){return K({[q]:`Computed`,target:e,parameters:t},n)}function fD(e,t){let{[t]:n,...r}=e;return r}function pD(e,t){return t.reduce((e,t)=>fD(e,t),e)}function mD(e){return K({[q]:`Never`,not:{}},e)}function hD(e){return K({[q]:`MappedResult`,properties:e})}function gD(e,t,n){return K({[q]:`Constructor`,type:`Constructor`,parameters:e,returns:t},n)}function _D(e,t,n){return K({[q]:`Function`,type:`Function`,parameters:e,returns:t},n)}function vD(e,t){return K({[q]:`Union`,anyOf:e},t)}function yD(e){return e.some(e=>rT(e))}function bD(e){return e.map(e=>rT(e)?xD(e):e)}function xD(e){return pD(e,[eT])}function SD(e,t){return yD(e)?ck(vD(bD(e),t)):vD(bD(e),t)}function CD(e,t){return e.length===1?K(e[0],t):e.length===0?mD(t):SD(e,t)}function wD(e,t){return e.length===0?mD(t):e.length===1?K(e[0],t):vD(e,t)}var TD=class extends Zw{};function ED(e){return e.replace(/\\\$/g,`$`).replace(/\\\*/g,`*`).replace(/\\\^/g,`^`).replace(/\\\|/g,`|`).replace(/\\\(/g,`(`).replace(/\\\)/g,`)`)}function DD(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function OD(e,t){return DD(e,t,`(`)}function kD(e,t){return DD(e,t,`)`)}function AD(e,t){return DD(e,t,`|`)}function jD(e){if(!(OD(e,0)&&kD(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(OD(e,n)&&(t+=1),kD(e,n)&&--t,t===0&&n!==e.length-1)return!1;return!0}function MD(e){return e.slice(1,e.length-1)}function ND(e){let t=0;for(let n=0;n<e.length;n++)if(OD(e,n)&&(t+=1),kD(e,n)&&--t,AD(e,n)&&t===0)return!0;return!1}function PD(e){for(let t=0;t<e.length;t++)if(OD(e,t))return!0;return!1}function FD(e){let[t,n]=[0,0],r=[];for(let i=0;i<e.length;i++)if(OD(e,i)&&(t+=1),kD(e,i)&&--t,AD(e,i)&&t===0){let t=e.slice(n,i);t.length>0&&r.push(LD(t)),n=i+1}let i=e.slice(n);return i.length>0&&r.push(LD(i)),r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`or`,expr:r}}function ID(e){function t(e,t){if(!OD(e,t))throw new TD(`TemplateLiteralParser: Index must point to open parens`);let n=0;for(let r=t;r<e.length;r++)if(OD(e,r)&&(n+=1),kD(e,r)&&--n,n===0)return[t,r];throw new TD(`TemplateLiteralParser: Unclosed group parens in expression`)}function n(e,t){for(let n=t;n<e.length;n++)if(OD(e,n))return[t,n];return[t,e.length]}let r=[];for(let i=0;i<e.length;i++)if(OD(e,i)){let[n,a]=t(e,i),o=e.slice(n,a+1);r.push(LD(o)),i=a}else{let[t,a]=n(e,i),o=e.slice(t,a);o.length>0&&r.push(LD(o)),i=a-1}return r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`and`,expr:r}}function LD(e){return jD(e)?LD(MD(e)):ND(e)?FD(e):PD(e)?ID(e):{type:`const`,const:ED(e)}}function RD(e){return LD(e.slice(1,e.length-1))}var zD=class extends Zw{};function BD(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`0`&&e.expr[1].type===`const`&&e.expr[1].const===`[1-9][0-9]*`}function VD(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`true`&&e.expr[1].type===`const`&&e.expr[1].const===`false`}function HD(e){return e.type===`const`&&e.const===`.*`}function UD(e){return BD(e)||HD(e)?!1:VD(e)?!0:e.type===`and`||e.type===`or`?e.expr.every(e=>UD(e)):e.type===`const`?!0:(()=>{throw new zD(`Unknown expression type`)})()}function WD(e){return UD(RD(e.pattern))}var GD=class extends Zw{};function*KD(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of KD(e.slice(1)))yield`${t}${n}`}function*qD(e){return yield*KD(e.expr.map(e=>[...XD(e)]))}function*JD(e){for(let t of e.expr)yield*XD(t)}function*YD(e){return yield e.const}function*XD(e){return e.type===`and`?yield*qD(e):e.type===`or`?yield*JD(e):e.type===`const`?yield*YD(e):(()=>{throw new GD(`Unknown expression`)})()}function ZD(e){let t=RD(e.pattern);return UD(t)?[...XD(t)]:[]}function QD(e,t){return K({[q]:`Literal`,const:e,type:typeof e},t)}function $D(e){return K({[q]:`Boolean`,type:`boolean`},e)}function eO(e){return K({[q]:`BigInt`,type:`bigint`},e)}function tO(e){return K({[q]:`Number`,type:`number`},e)}function nO(e){return K({[q]:`String`,type:`string`},e)}function*rO(e){let t=e.trim().replace(/"|'/g,``);return t===`boolean`?yield $D():t===`number`?yield tO():t===`bigint`?yield eO():t===`string`?yield nO():yield(()=>{let e=t.split(`|`).map(e=>QD(e.trim()));return e.length===0?mD():e.length===1?e[0]:CD(e)})()}function*iO(e){if(e[1]!==`{`)return yield*[QD(`$`),...aO(e.slice(1))];for(let t=2;t<e.length;t++)if(e[t]===`}`){let n=rO(e.slice(2,t)),r=aO(e.slice(t+1));return yield*[...n,...r]}yield QD(e)}function*aO(e){for(let t=0;t<e.length;t++)if(e[t]===`$`)return yield*[QD(e.slice(0,t)),...iO(e.slice(t))];yield QD(e)}function oO(e){return[...aO(e)]}var sO=class extends Zw{};function cO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function lO(e,t){return NT(e)?e.pattern.slice(1,e.pattern.length-1):RT(e)?`(${e.anyOf.map(e=>lO(e,t)).join(`|`)})`:TT(e)||mT(e)||cT(e)?`${t}${YE}`:jT(e)?`${t}${XE}`:yT(e)?`${t}${cO(e.const.toString())}`:lT(e)?`${t}${JE}`:(()=>{throw new sO(`Unexpected Kind '${e[q]}'`)})()}function uO(e){return`^${e.map(e=>lO(e,``)).join(``)}\$`}function dO(e){return CD(ZD(e).map(e=>QD(e)))}function fO(e,t){let n=Ow(e)?uO(oO(e)):uO(e);return K({[q]:`TemplateLiteral`,type:`string`,pattern:n},t)}function pO(e){return ZD(e).map(e=>e.toString())}function mO(e){let t=[];for(let n of e)t.push(...gO(n));return t}function hO(e){return[e.toString()]}function gO(e){return[...new Set(NT(e)?pO(e):RT(e)?mO(e.anyOf):yT(e)?hO(e.const):TT(e)||mT(e)?[`[number]`]:[])]}function _O(e,t,n){let r={};for(let i of Object.getOwnPropertyNames(t))r[i]=jO(e,gO(t[i]),n);return r}function vO(e,t,n){return _O(e,t.properties,n)}function yO(e,t,n){return hD(vO(e,t,n))}function bO(e,t){return e.map(e=>OO(e,t))}function xO(e){return e.filter(e=>!ST(e))}function SO(e,t){return _k(xO(bO(e,t)))}function CO(e){return e.some(e=>ST(e))?[]:e}function wO(e,t){return CD(CO(bO(e,t)))}function TO(e,t){return t in e?e[t]:t===`[number]`?CD(e):mD()}function EO(e,t){return t===`[number]`?e:mD()}function DO(e,t){return t in e?e[t]:mD()}function OO(e,t){return hT(e)?SO(e.allOf,t):RT(e)?wO(e.anyOf,t):IT(e)?TO(e.items??[],t):oT(e)?EO(e.items,t):ET(e)?DO(e.properties,t):mD()}function kO(e,t){return t.map(t=>OO(e,t))}function AO(e,t){return CD(kO(e,t))}function jO(e,t,n){if(kT(e)||kT(t)){if(!WT(e)||!WT(t))throw new Zw(`Index types using Ref parameters require both Type and Key to be of TSchema`);return dD(`Index`,[e,t])}return xT(t)?yO(e,t,n):bT(t)?FO(e,t,n):K(WT(t)?AO(e,gO(t)):AO(e,t),n)}function MO(e,t,n){return{[t]:jO(e,[t],Rw(n))}}function NO(e,t,n){return t.reduce((t,r)=>({...t,...MO(e,r,n)}),{})}function PO(e,t,n){return NO(e,t.keys,n)}function FO(e,t,n){return hD(PO(e,t,n))}function IO(e,t){return K({[q]:`Iterator`,type:`Iterator`,items:e},t)}function LO(e){return globalThis.Object.keys(e).filter(t=>!rT(e[t]))}function RO(e,t){let n=LO(e);return K(n.length>0?{[q]:`Object`,type:`object`,required:n,properties:e}:{[q]:`Object`,type:`object`,properties:e},t)}var zO=RO;function BO(e,t){return K({[q]:`Promise`,type:`Promise`,item:e},t)}function VO(e){return K(pD(e,[$w]))}function HO(e){return K({...e,[$w]:`Readonly`})}function UO(e,t){return t===!1?VO(e):HO(e)}function WO(e,t){let n=t??!0;return xT(e)?qO(e,n):UO(e,n)}function GO(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=WO(e[r],t);return n}function KO(e,t){return GO(e.properties,t)}function qO(e,t){return hD(KO(e,t))}function JO(e,t){return K(e.length>0?{[q]:`Tuple`,type:`array`,items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[q]:`Tuple`,type:`array`,minItems:e.length,maxItems:e.length},t)}function YO(e,t){return e in t?nk(e,t[e]):hD(t)}function XO(e){return{[e]:QD(e)}}function ZO(e){let t={};for(let n of e)t[n]=QD(n);return t}function QO(e,t){return tD(t,e)?XO(e):ZO(t)}function $O(e,t){return YO(e,QO(e,t))}function ek(e,t){return t.map(t=>nk(e,t))}function tk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=nk(e,t[r]);return n}function nk(e,t){let n={...t};return rT(t)?ck(nk(e,pD(t,[eT]))):nT(t)?WO(nk(e,pD(t,[$w]))):xT(t)?YO(e,t.properties):bT(t)?$O(e,t.keys):dT(t)?gD(ek(e,t.parameters),nk(e,t.returns),n):pT(t)?_D(ek(e,t.parameters),nk(e,t.returns),n):sT(t)?uD(nk(e,t.items),n):gT(t)?IO(nk(e,t.items),n):hT(t)?vk(ek(e,t.allOf),n):RT(t)?wD(ek(e,t.anyOf),n):IT(t)?JO(ek(e,t.items??[]),n):ET(t)?zO(tk(e,t.properties),n):oT(t)?cD(nk(e,t.items),n):DT(t)?BO(nk(e,t.item),n):t}function rk(e,t){let n={};for(let r of e)n[r]=nk(r,t);return n}function ik(e,t,n){let r=WT(e)?gO(e):e;return zO(rk(r,t({[q]:`MappedKey`,keys:r})),n)}function ak(e){return K(pD(e,[eT]))}function ok(e){return K({...e,[eT]:`Optional`})}function sk(e,t){return t===!1?ak(e):ok(e)}function ck(e,t){let n=t??!0;return xT(e)?dk(e,n):sk(e,n)}function lk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=ck(e[r],t);return n}function uk(e,t){return lk(e.properties,t)}function dk(e,t){return hD(uk(e,t))}function fk(e,t={}){let n=e.every(e=>ET(e)),r=WT(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return K(t.unevaluatedProperties===!1||WT(t.unevaluatedProperties)||n?{...r,[q]:`Intersect`,type:`object`,allOf:e}:{...r,[q]:`Intersect`,allOf:e},t)}function pk(e){return e.every(e=>rT(e))}function mk(e){return pD(e,[eT])}function hk(e){return e.map(e=>rT(e)?mk(e):e)}function gk(e,t){return pk(e)?ck(fk(hk(e),t)):fk(hk(e),t)}function _k(e,t={}){if(e.length===1)return K(e[0],t);if(e.length===0)return mD(t);if(e.some(e=>FT(e)))throw Error(`Cannot intersect transform types`);return gk(e,t)}function vk(e,t){if(e.length===1)return K(e[0],t);if(e.length===0)return mD(t);if(e.some(e=>FT(e)))throw Error(`Cannot intersect transform types`);return fk(e,t)}function yk(...e){let[t,n]=typeof e[0]==`string`?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!=`string`)throw new Zw(`Ref: $ref must be a string`);return K({[q]:`Ref`,$ref:t},n)}function bk(e,t){return dD(`Awaited`,[dD(e,t)])}function xk(e){return dD(`Awaited`,[yk(e)])}function Sk(e){return vk(Tk(e))}function Ck(e){return wD(Tk(e))}function wk(e){return Ek(e)}function Tk(e){return e.map(e=>Ek(e))}function Ek(e,t){return K(uT(e)?bk(e.target,e.parameters):hT(e)?Sk(e.allOf):RT(e)?Ck(e.anyOf):DT(e)?wk(e.item):kT(e)?xk(e.$ref):e,t)}function Dk(e){let t=[];for(let n of e)t.push(Pk(n));return t}function Ok(e){return oD(Dk(e))}function kk(e){return aD(Dk(e))}function Ak(e){return e.map((e,t)=>t.toString())}function jk(e){return[`[number]`]}function Mk(e){return globalThis.Object.getOwnPropertyNames(e)}function Nk(e){return Fk?globalThis.Object.getOwnPropertyNames(e).map(e=>e[0]===`^`&&e[e.length-1]===`$`?e.slice(1,e.length-1):e):[]}function Pk(e){return hT(e)?Ok(e.allOf):RT(e)?kk(e.anyOf):IT(e)?Ak(e.items??[]):oT(e)?jk(e.items):ET(e)?Mk(e.properties):OT(e)?Nk(e.patternProperties):[]}var Fk=!1;function Ik(e,t){return dD(`KeyOf`,[dD(e,t)])}function Lk(e){return dD(`KeyOf`,[yk(e)])}function Rk(e,t){return K(CD(zk(Pk(e))),t)}function zk(e){return e.map(e=>e===`[number]`?tO():QD(e))}function Bk(e,t){return uT(e)?Ik(e.target,e.parameters):kT(e)?Lk(e.$ref):xT(e)?Uk(e,t):Rk(e,t)}function Vk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Bk(e[r],Rw(t));return n}function Hk(e,t){return Vk(e.properties,t)}function Uk(e,t){return hD(Hk(e,t))}function Wk(e){let t=[];for(let n of e)t.push(...Pk(n));return nD(t)}function Gk(e){return e.filter(e=>!ST(e))}function Kk(e,t){let n=[];for(let r of e)n.push(...kO(r,[t]));return Gk(n)}function qk(e,t){let n={};for(let r of t)n[r]=_k(Kk(e,r));return n}function Jk(e,t){return zO(qk(e,Wk(e)),t)}function Yk(e){return K({[q]:`Date`,type:`Date`},e)}function Xk(e){return K({[q]:`Null`,type:`null`},e)}function Zk(e){return K({[q]:`Symbol`,type:`symbol`},e)}function Qk(e){return K({[q]:`Undefined`,type:`undefined`},e)}function $k(e){return K({[q]:`Uint8Array`,type:`Uint8Array`},e)}function eA(e){return K({[q]:`Unknown`},e)}function tA(e){return e.map(e=>iA(e,!1))}function nA(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=WO(iA(e[n],!1));return t}function rA(e,t){return t===!0?e:WO(e)}function iA(e,t){return _w(e)||Cw(e)?rA(sD(),t):vw(e)?WO(JO(tA(e))):Aw(e)?$k():xw(e)?Yk():Ew(e)?rA(zO(nA(e)),t):Sw(e)?rA(_D([],eA()),t):jw(e)?Qk():ww(e)?Xk():kw(e)?Zk():yw(e)?eO():Tw(e)||bw(e)||Ow(e)?QD(e):zO({})}function aA(e,t){return K(iA(e,!0),t)}function oA(e,t){return dT(e)?JO(e.parameters,t):mD(t)}function sA(e,t){if(jw(e))throw Error(`Enum undefined or empty`);let n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return wD([...new Set(n)].map(e=>QD(e)),{...t,[tT]:`Enum`})}var cA=class extends Zw{},J;(function(e){e[e.Union=0]=`Union`,e[e.True=1]=`True`,e[e.False=2]=`False`})(J||={});function lA(e){return e===J.False?e:J.True}function uA(e){throw new cA(e)}function dA(e){return TE(e)||hE(e)||VE(e)||UE(e)||rE(e)}function fA(e,t){return TE(t)?AA(e,t):hE(t)?EA(e,t):VE(t)?pj(e,t):UE(t)?hj(e,t):rE(t)?pA(e,t):uA(`StructuralRight`)}function pA(e,t){return J.True}function mA(e,t){return hE(t)?EA(e,t):VE(t)&&t.anyOf.some(e=>rE(e)||UE(e))?J.True:VE(t)?J.Union:UE(t)||rE(t)?J.True:J.Union}function hA(e,t){return UE(e)?J.False:rE(e)?J.Union:TE(e)?J.True:J.False}function gA(e,t){return kE(t)&&qA(t)?J.True:dA(t)?fA(e,t):aE(t)?lA(yj(e.items,t.items)):J.False}function _A(e,t){return dA(t)?fA(e,t):oE(t)?lA(yj(e.items,t.items)):J.False}function vA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):sE(t)?J.True:J.False}function yA(e,t){return bE(e)||cE(e)?J.True:J.False}function bA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):cE(t)?J.True:J.False}function xA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):uE(t)?e.parameters.length>t.parameters.length?J.False:e.parameters.every((e,n)=>lA(yj(t.parameters[n],e))===J.True)?lA(yj(e.returns,t.returns)):J.False:J.False}function SA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):dE(t)?J.True:J.False}function CA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):fE(t)?e.parameters.length>t.parameters.length?J.False:e.parameters.every((e,n)=>lA(yj(t.parameters[n],e))===J.True)?lA(yj(e.returns,t.returns)):J.False:J.False}function wA(e,t){return xE(e)&&Tw(e.const)||OE(e)||pE(e)?J.True:J.False}function TA(e,t){return pE(t)||OE(t)?J.True:dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):J.False}function EA(e,t){return t.allOf.every(t=>yj(e,t)===J.True)?J.True:J.False}function DA(e,t){return e.allOf.some(e=>yj(e,t)===J.True)?J.True:J.False}function OA(e,t){return dA(t)?fA(e,t):gE(t)?lA(yj(e.items,t.items)):J.False}function kA(e,t){return xE(t)&&t.const===e.const?J.True:dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):PE(t)?ij(e,t):OE(t)?FA(e,t):pE(t)?wA(e,t):cE(t)?yA(e,t):J.False}function AA(e,t){return J.False}function jA(e,t){return J.True}function MA(e){let[t,n]=[e,0];for(;EE(t);)t=t.not,n+=1;return n%2==0?t:eA()}function NA(e,t){return EE(e)?yj(MA(e),t):EE(t)?yj(e,MA(t)):uA(`Invalid fallthrough for Not`)}function PA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):DE(t)?J.True:J.False}function FA(e,t){return yE(e)||OE(e)||pE(e)?J.True:J.False}function IA(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):pE(t)||OE(t)?J.True:J.False}function LA(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function RA(e){return qA(e)}function zA(e){return LA(e,0)||LA(e,1)&&`description`in e.properties&&VE(e.properties.description)&&e.properties.description.anyOf.length===2&&(PE(e.properties.description.anyOf[0])&&BE(e.properties.description.anyOf[1])||PE(e.properties.description.anyOf[1])&&BE(e.properties.description.anyOf[0]))}function BA(e){return LA(e,0)}function VA(e){return LA(e,0)}function HA(e){return LA(e,0)}function UA(e){return LA(e,0)}function WA(e){return qA(e)}function GA(e){let t=tO();return LA(e,0)||LA(e,1)&&`length`in e.properties&&lA(yj(e.properties.length,t))===J.True}function KA(e){return LA(e,0)}function qA(e){let t=tO();return LA(e,0)||LA(e,1)&&`length`in e.properties&&lA(yj(e.properties.length,t))===J.True}function JA(e){let t=_D([sD()],sD());return LA(e,0)||LA(e,1)&&`then`in e.properties&&lA(yj(e.properties.then,t))===J.True}function YA(e,t){return yj(e,t)===J.False||nE(e)&&!nE(t)?J.False:J.True}function XA(e,t){return UE(e)?J.False:rE(e)?J.Union:TE(e)||vE(e)&&RA(t)||yE(e)&&BA(t)||bE(e)&&VA(t)||FE(e)&&zA(t)||sE(e)&&HA(t)||PE(e)&&RA(t)||FE(e)&&zA(t)||OE(e)&&BA(t)||pE(e)&&BA(t)||cE(e)&&VA(t)||HE(e)&&WA(t)||dE(e)&&UA(t)||uE(e)&&KA(t)||fE(e)&&GA(t)?J.True:jE(e)&&PE($A(e))?t[tT]===`Record`?J.True:J.False:jE(e)&&OE($A(e))&&LA(t,0)?J.True:J.False}function ZA(e,t){return dA(t)?fA(e,t):jE(t)?tj(e,t):kE(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!nE(t.properties[n]))return J.False;if(nE(t.properties[n]))return J.True;if(YA(e.properties[n],t.properties[n])===J.False)return J.False}return J.True})():J.False}function QA(e,t){return dA(t)?fA(e,t):kE(t)&&JA(t)?J.True:AE(t)?lA(yj(e.item,t.item)):J.False}function $A(e){return QE in e.patternProperties?tO():$E in e.patternProperties?nO():uA(`Unknown record key pattern`)}function ej(e){return QE in e.patternProperties?e.patternProperties[QE]:$E in e.patternProperties?e.patternProperties[$E]:uA(`Unable to get record value schema`)}function tj(e,t){let[n,r]=[$A(t),ej(t)];return vE(e)&&OE(n)&&lA(yj(e,r))===J.True?J.True:HE(e)&&OE(n)||PE(e)&&OE(n)||aE(e)&&OE(n)?yj(e,r):kE(e)?(()=>{for(let t of Object.getOwnPropertyNames(e.properties))if(YA(r,e.properties[t])===J.False)return J.False;return J.True})():J.False}function nj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?yj(ej(e),ej(t)):J.False}function rj(e,t){return yj(NE(e)?nO():e,NE(t)?nO():t)}function ij(e,t){return xE(e)&&Ow(e.const)||PE(e)?J.True:J.False}function aj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):PE(t)?J.True:J.False}function oj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):FE(t)?J.True:J.False}function sj(e,t){return IE(e)?yj(dO(e),t):IE(t)?yj(e,dO(t)):uA(`Invalid fallthrough for TemplateLiteral`)}function cj(e,t){return aE(t)&&e.items!==void 0&&e.items.every(e=>yj(e,t.items)===J.True)}function lj(e,t){return TE(e)?J.True:UE(e)?J.False:rE(e)?J.Union:J.False}function uj(e,t){return dA(t)?fA(e,t):kE(t)&&qA(t)||aE(t)&&cj(e,t)?J.True:zE(t)?jw(e.items)&&!jw(t.items)||!jw(e.items)&&jw(t.items)?J.False:jw(e.items)&&!jw(t.items)||e.items.every((e,n)=>yj(e,t.items[n])===J.True)?J.True:J.False:J.False}function dj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):HE(t)?J.True:J.False}function fj(e,t){return dA(t)?fA(e,t):kE(t)?XA(e,t):jE(t)?tj(e,t):GE(t)?_j(e,t):BE(t)?J.True:J.False}function pj(e,t){return t.anyOf.some(t=>yj(e,t)===J.True)?J.True:J.False}function mj(e,t){return e.anyOf.every(e=>yj(e,t)===J.True)?J.True:J.False}function hj(e,t){return J.True}function gj(e,t){return TE(t)?AA(e,t):hE(t)?EA(e,t):VE(t)?pj(e,t):rE(t)?pA(e,t):PE(t)?ij(e,t):OE(t)?FA(e,t):pE(t)?wA(e,t):cE(t)?yA(e,t):aE(t)?hA(e,t):zE(t)?lj(e,t):kE(t)?XA(e,t):UE(t)?J.True:J.False}function _j(e,t){return BE(e)||BE(e)?J.True:J.False}function vj(e,t){return hE(t)?EA(e,t):VE(t)?pj(e,t):UE(t)?hj(e,t):rE(t)?pA(e,t):kE(t)?XA(e,t):GE(t)?J.True:J.False}function yj(e,t){return IE(e)||IE(t)?sj(e,t):NE(e)||NE(t)?rj(e,t):EE(e)||EE(t)?NA(e,t):rE(e)?mA(e,t):aE(e)?gA(e,t):sE(e)?vA(e,t):cE(e)?bA(e,t):oE(e)?_A(e,t):uE(e)?xA(e,t):dE(e)?SA(e,t):fE(e)?CA(e,t):pE(e)?TA(e,t):hE(e)?DA(e,t):gE(e)?OA(e,t):xE(e)?kA(e,t):TE(e)?jA(e,t):DE(e)?PA(e,t):OE(e)?IA(e,t):kE(e)?ZA(e,t):jE(e)?nj(e,t):PE(e)?aj(e,t):FE(e)?oj(e,t):zE(e)?uj(e,t):AE(e)?QA(e,t):HE(e)?dj(e,t):BE(e)?fj(e,t):VE(e)?mj(e,t):UE(e)?gj(e,t):GE(e)?vj(e,t):uA(`Unknown left type operand '${e[q]}'`)}function bj(e,t){return yj(e,t)}function xj(e,t,n,r,i){let a={};for(let o of globalThis.Object.getOwnPropertyNames(e))a[o]=Tj(e[o],t,n,r,Rw(i));return a}function Sj(e,t,n,r,i){return xj(e.properties,t,n,r,i)}function Cj(e,t,n,r,i){return hD(Sj(e,t,n,r,i))}function wj(e,t,n,r){let i=bj(e,t);return i===J.Union?wD([n,r]):i===J.True?n:r}function Tj(e,t,n,r,i){return xT(e)?Cj(e,t,n,r,i):bT(e)?K(kj(e,t,n,r,i)):K(wj(e,t,n,r),i)}function Ej(e,t,n,r,i){return{[e]:Tj(QD(e),t,n,r,Rw(i))}}function Dj(e,t,n,r,i){return e.reduce((e,a)=>({...e,...Ej(a,t,n,r,i)}),{})}function Oj(e,t,n,r,i){return Dj(e.keys,t,n,r,i)}function kj(e,t,n,r,i){return hD(Oj(e,t,n,r,i))}function Aj(e,t){return Mj(dO(e),t)}function jj(e,t){let n=e.filter(e=>bj(e,t)===J.False);return n.length===1?n[0]:wD(n)}function Mj(e,t,n={}){return NT(e)?K(Aj(e,t),n):xT(e)?K(Fj(e,t),n):K(RT(e)?jj(e.anyOf,t):bj(e,t)===J.False?e:mD(),n)}function Nj(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Mj(e[r],t);return n}function Pj(e,t){return Nj(e.properties,t)}function Fj(e,t){return hD(Pj(e,t))}function Ij(e,t){return Rj(dO(e),t)}function Lj(e,t){let n=e.filter(e=>bj(e,t)!==J.False);return n.length===1?n[0]:wD(n)}function Rj(e,t,n){return NT(e)?K(Ij(e,t),n):xT(e)?K(Vj(e,t),n):K(RT(e)?Lj(e.anyOf,t):bj(e,t)===J.False?mD():e,n)}function zj(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Rj(e[r],t);return n}function Bj(e,t){return zj(e.properties,t)}function Vj(e,t){return hD(Bj(e,t))}function Hj(e,t){return dT(e)?K(e.returns,t):mD(t)}function Uj(e){return WO(ck(e))}function Wj(e,t,n){return K({[q]:`Record`,type:`object`,patternProperties:{[e]:t}},n)}function Gj(e,t,n){let r={};for(let n of e)r[n]=t;return zO(r,{...n,[tT]:`Record`})}function Kj(e,t,n){return WD(e)?Gj(gO(e),t,n):Wj(e.pattern,t,n)}function qj(e,t,n){return Gj(gO(wD(e)),t,n)}function Jj(e,t,n){return Gj([e.toString()],t,n)}function Yj(e,t,n){return Wj(e.source,t,n)}function Xj(e,t,n){return Wj(jw(e.pattern)?$E:e.pattern,t,n)}function Zj(e,t,n){return Wj($E,t,n)}function Qj(e,t,n){return Wj(eD,t,n)}function $j(e,t,n){return zO({true:t,false:t},n)}function eM(e,t,n){return Wj(QE,t,n)}function tM(e,t,n){return Wj(QE,t,n)}function nM(e,t,n={}){return RT(e)?qj(e.anyOf,t,n):NT(e)?Kj(e,t,n):yT(e)?Jj(e.const,t,n):lT(e)?$j(e,t,n):mT(e)?eM(e,t,n):TT(e)?tM(e,t,n):AT(e)?Yj(e,t,n):jT(e)?Xj(e,t,n):iT(e)?Zj(e,t,n):ST(e)?Qj(e,t,n):mD(n)}function rM(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function iM(e){let t=rM(e);return t===$E?nO():t===QE?tO():nO({pattern:t})}function aM(e){return e.patternProperties[rM(e)]}function oM(e,t){return t.parameters=bM(e,t.parameters),t.returns=xM(e,t.returns),t}function sM(e,t){return t.parameters=bM(e,t.parameters),t.returns=xM(e,t.returns),t}function cM(e,t){return t.allOf=bM(e,t.allOf),t}function lM(e,t){return t.anyOf=bM(e,t.anyOf),t}function uM(e,t){return jw(t.items)||(t.items=bM(e,t.items)),t}function dM(e,t){return t.items=xM(e,t.items),t}function fM(e,t){return t.items=xM(e,t.items),t}function pM(e,t){return t.items=xM(e,t.items),t}function mM(e,t){return t.item=xM(e,t.item),t}function hM(e,t){let n=yM(e,t.properties);return{...t,...zO(n)}}function gM(e,t){let n=nM(xM(e,iM(t)),xM(e,aM(t)));return{...t,...n}}function _M(e,t){return t.index in e?e[t.index]:eA()}function vM(e,t){let n=nT(t),r=rT(t),i=xM(e,t);return n&&r?Uj(i):n&&!r?WO(i):!n&&r?ck(i):i}function yM(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:vM(e,t[r])}),{})}function bM(e,t){return t.map(t=>xM(e,t))}function xM(e,t){return dT(t)?oM(e,t):pT(t)?sM(e,t):hT(t)?cM(e,t):RT(t)?lM(e,t):IT(t)?uM(e,t):oT(t)?dM(e,t):sT(t)?fM(e,t):gT(t)?pM(e,t):DT(t)?mM(e,t):ET(t)?hM(e,t):OT(t)?gM(e,t):aT(t)?_M(e,t):t}function SM(e,t){return xM(t,zw(e))}function CM(e){return K({[q]:`Integer`,type:`integer`},e)}function wM(e,t,n){return{[e]:FM(QD(e),t,Rw(n))}}function TM(e,t,n){return e.reduce((e,r)=>({...e,...wM(r,t,n)}),{})}function EM(e,t,n){return TM(e.keys,t,n)}function DM(e,t,n){return hD(EM(e,t,n))}function OM(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join(``)}function kM(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join(``)}function AM(e){return e.toUpperCase()}function jM(e){return e.toLowerCase()}function MM(e,t,n){let r=RD(e.pattern);return UD(r)?fO([wD(PM([...XD(r)].map(e=>QD(e)),t))],n):{...e,pattern:NM(e.pattern,t)}}function NM(e,t){return typeof e==`string`?t===`Uncapitalize`?OM(e):t===`Capitalize`?kM(e):t===`Uppercase`?AM(e):t===`Lowercase`?jM(e):e:e.toString()}function PM(e,t){return e.map(e=>FM(e,t))}function FM(e,t,n={}){return bT(e)?DM(e,t,n):NT(e)?MM(e,t,n):RT(e)?wD(PM(e.anyOf,t),n):yT(e)?QD(NM(e.const,t),n):K(e,n)}function IM(e,t={}){return FM(e,`Capitalize`,t)}function LM(e,t={}){return FM(e,`Lowercase`,t)}function RM(e,t={}){return FM(e,`Uncapitalize`,t)}function zM(e,t={}){return FM(e,`Uppercase`,t)}function BM(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=XM(e[i],t,Rw(n));return r}function VM(e,t,n){return BM(e.properties,t,n)}function HM(e,t,n){return hD(VM(e,t,n))}function UM(e,t){return e.map(e=>YM(e,t))}function WM(e,t){return e.map(e=>YM(e,t))}function GM(e,t){let{[t]:n,...r}=e;return r}function KM(e,t){return t.reduce((e,t)=>GM(e,t),e)}function qM(e,t,n){let r=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(KM(n,t),r)}function JM(e){return wD(e.reduce((e,t)=>vT(t)?[...e,QD(t)]:e,[]))}function YM(e,t){return hT(e)?vk(UM(e.allOf,t)):RT(e)?wD(WM(e.anyOf,t)):ET(e)?qM(e,t,e.properties):zO({})}function XM(e,t,n){let r=vw(t)?JM(t):t,i=WT(t)?gO(t):t,a=kT(e),o=kT(t);return xT(e)?HM(e,i,n):bT(t)?eN(e,t,n):a&&o||!a&&o||a&&!o?dD(`Omit`,[e,r],n):K({...YM(e,i),...n})}function ZM(e,t,n){return{[t]:XM(e,[t],Rw(n))}}function QM(e,t,n){return t.reduce((t,r)=>({...t,...ZM(e,r,n)}),{})}function $M(e,t,n){return QM(e,t.keys,n)}function eN(e,t,n){return hD($M(e,t,n))}function tN(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=uN(e[i],t,Rw(n));return r}function nN(e,t,n){return tN(e.properties,t,n)}function rN(e,t,n){return hD(nN(e,t,n))}function iN(e,t){return e.map(e=>lN(e,t))}function aN(e,t){return e.map(e=>lN(e,t))}function oN(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function sN(e,t,n){let r=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(oN(n,t),r)}function cN(e){return wD(e.reduce((e,t)=>vT(t)?[...e,QD(t)]:e,[]))}function lN(e,t){return hT(e)?vk(iN(e.allOf,t)):RT(e)?wD(aN(e.anyOf,t)):ET(e)?sN(e,t,e.properties):zO({})}function uN(e,t,n){let r=vw(t)?cN(t):t,i=WT(t)?gO(t):t,a=kT(e),o=kT(t);return xT(e)?rN(e,i,n):bT(t)?mN(e,t,n):a&&o||!a&&o||a&&!o?dD(`Pick`,[e,r],n):K({...lN(e,i),...n})}function dN(e,t,n){return{[t]:uN(e,[t],Rw(n))}}function fN(e,t,n){return t.reduce((t,r)=>({...t,...dN(e,r,n)}),{})}function pN(e,t,n){return fN(e,t.keys,n)}function mN(e,t,n){return hD(pN(e,t,n))}function hN(e,t){return dD(`Partial`,[dD(e,t)])}function gN(e){return dD(`Partial`,[yk(e)])}function _N(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=ck(e[n]);return t}function vN(e,t){let n=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(_N(t),n)}function yN(e){return e.map(e=>bN(e))}function bN(e){return uT(e)?hN(e.target,e.parameters):kT(e)?gN(e.$ref):hT(e)?vk(yN(e.allOf)):RT(e)?wD(yN(e.anyOf)):ET(e)?vN(e,e.properties):cT(e)||lT(e)||mT(e)||yT(e)||wT(e)||TT(e)||jT(e)||MT(e)||LT(e)?e:zO({})}function xN(e,t){return xT(e)?wN(e,t):K({...bN(e),...t})}function SN(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=xN(e[r],Rw(t));return n}function CN(e,t){return SN(e.properties,t)}function wN(e,t){return hD(CN(e,t))}function TN(e,t){return dD(`Required`,[dD(e,t)])}function EN(e){return dD(`Required`,[yk(e)])}function DN(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=pD(e[n],[eT]);return t}function ON(e,t){let n=pD(e,[Qw,`$id`,`required`,`properties`]);return zO(DN(t),n)}function kN(e){return e.map(e=>AN(e))}function AN(e){return uT(e)?TN(e.target,e.parameters):kT(e)?EN(e.$ref):hT(e)?vk(kN(e.allOf)):RT(e)?wD(kN(e.anyOf)):ET(e)?ON(e,e.properties):cT(e)||lT(e)||mT(e)||yT(e)||wT(e)||TT(e)||jT(e)||MT(e)||LT(e)?e:zO({})}function jN(e,t){return xT(e)?PN(e,t):K({...AN(e),...t})}function MN(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=jN(e[r],t);return n}function NN(e,t){return MN(e.properties,t)}function PN(e,t){return hD(NN(e,t))}function FN(e,t){return t.map(t=>kT(t)?IN(e,t.$ref):rP(e,t))}function IN(e,t){return t in e?kT(e[t])?IN(e,e[t].$ref):rP(e,e[t]):mD()}function LN(e){return Ek(e[0])}function RN(e){return jO(e[0],e[1])}function zN(e){return Bk(e[0])}function BN(e){return xN(e[0])}function VN(e){return XM(e[0],e[1])}function HN(e){return uN(e[0],e[1])}function UN(e){return jN(e[0])}function WN(e,t,n){let r=FN(e,n);return t===`Awaited`?LN(r):t===`Index`?RN(r):t===`KeyOf`?zN(r):t===`Partial`?BN(r):t===`Omit`?VN(r):t===`Pick`?HN(r):t===`Required`?UN(r):mD()}function GN(e,t){return cD(rP(e,t))}function KN(e,t){return uD(rP(e,t))}function qN(e,t,n){return gD(nP(e,t),rP(e,n))}function JN(e,t,n){return _D(nP(e,t),rP(e,n))}function YN(e,t){return vk(nP(e,t))}function XN(e,t){return IO(rP(e,t))}function ZN(e,t){return zO(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:rP(e,t[r])}),{}))}function QN(e,t){let[n,r]=[rP(e,aM(t)),rM(t)],i=zw(t);return i.patternProperties[r]=n,i}function $N(e,t){return kT(t)?{...IN(e,t.$ref),[Qw]:t[Qw]}:t}function eP(e,t){return JO(nP(e,t))}function tP(e,t){return wD(nP(e,t))}function nP(e,t){return t.map(t=>rP(e,t))}function rP(e,t){return rT(t)?K(rP(e,pD(t,[eT])),t):nT(t)?K(rP(e,pD(t,[$w])),t):FT(t)?K($N(e,t),t):oT(t)?K(GN(e,t.items),t):sT(t)?K(KN(e,t.items),t):uT(t)?K(WN(e,t.target,t.parameters)):dT(t)?K(qN(e,t.parameters,t.returns),t):pT(t)?K(JN(e,t.parameters,t.returns),t):hT(t)?K(YN(e,t.allOf),t):gT(t)?K(XN(e,t.items),t):ET(t)?K(ZN(e,t.properties),t):OT(t)?K(QN(e,t)):IT(t)?K(eP(e,t.items||[]),t):RT(t)?K(tP(e,t.anyOf),t):t}function iP(e,t){return t in e?rP(e,e[t]):mD()}function aP(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:iP(e,n)}),{})}var oP=class{constructor(e){let t=aP(e),n=this.WithIdentifiers(t);this.$defs=n}Import(e,t){let n={...this.$defs,[e]:K(this.$defs[e],t)};return K({[q]:`Import`,$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}};function sP(e){return new oP(e)}function cP(e,t){return K({[q]:`Not`,not:e},t)}function lP(e,t){return pT(e)?JO(e.parameters,t):mD()}var uP=0;function dP(e,t={}){jw(t.$id)&&(t.$id=`T${uP++}`);let n=zw(e({[q]:`This`,$ref:`${t.$id}`}));return n.$id=t.$id,K({[tT]:`Recursive`,...n},t)}function fP(e,t){let n=Ow(e)?new globalThis.RegExp(e):e;return K({[q]:`RegExp`,type:`RegExp`,source:n.source,flags:n.flags},t)}function pP(e){return hT(e)?e.allOf:RT(e)?e.anyOf:IT(e)?e.items??[]:[]}function mP(e){return pP(e)}function hP(e,t){return pT(e)?K(e.returns,t):mD(t)}var gP=class{constructor(e){this.schema=e}Decode(e){return new _P(this.schema,e)}},_P=class{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){let n={Encode:n=>t[Qw].Encode(e(n)),Decode:e=>this.decode(t[Qw].Decode(e))};return{...t,[Qw]:n}}EncodeSchema(e,t){let n={Decode:this.decode,Encode:e};return{...t,[Qw]:n}}Encode(e){return FT(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function vP(e){return new gP(e)}function yP(e={}){return K({[q]:e[q]??`Unsafe`},e)}function bP(e){return K({[q]:`Void`,type:`void`},e)}var Y=s({Any:()=>sD,Argument:()=>lD,Array:()=>cD,AsyncIterator:()=>uD,Awaited:()=>Ek,BigInt:()=>eO,Boolean:()=>$D,Capitalize:()=>IM,Composite:()=>Jk,Const:()=>aA,Constructor:()=>gD,ConstructorParameters:()=>oA,Date:()=>Yk,Enum:()=>sA,Exclude:()=>Mj,Extends:()=>Tj,Extract:()=>Rj,Function:()=>_D,Index:()=>jO,InstanceType:()=>Hj,Instantiate:()=>SM,Integer:()=>CM,Intersect:()=>vk,Iterator:()=>IO,KeyOf:()=>Bk,Literal:()=>QD,Lowercase:()=>LM,Mapped:()=>ik,Module:()=>sP,Never:()=>mD,Not:()=>cP,Null:()=>Xk,Number:()=>tO,Object:()=>zO,Omit:()=>XM,Optional:()=>ck,Parameters:()=>lP,Partial:()=>xN,Pick:()=>uN,Promise:()=>BO,Readonly:()=>WO,ReadonlyOptional:()=>Uj,Record:()=>nM,Recursive:()=>dP,Ref:()=>yk,RegExp:()=>fP,Required:()=>jN,Rest:()=>mP,ReturnType:()=>hP,String:()=>nO,Symbol:()=>Zk,TemplateLiteral:()=>fO,Transform:()=>vP,Tuple:()=>JO,Uint8Array:()=>$k,Uncapitalize:()=>RM,Undefined:()=>Qk,Union:()=>wD,Unknown:()=>eA,Unsafe:()=>yP,Uppercase:()=>zM,Void:()=>bP});function xP(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function SP(e,t){return Y.String({pattern:`^${xP(e)}${Ft}$`,...t===void 0?{}:{description:t}})}var X=Y.String({minLength:1,description:`ISO 8601 date-time string`}),CP=Y.String({minLength:1});SP(Lt.project,`ProjectId`);var wP=SP(Lt.message,`MessageId`),TP=SP(Lt.taskModule,`TaskModuleId`),EP=SP(Lt.task,`TaskId`),DP=SP(Lt.runResult,`RunResultId`),OP=SP(Lt.recoverySummary,`RecoverySummaryId`),kP=SP(Lt.activity,`ActivityRef`),AP=SP(Lt.event,`EventRef`),jP=SP(Lt.workflowInvocation,`WorkflowInvocationRef`),MP=SP(Lt.clarificationThread,`ClarificationThreadRef`),NP=SP(Lt.clarificationRound,`ClarificationRoundRef`);SP(Lt.clarificationInteractionResponse,`ClarificationInteractionResponseId`);var PP=SP(Lt.approvalRequest,`ApprovalRequestId`),FP=SP(Lt.idempotency,`IdempotencyKey`),IP=SP(Lt.relayProject,`RelayProjectRef`);SP(Lt.relayAccount,`RelayAccountRef`),SP(Lt.relayMembership,`RelayMembershipRef`),SP(Lt.relayAccountSession,`RelayAccountSessionRef`),SP(Lt.relayClientSession,`RelayClientSessionId`);var LP=SP(Lt.relayUpload,`RelayUploadRef`);SP(Lt.relayAuthChallenge,`RelayAuthChallengeRef`),SP(Lt.hostConnection,`HostConnectionRef`),SP(Lt.joinToken,`JoinTokenRef`);var RP=Y.Union([Y.Literal(`project_context_bootstrap`),Y.Literal(`scratchpad_refresh`),Y.Literal(`task_compile`),Y.Literal(`context_sync`),Y.Literal(`reference_summary_refresh`),Y.Literal(`recovery_check`),Y.Literal(`follow_up_check`)]);Y.Object({cursor:Y.Optional(CP),limit:Y.Optional(Y.Integer({minimum:1,maximum:200,default:50}))},{additionalProperties:!1});function zP(e){return Y.Object({items:Y.Array(e),page:Y.Object({next_cursor:Y.Optional(CP),has_more:Y.Boolean(),limit:Y.Integer({minimum:1,maximum:200})},{additionalProperties:!1})},{additionalProperties:!1})}function BP(e){return Y.Object({items:Y.Array(e),window:Y.Object({older_cursor:Y.Optional(CP),newer_cursor:Y.Optional(CP),has_older:Y.Boolean(),has_newer:Y.Boolean(),limit:Y.Integer({minimum:1,maximum:200})},{additionalProperties:!1})},{additionalProperties:!1})}var VP=Y.Union([Y.Object({kind:Y.Literal(`all`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`workspace`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`session`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`bootstrap`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`messages`),scope:Y.Literal(`main_chat`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`messages`),scope:Y.Literal(`clarification_round`),round_id:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`scratchpad`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`worklist`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`read_state`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task_detail`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task_run_results`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`clarification`),thread_id:Y.Optional(MP),round_id:Y.Optional(NP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`execution_status`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`activity`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_config`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_usage`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`project_timeline`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`skills`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`artifacts`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`approval`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`viewer`),path:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`recovery_summaries`)},{additionalProperties:!1})]);Y.Object({kind:Y.String({minLength:1})});var HP=Y.Object({kind:Y.Literal(`interrupted`),retry_with_new_command_id:Y.Literal(!0)},{additionalProperties:!1});function UP(e){return Y.Object({command_id:FP,issued_at:X,payload:e},{additionalProperties:!1})}function WP(e){return Y.Object({command_id:FP,disposition:e,invalidates:Y.Optional(Y.Array(VP))},{additionalProperties:!1})}function GP(e,t){return Y.Object({command_id:FP,disposition:e,result:Y.Optional(t),invalidates:Y.Optional(Y.Array(VP))},{additionalProperties:!1})}var KP=Y.Union([Y.Literal(`bad_request`),Y.Literal(`unauthorized`),Y.Literal(`forbidden`),Y.Literal(`not_found`),Y.Literal(`conflict`),Y.Literal(`validation_failed`),Y.Literal(`provider_not_configured`),Y.Literal(`provider_auth_invalid`),Y.Literal(`provider_quota_or_billing_required`),Y.Literal(`provider_rate_limited`),Y.Literal(`provider_model_unavailable`),Y.Literal(`provider_network_error`),Y.Literal(`relay_session_invalid`),Y.Literal(`command_replay_mismatch`),Y.Literal(`repo_snapshot_unavailable`),Y.Literal(`host_unavailable`),Y.Literal(`internal_error`)]);Y.Object({error:Y.Object({code:KP,message:Y.String({minLength:1}),retryable:Y.Boolean(),details:Y.Optional(Y.Unknown())},{additionalProperties:!1})},{additionalProperties:!1}),Y.Union([Y.Literal(`connection.ready`),Y.Literal(`message.created`),Y.Literal(`scratchpad.updated`),Y.Literal(`worklist.changed`),Y.Literal(`task.updated`),Y.Literal(`task_detail.updated`),Y.Literal(`clarification.changed`),Y.Literal(`approval.changed`),Y.Literal(`activity.event`),Y.Literal(`execution_status.changed`),Y.Literal(`provider_config.changed`),Y.Literal(`workspace.recovered`),Y.Literal(`query.invalidate`)]),Y.Union([Y.Object({kind:Y.Literal(`all`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`me`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`recent_projects`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`join_entries`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`project_presence`),relay_project_ref:IP},{additionalProperties:!1})]),Y.Union([Y.Literal(`connection.ready`),Y.Literal(`query.invalidate`)]);var qP=Y.Object({retention_seconds:Y.Literal(300),max_events:Y.Literal(1e3)},{additionalProperties:!1}),Z=Y.String({minLength:1}),JP=Y.Union([Y.Literal(`provider_auth_invalid`),Y.Literal(`provider_quota_or_billing_required`),Y.Literal(`provider_rate_limited`),Y.Literal(`provider_model_unavailable`),Y.Literal(`provider_network_error`),Y.Literal(`unknown`)]),YP=JP,XP=Y.Union([Y.Object({status:Y.Literal(`not_configured`)},{additionalProperties:!1}),Y.Object({status:Y.Literal(`configured`),provider:Y.Literal(`openai`),auth_kind:Y.Literal(`api_key`),redacted_key:Z,default_model:Z,validated_at:X},{additionalProperties:!1}),Y.Object({status:Y.Literal(`invalid`),provider:Y.Optional(Y.Literal(`openai`)),auth_kind:Y.Optional(Y.Literal(`api_key`)),redacted_key:Y.Optional(Z),default_model:Y.Optional(Z),validated_at:Y.Optional(X),invalid_reason_code:Y.Optional(JP)},{additionalProperties:!1})]),ZP=Y.Union([Y.Literal(`implementation`),Y.Literal(`planning`),Y.Literal(`context`),Y.Literal(`qna`),Y.Literal(`other`)]),QP=Y.Object({input_tokens:Y.Integer({minimum:0}),cached_input_tokens:Y.Integer({minimum:0}),output_tokens:Y.Integer({minimum:0}),reasoning_output_tokens:Y.Integer({minimum:0}),total_tokens:Y.Integer({minimum:0}),event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),$P=Y.Object({source:Y.String({minLength:1}),label:Y.String({minLength:1}),category:ZP,input_tokens:Y.Integer({minimum:0}),cached_input_tokens:Y.Integer({minimum:0}),output_tokens:Y.Integer({minimum:0}),reasoning_output_tokens:Y.Integer({minimum:0}),total_tokens:Y.Integer({minimum:0}),event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),eF=Y.Object({model:Y.String({minLength:1}),input_tokens:Y.Integer({minimum:0}),cached_input_tokens:Y.Integer({minimum:0}),output_tokens:Y.Integer({minimum:0}),reasoning_output_tokens:Y.Integer({minimum:0}),total_tokens:Y.Integer({minimum:0}),event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),tF=Y.Object({total_tokens:Y.Integer({minimum:0}),totals:QP,by_source:Y.Array($P),by_model:Y.Array(eF),recent_windows:Y.Object({today:QP,last_7_days:QP,last_30_days:QP},{additionalProperties:!1})},{additionalProperties:!1}),nF=Y.Union([Y.Literal(`task_accepted`),Y.Literal(`task_update`),Y.Literal(`checkpoint`)]),rF=Y.Union([Y.Literal(`completed`),Y.Literal(`failed`),Y.Literal(`needs_human`)]),iF=Y.Union([Y.Literal(`needs_input`),Y.Literal(`completed`),Y.Literal(`failed`)]),aF=Y.Union([Y.Literal(`neutral`),Y.Literal(`success`),Y.Literal(`warning`),Y.Literal(`error`)]),oF=Y.Object({kind:Y.Union([Y.Literal(`worklist_task`),Y.Literal(`chat_message`),Y.Literal(`reference_file`),Y.Literal(`repo_path`)]),label:Y.String({minLength:1}),task_id:Y.Optional(EP),message_id:Y.Optional(wP),path:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1}),sF=Y.Object({message_id:wP,author:Y.String({minLength:1}),body:Y.String(),created_at:X},{additionalProperties:!1}),cF=Y.Object({title:Y.Optional(Y.String({minLength:1})),summary:Y.String({minLength:1}),source:Y.Optional(Y.Union([Y.Literal(`scratchpad`),Y.Literal(`clarification`),Y.Literal(`contract`)]))},{additionalProperties:!1}),lF=Y.Object({title:Y.Optional(Y.String({minLength:1})),summary:Y.Optional(Y.String()),request:Y.Optional(Y.String()),status:Y.Optional(Y.Union([Y.Literal(`active`),Y.Literal(`resolved`)])),answer_count:Y.Optional(Y.Integer({minimum:0})),answers:Y.Optional(Y.Array(sF))},{additionalProperties:!1}),uF=Y.Union([Y.Literal(`added`),Y.Literal(`modified`),Y.Literal(`deleted`),Y.Literal(`renamed`),Y.Literal(`unknown`)]),dF=Y.Object({tone:aF,summary:Y.Optional(Y.String()),origin:Y.Optional(Y.Object({title:Y.Optional(Y.String({minLength:1})),summary:Y.Optional(Y.String()),snippets:Y.Optional(Y.Array(sF)),source_count:Y.Optional(Y.Integer({minimum:0})),unavailable_reason:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),decisions:Y.Optional(Y.Array(cF)),clarification:Y.Optional(lF),contract:Y.Optional(Y.Object({goal:Y.String(),scope:Y.Array(Y.String()),truncated:Y.Optional(Y.Boolean())},{additionalProperties:!1})),result:Y.Optional(Y.Object({summary:Y.String(),error_code:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),changes:Y.Optional(Y.Object({items:Y.Array(Y.Object({status:uF,path:Y.String({minLength:1}),previous_path:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),total_count:Y.Integer({minimum:0}),truncated:Y.Boolean()},{additionalProperties:!1})),verification:Y.Optional(Y.Object({checks:Y.Union([Y.Literal(`passed`),Y.Literal(`failed`),Y.Literal(`skipped`)]),skip_reason_code:Y.Optional(Y.String({minLength:1})),skip_reason_summary:Y.Optional(Y.String())},{additionalProperties:!1})),promotion:Y.Optional(Y.Object({status:Y.Union([Y.Literal(`promoted`),Y.Literal(`not_promoted`),Y.Literal(`not_attempted`)]),commit_oid:Y.Optional(Y.String({minLength:1})),commit_short_oid:Y.Optional(Y.String({minLength:1})),summary:Y.Optional(Y.String()),reason_code:Y.Optional(Y.String({minLength:1}))},{additionalProperties:!1})),checkpoint:Y.Optional(Y.Object({counters:Y.Object({completed:Y.Integer({minimum:0}),failed:Y.Integer({minimum:0}),remaining:Y.Integer({minimum:0})},{additionalProperties:!1}),items:Y.Array(Y.Object({task_id:EP,title:Y.String({minLength:1}),status:Y.Union([Y.Literal(`done`),Y.Literal(`failed`)]),summary:Y.String()},{additionalProperties:!1})),generated_files:Y.Optional(Y.Array(Y.Object({path:Y.String({minLength:1}),name:Y.String({minLength:1})},{additionalProperties:!1}))),truncated:Y.Optional(Y.Boolean())},{additionalProperties:!1})),links:Y.Array(oF)},{additionalProperties:!1}),fF=Y.Object({id:Y.String({minLength:1}),kind:nF,occurred_at:X,title:Y.String({minLength:1}),summary:Y.Optional(Y.String()),task_id:Y.Optional(EP),task_title:Y.Optional(Y.String({minLength:1})),activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),run_result_id:Y.Optional(DP),message_id:Y.Optional(wP),status:Y.Optional(rF),update_state:Y.Optional(iF),token_usage:Y.Optional(QP),usage_sources:Y.Optional(Y.Array($P)),usage_models:Y.Optional(Y.Array(eF)),trace_card:Y.Optional(dF)},{additionalProperties:!1});Y.Object({generated_at:X,usage_overview:tF,items:Y.Array(fF)},{additionalProperties:!1});var pF=10*1024*1024,mF=50*1024*1024,hF=mF,gF=Y.Union([Y.Literal(`reference_file`),Y.Literal(`skill_zip`)]),_F=Y.String({pattern:`^sha256:[a-f0-9]{64}$`});function vF(e){return{upload_id:LP,file_name:Z,size_bytes:Y.Integer({minimum:1,maximum:e}),sha256:_F,media_type:Y.Optional(Z)}}function yF(e){return e===`skill_zip`?mF:pF}var bF=vF(hF),xF=vF(pF),SF=vF(mF),CF={relay_project_ref:IP,file_name:Z,sha256:_F,media_type:Y.Optional(Z)},wF=Y.Object({...CF,purpose:Y.Literal(`reference_file`),size_bytes:Y.Integer({minimum:1,maximum:pF})},{additionalProperties:!1}),TF=Y.Object({...CF,purpose:Y.Literal(`skill_zip`),size_bytes:Y.Integer({minimum:1,maximum:mF})},{additionalProperties:!1});Y.Object(bF,{additionalProperties:!1});var EF=Y.Union([wF,TF]),DF=Y.Object({upload_id:LP,relay_project_ref:IP,purpose:gF,file_name:Z,size_bytes:Y.Integer({minimum:1,maximum:hF}),sha256:_F,media_type:Y.Optional(Z),expires_at:X},{additionalProperties:!1}),OF=Y.Object({method:Y.Literal(`PUT`),url:Y.String({minLength:1}),headers:Y.Optional(Y.Record(Y.String({minLength:1}),Y.String()))},{additionalProperties:!1}),kF=Y.Union([Y.Object({kind:Y.Literal(`started`)},{additionalProperties:!1})]),AF=Y.Object({upload:DF,put:OF},{additionalProperties:!1});UP(EF),GP(kF,AF);var jF=Y.Union([Y.Literal(`chat`),Y.Literal(`worklist`),Y.Literal(`references`),Y.Literal(`skills`)]),MF=Y.Object({scope:jF,latest_event_cursor:Y.Integer({minimum:0}),read_event_cursor:Y.Integer({minimum:0}),has_unread:Y.Boolean(),updated_at:Y.Optional(X)},{additionalProperties:!1}),NF=Y.Object({generated_at:X,scopes:Y.Object({chat:MF,worklist:MF,references:MF,skills:MF},{additionalProperties:!1})},{additionalProperties:!1}),PF=Y.Object({scope:jF,up_to_event_cursor:Y.Optional(Y.Integer({minimum:0}))},{additionalProperties:!1}),FF=Y.Union([Y.Object({kind:Y.Literal(`marked`)},{additionalProperties:!1}),HP]),IF=Y.Object({read_state:NF},{additionalProperties:!1});UP(PF),GP(FF,IF);var LF=Y.Object({attempt:Y.Integer({minimum:1}),kind:Y.Union([Y.Literal(`initial`),Y.Literal(`continuation`),Y.Literal(`retry`)]),parent_activity_ref:Y.Optional(kP),root_activity_ref:Y.Optional(kP)},{additionalProperties:!1}),RF=Y.Union([Y.Object({kind:Y.Literal(`task`),task_id:EP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`workflow`),workflow_ref:jP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`project`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`clarification_round`),clarification_round_ref:NP},{additionalProperties:!1})]),zF=Y.Union([Y.Literal(`todo`),Y.Literal(`running`),Y.Literal(`pending`),Y.Literal(`done`),Y.Literal(`failed`)]),BF=Y.Object({task_id:EP,title:Z,summary:Y.String(),status:zF,module_id:TP,module_name:Z},{additionalProperties:!1}),VF=Y.Object({workflow_ref:jP,activity_ref:kP,topic:Y.String(),background_summary:Y.String(),current_consensus:Y.Array(Y.String()),open_questions:Y.Array(Y.String()),task_changes:Y.Array(Y.String()),submitted_at:X,compiled_tasks:Y.Optional(Y.Array(BF))},{additionalProperties:!1}),HF=Y.Object({id:Y.Literal(`current`),state:Y.Union([Y.Literal(`empty`),Y.Literal(`ready`),Y.Literal(`submitted`)]),topic:Y.String(),background_summary:Y.String(),current_consensus:Y.Array(Y.String()),open_questions:Y.Array(Y.String()),task_changes:Y.Array(Y.String()),updated_by_activity_ref:Y.Optional(kP),updated_at:Y.Optional(X),submitted_by_activity_ref:Y.Optional(kP),submitted_by_workflow_ref:Y.Optional(jP),submitted_at:Y.Optional(X),receipts:Y.Array(VF)},{additionalProperties:!1}),UF=Y.Object({id:TP,name:Z,summary:Y.Optional(Y.String()),order:Y.Integer(),archived:Y.Boolean(),created_at:X,updated_at:Y.Optional(X)},{additionalProperties:!1}),WF=Y.Object({id:EP,module_id:TP,title:Z,summary:Y.String(),status:zF,order:Y.Integer(),current_activity_ref:Y.Optional(kP),active_clarification_thread_ref:Y.Optional(MP),latest_run_result_id:Y.Optional(DP),created_from_workflow_ref:jP,created_at:X,updated_at:X},{additionalProperties:!1});Y.Object({modules:Y.Array(Y.Object({module:UF,tasks:Y.Array(WF)},{additionalProperties:!1})),updated_at:Y.Optional(X)},{additionalProperties:!1});var GF=Y.Object({goal:Y.String(),scope:Y.Array(Y.String())},{additionalProperties:!1}),KF=Y.Union([Y.Literal(`no_validation_command_found`),Y.Literal(`project_has_no_test_setup`),Y.Literal(`validation_not_applicable`),Y.Literal(`command_prerequisite_missing`),Y.Literal(`command_requires_external_service`),Y.Literal(`command_requires_secret`),Y.Literal(`command_requires_interactive_input`),Y.Literal(`command_too_expensive_for_mvp`),Y.Literal(`unsafe_command_blocked`),Y.Literal(`known_failing_baseline`)]),qF=Y.Object({status:Y.Union([Y.Literal(`succeeded`),Y.Literal(`failed`),Y.Literal(`unknown`)]),target:Y.Optional(Z),redacted_summary:Y.String(),started_at:Y.Optional(X),finished_at:Y.Optional(X)},{additionalProperties:!1}),JF=Y.Object({latest_run_result_id:Y.Optional(DP),result_kind:Y.Optional(Y.Union([Y.Literal(`needs_human`),Y.Literal(`finished`),Y.Literal(`failed`)])),run_lineage:Y.Optional(LF),clarification_thread_ref:Y.Optional(MP),outcome:Y.Optional(Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)])),summary:Y.Optional(Y.String()),checks:Y.Optional(Y.Union([Y.Literal(`passed`),Y.Literal(`failed`),Y.Literal(`skipped`)])),docs:Y.Optional(Y.Union([Y.Literal(`updated`),Y.Literal(`checked_no_change`),Y.Literal(`not_checked`),Y.Literal(`sync_deferred`)])),skip_reason_code:Y.Optional(KF),skip_reason_summary:Y.Optional(Y.String()),external_side_effects:Y.Optional(Y.Array(qF)),changed_paths:Y.Optional(Y.Array(Y.String())),user_note_candidate:Y.Optional(Y.String()),promotion:Y.Optional(Y.Object({status:Y.Union([Y.Literal(`promoted`),Y.Literal(`not_promoted`),Y.Literal(`not_attempted`)]),summary:Y.Optional(Y.String()),reason_code:Y.Optional(Z),commit_oid:Y.Optional(Z)},{additionalProperties:!1})),error_code:Y.Optional(Z),retryable:Y.Optional(Y.Boolean()),updated_at:Y.Optional(X)},{additionalProperties:!1}),YF=Y.Object({task:WF,detail:Y.Object({task_id:EP,contract:GF,result:JF,frozen_contract_since_activity_ref:Y.Optional(kP),updated_at:X},{additionalProperties:!1})},{additionalProperties:!1});zP(Y.Union([Y.Object({id:DP,activity_ref:kP,task_id:EP,run_lineage:LF,result_kind:Y.Literal(`needs_human`),summary:Y.String(),clarification_thread_ref:MP,created_at:X},{additionalProperties:!1}),Y.Object({id:DP,activity_ref:kP,task_id:EP,run_lineage:LF,result_kind:Y.Literal(`finished`),outcome:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)]),summary:Y.String(),user_note_candidate:Y.Optional(Y.String()),checks:Y.Union([Y.Literal(`passed`),Y.Literal(`failed`),Y.Literal(`skipped`)]),docs:Y.Union([Y.Literal(`updated`),Y.Literal(`checked_no_change`),Y.Literal(`not_checked`),Y.Literal(`sync_deferred`)]),skip_reason_code:Y.Optional(KF),skip_reason_summary:Y.Optional(Y.String()),external_side_effects:Y.Optional(Y.Array(qF)),created_at:X},{additionalProperties:!1}),Y.Object({id:DP,activity_ref:kP,task_id:EP,run_lineage:LF,result_kind:Y.Literal(`failed`),summary:Y.String(),error_code:Z,retryable:Y.Boolean(),created_at:X},{additionalProperties:!1})]));var XF=Y.Object({recovery_summary_id:OP,summary:Y.String({minLength:1}),affected_activities:Y.Array(kP),affected_activity_count:Y.Integer({minimum:0}),created_at:X},{additionalProperties:!1});zP(XF),Y.Object({recovery_summary:XF},{additionalProperties:!1});var ZF=Y.Union(or.map(e=>Y.Literal(e))),QF=Y.Union([Y.Object({kind:Y.Literal(`initials`),initials:Y.String({minLength:1}),color:ZF},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`image`),image_url:Y.String({minLength:1}),initials:Y.String({minLength:1}),color:ZF},{additionalProperties:!1})]),$F=Y.Union([Y.Object({kind:Y.Literal(`main_chat`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`clarification_round`),clarification_round_ref:NP},{additionalProperties:!1})]),eI=Y.Object({kind:Y.Union([Y.Literal(`human`),Y.Literal(`system`),Y.Literal(`agent`)]),ref:Y.Optional(Z),display_name:Y.Optional(Z),avatar:Y.Optional(QF)},{additionalProperties:!1}),tI=Y.Union([Y.Literal(`user_text`),Y.Literal(`agent_text`),Y.Literal(`system_notice`),Y.Literal(`clarification_request`),Y.Literal(`clarification_card`)]),nI=Y.Union([Y.Literal(`file`),Y.Literal(`image`)]),rI=Y.Object({path:Y.String({minLength:1}),name:Z,source:Y.Union([Y.Literal(`human_upload`),Y.Literal(`tutti_output`)]),category:nI,blob_oid:Y.Optional(Z),media_type:Y.Optional(Z),size_bytes:Y.Integer({minimum:0}),text_read:Y.Object({can_read:Y.Boolean(),blocked_reason:Y.Optional(Y.Union([Y.Literal(`binary`),Y.Literal(`too_large`),Y.Literal(`unsupported_encoding`),Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`unknown`)]))},{additionalProperties:!1})},{additionalProperties:!1}),iI=Y.Object({task_id:EP,title:Z,status:Y.Union([Y.Literal(`done`),Y.Literal(`failed`)]),summary:Y.String(),module_name:Y.Optional(Z),latest_run_result_id:Y.Optional(DP)},{additionalProperties:!1}),aI=Y.Object({path:Y.String({minLength:1}),name:Z,group:Y.Optional(Z),size_bytes:Y.Integer({minimum:0}),media_type:Y.Optional(Z)},{additionalProperties:!1}),oI=Y.Object({kind:Y.Literal(`worklist_terminal`),status:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)]),reason:Y.Union([Y.Literal(`all_tasks_done`),Y.Literal(`run_failed`)]),title:Z,feedback_key:Z,counters:Y.Object({completed:Y.Integer({minimum:0}),failed:Y.Integer({minimum:0}),remaining:Y.Integer({minimum:0})},{additionalProperties:!1}),items:Y.Array(iI),final_note:Y.Optional(Y.String()),generated_files:Y.Optional(Y.Array(aI)),primary_task_id:Y.Optional(EP)},{additionalProperties:!1}),sI=Y.Object({kind:Y.Literal(`task_result`),status:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`)]),title:Z,task_id:EP,task_title:Z,result_key:Z,summary:Y.String(),module_name:Y.Optional(Z),latest_run_result_id:Y.Optional(DP),activity_ref:Y.Optional(kP),final_note:Y.Optional(Y.String()),generated_files:Y.Optional(Y.Array(aI)),error_code:Y.Optional(Z)},{additionalProperties:!1}),cI=Y.Object({kind:Y.Literal(`worklist_compile`),workflow_ref:jP,title:Z,task_count:Y.Integer({minimum:0}),tasks:Y.Array(BF)},{additionalProperties:!1}),lI=Y.Object({kind:Y.Literal(`artifact_preview`),title:Z,status:Y.Union([Y.Literal(`available`),Y.Literal(`updated`)]),task_id:Y.Optional(EP),run_result_id:Y.Optional(DP)},{additionalProperties:!1}),uI=Y.Object({task_id:Y.Optional(EP),activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),clarification_thread_ref:Y.Optional(MP),clarification_round_ref:Y.Optional(NP),scratchpad_source:Y.Optional(Y.Union([Y.Literal(`include`),Y.Literal(`exclude`)])),reference_file:Y.Optional(rI),worklist_compile:Y.Optional(cI),worklist_feedback:Y.Optional(oI),task_result:Y.Optional(sI),artifact_preview:Y.Optional(lI)},{additionalProperties:!1}),dI=Y.Object({id:wP,scope:$F,author:eI,message_kind:tI,body:Y.String(),refs:Y.Optional(uI),clarification_card:Y.Optional(Y.Object({thread_id:MP,round_id:NP,title:Y.Optional(Z),summary:Z,status:Y.Union([Y.Literal(`writable`),Y.Literal(`sealed`)]),is_current_round:Y.Boolean()},{additionalProperties:!1})),created_at:X},{additionalProperties:!1});BP(dI);var fI=Y.Object({body:Y.String({minLength:1,maxLength:8e3})},{additionalProperties:!1}),pI=Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),mI=Y.Union([pI,HP]),hI=Y.Object({message:dI},{additionalProperties:!1});Y.Object({limit:Y.Optional(Y.Integer({minimum:1,maximum:200,default:50})),anchor:Y.Optional(Y.Union([Y.Literal(`latest`),Y.Literal(`start`)])),before:Y.Optional(CP),after:Y.Optional(CP),around:Y.Optional(wP)},{additionalProperties:!1}),UP(fI),GP(mI,hI),Y.Object({message:dI},{additionalProperties:!1});var gI=Y.Union([Y.Literal(`command_execution`),Y.Literal(`file_change`),Y.Literal(`permissions`),Y.Literal(`legacy_exec_command`),Y.Literal(`legacy_apply_patch`)]),_I=Y.Union([Y.Literal(`allow_once`),Y.Literal(`allow_session`),Y.Literal(`deny`),Y.Literal(`cancel`)]),vI=Y.Union([Y.Literal(`primary`),Y.Literal(`neutral`),Y.Literal(`danger`)]),yI=Y.Object({decision_id:Z,kind:_I,label:Z,tone:vI},{additionalProperties:!1}),bI=Y.Object({text:Z,cwd_label:Y.Optional(Z),actions:Y.Optional(Y.Array(Y.Object({label:Z,detail:Y.Optional(Z)},{additionalProperties:!1}))),network:Y.Optional(Y.Object({host:Z,protocol:Z},{additionalProperties:!1}))},{additionalProperties:!1}),xI=Y.Object({grant_root_label:Y.Optional(Z),paths:Y.Optional(Y.Array(Z))},{additionalProperties:!1}),SI=Y.Object({network:Y.Optional(Y.Object({enabled:Y.Boolean()},{additionalProperties:!1})),filesystem:Y.Optional(Y.Object({read:Y.Optional(Y.Array(Z)),write:Y.Optional(Y.Array(Z))},{additionalProperties:!1}))},{additionalProperties:!1}),CI=Y.Object({approval_id:PP,request_kind:gI,title:Z,summary:Z,reason:Y.Optional(Z),requested_at:X,expires_at:Y.Optional(X),task_id:Y.Optional(EP),activity_ref:Y.Optional(kP),command:Y.Optional(bI),file_change:Y.Optional(xI),permissions:Y.Optional(SI),decisions:Y.Array(yI,{minItems:1})},{additionalProperties:!1}),wI=Y.Union([Y.Literal(`accepted`),Y.Literal(`declined`),Y.Literal(`cancelled`),Y.Literal(`expired`)]),TI=Y.Object({decision_id:Z,label:Z,outcome:wI,decided_at:X,decided_by:Y.Optional(Y.Object({account_ref:Z,display_name:Z},{additionalProperties:!1}))},{additionalProperties:!1}),EI=Y.Union([Y.Object({state:Y.Literal(`none`)},{additionalProperties:!1}),Y.Object({state:Y.Literal(`pending`),request:CI},{additionalProperties:!1}),Y.Object({state:Y.Literal(`resolved`),request:CI,resolution:TI},{additionalProperties:!1})]),DI=Y.Object({decision_id:Z},{additionalProperties:!1}),OI=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_approval`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`decision_unavailable`)},{additionalProperties:!1}),HP]),kI=Y.Object({approval:Y.Optional(EI)},{additionalProperties:!1});UP(DI),GP(OI,kI);var AI=Y.Union([Y.Object({ref_kind:Y.Literal(`project_doc`),path:Z},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`directory_readme`),path:Z},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`task_detail`),task_id:EP},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`worklist`),module_id:Y.Optional(TP),task_id:Y.Optional(EP)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`scratchpad`),id:Y.Literal(`current`)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`clarification_round`),clarification_round_ref:NP},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`chat_messages`),message_refs:Y.Array(wP)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`repo_paths`),paths:Y.Array(Z)},{additionalProperties:!1}),Y.Object({ref_kind:Y.Literal(`recovery_summary`),recovery_summary_id:OP},{additionalProperties:!1})]),jI=Y.Object({kind:Y.Literal(`freeform`),purpose:Y.Union([Y.Literal(`clarify_requirement`),Y.Literal(`confirm_risk`)]),prompt:Y.Object({title:Y.Optional(Z),summary:Z,request:Z},{additionalProperties:!1}),subject:Y.Optional(Y.Object({kind:Y.Union([Y.Literal(`task`),Y.Literal(`deployment_target`),Y.Literal(`project_context`)]),ref:Y.Optional(Z),summary:Z},{additionalProperties:!1})),expires_when:Y.Optional(Y.Union([Y.Literal(`current_run_only`),Y.Literal(`until_task_contract_changes`)]))},{additionalProperties:!1});Y.Object({summary:Z,request:Z,interaction:Y.Optional(jI)},{additionalProperties:!1});var MI=Y.Object({summary:Z,request:Z,interaction:Y.Optional(jI),title:Y.Optional(Z),related_refs:Y.Optional(Y.Array(AI))},{additionalProperties:!1}),NI=Y.Union([Y.Object({kind:Y.Literal(`task_compile`),workflow_ref:jP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`task`),task_id:EP},{additionalProperties:!1})]),PI=Y.Object({id:MP,owner:NI,status:Y.Union([Y.Literal(`active`),Y.Literal(`closed`)]),current_round_id:Y.Optional(NP),created_from_activity_ref:Y.Optional(kP),closed_reason:Y.Optional(Y.Union([Y.Literal(`resolved`),Y.Literal(`contract_changed`),Y.Literal(`cancelled`)])),created_at:X,updated_at:X},{additionalProperties:!1}),FI=Y.Union([Y.Object({kind:Y.Literal(`next_round`),clarification_round_ref:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`run`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`chain_closed`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`proposal_applied`),workflow_ref:jP},{additionalProperties:!1})]),II=Y.Object({id:NP,thread_id:MP,round_index:Y.Integer({minimum:1}),status:Y.Union([Y.Literal(`writable`),Y.Literal(`sealed`)]),request_payload:MI,card_message_id:wP,opening_message_id:wP,submitted_at:Y.Optional(X),submitted_message_refs:Y.Optional(Y.Array(wP)),successor_status:Y.Union([Y.Literal(`not_materialized`),Y.Literal(`materialized`)]),successor_ref:Y.Optional(FI),capabilities:Y.Object({send_message:Y.Boolean(),submit:Y.Boolean()},{additionalProperties:!1}),created_at:X,updated_at:X},{additionalProperties:!1});Y.Union([Y.Object({state:Y.Literal(`none`)},{additionalProperties:!1}),Y.Object({state:Y.Literal(`active`),thread:PI,round:II},{additionalProperties:!1})]);var LI=Y.Object({id:NP,thread_id:MP,round_index:Y.Integer({minimum:1}),status:Y.Union([Y.Literal(`writable`),Y.Literal(`sealed`)]),title:Y.Optional(Z),summary:Z,submitted_at:Y.Optional(X),successor_status:Y.Union([Y.Literal(`not_materialized`),Y.Literal(`materialized`)]),created_at:X,updated_at:X},{additionalProperties:!1});Y.Object({thread:PI,rounds:Y.Array(LI)},{additionalProperties:!1}),Y.Object({thread:PI,round:II},{additionalProperties:!1}),Y.Object({limit:Y.Optional(Y.Integer({minimum:1,maximum:200,default:50})),anchor:Y.Optional(Y.Union([Y.Literal(`start`),Y.Literal(`latest`)])),before:Y.Optional(CP),after:Y.Optional(CP)},{additionalProperties:!1});var RI=Y.Object({body:Y.String({minLength:1,maxLength:8e3})},{additionalProperties:!1}),zI=Y.Union([Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_round`),current_round_id:Y.Optional(NP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`chain_closed`)},{additionalProperties:!1}),HP]),BI=Y.Object({message:Y.Optional(dI)},{additionalProperties:!1});UP(RI),GP(zI,BI);var VI=Y.Object({},{additionalProperties:!1}),HI=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_submitted`),successor_status:Y.Union([Y.Literal(`not_materialized`),Y.Literal(`materialized`)]),successor_ref:Y.Optional(FI)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_round`),current_round_id:Y.Optional(NP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`chain_closed`)},{additionalProperties:!1}),HP]),UI=Y.Object({round:Y.Optional(II),materialization:Y.Optional(Y.Object({status:Y.Union([Y.Literal(`queued`),Y.Literal(`already_materialized`)]),successor_ref:Y.Optional(FI)},{additionalProperties:!1}))},{additionalProperties:!1});UP(VI),GP(HI,UI),Y.Object({reason:Y.Union([Y.Literal(`round_opened`),Y.Literal(`round_message_created`),Y.Literal(`round_submitted`),Y.Literal(`successor_materialized`),Y.Literal(`chain_closed`),Y.Literal(`recovered`)]),thread_id:MP,round_id:Y.Optional(NP),successor_ref:Y.Optional(FI)},{additionalProperties:!1});var WI=Y.String(),GI=Y.Object({source:Y.Literal(`mainline`),branch:Y.Literal(`tutti/mainline`),head:Y.Optional(Y.Object({oid:Z,short_oid:Z},{additionalProperties:!1})),mainline_clean:Y.Boolean(),generated_at:X},{additionalProperties:!1}),KI=Y.Union([Y.Literal(`product`),Y.Literal(`tech`),Y.Literal(`structure`),Y.Literal(`architecture_principles`)]),qI=Y.Union([Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`binary`),Y.Literal(`unsupported_encoding`),Y.Literal(`too_large`)]),JI=Y.Object({doc_key:KI,path:WI,status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`),Y.Literal(`unreadable`)]),unreadable_reason:Y.Optional(qI),size_bytes:Y.Optional(Y.Integer({minimum:0})),blob_oid:Y.Optional(Z),last_commit:Y.Optional(Y.Object({oid:Z,short_oid:Z,committed_at:X,title:Y.Optional(Z)},{additionalProperties:!1}))},{additionalProperties:!1}),YI=Y.Union([Y.Literal(`directory`),Y.Literal(`symlink`),Y.Literal(`submodule`),Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`binary`),Y.Literal(`too_large`),Y.Literal(`unknown`)]),XI=Y.Object({path:WI,name:Y.String(),kind:Y.Union([Y.Literal(`directory`),Y.Literal(`file`),Y.Literal(`symlink`),Y.Literal(`submodule`)]),depth:Y.Integer({minimum:0}),parent_path:Y.Optional(WI),size_bytes:Y.Optional(Y.Integer({minimum:0})),blob_oid:Y.Optional(Z),extension:Y.Optional(Z),language_hint:Y.Optional(Z),has_children:Y.Optional(Y.Boolean()),project_doc_key:Y.Optional(KI),text_read:Y.Object({can_read:Y.Boolean(),blocked_reason:Y.Optional(YI)},{additionalProperties:!1})},{additionalProperties:!1}),ZI=Y.Union([Y.Object({kind:Y.Literal(`text`),encoding:Y.Literal(`utf-8`),text:Y.String(),truncated:Y.Boolean(),bytes_returned:Y.Integer({minimum:0}),total_bytes:Y.Integer({minimum:0}),line_count:Y.Optional(Y.Integer({minimum:0}))},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`omitted`),reason:Y.Union([Y.Literal(`binary`),Y.Literal(`unsupported_encoding`),Y.Literal(`too_large`)]),total_bytes:Y.Integer({minimum:0})},{additionalProperties:!1})]),QI=Y.Object({path:WI,name:Z,kind:Y.Literal(`file`),size_bytes:Y.Integer({minimum:0}),blob_oid:Y.Optional(Z),extension:Y.Optional(Z),language_hint:Y.Optional(Z),media_type:Y.Optional(Z)},{additionalProperties:!1});Y.Object({snapshot:GI,docs:Y.Array(JI)},{additionalProperties:!1}),Y.Object({doc_key:KI},{additionalProperties:!1}),Y.Object({max_bytes:Y.Optional(Y.Integer({minimum:1,maximum:1048576}))},{additionalProperties:!1}),Y.Object({snapshot:GI,doc:JI,content:ZI},{additionalProperties:!1}),Y.Object({path:Y.Optional(WI),depth:Y.Optional(Y.Integer({minimum:1,maximum:3})),limit:Y.Optional(Y.Integer({minimum:1,maximum:1e3})),cursor:Y.Optional(CP)},{additionalProperties:!1});var $I=Y.Object({next_cursor:Y.Optional(CP),has_more:Y.Boolean(),limit:Y.Integer({minimum:1,maximum:1e3})},{additionalProperties:!1});Y.Object({snapshot:GI,root:XI,items:Y.Array(XI),page:$I},{additionalProperties:!1}),Y.Object({path:WI,max_bytes:Y.Optional(Y.Integer({minimum:1,maximum:1048576}))},{additionalProperties:!1});var eL=Y.Union([Y.Literal(`thumbnail`),Y.Literal(`preview`),Y.Literal(`original`)]);Y.Object({path:WI,variant:eL,v:Z},{additionalProperties:!1}),Y.Object({snapshot:GI,file:QI,content:ZI},{additionalProperties:!1});var tL=Y.Object({path:Y.Literal(`docs/reference`),status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`)]),index_path:Y.Literal(`docs/reference/README.md`),files_path:Y.Literal(`docs/reference/files`),images_path:Y.Literal(`docs/reference/images`),tutti_path:Y.Literal(`docs/reference/tutti`),index_status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`),Y.Literal(`unreadable`)]),index_unreadable_reason:Y.Optional(qI)},{additionalProperties:!1}),nL=Y.Union([Y.Literal(`binary`),Y.Literal(`too_large`),Y.Literal(`unsupported_encoding`),Y.Literal(`restricted_path`),Y.Literal(`secret_like`),Y.Literal(`unknown`)]),rL=Y.Object({status:Y.Union([Y.Literal(`available`),Y.Literal(`missing`),Y.Literal(`stale`),Y.Literal(`unavailable`)]),text:Y.Optional(Y.String()),generated_at:Y.Optional(X),source_blob_oid:Y.Optional(Z),unavailable_reason:Y.Optional(Y.String()),read_paths:Y.Optional(Y.Array(WI))},{additionalProperties:!1}),iL=Y.Object({path:WI,name:Z,source:Y.Union([Y.Literal(`human_upload`),Y.Literal(`tutti_output`)]),category:nI,size_bytes:Y.Integer({minimum:0}),media_type:Y.Optional(Z),extension:Y.Optional(Z),language_hint:Y.Optional(Z),blob_oid:Y.Optional(Z),text_read:Y.Object({can_read:Y.Boolean(),blocked_reason:Y.Optional(nL)},{additionalProperties:!1}),summary:Y.Optional(rL)},{additionalProperties:!1});Y.Object({include_index:Y.Optional(Y.Boolean()),limit:Y.Optional(Y.Integer({minimum:1,maximum:1e3})),cursor:Y.Optional(CP)},{additionalProperties:!1}),Y.Object({snapshot:GI,directory:tL,items:Y.Array(iL),page:$I},{additionalProperties:!1});var aL=Y.Object({...xF,note:Y.Optional(Y.String())},{additionalProperties:!1}),oL=Y.Union([Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),HP]),sL=Y.Object({file:iL,message:dI,index_path:Y.Literal(`docs/reference/README.md`)},{additionalProperties:!1});UP(aL),GP(oL,sL);var cL=Y.Object({paths:Y.Optional(Y.Array(WI))},{additionalProperties:!1}),lL=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`no_targets`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:Y.Union([Y.Literal(`provider_auth_invalid`),Y.Literal(`provider_quota_or_billing_required`),Y.Literal(`provider_rate_limited`),Y.Literal(`provider_model_unavailable`),Y.Literal(`provider_network_error`)]),retryable:Y.Boolean()},{additionalProperties:!1}),HP]),uL=Y.Object({activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),target_count:Y.Optional(Y.Integer({minimum:0}))},{additionalProperties:!1});UP(cL),GP(lL,uL);var dL=Y.Union([Y.Literal(`static`),Y.Literal(`server`)]),fL=Y.String({minLength:1,maxLength:120,pattern:`\\S`}),pL=Y.String({minLength:1}),mL=Y.Object({title:fL,kind:Y.Literal(`static`),root:pL,entry:pL,network:Y.Boolean()},{additionalProperties:!1}),hL=Y.Object({title:fL,kind:Y.Literal(`server`),cwd:pL,entry:Y.String({minLength:1,maxLength:256,pattern:`^/`}),network:Y.Boolean()},{additionalProperties:!1});Y.Object({version:Y.Literal(1),artifact:Y.Union([mL,hL])},{additionalProperties:!1});var gL=Y.Union([Y.Literal(`ready`),Y.Literal(`starting`),Y.Literal(`idle`),Y.Literal(`failed`)]),_L=Y.Object({title:fL,kind:dL,network:Y.Boolean()},{additionalProperties:!1}),vL=Y.Object({status:gL,url:Y.Optional(Y.String({minLength:1})),error_message:Y.Optional(Z)},{additionalProperties:!1}),yL=Y.Union([Y.Object({status:Y.Literal(`not_declared`)},{additionalProperties:!1}),Y.Object({status:Y.Literal(`invalid`),error:Y.Object({code:Z,message:Z},{additionalProperties:!1})},{additionalProperties:!1}),Y.Object({status:Y.Literal(`declared`),preview_generation:Z,artifact:_L,preview:vL},{additionalProperties:!1})]);Y.Object({artifact:yL},{additionalProperties:!1});var bL=Y.Object({},{additionalProperties:!1}),xL=Y.Union([Y.Object({kind:Y.Literal(`issued`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`not_declared`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`invalid_manifest`),message:Z},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`preview_not_ready`),status:Y.Union([Y.Literal(`starting`),Y.Literal(`idle`),Y.Literal(`failed`)]),message:Y.Optional(Z)},{additionalProperties:!1}),HP]),SL=Y.Object({bootstrap_url:Y.String({minLength:1}),expires_at:X},{additionalProperties:!1});UP(bL),GP(xL,SL);var CL=Y.String({minLength:1,maxLength:96,pattern:`^[a-z0-9_-]+$`}),wL=Y.Object({name:CL,description:Z,short_description:Y.Optional(Z),enabled:Y.Boolean(),source:Y.Literal(`user`),updated_at:Y.Optional(X)},{additionalProperties:!1}),TL=Y.Object({name:CL,description:Z,short_description:Y.Optional(Z),enabled:Y.Boolean(),source:Y.Literal(`user`),updated_at:Y.Optional(X),skill_md:Y.String({minLength:1})},{additionalProperties:!1});Y.Object({items:Y.Array(wL)},{additionalProperties:!1}),Y.Object({skill_name:CL},{additionalProperties:!1}),Y.Object({skill:TL},{additionalProperties:!1});var EL=Y.Object(SF,{additionalProperties:!1}),DL=Y.Union([Y.Object({kind:Y.Literal(`created`),skill_name:CL},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`replaced`),skill_name:CL},{additionalProperties:!1}),HP]),OL=Y.Object({skill:TL},{additionalProperties:!1});UP(EL),GP(DL,OL);var kL=Y.Object({skill_name:CL},{additionalProperties:!1}),AL=Y.Union([Y.Object({kind:Y.Literal(`deleted`),skill_name:CL},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`not_found`),skill_name:CL},{additionalProperties:!1}),HP]);UP(kL),WP(AL);var jL=Y.Union([Y.Literal(`idle`),Y.Literal(`running`),Y.Literal(`pending`),Y.Literal(`failed`)]),ML=Y.Union([Y.Literal(`foreground`),Y.Literal(`scratchpad_background`)]),NL=Y.Object({activity_ref:kP,activity_kind:Y.Union([Y.Literal(`run`),Y.Literal(`procedure`)]),workflow_ref:Y.Optional(jP),workflow_kind:Y.Optional(RP),lane:Y.Optional(ML),started_at:Y.Optional(X)},{additionalProperties:!1}),PL=Y.Union([Y.Literal(`reading_context`),Y.Literal(`planning`),Y.Literal(`editing_files`),Y.Literal(`running_command`),Y.Literal(`using_tool`),Y.Literal(`waiting_for_approval`),Y.Literal(`finalizing`)]),FL=Y.Object({input_tokens:Y.Optional(Y.Integer({minimum:0})),cached_input_tokens:Y.Optional(Y.Integer({minimum:0})),output_tokens:Y.Optional(Y.Integer({minimum:0})),reasoning_output_tokens:Y.Optional(Y.Integer({minimum:0})),total_tokens:Y.Integer({minimum:0})},{additionalProperties:!1}),IL=Y.Object({activity_ref:kP,stage_id:Y.Optional(Y.String()),started_at:Y.Optional(X),updated_at:Y.Optional(X),token_usage:Y.Optional(FL),current_action:Y.Optional(PL)},{additionalProperties:!1}),LL=Y.Object({status:jL,summary:Y.String(),active_task:Y.Optional(WF),active_activity:Y.Optional(NL),active_activities:Y.Optional(Y.Array(NL)),runtime:Y.Optional(IL),blocked_by:Y.Optional(Y.Union([Y.Object({kind:Y.Literal(`clarification`),thread_id:MP,round_id:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`approval`),approval_id:PP},{additionalProperties:!1})])),last_conclusion:Y.Optional(Y.Object({kind:Y.Union([Y.Literal(`completed`),Y.Literal(`failed`),Y.Literal(`needs_human`),Y.Literal(`recovered`)]),summary:Y.String(),task_id:Y.Optional(EP),activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),occurred_at:X},{additionalProperties:!1})),updated_at:X},{additionalProperties:!1}),RL=Y.Object({activity_ref:kP,activity_kind:Y.Union([Y.Literal(`run`),Y.Literal(`procedure`)]),status:Y.Union([Y.Literal(`running`),Y.Literal(`needs_human`),Y.Literal(`finished`),Y.Literal(`failed`),Y.Literal(`interrupted`)]),title:Z,summary:Y.String(),task_id:Y.Optional(EP),workflow_ref:Y.Optional(jP),workflow_kind:Y.Optional(RP),lane:Y.Optional(ML),run_lineage:Y.Optional(LF),started_at:Y.Optional(X),ended_at:Y.Optional(X),latest_event_ref:Y.Optional(AP),result_anchor:Y.Optional(RF)},{additionalProperties:!1}),zL=Y.Object({event_ref:AP,activity_ref:kP,event_kind:Y.Union([Y.Literal(`started`),Y.Literal(`progress`),Y.Literal(`needs_human`),Y.Literal(`artifact_snapshot`),Y.Literal(`finished`),Y.Literal(`failed`)]),occurred_at:X,summary:Y.String(),payload:Y.Optional(Y.Object({progress:Y.Optional(Y.Object({message:Y.String(),phase:Y.Optional(Y.String())},{additionalProperties:!1})),artifact:Y.Optional(Y.Object({artifact_kind:Y.Union([Y.Literal(`scratchpad_snapshot`),Y.Literal(`task_compile_proposal`),Y.Literal(`context_sync_findings`),Y.Literal(`recovery_summary`),Y.Literal(`run_changed_paths`)]),summary:Y.String()},{additionalProperties:!1})),terminal:Y.Optional(Y.Object({result_kind:Y.Union([Y.Literal(`needs_human`),Y.Literal(`finished`),Y.Literal(`failed`)]),summary:Y.String()},{additionalProperties:!1}))},{additionalProperties:!1}))},{additionalProperties:!1});Y.Object({server_time:X,current_event_cursor:Z,replay:Y.Object({requested_cursor:Y.Optional(Z),status:Y.Union([Y.Literal(`not_requested`),Y.Literal(`replayed`),Y.Literal(`missed`)]),replayed_event_count:Y.Integer({minimum:0})},{additionalProperties:!1}),retry_after_ms:Y.Integer({minimum:0}),replay_window:qP},{additionalProperties:!1}),Y.Object({reason:Y.Union([Y.Literal(`replay_missed`),Y.Literal(`bulk_state_change`),Y.Literal(`workspace_recovered`),Y.Literal(`viewer_changed`)]),message:Y.Optional(Y.String())},{additionalProperties:!1}),Y.Object({execution_status:LL},{additionalProperties:!1}),Y.Object({approval:EI},{additionalProperties:!1}),Y.Object({activity:RL,event:zL},{additionalProperties:!1}),Y.Object({reason:Y.Union([Y.Literal(`task_compile_applied`),Y.Literal(`task_state_changed`),Y.Literal(`task_result_recorded`),Y.Literal(`workspace_recovered`)]),workflow_ref:Y.Optional(jP),activity_ref:Y.Optional(kP),changed_module_ids:Y.Optional(Y.Array(TP)),changed_task_ids:Y.Optional(Y.Array(EP))},{additionalProperties:!1}),Y.Object({task:WF},{additionalProperties:!1}),Y.Object({task_id:EP,task:Y.Optional(WF),detail:Y.Optional(YF),latest_run_result_id:Y.Optional(DP)},{additionalProperties:!1}),Y.Object({scratchpad:HF,activity_ref:Y.Optional(kP)},{additionalProperties:!1}),Y.Object({provider_config:XP},{additionalProperties:!1}),Y.Object({recovery_summary_id:OP,summary:Y.String(),affected_activities:Y.Array(kP),replayed_round_ids:Y.Optional(Y.Array(NP))},{additionalProperties:!1}),Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`no_source_messages`)},{additionalProperties:!1}),HP]),Y.Object({activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP),scratchpad:Y.Optional(HF)},{additionalProperties:!1});var BL=Y.Object({expected_scratchpad_updated_at:Y.Optional(X)},{additionalProperties:!1}),VL=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`scratchpad_empty`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`stale_scratchpad`),current_scratchpad:HF},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),HP]),HL=Y.Object({activity_ref:Y.Optional(kP),workflow_ref:Y.Optional(jP)},{additionalProperties:!1});UP(BL),GP(VL,HL);var UL=Y.Object({scope:Y.Optional(Y.Object({kind:Y.Literal(`worklist`)},{additionalProperties:!1}))},{additionalProperties:!1}),WL=Y.Union([Y.Object({kind:Y.Literal(`scheduled`),task_id:EP,activity_ref:kP,queued_task_ids:Y.Array(EP)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP,activity_kind:Y.Union([Y.Literal(`run`),Y.Literal(`procedure`)])},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`blocked_by_clarification`),thread_id:MP,round_id:NP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`nothing_to_run`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`mainline_not_clean`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),HP]);UP(UL),WP(WL);var GL=Y.Object({display_name:Y.String({minLength:1,maxLength:80})},{additionalProperties:!1}),KL=Y.Union([Y.Object({kind:Y.Literal(`updated`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`unchanged`)},{additionalProperties:!1}),HP]),qL=Y.Object({project:Y.Object({display_name:Y.String({minLength:1,maxLength:80})},{additionalProperties:!1})},{additionalProperties:!1});UP(GL),GP(KL,qL);var JL=Y.Object({description:Y.String({maxLength:160})},{additionalProperties:!1}),YL=Y.Union([Y.Object({kind:Y.Literal(`updated`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`unchanged`)},{additionalProperties:!1}),HP]),XL=Y.Object({project:Y.Object({description:Y.String({maxLength:160})},{additionalProperties:!1})},{additionalProperties:!1});UP(JL),GP(YL,XL);var ZL=Y.Object({},{additionalProperties:!1}),QL=Y.Union([Y.Object({kind:Y.Literal(`created`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_initialized`)},{additionalProperties:!1}),HP]),$L=Y.Object({activity_ref:kP,workflow_ref:jP},{additionalProperties:!1}),eR=Y.Object({docs:Y.Array(JI),created_paths:Y.Array(WI),commit_oid:Y.Optional(Z)},{additionalProperties:!1});UP(ZL),GP(QL,eR);var tR=Y.Object({},{additionalProperties:!1}),nR=Y.Union([Y.Object({kind:Y.Literal(`accepted`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`already_running`),activity_ref:kP},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_not_configured`)},{additionalProperties:!1}),Y.Object({kind:Y.Literal(`provider_unavailable`),reason:YP,retryable:Y.Boolean()},{additionalProperties:!1}),HP]),rR=$L;UP(tR),GP(nR,rR);function iR(e){try{return decodeURIComponent(e)}catch{return e}}function aR(e){return Ut(iR(e))}function oR(e,t=``){if(/^\/$/u.test(e))return{kind:`home`};if(/^\/console\/?$/u.test(e))return{kind:`local_console`};if(/^\/setup\/?$/u.test(e))return{kind:`setup`};if(/^\/projects\/?$/u.test(e)){let e=new URLSearchParams(t).get(`open`);if(e!==null){let t=aR(e);if(t!==null)return{kind:`project_open`,relayProjectRef:t}}return{kind:`project_center`}}let n=/^\/join\/([^/]+)\/?$/u.exec(e);if(n?.[1]!==void 0)return{kind:`join`,joinToken:iR(n[1])};let r=/^\/projects\/([^/]+)\/workspace\/?$/u.exec(e);if(r?.[1]!==void 0){let e=aR(r[1]);return e===null?{kind:`project_center`}:{kind:`workspace`,relayProjectRef:e}}let i=/^\/projects\/([^/]+)\/references\/?$/u.exec(e);if(i?.[1]!==void 0){let e=aR(i[1]);return e===null?{kind:`project_center`}:{kind:`references`,relayProjectRef:e}}let a=/^\/projects\/([^/]+)\/artifacts\/?$/u.exec(e);if(a?.[1]!==void 0){let e=aR(a[1]);return e===null?{kind:`project_center`}:{kind:`artifacts`,relayProjectRef:e}}let o=/^\/projects\/([^/]+)\/worklist\/?$/u.exec(e);if(o?.[1]!==void 0){let e=aR(o[1]);return e===null?{kind:`project_center`}:{kind:`worklist`,relayProjectRef:e}}let s=/^\/projects\/([^/]+)\/skills\/?$/u.exec(e);if(s?.[1]!==void 0){let e=aR(s[1]);return e===null?{kind:`project_center`}:{kind:`skills`,relayProjectRef:e}}let c=/^\/projects\/([^/]+)\/timeline\/?$/u.exec(e);if(c?.[1]!==void 0){let e=aR(c[1]);return e===null?{kind:`project_center`}:{kind:`timeline`,relayProjectRef:e}}let l=/^\/projects\/([^/]+)\/settings\/?$/u.exec(e);if(l?.[1]!==void 0){let e=aR(l[1]);return e===null?{kind:`project_center`}:{kind:`settings`,relayProjectRef:e}}return{kind:`project_center`}}var sR={success:3e3,error:9e3,warning:6e3,info:4500},cR=5,lR=(0,N.createContext)(null);function uR(e){return e.persistent===!0||e.tone===`loading`?e.durationMs:e.durationMs??sR[e.tone]}function dR(e){return e.persistent??e.tone===`loading`}function fR(e){return e.dismissible??e.tone!==`loading`}function pR(e,t){let n=uR(t);return{id:e,tone:t.tone,title:t.title,persistent:dR(t),dismissible:fR(t),...t.message===void 0?{}:{message:t.message},...n===void 0?{}:{durationMs:n}}}function mR(e,t){let n=t.tone===void 0,r={tone:t.tone??e.tone,title:t.title??e.title,...t.message===void 0?e.message===void 0?{}:{message:e.message}:{message:t.message},...t.durationMs===void 0?!n||e.durationMs===void 0?{}:{durationMs:e.durationMs}:{durationMs:t.durationMs},...t.persistent===void 0?!n||e.persistent===void 0?{}:{persistent:e.persistent}:{persistent:t.persistent},...t.dismissible===void 0?!n||e.dismissible===void 0?{}:{dismissible:e.dismissible}:{dismissible:t.dismissible}};return pR(e.id,r)}function hR(e){return[e.id,e.tone,e.title,e.message??``,e.durationMs??``,e.persistent===!0?`persistent`:`timed`].join(`:`)}function gR({children:e}){let[t,n]=(0,N.useState)([]),r=(0,N.useRef)(new Map),i=(0,N.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),a=(0,N.useCallback)(e=>{let t=Gt(),r=pR(t,e);return n(e=>[...e,r].slice(-cR)),t},[]),o=(0,N.useCallback)((e,t)=>{if(e===void 0){a(t);return}n(n=>n.map(n=>n.id===e?mR(n,t):n))},[a]);(0,N.useEffect)(()=>{let e=new Set(t.map(e=>e.id));for(let[t,n]of r.current)e.has(t)||(window.clearTimeout(n.timeout),r.current.delete(t));for(let e of t){let t=r.current.get(e.id),n=hR(e);if(t!==void 0&&t.key!==n&&(window.clearTimeout(t.timeout),r.current.delete(e.id)),e.persistent===!0||e.durationMs===void 0||r.current.has(e.id))continue;let a=window.setTimeout(()=>i(e.id),e.durationMs);r.current.set(e.id,{key:n,timeout:a})}},[i,t]),(0,N.useEffect)(()=>()=>{for(let e of r.current.values())window.clearTimeout(e.timeout);r.current.clear()},[]);let s=(0,N.useMemo)(()=>({notify:a,update:o,dismiss:i}),[i,a,o]);return(0,P.jsxs)(lR.Provider,{value:s,children:[e,(0,P.jsx)(da,{notices:t,onDismiss:i})]})}function _R(){let e=(0,N.useContext)(lR);if(e===null)throw Error(`useNotify must be used inside NotificationProvider`);return e}var vR=`http://127.0.0.1:4370`;function yR(){return typeof window<`u`?window.location.origin:vR}function bR(){let e=`https://tutti.now`;return typeof e==`string`?e:yR()}var xR=bR(),SR={relayBaseUrl:xR},CR=3e4,Q={relayRoot:[`relay`],me:[`relay`,`me`],recentProjects:[`relay`,`projects`,`recent`],projectPresence:e=>[`relay`,`projects`,e,`presence`],relayJoinRoot:[`relay`,`join`],join:e=>[`relay`,`join`,e],bootstrap:e=>[`host`,e,`bootstrap`],hostRoot:e=>[`host`,e],hostSession:e=>[`host`,e,`session`],hostWorkspace:e=>[`host`,e,`workspace`],messages:e=>[`host`,e,`messages`,`main_chat`],messagesWindow:(e,t)=>[...Q.messages(e),{limit:t}],messagesAround:(e,t,n)=>[...Q.messages(e),{around:t,limit:n}],messageHistory:(e,t,n)=>[...Q.messages(e),{history:t,limit:n}],scratchpad:e=>[`host`,e,`scratchpad`],worklist:e=>[`host`,e,`worklist`],readState:e=>[`host`,e,`read-state`],activeClarification:e=>[`host`,e,`clarification`,`active`],activeApproval:e=>[`host`,e,`approval`,`active`],noActiveClarificationRoundMessages:e=>[`host`,e,`clarification-round-messages`,`none`],clarificationRoundMessages:(e,t)=>[`host`,e,`clarification-round-messages`,t],task:(e,t)=>[`host`,e,`task`,t],taskDetail:(e,t)=>[`host`,e,`task-detail`,t],taskRunResults:(e,t)=>[`host`,e,`task-run-results`,t],executionStatus:e=>[`host`,e,`execution-status`],providerConfig:e=>[`host`,e,`provider-config`],providerUsage:e=>[`host`,e,`provider-usage`],projectTimeline:e=>[`host`,e,`project-timeline`],viewerRoot:e=>[`host`,e,`viewer`],viewerFile:(e,t)=>[`host`,e,`viewer`,`file`,t],referenceFiles:e=>[`host`,e,`references`,`files`],artifacts:e=>[`host`,e,`artifacts`],artifactPreviewSession:(e,t)=>[`relay`,e,`artifact-preview-session`,t],skills:e=>[`host`,e,`skills`],skillDetail:(e,t)=>[`host`,e,`skills`,t]};function wR(){return`${window.location.pathname}${window.location.search}${window.location.hash}`}function $(e,t={}){t.replace===!0?window.history.replaceState(null,``,e):window.history.pushState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))}function TR(e){let t=new URL(e,window.location.origin);$(`${t.pathname}${t.search}${t.hash}`)}function ER(){let[e,t]=(0,N.useState)(wR);return(0,N.useEffect)(()=>{let e=()=>{t(wR())};return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e)}},[]),(0,N.useMemo)(()=>{let t=new URL(e,window.location.origin);return oR(t.pathname,t.search)},[e])}function DR(e){return e instanceof Error?e.message:`Request failed`}function OR(e){e.invalidateQueries({queryKey:Q.me}),e.invalidateQueries({queryKey:Q.recentProjects})}function kR(e,t){if(t!==void 0)for(let n of t)switch(n.kind){case`all`:e.invalidateQueries({queryKey:Q.relayRoot});break;case`me`:e.invalidateQueries({queryKey:Q.me});break;case`recent_projects`:e.invalidateQueries({queryKey:Q.recentProjects});break;case`join_entries`:e.invalidateQueries({queryKey:Q.relayJoinRoot});break;case`project_presence`:Vt(n.relay_project_ref,Lt.relayProject)&&e.invalidateQueries({queryKey:Q.projectPresence(n.relay_project_ref)});break}}function AR(e){let t=rt(),n=(0,N.useMemo)(()=>zn(SR),[]);(0,N.useEffect)(()=>{if(e)try{let e=n.connectEvents({onReady:e=>{e.payload.replay.status===`missed`&&t.invalidateQueries({queryKey:Q.relayRoot})},onInvalidate:e=>{kR(t,e)}});return()=>{e.close()}}catch{return}},[e,t,n])}function jR(e,t,n){if(n!==void 0)for(let r of n)switch(r.kind){case`all`:e.invalidateQueries({queryKey:Q.hostRoot(t)});break;case`workspace`:e.invalidateQueries({queryKey:Q.hostWorkspace(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`session`:e.invalidateQueries({queryKey:Q.hostSession(t)});break;case`bootstrap`:e.invalidateQueries({queryKey:Q.bootstrap(t)});break;case`messages`:r.scope===`main_chat`?e.invalidateQueries({queryKey:Q.messages(t)}):e.invalidateQueries({queryKey:Q.clarificationRoundMessages(t,r.round_id)});break;case`scratchpad`:e.invalidateQueries({queryKey:Q.scratchpad(t)});break;case`worklist`:e.invalidateQueries({queryKey:Q.worklist(t)});break;case`read_state`:e.invalidateQueries({queryKey:Q.readState(t)});break;case`task`:e.invalidateQueries({queryKey:Q.task(t,r.task_id)});break;case`task_detail`:e.invalidateQueries({queryKey:Q.taskDetail(t,r.task_id)});break;case`task_run_results`:e.invalidateQueries({queryKey:Q.taskRunResults(t,r.task_id)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`execution_status`:e.invalidateQueries({queryKey:Q.executionStatus(t)});break;case`approval`:e.invalidateQueries({queryKey:Q.activeApproval(t)});break;case`provider_config`:e.invalidateQueries({queryKey:Q.providerConfig(t)});break;case`provider_usage`:e.invalidateQueries({queryKey:Q.providerUsage(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`project_timeline`:e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`viewer`:e.invalidateQueries({queryKey:Q.viewerRoot(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)}),(r.path===void 0||r.path.startsWith(`docs/reference`))&&e.invalidateQueries({queryKey:Q.referenceFiles(t)}),r.path!==void 0&&e.invalidateQueries({queryKey:Q.viewerFile(t,r.path)});break;case`skills`:e.invalidateQueries({queryKey:Q.skills(t)});break;case`artifacts`:e.invalidateQueries({queryKey:Q.artifacts(t)});break;case`recovery_summaries`:e.invalidateQueries({queryKey:Q.projectTimeline(t)});break;case`activity`:break;case`clarification`:e.invalidateQueries({queryKey:Q.activeClarification(t)}),e.invalidateQueries({queryKey:Q.projectTimeline(t)}),r.round_id!==void 0&&e.invalidateQueries({queryKey:Q.clarificationRoundMessages(t,r.round_id)});break}}function MR(){return{items:[],window:{has_older:!1,has_newer:!1,limit:50}}}function NR(){return{modules:[]}}function PR(){return{id:`current`,state:`empty`,topic:``,background_summary:``,current_consensus:[],open_questions:[],task_changes:[],receipts:[]}}function FR(e){return{chat:e?.scopes.chat.has_unread===!0,worklist:e?.scopes.worklist.has_unread===!0,references:e?.scopes.references.has_unread===!0,skills:e?.scopes.skills.has_unread===!0}}function IR(e){return e?.artifact.status===`declared`?{available:!0}:{available:!1}}function LR({enabled:e,hostClient:t,relayProjectRef:n,readState:r,scope:i}){let a=rt(),o=(0,N.useRef)(null),s=yt({mutationFn:e=>t.markRead({scope:i,up_to_event_cursor:e}),onSuccess:e=>{jR(a,n,e.invalidates)},onError:()=>{o.current=null}});(0,N.useEffect)(()=>{if(!e||r===void 0)return;let t=r.scopes[i];if(!t.has_unread){t.read_event_cursor>=t.latest_event_cursor&&(o.current=null);return}let n=`${i}:${t.latest_event_cursor}`;o.current===n||s.isPending||(o.current=n,s.mutate(t.latest_event_cursor))},[e,s,r,i])}function RR(){return{state:`none`}}function zR(e){return{status:`idle`,summary:`Idle`,updated_at:e}}function BR(e){return e.active_activities??(e.active_activity===void 0?[]:[e.active_activity])}function VR(e,t,n){return BR(e).some(e=>e.workflow_kind===t?n===void 0||(e.lane??`foreground`)===n:!1)}function HR(e,t){let n=`/projects/${encodeURIComponent(Ht(e))}/references`;return t===void 0?n:`${n}?path=${encodeURIComponent(t)}`}function UR(e){return`/projects/${encodeURIComponent(Ht(e))}/artifacts`}function WR(e,t){let n=`/projects/${encodeURIComponent(Ht(e))}/worklist`;return t===void 0?n:`${n}?task=${encodeURIComponent(t)}`}function GR(e,t){return`${rn(e)}?message=${encodeURIComponent(t)}`}function KR(e){return`/projects/${encodeURIComponent(Ht(e))}/settings`}function qR(e){return`/projects/${encodeURIComponent(Ht(e))}/timeline`}function JR(e,t){let n=`/projects/${encodeURIComponent(Ht(e))}/skills`;return t===void 0?n:`${n}?skill=${encodeURIComponent(t)}`}function YR(e,t){switch(t.target.kind){case`approval`:case`clarification`:case`scratchpad`:return rn(e);case`worklist`:return WR(e);case`references`:return HR(e);case`task`:return WR(e,t.target.taskId)}}function XR(e,t){$(YR(e,t))}function ZR(e,t){let n=Fr(e);if(t!==void 0&&n.some(e=>e.id===t))return t;for(let e of[`running`,`pending`,`failed`,`todo`,`done`]){let t=n.find(t=>t.status===e);if(t!==void 0)return t.id}}function QR(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $R(e){switch(e){case`binary`:return`Binary file`;case`too_large`:return`File too large`;case`unsupported_encoding`:return`Unsupported encoding`;case`restricted_path`:case`secret_like`:return`Restricted file`;default:return`Preview unavailable`}}function ez(e){if(!(e===void 0||e.kind===`text`))return $R(e.reason)}function tz(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function nz(e){if(globalThis.crypto?.subtle===void 0)throw Error(`This browser does not support file upload hashing.`);return`sha256:${tz(await globalThis.crypto.subtle.digest(`SHA-256`,await e.arrayBuffer()))}`}async function rz(e){if(e.file.size<=0)throw Error(`Upload file cannot be empty.`);let t=yF(e.purpose);if(e.file.size>t)throw Error(`Upload file cannot exceed ${QR(t)}.`);let n=await nz(e.file),r=e.file.type===``?void 0:e.file.type,i=zn(SR),a=e.purpose===`skill_zip`?{relay_project_ref:e.relayProjectRef,purpose:`skill_zip`,file_name:e.file.name,size_bytes:e.file.size,sha256:n,...r===void 0?{}:{media_type:r}}:{relay_project_ref:e.relayProjectRef,purpose:`reference_file`,file_name:e.file.name,size_bytes:e.file.size,sha256:n,...r===void 0?{}:{media_type:r}},o=await i.startUpload(a);if(o.result===void 0)throw Error(`Upload session could not be started.`);let s=new Headers(o.result.put.headers??{});r!==void 0&&!s.has(`content-type`)&&s.set(`content-type`,r);let c;try{c=await fetch(o.result.put.url,{method:o.result.put.method,headers:s,body:e.file})}catch{throw Error(`File upload failed while sending the file to upload storage. Check that R2 CORS allows PUT from this Web origin.`)}if(!c.ok)throw Error(`File upload failed while sending the file to upload storage (${c.status}).`);return{upload_id:o.result.upload.upload_id,file_name:o.result.upload.file_name,size_bytes:o.result.upload.size_bytes,sha256:o.result.upload.sha256,...o.result.upload.media_type===void 0?{}:{media_type:o.result.upload.media_type}}}function iz(e){let t=rt(),n=_R(),[r,i]=(0,N.useState)(`identity`),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)({email:``,displayName:``,code:``}),l=yt({mutationFn:async()=>{let e=s.email.trim(),t=await Vn(SR,{email:e});if(t.result===void 0)throw Error(`Login challenge was not returned`);return{challenge:t.result.challenge,disposition:t.disposition,email:e}},onSuccess:({challenge:e,disposition:t,email:r})=>{o(e),c(e=>({...e,code:``})),i(`code`),n.notify({tone:`success`,title:t.kind===`otp_already_pending`?`Verification email already sent`:`Verification email sent`,message:t.kind===`otp_already_pending`?`Verification email already sent to ${r}.`:`Verification email sent to ${r}.`})}}),u=yt({mutationFn:async()=>{if(a===null)throw Error(`Login challenge is missing`);let e=await Hn(SR,{challenge_ref:a.challenge_ref,code:s.code.trim()});if(e.result===void 0)throw Error(`Login response was not returned`);return e.result},onSuccess:n=>{if(!n.account.profile_complete){t.invalidateQueries({queryKey:Q.me}),c(e=>({...e,displayName:``})),i(`profile`);return}OR(t),e?.()}}),d=yt({mutationFn:async()=>{let e=await Un(SR,{display_name:s.displayName.trim()});if(e.result===void 0)throw Error(`Profile response was not returned`);return e.result.account},onSuccess:()=>{OR(t),e?.()}}),f=e=>{if(e.preventDefault(),r===`identity`&&s.email.trim()!==``){l.mutate();return}if(r===`code`&&a!==null&&s.code.trim()!==``){u.mutate();return}r===`profile`&&s.displayName.trim()!==``&&d.mutate()},p=l.isPending||u.isPending||d.isPending,m=r===`identity`?l.error:r===`code`?u.error??l.error:d.error;return{phase:r,form:s,pending:p,submitDisabled:r===`identity`?s.email.trim()===``:r===`code`?a===null||s.code.replace(/\s+/gu,``).length!==6:s.displayName.trim()===``,challengeEmailHint:a?.email_hint??null,error:m===null?null:DR(m),onChange:e=>{c(t=>({...t,...e,...e.code===void 0?{}:{code:e.code.replace(/\D/gu,``).slice(0,6)}}))},onSubmit:f,onBack:()=>{l.reset(),u.reset(),d.reset(),o(null),c(e=>({...e,code:``})),i(`identity`)}}}function az(e){let t=rt(),[n,r]=(0,N.useState)({email:``,displayName:``,code:``}),i=yt({mutationFn:async()=>{let e=await Un(SR,{display_name:n.displayName.trim()});if(e.result===void 0)throw Error(`Profile response was not returned`);return e.result.account},onSuccess:()=>{OR(t),e?.()}});return{phase:`profile`,form:n,pending:i.isPending,submitDisabled:n.displayName.trim()===``,challengeEmailHint:null,error:i.error===null?null:DR(i.error),onChange:e=>{r(t=>({...t,...e,...e.code===void 0?{}:{code:e.code.replace(/\D/gu,``).slice(0,6)}}))},onSubmit:e=>{e.preventDefault(),n.displayName.trim()!==``&&i.mutate()}}}var oz=`tutti.workspace-onboarding.v1`,sz={version:1,start_chat_pending:!1,tour_pending:!1};function cz(){try{return typeof window>`u`?null:window.sessionStorage}catch{return null}}function lz(e){return e.storage===void 0?cz():e.storage}function uz(e,t){return`${oz}:${e}:${t}`}function dz(e){if(typeof e!=`object`||!e)return null;let t=e;return t.version===1&&typeof t.start_chat_pending==`boolean`&&typeof t.tour_pending==`boolean`?{version:1,start_chat_pending:t.start_chat_pending,tour_pending:t.tour_pending}:null}function fz(e,t,n){if(e!==null)try{if(!n.start_chat_pending&&!n.tour_pending){e.removeItem(t);return}e.setItem(t,JSON.stringify(n))}catch{}}function pz(e,t,n={}){let r=lz(n);if(r===null)return{...sz};try{let n=r.getItem(uz(e,t));return n===null?{...sz}:dz(JSON.parse(n))??{...sz}}catch{return{...sz}}}function mz(e,t,n={}){fz(lz(n),uz(e,t),{version:1,start_chat_pending:!0,tour_pending:!0})}function hz(e,t,n,r){let i=lz(r),a=pz(e,t,{storage:i});a[n]&&fz(i,uz(e,t),{...a,[n]:!1})}function gz(e,t,n={}){hz(e,t,`start_chat_pending`,n)}function _z(e,t,n={}){hz(e,t,`tour_pending`,n)}function vz({joinToken:e}){let t=rt(),n=F({queryKey:Q.join(e),queryFn:()=>Gn(SR,e)}),r=iz(()=>{n.refetch()}),i=az(()=>{n.refetch()}),a=yt({mutationFn:()=>Kn(SR,e),onSuccess:n=>{OR(t),t.invalidateQueries({queryKey:Q.join(e)}),n.disposition.kind===`joined`&&n.result!==void 0&&mz(n.result.account.account_ref,n.result.relay_project.relay_project_ref),n.result?.relay_project.host_status===`online`&&$(rn(n.result.relay_project.relay_project_ref))}}),o=yt({mutationFn:e=>Jn(SR,e),onSuccess:e=>{OR(t),e.disposition.kind===`opened`&&e.result?.open_url!==void 0&&TR(e.result.open_url)}}),s=n.data;AR(s?.account!==void 0);let c=s?.relay_project?.display_name??`Project`,l=s?.relay_project?.host_status??`unknown`,u=s?.account?.profile_complete===!1,d=u?`login_required`:n.isLoading?`loading`:n.error===null?s?.next.kind??`invalid_or_expired`:`error`;return(0,P.jsx)(nC,{projectName:c,description:d===`invalid_or_expired`?`This invite can no longer be used.`:`You have been invited to join ${c}.`,hostLabel:rr(l),hostOnline:l===`online`,nextKind:d,accountLabel:s?.account?.display_name??null,membershipLabel:s?.membership?.label??null,actionPending:a.isPending||o.isPending,error:n.error===null?a.error===null?o.error===null?null:DR(o.error):DR(a.error):DR(n.error),onBrandClick:()=>$(`/`),onRetry:()=>void n.refetch(),onAccept:()=>a.mutate(),onOpen:()=>{s?.next.kind===`open_workspace`&&o.mutate(s.next.relay_project_ref)},...d===`login_required`?{loginForm:u?i:r}:{}})}function yz(){$(`/projects`,{replace:!0})}function bz(){let e=F({queryKey:Q.me,queryFn:()=>Bn(SR)}),t=iz(yz);return(0,N.useEffect)(()=>{e.data!==void 0&&yz()},[e.data]),e.isLoading||e.data!==void 0?null:(0,P.jsx)(uC,{...t,onBrandClick:()=>$(`/`),sessionError:e.error===null||Qt(e.error)?null:`Tutti could not check your current session. You can still try signing in.`})}function xz(e){let t=e.trim().replace(/[\\/]+$/u,``);return t===``?``:t.slice(Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`))+1)}function Sz(e=``){return{workspacePath:e,displayName:xz(e),description:``,baseUrl:``,apiKey:``,model:``}}function Cz(e,t,n){return{...e,workspacePath:t,...n?{}:{displayName:xz(t)}}}function wz(e){switch(e){case`console_busy`:return`Wait for the current Local Console action to finish.`;case`host_busy`:return`Wait for active project work or questions to finish.`;case`host_identity_unverified`:return`Stop or reopen the affected project before updating.`;case`update_in_progress`:return`Another Tutti update is already in progress.`;case`update_recovery_required`:return`Run tutti again after closing this page to recover the interrupted update.`;case`global_prefix_read_only`:return`Use your normal terminal installation environment to update Tutti.`;case`npm_install_failed`:return`The npm installation failed. Refresh to check whether it can be retried.`;case`post_install_validation_failed`:return`The installed package could not be verified. Run tutti again to recover.`;case`completion_start_failed`:case`completion_failed`:case`worker_crashed`:return`The update was interrupted. Run tutti again to recover.`;case`host_restore_failed`:return`Tutti updated, but one or more local projects could not restart.`;case`installation_not_global`:case`custom_home`:case`npm_unavailable`:case`npm_global_root_mismatch`:case`npm_version_unsupported`:case`registry_unavailable`:case void 0:return`Tutti cannot update from this Local Console.`}}function Tz(e){if(e.status!==`updating`)return e.status===`blocked`||e.status===`failed`?wz(e.reason_code):void 0;switch(e.phase){case`stopping_hosts`:return`Safely stopping online projects.`;case`installing`:return`Installing the new Tutti version.`;case`restarting`:return`Restarting local projects.`;case`preparing`:case void 0:return`Preparing the update.`}}function Ez(e){let t=e.update;if(t===null||t.status===`up_to_date`||t.latest_version===void 0&&t.status!==`updating`&&t.status!==`failed`)return;let n=e.checking&&t.status===`ready`?`Checking update readiness.`:Tz(t);return{label:t.status===`updating`?`Updating…`:`Restart and Update`,disabled:t.status!==`ready`||!t.can_update||e.checking||e.starting,...n===void 0?{}:{description:n}}}function Dz(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length===0?t:n}function Oz({inviterName:e,projectName:t,joinUrl:n}){return`${Dz(e,`A teammate`)} invited you to join the Tutti project “${Dz(t,`Untitled project`)}”.\n\nOpen the invitation link:\n${n.trim()}`}var kz=Sz();function Az(){let e=window.location.hash.startsWith(`#`)?window.location.hash.slice(1):window.location.hash;return new URLSearchParams(e).get(`access_token`)}function jz(){window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}`)}function Mz(e){return window.open(e,`_blank`,`noopener,noreferrer`)}function Nz(){let e=window.open(`about:blank`,`_blank`);return e!==null&&(e.opener=null),e}function Pz(){let e=_R(),t=(0,N.useRef)(void 0),n=(0,N.useRef)(void 0),r=(0,N.useRef)(!1),i=(0,N.useRef)(null),a=(0,N.useRef)(!1),o=(0,N.useRef)(null),s=(0,N.useRef)(!1),c=(0,N.useMemo)(()=>Fn({baseUrl:window.location.origin,csrfToken:()=>t.current,contextToken:()=>n.current}),[]),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(null),[p,m]=(0,N.useState)(kz),h=(0,N.useRef)(!1),g=(0,N.useRef)({baseUrl:``,apiKey:``}),[_,v]=(0,N.useState)([]),[y,b]=(0,N.useState)(!1),[x,S]=(0,N.useState)(`folder`),[C,w]=(0,N.useState)([]),[T,E]=(0,N.useState)(!0),[ee,D]=(0,N.useState)(!1),[O,k]=(0,N.useState)(!1),[te,ne]=(0,N.useState)(null),[A,re]=(0,N.useState)(null),[ie,j]=(0,N.useState)(!1),[M,ae]=(0,N.useState)(!1);async function oe(){if(t.current!==void 0){E(!0);try{w((await c.getProjects()).projects)}catch(t){e.notify({tone:`error`,title:`Projects unavailable`,message:DR(t)})}finally{E(!1)}}}async function se(e={}){i.current?.abort();let t=new AbortController;i.current=t,j(!0);try{re(await c.getPackageUpdate({refresh:e.refresh===!0,signal:t.signal}))}catch{}finally{i.current===t&&(i.current=null,j(!1))}}(0,N.useEffect)(()=>{r.current||(r.current=!0,(async()=>{try{let e=Az();if(e!==null&&e.trim()!==``){jz();let r=await c.exchangeSession(e);t.current=r.csrf_token,n.current=r.context_token}let r=await c.getBootstrap();t.current=r.csrf_token,u(r),f(null),await Promise.all([oe(),se()])}catch(e){E(!1),f(DR(e))}})())},[c]),(0,N.useEffect)(()=>()=>{i.current?.abort()},[]),(0,N.useEffect)(()=>{if(l===null)return;let e=window.setInterval(()=>{c.heartbeat().catch(()=>void 0)},6e4);return()=>window.clearInterval(e)},[l,c]),(0,N.useEffect)(()=>{if(l===null||A?.latest_version===void 0||A.status===`up_to_date`||A.status===`failed`)return;let e=window.setInterval(()=>void se(),A.status===`updating`?2e3:15e3);return()=>window.clearInterval(e)},[l,A?.latest_version,A?.status]),(0,N.useEffect)(()=>{let t=l?.package_update_completion;t===void 0||s.current||(s.current=!0,e.notify(t.restart_failure_count===0?{tone:`success`,title:`Tutti updated to ${t.target_version}`}:{tone:`warning`,title:`Tutti updated to ${t.target_version}`,message:`${t.restart_failure_count} local project${t.restart_failure_count===1?``:`s`} could not restart.`}))},[l,e]),(0,N.useEffect)(()=>{if(A?.status!==`failed`)return;let t=A.reason_code??`update_failed`;o.current!==t&&(o.current=t,e.notify({tone:`error`,title:`Tutti update did not complete`,message:wz(A.reason_code)}))},[e,A]);async function ce(){try{let t=await c.pickFolder();t.kind===`selected`?ge({workspacePath:t.path}):t.kind===`unavailable`&&e.notify({tone:`info`,title:`Use a folder path`,message:t.message})}catch(t){e.notify({tone:`error`,title:`Folder picker unavailable`,message:DR(t)})}}async function le(){let t={baseUrl:p.baseUrl.trim(),apiKey:p.apiKey.trim()},n=()=>g.current.baseUrl.trim()===t.baseUrl&&g.current.apiKey.trim()===t.apiKey;D(!0);try{let r=await c.discoverModels({base_url:t.baseUrl,api_key:t.apiKey});if(!n())return;r.kind===`ok`?(v(r.models),m(e=>({...e,model:``})),S(`model`)):(v([]),e.notify({tone:`error`,title:`Provider check failed`,message:r.reason===`model_list_empty`?`The endpoint did not return any available models.`:`Check the Base URL and API key, then try again.`}))}catch(t){if(!n())return;v([]),e.notify({tone:`error`,title:`Provider check failed`,message:DR(t)})}finally{D(!1)}}async function ue(){k(!0);try{let e=await c.launchProject({workspace_path:p.workspacePath.trim(),project:{display_name:p.displayName.trim(),...p.description.trim()===``?{}:{description:p.description.trim()}},provider:{base_url:p.baseUrl.trim(),api_key:p.apiKey.trim(),model:p.model.trim()}});_e(),window.location.assign(e.join_url)}catch(t){e.notify({tone:`error`,title:`Launch failed`,message:DR(t)})}finally{k(!1)}}async function de(t){ne(t.project_id);try{await c.launchProject({workspace_path:t.workspace_path}),await oe(),e.notify({tone:`success`,title:`${t.display_name} is ready`})}catch(t){let n=t instanceof Jt&&t.code===`provider_configuration_required`;e.notify({tone:n?`warning`:`error`,title:n?`Provider required`:`Launch failed`,message:n?`Use New project with this folder to update its Provider configuration.`:DR(t)})}finally{ne(null)}}async function fe(t){ne(t.project_id);try{let n=await c.refreshInvite(t.project_id);await navigator.clipboard.writeText(Oz({inviterName:``,projectName:t.display_name,joinUrl:n.join_url})),w(e=>e.map(e=>e.project_id===t.project_id?{...e,join_url:n.join_url}:e)),e.notify({tone:`success`,title:`Invitation copied`})}catch(t){e.notify({tone:`error`,title:`Invite unavailable`,message:DR(t)})}finally{ne(null)}}async function pe(t){if(t.open_url===void 0)return;if(t.update_required!==!0){Mz(t.open_url);return}let n=Nz();ne(t.project_id);try{let r=await c.openProject(t.project_id);w(e=>e.map(e=>e.project_id===r.project.project_id?r.project:e)),n===null?window.location.assign(r.open_url):n.location.replace(r.open_url),r.disposition===`updated`?e.notify({tone:`success`,title:`${t.display_name} updated`}):r.disposition===`deferred_busy`?e.notify({tone:`info`,title:`Opened without updating`,message:`Try Open again after the current project activity finishes.`}):r.disposition===`deferred_unsupported`?e.notify({tone:`info`,title:`Opened with the current Host`,message:`Stop and Resume this project once to enable safe automatic updates.`}):r.disposition===`deferred_unavailable`&&e.notify({tone:`warning`,title:`Update deferred`,message:`The current Host could not be safely restarted, so the project opened as-is.`})}catch(t){n?.close(),e.notify({tone:`error`,title:`Open failed`,message:DR(t)})}finally{ne(null)}}async function me(t){ne(t.project_id);try{await c.stopProject(t.project_id),await Promise.all([oe(),se()]),e.notify({tone:`success`,title:`${t.display_name} stopped`})}catch(t){e.notify({tone:`error`,title:`Stop failed`,message:DR(t)})}finally{ne(null)}}async function he(){if(!(a.current||A?.status!==`ready`||!A.can_update)){a.current=!0,ae(!0);try{re(await c.startPackageUpdate())}catch(t){t instanceof Jt&&t.statusCode===0?re({...A,status:`updating`,can_update:!1,phase:`preparing`}):(e.notify({tone:`error`,title:`Update not started`,message:DR(t)}),await se())}finally{a.current=!1,ae(!1)}}}function ge(e){e.displayName!==void 0&&(h.current=!0);let t=e.baseUrl!==void 0&&e.baseUrl!==p.baseUrl||e.apiKey!==void 0&&e.apiKey!==p.apiKey;t&&(v([]),g.current={baseUrl:e.baseUrl??p.baseUrl,apiKey:e.apiKey??p.apiKey}),m(n=>({...e.workspacePath===void 0?n:Cz(n,e.workspacePath,h.current),...e,...t?{model:``}:{}}))}function _e(){b(!1),S(`folder`),v([]),g.current={baseUrl:``,apiKey:``},h.current=!1,m(Sz())}function ve(e){if(!e){!ee&&!O&&_e();return}let t=l?.invocation.source===`terminal`?l.invocation.current_directory:``;h.current=!1,g.current={baseUrl:``,apiKey:``},v([]),m(Sz(t)),S(`folder`),b(!0)}function ye(e){if(e.preventDefault(),x===`folder`){S(`details`);return}if(x===`details`){S(`provider`);return}if(x===`provider`){le();return}ue()}function be(){S(e=>{switch(e){case`folder`:return`folder`;case`details`:return`folder`;case`provider`:return`details`;case`model`:return`provider`}})}let xe=Ez({update:A,checking:ie,starting:M});return(0,P.jsx)(lC,{form:p,models:_,projects:C,projectsLoading:T,sessionLoading:l===null&&d===null,sessionError:d,createOpen:y,createStep:x,modelDiscoveryPending:ee,launchPending:O,projectActionPending:te,...xe===void 0?{}:{packageUpdateAction:xe},onChange:ge,onCreateOpenChange:ve,onCreateSubmit:ye,onCreateBack:be,onChooseFolder:()=>void ce(),onRefresh:()=>void Promise.all([oe(),se({refresh:!0})]),onLaunchExisting:e=>void de(e),onOpenProject:e=>void pe(e),onCopyInvite:e=>void fe(e),onStopProject:e=>void me(e),onPackageUpdate:()=>void he()})}var Fz=/^[A-Za-z0-9_-]{8,256}$/u,Iz=/https?:\/\/[^\s<>"'`“”‘’]+/giu,Lz=/(?:^|[\s("'“‘])((?:\/)?join\/[A-Za-z0-9_-]{8,256})(?=$|[\s?#.,;:!'"”’)\]}])/giu,Rz=/[.,;:!?)}\]]+$/u;function zz(e){let t;try{t=decodeURIComponent(e)}catch{return null}return Fz.test(t)?t:null}function Bz(e){let t=e.split(`/`).filter(Boolean);return t.length!==2||t[0]!==`join`?null:zz(t[1]??``)}function Vz(e,t){let n=Bz(t);n!==null&&e.add(`/join/${encodeURIComponent(n)}`)}function Hz(e,t){try{Vz(e,new URL(t.replace(Rz,``)).pathname)}catch{}}function Uz(e){let t=e.trim();if(t===``)return{kind:`empty`};let n=new Set;for(let e of t.matchAll(Iz))Hz(n,e[0]);for(let e of t.matchAll(Lz)){let t=e[1];if(t!==void 0)try{Vz(n,new URL(t,`https://tutti.invalid`).pathname)}catch{}}let r=zz(t);return r!==null&&n.add(`/join/${encodeURIComponent(r)}`),n.size===0?{kind:`invalid`}:n.size>1?{kind:`ambiguous`}:{kind:`matched`,route:[...n][0]}}function Wz({requestedOpenProjectRef:e}){let t=rt(),n=_R(),r=iz(),i=az(),[a,o]=(0,N.useState)(``),[s,c]=(0,N.useState)(null),[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f=F({queryKey:Q.me,queryFn:()=>Bn(SR)}),p=F({queryKey:Q.recentProjects,queryFn:()=>qn(SR),enabled:f.isSuccess});AR(f.isSuccess);let m=yt({mutationFn:e=>Jn(SR,e),onSuccess:e=>{if(OR(t),e.disposition.kind===`opened`&&e.result?.open_url!==void 0){TR(e.result.open_url);return}n.notify({tone:`warning`,title:`Host is offline`})},onError:e=>{n.notify({tone:`error`,title:`Project open failed`,message:DR(e)})}}),h=m.mutate;(0,N.useEffect)(()=>{e===void 0||f.data?.account.profile_complete!==!0||d.current===e||(d.current=e,h(e))},[f.data?.account.profile_complete,h,e]);let g=yt({mutationFn:()=>Wn(SR),onSuccess:()=>{t.invalidateQueries({queryKey:Q.relayRoot}),t.invalidateQueries({queryKey:Q.me}),t.invalidateQueries({queryKey:Q.recentProjects})},onError:e=>{n.notify({tone:`error`,title:`Sign out failed`,message:DR(e)})}});if(f.error!==null&&Qt(f.error))return(0,P.jsx)($S,{...r,onBrandClick:()=>$(`/`)});let _=f.data?.account;if(_!==void 0&&!_.profile_complete)return(0,P.jsx)($S,{...i,onBrandClick:()=>$(`/`)});let v=(p.data?.projects??[]).map(ar);return(0,P.jsx)(dC,{account:_===void 0?null:{displayName:_.display_name},projects:v,loading:f.isLoading||p.isLoading,error:f.error===null?p.error===null?null:DR(p.error):DR(f.error),openPending:m.isPending,logoutPending:g.isPending,joinLinkForm:{value:a,error:s,onChange:e=>{o(e),c(null)},onSubmit:()=>{let e=Uz(a);if(e.kind!==`matched`){c(e.kind===`ambiguous`?`Paste one Tutti invitation at a time.`:`Paste a valid Tutti invitation.`);return}$(e.route)}},launchExpanded:l,onLaunch:()=>u(!0),onCopyLaunchCommand:e=>{navigator.clipboard.writeText(e).then(()=>{n.notify({tone:`success`,title:`Command copied`})}).catch(()=>{n.notify({tone:`error`,title:`Copy failed`,message:`The browser could not copy the launch command.`})})},onBrandClick:()=>$(`/`),onOpenProject:e=>m.mutate(e),onLogout:()=>g.mutate()})}function Gz(e){let t=e?.relay;if(t?.join_url_visibility===`visible_once`&&t.join_url!==void 0&&t.join_url.trim()!==``)return t.join_url}function Kz(e,t){try{return new URL(e).origin===new URL(t,e).origin}catch{return!1}}function qz(e,t){let n=Gz(e);if(n!==void 0)return{kind:`join`,joinUrl:n};let r=e?.relay?.relay_project_ref;return r===void 0?{kind:`unavailable`,message:`Relay project is unavailable`}:Kz(t.currentOrigin,t.relayBaseUrl)?{kind:`relay_open`,relayProjectRef:r}:{kind:`unavailable`,message:`Open the latest Join URL printed by tutti launch.`}}var Jz=`gpt-5.5`,Yz=`/host-local/v1`;function Xz(){return new URL(window.location.href).searchParams.get(`token`)?.trim()??``}function Zz(e){return{baseUrl:Yz,credentials:`same-origin`,headers:{authorization:`Bearer ${e}`}}}function Qz(e){return I(Zz(e),`/provider/config`)}function $z(e){return I(Zz(e),`/launch-status`)}function eB(e){return I(Zz(e),`/project`)}function tB(e,t){return I(Zz(e),`/project`,{method:`POST`,body:t})}function nB(e,t){return I(Zz(e),`/provider/config`,{method:`POST`,body:t})}function rB(e){return e===void 0?`loading`:e.status===`configured`?`configured`:e.status===`invalid`?`invalid`:`not configured`}function iB(e){let t=e instanceof Error&&`code`in e?String(e.code):``;return t.startsWith(`provider_`)?t:DR(e)}function aB(){let e=Xz(),t=e===``,[n,r]=(0,N.useState)({projectName:``,apiKey:``,baseUrl:``,defaultModel:Jz}),[i,a]=(0,N.useState)(null),[o,s]=(0,N.useState)(null),c=(0,N.useRef)(!1),l=F({queryKey:[`host-local`,`provider-config`,e],queryFn:()=>Qz(e),enabled:!t}),u=F({queryKey:[`host-local`,`launch-status`,e],queryFn:()=>$z(e),enabled:!t}),d=F({queryKey:[`host-local`,`project`,e],queryFn:()=>eB(e),enabled:!t}),f=u.data,p=yt({mutationFn:e=>Jn(SR,e.relayProjectRef),onSuccess:e=>{if(e.disposition.kind===`opened`&&e.result?.open_url!==void 0){TR(e.result.open_url);return}s(`Host is offline`)},onError:e=>{s(DR(e))}}),m=yt({mutationFn:async()=>{let t=n.projectName.trim(),r=d.data?.display_name.trim()??``;t!==``&&t!==r&&await tB(e,{display_name:t});let i={api_key:n.apiKey.trim()},a=n.baseUrl.trim(),o=n.defaultModel.trim();return a!==``&&(i.base_url=a),o!==``&&(i.default_model=o),await nB(e,i)},onSuccess:()=>{a(`Provider saved.`),r(e=>({...e,apiKey:``})),d.refetch(),l.refetch(),v()}}),h=l.data;(0,N.useEffect)(()=>{let e=d.data?.display_name;e!==void 0&&r(t=>t.projectName.trim()===``?{...t,projectName:e}:t)},[d.data?.display_name]),(0,N.useEffect)(()=>{t||h?.status!==`configured`||v()},[h?.status,t]);let g=t?`Setup token is missing.`:d.error===null?l.error===null?m.error===null?o:iB(m.error):iB(l.error):iB(d.error);function _(e){e.preventDefault(),a(null),s(null),c.current=!1,!t&&n.apiKey.trim()!==``&&n.projectName.trim()!==``&&m.mutate()}async function v(){if(c.current)return;c.current=!0;let e=qz(f??(await u.refetch()).data,{currentOrigin:window.location.origin,relayBaseUrl:xR});if(e.kind===`join`){window.location.assign(e.joinUrl);return}if(e.kind===`unavailable`){s(e.message);return}p.mutate({relayProjectRef:e.relayProjectRef})}return(0,P.jsx)(pC,{form:n,statusLabel:rB(h),configured:h?.status===`configured`,loading:l.isLoading||d.isLoading,pending:m.isPending,tokenMissing:t,error:g,success:i,openProjectPending:p.isPending,onChange:e=>r(t=>({...t,...e})),onSubmit:_,onRetry:()=>void l.refetch(),onBrandClick:()=>$(`/`)})}function oB(e){return`${e.created_at}:${e.id}`}function sB(e){return{kind:`initial`,entry:e}}function cB(e,t=50){if(e.kind===`older`)return{before:e.before,limit:t};if(e.kind===`newer`)return{after:e.after,limit:t};switch(e.entry.kind){case`latest`:return{limit:t};case`start`:return{anchor:`start`,limit:t};case`around`:return{around:e.entry.messageId,limit:t}}}function lB(e){let t=e.window.older_cursor;return e.window.has_older&&t!==void 0?{kind:`older`,before:t}:void 0}function uB(e){let t=e.window.newer_cursor;return e.window.has_newer&&t!==void 0?{kind:`newer`,after:t}:void 0}function dB(e,t=50){let n=e[0],r=e.at(-1);if(n===void 0||r===void 0)return{items:[],window:{has_older:!1,has_newer:!1,limit:t}};let i=new Map;for(let t of e)for(let e of t.items)i.set(e.id,e);let a=[...i.values()].sort((e,t)=>oB(e).localeCompare(oB(t))),o={has_older:n.window.has_older,has_newer:r.window.has_newer,limit:n.window.limit};return o.has_older&&n.window.older_cursor!==void 0&&(o.older_cursor=n.window.older_cursor),o.has_newer&&r.window.newer_cursor!==void 0&&(o.newer_cursor=r.window.newer_cursor),{items:a,window:o}}var fB=5400,pB=1500;function mB(e){let t=e.completionSource;return t?.activityRef??t?.workflowRef??t?.taskId??e.key}function hB(e){switch(e.kind){case`accepted`:case`already_running`:return null;case`scratchpad_empty`:return{label:`Scratchpad is empty. Let it refresh before running.`,tone:`error`};case`stale_scratchpad`:return{label:`Scratchpad changed. Review the latest snapshot and run again.`,tone:`error`};case`provider_not_configured`:return{label:`Provider is not configured yet.`,tone:`error`};case`provider_unavailable`:return{label:`Provider unavailable: ${e.reason}.`,tone:`error`};case`interrupted`:return{label:`Run was interrupted. Try again.`,tone:`error`}}}function gB(e,t){t.displayName.trim()===``||e.has(t.key)||e.set(t.key,t)}function _B(e){if(e.author.kind!==`human`)return null;let t=e.author.display_name?.trim()||`Member`;return{key:e.author.ref===void 0?`message-author:${t.toLocaleLowerCase()}`:e.author.ref,displayName:t,avatar:e.author.avatar??{kind:`initials`,initials:dr(t),color:`blue`}}}function vB({account:e,presence:t,messages:n=[]}){let r=new Map;e!==void 0&&gB(r,{key:e.account_ref,displayName:e.display_name,avatar:e.avatar});for(let e of t?.sample_members??[])gB(r,{key:e.account_ref,displayName:e.display_name,avatar:e.avatar});for(let e of t?.members??[])gB(r,{key:e.account_ref,displayName:e.display_name,avatar:e.avatar});for(let e of n){let t=_B(e);t!==null&&gB(r,t)}return[...r.values()]}function yB({account:e,presence:t}){let n={},r=(e,t)=>{let r=n[e];n[e]={avatar:t.avatar,online:r?.online===!0||t.online}};for(let e of t?.members??[])r(e.account_ref,{avatar:e.avatar,online:e.online});for(let e of t?.sample_members??[])r(e.account_ref,{avatar:e.avatar,online:!0});return e!==void 0&&r(e.account_ref,{avatar:e.avatar,online:!0}),n}function bB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),[i,a]=(0,N.useState)(``),[o,s]=(0,N.useState)(``),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)(()=>Date.now()),[g,_]=(0,N.useState)(null),v=new URL(wR(),window.location.origin).searchParams.get(`message`),y=v!==null&&Vt(v,Lt.message)?v:void 0,[b,x]=(0,N.useState)(()=>y===void 0?{kind:`latest`}:{kind:`around`,messageId:y}),S=(0,N.useRef)(null),C=(0,N.useRef)(null),w=(0,N.useRef)(null),[T,E]=(0,N.useState)(null),ee=u!==null;(0,N.useEffect)(()=>{y!==void 0&&(b.kind!==`around`||b.messageId!==y)&&x({kind:`around`,messageId:y})},[b,y]);let D=(t=null)=>{x({kind:`latest`}),_(t),y!==void 0&&$(rn(e),{replace:!0})},O=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap(),staleTime:CR}),k=O.data?.session.account.account_ref,te=k===void 0?null:`${k}:${e}`,ne=y!==void 0||te!==null&&T===te;(0,N.useEffect)(()=>{te===null||T===te||(y===void 0&&k!==void 0&&x(pz(k,e).start_chat_pending?{kind:`start`}:{kind:`latest`}),E(te))},[k,te,e,y,T]);let A=bt({queryKey:Q.messageHistory(e,b,50),queryFn:({pageParam:e})=>r.getMessages(cB(e)),initialPageParam:sB(b),getPreviousPageParam:e=>lB(e),getNextPageParam:e=>uB(e),enabled:O.isSuccess&&ne,staleTime:CR}),re=F({queryKey:Q.scratchpad(e),queryFn:()=>r.getScratchpad(),enabled:O.isSuccess,staleTime:CR,refetchInterval:ee?pB:!1}),ie=F({queryKey:Q.activeClarification(e),queryFn:()=>r.getActiveClarification(),enabled:O.isSuccess,staleTime:CR,refetchInterval:ee?pB:!1}),j=F({queryKey:Q.activeApproval(e),queryFn:()=>r.getActiveApproval(),enabled:O.isSuccess,staleTime:CR}),M=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:O.isSuccess,staleTime:CR,refetchInterval:ee?pB:!1}),ae=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:O.isSuccess,staleTime:CR}),oe=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:O.isSuccess,staleTime:CR}),se=F({queryKey:Q.projectPresence(e),queryFn:()=>Yn(SR,e),enabled:O.isSuccess,staleTime:CR,refetchInterval:6e4});AR(O.isSuccess);let ce=yt({mutationFn:e=>r.updateProjectDisplayName({display_name:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project name`,message:e}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project name saved`,message:i})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project name save failed`,message:`${t}: ${DR(e)}`})}}),le=yt({mutationFn:e=>r.updateProjectDescription({description:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project description`,...e.length===0?{}:{message:e}}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project description saved`,...i.length===0?{}:{message:i}})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project description save failed`,message:DR(e)})}}),ue=yt({mutationFn:({body:e,commandId:t})=>r.sendMainChatMessage({body:e},{commandId:t}),onSuccess:(n,r)=>{S.current=null,a(e=>e.trim()===r.body?``:e),n.result?.message!==void 0&&(b.kind===`latest`&&!A.hasNextPage?_(n.result.message.id):D(n.result.message.id)),jR(t,e,n.invalidates)},onError:e=>{n.notify({tone:`error`,title:`Message send failed`,message:DR(e)})}}),de=yt({mutationFn:async t=>{let n=await rz({relayProjectRef:e,purpose:`reference_file`,file:t});return r.uploadReferenceFile(n)},onMutate:e=>n.notify({tone:`loading`,title:`Uploading reference`,message:e.name}),onSuccess:(r,i,a)=>{let o=r.result?.message;o!==void 0&&(b.kind===`latest`&&!A.hasNextPage?_(o.id):D(o.id)),jR(t,e,r.invalidates),n.update(a,{tone:`success`,title:`Reference uploaded`,message:r.result?.file.name??i.name})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Reference upload failed`,message:DR(e)})}}),fe=yt({mutationFn:e=>r.submitWorklist(e===void 0?{}:{expected_scratchpad_updated_at:e}),onMutate:()=>(d({kind:`request`}),n.notify({tone:`loading`,title:`Running Scratchpad`})),onSuccess:(r,i,a)=>{if(r.disposition.kind===`accepted`){let e=r.result?.activity_ref;d(e===void 0?null:{kind:`activity`,activityRef:e,...r.result?.workflow_ref===void 0?{}:{workflowRef:r.result.workflow_ref}}),n.update(a,{tone:`success`,title:`Scratchpad run started`,message:`Tutti is preparing Worklist tasks.`})}else if(r.disposition.kind===`already_running`)d(null),n.update(a,{tone:`info`,title:`Already running`,message:`Tutti is already processing work.`});else{d(null);let e=hB(r.disposition);n.update(a,{tone:e?.tone??`warning`,title:`Scratchpad run blocked`,...e?.label===void 0?{}:{message:e.label}})}jR(t,e,r.invalidates)},onError:(e,t,r)=>{d(null),n.update(r,{tone:`error`,title:`Scratchpad run failed`,message:DR(e)})}}),pe=O.data,me=yB({account:pe?.session.account,presence:se.data?.presence}),he=pe?.generated_at??new Date(0).toISOString(),ge=A.data===void 0?void 0:dB(A.data.pages,50),_e=ge??(ne&&b.kind===`latest`?pe?.snapshots.main_chat:void 0)??MR(),ve=A.data!==void 0&&A.hasPreviousPage===!0,ye=A.data!==void 0&&A.hasNextPage===!0,be=b.kind===`latest`||b.kind===`start`&&!ye||b.kind===`around`&&_e.items.length>0&&!ye,xe=b.kind===`around`?`around:${b.messageId}`:b.kind,Se=b.kind===`around`?`focus`:b.kind===`start`?`start`:`latest`,Ce=pe!==void 0&&(!ne||ge===void 0&&A.isLoading&&(b.kind!==`latest`||pe.snapshots.main_chat===void 0)),we=re.data??pe?.snapshots.scratchpad??PR(),Te=ae.data??pe?.snapshots.read_state;LR({enabled:O.isSuccess,hostClient:r,relayProjectRef:e,readState:Te,scope:`chat`});let Ee=ie.data??pe?.snapshots.active_clarification??RR(),De=j.data??pe?.snapshots.active_approval??{state:`none`},Oe=Ee.state===`active`?Ee.round.id:void 0;(0,N.useEffect)(()=>{c!==null&&(Oe===void 0||c!==Oe)&&l(null)},[Oe,c]);let ke=Ee.state===`active`&&Ee.thread.owner.kind===`task_compile`,Ae=(0,N.useMemo)(()=>{let e=new Set;for(let t of _e.items)t.clarification_card!==void 0&&e.add(t.clarification_card.round_id);return Oe!==void 0&&e.add(Oe),[...e]},[Oe,_e.items]),je=_t({queries:Ae.map(t=>({queryKey:Q.clarificationRoundMessages(e,t),queryFn:()=>r.getClarificationRoundMessages(t,{anchor:`start`,limit:50}),enabled:O.isSuccess}))}),Me=yt({mutationFn:({roundId:e,body:t})=>r.sendClarificationRoundMessage(e,{body:t}),onSuccess:n=>{s(``),jR(t,e,n.invalidates)},onError:e=>{n.notify({tone:`error`,title:`Reply send failed`,message:DR(e)})}}),Ne=yt({mutationFn:e=>r.submitClarificationRound(e),onMutate:e=>(l(e),n.notify({tone:`loading`,title:`Submitting reply`})),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates),n.update(a,{tone:`success`,title:`Reply submitted`})},onError:(e,t,r)=>{l(e=>e===t?null:e),n.update(r,{tone:`error`,title:`Reply submit failed`,message:DR(e)})}}),Pe=yt({mutationFn:({approvalId:e,decisionId:t})=>r.decideApproval(e,{decision_id:t}),onMutate:()=>n.notify({tone:`loading`,title:`Sending decision`}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates),n.update(a,{tone:`success`,title:`Decision sent`})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Decision failed`,message:DR(e)})}}),Fe=Object.fromEntries(Ae.map((e,t)=>[e,(je[t]?.data??MR()).items.map(e=>_r(e,{authorProfiles:me}))])),Ie=vB({account:pe?.session.account,presence:se.data?.presence,messages:[..._e.items,...je.flatMap(e=>e.data?.items??[])]}),Le=M.data??pe?.snapshots.execution_status??zR(he),Re=BR(Le),ze=VR(Le,`scratchpad_refresh`),Be=VR(Le,`scratchpad_refresh`,`foreground`),Ve=VR(Le,`task_compile`,`foreground`),He=VR(Le,`project_context_bootstrap`,`foreground`),Ue=u?.kind===`activity`?u.activityRef:void 0,We=u?.kind===`activity`?u.workflowRef:void 0;(0,N.useEffect)(()=>{if(u===null)return;if(we.state===`submitted`){d(null);return}if(we.state===`empty`){d(null);return}if(Le.status===`pending`){ke||d(null);return}let e=Le.last_conclusion,t=We!==void 0&&e?.workflow_ref===We,r=Ue!==void 0&&e?.activity_ref===Ue;if(!(!t&&!r)){if(d(null),e?.kind===`failed`){n.notify({tone:`error`,title:`Scratchpad run failed`,message:e.summary});return}if(e?.kind===`needs_human`){n.notify({tone:`warning`,title:`Scratchpad needs input`,message:e.summary});return}}},[Le.last_conclusion?.activity_ref,Le.last_conclusion?.kind,Le.last_conclusion?.summary,Le.last_conclusion?.workflow_ref,Le.status,Le.summary,ke,n,we.state,u,Ue,We]);let Ge=Ue!==void 0&&Re.some(e=>e.activity_ref===Ue),Ke=Ge&&Re.some(e=>e.activity_ref===Ue&&e.workflow_kind===`scratchpad_refresh`)||u!==null&&Be,qe=Ve||He||Ke||Ge||ke,Je=ze,Ye=fe.isPending||qe||u!==null&&Le.status===`idle`,Xe=Le.status!==`idle`||Ye||f!==null;(0,N.useEffect)(()=>{if(!Xe)return;h(Date.now());let e=window.setInterval(()=>{h(Date.now())},1e3);return()=>{window.clearInterval(e)}},[Xe]);let Ze=Re.some(e=>e.activity_kind===`procedure`&&(e.lane??`foreground`)===`foreground`)&&!Je&&!Ye,Qe=bS(Le),$e={key:`scratchpad-submit`,label:ke?`Needs input`:Ke?`Compiling Worklist tasks`:He?`Preparing project context`:Ve?`Compiling Worklist tasks`:`Preparing Worklist`,title:ke?`Needs input`:`Preparing Scratchpad for Worklist.`,tone:ke?`pending`:`running`,target:ke?{kind:`clarification`}:{kind:`scratchpad`}},et=Ye&&Qe.length===0?[$e]:Qe,tt=gS(Le,{now:m}),nt=Re.find(e=>(e.lane??`foreground`)===`foreground`?e.workflow_kind===`project_context_bootstrap`&&He||e.workflow_kind===`task_compile`&&Ve||e.workflow_kind===`scratchpad_refresh`&&Ke?!0:Ue!==void 0&&e.activity_ref===Ue:!1),it=(Ye?_S({activeScratchpadRefreshFromSubmit:Ke,activeProjectContextBootstrap:He,activeTaskCompile:Ve,activeTaskCompileClarification:ke,now:m,...nt?.started_at===void 0?{}:{startedAt:nt.started_at},...Le.runtime===void 0?{}:{runtime:Le.runtime}}):null)??tt;(0,N.useEffect)(()=>{it!==null&&(C.current=it,p(null))},[it]),(0,N.useEffect)(()=>{if(!ze||it!==null)return;let e=C.current;if(e?.completionSource===void 0)return;let t=`hidden:${mB(e)}`;if(w.current===t)return;w.current=t;let n=vS(e,e.summary);p(n),C.current=null;let r=window.setTimeout(()=>{p(e=>e?.key===n.key?null:e)},fB);return()=>{window.clearTimeout(r)}},[it,ze]),(0,N.useEffect)(()=>{if(it!==null||Le.status!==`idle`)return;let e=Le.last_conclusion;if(e?.kind!==`completed`)return;let t=e.activity_ref??`${e.kind}:${e.task_id??`none`}:${e.occurred_at}`;if(w.current===t)return;let n=C.current;if(n===null)return;if(!yS(n,e)){C.current=null;return}w.current=t;let r=vS(n,e.summary);p(r);let i=window.setTimeout(()=>{p(e=>e?.key===r.key?null:e),C.current=null},fB);return()=>{window.clearTimeout(i)}},[it,Le.last_conclusion?.activity_ref,Le.last_conclusion?.kind,Le.last_conclusion?.occurred_at,Le.last_conclusion?.summary,Le.last_conclusion?.task_id,Le.status]);let at=it??f,ot=f===null?null:{key:`completed`,label:`Completed`,tone:`done`,target:f.completionTarget??{kind:`scratchpad`}},st=ot===null?et:[ot,...et],ct=e=>{e.preventDefault();let t=i.trim();if(t!==``&&!ue.isPending){let e=S.current?.body===t?S.current:{body:t,commandId:Wt()};S.current=e,ue.mutate(e)}},lt=e=>{e.preventDefault();let t=o.trim();t!==``&&Oe!==void 0&&!Me.isPending&&Me.mutate({roundId:Oe,body:t})},ut=ne&&ge===void 0&&A.error!==null&&(b.kind!==`latest`||pe?.snapshots.main_chat===void 0),dt=pe===void 0&&O.error!==null||ut;return(0,N.useEffect)(()=>{y!==void 0&&_(y)},[y]),(0,P.jsx)($C,{projectName:pe?.workspace.project.display_name??`Workspace`,projectDescription:pe?.workspace.project.description??``,members:Ie,messages:_e.items.map(e=>_r(e,{authorProfiles:me,referenceAssetUrl:(e,t,n)=>r.viewerAssetUrl({path:e,variant:t,v:n})})),scratchpad:Nr(we,_e.items),executionProgress:at,activeApproval:Sr(De),activeClarification:vr(Ee),clarificationMessagesByRoundId:Fe,statusShortcuts:st,unread:FR(Te),artifactSignal:IR(oe.data),draft:i,roundDraft:o,sendPending:ue.isPending,focusMessageId:g,messageHistoryIdentity:xe,initialMessagePosition:Se,hasOlderMessages:ve,hasNewerMessages:ye,loadingOlderMessages:A.isFetchingPreviousPage,loadingNewerMessages:A.isFetchingNextPage,historyConnectedToLatest:be,submittedRoundId:c,referenceUploadPending:de.isPending,scratchpadSyncPending:Je,scratchpadActionsDisabled:Ze,scratchpadSubmitPending:Ye,roundSendPending:Me.isPending,roundSubmitPending:Ne.isPending,approvalDecisionPending:Pe.isPending,projectNameSaving:ce.isPending,projectDescriptionSaving:le.isPending,loading:pe===void 0&&O.isLoading||Ce,unavailable:dt,onDraftChange:e=>{S.current?.body!==e.trim()&&(S.current=null),a(e)},onMessageFocused:()=>_(null),onInitialMessagePositioned:()=>{b.kind===`start`&&A.isSuccess&&k!==void 0&&gz(k,e)},onLoadOlderMessages:()=>{A.fetchPreviousPage()},onLoadNewerMessages:()=>{A.fetchNextPage()},onJumpToLatest:()=>D(),onUploadReferenceFile:e=>de.mutate(e),onOpenReferenceFile:t=>$(HR(e,t)),onRoundDraftChange:s,onSendMessage:ct,onSendRoundMessage:lt,onSubmitRound:()=>{Oe!==void 0&&Ne.mutate(Oe)},onDecideApproval:(e,t)=>Pe.mutate({approvalId:e,decisionId:t}),onSubmitScratchpad:()=>fe.mutate(we.updated_at),onUpdateProjectDisplayName:async e=>{await ce.mutateAsync(e)},onUpdateProjectDescription:async e=>{await le.mutateAsync(e)},onOpenProjectCenter:()=>$(`/projects`),onOpenWorklist:()=>$(WR(e)),onOpenWorklistTask:t=>$(WR(e,t)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t)})}function xB(e){return Qt(e)?Zt(e,`relay_session_invalid`)?`client_session`:`account_session`:null}function SB(e){return e===`client_session`?{title:`Workspace session expired`,message:`Open the project again from Project Center.`}:{title:`Sign in required`,message:`Sign in to Tutti before opening this workspace.`}}function CB(e){return e===`client_session`?`/projects`:`/`}function wB({relayProjectRef:e,children:t}){let n=rt(),r=_R(),i=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),a=(0,N.useRef)(void 0),o=(0,N.useRef)(null),s=F({queryKey:Q.bootstrap(e),queryFn:()=>i.getBootstrap(),staleTime:CR}),c=xB(s.error),l=c===null&&s.data?.workspace.capabilities.sse===!0;return a.current===void 0&&s.data!==void 0&&(a.current=s.data.event_cursor),(0,N.useEffect)(()=>{if(c===null)return;let t=`${e}:${c}`;o.current!==t&&(o.current=t,r.notify({tone:`warning`,...SB(c)}),$(CB(c),{replace:!0}))},[c,r,e]),(0,N.useEffect)(()=>{if(!l)return;let t=i.connectEvents({...a.current===void 0?{}:{after:a.current},onReady:t=>{t.payload.replay.status===`missed`&&n.invalidateQueries({queryKey:Q.hostRoot(e)})},onInvalidate:t=>{jR(n,e,t)},onError:()=>void 0});return()=>t.close()},[i,n,e,l]),c===null?t:null}function TB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap(),staleTime:CR}).data?.session.account.account_ref,r=n===void 0?null:`${n}:${e}`,[i,a]=(0,N.useState)({identity:null,pending:!1}),[o,s]=(0,N.useState)(!1),c=Vd();(0,N.useEffect)(()=>{n===void 0||r===null||i.identity===r||a({identity:r,pending:pz(n,e).tour_pending})},[n,r,i.identity,e]);let l=t=>{_z(t,e),a({identity:r,pending:!1})};return(0,P.jsxs)(P.Fragment,{children:[c&&r!==null&&i.identity===r&&i.pending&&n!==void 0&&typeof document<`u`?(0,vc.createPortal)((0,P.jsx)(Jd,{onOpen:()=>{l(n),s(!0)},onDismiss:()=>l(n)}),document.body):null,(0,P.jsx)(Yd,{assets:FS,open:o,onOpenChange:s})]})}var EB=2e4,DB=3e4;function OB(e){let t=e.intervalMs??EB,n=e.setIntervalFn??window.setInterval.bind(window),r=e.clearIntervalFn??window.clearInterval.bind(window),i=!0,a=!1,o=!1,s=()=>{!i||a||(a=!0,e.renew().then(()=>{i&&!o&&(o=!0,e.onInitialRenewed?.())}).catch(()=>void 0).finally(()=>{a=!1}))};s();let c=n(s,t);return()=>{i=!1,r(c)}}function kB(e,t,n={}){let r=n.runActive??!1;if(e===void 0)return r?{status:`updating`}:{status:`loading`};if(e.status===`not_declared`)return r?{status:`updating`}:{status:`not_declared`};if(e.status===`invalid`)return r?{status:`updating`}:{status:`invalid`,message:e.error.message};let i={status:`declared`,title:e.artifact.title,previewStatus:e.preview.status,...e.preview.error_message===void 0?{}:{errorMessage:e.preview.error_message}};return e.preview.status===`ready`?t.previewUrl===void 0?r?{status:`updating`}:t.errorMessage===void 0?{...i,previewStatus:t.pending?`starting`:`failed`,...t.pending?{}:{errorMessage:`Preview session is unavailable`}}:{...i,previewStatus:`failed`,errorMessage:t.errorMessage}:{...i,previewUrl:t.previewUrl}:r?{status:`updating`}:i}function AB(e){if(!(e===void 0||e.disposition.kind===`issued`))return e.disposition.kind===`invalid_manifest`?e.disposition.message:e.disposition.kind===`preview_not_ready`?e.disposition.message??`Preview is not ready`:e.disposition.kind===`not_declared`?`Artifact is no longer declared`:`Preview session expired before it could be opened`}function jB(e){return e===void 0?!1:e.disposition.kind!==`issued`||e.result===void 0?e.disposition.kind===`preview_not_ready`||e.disposition.kind===`interrupted`?1e3:!1:Math.max(1e3,Date.parse(e.result.expires_at)-Date.now()-DB)}function MB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=(0,N.useMemo)(()=>zn(SR),[]),r=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap(),staleTime:CR}),i=F({queryKey:Q.artifacts(e),queryFn:()=>t.getArtifacts(),enabled:r.isSuccess,staleTime:CR}),a=F({queryKey:Q.executionStatus(e),queryFn:()=>t.getExecutionStatus(),enabled:r.isSuccess,staleTime:CR}),o=F({queryKey:Q.readState(e),queryFn:()=>t.getReadState(),enabled:r.isSuccess,staleTime:CR}),s=r.data,c=s?.generated_at??new Date(0).toISOString(),l=o.data??s?.snapshots.read_state,u=a.data??s?.snapshots.execution_status??zR(c),d=u.active_activity?.activity_kind===`run`||u.active_activities?.some(e=>e.activity_kind===`run`)===!0,f=i.data?.artifact,p=f?.status===`declared`&&f.preview.status===`ready`&&f.preview.url!==void 0?f.preview.url:null,m=F({queryKey:Q.artifactPreviewSession(e,p??`not-ready`),queryFn:()=>n.issueArtifactPreviewSession(e),enabled:p!==null,staleTime:1/0,retry:1,refetchInterval:e=>jB(e.state.data)}),h=m.data,g=h?.disposition.kind===`issued`?h.result?.bootstrap_url:void 0,_=m.error===null?AB(h):DR(m.error);(0,N.useEffect)(()=>{if(r.isSuccess)return OB({renew:()=>t.renewArtifactPreviewLease(),onInitialRenewed:()=>{i.refetch()}})},[i.refetch,r.isSuccess,t]);let v=i.data!==void 0,y=!v&&(r.error!==null||i.error!==null);return(0,P.jsx)(ew,{statusShortcuts:bS(u),unread:FR(l),artifactSignal:IR(i.data),state:kB(i.data?.artifact,{...g===void 0?{}:{previewUrl:g},pending:p!==null&&g===void 0&&_===void 0,..._===void 0?{}:{errorMessage:_}},{runActive:d}),loading:!v&&(r.isLoading||i.isLoading),unavailable:y,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t)})}function NB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),i=new URL(wR(),window.location.origin).searchParams.get(`path`)??void 0,[a,o]=(0,N.useState)(i),[s,c]=(0,N.useState)(`time`),l=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap(),staleTime:CR}),u=F({queryKey:Q.referenceFiles(e),queryFn:()=>r.getReferenceFiles({limit:200}),enabled:l.isSuccess,staleTime:CR}),d=F({queryKey:Q.messagesWindow(e,200),queryFn:()=>r.getMessages({limit:200}),enabled:l.isSuccess,staleTime:CR}),f=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:l.isSuccess,staleTime:CR}),p=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:l.isSuccess,staleTime:CR}),m=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:l.isSuccess,staleTime:CR}),h=u.data?.items??[],g=(0,N.useMemo)(()=>{let e=new Map;for(let t of d.data?.items??[]){let n=t.refs?.reference_file;if(n===void 0)continue;let r=e.get(n.path);(r===void 0||t.created_at>r)&&e.set(n.path,t.created_at)}return e},[d.data?.items]),_=(0,N.useMemo)(()=>{let e=(e,t)=>e.name.localeCompare(t.name),t=(t,n)=>{let r=g.get(t.path)??``,i=g.get(n.path)??``;return r===i?e(t,n):i.localeCompare(r)},n=(e,n)=>{let r=e.extension??e.media_type??`file`,i=n.extension??n.media_type??`file`;return r===i?t(e,n):r.localeCompare(i)},r=[...h.filter(e=>e.category===`image`&&e.source===`human_upload`)].sort(t),i=[...h.filter(e=>!(e.category===`image`&&e.source===`human_upload`))].sort(s===`time`?t:n);return[...r,...i]},[s,h,g]);(0,N.useEffect)(()=>{if(_.length===0){a!==void 0&&o(void 0);return}if(i!==void 0&&_.some(e=>e.path===i)){a!==i&&o(i);return}(a===void 0||!_.some(e=>e.path===a))&&o(_[0]?.path)},[_,i,a]);let v=h.find(e=>e.path===a),y=v?.category===`image`,b=v?.text_read.can_read===!0,x=F({queryKey:a===void 0?Q.viewerFile(e,`none`):Q.viewerFile(e,a),queryFn:()=>r.getViewerFile({path:a,max_bytes:204800}),enabled:l.isSuccess&&a!==void 0&&b&&!y,staleTime:CR}),S=yt({mutationFn:async t=>{let n=await rz({relayProjectRef:e,purpose:`reference_file`,file:t});return r.uploadReferenceFile(n)},onMutate:e=>n.notify({tone:`loading`,title:`Uploading reference`,message:e.name}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates),r.result?.file.path!==void 0&&(o(r.result.file.path),$(HR(e,r.result.file.path))),n.update(a,{tone:`success`,title:`Reference uploaded`,message:r.result?.file.name??i.name})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Reference upload failed`,message:DR(e)||t.name})}}),C=l.data,w=C?.generated_at??new Date(0).toISOString(),T=p.data??C?.snapshots.read_state;LR({enabled:l.isSuccess,hostClient:r,relayProjectRef:e,readState:T,scope:`references`});let E=f.data??C?.snapshots.execution_status??zR(w),ee=_.map(e=>{let t=IB(e,u.data?.directory.tutti_path);return{path:e.path,name:e.name,meta:FB(e),source:e.source,...t===void 0?{}:{generatedGroup:t},selected:e.path===a,canPreview:e.text_read.can_read,category:e.category,...e.category===`image`&&e.source===`human_upload`?{...e.blob_oid===void 0?{}:{thumbnailUrl:r.viewerAssetUrl({path:e.path,variant:`thumbnail`,v:e.blob_oid})}}:{},...e.extension===void 0?{}:{extension:e.extension}}}),D=x.data?.content,O=(()=>{if(v===void 0)return{title:h.length===0?`No reference files`:`No file selected`,unavailableReason:h.length===0?`No reference files`:`Select a reference file`};if(D?.kind===`text`)return{title:v.name,meta:QR(v.size_bytes),...PB(v),content:D.text};if(y&&a!==void 0)return v.blob_oid===void 0?{title:v.name,meta:QR(v.size_bytes),...PB(v),unavailableReason:`Image version unavailable`}:{title:v.name,meta:QR(v.size_bytes),...PB(v),imageUrl:r.viewerAssetUrl({path:a,variant:`preview`,v:v.blob_oid})};let e=b&&x.isLoading?`Loading`:ez(D)??(b?void 0:$R(v.text_read.blocked_reason));return e===void 0?{title:v.name,meta:QR(v.size_bytes),...PB(v)}:{title:v.name,meta:QR(v.size_bytes),...PB(v),unavailableReason:e}})(),k=u.data!==void 0,te=!k&&(l.error!==null||u.error!==null);return(0,P.jsx)(tw,{statusShortcuts:bS(E),unread:FR(T),artifactSignal:IR(m.data),files:ee,detail:O,uploadPending:S.isPending,fileSortMode:s,loading:!k&&(l.isLoading||u.isLoading),unavailable:te,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t),onSelectFile:t=>{o(t),$(HR(e,t))},onUploadFile:e=>S.mutate(e),onFileSortModeChange:c})}function PB(e){let t=e.summary;return t===void 0||t.status===`missing`?{summaryStatus:`Summary not available yet`}:t.status===`stale`?{...t.text===void 0?{}:{summary:t.text},summaryStatus:`Summary may be out of date`}:t.status===`unavailable`?{...t.text===void 0?{}:{summary:t.text},summaryStatus:`Summary could not be generated`}:t.text===void 0?{summaryStatus:`Summary unavailable`}:{summary:t.text}}function FB(e){let t=e.source===`tutti_output`?`Tutti`:`Uploaded`;if(e.category===`image`)return[t,e.media_type??`Image`,QR(e.size_bytes)].join(` · `);let n=[t,QR(e.size_bytes)];return e.text_read.can_read||n.push($R(e.text_read.blocked_reason)),n.join(` · `)}function IB(e,t){if(e.source!==`tutti_output`||t===void 0)return;let n=`${t}/`;if(!e.path.startsWith(n))return;let[r,i]=e.path.slice(n.length).split(`/`);if(!(r===void 0||r.length===0||i===void 0))return r}function LB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),i=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap()}),a=F({queryKey:Q.hostWorkspace(e),queryFn:()=>r.getWorkspace(),enabled:i.isSuccess}),o=F({queryKey:Q.hostSession(e),queryFn:()=>r.getSession(),enabled:i.isSuccess}),s=F({queryKey:Q.providerConfig(e),queryFn:()=>r.getProviderConfig(),enabled:i.isSuccess}),c=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:i.isSuccess}),l=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:i.isSuccess}),u=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:i.isSuccess}),d=yt({mutationFn:e=>r.updateProjectDisplayName({display_name:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project name`,message:e}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project name saved`,message:i})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project name save failed`,message:`${t}: ${DR(e)}`})}}),f=yt({mutationFn:e=>r.updateProjectDescription({description:e}),onMutate:e=>n.notify({tone:`loading`,title:`Saving project description`,...e.length===0?{}:{message:e}}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates??[{kind:`workspace`},{kind:`bootstrap`}]),n.update(a,{tone:`success`,title:`Project description saved`,...i.length===0?{}:{message:i}})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Project description save failed`,message:DR(e)})}}),p=i.data,m=p?.generated_at??new Date(0).toISOString(),h=l.data??p?.snapshots.read_state,g=a.data??p?.workspace,_=o.data??p?.session,v=s.data??p?.provider_config,y=c.data??p?.snapshots.execution_status??zR(m),b=g===void 0||_===void 0||v===void 0?void 0:Jr(g,_,v),x=b===void 0&&(i.error!==null||a.error!==null||o.error!==null||s.error!==null),S=g?.relay.join_url,C=S===void 0||g===void 0||_===void 0?void 0:Oz({inviterName:_.account.display_name,projectName:g.project.display_name,joinUrl:S});return(0,P.jsx)(fw,{...b===void 0?{}:{settings:b},statusShortcuts:bS(y),unread:FR(h),artifactSignal:IR(u.data),loading:b===void 0&&(i.isLoading||a.isLoading||o.isLoading||s.isLoading),unavailable:x,projectNameSaving:d.isPending,projectDescriptionSaving:f.isPending,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onActivateStatusShortcut:t=>XR(e,t),...C===void 0?{}:{onCopyJoinUrl:()=>{navigator.clipboard.writeText(C).then(()=>{n.notify({tone:`success`,title:`Invitation copied`})}).catch(()=>{n.notify({tone:`error`,title:`Copy failed`,message:`The browser could not copy the invite link.`})})}},onUpdateProjectDisplayName:async e=>{await d.mutateAsync(e)},onUpdateProjectDescription:async e=>{await f.mutateAsync(e)}})}function RB({relayProjectRef:e}){let t=rt(),n=_R(),r=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),i=new URL(wR(),window.location.origin).searchParams.get(`skill`)??void 0,[a,o]=(0,N.useState)(i),s=F({queryKey:Q.bootstrap(e),queryFn:()=>r.getBootstrap(),staleTime:CR}),c=F({queryKey:Q.skills(e),queryFn:()=>r.getSkills(),enabled:s.isSuccess,staleTime:CR}),l=F({queryKey:Q.executionStatus(e),queryFn:()=>r.getExecutionStatus(),enabled:s.isSuccess,staleTime:CR}),u=F({queryKey:Q.readState(e),queryFn:()=>r.getReadState(),enabled:s.isSuccess,staleTime:CR}),d=F({queryKey:Q.artifacts(e),queryFn:()=>r.getArtifacts(),enabled:s.isSuccess,staleTime:CR}),f=c.data?.items??[];(0,N.useEffect)(()=>{if(f.length===0){a!==void 0&&o(void 0);return}if(i!==void 0&&f.some(e=>e.name===i)){a!==i&&o(i);return}(a===void 0||!f.some(e=>e.name===a))&&o(f[0]?.name)},[i,a,f]);let p=F({queryKey:a===void 0?Q.skillDetail(e,`none`):Q.skillDetail(e,a),queryFn:()=>r.getSkill(a),enabled:s.isSuccess&&a!==void 0,staleTime:CR}),m=yt({mutationFn:async t=>{let n=await rz({relayProjectRef:e,purpose:`skill_zip`,file:t});return r.importSkillZip(n)},onMutate:e=>n.notify({tone:`loading`,title:`Uploading skill`,message:e.name}),onSuccess:(r,i,a)=>{jR(t,e,r.invalidates);let s=r.result?.skill.name??(r.disposition.kind===`created`||r.disposition.kind===`replaced`?r.disposition.skill_name:void 0);s!==void 0&&(o(s),$(JR(e,s))),n.update(a,{tone:`success`,title:`Skill installed`,message:s??i.name})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Skill upload failed`,message:DR(e)})}}),h=yt({mutationFn:e=>r.deleteSkill({skill_name:e}),onMutate:e=>n.notify({tone:`loading`,title:`Deleting skill`,message:e}),onSuccess:(r,i,s)=>{jR(t,e,r.invalidates);let c=r.disposition.kind===`deleted`||r.disposition.kind===`not_found`?r.disposition.skill_name:a,l=f.find(e=>e.name!==c);o(l?.name),$(l===void 0?JR(e):JR(e,l.name)),n.update(s,{tone:`success`,title:`Skill deleted`,message:c??i})},onError:(e,t,r)=>{n.update(r,{tone:`error`,title:`Skill delete failed`,message:`${t}: ${DR(e)}`})}}),g=s.data,_=g?.generated_at??new Date(0).toISOString(),v=u.data??g?.snapshots.read_state;LR({enabled:s.isSuccess,hostClient:r,relayProjectRef:e,readState:v,scope:`skills`});let y=l.data??g?.snapshots.execution_status??zR(_),b=f.map(e=>({name:e.name,description:e.description,...e.short_description===void 0?{}:{shortDescription:e.short_description},selected:e.name===a,...e.updated_at===void 0?{}:{updatedLabel:`Updated ${Zn(e.updated_at)}`}})),x=f.find(e=>e.name===a),S=(()=>{let e=p.data?.skill;return e===void 0?a===void 0?{title:f.length===0?`No skills`:`No skill selected`,unavailableReason:f.length===0?`No user skills`:`Select a skill`}:{title:x?.name??a,...x?.description===void 0?{}:{description:x.description},unavailableReason:p.isLoading?`Loading`:`Skill unavailable`}:{title:e.name,description:e.description,...e.updated_at===void 0?{}:{updatedLabel:`Updated ${Zn(e.updated_at)}`},skillMd:e.skill_md}})(),C=c.data!==void 0,w=!C&&(s.error!==null||c.error!==null);return(0,P.jsx)(mw,{statusShortcuts:bS(y),unread:FR(v),artifactSignal:IR(d.data),skills:b,detail:S,uploadPending:m.isPending,deletePending:h.isPending,loading:!C&&(s.isLoading||c.isLoading),unavailable:w,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t),onSelectSkill:t=>{o(t),$(JR(e,t))},onUploadSkill:e=>m.mutate(e),onDeleteSkill:e=>h.mutate(e)})}function zB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap(),staleTime:CR}),r=F({queryKey:Q.projectTimeline(e),queryFn:()=>t.getProjectTimeline(),enabled:n.isSuccess,staleTime:CR}),i=F({queryKey:Q.executionStatus(e),queryFn:()=>t.getExecutionStatus(),enabled:n.isSuccess,staleTime:CR}),a=F({queryKey:Q.readState(e),queryFn:()=>t.getReadState(),enabled:n.isSuccess,staleTime:CR}),o=F({queryKey:Q.artifacts(e),queryFn:()=>t.getArtifacts(),enabled:n.isSuccess,staleTime:CR}),s=n.data,c=s?.generated_at??new Date(0).toISOString(),l=a.data??s?.snapshots.read_state,u=i.data??s?.snapshots.execution_status??zR(c),d=r.data===void 0&&(n.error!==null||r.error!==null);return(0,P.jsx)(hw,{...r.data===void 0?{}:{timeline:Lx(r.data,{onOpenWorklistTask:t=>$(WR(e,t)),onOpenChatMessage:t=>$(GR(e,t)),onOpenReferenceFile:t=>$(HR(e,t))})},statusShortcuts:bS(u),unread:FR(l),artifactSignal:IR(o.data),loading:r.data===void 0&&(n.isLoading||r.isLoading),unavailable:d,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenWorklist:()=>$(WR(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t)})}function BB({relayProjectRef:e}){let t=(0,N.useMemo)(()=>Pn({...SR,relayProjectRef:e}),[e]),n=new URL(wR(),window.location.origin).searchParams.get(`task`)??void 0,[r,i]=(0,N.useState)(void 0),a=F({queryKey:Q.bootstrap(e),queryFn:()=>t.getBootstrap()}),o=F({queryKey:Q.worklist(e),queryFn:()=>t.getWorklist(),enabled:a.isSuccess}),s=F({queryKey:Q.executionStatus(e),queryFn:()=>t.getExecutionStatus(),enabled:a.isSuccess}),c=F({queryKey:Q.readState(e),queryFn:()=>t.getReadState(),enabled:a.isSuccess}),l=F({queryKey:Q.artifacts(e),queryFn:()=>t.getArtifacts(),enabled:a.isSuccess}),u=a.data,d=u?.generated_at??new Date(0).toISOString(),f=o.data??u?.snapshots.worklist??NR(),p=c.data??u?.snapshots.read_state;LR({enabled:a.isSuccess,hostClient:t,relayProjectRef:e,readState:p,scope:`worklist`});let m=(0,N.useMemo)(()=>Fr(f),[f]),h=n!==void 0&&m.some(e=>e.id===n),g=n!==void 0&&!h?n:void 0;(0,N.useEffect)(()=>{if(n!==void 0){i(h?e=>e===n?e:n:void 0);return}if(m.length===0){i(void 0);return}(r===void 0||!m.some(e=>e.id===r))&&i(ZR(f,void 0))},[h,n,r,m,f]);let _=F({queryKey:r===void 0?Q.taskDetail(e,`none`):Q.taskDetail(e,r),queryFn:()=>t.getTaskDetail(r),enabled:a.isSuccess&&r!==void 0}),v=F({queryKey:r===void 0?Q.taskRunResults(e,`none`):Q.taskRunResults(e,r),queryFn:()=>t.getTaskRunResults(r,{limit:50}),enabled:a.isSuccess&&r!==void 0}),y=s.data??u?.snapshots.execution_status??zR(d),b=Pr(f,r),x=Gr(_.data,v.data),S=o.data!==void 0||u?.snapshots.worklist!==void 0,C=!S&&(a.error!==null||o.error!==null);return(0,P.jsx)(gw,{statusShortcuts:bS(y),unread:FR(p),artifactSignal:IR(l.data),modules:b.modules,taskCount:b.taskCount,...x===void 0?{}:{detail:x},...g===void 0?{}:{missingTaskId:g},loading:!S&&(a.isLoading||o.isLoading),unavailable:C,onOpenProjectCenter:()=>$(`/projects`),onOpenChat:()=>$(rn(e)),onOpenReferences:()=>$(HR(e)),onOpenArtifacts:()=>$(UR(e)),onOpenSkills:()=>$(JR(e)),onOpenTimeline:()=>$(qR(e)),onOpenSettings:()=>$(KR(e)),onActivateStatusShortcut:t=>XR(e,t),onSelectTask:t=>{i(t),$(WR(e,t))}})}var VB=`is-scrollbar-active`,HB=1e3;function UB(e,t){let n=e.target;return n instanceof Element?n:t.scrollingElement??t.documentElement}function WB(e){let t=new Map,n=e=>{let n=t.get(e);n!==void 0&&(window.clearTimeout(n),t.delete(e)),e.classList.remove(VB)},r=e=>{let r=t.get(e);r!==void 0&&window.clearTimeout(r),e.classList.add(VB);let i=window.setTimeout(()=>n(e),HB);t.set(e,i)},i=t=>{r(UB(t,e))};return e.addEventListener(`scroll`,i,{capture:!0,passive:!0}),()=>{e.removeEventListener(`scroll`,i,!0);for(let[e,n]of t)window.clearTimeout(n),e.classList.remove(VB);t.clear()}}var GB=`--tutti-viewport-height`,KB=`--tutti-viewport-offset-top`;function qB(e,t=window){let n=e.documentElement,r=t.visualViewport,i=()=>{let e=r?.height??t.innerHeight,i=r?.offsetTop??0;n.style.setProperty(GB,`${Math.max(0,e)}px`),n.style.setProperty(KB,`${Math.max(0,i)}px`)};return i(),t.addEventListener(`resize`,i),t.addEventListener(`orientationchange`,i),r?.addEventListener(`resize`,i),r?.addEventListener(`scroll`,i),()=>{t.removeEventListener(`resize`,i),t.removeEventListener(`orientationchange`,i),r?.removeEventListener(`resize`,i),r?.removeEventListener(`scroll`,i),n.style.removeProperty(GB),n.style.removeProperty(KB)}}var JB=new $e({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function YB(){let e=ER();if(e.kind===`local_console`)return(0,P.jsx)(Pz,{});if(e.kind===`home`)return(0,P.jsx)(bz,{});if(e.kind===`join`)return(0,P.jsx)(vz,{joinToken:e.joinToken});if(e.kind===`setup`)return(0,P.jsx)(aB,{});if(e.kind===`project_open`)return(0,P.jsx)(Wz,{requestedOpenProjectRef:e.relayProjectRef});if(e.kind===`workspace`||e.kind===`worklist`||e.kind===`references`||e.kind===`artifacts`||e.kind===`skills`||e.kind===`timeline`||e.kind===`settings`){let t=e.kind===`workspace`?(0,P.jsx)(bB,{relayProjectRef:e.relayProjectRef}):e.kind===`worklist`?(0,P.jsx)(BB,{relayProjectRef:e.relayProjectRef}):e.kind===`references`?(0,P.jsx)(NB,{relayProjectRef:e.relayProjectRef}):e.kind===`artifacts`?(0,P.jsx)(MB,{relayProjectRef:e.relayProjectRef}):e.kind===`skills`?(0,P.jsx)(RB,{relayProjectRef:e.relayProjectRef}):e.kind===`timeline`?(0,P.jsx)(zB,{relayProjectRef:e.relayProjectRef}):(0,P.jsx)(LB,{relayProjectRef:e.relayProjectRef});return(0,P.jsxs)(wB,{relayProjectRef:e.relayProjectRef,children:[t,(0,P.jsx)(TB,{relayProjectRef:e.relayProjectRef})]},e.relayProjectRef)}return(0,P.jsx)(Wz,{})}function XB(){return(0,N.useEffect)(()=>{let e=WB(document),t=qB(document);return()=>{e(),t()}},[]),(0,P.jsx)(it,{client:JB,children:(0,P.jsx)(gR,{children:(0,P.jsx)(YB,{})})})}function ZB(e){let t=document.querySelector(`link[rel="icon"]`),n=t??document.createElement(`link`);n.rel=`icon`,n.type=`image/png`,n.sizes=`1204x1204`,n.href=e,t===null&&document.head.append(n)}ZB(MS),(0,xt.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(N.StrictMode,{children:(0,P.jsx)(XB,{})}));export{L as C,ci as S,Mi as _,Td as a,di as b,Pd as c,Zi as d,Xi as f,Fi as g,Li as h,jd as i,kd as l,Bi as m,_d as n,Dd as o,qi as p,Nd as r,Md as s,Zy as t,ra as u,ji as v,tt as w,li as x,Si as y};