@soleone/factory 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
6
6
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);case 30:return be(`ViewTransition`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(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&-e;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 Xe(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=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(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 Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-He(n),i=1<<r;t|=e[r],n&=~i}return t}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=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(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-He(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&&it(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function it(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function at(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ot(e,t){var n=t&-t;return n=n&42?1:st(n),(n&(e.suspendedLanes|t))===0?n:0}function st(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 ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function lt(){var e=K.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function ut(e,t){var n=K.p;try{return K.p=e,t()}finally{K.p=n}}var dt=Math.random().toString(36).slice(2),ft=`__reactFiber$`+dt,pt=`__reactProps$`+dt,mt=`__reactContainer$`+dt,ht=`__reactEvents$`+dt,gt=`__reactListeners$`+dt,_t=`__reactHandles$`+dt,vt=`__reactResources$`+dt,yt=`__reactMarker$`+dt,bt=`__reactLoad$`+dt;function xt(e){delete e[ft],delete e[pt],delete e[gt],delete e[_t]}function St(e){var t;if(t=e[ft])return t;for(var n=e.parentNode;n;){if(t=n[mt]||n[ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[ft])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[ft]||e[mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[yt]=!0}function Dt(e){e[bt]=void 0}var Ot=new Set,kt={};function At(e,t){jt(e,t),jt(e+`Capture`,t)}function jt(e,t){for(kt[e]=t,e=0;e<t.length;e++)Ot.add(t[e])}var Mt=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]*$`),Nt={},Pt={};function Ft(e){return Te.call(Pt,e)?!0:Te.call(Nt,e)?!1:Mt.test(e)?Pt[e]=!0:(Nt[e]=!0,!1)}var It=!1;function Lt(){var e=It;return It=!1,e}function Rt(e,t,n){if(Ft(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 zt(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 Bt(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 Vt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ht(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ut(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 Wt(e){if(!e._valueTracker){var t=Ht(e)?`checked`:`value`;e._valueTracker=Ut(e,t,``+e[t])}}function Gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ht(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Kt=/[\n"\\]/g;function qt(e){return e.replace(Kt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Jt(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=``+Vt(t)):e.value!==``+Vt(t)&&(e.value=``+Vt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Xt(e,Vt(n)):o===`number`&&e.value==t?Xt(e,Vt(e.value)):Xt(e,Vt(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=``+Vt(s):e.removeAttribute(`name`)}function Yt(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)){Wt(e);return}n=n==null?``:``+Vt(n),t=t==null?n:``+Vt(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),Wt(e)}function Xt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function Zt(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=``+Vt(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 Qt(e,t,n){t!=null&&(t=``+Vt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Vt(n)}function $t(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Vt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Wt(e)}function en(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tn=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 nn(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||tn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function rn(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]=``,It=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(nn(e,a,r),It=!0)}else for(var o in t)t.hasOwnProperty(o)&&nn(e,o,t[o])}function an(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 on=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`],[`maskType`,`mask-type`],[`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`]]),sn=/^[\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 cn(e){return sn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function ln(){}var un=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fn=null,pn=null;function mn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[pt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Jt(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="`+qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[pt]||null;if(!a)throw Error(i(90));Jt(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&&Gt(r)}break a;case`textarea`:Qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Zt(e,!!n.multiple,t,!1)}}}var hn=!1;function gn(e,t,n){if(hn)return e(t,n);hn=!0;try{return e(t)}finally{if(hn=!1,(fn!==null||pn!==null)&&(zd(),fn&&(t=fn,e=pn,pn=fn=null,mn(t),e)))for(t=0;t<e.length;t++)mn(e[t])}}function _n(e,t){var n=e.stateNode;if(n===null)return null;var r=n[pt]||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 vn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.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 Cn=i.slice(e,1<r?1-r:void 0)}function Tn(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 En(){return!0}function Dn(){return!1}function On(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)?En:Dn,this.isPropagationStopped=Dn,this}return D(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=En)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=En)},persist:function(){},isPersistent:En}),t}var kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},An=On(kn),jn=D({},kn,{view:0,detail:0}),Mn=On(jn),Nn,Pn,Fn,In=D({},jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kn,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!==Fn&&(Fn&&e.type===`mousemove`?(Nn=e.screenX-Fn.screenX,Pn=e.screenY-Fn.screenY):Pn=Nn=0,Fn=e),Nn)},movementY:function(e){return`movementY`in e?e.movementY:Pn}}),Y=On(In),Ln=On(D({},In,{dataTransfer:0})),Rn=On(D({},jn,{relatedTarget:0})),zn=On(D({},kn,{animationName:0,elapsedTime:0,pseudoElement:0})),Bn=On(D({},kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Vn=On(D({},kn,{data:0})),Hn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Un={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Gn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wn[e])?!!t[e]:!1}function Kn(){return Gn}var qn=On(D({},jn,{key:function(e){if(e.key){var t=Hn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Tn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Un[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kn,charCode:function(e){return e.type===`keypress`?Tn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Tn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Jn=On(D({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yn=On(D({},kn,{submitter:0})),Xn=On(D({},jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kn})),Zn=On(D({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Qn=On(D({},In,{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})),$n=On(D({},kn,{newState:0,oldState:0,source:0})),er=[9,13,27,32],tr=vn&&`CompositionEvent`in window,nr=null;vn&&`documentMode`in document&&(nr=document.documentMode);var rr=vn&&`TextEvent`in window&&!nr,ir=vn&&(!tr||nr&&8<nr&&11>=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var lr=!1;function ur(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=wn(),Cn=Sn=xn=null,lr=!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 ir&&t.locale!==`ko`?null:t.data;default:return null}}var fr={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 pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!fr[e.type]:t===`textarea`}function mr(e,t,n,r){fn?pn?pn.push(r):pn=[r]:fn=r,t=Yf(t,`onChange`),0<t.length&&(n=new An(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var hr=null,gr=null;function _r(e){Hf(e,0)}function vr(e){if(Gt(wt(e)))return e}function yr(e,t){if(e===`change`)return t}var br=!1;if(vn){var xr;if(vn){var Sr=`oninput`in document;if(!Sr){var Cr=document.createElement(`div`);Cr.setAttribute(`oninput`,`return;`),Sr=typeof Cr.oninput==`function`}xr=Sr}else xr=!1;br=xr&&(!document.documentMode||9<document.documentMode)}function wr(){hr&&(hr.detachEvent(`onpropertychange`,Tr),gr=hr=null)}function Tr(e){if(e.propertyName===`value`&&vr(gr)){var t=[];mr(t,gr,e,dn(e)),gn(_r,t)}}function Er(e,t,n){e===`focusin`?(wr(),hr=t,gr=n,hr.attachEvent(`onpropertychange`,Tr)):e===`focusout`&&wr()}function Dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return vr(gr)}function Or(e,t){if(e===`click`)return vr(t)}function kr(e,t){if(e===`input`||e===`change`)return vr(t)}function Ar(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var jr=typeof Object.is==`function`?Object.is:Ar;function Mr(e,t){if(jr(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(!Te.call(t,i)||!jr(e[i],t[i]))return!1}return!0}function Nr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fr(e,t){var n=Pr(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=Pr(n)}}function Ir(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ir(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nr(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=Nr(e.document)}return t}function Rr(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 zr=vn&&`documentMode`in document&&11>=document.documentMode,Br=null,Vr=null,Hr=null,Ur=!1;function Wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||Br==null||Br!==Nr(r)||(r=Br,`selectionStart`in r&&Rr(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}),Hr&&Mr(Hr,r)||(Hr=r,r=Yf(Vr,`onSelect`),0<r.length&&(t=new An(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Br)))}function Gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Kr={animationend:Gr(`Animation`,`AnimationEnd`),animationiteration:Gr(`Animation`,`AnimationIteration`),animationstart:Gr(`Animation`,`AnimationStart`),transitionrun:Gr(`Transition`,`TransitionRun`),transitionstart:Gr(`Transition`,`TransitionStart`),transitioncancel:Gr(`Transition`,`TransitionCancel`),transitionend:Gr(`Transition`,`TransitionEnd`)},qr={},Jr={};vn&&(Jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),`TransitionEvent`in window||delete Kr.transitionend.transition);function Yr(e){if(qr[e])return qr[e];if(!Kr[e])return e;var t=Kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jr)return qr[e]=t[n];return e}var Xr=Yr(`animationend`),Zr=Yr(`animationiteration`),Qr=Yr(`animationstart`),$r=Yr(`transitionrun`),ei=Yr(`transitionstart`),ti=Yr(`transitioncancel`),ni=Yr(`transitionend`),ri=new Map,ii=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ii.push(`scrollEnd`);function ai(e,t){ri.set(e,t),At(t,[e])}var oi=0;function si(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=oi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function ci(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function li(e,t){return e=ci(e),t=ci(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var ui=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)},di=[],fi=0,pi=0;function mi(){for(var e=fi,t=pi=fi=0;t<e;){var n=di[t];di[t++]=null;var r=di[t];di[t++]=null;var i=di[t];di[t++]=null;var a=di[t];if(di[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&&vi(n,i,a)}}function hi(e,t,n,r){di[fi++]=e,di[fi++]=t,di[fi++]=n,di[fi++]=r,pi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function gi(e,t,n,r){return hi(e,t,n,r),yi(e)}function _i(e,t){return hi(e,null,null,t),yi(e)}function vi(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-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function yi(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bi={};function xi(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 Si(e,t,n,r){return new xi(e,t,n,r)}function Ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var n=e.alternate;return n===null?(n=Si(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&1206910976,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 Ti(e,t){e.flags&=1206910978;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 Ei(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ci(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=Si(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Di(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Si(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Si(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Si(19,n,t,a),e.elementType=R,e.lanes=o,e;case H:case ee:return e=a|32,e=Si(30,n,t,e),e.elementType=ee,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case B:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Di(e,t,n,r){return e=Si(7,e,r,t),e.lanes=n,e}function Oi(e,t,n){return e=Si(6,e,null,t),e.lanes=n,e}function ki(e){var t=Si(18,null,null,0);return t.stateNode=e,t}function Ai(e,t,n){return t=Si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ji=new WeakMap;function Mi(e,t){if(typeof e==`object`&&e){var n=ji.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},ji.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var Ni=[],Pi=0,Fi=null,Ii=0,Li=[],Ri=0,zi=null,Bi=1,Vi=``;function Hi(e,t){Ni[Pi++]=Ii,Ni[Pi++]=Fi,Fi=e,Ii=t}function Ui(e,t,n){Li[Ri++]=Bi,Li[Ri++]=Vi,Li[Ri++]=zi,zi=e;var r=Bi;e=Vi;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Bi=1<<32-He(t)+i|n<<i|r,Vi=a+e}else Bi=1<<a|n<<i|r,Vi=e}function Wi(e){e.return!==null&&(Hi(e,1),Ui(e,1,0))}function Gi(e){for(;e===Fi;)Fi=Ni[--Pi],Ni[Pi]=null,Ii=Ni[--Pi],Ni[Pi]=null;for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Vi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null}function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=Vi,Li[Ri++]=zi,Bi=t.id,Vi=t.overflow,zi=e}var qi=null,Ji=null,Yi=!1,Xi=null,Zi=!1,Qi=Error(i(519));function $i(e){throw aa(Mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Qi}function ea(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ft]=e,t[pt]=r,n){case`dialog`:Uf(`cancel`,t),Uf(`close`,t);break;case`iframe`:case`object`:case`embed`:Uf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Bf.length;n++)Uf(Bf[n],t);break;case`source`:Uf(`error`,t);break;case`img`:case`image`:case`link`:Uf(`error`,t),Uf(`load`,t);break;case`details`:Uf(`toggle`,t);break;case`input`:Uf(`invalid`,t),Yt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Uf(`invalid`,t);break;case`textarea`:Uf(`invalid`,t),$t(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||tp(t.textContent,n)?(r.popover!=null&&(Uf(`beforetoggle`,t),Uf(`toggle`,t)),r.onScroll!=null&&Uf(`scroll`,t),r.onScrollEnd!=null&&Uf(`scrollend`,t),r.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||$i(e,!0)}function ta(e){for(qi=e.return;qi;)switch(qi.tag){case 5:case 31:case 13:Zi=!1;return;case 27:case 3:Zi=!0;return;default:qi=qi.return}}function na(e){if(e!==qi)return!1;if(!Yi)return ta(e),Yi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||hp(e.type,e.memoizedProps)),n=!n),n&&Ji&&$i(e),ta(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ji=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ji=fm(e)}else t===27?(t=Ji,wp(e.type)?(e=dm,dm=null,Ji=e):Ji=t):Ji=qi?um(e.stateNode.nextSibling):null;return!0}function ra(){Ji=qi=null,Yi=!1}function ia(){var e=Xi;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),Xi=null),e}function aa(e){Xi===null?Xi=[e]:Xi.push(e)}var oa=se(null),sa=null,ca=null;function la(e,t,n){le(oa,t._currentValue),t._currentValue=n}function ua(e){e._currentValue=oa.current,ce(oa)}function da(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 fa(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),da(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),da(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),da(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 pa(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;jr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===pe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&fa(t,e,n,r),t.flags|=262144,e!==null}function ma(e){for(e=e.firstContext;e!==null;){if(!jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ha(e){sa=e,ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ga(e){return va(sa,e)}function _a(e,t){return sa===null&&ha(e),va(e,t)}function va(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ca===null){if(e===null)throw Error(i(308));ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ca=ca.next=t;return n}var ya=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()})}},ba=t.unstable_scheduleCallback,xa=t.unstable_NormalPriority,Sa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ca(){return{controller:new ya,data:new Map,refCount:0}}function wa(e){e.refCount--,e.refCount===0&&ba(xa,function(){e.controller.abort()})}function Ta(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ea=null;function Da(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oa=null,ka=0,Aa=0,ja=null;function Ma(e,t){if(Oa===null){var n=Oa=[];ka=0,Aa=Ff(),ja={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ka++,t.then(Na,Na),t}function Na(){if(--ka===0&&(Ea=null,Oa!==null)){ja!==null&&(ja.status=`fulfilled`);var e=Oa;Oa=null,Aa=0,ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pa(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 Fa=G.S;G.S=function(e,t){if(hd=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&Ma(e,t),Ea!==null)for(var n=xf;n!==null;)Ta(n,Ea),n=n.next;if(n=e.types,n!==null){for(var r=xf;r!==null;)Ta(r,n),r=r.next;if(Aa!==0){r=Ea,r===null&&(r=Ea=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Fa!==null&&Fa(e,t)};var Ia=se(null);function La(){var e=Ia.current;return e===null?Xu.pooledCache:e}function Ra(e,t){t===null?le(Ia,Ia.current):le(Ia,t.pool)}function za(){var e=La();return e===null?null:{parent:Sa._currentValue,pool:e}}var Ba=Error(i(460)),Va=Error(i(474)),Ha=Error(i(542)),Ua={then:function(){}};function Wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ln,ln),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ya(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(ln,ln);else{if(e=Xu,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,Ya(e),e}throw qa=t,Ba}}function Ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(qa=e,Ba):e}}var qa=null;function Ja(){if(qa===null)throw Error(i(459));var e=qa;return qa=null,e}function Ya(e){if(e===Ba||e===Ha)throw Error(i(483))}var Xa=null,Za=0;function Qa(e){var t=Za;return Za+=1,Xa===null&&(Xa=[]),Ga(Xa,e,t)}function $a(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function eo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function to(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=wi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Oi(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===j?(e=d(e,t,n.props.children,r,n.key),$a(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Ka(i)===t.type)?(t=a(t,n.props),$a(t,n),t.return=e,t):(t=Ei(n.type,n.key,n.props,null,e.mode,r),$a(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=Ai(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=Di(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=Oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ei(t.type,t.key,t.props,null,e.mode,n),$a(n,t),n.return=e,n;case A:return t=Ai(t,e.mode,n),t.return=e,t;case B:return t=Ka(t),f(e,t,n)}if(ae(t)||W(t))return t=Di(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Qa(t),n);if(t.$$typeof===F)return f(e,_a(e,t),n);eo(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Ka(n),p(e,t,n,r)}if(ae(n)||W(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Qa(n),r);if(n.$$typeof===F)return p(e,t,_a(e,n),r);eo(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Ka(r),m(e,t,n,r,i)}if(ae(r)||W(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Qa(r),i);if(r.$$typeof===F)return m(e,t,n,_a(t,r),i);eo(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),Yi&&Hi(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 Yi&&Hi(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(_.key===null?h:_.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)}),Yi&&Hi(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),Yi&&Hi(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 Yi&&Hi(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(_.key===null?g:_.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)}),Yi&&Hi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),$a(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),$a(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Di(o.props.children,e.mode,c,o.key),$a(c,o),c.return=e,e=c):(c=Ei(o.type,o.key,o.props,null,e.mode,c),$a(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ai(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Ka(o),_(e,r,o,c)}if(ae(o))return h(e,r,o,c);if(W(o)){if(l=W(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,Qa(o),c);if(o.$$typeof===F)return _(e,r,_a(e,o),c);eo(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=Oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Za=0;var i=_(e,t,n,r);return Xa=null,i}catch(t){if(t===Ba||t===Ha)throw t;var a=Si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var no=to(!0),ro=to(!1),io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oo(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 so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=yi(e),vi(e,null,n),t}return hi(e,r,t,n),yi(e)}function lo(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,at(e,n)}}function uo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var fo=!1;function po(){if(fo){var e=ja;if(e!==null)throw e}}function mo(e,t,n,r){fo=!1;var i=e.updateQueue;io=!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?(Qu&f)===f:(r&f)===f){f!==0&&f===Aa&&(fo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:io=!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),od|=o,e.lanes=o,e.memoizedState=d}}function ho(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function go(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ho(n[e],t)}var _o=se(null),vo=se(0);function yo(e,t){e=id,le(vo,e),le(_o,t),id=e|t.baseLanes}function bo(){le(vo,id),le(_o,_o.current)}function xo(){id=vo.current,ce(_o),ce(vo)}var So=se(null),Co=null;function wo(e){var t=e.alternate;le(ko,ko.current&1),le(So,e),Co===null&&(t===null||_o.current!==null||t.memoizedState!==null)&&(Co=e)}function To(e){le(ko,ko.current),le(So,e),Co===null&&(Co=e)}function Eo(e){e.tag===22?(le(ko,ko.current),le(So,e),Co===null&&(Co=e)):Do()}function Do(){le(ko,ko.current),le(So,So.current)}function Oo(e){ce(So),Co===e&&(Co=null),ce(ko)}var ko=se(0);function Ao(e,t){le(So,So.current),le(ko,t)}function jo(e){ce(ko),ce(So),Co===e&&(Co=null)}function Mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 No=0,Po=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return No=a,Po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?lc:uc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){G.H=cc;var t=Fo!==null&&Fo.next!==null;if(No=0,Io=Fo=Po=null,Lo=!1,Vo=0,Ho=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&ma(e)&&(Dc=!0))}function Jo(e,t,n,r){Po=e;var a=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}G.H=dc,o=t(n,r)}while(Ro);return o}function Yo(){var e=G.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Po.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}No=0,Io=Fo=Po=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Po.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Po.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Po.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Po.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Po.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ga(Ho,e,t),t=Po,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?lc:uc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===te)return;if(e.$$typeof===F)return ga(e)}throw Error(i(438,String(e)))}function is(e){var t=null,n=Po.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Po.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=ts(),Po.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]=U;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(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?(No&f)===f:(Qu&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===Aa&&(d=!0);else if((No&p)===p){u=u.next,p===Aa&&(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,Po.lanes|=p,od|=p;f=u.action,zo&&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,Po.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!jr(o,e.memoizedState)&&(Dc=!0,d&&(n=ja,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 cs(e){var t=es(),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);jr(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Po,a=es(),o=Yi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!jr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||No&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Po.updateQueue,t===null?(t=ts(),Po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function ms(e){var t=_i(e,2);t!==null&&Pd(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,a){if(ac(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)}};G.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=G.T,o={};o.types=a===null?null:a.types,G.T=o;try{var s=n(i,r),c=G.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),G.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(Yi){var n=Xu.formState;if(n!==null){a:{var r=Po;if(Yi){if(Ji){b:{for(var i=Ji,a=Zi;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ji=um(i.nextSibling),r=i.data===`F!`;break a}}$i(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=nc.bind(null,Po,r),r.dispatch=n,r=hs(!1),a=ic.bind(null,Po,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Po,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Ba?Ha:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Po.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Po.updateQueue,t===null&&(t=ts(),Po.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 As(){return es().memoizedState}function js(e,t,n,r){var i=$o();Po.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Po.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Po.flags|=4;var t=Po.updateQueue;if(t===null)t=ts(),Po.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=es().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(4,4,e,t)}function zs(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 Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||No&1073741824&&!(Qu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),Po.lanes|=e,od|=e,n)}function Gs(e,t,n,r){return jr(n,t)?n:_o.current===null?!(No&106)||No&1073741824&&!(Qu&261930)?(Dc=!0,e.memoizedState=n):(e=Md(),Po.lanes|=e,od|=e,t):(e=Ws(e,n,r),jr(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=K.p;K.p=a!==0&&8>a?a:8;var o=G.T,s={};s.types=o===null?null:o.types,G.T=s,ic(e,!1,t,n);try{var c=i(),l=G.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,Pa(c,r),jd(e)):rc(e,t,r,jd(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{K.p=a,o!==null&&s.types!==null&&(o.types=s.types),G.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,q,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:q},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},jd())}function Zs(){return ga(ch)}function Qs(){return es().memoizedState}function $s(){return es().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=so(n);var r=co(t,e,n);r!==null&&(Pd(r,t,n),lo(r,t,n)),t={cache:Ca()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=gi(e,t,n,r),n!==null&&(Pd(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,jd())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(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,jr(s,o))return hi(e,t,i,0),Xu===null&&mi(),!1}catch{}if(n=gi(e,t,i,r),n!==null)return Pd(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Ff(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=gi(e,n,r,2),t!==null&&Pd(t,e,2)}function ac(e){var t=e.alternate;return e===Po||t!==null&&t===Po}function oc(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}var cc={readContext:ga,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},lc={readContext:ga,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:ga,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){Ve(!0);try{n(t)}finally{Ve(!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=tc.bind(null,Po,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=nc.bind(null,Po,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Ks.bind(null,Po,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Po,a=$o();if(Yi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Qu&127||us(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Xu.identifierPrefix;if(Yi){var n=Vi,r=Bi;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,Po,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=ec.bind(null,Po)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:ga,use:rs,useCallback:Hs,useContext:ga,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:ga,use:rs,useCallback:Hs,useContext:ga,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=es();return Fo===null?Ws(n,e,t):Gs(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is};function fc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=so(r);i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Pd(t,e,r),lo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=so(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Pd(t,e,r),lo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=so(n);r.tag=2,t!=null&&(r.callback=t),t=co(e,r,n),t!==null&&(Pd(t,e,n),lo(t,e,n))}};function mc(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?!Mr(n,r)||!Mr(i,a):!0}function hc(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&&pc.enqueueReplaceState(t,t.state,null)}function gc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function _c(e){ui(e)}function vc(e){console.error(e)}function yc(e){ui(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(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 Sc(e,t,n){return n=so(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=so(e),e.tag=3,e}function wc(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(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&pa(t,n,a,!0),n=So.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Co===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ua?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),hf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ua?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)),hf(e,r,a)),!1}throw Error(i(435,n.tag))}return hf(e,r,a),Kd(),!1}if(Yi)return t=So.current,t===null?(r!==Qi&&(t=Error(i(423),{cause:r}),aa(Mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Mi(r,n),a=Sc(e.stateNode,r,a),uo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Qi&&(e=Error(i(422),{cause:r}),aa(Mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Mi(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),uo(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`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),uo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?ro(t,null,n,r):no(t,e.child,n,r)}function kc(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 ha(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(Yi&&s&&Wi(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=Ei(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=wi(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(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&&Ra(t,a===null?null:a.cachePool),a===null?bo():yo(t,a),Eo(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ra(t,null),bo(),Do()):(Ra(t,a.cachePool),yo(t,a),Do(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(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=La();return a=a===null?null:{parent:Sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ra(t,null),bo(),Eo(t),e!==null&&pa(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return no(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,Oo(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Yi){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(To(t),(e=Ji)?(e=om(e,Zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zi===null?null:{id:Bi,overflow:Vi},retryLane:536870912,hydrationErrors:null},n=ki(e),n.return=t,t.child=n,qi=t,Ji=null)):e=null,e===null)throw $i(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(To(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||pa(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(_o.current===null){if(r=Xu,r!==null&&(s=ot(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,_i(e,s),Pd(r,e,s),Ec;Kd()}t=Ic(e,t,n)}else e=o.treeContext,Ji=um(s.nextSibling),qi=t,Yi=!0,Xi=null,Zi=!1,e!==null&&Ki(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=wi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(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 zc(e,t,n,r,i){return ha(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(Yi&&r&&Wi(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return ha(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Dc?(Zo(e,t,a),rl(e,t,a)):(Yi&&r&&Wi(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(ha(t),t.stateNode===null){var a=bi,o=n.contextType;typeof o==`object`&&o&&(a=ga(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ao(t),o=n.contextType,a.context=typeof o==`object`&&o?ga(o):bi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(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&&pc.enqueueReplaceState(a,a.state,null),mo(t,r,a,i),po(),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=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=bi,typeof u==`object`&&u&&(o=ga(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)&&hc(t,a,r,o),io=!1;var f=t.memoizedState;a.state=f,mo(t,r,a,i),po(),l=t.memoizedState,s||f!==l||io?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=io||mc(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,oo(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=bi,typeof l==`object`&&l&&(c=ga(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)&&hc(t,a,r,c),io=!1,f=t.memoizedState,a.state=f,mo(t,r,a,i),po();var p=t.memoizedState;o!==d||f!==p||io||e!==null&&e.dependencies!==null&&ma(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=io||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ma(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,Rc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=no(t,e.child,null,i),t.child=no(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return ra(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:za()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(ko.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Yi){if(i?wo(t):Do(),(e=Ji)?(e=om(e,Zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zi===null?null:{id:Bi,overflow:Vi},retryLane:536870912,hydrationErrors:null},n=ki(e),n.return=t,t.child=n,qi=t,Ji=null)):e=null,e===null)throw $i(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Do(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Di(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(wo(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Do(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=wi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Di(i,a,n,null),i.flags|=2):i=wi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=za():(s=Sa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(wo(t),n=e.child,e=n.sibling,n=wi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Si(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return no(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(wo(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Do(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Di(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,no(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Do(),t.child=e.child,t.flags|=128,null);if(wo(t),cm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,aa({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||pa(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(_o.current!==null)return Yc(e,t,c);if(r=Xu,r!==null&&(a=ot(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,_i(e,a),Pd(r,e,a),Ec;return sm(o)||Kd(),Yc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Ji=um(o.nextSibling),qi=t,Yi=!0,Xi=null,Zi=!1,e!==null&&Ki(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),da(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Mo(n)===null&&(t=e),e=e.sibling}return t}function $c(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 el(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ko.current;if(t.flags&128)return Ao(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ao(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=Yi?Ii:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(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`backwards`:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return la(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(pa(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=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ma(e)))}function al(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),la(t,Sa,e.memoizedState.cache),ra();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:la(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,To(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return wo(t),t.flags|=128,null;r=pa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(wo(t),e=rl(e,t,n),e===null?null:e.sibling)}wo(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(pa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ao(t,ko.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:la(t,Sa,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,Yi&&t.flags&1048576&&Ui(t,Ii,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ka(t.elementType),t.type=e,typeof e==`function`)Ci(e)?(r=gc(e,r),t.tag=1,t=Vc(null,t,e,r,n)):(t.tag=0,t=zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,oo(e,t),mo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,la(t,Sa,r),r!==o.cache&&fa(t,[Sa],n,!0),po(),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=Hc(e,t,r,n);break a}if(r!==a){a=Mi(Error(i(424)),t),aa(a),t=Hc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ji=um(e.firstChild),qi=t,Yi=!0,Xi=null,Zi=!0,n=ro(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ra(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Yi||(t.stateNode=mp(t.type,t.pendingProps,fe.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&Yi&&(r=t.stateNode=gm(t.type,t.pendingProps,fe.current),qi=t,Zi=!0,a=Ji,wp(t.type)?(dm=a,Ji=um(r.firstChild)):Ji=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Yi&&((a=r=Ji)&&(r=im(r,t.type,t.pendingProps,Zi),r===null?a=!1:(t.stateNode=r,qi=t,Ji=um(r.firstChild),Zi=!1,a=!0)),a||$i(t)),ge(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,hp(a,o)?r=null:s!==null&&hp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ko(e,t,Yo,null,null,n),ch._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&Yi&&((e=n=Ji)&&(n=am(n,t.pendingProps,Zi),n===null?e=!1:(t.stateNode=n,qi=t,Ji=null,e=!0)),e||$i(t)),null;case 13:return Kc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=no(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ha(t),a=ga(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return ha(t),r=ga(Sa),e===null?(a=La(),a===null&&(a=Xu,o=Ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ao(t),la(t,Sa,a)):((e.lanes&n)!==0&&(oo(e,t),mo(t,null,null,n),po()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,la(t,Sa,r),r!==a.cache&&fa(t,[Sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),la(t,Sa,r))),Oc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:Yi&&Wi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw qa=Ua,Va}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Ud())e.flags|=8192;else throw qa=Ua,Va}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,ud|=t)}function dl(e,t){if(!Yi)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function fl(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&1206910976,r|=i.flags&1206910976,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 pl(e,t,n){var r=t.pendingProps;switch(Gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ua(Sa),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(na(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ia())),fl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(fl(t),cl(t,a,null,r,n)):(fl(t),ll(t,o))):o?o===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,a,e,r,n)),null;case 27:if(_e(t),n=fe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}e=ue.current,na(t)?ea(t,e):(e=gm(a,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}if(o=ue.current,na(t))ea(t,o);else{var s=dp(fe.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[ft]=t,o[pt]=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(ip(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&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,na(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||$i(t,!0)}else e=dp(e).createTextNode(r),e[ft]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=na(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[ft]=t}else ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Oo(t),t):(Oo(t),null);if(t.flags&128)throw Error(i(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=na(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[ft]=t}else ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),a=!1}else a=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Oo(t),t):(Oo(t),null)}return Oo(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),ul(t,t.updateQueue),fl(t),null);case 4:return he(),e===null&&Kf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return ua(t.type),fl(t),null;case 19:if(jo(t),r=t.memoizedState,r===null)return fl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)dl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Mo(e),o!==null){for(t.flags|=128,dl(r,!1),e=o.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ti(n,e),n=n.sibling;return Ao(t,ko.current&1|2),Yi&&Hi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>gd&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Yi)return fl(t),null}else 2*Ae()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,dl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,o=ko.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Yi?Ao(t,o):(n=o,le(So,t),le(ko,n),Co===null&&(Co=t)),Yi&&Hi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return Oo(t),xo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(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&&ce(Ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ua(Sa),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(i(156,t.tag))}function ml(e,t){switch(Gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(Sa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(Oo(t),t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return he(),null;case 10:return ua(t.type),null;case 22:case 23:return Oo(t),xo(),e!==null&&ce(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(Sa),null;case 25:return null;default:return null}}function hl(e,t){switch(Gi(t),t.tag){case 3:ua(Sa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&Oo(t);break;case 13:Oo(t);break;case 19:jo(t);break;case 10:ua(t.type);break;case 22:case 23:Oo(t),xo(),e!==null&&ce(Ia);break;case 24:ua(Sa)}}function gl(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){mf(t,t.return,e)}}function _l(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){mf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){mf(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{go(t,n)}catch(t){mf(e,e.return,t)}}}function yl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){mf(e,t,n)}}function bl(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:var i=e.stateNode,a=si(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Ip(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Lp(e);m(e.child,!1,$p,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){mf(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){mf(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){mf(e,t,n)}else n.current=null}}function Sl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)tm(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(El(t)&&tm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(El(t)&&nm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function El(e){return e&&e.tag===7&&e.stateNode!==null}function Dl(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){mf(e,e.return,t)}}function Ol(e,t,n){try{var r=e.stateNode;op(r,e.type,n,t),r[pt]=t}catch(t){mf(e,e.return,t)}}function kl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wp(e.type)||e.tag===4}function Al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kl(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&&wp(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 jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln)),Sl(e,r),It=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),It=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),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]);ip(t,r,n),t[ft]=e,t[pt]=n}catch(t){mf(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ap(o);r.push(s),s.view&&(a=!0)}else a||Ap(o).view&&(a=!0);Pl=!0,Dp(o,zl===0?t:t+`_`+zl,n),zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Op(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Hl(e.child,t)),e=e.sibling}function X(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(X(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=li(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=si(r,n),a=li(r.default,n.paired?r.share:r.enter);a===`none`?X(e):Bl(e,i,a,null,!1)?(X(e),n.paired||t||Nd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else X(e)}function Wl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=li(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=si(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=li(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),Nd(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Fl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=si(t,e.stateNode);t=li(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Hl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=Ap(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Dp(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=si(n,r),a=li(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,lp=_h,e=Lr(e),Rr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(up={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Fl=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){mf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=si(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=li(a.default,a.update),a!==`none`&&Bl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&gl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){mf(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){mf(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(Au(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{go(e,t)}catch(e){mf(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:Au(e,n),t===null&&r&4&&Dl(n),r&512&&bl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=vf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){mf(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,It=!0}catch(t){mf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ep(s,!0):Ep(e.stateNode,!1)}catch(t){mf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:$l||xl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||xl(n,t),wl(n);var r=hu,i=gu;wp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),It=!0}catch(e){mf(n,t,e)}else try{hu.removeChild(n.stateNode),It=!0}catch(e){mf(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Tp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):Tp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),$l||_l(4,n,t),_u(e,t,n);break;case 1:$l||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:xl(n,t),_u(e,t,n);break;case 7:$l||xl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){mf(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){mf(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=yf.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(wp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||xl(r,r.return)),a&64&&Ql&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||xl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Ql)e.stateNode=mp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[yt]||r[ft]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),ip(r,t,n),r[ft]=e,Et(r),t=r;break a;case`link`:if(o=Km(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),ip(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),ip(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[ft]=e,Et(r),t=r}e.stateNode=t}}else Ql||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||xl(r,r.return)),r!==null&&a&4&&Ol(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{en(t,``),It=!0}catch(t){mf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ol(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,It=!0}catch(t){mf(e,e.return,t)}}break;case 3:if(It=!1,Gm=null,o=wu,wu=xm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){mf(e,e.return,t)}tu&&(tu=!1,Du(e)),It=!1;break;case 4:a=eu,eu=Ql,r=Lt(),o=wu,wu=xm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,It&&au&&(ou=!0),It=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ae()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||xl(r,r.return)),a=Lt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&li(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&It&&(e.flags|=4),au=o,It=a;break;case 21:break;case 7:a&512&&($l||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(El(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Tl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,Al(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(en(l,``),n.flags&=-33),Ml(e,Al(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;jl(e,Al(e),u,s);break;default:throw Error(i(161))}}catch(t){mf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Rl(),Ou(t,e),!iu&&!ou){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Op(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}Ll=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Rl(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=si(a,o),o=si(n.memoizedProps,o);var s=li(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Xl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),ju(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),ju(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),ju(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:xl(n,n.return),ju(n,r);break;case 7:xl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),gl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){mf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)ho(l[i],c)}catch(e){mf(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),Mu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||qm(xm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),bl(a,a.return);break;case 30:Mu(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(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&&wa(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wa(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&wa(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){mf(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Lu(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(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:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=wu;wu=xm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=new Map),Fl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(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 Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:_l(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:wa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ga(Sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ga(Sa).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Zu=null,Qu=0,$u=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return Yu&2&&Qu!==0?Qu&-Qu:G.T===null?lt():Ff()}function Md(){if(ld===0){if(!(Qu&536870912)||Yi){var e=qe;qe<<=1,!(qe&3932160)&&(qe=262144),ld=e}else ld=536870912}return e=So.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Ip(si(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===Xu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Qu,ld,!1)),nt(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(sd|=n),ad===4&&Rd(e,Qu,ld,!1)),Df(e))}function Fd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ze(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n))a=qd(e,t,!1),o=!1;else{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=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(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&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-Ae(),10<a)){if(Rd(r,t,ld,!td),Xe(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=vp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}}while(1);Df(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ln},Fl=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ae():(a&4194048)===a?hd-Ae():0,m=th(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!jr(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 Rd(e,t,n,r){t=Qe(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&it(e,n,t)}function zd(){return Yu&6?!0:(Of(0,!1),!1)}function Bd(){if(Zu!==null){if($u===0)var e=Zu.return;else e=Zu,ca=sa=null,Qo(e),Xa=null,Za=0,e=Zu;for(;e!==null;)hl(e.alternate,e),e=e.return;Zu=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),Xu=e,Zu=n=wi(e.current,null),Qu=t,$u=0,ed=null,td=!1,nd=Ze(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=Qe(e,t),mi(),n}function Hd(e,t){Po=null,G.H=cc,t===Ba||t===Ha?(t=Ja(),$u=3):t===Va?(t=Ja(),$u=4):$u=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Zu===null&&(ad=1,bc(e,Mi(t,e.current)))}function Ud(){var e=So.current;return e===null?!0:(Qu&4194048)===Qu?Co===null:(Qu&62914560)===Qu||Qu&536870912?e===Co:!1}function Wd(){var e=G.H;return G.H=cc,e===null?cc:e}function Gd(){var e=G.A;return G.A=qu,e}function Kd(){ad=4,td||(Qu&4194048)!==Qu&&So.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Xu===null||Rd(Xu,Qu,ld,!1)}function qd(e,t,n){var r=Yu;Yu|=2;var i=Wd(),a=Gd();(Xu!==e||Qu!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Zu!==null){var s=Zu,c=ed;switch($u){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:So.current===null&&(t=!0);var l=$u;if($u=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,ca=sa=null,Yu=r,G.H=i,G.A=a,Zu===null&&(Xu=null,Qu=0,mi()),o}function Jd(){for(;Zu!==null;)Zd(Zu)}function Yd(e,t){var n=Yu;Yu|=2;var r=Wd(),a=Gd();Xu!==e||Qu!==t?(_d=null,gd=Ae()+500,Vd(e,t)):nd=Ze(e,t);a:do try{if($u!==0&&Zu!==null){t=Zu;var o=ed;b:switch($u){case 1:$u=0,ed=null,$d(e,t,o,1);break;case 2:case 9:if(Wa(o)){$u=0,ed=null,Qd(t);break}t=function(){$u!==2&&$u!==9||Xu!==e||($u=7),Df(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:Wa(o)?($u=0,ed=null,Qd(t)):($u=0,ed=null,$d(e,t,o,7));break;case 5:var s=null;switch(Zu.tag){case 26:s=Zu.memoizedState;case 5:case 27:var c=Zu;if(s?Xm(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Zu=l;else{var u=c.return;u===null?Zu=null:(Zu=u,ef(u))}break b}}$u=0,ed=null,$d(e,t,o,5);break;case 6:$u=0,ed=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return ca=sa=null,G.H=r,G.A=a,Yu=n,Zu===null?(Xu=null,Qu=0,mi(),ad):0}function Xd(){for(;Zu!==null&&!Oe();)Zd(Zu)}function Zd(e){var t=ol(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Qu);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Qu);break;case 5:Qo(t);var r=t;r===qi&&(Yi?(ta(r),r.tag===5&&r.stateNode!=null&&(Ji=r.stateNode)):(ta(r),Yi=!0));default:hl(n,t),t=Zu=Ti(t,id),t=ol(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function $d(e,t,n,r){ca=sa=null,Qo(t),Xa=null,Za=0;var i=t.return;try{if(Tc(e,i,t,n,Qu)){ad=1,bc(e,Mi(n,e.current)),Zu=null;return}}catch(t){if(i!==null)throw Zu=i,t;ad=1,bc(e,Mi(n,e.current)),Zu=null;return}t.flags&32768?(Yi||r===1?e=!0:nd||Qu&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=So.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=pl(t.alternate,t,id);if(n!==null){Zu=n;return}if(t=t.sibling,t!==null){Zu=t;return}Zu=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Zu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Zu=e;return}Zu=e=n}while(e!==null);ad=6,Zu=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Zu=Xu=null,Qu=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=pi,rt(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Da(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,bf(Pe,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=G.T,G.T=null,i=K.p,K.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,K.p=i,G.T=r}}yd=1,Pl?Ed=Pp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,ku(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=G.T,G.T=null;var i=K.p;K.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=up;var o=Lr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ir(s.ownerDocument.documentElement,s)){if(c!==null&&Rr(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 _=Fr(s,h),v=Fr(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}}_h=!!lp,up=lp=null}finally{Yu=a,K.p=i,G.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=G.T,G.T=null;var r=K.p;K.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,K.p=r,G.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,ke();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),ct(r),n=n.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=G.T,a=K.p,K.p=2,G.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{G.T=n,K.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Df(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Of(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wa(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=ct(Sd),r=G.T,a=K.p;try{K.p=32>n?32:n,G.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Of(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{K.p=a,G.T=r,uf(e,t)}}function pf(e,t,n){t=Mi(n,t),t=Sc(e.stateNode,t,2),e=co(e,t,2),e!==null&&(nt(e,2),Df(e))}function mf(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Mi(n,e),n=Cc(2),r=co(t,n,2),r!==null&&(wc(n,r,t,e),nt(r,2),Df(r));break}}t=t.return}}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(rd=!0,i.add(n),e=gf.bind(null,e,t,n),t.then(e,e))}function gf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Qu&n)===n&&(ad===4||ad===3&&(Qu&62914560)===Qu&&300>Ae()-md?Yu&2?cd|=n:Vd(e,0):cd|=n,ud===Qu&&(ud=0)),Df(e)}function _f(e,t){t===0&&(t=et()),e=_i(e,t),e!==null&&(nt(e,t),Df(e))}function vf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_f(e,n)}function yf(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),_f(e,n)}function bf(e,t){return Ee(e,t)}var xf=null,Sf=null,Cf=!1,wf=!1,Tf=!1,Ef=0;function Df(e){e!==Sf&&e.next===null&&(Sf===null?xf=Sf=e:Sf=Sf.next=e),wf=!0,Cf||(Cf=!0,Pf())}function Of(e,t){if(!Tf&&wf){Tf=!0;do for(var n=!1,r=xf;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-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=Qu,a=Xe(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,Nf(r,a))}r=r.next}while(n);Tf=!1}}function kf(){Af()}function Af(){wf=Cf=!1;var e=0;Ef!==0&&_p()&&(e=Ef);for(var t=Ae(),n=null,r=xf;r!==null;){var i=r.next,a=jf(r,t);a===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&(Sf=n)):(n=r,(e!==0||a&3)&&(wf=!0)),r=i}yd!==0&&yd!==5||Of(e,!1),Ef!==0&&(Ef=0)}function jf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(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=Xu,n=Qu,n=Xe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($u===2||$u===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),ct(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=Mf.bind(null,e),n=Ee(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function Mf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Qu;return r=Xe(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),jf(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?Mf.bind(null,e):null)}function Nf(e,t){if(df())return null;Fd(e,t,!0)}function Pf(){Sp(function(){Yu&6?Ee(Me,kf):Af()})}function Ff(){if(Ef===0){var e=Aa;e===0&&(e=Ke,Ke<<=1,!(Ke&261888)&&(Ke=256)),Ef=e}return Ef}function If(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:cn(e)}function Lf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=If((i[pt]||null).action),o=r.submitter;o&&(t=(t=o[pt]||null)?If(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new An(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ef!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Rf=0;Rf<ii.length;Rf++){var zf=ii[Rf];ai(zf.toLowerCase(),`on`+(zf[0].toUpperCase()+zf.slice(1)))}ai(Xr,`onAnimationEnd`),ai(Zr,`onAnimationIteration`),ai(Qr,`onAnimationStart`),ai(`dblclick`,`onDoubleClick`),ai(`focusin`,`onFocus`),ai(`focusout`,`onBlur`),ai($r,`onTransitionRun`),ai(ei,`onTransitionStart`),ai(ti,`onTransitionCancel`),ai(ni,`onTransitionEnd`),jt(`onMouseEnter`,[`mouseout`,`mouseover`]),jt(`onMouseLeave`,[`mouseout`,`mouseover`]),jt(`onPointerEnter`,[`pointerout`,`pointerover`]),jt(`onPointerLeave`,[`pointerout`,`pointerover`]),At(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),At(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),At(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),At(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),At(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),At(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Bf=`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(` `),Vf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Bf));function Hf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ui(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){ui(e)}i.currentTarget=null,a=c}}}}function Uf(e,t){var n=t[ht];n===void 0&&(n=t[ht]=new Set);var r=e+`__bubble`;n.has(r)||(qf(t,e,2,!1),n.add(r))}function Wf(e,t,n){var r=0;t&&(r|=4),qf(n,e,r,t)}var Gf=`_reactListening`+Math.random().toString(36).slice(2);function Kf(e){if(!e[Gf]){e[Gf]=!0,Ot.forEach(function(t){t!==`selectionchange`&&(Vf.has(t)||Wf(t,!1,e),Wf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gf]||(t[Gf]=!0,Wf(`selectionchange`,!1,t))}}function qf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!yn||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 Jf(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=St(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}gn(function(){var r=a,i=dn(n),s=[];a:{var c=ri.get(e);if(c!==void 0){var l=An,u=e;switch(e){case`keypress`:if(Tn(n)===0)break a;case`keydown`:case`keyup`:l=qn;break;case`focusin`:u=`focus`,l=Rn;break;case`focusout`:u=`blur`,l=Rn;break;case`beforeblur`:case`afterblur`:l=Rn;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=Y;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Ln;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Xn;break;case Xr:case Zr:case Qr:l=zn;break;case ni:l=Zn;break;case`scroll`:case`scrollend`:l=Mn;break;case`wheel`:l=Qn;break;case`copy`:case`cut`:case`paste`:l=Bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Jn;break;case`submit`:l=Yn;break;case`toggle`:case`beforetoggle`:l=$n}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=_n(m,p),g!=null&&d.push(Z(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==un&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[mt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?St(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Y,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Jn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:wt(c),h=l==null?u:wt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Xf):null,c!==null&&Zf(s,u,c,d,!1),l!==null&&f!==null&&Zf(s,f,l,d,!0)))}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=yr;else if(pr(c)){if(br)_=kr;else{_=Dr;var v=Er}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&an(r.elementType)&&(_=yr):_=Or;if(_&&=_(e,r)){mr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?wt(r):window,e){case`focusin`:(pr(v)||v.contentEditable===`true`)&&(Br=v,Vr=r,Hr=null);break;case`focusout`:Hr=Vr=Br=null;break;case`mousedown`:Ur=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ur=!1,Wr(s,n,i);break;case`selectionchange`:if(zr)break;case`keydown`:case`keyup`:Wr(s,n,i)}var y;if(tr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else lr?sr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ir&&n.locale!==`ko`&&(lr||b!==`onCompositionStart`?b===`onCompositionEnd`&&lr&&(y=wn()):(xn=i,Sn=`value`in xn?xn.value:xn.textContent,lr=!0)),v=Yf(r,b),0<v.length&&(b=new Vn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=cr(n),y!==null&&(b.data=y)))),(y=rr?ur(e,n):dr(e,n))&&(b=Yf(r,`onBeforeInput`),0<b.length&&(v=new Vn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Lf(s,e,r,n,i)}Hf(s,t)})}function Z(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yf(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=_n(e,n),i!=null&&r.unshift(Z(e,i,a)),i=_n(e,t),i!=null&&r.push(Z(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Xf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(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=_n(n,a),l!=null&&o.unshift(Z(n,l,c))):i||(l=_n(n,a),l!=null&&o.push(Z(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,$f=/\u0000|\uFFFD/g;function ep(e){return(typeof e==`string`?e:``+e).replace(Qf,`
|
|
9
|
-
`).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||en(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&en(e,``+r);else return;break;case`className`:zt(e,`class`,r);break;case`tabIndex`:zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:zt(e,n,r);break;case`style`:rn(e,r,o);return;case`data`:if(t!==`object`){zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);return;case`onScroll`:r!=null&&Uf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Uf(`scrollend`,e);return;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));o?.__html!==n&&(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=cn(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`credentialless`: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`:Uf(`beforetoggle`,e),Uf(`toggle`,e),Rt(e,`popover`,r);break;case`xlinkActuate`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Rt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=on.get(n)||n,Rt(e,n,r);else return}It=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:rn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)en(e,r);else if(typeof r==`number`||typeof r==`bigint`)en(e,``+r);else return;break;case`onScroll`:r!=null&&Uf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Uf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=ln);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[pt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}It=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Rt(e,n,r)}return}It=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Uf(`error`,e),Uf(`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:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Uf(`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:np(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Uf(`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:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(s in Uf(`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:np(e,t,s,c,n,null)}$t(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:np(e,t,l,r,n,null)}return;case`dialog`:Uf(`beforetoggle`,e),Uf(`toggle`,e),Uf(`cancel`,e),Uf(`close`,e);break;case`iframe`:case`object`:Uf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Bf.length;r++)Uf(Bf[r],e);break;case`image`:Uf(`error`,e),Uf(`load`,e);break;case`details`:Uf(`toggle`,e);break;case`embed`:case`source`:case`link`:Uf(`error`,e),Uf(`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:np(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(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)||np(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`:m!==f&&(It=!0),o=m;break;case`name`:m!==f&&(It=!0),a=m;break;case`checked`:m!==f&&(It=!0),u=m;break;case`defaultChecked`:m!==f&&(It=!0),d=m;break;case`value`:m!==f&&(It=!0),s=m;break;case`defaultValue`:m!==f&&(It=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Jt(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)||np(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`:o!==l&&(It=!0),p=o;break;case`defaultValue`:o!==l&&(It=!0),c=o;break;case`multiple`:o!==l&&(It=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(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:np(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`:a!==o&&(It=!0),p=a;break;case`defaultValue`:a!==o&&(It=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}Qt(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:np(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`:p!==m&&(It=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(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)&&np(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:np(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(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||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(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||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){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&&sp(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&&sp(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 lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(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 pp(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 mp(e,t,n,r){return n=dp(n).createElement(e),n[ft]=r,n[pt]=t,ip(n,e,t),Et(n),n}function hp(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 gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(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),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Ep(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 Dp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Op(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function kp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Mp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Zm(f),u>eh){s.length=o;break}f=new Promise(Np.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Hp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),mm(e,t))}Lp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,hm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Wp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=St(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Q(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Wp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Q(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Q(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=b(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[yt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){xp(function(){xp(function(t){return e(t)})})}function gm(e,t,n){switch(t=dp(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===ln&&(e.onclick=null),xt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=K.d;K.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=zd();return e||t}function wm(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[bt]=!0,o.onload=o.onerror=function(){Dt(o)}),Et(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=D({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),Et(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Tt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);Et(c),ip(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Tt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Et(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Tt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Et(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=fe.current)?xm(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`?(n=Fm(n.href),t=Tt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Fm(n.href);var o=Tt(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Rm(a,e,o,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`?(n=zm(n),t=Tt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+qt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[bt]){r.loading=1;return}}else t=e.createElement(`link`),t[bt]=!0,t.onload=t.onerror=Dt.bind(null,t),ip(t,`link`,n),Et(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function zm(e){return`[src="`+qt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),ip(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,Et(a),a):(r=n,(a=ym.get(o))&&(r=D({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),ip(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[yt]||a[ft]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:F,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function lh(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.transitionTypes=null,this.incompleteTransitions=new Map}function uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Si(3,null,null,t),e.current=a,a.stateNode=e,t=Ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ao(a),e}function dh(e){return e?(e=bi,e):bi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=so(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=co(e,r,t),n!==null&&(Pd(n,e,t),lo(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=_i(e,67108864);t!==null&&Pd(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=jd();t=st(t);var n=_i(e,t);n!==null&&Pd(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=G.T;G.T=null;var a=K.p;try{K.p=2,bh(e,t,n,r)}finally{K.p=a,G.T=i}}function yh(e,t,n,r){var i=G.T;G.T=null;var a=K.p;try{K.p=8,bh(e,t,n,r)}finally{K.p=a,G.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Jf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ye(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}Df(a),!(Yu&6)&&(gd=Ae()+500,Of(0,!1))}}break;case 31:case 13:s=_i(a,2),s!==null&&Pd(s,a,2),zd(),mh(a,2)}if(a=xh(r),a===null&&Jf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Jf(e,t,r,null,n)}}function xh(e){return e=dn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=St(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 Sh=e,null}function wh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=Ct(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=St(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,ut(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ut(e.priority,function(){gh(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 Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Ct(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=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(Ch(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.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[pt]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[pt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){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 Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,jd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),zd(),t[mt]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=lt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));K.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 Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:G,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{ze=Yh.inject(Jh),Be=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[mt]=t.current,Kf(e),new Gh(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=l(d(),1),y=_(),b=[{name:`gilt`,label:`Gilt`,mode:`dark`,accent:`#d4af37`,canvas:`#090a0c`},{name:`catppuccin-latte`,label:`Catppuccin Latte`,mode:`light`,accent:`#1e66f5`,canvas:`#e3e4e8`},{name:`catppuccin`,label:`Catppuccin Mocha`,mode:`dark`,accent:`#89b4fa`,canvas:`#161622`},{name:`coppernight`,label:`Copper Night`,mode:`dark`,accent:`#fab387`,canvas:`#0b0b12`},{name:`ethereal`,label:`Ethereal`,mode:`dark`,accent:`#7d82d9`,canvas:`#040816`},{name:`everforest`,label:`Everforest`,mode:`dark`,accent:`#7fbbb3`,canvas:`#21272c`},{name:`flexoki-light`,label:`Flexoki Light`,mode:`light`,accent:`#205ea6`,canvas:`#f2efe4`},{name:`game-boy`,label:`Game Boy`,mode:`light`,accent:`#346856`,canvas:`#88c070`,hidden:!0},{name:`gruvbox`,label:`Gruvbox`,mode:`dark`,accent:`#7daea3`,canvas:`#1e1e1e`},{name:`hackerman`,label:`Hackerman`,mode:`dark`,accent:`#82fb9c`,canvas:`#080910`},{name:`kanagawa`,label:`Kanagawa`,mode:`dark`,accent:`#dcd7ba`,canvas:`#17171e`},{name:`last-horizon`,label:`Last Horizon`,mode:`dark`,accent:`#b59790`,canvas:`#090809`},{name:`lumon`,label:`Lumon`,mode:`dark`,accent:`#8bc9eb`,canvas:`#101b21`},{name:`lupine`,label:`Lupine`,mode:`light`,accent:`#3264eb`,canvas:`#ececec`},{name:`matte-black`,label:`Matte Black`,mode:`dark`,accent:`#e68e0d`,canvas:`#0c0c0c`},{name:`miasma`,label:`Miasma`,mode:`dark`,accent:`#78824b`,canvas:`#191919`},{name:`nord`,label:`Nord`,mode:`dark`,accent:`#81a1c1`,canvas:`#222730`},{name:`oligarchy`,label:`Oligarchy`,mode:`light`,accent:`#c0271c`,canvas:`#e5dbc6`},{name:`osaka-jade`,label:`Osaka Jade`,mode:`dark`,accent:`#509475`,canvas:`#0c1512`},{name:`retro-82`,label:`Retro 82`,mode:`dark`,accent:`#faa968`,canvas:`#031222`},{name:`ristretto`,label:`Ristretto`,mode:`dark`,accent:`#f38d70`,canvas:`#211b1b`},{name:`rose-pine`,label:`Rose Pine Dawn`,mode:`light`,accent:`#56949f`,canvas:`#ede7e1`},{name:`solitude`,label:`Solitude`,mode:`dark`,accent:`#798186`,canvas:`#0c0e10`},{name:`tokyo-night`,label:`Tokyo Night`,mode:`dark`,accent:`#7aa2f7`,canvas:`#13141c`},{name:`vantablack`,label:`Vantablack`,mode:`dark`,accent:`#8d8d8d`,canvas:`#090909`},{name:`white`,label:`White`,mode:`light`,accent:`#6e6e6e`,canvas:`#f5f5f5`}],x=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})),S=o(((e,t)=>{t.exports=x()}))(),C=v.createContext(null),w=new Set,T=e=>(w.add(e),()=>w.delete(e)),E=()=>w.forEach(e=>e()),D=()=>document.documentElement.dataset.theme,O=()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`,k=()=>void 0,A=()=>window.matchMedia(`(prefers-color-scheme: dark)`),j=e=>e===`system`?A().matches:e===`dark`,M=[];function N(e){try{let t=JSON.parse(e??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):M}catch{return M}}function P(e){let t=document.createElement(`style`);t.textContent=`*,*::before,*::after{transition:none!important}`,document.head.appendChild(t),e(),getComputedStyle(document.body),setTimeout(()=>t.remove(),1)}function F({themes:e,storageKey:t,children:n}){let r=v.useSyncExternalStore(T,D,k),i=v.useSyncExternalStore(T,O,k),a=v.useCallback(n=>{let r=e.find(e=>e.name===n);if(r){P(()=>{document.documentElement.dataset.theme=r.name,document.documentElement.classList.toggle(`dark`,j(r.mode))});try{localStorage.setItem(t,r.name)}catch{}E()}},[e,t]),o=`${t}.favorites`,s=v.useSyncExternalStore(T,()=>{try{return localStorage.getItem(o)}catch{return null}},()=>null),c=v.useMemo(()=>N(s),[s]),l=v.useCallback(e=>{let t=c.includes(e)?c.filter(t=>t!==e):[...c,e];try{localStorage.setItem(o,JSON.stringify(t))}catch{return}E()},[c,o]),u=e.find(e=>e.name===r)?.mode;v.useEffect(()=>{if(u!==`system`)return;let e=A(),t=()=>{document.documentElement.classList.toggle(`dark`,e.matches),E()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[u]),v.useEffect(()=>{let e=getComputedStyle(document.documentElement).getPropertyValue(`--background`).trim();e&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e)},[r,i]);let d=v.useMemo(()=>({theme:r,resolvedMode:i,themes:e,setTheme:a,favorites:c,toggleFavorite:l}),[r,i,e,a,c,l]);return(0,S.jsx)(C,{value:d,children:n})}function I(){let e=v.useContext(C);if(!e)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function L(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.closest(`[role="listbox"], [role="combobox"], [role="dialog"]`)!==null:!1}var R=l(h(),1),z=750;function B(e,t,n){if(n||!t||!(`startViewTransition`in document))return e();let r=document.documentElement;r.classList.add(`theme-reveal`);let i=document.startViewTransition(()=>(0,R.flushSync)(e)),{x:a,y:o}=t,s=Math.hypot(Math.max(a,innerWidth-a),Math.max(o,innerHeight-o));i.ready.then(()=>r.animate({clipPath:[`circle(0px at ${a}px ${o}px)`,`circle(${s}px at ${a}px ${o}px)`]},{duration:z,easing:`cubic-bezier(0.65, 0, 0.35, 1)`,pseudoElement:`::view-transition-new(root)`})).catch(()=>{}),i.finished.finally(()=>r.classList.remove(`theme-reveal`))}var V={};function H(e,t){let n=v.useRef(V);return n.current===V&&(n.current=e(t)),n}var U=[],ee=void 0;function te(){return ee}function ne(e){U.push(e)}function W(e){let t=(t,n)=>{let r=H(ie).current,i;try{ee=r;for(let e of U)e.before(r);i=e(t,n);for(let e of U)e.after(r);r.didInitialize=!0}finally{ee=void 0}return i};return t.displayName=e.displayName||e.name,t}function re(e){return v.forwardRef(W(e))}function ie(){return{didInitialize:!1}}function ae(){}var G=Object.freeze([]),K=Object.freeze({}),q=typeof document<`u`?v.useLayoutEffect:()=>{};function oe(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var J=oe(`https://base-ui.com/production-error`,`Base UI`),se=v.createContext(void 0);function ce(e){let t=v.useContext(se);if(t===void 0&&!e)throw Error(J(72));return t}function le(e){v.useEffect(e,G)}var ue=0,de=class e{static create(){return new e}currentId=ue;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ue,t()},e)}isStarted(){return this.currentId!==ue}clear=()=>{this.currentId!==ue&&(clearTimeout(this.currentId),this.currentId=ue)};disposeEffect=()=>this.clear};function fe(){let e=H(de.create).current;return le(e.disposeEffect),e}function pe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:me,platform:he,maxTouchPoints:ge}=pe(),_e=me.toLowerCase(),ve=he.toLowerCase(),ye=/^i(os$|p)/.test(ve)||ve===`macintel`&&ge>1,be=`android`,xe=ve===be||_e.includes(be),Se=!ye&&ve.startsWith(`mac`);ve.startsWith(`win`),!xe&&/^(linux|chrome os)/.test(ve);var Ce=Se||ye,we=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Te=!we&&_e.includes(`firefox`);!we&&_e.includes(`chrom`);var Ee=Ce,De=/jsdom|happydom/.test(_e);function Oe(e){e.preventDefault(),e.stopPropagation()}function ke(e){return`nativeEvent`in e}function Ae(e){return e.pointerType===``&&e.isTrusted?!0:xe&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function je(e){return De?!1:!xe&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(xe||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Me(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ne(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Pe(){return typeof window<`u`}function Fe(e){return Re(e)?(e.nodeName||``).toLowerCase():`#document`}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){return((Re(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Re(e){return Pe()?e instanceof Node||e instanceof Ie(e).Node:!1}function ze(e){return Pe()?e instanceof Element||e instanceof Ie(e).Element:!1}function Be(e){return Pe()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function Ve(e){return!Pe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}function He(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=$e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ue(e){return/^(table|td|th)$/.test(Fe(e))}function We(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ge=/transform|translate|scale|rotate|perspective|filter/,Ke=/paint|layout|strict|content/,qe=e=>!!e&&e!==`none`,Je;function Ye(e){let t=ze(e)?$e(e):e;return qe(t.transform)||qe(t.translate)||qe(t.scale)||qe(t.rotate)||qe(t.perspective)||!Ze()&&(qe(t.backdropFilter)||qe(t.filter))||Ge.test(t.willChange||``)||Ke.test(t.contain||``)}function Xe(e){let t=tt(e);for(;Be(t)&&!Qe(t);){if(Ye(t))return t;if(We(t))return null;t=tt(t)}return null}function Ze(){return Je??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Je}function Qe(e){return/^(html|body|#document)$/.test(Fe(e))}function $e(e){return Ie(e).getComputedStyle(e)}function et(e){return ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tt(e){if(Fe(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ve(e)&&e.host||Le(e);return Ve(t)?t.host:t}function nt(e){let t=tt(e);return Qe(t)?(e.ownerDocument||e).body:Be(t)&&He(t)?t:nt(t)}function rt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=nt(e),i=r===e.ownerDocument?.body,a=Ie(r);if(i){let e=it(a);return t.concat(a,a.visualViewport||[],He(r)?r:[],e&&n?rt(e):[])}return t.concat(r,rt(r,[],n))}function it(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function at(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ot(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ve(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function st(e,t){let n=e;for(;n;){if(ze(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Ve(n)?n.host:null)}return null}function ct(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var lt=`data-base-ui-focusable`,ut=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,dt=`ArrowLeft`,ft=`ArrowRight`,pt=`ArrowUp`,mt=`ArrowDown`,ht=`data-starting-style`,gt=`data-ending-style`,_t={[ht]:``},vt={[gt]:``},yt={transitionStatus(e){return e===`starting`?_t:e===`ending`?vt:null}},bt=`data-open`,xt=`data-closed`,St=`data-anchor-hidden`,Ct=`data-popup-open`,wt=`data-pressed`,Tt={[Ct]:``},Et={[Ct]:``,[wt]:``},Dt={[bt]:``},Ot={[xt]:``},kt={[St]:``},At={open(e){return e?Tt:null}},jt={open(e){return e?Et:null}},Mt={open(e){return e?Dt:Ot},anchorHidden(e){return e?kt:null}},Nt={...Mt,...yt},Pt=`data-trigger-disabled`;function Ft(e,t){if(!ze(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Pt);for(let[,e]of t.entries())if(ot(e,n))return!e.hasAttribute(Pt);return!1}function It(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Lt(e){return e.matches(`html,body`)}function Rt(e){return Be(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function zt(e){return st(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ut}`)!=null}function Bt(e){return e?e.getAttribute(`role`)===`combobox`&&Rt(e):!1}function Vt(e){if(!e||De)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ht(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ut(e,t){return t!=null&&!Me(t)?0:typeof e==`function`?e():e}function Wt(e,t,n){let r=Ut(e,n);return typeof r==`number`?r:r?.[t]}function Gt(e){return typeof e==`function`?e():e}function Kt(e,t){return t||e===`click`||e===`mousedown`}function qt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Jt(e,t,n,r){let i=!1,a=!1,o=r??K;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Yt(e,t,n){let r=n??K;return{reason:e,event:t??new Event(`base-ui`),...r}}var Xt=`none`,Zt=`trigger-press`,Qt=`trigger-hover`,$t=`trigger-focus`,en=`outside-press`,tn=`item-press`,nn=`close-press`,rn=`clear-press`,an=`input-change`,on=`input-clear`,sn=`input-press`,cn=`focus-out`,ln=`escape-key`,un=`list-navigation`,dn=`keyboard`,fn=`pointer`,pn=`cancel-open`,mn=`sibling-open`,hn=`disabled`,gn=`missing`,_n=`initial`,vn=`imperative-action`,yn=`window-resize`,bn=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new de,currentIdRef:{current:null},currentContextRef:{current:null}});function xn(e,t){e.current=t.current}function Sn(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=v.useRef(n),a=v.useRef(n),o=v.useRef(null),s=v.useRef(null),c=fe();return q(()=>{a.current=n,o.current?i.current={open:Wt(i.current,`open`),close:Wt(n,`close`)}:i.current=n},[n,o,i,a]),(0,S.jsx)(bn.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Cn(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=v.useContext(bn),[d,f]=v.useState(!1),p=v.useRef(n);return q(()=>{p.current=n},[n]),q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Wt(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Jt(Xt))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,xn(a,s),u.clear()}},[c,i,a,r,s,u]),v.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function wn(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Tn(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function En(e,t,n,r){let i=H(On).current;return kn(i,e,t,n,r)&&jn(i,[e,t,n,r]),i.callback}function Dn(e){let t=H(On).current;return An(t,e)&&jn(t,e),t.callback}function On(){return{callback:null,cleanup:null,refs:[]}}function kn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function An(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function jn(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Mn(e){let t=H(Nn,e).current;return t.next=e,q(t.effect),t}function Nn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Pn={...v},Fn=Pn.useInsertionEffect,In=Fn&&Fn!==Pn.useLayoutEffect?Fn:e=>e();function Y(e){let t=H(Ln).current;return t.next=e,In(t.effect),t.trampoline}function Ln(){let e={next:void 0,callback:Rn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Rn(){}var zn=null;globalThis.requestAnimationFrame;var Bn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Vn=class e{static create(){return new e}static request(e){return Bn.request(e)}static cancel(e){return Bn.cancel(e)}currentId=zn;request(e){this.cancel(),this.currentId=Bn.request(()=>{this.currentId=zn,e()})}cancel=()=>{this.currentId!==zn&&(Bn.cancel(this.currentId),this.currentId=zn)};disposeEffect=()=>this.cancel};function Hn(){let e=H(Vn.create).current;return le(e.disposeEffect),e}function Un(e){return e?.ownerDocument||document}var Wn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Gn={...Wn,position:`fixed`,margin:0,top:0,left:0},Kn={...Wn,position:`absolute`},qn=v.forwardRef(function(e,t){let[n,r]=v.useState();q(()=>{Ee&&we&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,S.jsx)(`span`,{...e,ref:t,style:Gn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Jn=Math.min,Yn=Math.max,Xn=Math.round,Zn=Math.floor,Qn=e=>({x:e,y:e}),$n={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function er(e,t,n){return Yn(e,Jn(t,n))}function tr(e,t){return typeof e==`function`?e(t):e}function nr(e){return e.split(`-`)[0]}function rr(e){return e.split(`-`)[1]}function ir(e){return e===`x`?`y`:`x`}function ar(e){return e===`y`?`height`:`width`}function or(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sr(e){return ir(or(e))}function cr(e,t,n){n===void 0&&(n=!1);let r=rr(e),i=sr(e),a=ar(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_r(o)),[o,_r(o)]}function lr(e){let t=_r(e);return[ur(e),t,ur(t)]}function ur(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dr=[`left`,`right`],fr=[`right`,`left`],pr=[`top`,`bottom`],mr=[`bottom`,`top`];function hr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fr:dr:t?dr:fr;case`left`:case`right`:return t?pr:mr;default:return[]}}function gr(e,t,n,r){let i=rr(e),a=hr(nr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ur)))),a}function _r(e){let t=nr(e);return $n[t]+e.slice(t.length)}function vr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function yr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vr(e)}function br(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xr(e,t,n){return Math.floor(e/t)!==n}function Sr(e,t){return t<0||t>=e.length}function Cr(e,t){return Er(e.current,{disabledIndices:t})}function wr(e,t){return Er(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Tr(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Er(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Sr(e,u)?-1:u,wrapped:d}}function Er(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Or(e,a,r));return a}function Dr(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=st(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Or(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Zn(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Or(e,r,s))return r}};d&&Oe(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Er(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Er(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Sr(e,f)&&(f=u)}if(n===`both`){let n=Zn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Oe(t),u%o===o-1?r&&(f=Er(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Er(e,{startingIndex:u,disabledIndices:s}),r&&xr(f,o,n)&&(f=Er(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),xr(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Oe(t),u%o===0?r&&(f=Er(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Er(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&xr(f,o,n)&&(f=Er(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),xr(f,o,n)&&(f=u));let c=Zn(l/o)===n;Sr(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Er(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Or(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Ar(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function kr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Ar(e,t=e?$e(e):null){return!e||!e.isConnected||!t||kr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var jr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Mr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Ve(n)?n.host:null}function Nr(e){for(let t of Array.from(e.children))if(Fe(t)===`summary`)return t;return null}function Pr(e,t){let n=Nr(t);return!!n&&(e===n||ot(n,e))}function Fr(e){let t=e?Fe(e):``;return e!=null&&e.matches(jr)&&(t!==`summary`||e.parentElement!=null&&Fe(e.parentElement)===`details`&&Nr(e.parentElement)===e)&&(t!==`details`||Nr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ir(e){if(!Fr(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Mr(t)){let n=t!==e,r=Fe(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Fe(t)===`details`&&!t.open&&!Pr(e,t)||t.hasAttribute(`hidden`)||!r&&!Lr(t,n))return!1}return!0}function Lr(e,t){let n=$e(e);return t?n.display!==`none`:Ar(e,n)}function Rr(e){let t=e.tabIndex;if(t<0){let t=Fe(e);if(t===`details`||t===`audio`||t===`video`||Be(e)&&e.isContentEditable)return 0}return t}function zr(e){if(Fe(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Br(e,t){let n=zr(e);if(!n)return!0;let r=t.find(e=>{let t=zr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=zr(e);return t?.name===n.name&&t.form===n.form})===n}function Vr(e){if(Be(e)&&Fe(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Be(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Hr(e,t){Vr(e).forEach(e=>{Fr(e)&&t.push(e),Hr(e,t)})}function Ur(e,t,n){Vr(e).forEach(e=>{Be(e)&&e.matches(t)&&n.push(e),Ur(e,t,n)})}function Wr(e){return Ir(e)&&Rr(e)>=0}function Gr(e){let t=[];return Hr(e,t),t.filter(Ir)}function Kr(e){let t=Gr(e);return t.filter(e=>Rr(e)>=0&&Br(e,t))}function qr(e,t){let n=Kr(e),r=n.length;if(r===0)return;let i=at(Un(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Jr(e){return qr(Un(e).body,1)||e}function Yr(e){return qr(Un(e).body,-1)||e}function Xr(e,t,n){if(!e)return null;let r=[];Hr(Un(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Ir);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!ot(n,o)&&Wr(o)&&Br(o,a))return o}return r[i]}function Zr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!ot(n,r)}function Qr(e){Kr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function $r(e){let t=[];Ur(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ei(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ei(e,t.id,n)])}function ti(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ni(e){return`data-base-ui-${e}`}var ri=0;function ii(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ri);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),ae;let o=requestAnimationFrame(a);return ri=o,()=>{ri===o&&(cancelAnimationFrame(o),ri=0)}}var ai=`data-base-ui-inert`,oi=new WeakMap,si=new WeakSet,ci=new WeakMap,li=0;function ui(e){return e?Ve(e)?e.host:ui(e.parentNode):null}var di=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ui(t);return e.contains(n)?n:null}).filter(e=>e!=null),fi=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},pi=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Fe(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function mi(e,t,n,{mark:r=!0}){let i=di(t,e),a=r?pi(t,fi(i),new Set(i)):[],o=[],s=[];if(n){let e=di(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);pi(t,fi(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(oi.get(e)||0)+1;oi.set(e,r),o.push(e),r===1&&n&&si.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(ci.get(e)||0)+1;ci.set(e,t),s.push(e),t===1&&e.setAttribute(ai,``)}),li+=1,()=>{o.forEach(e=>{let t=(oi.get(e)||0)-1;oi.set(e,t),t||(si.has(e)||e.removeAttribute(`aria-hidden`),si.delete(e))}),r&&s.forEach(e=>{let t=(ci.get(e)||0)-1;ci.set(e,t),t||e.removeAttribute(ai)}),--li,li||(oi=new WeakMap,si=new WeakSet,ci=new WeakMap)}}function hi(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Un(e[0]).body;return mi(e,i,n,{mark:r})}function gi(){let[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}var _i=0;function vi(e,t=`mui`){let n=v.useRef(void 0),r=gi(),i=e??n.current;return v.useEffect(()=>{n.current??(_i+=1,n.current=`${t}-${_i}`,e??r())},[e,t,r]),i}var yi=Pn.useId;function bi(e,t){if(yi!==void 0){let n=yi();return e??(t?`${t}-${n}`:n)}return vi(e,t)}var xi=19;function Si(e){return xi>=e}function Ci(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Si(19)?n?.ref:t.ref)??null}function wi(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ti(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Ei(e,t){return typeof e==`function`?e(t):e}function Di(e,t){return typeof e==`function`?e(t):e}var Oi={};function ki(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ji(t);let a=ji(e);return t&&(a=Mi(a,t)),n&&(a=Mi(a,n)),r&&(a=Mi(a,r)),i&&(a=Mi(a,i)),a}function Ai(e){if(e.length===0)return Oi;if(e.length===1)return ji(e[0]);let t=ji(e[0]);for(let n=1;n<e.length;n+=1)t=Mi(t,e[n]);return t}function ji(e){return Ii(e)?{...e(Oi)}:Ni(e)}function Mi(e,t){return Ii(t)?t(e):Pi(e,t)}function Ni(e){let t={...e};for(let e in t){let n=t[e];Fi(e,n)&&(t[e]=Ri(n))}return t}function Pi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=wi(e.style,r);break;case`className`:e[n]=Bi(e.className,r);break;default:e[n]=Fi(n,r)?Li(e[n],r):r}}return e}function Fi(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ii(e){return typeof e==`function`}function Li(e,t){return t?e?(...n)=>{let r=n[0];if(Vi(r)){let i=r;zi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ri(t):e}function Ri(e){return e&&((...t)=>{let n=t[0];return Vi(n)&&zi(n),e(...t)})}function zi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Bi(e,t){return t?e?t+` `+e:t:e}function Vi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Hi(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ki(r));let i=Ui(t,n,r);if(n.enabled===!1)return null;let a=n.state??K;return qi(e,r,i,a)}function Ui(e,t,n){let{className:r,style:i}=e,{state:a=K,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ei(r,a):void 0,d=l?Di(i,a):void 0,f=l?Ti(a,c):K,p=l&&s?Wi(s):void 0,m=l?wi(f,p)??{}:K;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Dn([m.ref,Ci(n),...o]):En(m.ref,Ci(n),o):En(null,null)),l?(u!==void 0&&(m.className=Bi(m.className,u)),d!==void 0&&(m.style=wi(m.style,d)),m):K}function Wi(e){return Array.isArray(e)?Ai(e):ki(void 0,e)}var Gi=Symbol.for(`react.lazy`);function Ki(e){if(e?.$$typeof!==Gi)return e;let t=v.Children.toArray(e)[0];return v.isValidElement(t)?t:e}function qi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ki(n,t.props);return e.ref=n.ref,v.cloneElement(t,e)}return Ji(e,n)}function Ji(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var Yi={style:{transition:`none`}},Xi=`data-base-ui-click-trigger`,Zi={fallbackAxisSide:`none`},Qi={fallbackAxisSide:`end`},$i={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ea=v.createContext(null),ta=()=>v.useContext(ea),na=ni(`portal`);function ra(e={}){let{ref:t,container:n,componentProps:r=K,elementProps:i}=e,a=bi(),o=ta()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Y(e=>{e!==null&&u(e)}),f=v.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Re(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Hi(`div`,r,{ref:[t,d],props:[{id:a,[na]:``},i]}),m=s&&p?R.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var ia=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ra({container:o,ref:t,componentProps:e,elementProps:c}),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),h=v.useRef(null),[g,_]=v.useState(null),y=v.useRef(!1),b=g?.modal,x=g?.open,C=!!g&&!g.modal&&g.open&&!!l;v.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&Zr(e)&&(e.type===`focusin`?y.current&&=($r(l),!1):(Qr(l),y.current=!0))}return Tn(wn(l,`focusin`,e,!0),wn(l,`focusout`,e,!0))},[l,b]),q(()=>{l&&x===!0&&y.current&&($r(l),y.current=!1)},[x,l]);let w=v.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,S.jsxs)(v.Fragment,{children:[d,(0,S.jsxs)(ea.Provider,{value:w,children:[C&&l&&(0,S.jsx)(qn,{"data-type":`outside`,ref:f,onFocus:e=>{Zr(e,l)?m.current?.focus():Yr(g?g.domReference:null)?.focus()}}),C&&l&&(0,S.jsx)(`span`,{role:s,"aria-owns":u,style:$i}),l&&R.createPortal(a,l),C&&l&&(0,S.jsx)(qn,{"data-type":`outside`,ref:p,onFocus:e=>{Zr(e,l)?h.current?.focus():(Jr(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Jt(`focus-out`,e.nativeEvent)))}})]})]})});function aa(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var oa=class{nodesRef={current:[]};events=aa();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},sa=v.createContext(null),ca=v.createContext(null),la=()=>v.useContext(sa)?.id||null,ua=e=>{let t=v.useContext(ca);return e??t};function da(e){let t=bi(),n=ua(e),r=la();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fa(e){let{children:t,id:n}=e,r=la();return(0,S.jsx)(sa.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pa(e){let{children:t,externalTree:n}=e,r=H(()=>n??new oa).current;return(0,S.jsx)(ca.Provider,{value:r,children:t})}function ma(e){return e==null?e:`current`in e?e.current:e}function ha(e,t){let n=Ie(ct(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Ae(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ga=20,_a=[];function va(){_a=_a.filter(e=>e.deref()?.isConnected)}function ya(e){va(),e&&Fe(e)!==`body`&&(_a.push(new WeakRef(e)),_a.length>ga&&(_a=_a.slice(-20)))}function ba(){return va(),_a[_a.length-1]?.deref()}function xa(e){return e?Wr(e)?e:Kr(e)[0]||e:null}function Sa(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Gr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Wr(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Ca(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,C=Y(()=>x.current.floatingContext?.nodeId),w=i===!1,T=Bt(_)&&w,E=Mn(i),D=Mn(a),O=Mn(o),k=Mn(u),A=Mn(g),j=ua(m),M=ta(),N=v.useRef(!1),P=v.useRef(!1),F=v.useRef(!1),I=v.useRef(null),L=v.useRef(``),R=v.useRef(``),z=v.useRef(null),B=v.useRef(null),V=En(z,p,M?.beforeInsideRef),H=En(B,M?.afterInsideRef),U=fe(),ee=fe(),te=Hn(),ne=M!=null,W=Ht(y),re=Y((e=W)=>e?Kr(e):[]),ie=Y(()=>h?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&ot(W,at(Un(W)))&&re().length===0&&!T&&Oe(e)}return wn(Un(W),`keydown`,e)},[r,W,c,T,re]),v.useEffect(()=>{if(r||!g)return;let e=Un(W);function t(){F.current=!1}function n(e){let t=ct(e),n=ie(),r=ot(y,t)||ot(_,t)||ot(M?.portalNode,t)||n.some(e=>e===t||ot(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,st(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,ee.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return Tn(wn(e,`pointerdown`,n,!0),wn(e,`pointerup`,t,!0),wn(e,`pointercancel`,t,!0),wn(e,`keydown`,i,!0),t)},[r,y,_,W,g,M,ee,ie]),v.useEffect(()=>{if(r||!l)return;let e=Un(W);function n(){P.current=!0,ee.start(0,()=>{P.current=!1})}function i(e){let t=ct(e);Wr(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ct(n);c&&r==null&&a!=null&&ot(y,a)&&ya(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=ie(),p=r?.hasAttribute(ni(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,ma(f),ma(d)].includes(r),m=!(ot(_,r)||ot(y,r)||ot(r,y)||ot(M?.portalNode,r)||u.some(e=>e===r||ot(e,r))||l.hasMatchingElement(e=>ot(e,r))||p||j&&(ei(j.nodesRef.current,o).find(e=>ot(e.context?.elements.floating,r)||ot(e.context?.elements.domReference,r))||ti(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,Ht(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&W&&Sa(W),s&&i!==_&&!Ar(a)&&at(e)===e.body){if(Be(W)&&(W.focus(),s===`popup`)){te.request(()=>{W.focus()});return}let e=re(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;Be(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==ba())&&(N.current=!0,t.setOpen(!1,Jt(cn,n)))})}function o(){F.current||(x.current.insideReactTree=!0,U.start(0,()=>{x.current.insideReactTree=!1}))}let u=Be(_)?_:null;if(y||u)return Tn(u&&wn(u,`focusout`,a),u&&wn(u,`pointerdown`,n),y&&wn(y,`focusin`,i),y&&wn(y,`focusout`,a),y&&M&&wn(y,`focusout`,o,!0))},[r,_,y,W,c,j,M,t,l,s,re,T,C,x,U,ee,te,d,f,ie]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${ni(`portal`)}]`)||[]),t=(j?ti(j.nodesRef.current,C()):[]).find(e=>Bt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=hi([y,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...ie(),t,ma(f),ma(d),T?_:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=hi([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,c,M,T,j,C,d,f,ie]),q(()=>{if(!g||r||!Be(W))return;L.current=``,R.current=``;let e=Un(W),t=at(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||ot(W,t))return;let i=null,a=()=>(i??=re(W),i[0]||W),o;o=r===!0||r===null?a():ma(r),o||=a();let s=ot(W,at(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&Ae(c);ii(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=at(e);return!(t!==o&&ot(W,t))}})})},[r,g,W,re,E,k,A,x]);let ae=v.useRef(null);q(()=>{if(r||!W){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=Un(W),t=at(e),n=k.current==null;ya(t);function i(e){if(e.open||(L.current=ha(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(ni(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(Ae(e.nativeEvent)||je(e.nativeEvent))N.current=!1;else{let e=!1;Un(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}b.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Fe(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ba()||null,typeof i==`boolean`?s:ma(i)||s||null}return()=>{b.off(`openchange`,i);let t=at(e),n=ie(),r=ot(y,t)||n.some(e=>e===t||ot(e,t))||j&&ei(j.nodesRef.current,C(),!1).some(e=>ot(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=xa(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&Be(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,y,W,D,O,k,b,j,_,C,ie]),q(()=>{if(!we||g||!y)return;let e=at(Un(y));Be(e)&&Rt(e)&&ot(y,e)&&e.blur()},[g,y]),q(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,l,_]),q(()=>{if(!r&&W)return Sa(W),()=>{queueMicrotask(va)}},[r,W]);let G=!r&&(!c||!T)&&(ne||c);return(0,S.jsxs)(v.Fragment,{children:[G&&(0,S.jsx)(qn,{"data-type":`inside`,ref:V,onFocus:e=>{if(c){let e=re();ii(e[e.length-1])}else M?.portalNode&&(N.current=!1,Zr(e,M.portalNode)?Jr(_)?.focus():ma(f??M.beforeOutsideRef)?.focus())}}),n,G&&(0,S.jsx)(qn,{"data-type":`inside`,ref:H,onFocus:e=>{c?ii(re()[0]):M?.portalNode&&(l&&(N.current=!0),Zr(e,M.portalNode)?Yr(_)?.focus():ma(d??M.afterOutsideRef)?.focus())}})]})}function wa(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Zt}=t,l=e.context.dataRef,u=v.useRef(void 0),d=Hn(),f=fe(),p=v.useMemo(()=>{function t(t,n,r,i){let a=Jt(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Me(e.pointerType,!0)&&je(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Me(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=ct(s),p=Rt(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Me(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return v.useMemo(()=>n?{reference:p}:K,[n,p])}function Ta(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Ea(e){return e!=null&&e.clientX!=null}function Da(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=v.useRef(!1),l=v.useRef(null),[u,d]=v.useState(),[f,p]=v.useState([]),m=Y(t=>{e.set(`positionReference`,t)}),h=Y((t,n,i)=>{c.current||(!s.current.openEvent||Ea(s.current.openEvent))&&e.set(`positionReference`,Ta(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=Y(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Me(u)?a:i;v.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=Ie(a);function r(t){let n=ct(t);ot(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Ea(s.current.openEvent)?l.current=wn(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),v.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),v.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),v.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=v.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return v.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Oa(){return!1}function ka(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Aa(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Oa,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=ua(c),m=Y(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Y(()=>a),{escapeKey:y,outsidePress:b}=ka(s),x=v.useRef(!1),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(!1),E=v.useRef(``),D=v.useRef(null),O=fe(),k=fe(),A=fe(),j=Y(()=>{k.clear(),d.current.insideReactTree=!1}),M=Y(e=>{let t=d.current.floatingContext?.nodeId;return(p?ei(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(t=>It(t,e.select(`floatingElement`))||It(t,e.select(`domReferenceElement`))),P=Y(t=>{o()&&e.setOpen(!1,Jt(Zt,t.nativeEvent))}),F=Y(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ke(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=Jt(ln,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Y(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=Y(t=>{if(!l||!n||t.button!==0)return;let r=ct(t.nativeEvent);ot(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});v.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),v.useEffect(()=>j,[j]),v.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new de,i=Un(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(we?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=d.current.floatingContext?.nodeId,n=p&&ei(p.nodesRef.current,t).some(t=>It(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=ct(n),i=`[${ni(`inert`)}]`,a=ze(r)?r.getRootNode():null,o=Array.from((Ve(a)?a:Un(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>ot(e,r))))return;let c=ze(r)?r:null;for(;c&&!Qe(c);){let e=tt(c);if(Qe(e)||!ze(e))break;c=e}if(!(o.length&&ze(r)&&!Lt(r)&&!ot(r,e.select(`floatingElement`))&&o.every(e=>!ot(c,e)))){if(Be(r)&&!(`touches`in n)){let e=Qe(r),t=$e(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!v(n)){if(f()===`intentional`){if(n.detail!==0&&!Ae(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof h!=`function`||h(n))&&(M(`__outsidePressBubbles`)||(e.setOpen(!1,Jt(en,n)),j()))}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=ct(e);if(!n)return;let r=wn(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():v(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function V(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function H(e){L(e,V)}function U(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ee(e){L(e,U)}let te=Tn(r&&Tn(wn(i,`keydown`,F),wn(i,`compositionstart`,a),wn(i,`compositionend`,o)),g&&Tn(wn(i,`click`,z,!0),wn(i,`pointerdown`,z,!0),wn(i,`pointerup`,B,!0),wn(i,`pointercancel`,B,!0),wn(i,`mousedown`,z,!0),wn(i,`mouseup`,B,!0),wn(i,`touchstart`,R,{capture:!0,passive:!0}),wn(i,`touchmove`,H,{capture:!0,passive:!0}),wn(i,`touchend`,ee,{capture:!0,passive:!0})));return()=>{te(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,y,b,F,j,_,M,N,p,e,O,A]);let z=v.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=v.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return v.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}var ja=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(J(99,this.componentName,e,this.componentName));t.setOpen(!0,Jt(vn,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,Jt(vn))}};function Ma(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ze(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Na(e,t=!1,n=!1,r=!1){let[i,a]=v.useState(e&&t?`idle`:void 0),[o,s]=v.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=Vn.request(()=>{a(`ending`)});return()=>{Vn.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=Vn.request(()=>{a(void 0)});return()=>{Vn.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Vn.request(()=>{a(`idle`)});return()=>{Vn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Pa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Fa=null;function Ia(e){if(!Fa){let e=[];Fa=e,queueMicrotask(()=>{Fa=null,R.flushSync(()=>{for(let t of e)t()})})}Fa.push(e)}function La(e,t=!1,n=!1){let r=Hn();return Y((i,a=null)=>{r.cancel();let o=ma(e);if(o==null)return;let s=o,c=()=>{n?Ia(()=>{a?.aborted||i()}):R.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Pa(s).map(e=>e.finished.then(ae))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Pa(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=ht;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Ra(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Y(a),s=La(r,n,i);v.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function za(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Y(i),{mounted:c,setMounted:l,transitionStatus:u}=Na(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=v.useRef(c),p=v.useRef(!1),m=gi(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=Y(()=>{f.current&&(t?(p.current=!0,m()):h())});return Ra({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Ba={tabIndex:-1,[lt]:``};function Va(e){return t=>t!==`touch`||e.current}function Ha(e,t=!1){let n=bi(),r=la()!=null,i=H(()=>e(n,r)).current;return Ma({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ua({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Wa(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Ga(e,t){let n=v.useRef(null);return Y(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Wa(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Wa(t))})}function Ka(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function qa(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ja(e,t,n,r={}){let i=n.reason,a=i===Qt,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=qa(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Ka(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?R.flushSync(l):l()}function Ya(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Ga(e,n),o=Y(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Y(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Xa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Jt(Xt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Za(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=za({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return H(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Qa(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:K,inactiveTriggerProps:K,popupProps:K})},[e])}function $a(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var eo=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},to=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),no=o(((e,t)=>{t.exports=to()})),ro=o((e=>{var t=d(),n=no();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),io=o(((e,t)=>{t.exports=ro()})),ao=no(),oo=io(),so=Si(19)?uo:fo;function co(e,t,n,r,i){return so(e,t,n,r,i)}function lo(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ao.useSyncExternalStore)(e.subscribe,a,a)}ne({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ao.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function uo(e,t,n,r,i){let a=te();if(!a)return lo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function fo(e,t,n,r,i){return(0,oo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var po=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return co(this,e,t,n,r)}},mo=class extends po{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),co(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Y(t??ae);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},ho={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},go=class extends mo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:aa(),nested:n,triggerElements:i},ho),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Ne(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function _o(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new go({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:K,inactiveTriggerProps:K,popupProps:K}}var vo=e=>e.triggerIdProp??e.activeTriggerId,yo=e=>e.openProp??e.open,bo=e=>(e.popupElement?.id??e.floatingId)||void 0;function xo(e,t){return t!==void 0&&yo(e)&&vo(e)===t}function So(e,t){return xo(e,t)?!0:t!==void 0&&yo(e)&&vo(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Co={open:yo,mounted:e=>e.mounted,transitionStatus:e=>yo(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:vo,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:bo,isTriggerActive:(e,t)=>t!==void 0&&vo(e)===t,isOpenedByTrigger:(e,t)=>xo(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&vo(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>So(e,t)?bo(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function wo(e){let t=v.useCallback(t=>e===void 0?ae:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,ao.useSyncExternalStore)(t,n,()=>e?.serverStore)}function To(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=bi(),a=la()!=null,o=H(()=>new go({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new eo,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ze(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Eo=Se&&we;function Do(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=v.useRef(!1),s=v.useRef(null),c=v.useRef(!0),l=fe();v.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Ie(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Be(t)&&t===at(Un(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Tn(wn(r,`blur`,i),Eo&&wn(r,`keydown`,a,!0),Eo&&wn(r,`pointerdown`,l,!0))},[e,n]),v.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);ze(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=v.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=ct(n.nativeEvent);if(ze(a)){if(Eo&&!n.relatedTarget){if(!c.current&&!Rt(a))return}else if(!Vt(a))return}let u=Ft(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Jt($t,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Jt($t,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=ze(r)&&r.hasAttribute(ni(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=at(Un(t));(r||n!==t)&&(ot(a.current.floatingContext?.refs.floating.current,n)||ot(t,n)||o||Ft(r??n,e.context.triggerElements)||e.setOpen(!1,Jt($t,i)))})}}},[a,r,e,l]);return v.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Oo=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new de;restTimeout=new de;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ko=new WeakMap;function Ao(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ko.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ko.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function jo(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ko.get(n);a&&a!==e&&Ao(a),Ao(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ko.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Mo(e){let t=e.context.dataRef.current,n=H(()=>t.hoverInteractionState??Oo.create()).current;return t.hoverInteractionState||=n,le(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function No(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=ua(),u=la(),d=Mo(e),f=fe(),p=Y(()=>Kt(c.current.openEvent?.type,d.interactedInside)),m=Y(()=>qt(c.current.openEvent?.type)),h=Y(()=>{Ao(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),v.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&ze(s)&&o){let e=s,t=o,n=Un(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??st(e,`[data-rootownerid]`)??n.body;return jo(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),v.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ei(l.nodesRef.current,u).length>0)}function a(t){let n=Wt(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Jt(Qt,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=ct(e);zt(t)?d.interactedInside=st(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ft(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&ze(o)&&ei(l.nodesRef.current,r,!1).some(e=>ot(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,Jt(Qt,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Tn(y&&wn(y,`mouseenter`,g),y&&wn(y,`mouseleave`,_),y&&wn(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Po={current:null};function Fo(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Po,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=ua(l),y=Mo(e),b=v.useRef(!1),x=Mn(i),S=Mn(r),C=Mn(o),w=Mn(n),T=Mn(p),E=Mn(f),D=Y(()=>Kt(h.current.openEvent?.type,y.interactedInside)),O=Y(()=>T.current?.()!==!1),k=Y((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!ot(t,n);if(!ze(r))return!1;let a=r;return i.hasMatchingElement(e=>ot(e,a))&&(!t||!ot(t,a))}),A=Y(()=>{y.handler&&=(Un(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Y(()=>{Ao(y)});return u&&(y.handleCloseOptions=i?.__options),v.useEffect(()=>A,[A]),v.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Qt,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),v.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Wt(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,Jt(Qt,t)),_?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,Jt(Qt,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!ze(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Me(y.pointerType))return;let n=Gt(C.current),r=Wt(S.current,`open`,y.pointerType),i=ct(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(ze(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(ot(t,i)){c=t;break}}ze(o)&&ze(s)&&!e.context.triggerElements.hasElement(o)&&ot(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&ze(c)&&ze(s)&&ot(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,Jt(Qt,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,Jt(Qt,t,c))}):g&&O()&&e.setOpen(!0,Jt(Qt,t,c)))}function o(n){if(D()){j();return}A();let r=Un(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ft(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else(y.pointerType!==`touch`||!ot(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){ot(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?wn(r,`mouseout`,l):void 0;return s?Tn(wn(r,`mousemove`,i,{once:!0}),wn(r,`mouseenter`,i),wn(r,`mouseleave`,o),f):Tn(wn(r,`mouseenter`,i),wn(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,_,w,d,E,O,m]),v.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!Me(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;jo(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Gt(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,Jt(Qt,n,r))}y.pointerType===`touch`?R.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Io(e){return we&&e.movementX===0&&e.movementY===0}function Lo(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Ro(e,t){return Lo(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function zo(e,t,n){return Lo(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Bo(e,t,n){return Lo(t,n?e===dt:e===ft,e===mt)}function Vo(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Lo(t,n?e===ft:e===dt,e===pt)}function Ho(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=Ht(D),j=Bt(O),M=Mn(A),N=la(),P=ua(S),F=v.useRef(f),I=v.useRef(o??-1),L=v.useRef(null),R=v.useRef(!0),z=Y(e=>{i(I.current===-1?null:I.current,e)}),B=v.useRef(!!D),V=v.useRef(E),H=v.useRef(!1),U=v.useRef(!1),ee=v.useRef(null),te=Mn(h),ne=Mn(E),W=Mn(o),re=Mn(x),ie=Hn(),ae=Hn(),G=Y(()=>{ie.cancel();function e(e){d||(ee.current=ii(e,{sync:H.current,preventScroll:!0}))}let t=n.current[I.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),le&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{k.current.orientation=g},[k,g]),q(()=>{E||(L.current=null),(!E||f!==`auto`)&&(F.current=f)},[E,f]),q(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(U.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),q(()=>{if(a){if(!E)H.current=!1;else if(D){if(r==null){if(H.current=!1,W.current!=null)return;if(B.current&&(I.current=-1,G()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||zo(L.current,_,u)||l?Cr(n):wr(n),L.current=null,z())};t()}}else Sr(n.current,r)||(I.current=r,G(),U.current=!1)}}},[a,E,D,r,W,l,n,_,u,z,G,ae]),q(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=at(Un(O??t??null)),r=e.some(e=>e.context&&ot(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),q(()=>{V.current=E,B.current=!!D});let K=r!=null,oe=Y(e=>{if(!ne.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),J=Y(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),se=Y(()=>Cr(n,te.current)),ce=Y(t=>{if(R.current=!1,H.current=!0,t.which===229||!ne.current&&t.currentTarget===M.current)return;if(l&&Vo(t.key,g,u,T)){Ro(t.key,J())||Oe(t),e.setOpen(!1,Jt(un,t.nativeEvent));let n=C?.current??O;Be(n)&&n.focus();return}r!=null&&r!==I.current&&!Sr(n.current,r)&&(I.current=r);let i=I.current,a=Cr(n,h),o=wr(n,h);if(j||(t.key===`Home`&&(Oe(t),I.current=a,z(t)),t.key===`End`&&(Oe(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(Ro(t.key,g)){Oe(t);let e=at(t.currentTarget.ownerDocument);if(E&&!d&&ot(t.currentTarget,e)&&!n.current.some(t=>t!=null&&ot(t,e))){I.current=zo(t.key,g,u)?a:o,z(t),r===I.current&&G();return}let{index:l,wrapped:f}=Tr(n.current,i,{decrement:!zo(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(H.current=!1),I.current=l,z(t)}}),le=v.useMemo(()=>({onFocus(e){H.current=!0,oe(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Io(e)||(H.current=!0,U.current=!1,p&&oe(e))},onPointerLeave(e){if(!ne.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(ee.current?.(),ee.current=null,I.current=-1,z(e),!d)){let e=M.current,t=at(Un(e));e&&ot(e,t)&&e.focus({preventScroll:!0})}}}),[oe,ne,M,p,n,z,re,d]),ue=v.useMemo(()=>d&&E&&K&&{"aria-activedescendant":`${b}-${r}`},[d,E,K,b,r]),de=v.useMemo(()=>({...j?{}:ue,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=ct(t.nativeEvent);if(n&&!ot(M.current,n))return;Oe(t);let r=Jt(cn,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&Be(i)&&i.focus()}else ce(t)},onPointerMove(e){Io(e)||(R.current=!0)}}),[ue,ce,M,j,e,E,d,O,C]),fe=v.useMemo(()=>{function t(t){e.setOpen(!0,Jt(un,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Ae(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&je(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Bo(n.key,J(),u),o=Ro(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Rt(n.currentTarget)))return ce(n);if(r||m||!i){if(s){let e=Ro(n.key,J());L.current=l&&e?null:n.key}l?a&&(Oe(n),r?(I.current=se(),z(n),d&&M.current?.focus()):t(n)):o&&(W.current!=null&&(I.current=W.current),Oe(n),!r&&m?t(n):ce(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ce,f,se,l,z,e,m,g,_,J,u,W,d,M]),pe=v.useMemo(()=>({...ue,...fe}),[ue,fe]);return v.useMemo(()=>a?{reference:pe,floating:de,item:le,trigger:fe}:{},[a,pe,de,fe,le])}function Uo(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Y(s),f=e.useState(`open`),p=fe(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Ar(n)||n?.matches(`:disabled`)?!1:o==null||!Or(G,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Oe(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Oe(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);ot(r,n)||ot(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=v.useMemo(()=>({onKeyDown:_,onBlur:y}),[_,y]);return v.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Wo=.1,Go=Wo*Wo,Ko=.5;function qo(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Jo(e,t,n,r,i,a,o,s,c,l){let u=!1;return qo(e,t,n,r,i,a)&&(u=!u),qo(e,t,i,a,o,s)&&(u=!u),qo(e,t,o,s,c,l)&&(u=!u),qo(e,t,c,l,n,r)&&(u=!u),u}function Yo(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Xo(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Zo(e={}){let{blockPointerEvents:t=!1}=e,n=new de,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Go;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ct(r),g=r.type===`mouseleave`,_=ot(u,h),v=ot(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ze(r.relatedTarget)&&ot(u,r.relatedTarget))return;function y(){return!!(s&&ei(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Xo(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Xo(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Xo(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Xo(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Yo(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Ko/2:Ko*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Ko+1,o=C||T?S.bottom-Ko:S.top,s=C?T?S.bottom-Ko:S.top:S.bottom-Ko;M=Jo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Ko/2:Ko*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Ko,o=C||T?S.top+Ko:S.bottom,s=C?T?S.top+Ko:S.bottom:S.top+Ko;M=Jo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Ko/2:Ko*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Ko+1,o=w||E?S.right-Ko:S.left,s=w?E?S.right-Ko:S.left:S.right-Ko;M=Jo(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Ko/2:Ko*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Ko,o=w||E?S.left+Ko:S.right,s=w?E?S.left+Ko:S.right:S.left+Ko;M=Jo(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Qo(e,t,n){let{reference:r,floating:i}=e,a=or(t),o=sr(t),s=ar(o),c=nr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=rr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function $o(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=tr(t,e),p=yr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=br(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=br(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var es=50,ts=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$o},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<es&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Qo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ns=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=tr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nr(r),_=or(o),v=nr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_r(o)]:lr(o)),x=p!==`none`;!d&&x&&b.push(...gr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=cr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===or(t)||T.every(e=>or(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=or(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},rs=new Set([`left`,`top`]);async function is(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nr(n),s=rr(n),c=or(n)===`y`,l=rs.has(o)?-1:1,u=a&&c?-1:1,d=tr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var as=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await is(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},os=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=tr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=or(i),p=ir(f),m=u[p],h=u[f],g=(e,t)=>er(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ss=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=tr(e,t),u={x:n,y:r},d=or(i),f=ir(d),p=u[f],m=u[d],h=tr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=rs.has(nr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cs=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=tr(e,t),c=await i.detectOverflow(t,s),l=nr(n),u=rr(n),d=or(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Jn(p-c[m],g),y=Jn(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Yn(c.left,c.right):S=p-2*Yn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ls(e){let t=$e(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Be(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xn(n)!==a||Xn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function us(e){return ze(e)?e:e.contextElement}function ds(e){let t=us(e);if(!Be(t))return Qn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ls(t),o=(a?Xn(n.width):n.width)/r,s=(a?Xn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var fs=Qn(0);function ps(e){let t=Ie(e);return!Ze()||!t.visualViewport?fs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ms(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ie(e)}function hs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=us(e),o=Qn(1);t&&(r?ze(r)&&(o=ds(r)):o=ds(e));let s=ms(a,n,r)?ps(a):Qn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ie(a),t=ze(r)?Ie(r):r,n=e,i=it(n);for(;i&&t!==n;){let e=ds(i),t=i.getBoundingClientRect(),r=$e(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ie(i),i=it(n)}}return br({width:u,height:d,x:c,y:l})}function gs(e,t){let n=et(e).scrollLeft;return t?t.left+n:hs(Le(e)).left+n}function _s(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gs(e,n),y:n.top+t.scrollTop}}function vs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Le(r),s=t?We(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qn(1),u=Qn(0),d=Be(r);if((d||!a)&&((Fe(r)!==`body`||He(o))&&(c=et(r)),d)){let e=hs(r);l=ds(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_s(o,c):Qn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ys(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bs(e){let t=et(e),n=e.ownerDocument.body,r=Yn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Yn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gs(e),o=-t.scrollTop;return $e(n).direction===`rtl`&&(a+=Yn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xs=25;function Ss(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ie(e),a=Le(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ze()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xs&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Cs(e,t){let n=hs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ds(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ws(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ss(e,n,t);else if(t===`document`)r=bs(Le(e));else if(ze(t))r=Cs(t,n);else{let n=ps(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return br(r)}function Ts(e,t){let n=t.get(e);if(n)return n;let r=rt(e,[],!1).filter(e=>ze(e)&&Fe(e)!==`body`),i=null,a=$e(e).position===`fixed`,o=a?tt(e):e;for(;ze(o)&&!Qe(o);){let e=$e(o),t=Ye(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=tt(o)}return t.set(e,r),r}function Es(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?We(t)?[]:Ts(t,this._c):[].concat(n),r],o=ws(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ws(t,a[e],i);s=Yn(n.top,s),c=Jn(n.right,c),l=Jn(n.bottom,l),u=Yn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ds(e){let{width:t,height:n}=ls(e);return{width:t,height:n}}function Os(e,t,n){let r=Be(t),i=Le(t),a=n===`fixed`,o=hs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Qn(0);if((r||!a)&&((Fe(t)!==`body`||He(i))&&(s=et(t)),r)){let e=hs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gs(i));let l=i&&!r&&!a?_s(i,s):Qn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ks(e){return $e(e).position===`static`}function As(e,t){if(!Be(e)||$e(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function js(e,t){let n=Ie(e);if(We(e))return n;if(!Be(e)){let t=tt(e);for(;t&&!Qe(t);){if(ze(t)&&!ks(t))return t;t=tt(t)}return n}let r=As(e,t);for(;r&&Ue(r)&&ks(r);)r=As(r,t);return r&&Qe(r)&&ks(r)&&!Ye(r)?n:r||Xe(e)||n}var Ms=async function(e){let t=this.getOffsetParent||js,n=this.getDimensions,r=await n(e.floating);return{reference:Os(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ns(e){return $e(e).direction===`rtl`}var Ps={convertOffsetParentRelativeRectToViewportRelativeRect:vs,getDocumentElement:Le,getClippingRect:Es,getOffsetParent:js,getElementRects:Ms,getClientRects:ys,getDimensions:Ds,getScale:ds,isElement:ze,isRTL:Ns};function Fs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Is(e,t,n){let r=null,i,a=Le(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Zn(d),h=Zn(a.clientWidth-(u+f)),g=Zn(a.clientHeight-(d+p)),_=Zn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Yn(0,Jn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Fs(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ie(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ls(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=us(e),u=i||a?[...l?rt(l):[],...t?rt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Is(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?hs(e):null;c&&g();function g(){let t=hs(e);h&&!Fs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rs=as,zs=os,Bs=ns,Vs=cs,Hs=ss,Us=(e,t,n)=>{let r=new Map,i=n??{},a={...Ps,...i.platform,_c:r};return ts(e,t,{...i,platform:a})},Ws=typeof document<`u`?v.useLayoutEffect:function(){};function Gs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qs(e,t){let n=Ks(e);return Math.round(t*n)/n}function Js(e){let t=v.useRef(e);return Ws(()=>{t.current=e}),t}function Ys(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Gs(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Js(c),O=Js(i),k=Js(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Us(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Gs(T.current,t)&&(T.current=t,R.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ws(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Ws(()=>(j.current=!0,()=>{j.current=!1}),[]),Ws(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=qs(N.floating,u.x),r=qs(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ks(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Xs=(e,t)=>{let n=Rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zs=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>({fn:Hs(e).fn,options:[e,t]}),$s=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ec=(e,t)=>{let n=Vs(e);return{name:n.name,fn:n.fn,options:[e,t]}},tc=class extends mo{setState(e){}update(e){}set(e,t){}notifyAll(){}},nc={...Co,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},rc=class extends mo{constructor(e,t,n){let r=new eo;super(ac(e,r,t,n),oc(r),nc)}setOpen=(e,t)=>{Ja(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Jt(Zt,e))}};function ic(){let e=new eo,t=new tc(Object.freeze(ac(void 0,e)),Object.freeze(oc(e)),nc);return Object.assign(t,{setOpen:ae,cancelPendingOpen:ae})}function ac(e,t,n,r=!1){return{..._o(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function oc(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var sc=W(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ha((e,t)=>new rc({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Xa(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Za(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=v.useRef(null);q(()=>{m&&t&&p.setOpen(!1,Jt(hn))},[m,t,p]),q(()=>{x===`ending`&&T===`none`||x!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[x,C,T,w,p]),q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,Jt(vn))}),[b,p]);let D=h||_||!t&&a!==`none`;return(0,S.jsxs)(se.Provider,{value:p,children:[l&&(0,S.jsx)(Ua,{handle:l,store:p}),D&&(0,S.jsx)(cc,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function cc({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Aa(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Da(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>ki(a.reference,i.reference),[a.reference,i.reference]);return Qa(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??K}),null}function lc(e){return bi(e,`base-ui`)}var uc=v.createContext(void 0);function dc(){return v.useContext(uc)}var fc=`data-base-ui-tooltip-trigger`;function pc(e){let t=ct(e);return ze(t)?t:null}var mc=re(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=ce(!0),m=wo(a)??p;if(!m)throw Error(J(82));let h=lc(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=v.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Ya(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=dc(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Cn(y,{open:_}),k=Mo(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Mn(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=fe(),L=v.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=st(e,`[${fc}]`);return n!==null&&n!==t&&ot(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=Fo(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Zo():null,restMs:R,delay(){return u==null&&O?{close:Wt(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),H=Do(y,{enabled:!j}).reference,U=e=>{let t=F.current,n=pc(e),r=B(n),i=b.current,a=i&&n&&ot(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,Jt(Qt,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Me(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,Jt(Qt,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ee=m.useState(`appliedTriggerProps`,C||N!==`none`);return Hi(`button`,e,{state:{open:_},ref:[t,S,b],props:[V,H,ee,{onMouseOver(e){U(e.nativeEvent)},onFocus(e){z(pc(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Pt]:j?``:void 0,[fc]:j?void 0:``},f],stateAttributesMapping:At})}),hc=v.createContext(void 0);function gc(){let e=v.useContext(hc);if(e===void 0)throw Error(J(70));return e}var _c=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ra({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,S.jsxs)(v.Fragment,{children:[l,c&&R.createPortal(n,c)]})}),vc=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ce().useState(`mounted`)||n?(0,S.jsx)(hc.Provider,{value:n,children:(0,S.jsx)(_c,{ref:t,...r})}):null}),yc=v.createContext(void 0);function bc(){let e=v.useContext(yc);if(e===void 0)throw Error(J(71));return e}function xc(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=v.useState(null),d=v.useRef(null),f=ua(n),p=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Ys({...e,elements:{...p,...l&&{reference:l}}}),h=v.useCallback(e=>{let t=ze(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=v.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=v.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=v.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),v.useMemo(()=>({...m,context:y,refs:g,elements:_,rootStore:r}),[m,g,_,y,r])}var Sc=v.createContext(void 0);function Cc(){return v.useContext(Sc)?.direction??`ltr`}var wc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=tr(e,t)||{};if(l==null)return{};let d=yr(u),f={x:n,y:r},p=sr(i),m=ar(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=er(D,k,O),j=!c.arrow&&rr(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Tc=(e,t)=>{let{name:n,fn:r}=wc(e);return{name:n,fn:r,options:[e,t]}},Ec={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Dc={sideX:`left`,sideY:`top`},Oc=`--available-width`,kc=`--available-height`,Ac=`--anchor-width`,jc=`--anchor-height`,Mc=`--transform-origin`,Nc=Oc,Pc=kc;function Fc(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Ic(e,t,n){let{rects:r,placement:i}=e;return{side:Fc(t,nr(i),n),align:rr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Lc(e){return Rc(e,xc)}function Rc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=Y(k),j=k?A:n,M=Mn(n),N=Mn(g),P=Cc()===`rtl`,[F,I]=v.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?nr(F):null,z=F&&L?rr(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,H=V===`center`?B:`${B}-${V}`,U=l;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),W=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:U},ie=v.useRef(null),ae=Mn(a),G=Mn(s),K=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,J=[];p&&J.push(p),J.push(Xs(e=>{let t=Ic(e,i,P),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof G.current==`function`?G.current(t):G.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[K,oe,P,i]));let se=T===`none`&&w!==`shift`,ce=!se&&(u||D||w===`shift`),le=w===`none`?null:$s({...re,padding:{top:U.top+1+ee,right:U.right+1+W,bottom:U.bottom+1+te,left:U.left+1+ne},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),ue=se?null:Zs({...re,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ce,limiter:u||D?void 0:Qs(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=or(nr(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[re,u,D,O,U,T]);w===`shift`||T===`shift`||V===`center`?J.push(ue,le):J.push(le,ue),J.push(ec({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Nc,`${t}px`),i.setProperty(Pc,`${n}px`);let a=Ie(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Ac,`${u}px`),i.setProperty(jc,`${d}px`)}}),Tc(e=>({element:ie.current||Un(e.elements.floating).createElement(`div`),padding:ie.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=nr(r),u=rr(r),d=or(l)===`y`,f=ie.current,p=typeof a==`function`?a(Ic(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ce&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Mc,d?`${m} ${h}`:`${h} ${m}`),{}}},Ec,x),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let de=v.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:fe,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:H,middleware:J,strategy:r,whileElementsMounted:m?void 0:(...e)=>Ls(...e,de),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||Dc,we=be?r:`fixed`,Te=v.useMemo(()=>{let e;return e=be?x?{position:we,[Se]:me,[Ce]:he}:{...xe,position:we}:{position:we,top:0,left:0},e[Nc]=`100vw`,e[Pc]=`100vh`,be||(e.opacity=0),e},[x,we,Se,me,Ce,he,xe,be]),Ee=v.useRef(null);q(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(zc(t)?t.current:t)||null;n!==Ee.current&&(fe.setPositionReference(n),Ee.current=n)},[g,fe,j,M]),v.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&zc(e)&&e.current!==Ee.current&&(fe.setPositionReference(e.current),Ee.current=e.current)},[g,fe,j,M]),v.useEffect(()=>{if(m&&g&&pe.reference&&pe.floating)return Ls(pe.reference,pe.floating,_e,de)},[m,g,pe,_e,de]);let De=nr(ve),Oe=Fc(i,De,P),ke=rr(ve)||`center`,Ae=!!ge.hide?.referenceHidden;q(()=>{S&&g&&be&&(De!==B||L&&ke!==V)&&I(ve)},[S,L,g,be,ve,De,ke,B,V]);let je=v.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:ie,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:fe,context:ye,isPositioned:be,update:_e}),[Te,je,ie,Me,Oe,ke,De,Ae,fe,ye,be,_e])}function zc(e){return e!=null&&`current`in e}function Bc(e){return e===`starting`?Yi:K}function Vc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Hi(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Bc(r),i],stateAttributesMapping:Mt})}var Hc=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Qi,style:g,..._}=e,y=ce(),b=gc(),x=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`trackCursorAxis`),T=y.useState(`disableHoverablePopup`),E=y.useState(`floatingRootContext`),D=y.useState(`instantType`),O=y.useState(`transitionStatus`),k=Lc({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),A=Vc(e,v.useMemo(()=>({open:x,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[x,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!x||w===`both`||T});return(0,S.jsx)(yc.Provider,{value:k,children:A})}),Uc=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ce(),{side:s,align:c}=bc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Ra({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),No(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Hi(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Ba,f,Bc(d),a],stateAttributesMapping:Nt})}),Wc=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ce(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=bc();return Hi(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Mt})}),Gc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,S.jsx)(uc.Provider,{value:t,children:(0,S.jsx)(Sn,{delay:i,timeoutMs:r,children:e.children})})};function Kc(e){return Si(19)?e:e?`true`:void 0}function qc(e){let[t,n]=v.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Jc=class extends ja{constructor(){super(ic(),`Tooltip`)}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function Yc(){return new Jc}var Xc=48,Zc=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Xc-t;return n},Qc=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},$c=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Xc;n+=i>>>1^-(i&1),t[r]=n}return t},el=384,tl=[],nl=Qc(Zc(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),rl=Qc(Zc(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),il=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,al=(()=>{let e=nl.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=nl[n];i<nl[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(nl[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=nl[i];a<nl[i+1];a++)n[r++]=e,e+=t[e]}return n})(),ol=Zc(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),sl=Qc(Zc(`123333359346463635126536711576`)),cl=Zc(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ll=Zc(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ul=$c(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),dl=(()=>{let e=new Int32Array(319).fill(-1),t=$c(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=$c(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),fl=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),pl=$c(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ml=$c(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),hl=$c(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),gl=new Int32Array(987),_l=new Int32Array(987),vl=new Int32Array(987),yl=``,bl=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<pl.length;r++)for(let i of fl[hl[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),bl[a*2]=yl.length,bl[a*2+1]=i.length,yl+=i),gl[n]=pl[r],_l[n]=ml[r],vl[n]=a,n++}}var xl=$c(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Sl=Qc(Zc(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Cl=$c(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),wl=Zc(`ij`),Tl=Zc(``),El=Zc(`1`),Dl={GROUP_COUNT:el,customValidatorNames:tl,edgeStart:nl,labelStart:rl,labelText:il,edgeTarget:al,nodeGroup:ol,nodeVlist:dl,vlistPat:sl,vlistOps:cl,vlistRef:ll,vlistGroup:ul,litAnchor:gl,litGroup:_l,litPool:vl,poolOffsets:bl,poolText:yl,adjGid:xl,adjStart:Sl,adjTgt:Cl,patGid:wl,patTgt:Tl,postfixLookupGroups:El,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ol=`line`in Error(),kl=-1,Al=-1,jl=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Ml=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Nl=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(jl(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(jl(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,H=V.length,U=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=0,ie=-1,ae=-1,G=-1,K=-1,q=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,oe=e=>/\s/.test(String.fromCharCode(e)),J=(e,t,n)=>{if(re=0,ie=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)re=1;else if(r===40&&i===41)re=2;else return;G=t+1,K=n-1;let a=t+1;if(q(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!q(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ie=t+1,ae=a,G=a+1)}},se=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},ce=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,le=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ue=e=>!!e&&!Number.isNaN(Number(e)),de=(e,t,n)=>{if(n-t<11||!se(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&se(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&se(e,t+10,t+18,`-normal/`)},fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],he=(e,t,n,r)=>{if(e>=10){if(e>=25)return U[e-25](t.slice(n,r));let i=e-10;if(re!==fe[i])return!1;if(ie>=0){for(let e of pe[i])if(se(t,ie,ae,e))return!0;return!1}switch(me[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(G,K);return ee.test(e)&&!te.test(e)}case 3:return ue(t.slice(G,K));case 4:return W.test(t.slice(G,K));default:return ne.test(t.slice(G,K))}}switch(e){case 0:return!0;case 1:return re===0;case 2:return re===1;case 3:return re===2;case 4:return ce.test(t.slice(n,r));case 5:return ue(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ue(t.slice(n,r-1));case 8:return le.test(t.slice(n,r));default:return de(t,n,r)}},ge=new Set(typeof E==`string`?E.split(` `):E),_e=(e,t,n,r,i,a)=>{let o=jl(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ve=new Map,ye=new Map,be=2,xe=4096,Se=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ge.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=ye.get(s);return c===void 0&&ye.set(s,c=be++),c},Ce=new Map,we=r,Te=r+4096,Ee=()=>we++,De=2097152,Oe=8192,ke=new Int32Array(Oe),Ae=Array(Oe).fill(null),je=new Int32Array(Oe),Me=new Int32Array(Oe),Ne=new Uint8Array(Oe),Pe=0,Fe=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ae[e]!==null){if(Ae[e|1]===null)c=e|1;else if(!(Pe++&3))c=e|Pe>>2&1;else return}Ae[c]=t.slice(n,r),ke[c]=i,je[c]=a,Me[c]=o,Ne[c]=s},Ie=()=>Ae.fill(null),Le=256,Re=[new Int32Array(Le),new Int32Array(Le),new Int32Array(Le),new Int32Array(Le)],[ze,Be,Ve,He]=Re,Ue=new Uint8Array(Le),We=new Uint8Array(Le),Ge=()=>{Le*=2,Re=Re.map(e=>{let t=new Int32Array(Le);return t.set(e),t}),[ze,Be,Ve,He]=Re;let e=new Uint8Array(Le);e.set(Ue),Ue=e,We=new Uint8Array(Le)},Ke=64,qe=new Int32Array(Ke),Je=new Int32Array(Ke),Ye=new Int32Array(r),Xe=2048,Ze=21,Qe=new Float64Array(Xe),$e=new Int32Array(Xe),et=0,tt=(e,t)=>{if(e===0&&t<r)return Ye[t]===et?1:(Ye[t]=et,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Ze;for(;$e[i]===et;){if(Qe[i]===n)return 1;i=i+1&Xe-1}return Qe[i]=n,$e[i]=et,0},nt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?kl:_e(Ce,e,t+1,r,0,Ee)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Je[t];if(r>n)continue;let i=qe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;J(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(he(d[t],e,r,n))return p[h+t]}return kl},rt=e=>{let t=e.length,n=0,c=0,u=!1;(be>xe||ve.size>xe)&&(ve=new Map,ye=new Map,be=2,Ie()),we>Te&&(Ce=new Map,we=r,Ie());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&oe(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&oe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Le&&Ge();let _=n++;ze[_]=p,Be[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ke[y]===v&&Ae[y]!==null&&Ae[y].length===g?t=y:ke[y|1]===v&&Ae[y|1]!==null&&Ae[y|1].length===g&&(t=y|1),t>=0){let n=Ae[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ve[_]=je[t],He[_]=Me[t],Ue[_]=Ne[t];continue}}}let b=p;if(H!==0){if(h-p<=H||!e.startsWith(V,p)){Ve[_]=kl,Fe(y,e,p,h,v,kl,0,0);continue}b=p+H}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(qe[0]=0,Je[0]=M,R=1);let z=Al,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Al:P,B=R),P!==Al){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Al;else{let e=i[P],t=i[P+1],c=Al;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ke){Ke*=2;let e=new Int32Array(Ke);e.set(qe),qe=e;let t=new Int32Array(Ke);t.set(Je),Je=t}qe[R]=r,Je[R]=t+2,R++}}A===D&&(z=F<I?Al:P,B=R);let U=F<I?Al:P,ee,te=!1;if(A>=0){if(te=!0,ee=nt(e,E,A,z,B),ee!==kl&&ee<r&&j[ee]){let t=nt(e,E,D,U,R);t!==kl&&t!==ee&&(ee=t,te=!1)}else ee===kl&&(ee=nt(e,E,D,U,R),te=!1)}else ee=nt(e,E,D,U,R);let ne=0,W=0;ee===kl?Ve[_]=kl:(W=+!!te,ne=b>=C?+!!O:_e(ve,e,b,C,+!!O,e=>Se(e,O)),Ve[_]=ee,Ue[_]=W,He[_]=ne),Fe(y,e,p,h,v,ee,ne,W)}if(n===0)return``;if(n===1)return ze[0]===0&&Be[0]===t?e:e.slice(ze[0],Be[0]);if(n*k>Xe){for(;n*k>Xe;)Xe<<=1,Ze--;Qe=new Float64Array(Xe),$e=new Int32Array(Xe)}if(be>=De||we>=De)throw Error(`cn: too many distinct classes in one merge`);et=et+1|0,et===0&&(Ye.fill(0),$e.fill(0),et=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ve[e];if(t===kl){We[e]=1;continue}let n=He[e];if(tt(n,t)===1)We[e]=0,f=!0;else if(We[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)tt(n,x[e]);if(Ue[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&tt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!We[m]){m++;continue}let t=ze[m],r=Be[m],i=m+1;for(;i<n&&We[i]&&ze[i]===r+1&&e.charCodeAt(r)===32;)r=Be[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},it=16384,at=new Int32Array(it*2),ot=0,st=1,ct=Object.create(null),lt=Object.create(null),ut=new Map,dt=new Map,ft=0,pt=0,mt=()=>{ot^=it,st=st+1|0,pt=0},ht=e=>{let t=ct[e];if(t!==void 0)return t;let n=Ml(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=lt[e],t!==void 0)?(ct[e]=t,t):(t=rt(e),i?(ct[e]=t,++ft>z&&(ft=0,lt=ct,ct=Object.create(null),mt())):(at[r]=n^st,++pt>it&&mt()),t)},gt=e=>{let t=ut.get(e);if(t!==void 0)return t;let n=Ml(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=dt.get(e),t!==void 0)?(ut.set(e,t),t):(t=rt(e),i?(ut.set(e,t),++ft>z&&(ft=0,dt=ut,ut=new Map,mt())):(at[r]=n^st,++pt>it&&mt()),t)},_t=e=>{let t=Ml(e,0,e.length),n=(t&16383)+ot;return at[n]===(t^st)||at[n^it]===(t^st-1)||(at[n]=t^st,++pt>it&&mt(),!1)},vt=z===0?rt:Ol?e=>{let t=ut.get(e);return t===void 0?gt(e):t}:ht;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?vt(arguments[0]):vt(Il.apply(null,arguments))},mergeString:vt,seenBefore:z===0?()=>!1:_t,mergeUncached:rt}},Pl=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Pl(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Fl=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Pl(i,t);a&&(n&&(n+=` `),n+=a)}return n},Il=function(){return Fl(arguments,!1)},Ll=256,Rl=16,zl=1024,Bl=4096,Vl=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Bl).fill(``),l=Array(Bl).fill(``),u=Array(Bl).fill(``));let i=Ml(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Pl(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Rl&&(_.miss=Rl,_.skip=zl,_.e.length=0,_.at=0);let u=_.e;u.length<Ll?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Pl(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Hl=Nl(Dl),X=Vl(Hl.mergeString,Hl);Hl.merge;function Ul({delay:e=0,...t}){return(0,S.jsx)(Gc,{"data-slot":`tooltip-provider`,delay:e,...t})}function Wl({...e}){return(0,S.jsx)(sc,{"data-slot":`tooltip`,...e})}function Gl({...e}){return(0,S.jsx)(mc,{"data-slot":`tooltip-trigger`,...e})}function Kl({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,S.jsx)(vc,{children:(0,S.jsx)(Hc,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,S.jsxs)(Uc,{"data-slot":`tooltip-content`,className:X(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,S.jsx)(Wc,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var ql=new Set;function Jl(){for(let e of ql)e.isOpen&&e.close()}function Yl(e){return(0,v.useEffect)(()=>{function e(){document.hidden&&Jl()}return window.addEventListener(`blur`,Jl),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,Jl),document.removeEventListener(`visibilitychange`,e)}},[]),(0,S.jsx)(Ul,{...e})}function Xl(e){let[t]=(0,v.useState)(Yc);return(0,v.useEffect)(()=>(ql.add(t),()=>{ql.delete(t)}),[t]),(0,S.jsx)(Wl,{handle:t,...e})}var Zl=`factory.theme`,Ql=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function $l(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ql(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var eu=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},tu=e=>{let t=eu(e);return t.charAt(0).toUpperCase()+t.slice(1)},nu=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ru={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function iu(e){return e!=null}function au(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??ru.width,a=e.size??e.height??ru.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?nu(...c):nu(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??ru[`stroke-width`])*Number(e.size??e.width??ru.width)/Number(t.size??t.width??ru.width):t.strokeWidth??ru[`stroke-width`];return[`svg`,{...Object.entries(ru).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&iu(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&iu(t.width)&&{[r(`width`)]:t.width},...`height`in t&&iu(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ou(e,t={}){return au(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var su=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cu=(0,v.createContext)({}),lu=()=>(0,v.useContext)(cu),uu=(0,v.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:y=``}=lu()??{},b=!!c||su(d),[x,S,C=[]]=ou(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:nu(y,s),hasA11yProp:b,attributes:d});return(0,v.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function du(e,t=[],n=[]){let r=typeof e==`string`?$l(e,t,n):e,i=(0,v.forwardRef)(({className:e,...t},n)=>(0,v.createElement)(uu,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=tu(r.name)),i}var fu={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};fu.node;var pu=du(fu),mu={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};mu.node;var hu=du(mu),gu={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};gu.node;var _u=du(gu),vu={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};vu.node;var yu=du(vu),bu={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};bu.node;var xu=du(bu),Su={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Su.node;var Cu=du(Su),wu={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};wu.node;var Tu=du(wu),Eu={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Eu.node;var Du=du(Eu),Ou={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ou.node;var ku=du(Ou),Au={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Au.node;var ju=du(Au),Mu={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Mu.node;var Nu=du(Mu),Pu={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Pu.node;var Fu=du(Pu),Iu={name:`circle-x`,size:24,node:[[`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`}]],aliases:[`x-circle`]};Iu.node;var Lu=du(Iu),Ru={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ru.node;var zu=du(Ru),Bu={name:`external-link`,size:24,node:[[`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`}]]};Bu.node;var Vu=du(Bu),Hu={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};Hu.node;var Uu=du(Hu),Wu={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Wu.node;var Gu=du(Wu),Ku={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Ku.node;var qu=du(Ku),Ju={name:`git-pull-request-closed`,size:24,node:[[`path`,{d:`m15.5 3.5 5 5`,key:`1kmx7t`}],[`path`,{d:`m15.5 8.5 5-5`,key:`saftza`}],[`path`,{d:`M18 11.62V15`,key:`1greaj`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}]]};Ju.node;var Yu=du(Ju),Xu={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Xu.node;var Zu=du(Xu),Qu={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Qu.node;var $u=du(Qu),ed={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};ed.node;var td=du(ed),nd={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};nd.node;var rd=du(nd),id={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};id.node;var ad=du(id),od={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};od.node;var sd=du(od),cd={name:`message-circle`,size:24,node:[[`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`}]]};cd.node;var ld=du(cd),ud={name:`package-check`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]};ud.node;var dd=du(ud),fd={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};fd.node;var pd=du(fd),md={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};md.node;var hd=du(md),gd={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};gd.node;var _d=du(gd),vd={name:`refresh-cw`,size:24,node:[[`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`}]]};vd.node;var yd=du(vd),bd={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};bd.node;var xd=du(bd),Sd={name:`settings-2`,size:24,node:[[`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`}]]};Sd.node;var Cd=du(Sd),wd={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};wd.node;var Td=du(wd),Ed={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ed.node;var Dd=du(Ed),Od={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};Od.node;var kd=du(Od),Ad={name:`workflow`,size:24,node:[[`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`}]]};Ad.node;var jd=du(Ad),Md={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Md.node;var Nd=du(Md),Pd={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pd.node;var Fd=du(Pd);function Id(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Id(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ld(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Id(e))&&(r&&(r+=` `),r+=t);return r}var Rd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,zd=Ld,Bd=(e,t)=>n=>{if(t?.variants==null)return zd(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Rd(t)||Rd(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return zd(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Vd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty`,className:X(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function Hd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-header`,className:X(`flex max-w-sm flex-col items-center gap-2`,e),...t})}function Ud({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-title`,className:X(`font-heading text-sm font-medium tracking-tight`,e),...t})}function Wd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-description`,className:X(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function Gd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-content`,className:X(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance`,e),...t})}var Kd=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function qd(e){let t=Math.round((Date.now()-Date.parse(e))/6e4);if(t<1)return`just now`;if(t<60)return`${t} min ago`;let n=Math.round(t/60);return n<48?`${n} h ago`:`${Math.round(n/24)} days ago`}var Jd=e=>Math.round((Date.now()-Date.parse(e))/6e4),Yd=e=>e.split(`/`).filter(Boolean).at(-1)??e,Xd=e=>`${Yd(e.repo)}: ${e.title||e.id}`,Zd=e=>e.replace(/T(\d\d)(\d\d)(\d\d)$/,`T$1:$2:$3Z`),Qd={working:`default`,idle:`secondary`,sleeping:`outline`,stopped:`outline`},$d=({model:e,effort:t})=>[e,t].filter(Boolean).join(`, `),ef=e=>[e.agent,$d(e)].filter(Boolean).join(` `),tf=e=>e.charAt(0).toUpperCase()+e.slice(1);async function nf(e,t,n){let r=await fetch(t,{method:e,body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json();if(!r.ok)throw Error(i.error);return i}var rf={candidates:()=>nf(`GET`,`/api/candidates`),refreshCandidates:()=>nf(`POST`,`/api/candidates/refresh`),plays:()=>nf(`GET`,`/api/plays`),prompt:e=>nf(`POST`,`/api/candidates/prompt`,{repo:e.repo,id:e.id}),jobPrompt:e=>nf(`GET`,`/api/jobs/${e}/prompt`),repos:()=>nf(`GET`,`/api/repos`),clone:e=>nf(`POST`,`/api/repos/clone`,{name:e}),queue:(e,t)=>nf(`POST`,`/api/jobs`,{items:e,pin:t}),remove:e=>nf(`POST`,`/api/jobs/${e}/remove`),retry:e=>nf(`POST`,`/api/jobs/${e}/retry`),answer:(e,t)=>nf(`POST`,`/api/jobs/${e}/answer`,{text:t}),goal:(e,t)=>nf(`POST`,`/api/jobs/${e}/${t}`),replan:(e,t)=>nf(`POST`,`/api/jobs/${e}/replan`,{why:t}),verify:(e,t)=>nf(`POST`,`/api/jobs/${e}/verify`,{need:t}),followup:(e,t)=>nf(`POST`,`/api/jobs/${e}/followup`,{task:t}),review:(e,t)=>nf(`POST`,`/api/jobs/${e}/review`,{agent:t}),prDetails:e=>nf(`GET`,`/api/jobs/${e}/pr`),merge:e=>nf(`POST`,`/api/jobs/${e}/merge`),rebase:e=>nf(`POST`,`/api/jobs/${e}/rebase`),mergeTrain:e=>nf(`POST`,`/api/train`,{ids:e}),close:e=>nf(`POST`,`/api/jobs/${e}/close`),move:(e,t)=>nf(`POST`,`/api/jobs/${e}/move`,{index:t}),models:()=>nf(`GET`,`/api/models`),saveSettings:e=>nf(`PUT`,`/api/settings`,e),turnOn:e=>nf(`POST`,`/api/on`,e),turnOff:()=>nf(`POST`,`/api/off`),chat:e=>nf(`POST`,`/api/chat`,{message:e}),abortChat:()=>nf(`POST`,`/api/chat/abort`),answerChat:e=>nf(`POST`,`/api/chat/answer`,e),resetChat:()=>nf(`POST`,`/api/chat/reset`)};function af(){let[e,t]=(0,v.useState)(),[n,r]=(0,v.useState)(),i=(0,v.useCallback)(()=>nf(`GET`,`/api/state`).then(t,e=>r(`Can't reach factory serve: ${e.message}`)),[]);return(0,v.useEffect)(()=>{let e=()=>void nf(`GET`,`/api/state`).then(t,e=>r(`Can't reach factory serve: ${e.message}`));e();let n=setInterval(e,3e3);return()=>clearInterval(n)},[]),{snapshot:e,error:n,act:(0,v.useCallback)(async e=>{try{await e(),r(void 0)}catch(e){r(e.message)}await i()},[i])}}function of(e){return Hi(e.defaultTagName??`div`,e,e)}var sf=Bd(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,accent:`bg-(--om-accent) text-(--om-dark-background)`}},defaultVariants:{variant:`default`}});function cf({className:e,variant:t=`default`,render:n,...r}){return of({defaultTagName:`span`,props:ki({className:X(sf({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var lf=v.createContext(void 0);function uf(e=!1){let t=v.useContext(lf);if(t===void 0&&!e)throw Error(J(16));return t}function df(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function ff(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Ie(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function pf(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=uf(!0),c=a??s!==void 0,{props:l}=df({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;mf(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ki({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(zi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=mf(r),s=!i&&hf(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),ff(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ff(r,e)))},onKeyUp(e){t||(zi(e),a?.(e),e.target===e.currentTarget&&i&&c&&mf(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ff(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Y(e=>{o.current=e,u()})}}function mf(e){return Be(e)&&e.tagName===`BUTTON`}function hf(e){return Be(e)&&e.tagName===`A`&&!!e.href}var gf=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=pf({disabled:i,focusableWhenDisabled:a,native:o});return Hi(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),_f=Bd(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function vf({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,S.jsx)(gf,{"data-slot":`button`,className:X(_f({variant:t,size:n,className:e})),...r})}var yf=`data-valid`,bf=`data-invalid`,xf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Sf={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Cf={disabled:!1,...Sf},wf={valid(e){return e===null?null:e?{[yf]:``}:{[bf]:``}}},Tf={invalid:void 0,name:void 0,validityData:{state:xf,errors:[],error:``,value:``,initialValue:null},setValidityData:ae,disabled:void 0,setTouched:ae,setDirty:ae,setFilled:ae,setFocused:ae,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Cf,registerFieldControl:ae,validation:{getValidationProps:(e,t=K)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:ae,getInputControl:()=>null,commit:async()=>{},change:ae}},Ef=v.createContext(Tf);function Df(e=!0){let t=v.useContext(Ef);if(t.setValidityData===ae&&!e)throw Error(J(28));return t}var Of=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ae,validationMode:`onSubmit`,submitCountRef:{current:0}});function kf(){return v.useContext(Of)}var Af=v.createContext({controlId:void 0,registerControlId:ae,resetControlId:ae,labelId:void 0,setLabelId:ae,messageIds:[],setMessageIds:ae,getDescriptionProps:e=>e});function jf(){return v.useContext(Af)}function Mf(e,t,n,r=!0,i,a){let[o,s]=v.useState(),c=lc(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return q(()=>{let i=e||t||l||!r?void 0:Nf(n.current,c);o!==i&&s(i)}),u}function Nf(e,t){let n=Pf(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Pf(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function Ff(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=jf(),o=lc(),s=H(()=>Symbol()),c=v.useRef(!1),l=v.useRef(!1),u=Y(()=>{c.current&&i!==ae&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===ae){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}var If=v.createContext({disabled:!1});function Lf(){return v.useContext(If)}function Rf(e,t,n){let{setFocused:r,focusOwnerRef:i}=Df(),a=Y(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function zf(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Df(),s=H(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Bf(e,t){let n=v.useRef(e),r=Y(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var Vf=v.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:y,setFilled:b,validationMode:x,validation:S}=Df(),{clearErrors:C,elementRef:w,submitCountRef:T}=kf(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=jf(),A=Ff({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=Y(()=>S.inputRef.current?.value);zf(S.inputRef,A,M,N,!E,a),q(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),Bf(M,()=>{M!==void 0&&(C(D),_(M!==(y.initialValue??``)),S.change(M))});let P=v.useRef(null),F=Rf(E,P),I=fe();return Hi(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=Jt(Xt,e.nativeEvent);c?.(t,n),!j&&(_(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:wf})}),Hf=v.forwardRef(function(e,t){return(0,S.jsx)(Vf,{ref:t,...e})});function Uf({className:e,type:t,...n}){return(0,S.jsx)(Hf,{type:t,"data-slot":`input`,className:X(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var Wf={note:`note`,ask:`asked`,assume:`assumed`,answer:`you answered`,result:`result`,step:`step`,train:`merge train`,factory:`factory`};function Gf({job:e,act:t,queued:n}){let r=e.notes.findLast(e=>e.kind===`result`),i=[...new Set(e.notes.flatMap(e=>e.followups??[]))],a=e.attempts.at(-1)?.branch;return!r&&i.length===0&&!a?null:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-popover p-2 text-sm`,children:[r&&(0,S.jsxs)(`span`,{children:[r.text,` `,r.confidence&&(0,S.jsxs)(cf,{variant:`outline`,children:[r.confidence,` confidence`]})]}),a&&(0,S.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Unpushed work kept on branch `,a]}),i.map(r=>(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-muted-foreground`,children:[(0,S.jsxs)(`span`,{children:[`Follow-up: `,r]}),n.has(r)?(0,S.jsx)(`span`,{children:`queued`}):(0,S.jsx)(vf,{variant:`outline`,size:`xs`,onClick:()=>t(()=>rf.followup(e.id,r)),children:`Queue`})]},r))]})}function Kf({job:e,question:t,act:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=async()=>{o(!0);try{await n(()=>rf.answer(e.id,r.trim()))}finally{o(!1)}};return(0,S.jsxs)(`form`,{className:`flex flex-col gap-2 rounded-md border border-warning/60 p-2`,onSubmit:e=>{e.preventDefault(),s()},children:[(0,S.jsxs)(`span`,{className:`text-foreground`,children:[e.agent,` asks: `,t.text]}),(0,S.jsxs)(`span`,{className:`flex gap-2`,children:[(0,S.jsx)(Uf,{"aria-label":`Your answer`,placeholder:`Your answer; the job goes back in the queue with it`,value:r,onChange:e=>i(e.target.value)}),(0,S.jsx)(vf,{type:`submit`,variant:`outline`,size:`sm`,disabled:a||!r.trim(),children:a?`Sending…`:`Answer`})]})]})}var qf;function Jf(e){if(!qf){if(typeof document>`u`)return;qf=document.createElement(`textarea`)}var t=`&${e};`;qf.innerHTML=t;var n=qf.value;return n===t?void 0:n}var Z=32,Yf=9,Xf=13,Zf=10,Qf=96,$f=126,ep=91,tp=94,np=62,rp=35,ip=37,ap=45,op=61,sp=92,cp=42,lp=95,up=60,dp=64,fp=93,pp=33,mp=38,hp=58,gp=70,_p=102,vp=104,yp=119,bp=116,xp=112,Sp=115,Cp=160,wp=12,Tp=44,Ep=59,Dp=63,Op=46,kp=47,Ap=39,jp=34,Mp=43,Np=124,Pp=123,Fp=125,Ip=40,Lp=41,Rp=78,zp=110,Bp=79,Vp=111,Hp=120,Up=88,Wp=30,Gp=48,Kp=57,qp=65,Jp=90,Yp=97,Xp=122,Zp=128,Qp=32,Q={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22};function $p(e){if(!bm(e,`---`))return null;let t=3;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t<e.length&&e[t]===`\r`&&t++,t>=e.length||e[t]!==`
|
|
9
|
+
`).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||en(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&en(e,``+r);else return;break;case`className`:zt(e,`class`,r);break;case`tabIndex`:zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:zt(e,n,r);break;case`style`:rn(e,r,o);return;case`data`:if(t!==`object`){zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);return;case`onScroll`:r!=null&&Uf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Uf(`scrollend`,e);return;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));o?.__html!==n&&(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=cn(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`credentialless`: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`:Uf(`beforetoggle`,e),Uf(`toggle`,e),Rt(e,`popover`,r);break;case`xlinkActuate`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Rt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=on.get(n)||n,Rt(e,n,r);else return}It=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:rn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)en(e,r);else if(typeof r==`number`||typeof r==`bigint`)en(e,``+r);else return;break;case`onScroll`:r!=null&&Uf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Uf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=ln);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[pt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}It=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Rt(e,n,r)}return}It=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Uf(`error`,e),Uf(`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:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Uf(`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:np(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Uf(`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:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(s in Uf(`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:np(e,t,s,c,n,null)}$t(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:np(e,t,l,r,n,null)}return;case`dialog`:Uf(`beforetoggle`,e),Uf(`toggle`,e),Uf(`cancel`,e),Uf(`close`,e);break;case`iframe`:case`object`:Uf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Bf.length;r++)Uf(Bf[r],e);break;case`image`:Uf(`error`,e),Uf(`load`,e);break;case`details`:Uf(`toggle`,e);break;case`embed`:case`source`:case`link`:Uf(`error`,e),Uf(`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:np(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(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)||np(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`:m!==f&&(It=!0),o=m;break;case`name`:m!==f&&(It=!0),a=m;break;case`checked`:m!==f&&(It=!0),u=m;break;case`defaultChecked`:m!==f&&(It=!0),d=m;break;case`value`:m!==f&&(It=!0),s=m;break;case`defaultValue`:m!==f&&(It=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Jt(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)||np(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`:o!==l&&(It=!0),p=o;break;case`defaultValue`:o!==l&&(It=!0),c=o;break;case`multiple`:o!==l&&(It=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(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:np(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`:a!==o&&(It=!0),p=a;break;case`defaultValue`:a!==o&&(It=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}Qt(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:np(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`:p!==m&&(It=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(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)&&np(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:np(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(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||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(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||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){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&&sp(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&&sp(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 lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(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 pp(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 mp(e,t,n,r){return n=dp(n).createElement(e),n[ft]=r,n[pt]=t,ip(n,e,t),Et(n),n}function hp(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 gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(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),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Ep(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 Dp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Op(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function kp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Mp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Zm(f),u>eh){s.length=o;break}f=new Promise(Np.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Hp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),mm(e,t))}Lp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,hm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Wp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=St(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Q(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Wp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Q(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Q(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=b(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[yt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){xp(function(){xp(function(t){return e(t)})})}function gm(e,t,n){switch(t=dp(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===ln&&(e.onclick=null),xt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=K.d;K.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=zd();return e||t}function wm(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[bt]=!0,o.onload=o.onerror=function(){Dt(o)}),Et(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=D({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),Et(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Tt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);Et(c),ip(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Tt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Et(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Tt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Et(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=fe.current)?xm(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`?(n=Fm(n.href),t=Tt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Fm(n.href);var o=Tt(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Rm(a,e,o,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`?(n=zm(n),t=Tt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+qt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[bt]){r.loading=1;return}}else t=e.createElement(`link`),t[bt]=!0,t.onload=t.onerror=Dt.bind(null,t),ip(t,`link`,n),Et(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function zm(e){return`[src="`+qt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),ip(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,Et(a),a):(r=n,(a=ym.get(o))&&(r=D({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),ip(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[yt]||a[ft]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:F,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function lh(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.transitionTypes=null,this.incompleteTransitions=new Map}function uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Si(3,null,null,t),e.current=a,a.stateNode=e,t=Ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ao(a),e}function dh(e){return e?(e=bi,e):bi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=so(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=co(e,r,t),n!==null&&(Pd(n,e,t),lo(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=_i(e,67108864);t!==null&&Pd(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=jd();t=st(t);var n=_i(e,t);n!==null&&Pd(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=G.T;G.T=null;var a=K.p;try{K.p=2,bh(e,t,n,r)}finally{K.p=a,G.T=i}}function yh(e,t,n,r){var i=G.T;G.T=null;var a=K.p;try{K.p=8,bh(e,t,n,r)}finally{K.p=a,G.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Jf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ye(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}Df(a),!(Yu&6)&&(gd=Ae()+500,Of(0,!1))}}break;case 31:case 13:s=_i(a,2),s!==null&&Pd(s,a,2),zd(),mh(a,2)}if(a=xh(r),a===null&&Jf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Jf(e,t,r,null,n)}}function xh(e){return e=dn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=St(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 Sh=e,null}function wh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=Ct(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=St(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,ut(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ut(e.priority,function(){gh(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 Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Ct(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=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(Ch(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.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[pt]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[pt]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){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 Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,jd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),zd(),t[mt]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=lt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(i(527,qh,`19.3.1`));K.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 Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:G,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{ze=Yh.inject(Jh),Be=Yh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Wh),e[mt]=t.current,Kf(e),new Gh(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=l(d(),1),y=_(),b=[{name:`gilt`,label:`Gilt`,mode:`dark`,accent:`#d4af37`,canvas:`#090a0c`},{name:`catppuccin-latte`,label:`Catppuccin Latte`,mode:`light`,accent:`#1e66f5`,canvas:`#e3e4e8`},{name:`catppuccin`,label:`Catppuccin Mocha`,mode:`dark`,accent:`#89b4fa`,canvas:`#161622`},{name:`coppernight`,label:`Copper Night`,mode:`dark`,accent:`#fab387`,canvas:`#0b0b12`},{name:`ethereal`,label:`Ethereal`,mode:`dark`,accent:`#7d82d9`,canvas:`#040816`},{name:`everforest`,label:`Everforest`,mode:`dark`,accent:`#7fbbb3`,canvas:`#21272c`},{name:`flexoki-light`,label:`Flexoki Light`,mode:`light`,accent:`#205ea6`,canvas:`#f2efe4`},{name:`game-boy`,label:`Game Boy`,mode:`light`,accent:`#346856`,canvas:`#88c070`,hidden:!0},{name:`gruvbox`,label:`Gruvbox`,mode:`dark`,accent:`#7daea3`,canvas:`#1e1e1e`},{name:`hackerman`,label:`Hackerman`,mode:`dark`,accent:`#82fb9c`,canvas:`#080910`},{name:`kanagawa`,label:`Kanagawa`,mode:`dark`,accent:`#dcd7ba`,canvas:`#17171e`},{name:`last-horizon`,label:`Last Horizon`,mode:`dark`,accent:`#b59790`,canvas:`#090809`},{name:`lumon`,label:`Lumon`,mode:`dark`,accent:`#8bc9eb`,canvas:`#101b21`},{name:`lupine`,label:`Lupine`,mode:`light`,accent:`#3264eb`,canvas:`#ececec`},{name:`matte-black`,label:`Matte Black`,mode:`dark`,accent:`#e68e0d`,canvas:`#0c0c0c`},{name:`miasma`,label:`Miasma`,mode:`dark`,accent:`#78824b`,canvas:`#191919`},{name:`nord`,label:`Nord`,mode:`dark`,accent:`#81a1c1`,canvas:`#222730`},{name:`oligarchy`,label:`Oligarchy`,mode:`light`,accent:`#c0271c`,canvas:`#e5dbc6`},{name:`osaka-jade`,label:`Osaka Jade`,mode:`dark`,accent:`#509475`,canvas:`#0c1512`},{name:`retro-82`,label:`Retro 82`,mode:`dark`,accent:`#faa968`,canvas:`#031222`},{name:`ristretto`,label:`Ristretto`,mode:`dark`,accent:`#f38d70`,canvas:`#211b1b`},{name:`rose-pine`,label:`Rose Pine Dawn`,mode:`light`,accent:`#56949f`,canvas:`#ede7e1`},{name:`solitude`,label:`Solitude`,mode:`dark`,accent:`#798186`,canvas:`#0c0e10`},{name:`tokyo-night`,label:`Tokyo Night`,mode:`dark`,accent:`#7aa2f7`,canvas:`#13141c`},{name:`vantablack`,label:`Vantablack`,mode:`dark`,accent:`#8d8d8d`,canvas:`#090909`},{name:`white`,label:`White`,mode:`light`,accent:`#6e6e6e`,canvas:`#f5f5f5`}],x=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})),S=o(((e,t)=>{t.exports=x()}))(),C=v.createContext(null),w=new Set,T=e=>(w.add(e),()=>w.delete(e)),E=()=>w.forEach(e=>e()),D=()=>document.documentElement.dataset.theme,O=()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`,k=()=>void 0,A=()=>window.matchMedia(`(prefers-color-scheme: dark)`),j=e=>e===`system`?A().matches:e===`dark`,M=[];function N(e){try{let t=JSON.parse(e??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):M}catch{return M}}function P(e){let t=document.createElement(`style`);t.textContent=`*,*::before,*::after{transition:none!important}`,document.head.appendChild(t),e(),getComputedStyle(document.body),setTimeout(()=>t.remove(),1)}function F({themes:e,storageKey:t,children:n}){let r=v.useSyncExternalStore(T,D,k),i=v.useSyncExternalStore(T,O,k),a=v.useCallback(n=>{let r=e.find(e=>e.name===n);if(r){P(()=>{document.documentElement.dataset.theme=r.name,document.documentElement.classList.toggle(`dark`,j(r.mode))});try{localStorage.setItem(t,r.name)}catch{}E()}},[e,t]),o=`${t}.favorites`,s=v.useSyncExternalStore(T,()=>{try{return localStorage.getItem(o)}catch{return null}},()=>null),c=v.useMemo(()=>N(s),[s]),l=v.useCallback(e=>{let t=c.includes(e)?c.filter(t=>t!==e):[...c,e];try{localStorage.setItem(o,JSON.stringify(t))}catch{return}E()},[c,o]),u=e.find(e=>e.name===r)?.mode;v.useEffect(()=>{if(u!==`system`)return;let e=A(),t=()=>{document.documentElement.classList.toggle(`dark`,e.matches),E()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[u]),v.useEffect(()=>{let e=getComputedStyle(document.documentElement).getPropertyValue(`--background`).trim();e&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e)},[r,i]);let d=v.useMemo(()=>({theme:r,resolvedMode:i,themes:e,setTheme:a,favorites:c,toggleFavorite:l}),[r,i,e,a,c,l]);return(0,S.jsx)(C,{value:d,children:n})}function I(){let e=v.useContext(C);if(!e)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function L(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.closest(`[role="listbox"], [role="combobox"], [role="dialog"]`)!==null:!1}var R=l(h(),1),z=750;function B(e,t,n){if(n||!t||!(`startViewTransition`in document))return e();let r=document.documentElement;r.classList.add(`theme-reveal`);let i=document.startViewTransition(()=>(0,R.flushSync)(e)),{x:a,y:o}=t,s=Math.hypot(Math.max(a,innerWidth-a),Math.max(o,innerHeight-o));i.ready.then(()=>r.animate({clipPath:[`circle(0px at ${a}px ${o}px)`,`circle(${s}px at ${a}px ${o}px)`]},{duration:z,easing:`cubic-bezier(0.65, 0, 0.35, 1)`,pseudoElement:`::view-transition-new(root)`})).catch(()=>{}),i.finished.finally(()=>r.classList.remove(`theme-reveal`))}var V={};function H(e,t){let n=v.useRef(V);return n.current===V&&(n.current=e(t)),n}var U=[],ee=void 0;function te(){return ee}function ne(e){U.push(e)}function W(e){let t=(t,n)=>{let r=H(ie).current,i;try{ee=r;for(let e of U)e.before(r);i=e(t,n);for(let e of U)e.after(r);r.didInitialize=!0}finally{ee=void 0}return i};return t.displayName=e.displayName||e.name,t}function re(e){return v.forwardRef(W(e))}function ie(){return{didInitialize:!1}}function ae(){}var G=Object.freeze([]),K=Object.freeze({}),q=typeof document<`u`?v.useLayoutEffect:()=>{};function oe(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var J=oe(`https://base-ui.com/production-error`,`Base UI`),se=v.createContext(void 0);function ce(e){let t=v.useContext(se);if(t===void 0&&!e)throw Error(J(72));return t}function le(e){v.useEffect(e,G)}var ue=0,de=class e{static create(){return new e}currentId=ue;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ue,t()},e)}isStarted(){return this.currentId!==ue}clear=()=>{this.currentId!==ue&&(clearTimeout(this.currentId),this.currentId=ue)};disposeEffect=()=>this.clear};function fe(){let e=H(de.create).current;return le(e.disposeEffect),e}function pe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:me,platform:he,maxTouchPoints:ge}=pe(),_e=me.toLowerCase(),ve=he.toLowerCase(),ye=/^i(os$|p)/.test(ve)||ve===`macintel`&&ge>1,be=`android`,xe=ve===be||_e.includes(be),Se=!ye&&ve.startsWith(`mac`);ve.startsWith(`win`),!xe&&/^(linux|chrome os)/.test(ve);var Ce=Se||ye,we=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Te=!we&&_e.includes(`firefox`);!we&&_e.includes(`chrom`);var Ee=Ce,De=/jsdom|happydom/.test(_e);function Oe(e){e.preventDefault(),e.stopPropagation()}function ke(e){return`nativeEvent`in e}function Ae(e){return e.pointerType===``&&e.isTrusted?!0:xe&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function je(e){return De?!1:!xe&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(xe||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Me(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ne(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Pe(){return typeof window<`u`}function Fe(e){return Re(e)?(e.nodeName||``).toLowerCase():`#document`}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){return((Re(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Re(e){return Pe()?e instanceof Node||e instanceof Ie(e).Node:!1}function ze(e){return Pe()?e instanceof Element||e instanceof Ie(e).Element:!1}function Be(e){return Pe()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function Ve(e){return!Pe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}function He(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=$e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ue(e){return/^(table|td|th)$/.test(Fe(e))}function We(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ge=/transform|translate|scale|rotate|perspective|filter/,Ke=/paint|layout|strict|content/,qe=e=>!!e&&e!==`none`,Je;function Ye(e){let t=ze(e)?$e(e):e;return qe(t.transform)||qe(t.translate)||qe(t.scale)||qe(t.rotate)||qe(t.perspective)||!Ze()&&(qe(t.backdropFilter)||qe(t.filter))||Ge.test(t.willChange||``)||Ke.test(t.contain||``)}function Xe(e){let t=tt(e);for(;Be(t)&&!Qe(t);){if(Ye(t))return t;if(We(t))return null;t=tt(t)}return null}function Ze(){return Je??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Je}function Qe(e){return/^(html|body|#document)$/.test(Fe(e))}function $e(e){return Ie(e).getComputedStyle(e)}function et(e){return ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tt(e){if(Fe(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ve(e)&&e.host||Le(e);return Ve(t)?t.host:t}function nt(e){let t=tt(e);return Qe(t)?(e.ownerDocument||e).body:Be(t)&&He(t)?t:nt(t)}function rt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=nt(e),i=r===e.ownerDocument?.body,a=Ie(r);if(i){let e=it(a);return t.concat(a,a.visualViewport||[],He(r)?r:[],e&&n?rt(e):[])}return t.concat(r,rt(r,[],n))}function it(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function at(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ot(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ve(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function st(e,t){let n=e;for(;n;){if(ze(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Ve(n)?n.host:null)}return null}function ct(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var lt=`data-base-ui-focusable`,ut=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,dt=`ArrowLeft`,ft=`ArrowRight`,pt=`ArrowUp`,mt=`ArrowDown`,ht=`data-starting-style`,gt=`data-ending-style`,_t={[ht]:``},vt={[gt]:``},yt={transitionStatus(e){return e===`starting`?_t:e===`ending`?vt:null}},bt=`data-open`,xt=`data-closed`,St=`data-anchor-hidden`,Ct=`data-popup-open`,wt=`data-pressed`,Tt={[Ct]:``},Et={[Ct]:``,[wt]:``},Dt={[bt]:``},Ot={[xt]:``},kt={[St]:``},At={open(e){return e?Tt:null}},jt={open(e){return e?Et:null}},Mt={open(e){return e?Dt:Ot},anchorHidden(e){return e?kt:null}},Nt={...Mt,...yt},Pt=`data-trigger-disabled`;function Ft(e,t){if(!ze(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Pt);for(let[,e]of t.entries())if(ot(e,n))return!e.hasAttribute(Pt);return!1}function It(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Lt(e){return e.matches(`html,body`)}function Rt(e){return Be(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function zt(e){return st(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ut}`)!=null}function Bt(e){return e?e.getAttribute(`role`)===`combobox`&&Rt(e):!1}function Vt(e){if(!e||De)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ht(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ut(e,t){return t!=null&&!Me(t)?0:typeof e==`function`?e():e}function Wt(e,t,n){let r=Ut(e,n);return typeof r==`number`?r:r?.[t]}function Gt(e){return typeof e==`function`?e():e}function Kt(e,t){return t||e===`click`||e===`mousedown`}function qt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Jt(e,t,n,r){let i=!1,a=!1,o=r??K;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Yt(e,t,n){let r=n??K;return{reason:e,event:t??new Event(`base-ui`),...r}}var Xt=`none`,Zt=`trigger-press`,Qt=`trigger-hover`,$t=`trigger-focus`,en=`outside-press`,tn=`item-press`,nn=`close-press`,rn=`clear-press`,an=`input-change`,on=`input-clear`,sn=`input-press`,cn=`focus-out`,ln=`escape-key`,un=`list-navigation`,dn=`keyboard`,fn=`pointer`,pn=`cancel-open`,mn=`sibling-open`,hn=`disabled`,gn=`missing`,_n=`initial`,vn=`imperative-action`,yn=`window-resize`,bn=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new de,currentIdRef:{current:null},currentContextRef:{current:null}});function xn(e,t){e.current=t.current}function Sn(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=v.useRef(n),a=v.useRef(n),o=v.useRef(null),s=v.useRef(null),c=fe();return q(()=>{a.current=n,o.current?i.current={open:Wt(i.current,`open`),close:Wt(n,`close`)}:i.current=n},[n,o,i,a]),(0,S.jsx)(bn.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Cn(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=v.useContext(bn),[d,f]=v.useState(!1),p=v.useRef(n);return q(()=>{p.current=n},[n]),q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Wt(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Jt(Xt))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,xn(a,s),u.clear()}},[c,i,a,r,s,u]),v.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function wn(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Tn(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function En(e,t,n,r){let i=H(On).current;return kn(i,e,t,n,r)&&jn(i,[e,t,n,r]),i.callback}function Dn(e){let t=H(On).current;return An(t,e)&&jn(t,e),t.callback}function On(){return{callback:null,cleanup:null,refs:[]}}function kn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function An(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function jn(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Mn(e){let t=H(Nn,e).current;return t.next=e,q(t.effect),t}function Nn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Pn={...v},Fn=Pn.useInsertionEffect,In=Fn&&Fn!==Pn.useLayoutEffect?Fn:e=>e();function Y(e){let t=H(Ln).current;return t.next=e,In(t.effect),t.trampoline}function Ln(){let e={next:void 0,callback:Rn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Rn(){}var zn=null;globalThis.requestAnimationFrame;var Bn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Vn=class e{static create(){return new e}static request(e){return Bn.request(e)}static cancel(e){return Bn.cancel(e)}currentId=zn;request(e){this.cancel(),this.currentId=Bn.request(()=>{this.currentId=zn,e()})}cancel=()=>{this.currentId!==zn&&(Bn.cancel(this.currentId),this.currentId=zn)};disposeEffect=()=>this.cancel};function Hn(){let e=H(Vn.create).current;return le(e.disposeEffect),e}function Un(e){return e?.ownerDocument||document}var Wn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Gn={...Wn,position:`fixed`,margin:0,top:0,left:0},Kn={...Wn,position:`absolute`},qn=v.forwardRef(function(e,t){let[n,r]=v.useState();q(()=>{Ee&&we&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,S.jsx)(`span`,{...e,ref:t,style:Gn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Jn=Math.min,Yn=Math.max,Xn=Math.round,Zn=Math.floor,Qn=e=>({x:e,y:e}),$n={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function er(e,t,n){return Yn(e,Jn(t,n))}function tr(e,t){return typeof e==`function`?e(t):e}function nr(e){return e.split(`-`)[0]}function rr(e){return e.split(`-`)[1]}function ir(e){return e===`x`?`y`:`x`}function ar(e){return e===`y`?`height`:`width`}function or(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sr(e){return ir(or(e))}function cr(e,t,n){n===void 0&&(n=!1);let r=rr(e),i=sr(e),a=ar(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_r(o)),[o,_r(o)]}function lr(e){let t=_r(e);return[ur(e),t,ur(t)]}function ur(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dr=[`left`,`right`],fr=[`right`,`left`],pr=[`top`,`bottom`],mr=[`bottom`,`top`];function hr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fr:dr:t?dr:fr;case`left`:case`right`:return t?pr:mr;default:return[]}}function gr(e,t,n,r){let i=rr(e),a=hr(nr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ur)))),a}function _r(e){let t=nr(e);return $n[t]+e.slice(t.length)}function vr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function yr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vr(e)}function br(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xr(e,t,n){return Math.floor(e/t)!==n}function Sr(e,t){return t<0||t>=e.length}function Cr(e,t){return Er(e.current,{disabledIndices:t})}function wr(e,t){return Er(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Tr(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Er(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Sr(e,u)?-1:u,wrapped:d}}function Er(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Or(e,a,r));return a}function Dr(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=st(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Or(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Zn(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Or(e,r,s))return r}};d&&Oe(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Er(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Er(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Sr(e,f)&&(f=u)}if(n===`both`){let n=Zn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Oe(t),u%o===o-1?r&&(f=Er(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Er(e,{startingIndex:u,disabledIndices:s}),r&&xr(f,o,n)&&(f=Er(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),xr(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Oe(t),u%o===0?r&&(f=Er(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Er(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&xr(f,o,n)&&(f=Er(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),xr(f,o,n)&&(f=u));let c=Zn(l/o)===n;Sr(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Er(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Or(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Ar(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function kr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Ar(e,t=e?$e(e):null){return!e||!e.isConnected||!t||kr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var jr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Mr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Ve(n)?n.host:null}function Nr(e){for(let t of Array.from(e.children))if(Fe(t)===`summary`)return t;return null}function Pr(e,t){let n=Nr(t);return!!n&&(e===n||ot(n,e))}function Fr(e){let t=e?Fe(e):``;return e!=null&&e.matches(jr)&&(t!==`summary`||e.parentElement!=null&&Fe(e.parentElement)===`details`&&Nr(e.parentElement)===e)&&(t!==`details`||Nr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ir(e){if(!Fr(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Mr(t)){let n=t!==e,r=Fe(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Fe(t)===`details`&&!t.open&&!Pr(e,t)||t.hasAttribute(`hidden`)||!r&&!Lr(t,n))return!1}return!0}function Lr(e,t){let n=$e(e);return t?n.display!==`none`:Ar(e,n)}function Rr(e){let t=e.tabIndex;if(t<0){let t=Fe(e);if(t===`details`||t===`audio`||t===`video`||Be(e)&&e.isContentEditable)return 0}return t}function zr(e){if(Fe(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Br(e,t){let n=zr(e);if(!n)return!0;let r=t.find(e=>{let t=zr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=zr(e);return t?.name===n.name&&t.form===n.form})===n}function Vr(e){if(Be(e)&&Fe(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Be(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Hr(e,t){Vr(e).forEach(e=>{Fr(e)&&t.push(e),Hr(e,t)})}function Ur(e,t,n){Vr(e).forEach(e=>{Be(e)&&e.matches(t)&&n.push(e),Ur(e,t,n)})}function Wr(e){return Ir(e)&&Rr(e)>=0}function Gr(e){let t=[];return Hr(e,t),t.filter(Ir)}function Kr(e){let t=Gr(e);return t.filter(e=>Rr(e)>=0&&Br(e,t))}function qr(e,t){let n=Kr(e),r=n.length;if(r===0)return;let i=at(Un(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Jr(e){return qr(Un(e).body,1)||e}function Yr(e){return qr(Un(e).body,-1)||e}function Xr(e,t,n){if(!e)return null;let r=[];Hr(Un(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Ir);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!ot(n,o)&&Wr(o)&&Br(o,a))return o}return r[i]}function Zr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!ot(n,r)}function Qr(e){Kr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function $r(e){let t=[];Ur(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ei(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ei(e,t.id,n)])}function ti(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ni(e){return`data-base-ui-${e}`}var ri=0;function ii(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ri);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),ae;let o=requestAnimationFrame(a);return ri=o,()=>{ri===o&&(cancelAnimationFrame(o),ri=0)}}var ai=`data-base-ui-inert`,oi=new WeakMap,si=new WeakSet,ci=new WeakMap,li=0;function ui(e){return e?Ve(e)?e.host:ui(e.parentNode):null}var di=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ui(t);return e.contains(n)?n:null}).filter(e=>e!=null),fi=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},pi=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Fe(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function mi(e,t,n,{mark:r=!0}){let i=di(t,e),a=r?pi(t,fi(i),new Set(i)):[],o=[],s=[];if(n){let e=di(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);pi(t,fi(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(oi.get(e)||0)+1;oi.set(e,r),o.push(e),r===1&&n&&si.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(ci.get(e)||0)+1;ci.set(e,t),s.push(e),t===1&&e.setAttribute(ai,``)}),li+=1,()=>{o.forEach(e=>{let t=(oi.get(e)||0)-1;oi.set(e,t),t||(si.has(e)||e.removeAttribute(`aria-hidden`),si.delete(e))}),r&&s.forEach(e=>{let t=(ci.get(e)||0)-1;ci.set(e,t),t||e.removeAttribute(ai)}),--li,li||(oi=new WeakMap,si=new WeakSet,ci=new WeakMap)}}function hi(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Un(e[0]).body;return mi(e,i,n,{mark:r})}function gi(){let[,e]=v.useState({});return v.useCallback(()=>{e({})},[])}var _i=0;function vi(e,t=`mui`){let n=v.useRef(void 0),r=gi(),i=e??n.current;return v.useEffect(()=>{n.current??(_i+=1,n.current=`${t}-${_i}`,e??r())},[e,t,r]),i}var yi=Pn.useId;function bi(e,t){if(yi!==void 0){let n=yi();return e??(t?`${t}-${n}`:n)}return vi(e,t)}var xi=19;function Si(e){return xi>=e}function Ci(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Si(19)?n?.ref:t.ref)??null}function wi(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ti(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Ei(e,t){return typeof e==`function`?e(t):e}function Di(e,t){return typeof e==`function`?e(t):e}var Oi={};function ki(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ji(t);let a=ji(e);return t&&(a=Mi(a,t)),n&&(a=Mi(a,n)),r&&(a=Mi(a,r)),i&&(a=Mi(a,i)),a}function Ai(e){if(e.length===0)return Oi;if(e.length===1)return ji(e[0]);let t=ji(e[0]);for(let n=1;n<e.length;n+=1)t=Mi(t,e[n]);return t}function ji(e){return Ii(e)?{...e(Oi)}:Ni(e)}function Mi(e,t){return Ii(t)?t(e):Pi(e,t)}function Ni(e){let t={...e};for(let e in t){let n=t[e];Fi(e,n)&&(t[e]=Ri(n))}return t}function Pi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=wi(e.style,r);break;case`className`:e[n]=Bi(e.className,r);break;default:e[n]=Fi(n,r)?Li(e[n],r):r}}return e}function Fi(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ii(e){return typeof e==`function`}function Li(e,t){return t?e?(...n)=>{let r=n[0];if(Vi(r)){let i=r;zi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ri(t):e}function Ri(e){return e&&((...t)=>{let n=t[0];return Vi(n)&&zi(n),e(...t)})}function zi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Bi(e,t){return t?e?t+` `+e:t:e}function Vi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Hi(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ki(r));let i=Ui(t,n,r);if(n.enabled===!1)return null;let a=n.state??K;return qi(e,r,i,a)}function Ui(e,t,n){let{className:r,style:i}=e,{state:a=K,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ei(r,a):void 0,d=l?Di(i,a):void 0,f=l?Ti(a,c):K,p=l&&s?Wi(s):void 0,m=l?wi(f,p)??{}:K;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Dn([m.ref,Ci(n),...o]):En(m.ref,Ci(n),o):En(null,null)),l?(u!==void 0&&(m.className=Bi(m.className,u)),d!==void 0&&(m.style=wi(m.style,d)),m):K}function Wi(e){return Array.isArray(e)?Ai(e):ki(void 0,e)}var Gi=Symbol.for(`react.lazy`);function Ki(e){if(e?.$$typeof!==Gi)return e;let t=v.Children.toArray(e)[0];return v.isValidElement(t)?t:e}function qi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ki(n,t.props);return e.ref=n.ref,v.cloneElement(t,e)}return Ji(e,n)}function Ji(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var Yi={style:{transition:`none`}},Xi=`data-base-ui-click-trigger`,Zi={fallbackAxisSide:`none`},Qi={fallbackAxisSide:`end`},$i={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ea=v.createContext(null),ta=()=>v.useContext(ea),na=ni(`portal`);function ra(e={}){let{ref:t,container:n,componentProps:r=K,elementProps:i}=e,a=bi(),o=ta()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Y(e=>{e!==null&&u(e)}),f=v.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Re(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Hi(`div`,r,{ref:[t,d],props:[{id:a,[na]:``},i]}),m=s&&p?R.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var ia=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ra({container:o,ref:t,componentProps:e,elementProps:c}),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),h=v.useRef(null),[g,_]=v.useState(null),y=v.useRef(!1),b=g?.modal,x=g?.open,C=!!g&&!g.modal&&g.open&&!!l;v.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&Zr(e)&&(e.type===`focusin`?y.current&&=($r(l),!1):(Qr(l),y.current=!0))}return Tn(wn(l,`focusin`,e,!0),wn(l,`focusout`,e,!0))},[l,b]),q(()=>{l&&x===!0&&y.current&&($r(l),y.current=!1)},[x,l]);let w=v.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,S.jsxs)(v.Fragment,{children:[d,(0,S.jsxs)(ea.Provider,{value:w,children:[C&&l&&(0,S.jsx)(qn,{"data-type":`outside`,ref:f,onFocus:e=>{Zr(e,l)?m.current?.focus():Yr(g?g.domReference:null)?.focus()}}),C&&l&&(0,S.jsx)(`span`,{role:s,"aria-owns":u,style:$i}),l&&R.createPortal(a,l),C&&l&&(0,S.jsx)(qn,{"data-type":`outside`,ref:p,onFocus:e=>{Zr(e,l)?h.current?.focus():(Jr(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Jt(`focus-out`,e.nativeEvent)))}})]})]})});function aa(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var oa=class{nodesRef={current:[]};events=aa();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},sa=v.createContext(null),ca=v.createContext(null),la=()=>v.useContext(sa)?.id||null,ua=e=>{let t=v.useContext(ca);return e??t};function da(e){let t=bi(),n=ua(e),r=la();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fa(e){let{children:t,id:n}=e,r=la();return(0,S.jsx)(sa.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pa(e){let{children:t,externalTree:n}=e,r=H(()=>n??new oa).current;return(0,S.jsx)(ca.Provider,{value:r,children:t})}function ma(e){return e==null?e:`current`in e?e.current:e}function ha(e,t){let n=Ie(ct(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Ae(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ga=20,_a=[];function va(){_a=_a.filter(e=>e.deref()?.isConnected)}function ya(e){va(),e&&Fe(e)!==`body`&&(_a.push(new WeakRef(e)),_a.length>ga&&(_a=_a.slice(-20)))}function ba(){return va(),_a[_a.length-1]?.deref()}function xa(e){return e?Wr(e)?e:Kr(e)[0]||e:null}function Sa(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Gr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Wr(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Ca(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,C=Y(()=>x.current.floatingContext?.nodeId),w=i===!1,T=Bt(_)&&w,E=Mn(i),D=Mn(a),O=Mn(o),k=Mn(u),A=Mn(g),j=ua(m),M=ta(),N=v.useRef(!1),P=v.useRef(!1),F=v.useRef(!1),I=v.useRef(null),L=v.useRef(``),R=v.useRef(``),z=v.useRef(null),B=v.useRef(null),V=En(z,p,M?.beforeInsideRef),H=En(B,M?.afterInsideRef),U=fe(),ee=fe(),te=Hn(),ne=M!=null,W=Ht(y),re=Y((e=W)=>e?Kr(e):[]),ie=Y(()=>h?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&ot(W,at(Un(W)))&&re().length===0&&!T&&Oe(e)}return wn(Un(W),`keydown`,e)},[r,W,c,T,re]),v.useEffect(()=>{if(r||!g)return;let e=Un(W);function t(){F.current=!1}function n(e){let t=ct(e),n=ie(),r=ot(y,t)||ot(_,t)||ot(M?.portalNode,t)||n.some(e=>e===t||ot(e,t));F.current=!r,R.current=e.pointerType||`keyboard`,st(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,ee.start(0,()=>{P.current=!1}))}function i(){R.current=`keyboard`}return Tn(wn(e,`pointerdown`,n,!0),wn(e,`pointerup`,t,!0),wn(e,`pointercancel`,t,!0),wn(e,`keydown`,i,!0),t)},[r,y,_,W,g,M,ee,ie]),v.useEffect(()=>{if(r||!l)return;let e=Un(W);function n(){P.current=!0,ee.start(0,()=>{P.current=!1})}function i(e){let t=ct(e);Wr(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ct(n);c&&r==null&&a!=null&&ot(y,a)&&ya(a),queueMicrotask(()=>{let o=C(),l=t.context.triggerElements,u=ie(),p=r?.hasAttribute(ni(`focus-guard`))&&[z.current,B.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,ma(f),ma(d)].includes(r),m=!(ot(_,r)||ot(y,r)||ot(r,y)||ot(M?.portalNode,r)||u.some(e=>e===r||ot(e,r))||l.hasMatchingElement(e=>ot(e,r))||p||j&&(ei(j.nodesRef.current,o).find(e=>ot(e.context?.elements.floating,r)||ot(e.context?.elements.domReference,r))||ti(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,Ht(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&W&&Sa(W),s&&i!==_&&!Ar(a)&&at(e)===e.body){if(Be(W)&&(W.focus(),s===`popup`)){te.request(()=>{W.focus()});return}let e=re(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;Be(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(T||!c)&&r&&m&&!P.current&&(T||r!==ba())&&(N.current=!0,t.setOpen(!1,Jt(cn,n)))})}function o(){F.current||(x.current.insideReactTree=!0,U.start(0,()=>{x.current.insideReactTree=!1}))}let u=Be(_)?_:null;if(y||u)return Tn(u&&wn(u,`focusout`,a),u&&wn(u,`pointerdown`,n),y&&wn(y,`focusin`,i),y&&wn(y,`focusout`,a),y&&M&&wn(y,`focusout`,o,!0))},[r,_,y,W,c,j,M,t,l,s,re,T,C,x,U,ee,te,d,f,ie]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${ni(`portal`)}]`)||[]),t=(j?ti(j.nodesRef.current,C()):[]).find(e=>Bt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=hi([y,...e,z.current,B.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...ie(),t,ma(f),ma(d),T?_:null].filter(e=>e!=null),{ariaHidden:c||T,mark:!1}),i=hi([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,c,M,T,j,C,d,f,ie]),q(()=>{if(!g||r||!Be(W))return;L.current=``,R.current=``;let e=Un(W),t=at(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||ot(W,t))return;let i=null,a=()=>(i??=re(W),i[0]||W),o;o=r===!0||r===null?a():ma(r),o||=a();let s=ot(W,at(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&Ae(c);ii(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=at(e);return!(t!==o&&ot(W,t))}})})},[r,g,W,re,E,k,A,x]);let ae=v.useRef(null);q(()=>{if(r||!W){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=Un(W),t=at(e),n=k.current==null;ya(t);function i(e){if(e.open||(L.current=ha(e.nativeEvent,R.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(ni(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(Ae(e.nativeEvent)||je(e.nativeEvent))N.current=!1;else{let e=!1;Un(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}b.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&Fe(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ba()||null,typeof i==`boolean`?s:ma(i)||s||null}return()=>{b.off(`openchange`,i);let t=at(e),n=ie(),r=ot(y,t)||n.some(e=>e===t||ot(e,t))||j&&ei(j.nodesRef.current,C(),!1).some(e=>ot(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=xa(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&Be(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,y,W,D,O,k,b,j,_,C,ie]),q(()=>{if(!we||g||!y)return;let e=at(Un(y));Be(e)&&Rt(e)&&ot(y,e)&&e.blur()},[g,y]),q(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,l,_]),q(()=>{if(!r&&W)return Sa(W),()=>{queueMicrotask(va)}},[r,W]);let G=!r&&(!c||!T)&&(ne||c);return(0,S.jsxs)(v.Fragment,{children:[G&&(0,S.jsx)(qn,{"data-type":`inside`,ref:V,onFocus:e=>{if(c){let e=re();ii(e[e.length-1])}else M?.portalNode&&(N.current=!1,Zr(e,M.portalNode)?Jr(_)?.focus():ma(f??M.beforeOutsideRef)?.focus())}}),n,G&&(0,S.jsx)(qn,{"data-type":`inside`,ref:H,onFocus:e=>{c?ii(re()[0]):M?.portalNode&&(l&&(N.current=!0),Zr(e,M.portalNode)?Yr(_)?.focus():ma(d??M.afterOutsideRef)?.focus())}})]})}function wa(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Zt}=t,l=e.context.dataRef,u=v.useRef(void 0),d=Hn(),f=fe(),p=v.useMemo(()=>{function t(t,n,r,i){let a=Jt(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Me(e.pointerType,!0)&&je(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Me(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=ct(s),p=Rt(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Me(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return v.useMemo(()=>n?{reference:p}:K,[n,p])}function Ta(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Ea(e){return e!=null&&e.clientX!=null}function Da(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=v.useRef(!1),l=v.useRef(null),[u,d]=v.useState(),[f,p]=v.useState([]),m=Y(t=>{e.set(`positionReference`,t)}),h=Y((t,n,i)=>{c.current||(!s.current.openEvent||Ea(s.current.openEvent))&&e.set(`positionReference`,Ta(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=Y(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Me(u)?a:i;v.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=Ie(a);function r(t){let n=ct(t);ot(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Ea(s.current.openEvent)?l.current=wn(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),v.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),v.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),v.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=v.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return v.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Oa(){return!1}function ka(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Aa(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Oa,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=ua(c),m=Y(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Y(()=>a),{escapeKey:y,outsidePress:b}=ka(s),x=v.useRef(!1),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(!1),E=v.useRef(``),D=v.useRef(null),O=fe(),k=fe(),A=fe(),j=Y(()=>{k.clear(),d.current.insideReactTree=!1}),M=Y(e=>{let t=d.current.floatingContext?.nodeId;return(p?ei(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Y(t=>It(t,e.select(`floatingElement`))||It(t,e.select(`domReferenceElement`))),P=Y(t=>{o()&&e.setOpen(!1,Jt(Zt,t.nativeEvent))}),F=Y(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ke(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=Jt(ln,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=Y(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=Y(t=>{if(!l||!n||t.button!==0)return;let r=ct(t.nativeEvent);ot(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=Y(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});v.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),v.useEffect(()=>j,[j]),v.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new de,i=Un(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(we?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=d.current.floatingContext?.nodeId,n=p&&ei(p.nodesRef.current,t).some(t=>It(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=ct(n),i=`[${ni(`inert`)}]`,a=ze(r)?r.getRootNode():null,o=Array.from((Ve(a)?a:Un(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>ot(e,r))))return;let c=ze(r)?r:null;for(;c&&!Qe(c);){let e=tt(c);if(Qe(e)||!ze(e))break;c=e}if(!(o.length&&ze(r)&&!Lt(r)&&!ot(r,e.select(`floatingElement`))&&o.every(e=>!ot(c,e)))){if(Be(r)&&!(`touches`in n)){let e=Qe(r),t=$e(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!v(n)){if(f()===`intentional`){if(n.detail!==0&&!Ae(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof h!=`function`||h(n))&&(M(`__outsidePressBubbles`)||(e.setOpen(!1,Jt(en,n)),j()))}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=ct(e);if(!n)return;let r=wn(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():v(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function V(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function H(e){L(e,V)}function U(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ee(e){L(e,U)}let te=Tn(r&&Tn(wn(i,`keydown`,F),wn(i,`compositionstart`,a),wn(i,`compositionend`,o)),g&&Tn(wn(i,`click`,z,!0),wn(i,`pointerdown`,z,!0),wn(i,`pointerup`,B,!0),wn(i,`pointercancel`,B,!0),wn(i,`mousedown`,z,!0),wn(i,`mouseup`,B,!0),wn(i,`touchstart`,R,{capture:!0,passive:!0}),wn(i,`touchmove`,H,{capture:!0,passive:!0}),wn(i,`touchend`,ee,{capture:!0,passive:!0})));return()=>{te(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,y,b,F,j,_,M,N,p,e,O,A]);let z=v.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=v.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return v.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}var ja=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(J(99,this.componentName,e,this.componentName));t.setOpen(!0,Jt(vn,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,Jt(vn))}};function Ma(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ze(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Na(e,t=!1,n=!1,r=!1){let[i,a]=v.useState(e&&t?`idle`:void 0),[o,s]=v.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=Vn.request(()=>{a(`ending`)});return()=>{Vn.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=Vn.request(()=>{a(void 0)});return()=>{Vn.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Vn.request(()=>{a(`idle`)});return()=>{Vn.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Pa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Fa=null;function Ia(e){if(!Fa){let e=[];Fa=e,queueMicrotask(()=>{Fa=null,R.flushSync(()=>{for(let t of e)t()})})}Fa.push(e)}function La(e,t=!1,n=!1){let r=Hn();return Y((i,a=null)=>{r.cancel();let o=ma(e);if(o==null)return;let s=o,c=()=>{n?Ia(()=>{a?.aborted||i()}):R.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Pa(s).map(e=>e.finished.then(ae))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Pa(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=ht;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Ra(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Y(a),s=La(r,n,i);v.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function za(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Y(i),{mounted:c,setMounted:l,transitionStatus:u}=Na(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=v.useRef(c),p=v.useRef(!1),m=gi(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=Y(()=>{f.current&&(t?(p.current=!0,m()):h())});return Ra({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Ba={tabIndex:-1,[lt]:``};function Va(e){return t=>t!==`touch`||e.current}function Ha(e,t=!1){let n=bi(),r=la()!=null,i=H(()=>e(n,r)).current;return Ma({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ua({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Wa(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Ga(e,t){let n=v.useRef(null);return Y(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Wa(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Wa(t))})}function Ka(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function qa(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ja(e,t,n,r={}){let i=n.reason,a=i===Qt,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=qa(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Ka(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?R.flushSync(l):l()}function Ya(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Ga(e,n),o=Y(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Y(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Xa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Jt(Xt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Za(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=za({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return H(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Qa(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:K,inactiveTriggerProps:K,popupProps:K})},[e])}function $a(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var eo=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},to=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),no=o(((e,t)=>{t.exports=to()})),ro=o((e=>{var t=d(),n=no();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),io=o(((e,t)=>{t.exports=ro()})),ao=no(),oo=io(),so=Si(19)?uo:fo;function co(e,t,n,r,i){return so(e,t,n,r,i)}function lo(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ao.useSyncExternalStore)(e.subscribe,a,a)}ne({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ao.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function uo(e,t,n,r,i){let a=te();if(!a)return lo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function fo(e,t,n,r,i){return(0,oo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var po=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return co(this,e,t,n,r)}},mo=class extends po{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),co(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Y(t??ae);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},ho={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},go=class extends mo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:aa(),nested:n,triggerElements:i},ho),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Ne(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function _o(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new go({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:K,inactiveTriggerProps:K,popupProps:K}}var vo=e=>e.triggerIdProp??e.activeTriggerId,yo=e=>e.openProp??e.open,bo=e=>(e.popupElement?.id??e.floatingId)||void 0;function xo(e,t){return t!==void 0&&yo(e)&&vo(e)===t}function So(e,t){return xo(e,t)?!0:t!==void 0&&yo(e)&&vo(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Co={open:yo,mounted:e=>e.mounted,transitionStatus:e=>yo(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:vo,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:bo,isTriggerActive:(e,t)=>t!==void 0&&vo(e)===t,isOpenedByTrigger:(e,t)=>xo(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&vo(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>So(e,t)?bo(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function wo(e){let t=v.useCallback(t=>e===void 0?ae:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,ao.useSyncExternalStore)(t,n,()=>e?.serverStore)}function To(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=bi(),a=la()!=null,o=H(()=>new go({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new eo,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ze(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Eo=Se&&we;function Do(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=v.useRef(!1),s=v.useRef(null),c=v.useRef(!0),l=fe();v.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Ie(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Be(t)&&t===at(Un(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Tn(wn(r,`blur`,i),Eo&&wn(r,`keydown`,a,!0),Eo&&wn(r,`pointerdown`,l,!0))},[e,n]),v.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);ze(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=v.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=ct(n.nativeEvent);if(ze(a)){if(Eo&&!n.relatedTarget){if(!c.current&&!Rt(a))return}else if(!Vt(a))return}let u=Ft(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Jt($t,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Jt($t,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=ze(r)&&r.hasAttribute(ni(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=at(Un(t));(r||n!==t)&&(ot(a.current.floatingContext?.refs.floating.current,n)||ot(t,n)||o||Ft(r??n,e.context.triggerElements)||e.setOpen(!1,Jt($t,i)))})}}},[a,r,e,l]);return v.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Oo=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new de;restTimeout=new de;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ko=new WeakMap;function Ao(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ko.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ko.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function jo(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ko.get(n);a&&a!==e&&Ao(a),Ao(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ko.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Mo(e){let t=e.context.dataRef.current,n=H(()=>t.hoverInteractionState??Oo.create()).current;return t.hoverInteractionState||=n,le(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function No(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=ua(),u=la(),d=Mo(e),f=fe(),p=Y(()=>Kt(c.current.openEvent?.type,d.interactedInside)),m=Y(()=>qt(c.current.openEvent?.type)),h=Y(()=>{Ao(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),v.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&ze(s)&&o){let e=s,t=o,n=Un(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??st(e,`[data-rootownerid]`)??n.body;return jo(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),v.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ei(l.nodesRef.current,u).length>0)}function a(t){let n=Wt(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Jt(Qt,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=ct(e);zt(t)?d.interactedInside=st(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ft(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&ze(o)&&ei(l.nodesRef.current,r,!1).some(e=>ot(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,Jt(Qt,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Tn(y&&wn(y,`mouseenter`,g),y&&wn(y,`mouseleave`,_),y&&wn(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Po={current:null};function Fo(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Po,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=ua(l),y=Mo(e),b=v.useRef(!1),x=Mn(i),S=Mn(r),C=Mn(o),w=Mn(n),T=Mn(p),E=Mn(f),D=Y(()=>Kt(h.current.openEvent?.type,y.interactedInside)),O=Y(()=>T.current?.()!==!1),k=Y((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!ot(t,n);if(!ze(r))return!1;let a=r;return i.hasMatchingElement(e=>ot(e,a))&&(!t||!ot(t,a))}),A=Y(()=>{y.handler&&=(Un(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Y(()=>{Ao(y)});return u&&(y.handleCloseOptions=i?.__options),v.useEffect(()=>A,[A]),v.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Qt,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),v.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Wt(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,Jt(Qt,t)),_?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,Jt(Qt,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!ze(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Me(y.pointerType))return;let n=Gt(C.current),r=Wt(S.current,`open`,y.pointerType),i=ct(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(ze(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(ot(t,i)){c=t;break}}ze(o)&&ze(s)&&!e.context.triggerElements.hasElement(o)&&ot(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&ze(c)&&ze(s)&&ot(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,Jt(Qt,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,Jt(Qt,t,c))}):g&&O()&&e.setOpen(!0,Jt(Qt,t,c)))}function o(n){if(D()){j();return}A();let r=Un(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ft(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else(y.pointerType!==`touch`||!ot(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){ot(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?wn(r,`mouseout`,l):void 0;return s?Tn(wn(r,`mousemove`,i,{once:!0}),wn(r,`mouseenter`,i),wn(r,`mouseleave`,o),f):Tn(wn(r,`mouseenter`,i),wn(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,_,w,d,E,O,m]),v.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!Me(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;jo(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Gt(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,Jt(Qt,n,r))}y.pointerType===`touch`?R.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Io(e){return we&&e.movementX===0&&e.movementY===0}function Lo(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Ro(e,t){return Lo(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function zo(e,t,n){return Lo(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Bo(e,t,n){return Lo(t,n?e===dt:e===ft,e===mt)}function Vo(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Lo(t,n?e===ft:e===dt,e===pt)}function Ho(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=Ht(D),j=Bt(O),M=Mn(A),N=la(),P=ua(S),F=v.useRef(f),I=v.useRef(o??-1),L=v.useRef(null),R=v.useRef(!0),z=Y(e=>{i(I.current===-1?null:I.current,e)}),B=v.useRef(!!D),V=v.useRef(E),H=v.useRef(!1),U=v.useRef(!1),ee=v.useRef(null),te=Mn(h),ne=Mn(E),W=Mn(o),re=Mn(x),ie=Hn(),ae=Hn(),G=Y(()=>{ie.cancel();function e(e){d||(ee.current=ii(e,{sync:H.current,preventScroll:!0}))}let t=n.current[I.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),le&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{k.current.orientation=g},[k,g]),q(()=>{E||(L.current=null),(!E||f!==`auto`)&&(F.current=f)},[E,f]),q(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(U.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),q(()=>{if(a){if(!E)H.current=!1;else if(D){if(r==null){if(H.current=!1,W.current!=null)return;if(B.current&&(I.current=-1,G()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||zo(L.current,_,u)||l?Cr(n):wr(n),L.current=null,z())};t()}}else Sr(n.current,r)||(I.current=r,G(),U.current=!1)}}},[a,E,D,r,W,l,n,_,u,z,G,ae]),q(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=at(Un(O??t??null)),r=e.some(e=>e.context&&ot(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),q(()=>{V.current=E,B.current=!!D});let K=r!=null,oe=Y(e=>{if(!ne.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),J=Y(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),se=Y(()=>Cr(n,te.current)),ce=Y(t=>{if(R.current=!1,H.current=!0,t.which===229||!ne.current&&t.currentTarget===M.current)return;if(l&&Vo(t.key,g,u,T)){Ro(t.key,J())||Oe(t),e.setOpen(!1,Jt(un,t.nativeEvent));let n=C?.current??O;Be(n)&&n.focus();return}r!=null&&r!==I.current&&!Sr(n.current,r)&&(I.current=r);let i=I.current,a=Cr(n,h),o=wr(n,h);if(j||(t.key===`Home`&&(Oe(t),I.current=a,z(t)),t.key===`End`&&(Oe(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(Ro(t.key,g)){Oe(t);let e=at(t.currentTarget.ownerDocument);if(E&&!d&&ot(t.currentTarget,e)&&!n.current.some(t=>t!=null&&ot(t,e))){I.current=zo(t.key,g,u)?a:o,z(t),r===I.current&&G();return}let{index:l,wrapped:f}=Tr(n.current,i,{decrement:!zo(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(H.current=!1),I.current=l,z(t)}}),le=v.useMemo(()=>({onFocus(e){H.current=!0,oe(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Io(e)||(H.current=!0,U.current=!1,p&&oe(e))},onPointerLeave(e){if(!ne.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(ee.current?.(),ee.current=null,I.current=-1,z(e),!d)){let e=M.current,t=at(Un(e));e&&ot(e,t)&&e.focus({preventScroll:!0})}}}),[oe,ne,M,p,n,z,re,d]),ue=v.useMemo(()=>d&&E&&K&&{"aria-activedescendant":`${b}-${r}`},[d,E,K,b,r]),de=v.useMemo(()=>({...j?{}:ue,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=ct(t.nativeEvent);if(n&&!ot(M.current,n))return;Oe(t);let r=Jt(cn,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&Be(i)&&i.focus()}else ce(t)},onPointerMove(e){Io(e)||(R.current=!0)}}),[ue,ce,M,j,e,E,d,O,C]),fe=v.useMemo(()=>{function t(t){e.setOpen(!0,Jt(un,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Ae(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&je(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Bo(n.key,J(),u),o=Ro(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Rt(n.currentTarget)))return ce(n);if(r||m||!i){if(s){let e=Ro(n.key,J());L.current=l&&e?null:n.key}l?a&&(Oe(n),r?(I.current=se(),z(n),d&&M.current?.focus()):t(n)):o&&(W.current!=null&&(I.current=W.current),Oe(n),!r&&m?t(n):ce(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ce,f,se,l,z,e,m,g,_,J,u,W,d,M]),pe=v.useMemo(()=>({...ue,...fe}),[ue,fe]);return v.useMemo(()=>a?{reference:pe,floating:de,item:le,trigger:fe}:{},[a,pe,de,fe,le])}function Uo(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Y(s),f=e.useState(`open`),p=fe(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=Y(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Ar(n)||n?.matches(`:disabled`)?!1:o==null||!Or(G,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Oe(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Oe(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),y=Y(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);ot(r,n)||ot(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=v.useMemo(()=>({onKeyDown:_,onBlur:y}),[_,y]);return v.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Wo=.1,Go=Wo*Wo,Ko=.5;function qo(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Jo(e,t,n,r,i,a,o,s,c,l){let u=!1;return qo(e,t,n,r,i,a)&&(u=!u),qo(e,t,i,a,o,s)&&(u=!u),qo(e,t,o,s,c,l)&&(u=!u),qo(e,t,c,l,n,r)&&(u=!u),u}function Yo(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Xo(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Zo(e={}){let{blockPointerEvents:t=!1}=e,n=new de,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Go;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ct(r),g=r.type===`mouseleave`,_=ot(u,h),v=ot(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ze(r.relatedTarget)&&ot(u,r.relatedTarget))return;function y(){return!!(s&&ei(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Xo(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Xo(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Xo(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Xo(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Yo(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Ko/2:Ko*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Ko+1,o=C||T?S.bottom-Ko:S.top,s=C?T?S.bottom-Ko:S.top:S.bottom-Ko;M=Jo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Ko/2:Ko*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Ko,o=C||T?S.top+Ko:S.bottom,s=C?T?S.top+Ko:S.bottom:S.top+Ko;M=Jo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Ko/2:Ko*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Ko+1,o=w||E?S.right-Ko:S.left,s=w?E?S.right-Ko:S.left:S.right-Ko;M=Jo(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Ko/2:Ko*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Ko,o=w||E?S.left+Ko:S.right,s=w?E?S.left+Ko:S.right:S.left+Ko;M=Jo(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Qo(e,t,n){let{reference:r,floating:i}=e,a=or(t),o=sr(t),s=ar(o),c=nr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=rr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function $o(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=tr(t,e),p=yr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=br(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=br(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var es=50,ts=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$o},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<es&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Qo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ns=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=tr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nr(r),_=or(o),v=nr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_r(o)]:lr(o)),x=p!==`none`;!d&&x&&b.push(...gr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=cr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===or(t)||T.every(e=>or(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=or(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},rs=new Set([`left`,`top`]);async function is(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nr(n),s=rr(n),c=or(n)===`y`,l=rs.has(o)?-1:1,u=a&&c?-1:1,d=tr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var as=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await is(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},os=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=tr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=or(i),p=ir(f),m=u[p],h=u[f],g=(e,t)=>er(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ss=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=tr(e,t),u={x:n,y:r},d=or(i),f=ir(d),p=u[f],m=u[d],h=tr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=rs.has(nr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cs=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=tr(e,t),c=await i.detectOverflow(t,s),l=nr(n),u=rr(n),d=or(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Jn(p-c[m],g),y=Jn(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Yn(c.left,c.right):S=p-2*Yn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ls(e){let t=$e(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Be(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xn(n)!==a||Xn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function us(e){return ze(e)?e:e.contextElement}function ds(e){let t=us(e);if(!Be(t))return Qn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ls(t),o=(a?Xn(n.width):n.width)/r,s=(a?Xn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var fs=Qn(0);function ps(e){let t=Ie(e);return!Ze()||!t.visualViewport?fs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ms(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ie(e)}function hs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=us(e),o=Qn(1);t&&(r?ze(r)&&(o=ds(r)):o=ds(e));let s=ms(a,n,r)?ps(a):Qn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ie(a),t=ze(r)?Ie(r):r,n=e,i=it(n);for(;i&&t!==n;){let e=ds(i),t=i.getBoundingClientRect(),r=$e(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ie(i),i=it(n)}}return br({width:u,height:d,x:c,y:l})}function gs(e,t){let n=et(e).scrollLeft;return t?t.left+n:hs(Le(e)).left+n}function _s(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gs(e,n),y:n.top+t.scrollTop}}function vs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Le(r),s=t?We(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qn(1),u=Qn(0),d=Be(r);if((d||!a)&&((Fe(r)!==`body`||He(o))&&(c=et(r)),d)){let e=hs(r);l=ds(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_s(o,c):Qn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ys(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bs(e){let t=et(e),n=e.ownerDocument.body,r=Yn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Yn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gs(e),o=-t.scrollTop;return $e(n).direction===`rtl`&&(a+=Yn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xs=25;function Ss(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ie(e),a=Le(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ze()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xs&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Cs(e,t){let n=hs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ds(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ws(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ss(e,n,t);else if(t===`document`)r=bs(Le(e));else if(ze(t))r=Cs(t,n);else{let n=ps(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return br(r)}function Ts(e,t){let n=t.get(e);if(n)return n;let r=rt(e,[],!1).filter(e=>ze(e)&&Fe(e)!==`body`),i=null,a=$e(e).position===`fixed`,o=a?tt(e):e;for(;ze(o)&&!Qe(o);){let e=$e(o),t=Ye(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=tt(o)}return t.set(e,r),r}function Es(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?We(t)?[]:Ts(t,this._c):[].concat(n),r],o=ws(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ws(t,a[e],i);s=Yn(n.top,s),c=Jn(n.right,c),l=Jn(n.bottom,l),u=Yn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ds(e){let{width:t,height:n}=ls(e);return{width:t,height:n}}function Os(e,t,n){let r=Be(t),i=Le(t),a=n===`fixed`,o=hs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Qn(0);if((r||!a)&&((Fe(t)!==`body`||He(i))&&(s=et(t)),r)){let e=hs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gs(i));let l=i&&!r&&!a?_s(i,s):Qn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ks(e){return $e(e).position===`static`}function As(e,t){if(!Be(e)||$e(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function js(e,t){let n=Ie(e);if(We(e))return n;if(!Be(e)){let t=tt(e);for(;t&&!Qe(t);){if(ze(t)&&!ks(t))return t;t=tt(t)}return n}let r=As(e,t);for(;r&&Ue(r)&&ks(r);)r=As(r,t);return r&&Qe(r)&&ks(r)&&!Ye(r)?n:r||Xe(e)||n}var Ms=async function(e){let t=this.getOffsetParent||js,n=this.getDimensions,r=await n(e.floating);return{reference:Os(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ns(e){return $e(e).direction===`rtl`}var Ps={convertOffsetParentRelativeRectToViewportRelativeRect:vs,getDocumentElement:Le,getClippingRect:Es,getOffsetParent:js,getElementRects:Ms,getClientRects:ys,getDimensions:Ds,getScale:ds,isElement:ze,isRTL:Ns};function Fs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Is(e,t,n){let r=null,i,a=Le(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Zn(d),h=Zn(a.clientWidth-(u+f)),g=Zn(a.clientHeight-(d+p)),_=Zn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Yn(0,Jn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Fs(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ie(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ls(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=us(e),u=i||a?[...l?rt(l):[],...t?rt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Is(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?hs(e):null;c&&g();function g(){let t=hs(e);h&&!Fs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rs=as,zs=os,Bs=ns,Vs=cs,Hs=ss,Us=(e,t,n)=>{let r=new Map,i=n??{},a={...Ps,...i.platform,_c:r};return ts(e,t,{...i,platform:a})},Ws=typeof document<`u`?v.useLayoutEffect:function(){};function Gs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qs(e,t){let n=Ks(e);return Math.round(t*n)/n}function Js(e){let t=v.useRef(e);return Ws(()=>{t.current=e}),t}function Ys(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Gs(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Js(c),O=Js(i),k=Js(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Us(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Gs(T.current,t)&&(T.current=t,R.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ws(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Ws(()=>(j.current=!0,()=>{j.current=!1}),[]),Ws(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=qs(N.floating,u.x),r=qs(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ks(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Xs=(e,t)=>{let n=Rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zs=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>({fn:Hs(e).fn,options:[e,t]}),$s=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ec=(e,t)=>{let n=Vs(e);return{name:n.name,fn:n.fn,options:[e,t]}},tc=class extends mo{setState(e){}update(e){}set(e,t){}notifyAll(){}},nc={...Co,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},rc=class extends mo{constructor(e,t,n){let r=new eo;super(ac(e,r,t,n),oc(r),nc)}setOpen=(e,t)=>{Ja(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Jt(Zt,e))}};function ic(){let e=new eo,t=new tc(Object.freeze(ac(void 0,e)),Object.freeze(oc(e)),nc);return Object.assign(t,{setOpen:ae,cancelPendingOpen:ae})}function ac(e,t,n,r=!1){return{..._o(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function oc(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var sc=W(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ha((e,t)=>new rc({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Xa(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Za(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=v.useRef(null);q(()=>{m&&t&&p.setOpen(!1,Jt(hn))},[m,t,p]),q(()=>{x===`ending`&&T===`none`||x!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[x,C,T,w,p]),q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,Jt(vn))}),[b,p]);let D=h||_||!t&&a!==`none`;return(0,S.jsxs)(se.Provider,{value:p,children:[l&&(0,S.jsx)(Ua,{handle:l,store:p}),D&&(0,S.jsx)(cc,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function cc({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Aa(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Da(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>ki(a.reference,i.reference),[a.reference,i.reference]);return Qa(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??K}),null}function lc(e){return bi(e,`base-ui`)}var uc=v.createContext(void 0);function dc(){return v.useContext(uc)}var fc=`data-base-ui-tooltip-trigger`;function pc(e){let t=ct(e);return ze(t)?t:null}var mc=re(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=ce(!0),m=wo(a)??p;if(!m)throw Error(J(82));let h=lc(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=v.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Ya(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=dc(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Cn(y,{open:_}),k=Mo(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Mn(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=fe(),L=v.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=st(e,`[${fc}]`);return n!==null&&n!==t&&ot(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=Fo(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Zo():null,restMs:R,delay(){return u==null&&O?{close:Wt(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),H=Do(y,{enabled:!j}).reference,U=e=>{let t=F.current,n=pc(e),r=B(n),i=b.current,a=i&&n&&ot(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,Jt(Qt,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Me(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,Jt(Qt,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ee=m.useState(`appliedTriggerProps`,C||N!==`none`);return Hi(`button`,e,{state:{open:_},ref:[t,S,b],props:[V,H,ee,{onMouseOver(e){U(e.nativeEvent)},onFocus(e){z(pc(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Pt]:j?``:void 0,[fc]:j?void 0:``},f],stateAttributesMapping:At})}),hc=v.createContext(void 0);function gc(){let e=v.useContext(hc);if(e===void 0)throw Error(J(70));return e}var _c=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ra({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,S.jsxs)(v.Fragment,{children:[l,c&&R.createPortal(n,c)]})}),vc=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ce().useState(`mounted`)||n?(0,S.jsx)(hc.Provider,{value:n,children:(0,S.jsx)(_c,{ref:t,...r})}):null}),yc=v.createContext(void 0);function bc(){let e=v.useContext(yc);if(e===void 0)throw Error(J(71));return e}function xc(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=v.useState(null),d=v.useRef(null),f=ua(n),p=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Ys({...e,elements:{...p,...l&&{reference:l}}}),h=v.useCallback(e=>{let t=ze(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=v.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=v.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=v.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),v.useMemo(()=>({...m,context:y,refs:g,elements:_,rootStore:r}),[m,g,_,y,r])}var Sc=v.createContext(void 0);function Cc(){return v.useContext(Sc)?.direction??`ltr`}var wc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=tr(e,t)||{};if(l==null)return{};let d=yr(u),f={x:n,y:r},p=sr(i),m=ar(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=er(D,k,O),j=!c.arrow&&rr(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Tc=(e,t)=>{let{name:n,fn:r}=wc(e);return{name:n,fn:r,options:[e,t]}},Ec={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Dc={sideX:`left`,sideY:`top`},Oc=`--available-width`,kc=`--available-height`,Ac=`--anchor-width`,jc=`--anchor-height`,Mc=`--transform-origin`,Nc=Oc,Pc=kc;function Fc(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Ic(e,t,n){let{rects:r,placement:i}=e;return{side:Fc(t,nr(i),n),align:rr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Lc(e){return Rc(e,xc)}function Rc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=Y(k),j=k?A:n,M=Mn(n),N=Mn(g),P=Cc()===`rtl`,[F,I]=v.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?nr(F):null,z=F&&L?rr(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,H=V===`center`?B:`${B}-${V}`,U=l;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),W=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:U},ie=v.useRef(null),ae=Mn(a),G=Mn(s),K=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,J=[];p&&J.push(p),J.push(Xs(e=>{let t=Ic(e,i,P),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof G.current==`function`?G.current(t):G.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[K,oe,P,i]));let se=T===`none`&&w!==`shift`,ce=!se&&(u||D||w===`shift`),le=w===`none`?null:$s({...re,padding:{top:U.top+1+ee,right:U.right+1+W,bottom:U.bottom+1+te,left:U.left+1+ne},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),ue=se?null:Zs({...re,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ce,limiter:u||D?void 0:Qs(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=or(nr(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[re,u,D,O,U,T]);w===`shift`||T===`shift`||V===`center`?J.push(ue,le):J.push(le,ue),J.push(ec({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Nc,`${t}px`),i.setProperty(Pc,`${n}px`);let a=Ie(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Ac,`${u}px`),i.setProperty(jc,`${d}px`)}}),Tc(e=>({element:ie.current||Un(e.elements.floating).createElement(`div`),padding:ie.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=nr(r),u=rr(r),d=or(l)===`y`,f=ie.current,p=typeof a==`function`?a(Ic(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ce&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Mc,d?`${m} ${h}`:`${h} ${m}`),{}}},Ec,x),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let de=v.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:fe,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:H,middleware:J,strategy:r,whileElementsMounted:m?void 0:(...e)=>Ls(...e,de),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||Dc,we=be?r:`fixed`,Te=v.useMemo(()=>{let e;return e=be?x?{position:we,[Se]:me,[Ce]:he}:{...xe,position:we}:{position:we,top:0,left:0},e[Nc]=`100vw`,e[Pc]=`100vh`,be||(e.opacity=0),e},[x,we,Se,me,Ce,he,xe,be]),Ee=v.useRef(null);q(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(zc(t)?t.current:t)||null;n!==Ee.current&&(fe.setPositionReference(n),Ee.current=n)},[g,fe,j,M]),v.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&zc(e)&&e.current!==Ee.current&&(fe.setPositionReference(e.current),Ee.current=e.current)},[g,fe,j,M]),v.useEffect(()=>{if(m&&g&&pe.reference&&pe.floating)return Ls(pe.reference,pe.floating,_e,de)},[m,g,pe,_e,de]);let De=nr(ve),Oe=Fc(i,De,P),ke=rr(ve)||`center`,Ae=!!ge.hide?.referenceHidden;q(()=>{S&&g&&be&&(De!==B||L&&ke!==V)&&I(ve)},[S,L,g,be,ve,De,ke,B,V]);let je=v.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:ie,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:fe,context:ye,isPositioned:be,update:_e}),[Te,je,ie,Me,Oe,ke,De,Ae,fe,ye,be,_e])}function zc(e){return e!=null&&`current`in e}function Bc(e){return e===`starting`?Yi:K}function Vc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Hi(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Bc(r),i],stateAttributesMapping:Mt})}var Hc=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Qi,style:g,..._}=e,y=ce(),b=gc(),x=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`trackCursorAxis`),T=y.useState(`disableHoverablePopup`),E=y.useState(`floatingRootContext`),D=y.useState(`instantType`),O=y.useState(`transitionStatus`),k=Lc({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),A=Vc(e,v.useMemo(()=>({open:x,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[x,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!x||w===`both`||T});return(0,S.jsx)(yc.Provider,{value:k,children:A})}),Uc=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ce(),{side:s,align:c}=bc(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Ra({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),No(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Hi(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Ba,f,Bc(d),a],stateAttributesMapping:Nt})}),Wc=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ce(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=bc();return Hi(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Mt})}),Gc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,S.jsx)(uc.Provider,{value:t,children:(0,S.jsx)(Sn,{delay:i,timeoutMs:r,children:e.children})})};function Kc(e){return Si(19)?e:e?`true`:void 0}function qc(e){let[t,n]=v.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Jc=class extends ja{constructor(){super(ic(),`Tooltip`)}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function Yc(){return new Jc}var Xc=48,Zc=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Xc-t;return n},Qc=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},$c=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Xc;n+=i>>>1^-(i&1),t[r]=n}return t},el=384,tl=[],nl=Qc(Zc(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),rl=Qc(Zc(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),il=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,al=(()=>{let e=nl.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=nl[n];i<nl[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(nl[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=nl[i];a<nl[i+1];a++)n[r++]=e,e+=t[e]}return n})(),ol=Zc(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),sl=Qc(Zc(`123333359346463635126536711576`)),cl=Zc(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ll=Zc(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ul=$c(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),dl=(()=>{let e=new Int32Array(319).fill(-1),t=$c(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=$c(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),fl=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),pl=$c(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ml=$c(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),hl=$c(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±`),gl=new Int32Array(987),_l=new Int32Array(987),vl=new Int32Array(987),yl=``,bl=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<pl.length;r++)for(let i of fl[hl[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),bl[a*2]=yl.length,bl[a*2+1]=i.length,yl+=i),gl[n]=pl[r],_l[n]=ml[r],vl[n]=a,n++}}var xl=$c(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Sl=Qc(Zc(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Cl=$c(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),wl=Zc(`ij`),Tl=Zc(``),El=Zc(`1`),Dl={GROUP_COUNT:el,customValidatorNames:tl,edgeStart:nl,labelStart:rl,labelText:il,edgeTarget:al,nodeGroup:ol,nodeVlist:dl,vlistPat:sl,vlistOps:cl,vlistRef:ll,vlistGroup:ul,litAnchor:gl,litGroup:_l,litPool:vl,poolOffsets:bl,poolText:yl,adjGid:xl,adjStart:Sl,adjTgt:Cl,patGid:wl,patTgt:Tl,postfixLookupGroups:El,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ol=`line`in Error(),kl=-1,Al=-1,jl=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Ml=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Nl=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(jl(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(jl(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,H=V.length,U=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=0,ie=-1,ae=-1,G=-1,K=-1,q=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,oe=e=>/\s/.test(String.fromCharCode(e)),J=(e,t,n)=>{if(re=0,ie=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)re=1;else if(r===40&&i===41)re=2;else return;G=t+1,K=n-1;let a=t+1;if(q(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!q(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ie=t+1,ae=a,G=a+1)}},se=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},ce=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,le=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ue=e=>!!e&&!Number.isNaN(Number(e)),de=(e,t,n)=>{if(n-t<11||!se(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&se(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&se(e,t+10,t+18,`-normal/`)},fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],he=(e,t,n,r)=>{if(e>=10){if(e>=25)return U[e-25](t.slice(n,r));let i=e-10;if(re!==fe[i])return!1;if(ie>=0){for(let e of pe[i])if(se(t,ie,ae,e))return!0;return!1}switch(me[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(G,K);return ee.test(e)&&!te.test(e)}case 3:return ue(t.slice(G,K));case 4:return W.test(t.slice(G,K));default:return ne.test(t.slice(G,K))}}switch(e){case 0:return!0;case 1:return re===0;case 2:return re===1;case 3:return re===2;case 4:return ce.test(t.slice(n,r));case 5:return ue(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ue(t.slice(n,r-1));case 8:return le.test(t.slice(n,r));default:return de(t,n,r)}},ge=new Set(typeof E==`string`?E.split(` `):E),_e=(e,t,n,r,i,a)=>{let o=jl(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ve=new Map,ye=new Map,be=2,xe=4096,Se=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ge.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=ye.get(s);return c===void 0&&ye.set(s,c=be++),c},Ce=new Map,we=r,Te=r+4096,Ee=()=>we++,De=2097152,Oe=8192,ke=new Int32Array(Oe),Ae=Array(Oe).fill(null),je=new Int32Array(Oe),Me=new Int32Array(Oe),Ne=new Uint8Array(Oe),Pe=0,Fe=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ae[e]!==null){if(Ae[e|1]===null)c=e|1;else if(!(Pe++&3))c=e|Pe>>2&1;else return}Ae[c]=t.slice(n,r),ke[c]=i,je[c]=a,Me[c]=o,Ne[c]=s},Ie=()=>Ae.fill(null),Le=256,Re=[new Int32Array(Le),new Int32Array(Le),new Int32Array(Le),new Int32Array(Le)],[ze,Be,Ve,He]=Re,Ue=new Uint8Array(Le),We=new Uint8Array(Le),Ge=()=>{Le*=2,Re=Re.map(e=>{let t=new Int32Array(Le);return t.set(e),t}),[ze,Be,Ve,He]=Re;let e=new Uint8Array(Le);e.set(Ue),Ue=e,We=new Uint8Array(Le)},Ke=64,qe=new Int32Array(Ke),Je=new Int32Array(Ke),Ye=new Int32Array(r),Xe=2048,Ze=21,Qe=new Float64Array(Xe),$e=new Int32Array(Xe),et=0,tt=(e,t)=>{if(e===0&&t<r)return Ye[t]===et?1:(Ye[t]=et,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Ze;for(;$e[i]===et;){if(Qe[i]===n)return 1;i=i+1&Xe-1}return Qe[i]=n,$e[i]=et,0},nt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?kl:_e(Ce,e,t+1,r,0,Ee)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Je[t];if(r>n)continue;let i=qe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;J(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(he(d[t],e,r,n))return p[h+t]}return kl},rt=e=>{let t=e.length,n=0,c=0,u=!1;(be>xe||ve.size>xe)&&(ve=new Map,ye=new Map,be=2,Ie()),we>Te&&(Ce=new Map,we=r,Ie());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&oe(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&oe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Le&&Ge();let _=n++;ze[_]=p,Be[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ke[y]===v&&Ae[y]!==null&&Ae[y].length===g?t=y:ke[y|1]===v&&Ae[y|1]!==null&&Ae[y|1].length===g&&(t=y|1),t>=0){let n=Ae[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ve[_]=je[t],He[_]=Me[t],Ue[_]=Ne[t];continue}}}let b=p;if(H!==0){if(h-p<=H||!e.startsWith(V,p)){Ve[_]=kl,Fe(y,e,p,h,v,kl,0,0);continue}b=p+H}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(qe[0]=0,Je[0]=M,R=1);let z=Al,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Al:P,B=R),P!==Al){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Al;else{let e=i[P],t=i[P+1],c=Al;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ke){Ke*=2;let e=new Int32Array(Ke);e.set(qe),qe=e;let t=new Int32Array(Ke);t.set(Je),Je=t}qe[R]=r,Je[R]=t+2,R++}}A===D&&(z=F<I?Al:P,B=R);let U=F<I?Al:P,ee,te=!1;if(A>=0){if(te=!0,ee=nt(e,E,A,z,B),ee!==kl&&ee<r&&j[ee]){let t=nt(e,E,D,U,R);t!==kl&&t!==ee&&(ee=t,te=!1)}else ee===kl&&(ee=nt(e,E,D,U,R),te=!1)}else ee=nt(e,E,D,U,R);let ne=0,W=0;ee===kl?Ve[_]=kl:(W=+!!te,ne=b>=C?+!!O:_e(ve,e,b,C,+!!O,e=>Se(e,O)),Ve[_]=ee,Ue[_]=W,He[_]=ne),Fe(y,e,p,h,v,ee,ne,W)}if(n===0)return``;if(n===1)return ze[0]===0&&Be[0]===t?e:e.slice(ze[0],Be[0]);if(n*k>Xe){for(;n*k>Xe;)Xe<<=1,Ze--;Qe=new Float64Array(Xe),$e=new Int32Array(Xe)}if(be>=De||we>=De)throw Error(`cn: too many distinct classes in one merge`);et=et+1|0,et===0&&(Ye.fill(0),$e.fill(0),et=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ve[e];if(t===kl){We[e]=1;continue}let n=He[e];if(tt(n,t)===1)We[e]=0,f=!0;else if(We[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)tt(n,x[e]);if(Ue[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&tt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!We[m]){m++;continue}let t=ze[m],r=Be[m],i=m+1;for(;i<n&&We[i]&&ze[i]===r+1&&e.charCodeAt(r)===32;)r=Be[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},it=16384,at=new Int32Array(it*2),ot=0,st=1,ct=Object.create(null),lt=Object.create(null),ut=new Map,dt=new Map,ft=0,pt=0,mt=()=>{ot^=it,st=st+1|0,pt=0},ht=e=>{let t=ct[e];if(t!==void 0)return t;let n=Ml(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=lt[e],t!==void 0)?(ct[e]=t,t):(t=rt(e),i?(ct[e]=t,++ft>z&&(ft=0,lt=ct,ct=Object.create(null),mt())):(at[r]=n^st,++pt>it&&mt()),t)},gt=e=>{let t=ut.get(e);if(t!==void 0)return t;let n=Ml(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=dt.get(e),t!==void 0)?(ut.set(e,t),t):(t=rt(e),i?(ut.set(e,t),++ft>z&&(ft=0,dt=ut,ut=new Map,mt())):(at[r]=n^st,++pt>it&&mt()),t)},_t=e=>{let t=Ml(e,0,e.length),n=(t&16383)+ot;return at[n]===(t^st)||at[n^it]===(t^st-1)||(at[n]=t^st,++pt>it&&mt(),!1)},vt=z===0?rt:Ol?e=>{let t=ut.get(e);return t===void 0?gt(e):t}:ht;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?vt(arguments[0]):vt(Il.apply(null,arguments))},mergeString:vt,seenBefore:z===0?()=>!1:_t,mergeUncached:rt}},Pl=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Pl(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Fl=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Pl(i,t);a&&(n&&(n+=` `),n+=a)}return n},Il=function(){return Fl(arguments,!1)},Ll=256,Rl=16,zl=1024,Bl=4096,Vl=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Bl).fill(``),l=Array(Bl).fill(``),u=Array(Bl).fill(``));let i=Ml(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Pl(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Rl&&(_.miss=Rl,_.skip=zl,_.e.length=0,_.at=0);let u=_.e;u.length<Ll?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Pl(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Hl=Nl(Dl),X=Vl(Hl.mergeString,Hl);Hl.merge;function Ul({delay:e=0,...t}){return(0,S.jsx)(Gc,{"data-slot":`tooltip-provider`,delay:e,...t})}function Wl({...e}){return(0,S.jsx)(sc,{"data-slot":`tooltip`,...e})}function Gl({...e}){return(0,S.jsx)(mc,{"data-slot":`tooltip-trigger`,...e})}function Kl({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,S.jsx)(vc,{children:(0,S.jsx)(Hc,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,S.jsxs)(Uc,{"data-slot":`tooltip-content`,className:X(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,S.jsx)(Wc,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var ql=new Set;function Jl(){for(let e of ql)e.isOpen&&e.close()}function Yl(e){return(0,v.useEffect)(()=>{function e(){document.hidden&&Jl()}return window.addEventListener(`blur`,Jl),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,Jl),document.removeEventListener(`visibilitychange`,e)}},[]),(0,S.jsx)(Ul,{...e})}function Xl(e){let[t]=(0,v.useState)(Yc);return(0,v.useEffect)(()=>(ql.add(t),()=>{ql.delete(t)}),[t]),(0,S.jsx)(Wl,{handle:t,...e})}var Zl=`factory.theme`,Ql=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function $l(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ql(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var eu=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},tu=e=>{let t=eu(e);return t.charAt(0).toUpperCase()+t.slice(1)},nu=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ru={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function iu(e){return e!=null}function au(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??ru.width,a=e.size??e.height??ru.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?nu(...c):nu(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??ru[`stroke-width`])*Number(e.size??e.width??ru.width)/Number(t.size??t.width??ru.width):t.strokeWidth??ru[`stroke-width`];return[`svg`,{...Object.entries(ru).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&iu(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&iu(t.width)&&{[r(`width`)]:t.width},...`height`in t&&iu(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ou(e,t={}){return au(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var su=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cu=(0,v.createContext)({}),lu=()=>(0,v.useContext)(cu),uu=(0,v.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:y=``}=lu()??{},b=!!c||su(d),[x,S,C=[]]=ou(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:nu(y,s),hasA11yProp:b,attributes:d});return(0,v.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function du(e,t=[],n=[]){let r=typeof e==`string`?$l(e,t,n):e,i=(0,v.forwardRef)(({className:e,...t},n)=>(0,v.createElement)(uu,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=tu(r.name)),i}var fu={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};fu.node;var pu=du(fu),mu={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};mu.node;var hu=du(mu),gu={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};gu.node;var _u=du(gu),vu={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};vu.node;var yu=du(vu),bu={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};bu.node;var xu=du(bu),Su={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Su.node;var Cu=du(Su),wu={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};wu.node;var Tu=du(wu),Eu={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Eu.node;var Du=du(Eu),Ou={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ou.node;var ku=du(Ou),Au={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Au.node;var ju=du(Au),Mu={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Mu.node;var Nu=du(Mu),Pu={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Pu.node;var Fu=du(Pu),Iu={name:`circle-x`,size:24,node:[[`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`}]],aliases:[`x-circle`]};Iu.node;var Lu=du(Iu),Ru={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ru.node;var zu=du(Ru),Bu={name:`external-link`,size:24,node:[[`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`}]]};Bu.node;var Vu=du(Bu),Hu={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};Hu.node;var Uu=du(Hu),Wu={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Wu.node;var Gu=du(Wu),Ku={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Ku.node;var qu=du(Ku),Ju={name:`git-pull-request-closed`,size:24,node:[[`path`,{d:`m15.5 3.5 5 5`,key:`1kmx7t`}],[`path`,{d:`m15.5 8.5 5-5`,key:`saftza`}],[`path`,{d:`M18 11.62V15`,key:`1greaj`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}]]};Ju.node;var Yu=du(Ju),Xu={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Xu.node;var Zu=du(Xu),Qu={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Qu.node;var $u=du(Qu),ed={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};ed.node;var td=du(ed),nd={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};nd.node;var rd=du(nd),id={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};id.node;var ad=du(id),od={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};od.node;var sd=du(od),cd={name:`message-circle`,size:24,node:[[`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`}]]};cd.node;var ld=du(cd),ud={name:`package-check`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]};ud.node;var dd=du(ud),fd={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};fd.node;var pd=du(fd),md={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};md.node;var hd=du(md),gd={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};gd.node;var _d=du(gd),vd={name:`refresh-cw`,size:24,node:[[`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`}]]};vd.node;var yd=du(vd),bd={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};bd.node;var xd=du(bd),Sd={name:`settings-2`,size:24,node:[[`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`}]]};Sd.node;var Cd=du(Sd),wd={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};wd.node;var Td=du(wd),Ed={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ed.node;var Dd=du(Ed),Od={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};Od.node;var kd=du(Od),Ad={name:`workflow`,size:24,node:[[`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`}]]};Ad.node;var jd=du(Ad),Md={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Md.node;var Nd=du(Md),Pd={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Pd.node;var Fd=du(Pd);function Id(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Id(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ld(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Id(e))&&(r&&(r+=` `),r+=t);return r}var Rd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,zd=Ld,Bd=(e,t)=>n=>{if(t?.variants==null)return zd(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Rd(t)||Rd(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return zd(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Vd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty`,className:X(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function Hd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-header`,className:X(`flex max-w-sm flex-col items-center gap-2`,e),...t})}function Ud({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-title`,className:X(`font-heading text-sm font-medium tracking-tight`,e),...t})}function Wd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-description`,className:X(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function Gd({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`empty-content`,className:X(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance`,e),...t})}var Kd=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function qd(e){let t=Math.round((Date.now()-Date.parse(e))/6e4);if(t<1)return`just now`;if(t<60)return`${t} min ago`;let n=Math.round(t/60);return n<48?`${n} h ago`:`${Math.round(n/24)} days ago`}var Jd=e=>Math.round((Date.now()-Date.parse(e))/6e4),Yd=e=>e.split(`/`).filter(Boolean).at(-1)??e,Xd=e=>`${Yd(e.repo)}: ${e.title||e.id}`,Zd=e=>e.replace(/T(\d\d)(\d\d)(\d\d)$/,`T$1:$2:$3Z`),Qd={working:`default`,idle:`secondary`,sleeping:`outline`,stopped:`outline`},$d=({model:e,effort:t})=>[e,t].filter(Boolean).join(`, `),ef=e=>[e.agent,$d(e)].filter(Boolean).join(` `),tf=e=>e.charAt(0).toUpperCase()+e.slice(1);async function nf(e,t,n){let r=await fetch(t,{method:e,body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json();if(!r.ok)throw Error(i.error);return i}var rf={candidates:()=>nf(`GET`,`/api/candidates`),refreshCandidates:()=>nf(`POST`,`/api/candidates/refresh`),plays:()=>nf(`GET`,`/api/plays`),prompt:e=>nf(`POST`,`/api/candidates/prompt`,{repo:e.repo,id:e.id}),jobPrompt:e=>nf(`GET`,`/api/jobs/${e}/prompt`),repos:()=>nf(`GET`,`/api/repos`),clone:e=>nf(`POST`,`/api/repos/clone`,{name:e}),queue:(e,t)=>nf(`POST`,`/api/jobs`,{items:e,pin:t}),remove:e=>nf(`POST`,`/api/jobs/${e}/remove`),retry:e=>nf(`POST`,`/api/jobs/${e}/retry`),answer:(e,t)=>nf(`POST`,`/api/jobs/${e}/answer`,{text:t}),goal:(e,t)=>nf(`POST`,`/api/jobs/${e}/${t}`),newGoal:e=>nf(`POST`,`/api/goals`,e),importPlan:e=>nf(`POST`,`/api/goals/import`,{plan:e}),replan:(e,t)=>nf(`POST`,`/api/jobs/${e}/replan`,{why:t}),verify:(e,t)=>nf(`POST`,`/api/jobs/${e}/verify`,{need:t}),followup:(e,t)=>nf(`POST`,`/api/jobs/${e}/followup`,{task:t}),review:(e,t)=>nf(`POST`,`/api/jobs/${e}/review`,{agent:t}),prDetails:e=>nf(`GET`,`/api/jobs/${e}/pr`),merge:e=>nf(`POST`,`/api/jobs/${e}/merge`),rebase:e=>nf(`POST`,`/api/jobs/${e}/rebase`),mergeTrain:e=>nf(`POST`,`/api/train`,{ids:e}),close:e=>nf(`POST`,`/api/jobs/${e}/close`),move:(e,t)=>nf(`POST`,`/api/jobs/${e}/move`,{index:t}),models:()=>nf(`GET`,`/api/models`),saveSettings:e=>nf(`PUT`,`/api/settings`,e),turnOn:e=>nf(`POST`,`/api/on`,e),turnOff:()=>nf(`POST`,`/api/off`),chat:e=>nf(`POST`,`/api/chat`,{message:e}),abortChat:()=>nf(`POST`,`/api/chat/abort`),answerChat:e=>nf(`POST`,`/api/chat/answer`,e),resetChat:()=>nf(`POST`,`/api/chat/reset`)};function af(){let[e,t]=(0,v.useState)(),[n,r]=(0,v.useState)(),i=(0,v.useCallback)(()=>nf(`GET`,`/api/state`).then(t,e=>r(`Can't reach factory serve: ${e.message}`)),[]);return(0,v.useEffect)(()=>{let e=()=>void nf(`GET`,`/api/state`).then(t,e=>r(`Can't reach factory serve: ${e.message}`));e();let n=setInterval(e,3e3);return()=>clearInterval(n)},[]),{snapshot:e,error:n,act:(0,v.useCallback)(async e=>{try{await e(),r(void 0)}catch(e){r(e.message)}await i()},[i])}}function of(e){return Hi(e.defaultTagName??`div`,e,e)}var sf=Bd(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,accent:`bg-(--om-accent) text-(--om-dark-background)`}},defaultVariants:{variant:`default`}});function cf({className:e,variant:t=`default`,render:n,...r}){return of({defaultTagName:`span`,props:ki({className:X(sf({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var lf=v.createContext(void 0);function uf(e=!1){let t=v.useContext(lf);if(t===void 0&&!e)throw Error(J(16));return t}function df(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function ff(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Ie(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function pf(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=uf(!0),c=a??s!==void 0,{props:l}=df({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;mf(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ki({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(zi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=mf(r),s=!i&&hf(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),ff(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ff(r,e)))},onKeyUp(e){t||(zi(e),a?.(e),e.target===e.currentTarget&&i&&c&&mf(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ff(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Y(e=>{o.current=e,u()})}}function mf(e){return Be(e)&&e.tagName===`BUTTON`}function hf(e){return Be(e)&&e.tagName===`A`&&!!e.href}var gf=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=pf({disabled:i,focusableWhenDisabled:a,native:o});return Hi(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),_f=Bd(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function vf({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,S.jsx)(gf,{"data-slot":`button`,className:X(_f({variant:t,size:n,className:e})),...r})}var yf=`data-valid`,bf=`data-invalid`,xf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Sf={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Cf={disabled:!1,...Sf},wf={valid(e){return e===null?null:e?{[yf]:``}:{[bf]:``}}},Tf={invalid:void 0,name:void 0,validityData:{state:xf,errors:[],error:``,value:``,initialValue:null},setValidityData:ae,disabled:void 0,setTouched:ae,setDirty:ae,setFilled:ae,setFocused:ae,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Cf,registerFieldControl:ae,validation:{getValidationProps:(e,t=K)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:ae,getInputControl:()=>null,commit:async()=>{},change:ae}},Ef=v.createContext(Tf);function Df(e=!0){let t=v.useContext(Ef);if(t.setValidityData===ae&&!e)throw Error(J(28));return t}var Of=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ae,validationMode:`onSubmit`,submitCountRef:{current:0}});function kf(){return v.useContext(Of)}var Af=v.createContext({controlId:void 0,registerControlId:ae,resetControlId:ae,labelId:void 0,setLabelId:ae,messageIds:[],setMessageIds:ae,getDescriptionProps:e=>e});function jf(){return v.useContext(Af)}function Mf(e,t,n,r=!0,i,a){let[o,s]=v.useState(),c=lc(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return q(()=>{let i=e||t||l||!r?void 0:Nf(n.current,c);o!==i&&s(i)}),u}function Nf(e,t){let n=Pf(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Pf(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function Ff(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=jf(),o=lc(),s=H(()=>Symbol()),c=v.useRef(!1),l=v.useRef(!1),u=Y(()=>{c.current&&i!==ae&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===ae){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}var If=v.createContext({disabled:!1});function Lf(){return v.useContext(If)}function Rf(e,t,n){let{setFocused:r,focusOwnerRef:i}=Df(),a=Y(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function zf(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Df(),s=H(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Bf(e,t){let n=v.useRef(e),r=Y(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}var Vf=v.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:y,setFilled:b,validationMode:x,validation:S}=Df(),{clearErrors:C,elementRef:w,submitCountRef:T}=kf(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=jf(),A=Ff({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=Y(()=>S.inputRef.current?.value);zf(S.inputRef,A,M,N,!E,a),q(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),Bf(M,()=>{M!==void 0&&(C(D),_(M!==(y.initialValue??``)),S.change(M))});let P=v.useRef(null),F=Rf(E,P),I=fe();return Hi(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=Jt(Xt,e.nativeEvent);c?.(t,n),!j&&(_(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:wf})}),Hf=v.forwardRef(function(e,t){return(0,S.jsx)(Vf,{ref:t,...e})});function Uf({className:e,type:t,...n}){return(0,S.jsx)(Hf,{type:t,"data-slot":`input`,className:X(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var Wf={note:`note`,ask:`asked`,assume:`assumed`,answer:`you answered`,result:`result`,step:`step`,train:`merge train`,factory:`factory`};function Gf({job:e,act:t,queued:n}){let r=e.notes.findLast(e=>e.kind===`result`),i=[...new Set(e.notes.flatMap(e=>e.followups??[]))],a=e.attempts.at(-1)?.branch;return!r&&i.length===0&&!a?null:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-popover p-2 text-sm`,children:[r&&(0,S.jsxs)(`span`,{children:[r.text,` `,r.confidence&&(0,S.jsxs)(cf,{variant:`outline`,children:[r.confidence,` confidence`]})]}),a&&(0,S.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Unpushed work kept on branch `,a]}),i.map(r=>(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-muted-foreground`,children:[(0,S.jsxs)(`span`,{children:[`Follow-up: `,r]}),n.has(r)?(0,S.jsx)(`span`,{children:`queued`}):(0,S.jsx)(vf,{variant:`outline`,size:`xs`,onClick:()=>t(()=>rf.followup(e.id,r)),children:`Queue`})]},r))]})}function Kf({job:e,question:t,act:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=async()=>{o(!0);try{await n(()=>rf.answer(e.id,r.trim()))}finally{o(!1)}};return(0,S.jsxs)(`form`,{className:`flex flex-col gap-2 rounded-md border border-warning/60 p-2`,onSubmit:e=>{e.preventDefault(),s()},children:[(0,S.jsxs)(`span`,{className:`text-foreground`,children:[e.agent,` asks: `,t.text]}),(0,S.jsxs)(`span`,{className:`flex gap-2`,children:[(0,S.jsx)(Uf,{"aria-label":`Your answer`,placeholder:`Your answer; the job goes back in the queue with it`,value:r,onChange:e=>i(e.target.value)}),(0,S.jsx)(vf,{type:`submit`,variant:`outline`,size:`sm`,disabled:a||!r.trim(),children:a?`Sending…`:`Answer`})]})]})}var qf;function Jf(e){if(!qf){if(typeof document>`u`)return;qf=document.createElement(`textarea`)}var t=`&${e};`;qf.innerHTML=t;var n=qf.value;return n===t?void 0:n}var Z=32,Yf=9,Xf=13,Zf=10,Qf=96,$f=126,ep=91,tp=94,np=62,rp=35,ip=37,ap=45,op=61,sp=92,cp=42,lp=95,up=60,dp=64,fp=93,pp=33,mp=38,hp=58,gp=70,_p=102,vp=104,yp=119,bp=116,xp=112,Sp=115,Cp=160,wp=12,Tp=44,Ep=59,Dp=63,Op=46,kp=47,Ap=39,jp=34,Mp=43,Np=124,Pp=123,Fp=125,Ip=40,Lp=41,Rp=78,zp=110,Bp=79,Vp=111,Hp=120,Up=88,Wp=30,Gp=48,Kp=57,qp=65,Jp=90,Yp=97,Xp=122,Zp=128,Qp=32,Q={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22};function $p(e){if(!bm(e,`---`))return null;let t=3;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t<e.length&&e[t]===`\r`&&t++,t>=e.length||e[t]!==`
|
|
10
10
|
`)return null;t++;let n=!1;for(;t<e.length;){let r=t;for(;t<e.length&&e[t]!==`
|
|
11
11
|
`&&e[t]!==`\r`;)t++;if(t>=e.length)break;let i=t;if(e[t]===`\r`&&t++,t<e.length&&e[t]===`
|
|
12
12
|
`&&t++,bm(e,`---`,r))return{endPos:t,hasValidYaml:n};if(!n){let t=Bm(e,r,i);if(t<i){let r=e.charCodeAt(t);if(r>=Yp&&r<=Xp||r>=qp&&r<=Jp||r>=Gp&&r<=Kp||r===lp){for(t++;t<i&&(r=e.charCodeAt(t),r>=Yp&&r<=Xp||r>=qp&&r<=Jp||r>=Gp&&r<=Kp||r===lp||r===ap||r===Op);)t++;t<i&&e.charCodeAt(t)===hp&&(t++,t>=i?n=!0:(r=e.charCodeAt(t),(r===Z||r===Yf)&&(n=!0)))}}}}return null}var em=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,tm={class:`className`,for:`htmlFor`,allowfullscreen:`allowFullScreen`,allowtransparency:`allowTransparency`,autocomplete:`autoComplete`,autofocus:`autoFocus`,autoplay:`autoPlay`,cellpadding:`cellPadding`,cellspacing:`cellSpacing`,charset:`charSet`,classid:`classId`,colspan:`colSpan`,contenteditable:`contentEditable`,contextmenu:`contextMenu`,crossorigin:`crossOrigin`,enctype:`encType`,formaction:`formAction`,formenctype:`formEncType`,formmethod:`formMethod`,formnovalidate:`formNoValidate`,formtarget:`formTarget`,frameborder:`frameBorder`,hreflang:`hrefLang`,inputmode:`inputMode`,keyparams:`keyParams`,keytype:`keyType`,marginheight:`marginHeight`,marginwidth:`marginWidth`,maxlength:`maxLength`,mediagroup:`mediaGroup`,minlength:`minLength`,novalidate:`noValidate`,radiogroup:`radioGroup`,readonly:`readOnly`,rowspan:`rowSpan`,spellcheck:`spellCheck`,srcdoc:`srcDoc`,srclang:`srcLang`,srcset:`srcSet`,tabindex:`tabIndex`,usemap:`useMap`,viewbox:`viewBox`},nm={};function rm(e){if(!e)return nm;var t={};for(var n in e){var r=tm[n.toLowerCase()];if(r)t[r]=e[n];else{var i=n.indexOf(`:`);i===-1?t[n]=e[n]:t[n.slice(0,i)+n[i+1].toUpperCase()+n.slice(i+2)]=e[n]}}return t}function im(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(im(e[t]))return!0;return!1}return e!=null&&typeof e!=`boolean`&&e!==``}function am(e,t){return typeof e==`string`&&!im(t)?e:void 0}var om=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function sm(e){return e.indexOf(`&`)===-1?e:e.replace(em,(e,t)=>{var n=Jf(t);if(n)return n;if(t[0]===`#`){var r=t[1]===`x`||t[1]===`X`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return r===0||r>=55296&&r<=57343||r>1114111?`�`:r<=65535?String.fromCharCode(r):String.fromCharCode(55296+(r-65536>>10),56320+(r-65536&1023))}return e})}var cm=RegExp(`^[^/?#]*?(javascript|vbscript|data(?!:image)):`,`i`),lm=/[/?#][\s\S]*$/,um={malformed:3,safe:0,unsafe:1,unsafeDecoded:2},dm=/[^A-Za-z0-9/:]/g,fm=/[%\t\n\r]/;function pm(e){return decodeURIComponent(e).replace(dm,``)}function mm(e){if(cm.test(e))return um.unsafe;if(!fm.test(e))return um.safe;try{return cm.test(pm(e.replace(lm,``)))?um.unsafeDecoded:um.safe}catch{return um.malformed}}function hm(e){return mm(e)===um.safe?e:null}for(var gm={},_m=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],vm=0;vm<_m.length;vm++)gm[_m[vm]]=`a`;for(gm[231]=gm[199]=`c`,gm[240]=gm[208]=`d`,_m=[200,201,202,203,233,232,234,235],vm=0;vm<_m.length;vm++)gm[_m[vm]]=`e`;for(_m=[207,239,206,238,205,237,204,236],vm=0;vm<_m.length;vm++)gm[_m[vm]]=`i`;for(gm[209]=gm[241]=`n`,_m=[248,216,339,338,213,245,212,244,211,243,210,242],vm=0;vm<_m.length;vm++)gm[_m[vm]]=`o`;for(_m=[220,252,219,251,218,250,217,249],vm=0;vm<_m.length;vm++)gm[_m[vm]]=`u`;gm[376]=gm[255]=gm[221]=gm[253]=`y`;function ym(e){for(var t=``,n=-1,r=e.length,i=0;i<r;i++){var a=e.charCodeAt(i);if(a>=Yp&&a<=Xp||a>=Gp&&a<=Kp)n<0&&(n=i);else if(a>=qp&&a<=Jp)n>=0&&(t+=e.slice(n,i),n=-1),t+=String.fromCharCode(a+Qp);else if(a===Z||a===ap)n>=0&&(t+=e.slice(n,i),n=-1),t+=`-`;else{n>=0&&(t+=e.slice(n,i),n=-1);var o=gm[a];o&&(t+=o)}}return n>=0&&(t+=e.slice(n)),t}function bm(e,t,n){return e.startsWith(t,n)}var xm=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`,`circle`,`ellipse`,`line`,`path`,`polygon`,`polyline`,`rect`,`use`,`stop`,`animate`,`set`]);function Sm(e){let t=e.toLowerCase();if(xm.has(t))return!0;let n=t.indexOf(`:`);return n!==-1&&(t=t.slice(n+1),xm.has(t))}var Cm=1,wm=2,Tm=4,Em=8,Dm=16,Om=32,km=64,Am=(()=>{var e=new Uint8Array(128),t;for(e[Yf]=Cm,e[Zf]=Cm|wm,e[wp]=Cm,e[Xf]=Cm|wm,e[Z]=Cm,t=pp;t<=kp;t++)e[t]=Tm;for(t=hp;t<=dp;t++)e[t]=Tm;for(t=ep;t<=Qf;t++)e[t]=Tm;for(t=Pp;t<=$f;t++)e[t]=Tm;for(t=Gp;t<=Kp;t++)e[t]=Dm;for(t=qp;t<=Jp;t++)e[t]=Em;for(t=Yp;t<=Xp;t++)e[t]=Em;return e})();function jm(e){return e<Zp&&(Am[e]&Cm)!==0}var Mm=/[\p{P}\p{S}]/u,Nm=/\p{Zs}/u,Pm=[];function Fm(e){var t=e.indexOf(`\r`),n=e.indexOf(`\0`);if(t===-1&&n===-1)return e;var r=e.length;Pm.length=0;var i=0,a=0;for(a=t===-1?n:n===-1||t<n?t:n;a<r;a++){var o=e.charCodeAt(a);o===Xf?(i<a&&Pm.push(e.slice(i,a)),a+1<r&&e.charCodeAt(a+1)===Zf&&a++,Pm.push(`
|
|
@@ -73,8 +73,8 @@ ${e.slice(l,u)}`,l=Tg(e,u);else if(Mg(e,l,u)){var d=Tg(e,u);if(d<r&&(jg(e,d,wg(e
|
|
|
73
73
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
74
74
|
`}),n}function IN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function LN(e,t){let n=jN(e,t),r=n.one(e,void 0),i=mN(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
75
75
|
`},i)),a}function RN(e,t){return e&&`run`in e?async function(n,r){let i=LN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return LN(n,{file:r,...e||t})}}function zN(e){if(e)throw e}var BN=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function VN(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function HN(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?UN(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function UN(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var WN={basename:GN,dirname:KN,extname:qN,join:JN,sep:`/`};function GN(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ZN(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function KN(e){if(ZN(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function qN(e){ZN(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function JN(...e){let t=-1,n;for(;++t<e.length;)ZN(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:YN(n)}function YN(e){ZN(e);let t=e.codePointAt(0)===47,n=XN(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function XN(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function ZN(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var QN={cwd:$N};function $N(){return`/`}function eP(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function tP(e){if(typeof e==`string`)e=new URL(e);else if(!eP(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return nP(e)}function nP(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var rP=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],iP=class{constructor(e){let t;t=e?eP(e)?{path:e}:typeof e==`string`||cP(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:QN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<rP.length;){let e=rP[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)rP.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?WN.basename(this.path):void 0}set basename(e){oP(e,`basename`),aP(e,`basename`),this.path=WN.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?WN.dirname(this.path):void 0}set dirname(e){sP(this.basename,`dirname`),this.path=WN.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?WN.extname(this.path):void 0}set extname(e){if(aP(e,`extname`),sP(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=WN.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){eP(e)&&(e=tP(e)),oP(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?WN.basename(this.path,this.extname):void 0}set stem(e){oP(e,`stem`),aP(e,`stem`),this.path=WN.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new zO(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function aP(e,t){if(e&&e.includes(WN.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+WN.sep+"`")}function oP(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function sP(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function cP(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var lP=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),uP=l(BN(),1),dP={}.hasOwnProperty,fP=new class e extends lP{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=HN()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,uP.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(hP(`data`,this.frozen),this.namespace[e]=t,this):dP.call(this.namespace,e)&&this.namespace[e]||void 0:e?(hP(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=vP(e),n=this.parser||this.Parser;return pP(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),pP(`process`,this.parser||this.Parser),mP(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=vP(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);bP(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),pP(`processSync`,this.parser||this.Parser),mP(`processSync`,this.compiler||this.Compiler),this.process(e,r),_P(`processSync`,`process`,t),n;function r(e,r){t=!0,zN(e),n=r}}run(e,t,n){gP(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=vP(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),_P(`runSync`,`run`,n),r;function i(e,t){zN(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=vP(t),r=this.compiler||this.Compiler;return mP(`stringify`,r),gP(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(hP(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,uP.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];VN(o)&&VN(r)&&(r=(0,uP.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function pP(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function mP(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function hP(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gP(e){if(!VN(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function _P(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function vP(e){return yP(e)?e:new iP(e)}function yP(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function bP(e){return typeof e==`string`||xP(e)}function xP(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var SP=[],CP={allowDangerousHtml:!0},wP=/^(https?|ircs?|mailto|xmpp)$/i,TP=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function EP(e){let t=DP(e),n=OP(e);return kP(t.runSync(t.parse(n),n),e)}function DP(e){let t=e.rehypePlugins||SP,n=e.remarkPlugins||SP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...CP}:CP;return fP().use(yM).use(n).use(RN,r).use(t)}function OP(e){let t=e.children||``,n=new iP;return typeof t==`string`?n.value=t:``+t,n}function kP(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||AP;for(let e of TP)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return EN(e,l),qO(e,{Fragment:S.Fragment,components:i,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in gk)if(Object.hasOwn(gk,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=gk[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function AP(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||wP.test(e.slice(0,t))?e:``}var jP=Bd(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function MP({className:e,variant:t,...n}){return(0,S.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:X(jP({variant:t}),e),...n})}function NP({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`alert-title`,className:X(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function PP({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`alert-description`,className:X(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}var FP=Bd(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function IP({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,S.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:X(FP({variant:e}),n),...r})}function LP({className:e,render:t,...n}){return of({defaultTagName:`div`,props:ki({className:X(`w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50`,e)},n),render:t,state:{slot:`bubble-content`}})}function RP({className:e,align:t=`start`,...n}){return(0,S.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:X(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function zP({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`message-content`,className:X(`flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function BP({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=VP(HP(r,i),t);if(!n)return v.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!v.isValidElement(n))return null;let o=n.props,s={...VP(a,o),ref:GP(a.ref,o.ref)};return v.cloneElement(n,s)}function VP(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?GP(i,r):WP(n)&&typeof i==`function`&&typeof r==`function`?UP(r,i):r}}return t}function HP(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function UP(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function WP(e){return/^on[A-Z]/.test(e)}function GP(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var KP=8,qP=64,JP=0,YP=.5,XP=180,ZP=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),QP={start:!1,end:!1},$P={currentAnchorId:null,visibleMessageIds:[]};function eF({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return QP;let i=fF({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function tF({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return $P;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of nF(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+YP&&(u=e)}return l.length===0&&u===null?$P:{currentAnchorId:u,visibleMessageIds:l}}function nF(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function rF(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function iF(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function aF(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function oF(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function sF({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of nF(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function cF({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=lF(t,i),o=t.getBoundingClientRect().height,s=hF(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function lF(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function uF(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function dF({content:e,scrollTop:t,spacer:n,viewport:r}){let i=fF({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function fF({content:e,spacer:t,viewport:n}){let r=nF(e,t),i=mF(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function pF(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function mF(e){let t=window.getComputedStyle(e);return{end:_F(t.paddingBlockEnd||t.paddingBottom),start:_F(t.paddingBlockStart||t.paddingTop)}}function hF(e){let t=e?.parentElement;return t?mF(t):{end:0,start:0}}function gF(e){if(!e)return 0;let t=window.getComputedStyle(e);return _F(t.rowGap===`normal`?t.gap:t.rowGap)}function _F(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function vF(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function yF(e,t){return vF(e,t)}function bF(){return vF($P,SF)}function xF(e,t){return e.start===t.start&&e.end===t.end}function SF(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function CF({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=v.useRef(e),o=v.useRef(!1),s=v.useRef(null),c=v.useRef(!1),l=v.useRef(n),u=v.useRef(0),d=v.useRef(null),f=v.useRef(0),p=v.useRef(e?`following-bottom`:`free-scrolling`),m=v.useRef(new Map),h=v.useRef(null),g=v.useRef(null),_=v.useRef(null),y=v.useRef(i),b=v.useRef(!0),x=v.useRef(null),S=v.useRef(r),C=v.useRef(null),w=v.useRef(0),T=v.useRef(0),E=v.useRef(null),D=v.useRef(null),O=v.useRef(null),k=v.useRef(null),A=v.useRef(null),j=v.useRef(null),M=v.useRef(null),N=v.useRef(null),P=v.useRef(null),F=v.useRef(new Set),I=v.useRef(new WeakSet);return O.current===null&&(O.current=yF(t===`end`||t===`last-anchor`,(e,t)=>e===t)),k.current===null&&(k.current=yF(QP,xF)),P.current===null&&(P.current=bF()),a.current=e,l.current=n,S.current=r,y.current=i,{autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:A,streamingTurnRef:_,contentRef:s,defaultScrollPositionAppliedRef:c,firstItemRef:d,itemCountRef:u,lastScrollTopRef:f,messageElementsRef:m,modeRef:p,pendingScrollFrameRef:C,pendingScrollToMessageRef:h,prependRestoreRef:g,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:O.current,rootRef:x,scrollEdgeThresholdRef:l,scrollMarginRef:S,scrollPreviousItemPeekRef:y,spacerGapRef:w,spacerHeightRef:T,spacerRef:E,stateFrameRef:D,stateStore:k.current,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P.current,visibleMessageIdsRef:F,handledScrollAnchorsRef:I}}function wF(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function TF(e){e.defaultScrollPositionAppliedRef.current=!0,wF(e)}function EF({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,itemCountRef:l,messageElementsRef:u,modeRef:d,pendingScrollToMessageRef:f,prependRestoreRef:p,scrollMarginRef:m,scrollPreviousItemPeekRef:h,spacerGapRef:g,spacerHeightRef:_,spacerRef:y,viewportRef:b}=e,x=v.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},XP))},[t]),S=v.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));_.current!==n&&(_.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-g.current}px`:``)},[]),C=v.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=YP?(a.scrollTop=o,t()):(i&&x(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,x]),w=v.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,d.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=v.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,d.current=a.current?`following-bottom`:`free-scrolling`,C(pF(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=v.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=m.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=cF({align:t,element:e,scrollMargin:o?a+h.current:a,spacer:y.current,viewport:l}),f=dF({content:s,scrollTop:u,spacer:y.current,viewport:l});return S(f),p.current={element:e,viewportTop:uF(e,l)},d.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=v.useCallback(()=>{let e=i.current;return!e||!e.isConnected||d.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=v.useCallback((t,n)=>{let r=u.current.get(t);return r?(TF(e),E(r,n)?(f.current=null,!0):(f.current={messageId:t,options:n},!0)):l.current===0&&(f.current={messageId:t,options:n},TF(e),!0)},[E]);return{flushPendingScrollToMessage:v.useCallback(()=>{let t=f.current;if(!t)return!1;let n=u.current.get(t.messageId);return!n||!E(n,t.options)?!1:(f.current=null,TF(e),!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function DF(e,t){return v.useCallback(n=>{e.current=n,n&&t()},[e,t])}function OF({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=KP,scrollPreviousItemPeek:r=qP,scrollMargin:i=JP}){let a=CF({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:y,prependRestoreRef:b,preserveScrollOnPrependRef:x,pendingDefaultScrollStore:S,rootRef:C,scrollEdgeThresholdRef:w,scrollMarginRef:T,scrollPreviousItemPeekRef:E,spacerGapRef:D,spacerHeightRef:O,spacerRef:k,stateFrameRef:A,stateStore:j,viewportRef:M,visibilityFrameRef:N,visibilityObserverRef:P,visibilityStore:F,visibleMessageIdsRef:I,handledScrollAnchorsRef:L}=a,R=v.useRef(t);R.current!==t&&(R.current=t,d.current=!1);let z=v.useCallback(e=>{let t=C.current,n=M.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),B=v.useCallback(e=>{let t=M.current?.scrollTop??0,n=t<m.current-YP;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),V=v.useCallback(()=>{let e=eF({content:u.current,scrollEdgeThreshold:w.current,spacer:k.current,viewport:M.current});B(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;z(t),j.setSnapshot(t)},[B,j,z]),H=v.useCallback(()=>{A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,V()}))},[V]),U=v.useCallback(()=>{F.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,F.hasListeners()&&F.setSnapshot(tF({content:u.current,scrollMargin:T.current,scrollPreviousItemPeek:E.current,spacer:k.current,viewport:M.current,visibleMessageIds:I.current}))}))},[F]),{flushPendingScrollToMessage:ee,reanchorToAnchoredMessage:te,scrollToElement:ne,scrollToEnd:W,scrollToMessage:re,scrollToStart:ie}=EF({refs:a,commitScrollState:V,scheduleStateCommit:H,scheduleVisibilitySync:U}),ae=v.useCallback(()=>{let e=b.current,t=M.current;if(!e||!t||!e.element.isConnected)return!1;let n=uF(e.element,t)-e.viewportTop;return Math.abs(n)<=YP?!1:(t.scrollTop+=n,e.viewportTop=uF(e.element,t),H(),U(),!0)},[H,U]),G=v.useCallback(()=>{let e=u.current,t=M.current;if(!e||!t){b.current=null;return}let n=sF({content:e,spacer:k.current,viewport:t});b.current=n?{element:n,viewportTop:uF(n,t)}:null},[]),K=v.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,ee()&&G()}))},[G,ee]),q=v.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=M.current,r=t&&n?oF(nF(t,k.current)):null;if(!t||!n||!r)e=W({behavior:`auto`});else{let i=lF(r,n);e=fF({content:t,spacer:k.current,viewport:n})-i<=n.clientHeight?W({behavior:`auto`}):ne(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?W({behavior:`auto`}):ie({behavior:`auto`});return e?(TF(a),!0):!1},[t,ne,W,ie]),oe=v.useCallback(()=>{let e=u.current;if(!e)return;let t=nF(e,k.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(ee())return;if(n===0){if(q()||t.length>0&&s.current&&W({behavior:`auto`}))return;V(),U();return}let e=r?t.indexOf(r):-1;if(x.current&&e>0)ae();else{if(t.length>n){let e=rF(t,n);if(e){if(s.current&&g.current===`following-bottom`&&aF(t,n)){W({behavior:`auto`});return}ne(e,{align:`start`},{keepPreviousPeek:!0}),L.current.add(e);return}}if(t.length===n){let e=iF(t,L.current);if(e){ne(e,{align:`start`},{keepPreviousPeek:!0}),L.current.add(e);return}}g.current===`following-bottom`&&s.current?W({behavior:`auto`}):(V(),U())}})(),G()},[q,G,V,ee,ae,U,ne,W]),J=v.useCallback(()=>{if(g.current===`following-bottom`&&s.current){W({behavior:`auto`});return}let e=O.current;te()?s.current&&e>0&&O.current===0&&W({behavior:`auto`}):(H(),U())},[te,H,U,W]),se=v.useCallback(()=>{let e=M.current;if(e&&F.hasListeners()){if(typeof IntersectionObserver>`u`){U();return}P.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?I.current.add(e):I.current.delete(e))}U()},{root:e,rootMargin:`${-(T.current+E.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{P.current?.observe(e)}),U()}},[U,F]),ce=v.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),P.current?.disconnect(),P.current=null,I.current.clear(),F.setSnapshot($P)},[F]),le=v.useCallback((e,t,n)=>{t?(h.current.set(e,t),P.current?.observe(t),U(),y.current?.messageId===e&&K()):n&&h.current.get(e)===n&&(h.current.delete(e),I.current.delete(e),P.current?.unobserve(n),U())},[K,U]),ue=v.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),de=v.useCallback(()=>z(j.getSnapshot()),[j,z]),fe=DF(C,de),pe=DF(M,de),me=v.useCallback(e=>{u.current=e},[]),he=v.useCallback(e=>{k.current=e,D.current=gF(e?.parentElement??null)},[]),ge=v.useCallback(()=>{V(),U(),G()},[G,V,U]),_e=v.useMemo(()=>({handleContentChange:oe,handleResize:J,observeVisibility:se,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:x,scrollToEnd:W,scrollToMessage:re,scrollToStart:ie,setContentElement:me,setRootElement:fe,setSpacerElement:he,setViewportElement:pe,stateStore:j,syncAfterScroll:ge,unobserveVisibility:ce,userScrollIntent:ue,viewportRef:M,visibilityStore:F}),[oe,J,se,S,W,re,ie,me,fe,he,pe,j,ge,ce,ue,F]);return v.useLayoutEffect(()=>{q()||p.current===0&&wF(a)},[q]),v.useEffect(()=>()=>{A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),P.current?.disconnect(),P.current=null},[]),v.useLayoutEffect(()=>{e&&g.current===`following-bottom`&&p.current>0?W({behavior:`auto`}):V()},[e,V,W]),{context:_e,registerMessage:le}}function kF(e){let t=v.useRef(e);return t.current=e,t}var AF=v.createContext(null),jF=v.createContext(null);function MF(){let e=v.useContext(AF);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function NF(){let e=v.useContext(jF);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function PF({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=OF({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,S.jsx)(AF.Provider,{value:o,children:(0,S.jsx)(jF.Provider,{value:s,children:t})})}function FF(){let{pendingDefaultScrollStore:e}=MF();return v.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function IF({children:e,...t}){let{setRootElement:n}=MF(),r=FF();return(0,S.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function LF({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=MF(),_=FF();f.current=o;let y=v.useCallback(e=>{p(e),GP(s)?.(e)},[s,p]);function b(e){m(),r?.(e)}function x(e){h(),a?.(e)}function C(e){h(),i?.(e)}function w(e){ZP.has(e.key)&&h(),n?.(e)}return v.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,S.jsx)(`div`,{ref:y,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:w,onScroll:b,onTouchMove:C,onWheel:x,...u,..._?{"data-pending-scroll":``}:null,children:t})}function RF({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=MF(),u=v.useRef(null),d=v.useCallback(e=>{u.current=e,c(e),GP(n)?.(e)},[n,c]);return v.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),v.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,S.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,S.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function zF({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=NF(),a=v.useRef(null),o=v.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),GP(t)?.(n)},[e,t,i]);return(0,S.jsx)(`div`,{ref:o,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function BF({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=MF(),d=kF(r),f=v.useCallback(e=>u.subscribe(e),[u]),p=v.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=v.useSyncExternalStore(f,p,p),h=v.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return BP({defaultTagName:`button`,props:VP({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,S.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var VF={Provider:PF,Root:IF,Viewport:LF,Content:RF,Item:zF,Button:BF};function HF(e){return(0,S.jsx)(VF.Provider,{...e})}function UF({className:e,...t}){return(0,S.jsx)(VF.Root,{"data-slot":`message-scroller`,className:X(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function WF({className:e,...t}){return(0,S.jsx)(VF.Viewport,{"data-slot":`message-scroller-viewport`,className:X(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function GF({className:e,...t}){return(0,S.jsx)(VF.Content,{"data-slot":`message-scroller-content`,className:X(`flex h-max min-h-full flex-col gap-6`,e),...t})}function KF({className:e,scrollAnchor:t=!1,...n}){return(0,S.jsx)(VF.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:X(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function qF({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,S.jsx)(VF.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:X(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,t),render:r??(0,S.jsx)(vf,{variant:i,size:a}),...o,children:n??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(hu,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function JF({...e}){return(0,S.jsx)(XC,{"data-slot":`collapsible`,...e})}function YF({...e}){return(0,S.jsx)(QC,{"data-slot":`collapsible-trigger`,...e})}function XF({...e}){return(0,S.jsx)(tw,{"data-slot":`collapsible-content`,...e})}function ZF({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`trace`,className:X(`flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-md *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50`,e),...t})}function QF({className:e,status:t,...n}){return(0,S.jsx)(`span`,{"data-slot":`trace-line`,"data-status":t,className:X(`flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer`,e),...n})}function $F({className:e,...t}){return(0,S.jsx)(`span`,{"data-slot":`trace-icon`,"aria-hidden":`true`,className:X(`flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1`,e),...t})}function eI({className:e,...t}){return(0,S.jsx)(`span`,{"data-slot":`trace-title`,className:X(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function tI({className:e,...t}){return(0,S.jsx)(JF,{"data-slot":`trace-collapsible`,className:X(`flex w-full min-w-0 flex-col`,e),...t})}function nI({className:e,children:t,...n}){return(0,S.jsxs)(YF,{"data-slot":`trace-collapsible-trigger`,className:X(`group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive`,e),...n,children:[t,(0,S.jsx)($F,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,S.jsx)(Du,{})})]})}function rI({className:e,children:t,...n}){return(0,S.jsx)(XF,{"data-slot":`trace-collapsible-content`,className:`h-(--collapsible-panel-height) min-w-0 overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0`,...n,children:(0,S.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className:X(`mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground`,e),children:t})})}function iI(e){let t=[];for(let n of e){let e=t.at(-1);n.role===`assistant`&&e?.role===`assistant`?e.messages.push(n):t.push({id:n.id,role:n.role,messages:[n]})}return t}function aI(e,t){let n=[];for(let r of e){r.text&&n.push({type:`text`,text:r.text});for(let e of r.tools??[]){let r=t?.(e),i=n.at(-1);r==null?i?.type===`steps`?i.tools.push(e):n.push({type:`steps`,tools:[e]}):n.push({type:`result`,id:e.id,node:r})}}return n}function oI({host:e}){let[t,n]=(0,v.useState)(!1);return t?(0,S.jsx)($u,{}):(0,S.jsx)(`img`,{src:`https://icons.duckduckgo.com/ip3/${e}.ico`,alt:``,className:`size-3 shrink-0 rounded-sm`,onError:()=>n(!0)})}var sI=6;function cI({sources:e}){let t=new Map;for(let n of e){let e=new URL(n.url).hostname;t.has(e)||t.set(e,n)}let n=t.size-sI;return(0,S.jsxs)(`ul`,{"aria-label":`Sources`,className:`flex flex-wrap gap-1 pl-6`,children:[[...t].slice(0,sI).map(([e,t])=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(Xl,{children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(cf,{variant:`outline`,render:(0,S.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noopener noreferrer`})}),children:[(0,S.jsx)(oI,{host:e}),e.replace(/^www\./,``)]}),(0,S.jsx)(Kl,{className:`wrap-anywhere`,children:t.title??t.url})]})},e)),n>0&&(0,S.jsx)(`li`,{children:(0,S.jsxs)(cf,{variant:`secondary`,children:[`+`,n]})})]})}function lI({tool:e}){let t=(0,S.jsxs)(QF,{status:e.status===`complete`?void 0:e.status,children:[(0,S.jsx)($F,{children:e.sources?(0,S.jsx)($u,{}):(0,S.jsx)(Nd,{})}),(0,S.jsx)(eI,{children:e.label})]}),n=e.output?(0,S.jsxs)(tI,{children:[(0,S.jsx)(nI,{children:t}),(0,S.jsx)(rI,{children:(0,S.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap text-xs`,children:e.output})})]}):t;return e.sources?.length?(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[n,(0,S.jsx)(cI,{sources:e.sources})]}):n}function uI({quote:e}){return(0,S.jsx)(ZF,{children:(0,S.jsxs)(tI,{defaultOpen:!0,children:[(0,S.jsx)(nI,{children:(0,S.jsxs)(QF,{children:[(0,S.jsx)($F,{children:(0,S.jsx)(kd,{})}),(0,S.jsx)(eI,{children:e.source})]})}),(0,S.jsxs)(rI,{children:[(0,S.jsx)(`p`,{className:`max-h-48 overflow-auto whitespace-pre-wrap text-foreground`,children:e.text}),e.href&&(0,S.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`block truncate text-xs underline underline-offset-4`,children:e.href})]})]})})}var dI=(0,v.memo)(function({text:e}){return(0,S.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2 text-sm leading-relaxed wrap-break-word`,children:(0,S.jsx)(EP,{skipHtml:!0,allowedElements:[`p`,`strong`,`em`,`a`,`ul`,`ol`,`li`,`code`,`pre`,`br`,`blockquote`],components:{a:({children:e,href:t})=>(0,S.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`underline underline-offset-4`,children:e}),ul:({children:e})=>(0,S.jsx)(`ul`,{className:`list-disc pl-5`,children:e}),ol:({children:e})=>(0,S.jsx)(`ol`,{className:`list-decimal pl-5`,children:e}),pre:({children:e})=>(0,S.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap`,children:e})},children:e})})});function fI({messages:e,prompt:t,onPromptChange:n,busy:r,disabled:i=!1,error:a,onSend:o,onStop:s,renderTool:c,model:l,placeholder:u=`Ask the agent…`,emptyTitle:d=`What would you like to do?`,emptyDescription:f=`Ask a question or describe a change. You stay in control of what gets applied.`}){let[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),_=a||h,y=(0,v.useId)(),b=r||p;async function x(){let e=t.trim();if(!(!e||b||i)){m(!0),g(``);try{await o(e)&&n(t=>t.trim()===e?``:t)}catch(e){g(e instanceof Error?e.message:`Could not send. Please try again.`)}finally{m(!1)}}}return(0,S.jsxs)(`section`,{"aria-label":`Agent conversation`,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4`,children:[(0,S.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,S.jsx)(HF,{autoScroll:!0,children:(0,S.jsxs)(UF,{children:[(0,S.jsx)(WF,{children:(0,S.jsx)(GF,{children:e.length===0?(0,S.jsx)(KF,{messageId:`empty`,children:(0,S.jsx)(Vd,{children:(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:d}),(0,S.jsx)(Wd,{children:f})]})})}):iI(e).map(e=>(0,S.jsx)(KF,{messageId:e.id,scrollAnchor:e.role===`user`,children:(0,S.jsx)(RP,{align:e.role===`user`?`end`:`start`,children:(0,S.jsx)(zP,{children:e.role===`user`?(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col items-end gap-2`,children:[e.messages[0].quote&&(0,S.jsx)(uI,{quote:e.messages[0].quote}),(0,S.jsx)(IP,{align:`end`,variant:`muted`,children:(0,S.jsx)(LP,{className:`whitespace-pre-wrap`,children:e.messages[0].text})})]}):(0,S.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:aI(e.messages,c).map((e,t)=>e.type===`text`?(0,S.jsx)(dI,{text:e.text},t):e.type===`steps`?(0,S.jsx)(ZF,{children:e.tools.map(e=>(0,S.jsx)(lI,{tool:e},e.id))},e.tools[0].id):(0,S.jsx)(`div`,{className:`min-w-0`,children:e.node},e.id))})})})},e.id))})}),(0,S.jsx)(qF,{})]})})}),_&&(0,S.jsxs)(MP,{variant:`destructive`,children:[(0,S.jsx)(NP,{children:`The agent could not continue`}),(0,S.jsx)(PP,{children:_})]}),(0,S.jsxs)(`form`,{className:`shrink-0`,onSubmit:e=>{e.preventDefault(),x()},children:[(0,S.jsx)(`label`,{htmlFor:y,className:`sr-only`,children:`Message the agent`}),(0,S.jsxs)(iE,{children:[(0,S.jsx)(uE,{id:y,value:t,onChange:e=>n(e.target.value),className:`max-h-40`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),x())},placeholder:u,disabled:i,maxLength:4e3,rows:2}),(0,S.jsx)(oE,{align:`block-end`,className:`justify-end`,children:b?(0,S.jsxs)(cE,{type:`button`,size:`sm`,variant:`outline`,onClick:s,disabled:p||i,children:[(0,S.jsx)(Td,{"data-icon":`inline-start`}),`Stop`]}):(0,S.jsxs)(cE,{type:`submit`,size:`sm`,variant:t.trim()?`default`:`secondary`,disabled:i,"aria-disabled":i||!t.trim(),children:[(0,S.jsx)(yu,{"data-icon":`inline-start`}),`Send`]})})]})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,S.jsx)(`p`,{role:`status`,className:`truncate text-xs text-muted-foreground`,children:b?`Agent working. You can stop it at any time.`:`Enter to send. Shift+Enter for a new line.`}),l&&(0,S.jsxs)(Xl,{children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(cf,{variant:`secondary`}),children:[(0,S.jsx)(xu,{}),l.name,` · `,l.thinking]}),(0,S.jsxs)(Kl,{children:[`Model `,l.name,`, thinking `,l.thinking]})]})]})]})}var pI=768;function mI(){let[e,t]=v.useState(void 0);return v.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<pI)};return e.addEventListener(`change`,n),t(window.innerWidth<pI),()=>e.removeEventListener(`change`,n)},[]),!!e}function hI({...e}){return(0,S.jsx)(Ty,{"data-slot":`sheet`,...e})}function gI({...e}){return(0,S.jsx)(sy,{"data-slot":`sheet-portal`,...e})}function _I({className:e,...t}){return(0,S.jsx)(Bv,{"data-slot":`sheet-overlay`,className:X(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function vI({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,S.jsxs)(gI,{children:[(0,S.jsx)(_I,{}),(0,S.jsxs)(ay,{"data-slot":`sheet-content`,"data-side":n,className:X(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,S.jsxs)(Vv,{"data-slot":`sheet-close`,render:(0,S.jsx)(vf,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,S.jsx)(Fd,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function yI({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sheet-header`,className:X(`flex flex-col gap-0.5 p-4`,e),...t})}function bI({className:e,...t}){return(0,S.jsx)(Ey,{"data-slot":`sheet-title`,className:X(`font-heading text-base font-medium text-foreground`,e),...t})}function xI({className:e,...t}){return(0,S.jsx)(Hv,{"data-slot":`sheet-description`,className:X(`text-sm text-muted-foreground`,e),...t})}var SI=`sidebar_state`,CI=604800,wI=`16rem`,TI=`18rem`,EI=`3rem`,DI=`b`,OI=v.createContext(null);function kI(){let e=v.useContext(OI);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function AI({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=mI(),[c,l]=v.useState(!1),[u,d]=v.useState(e),f=t??u,p=v.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${SI}=${t}; path=/; max-age=${CI}`},[n,f]),m=v.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);v.useEffect(()=>{let e=e=>{e.key===DI&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=v.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,S.jsx)(OI.Provider,{value:g,children:(0,S.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":wI,"--sidebar-width-icon":EI,...i},className:X(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function jI({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=kI();return n===`none`?(0,S.jsx)(`div`,{"data-slot":`sidebar`,className:X(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,S.jsx)(hI,{open:l,onOpenChange:u,...o,children:(0,S.jsxs)(vI,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":TI},side:e,children:[(0,S.jsxs)(yI,{className:`sr-only`,children:[(0,S.jsx)(bI,{children:`Sidebar`}),(0,S.jsx)(xI,{children:`Displays the mobile sidebar.`})]}),(0,S.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,S.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,S.jsx)(`div`,{"data-slot":`sidebar-gap`,className:X(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,S.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:X(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,S.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function MI({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:X(`flex flex-col gap-2 p-2`,e),...t})}function NI({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:X(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function PI({children:e,agent:t,title:n=`Agent`}){return(0,S.jsx)(AI,{defaultOpen:!1,style:{"--sidebar-width":`24rem`},children:(0,S.jsx)(FI,{agent:t,title:n,children:e})})}function FI({children:e,agent:t,title:n}){let{open:r,openMobile:i,isMobile:a,toggleSidebar:o}=kI(),s=a?i:r,[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null);return(0,v.useEffect)(()=>{s?l(!0):c&&u.current?.focus()},[s,c]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`min-w-0 flex-1`,children:e}),(0,S.jsx)(`div`,{hidden:s,className:`fixed right-6 bottom-6 z-20`,children:(0,S.jsxs)(vf,{ref:u,"aria-label":`Open agent`,"aria-expanded":s,onClick:o,children:[(0,S.jsx)(ld,{"data-icon":`inline-start`}),n]})}),(0,S.jsx)(jI,{side:`right`,collapsible:`offcanvas`,children:(0,S.jsxs)(`div`,{inert:!s,className:`flex h-full min-h-0 flex-col`,children:[(0,S.jsx)(MI,{children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`h2`,{className:`text-sm font-medium`,children:n}),(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Minimize agent`,onClick:o,children:(0,S.jsx)(hd,{})})]})}),(0,S.jsx)(NI,{className:`overflow-hidden`,children:(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:c?t:null})})]})})]})}function II(e){let t=e.match(/https?:\/\/[^\s"'<>()[\]]+/g)??[];return[...new Set(t.map(e=>e.replace(/[.,;:!?]+$/,``)))].filter(e=>URL.canParse(e)).map(e=>({url:e}))}var LI=e=>typeof e==`string`?e.split(`
|
|
76
|
-
`)[0]:void 0,RI=e=>e>1?` and ${e-1} more`:``,zI=({url:e,urls:t})=>[e,t].flat().filter(e=>typeof e==`string`&&URL.canParse(e)),BI={running:`Running`,complete:`Ran`,error:`Failed to run`},VI={bash:{verbs:BI,subject:({command:e})=>LI(e)},read:{verbs:{running:`Reading`,complete:`Read`,error:`Failed to read`},subject:({path:e})=>LI(e)},edit:{verbs:{running:`Editing`,complete:`Edited`,error:`Failed to edit`},subject:({path:e})=>LI(e)},write:{verbs:{running:`Writing`,complete:`Wrote`,error:`Failed to write`},subject:({path:e})=>LI(e)},grep:{verbs:{running:`Searching for`,complete:`Searched for`,error:`Failed to search for`},subject:({pattern:e})=>LI(e)},find:{verbs:{running:`Finding`,complete:`Found`,error:`Failed to find`},subject:({pattern:e})=>LI(e)},ls:{verbs:{running:`Listing`,complete:`Listed`,error:`Failed to list`},subject:({path:e})=>LI(e)},web_search:{verbs:{running:`Searching`,complete:`Searched`,error:`Failed to search`},subject:({query:e,queries:t})=>{let n=Array.isArray(t)?t:[e];return typeof n[0]==`string`?`for “${n[0]}”${RI(n.length)}`:`the web`},sources:(e,t)=>t?II(t):void 0},fetch_content:{verbs:{running:`Reading`,complete:`Read`,error:`Failed to read`},subject:e=>{let t=zI(e);return t.length?`${new URL(t[0]).hostname}${RI(t.length)}`:`a page`},sources:e=>zI(e).map(e=>({url:e}))}};function HI(e,t,n,r=VI){let i=r[e.name];return i?{label:`${i.verbs[t]} ${i.subject(e.arguments)??``}`.trim(),sources:i.sources?.(e.arguments,n)}:{label:`${BI[t]} ${e.name}`}}var UI=(0,v.createContext)({});function WI(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var GI=typeof window<`u`?v.useLayoutEffect:v.useEffect,KI=(0,v.createContext)(null);function qI(e,t){e.indexOf(t)===-1&&e.push(t)}function JI(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var YI=(e,t,n)=>n>t?t:n<e?e:n,XI={},ZI=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QI=e=>typeof e==`object`&&!!e,$I=e=>/^0[^.\s]+$/u.test(e);function eL(e){let t;return()=>(t===void 0&&(t=e()),t)}var tL=e=>e,nL=(...e)=>e.reduce((e,t)=>n=>t(e(n))),rL=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},iL=class{constructor(){this.subscriptions=[]}add(e){return qI(this.subscriptions,e),()=>this.remove(e)}remove(e){JI(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},aL=e=>e*1e3,oL=e=>e/1e3,sL=(e,t)=>t?1e3/t*e:0,cL=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},lL=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function uL(e,t,n,r){return e===t&&n===r?tL:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=lL(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(lL(s+1e-7,e,n)-i-r)}return lL(s,t,r)}}var dL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fL=e=>t=>1-e(1-t),pL=uL(.33,1.53,.69,.99),mL=fL(pL),hL=dL(mL),gL=e=>e>=1?1:(e*=2)<1?.5*mL(e):.5*(2-2**(-10*(e-1))),_L=e=>1-Math.sin(Math.acos(e)),vL=fL(_L),yL=dL(_L),bL=uL(.42,0,1,1),xL=uL(0,0,.58,1),SL=uL(.42,0,.58,1),CL=e=>Array.isArray(e)&&typeof e[0]!=`number`;function wL(e,t){return CL(e)?e[cL(0,e.length,t)]:e}var TL=e=>Array.isArray(e)&&typeof e[0]==`number`,EL={linear:tL,easeIn:bL,easeInOut:SL,easeOut:xL,circIn:_L,circInOut:yL,circOut:vL,backIn:mL,backInOut:hL,backOut:pL,anticipate:gL},DL=e=>typeof e==`string`,OL=e=>{if(TL(e)){let[t,n,r,i]=e;return uL(t,n,r,i)}return DL(e)?EL[e]:e},kL={delta:0,timestamp:0,isProcessing:!1},AL;function jL(){AL=void 0}var ML={now:()=>(AL===void 0&&ML.set(kL.isProcessing||XI.useManualTiming?kL.timestamp:performance.now()),AL),set:e=>{AL=e,queueMicrotask(jL)}},NL=e=>Math.round(e*1e5)/1e5,PL=e=>t=>typeof t==`string`&&t.startsWith(e),FL=PL(`--`),IL=PL(`var(--`),LL=e=>IL(e)?RL.test(e.split(`/*`)[0].trim()):!1,RL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zL(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var BL={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},VL={...BL,transform:e=>YI(0,1,e)},HL={...BL,default:1},UL=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function WL(e){return e==null}var GL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,KL=(e,t)=>n=>!!(typeof n==`string`&&GL.test(n)&&n.startsWith(e)||t&&!WL(n)&&Object.prototype.hasOwnProperty.call(n,t)),qL=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(UL);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},JL=e=>YI(0,255,e),YL={...BL,transform:e=>Math.round(JL(e))},XL={test:KL(`rgb`,`red`),parse:qL(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+YL.transform(e)+`, `+YL.transform(t)+`, `+YL.transform(n)+`, `+NL(VL.transform(r))+`)`},ZL=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function QL(e){let t=e.length>5?2:1,n=ZL(e,3,t);return{red:parseInt(ZL(e,0,t),16),green:parseInt(ZL(e,1,t),16),blue:parseInt(ZL(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var $L={test:KL(`#`),parse:QL,transform:XL.transform},eR=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tR=eR(`deg`),nR=eR(`%`),rR=eR(`px`),iR=eR(`vh`),aR=eR(`vw`),oR={...nR,parse:e=>nR.parse(e)/100,transform:e=>nR.transform(e*100)},sR={test:KL(`hsl`,`hue`),parse:qL(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+nR.transform(NL(t))+`, `+nR.transform(NL(n))+`, `+NL(VL.transform(r))+`)`},cR={test:e=>XL.test(e)||$L.test(e)||sR.test(e),parse:e=>XL.test(e)?XL.parse(e):sR.test(e)?sR.parse(e):$L.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?XL.transform(e):sR.transform(e),getAnimatableNone:e=>{let t=cR.parse(e);return t.alpha=0,cR.transform(t)}},lR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,uR=new RegExp(UL.source),dR=new RegExp(lR.source,`i`);function fR(e){return isNaN(e)&&typeof e==`string`&&(uR.test(e)||dR.test(e))}var pR=`number`,mR=`color`,hR=`var`,gR=`var(`,_R="${}",vR=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function yR(e){let t=e.toString();return uR.test(t)||dR.test(t)}function bR(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(vR,e=>(cR.test(e)?(r.color.push(a),i.push(mR),n.push(cR.parse(e))):e.startsWith(gR)?(r.var.push(a),i.push(hR),n.push(e)):(r.number.push(a),i.push(pR),n.push(parseFloat(e))),++a,_R)).split(_R),indexes:r,types:i}}function xR(e){return bR(e).values}function SR({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===pR?NL(r[a]):e===mR?cR.transform(r[a]):r[a]}return i}}function CR(e){return SR(bR(e))}var wR=e=>typeof e==`number`?0:cR.test(e)?cR.getAnimatableNone(e):e,TR=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:wR(e);function ER(e){let t=bR(e);return SR(t)(t.values.map((e,n)=>TR(e,t.split[n])))}var DR={test:fR,parse:xR,createTransformer:CR,getAnimatableNone:ER};function OR(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=OR(s,r,e+1/3),a=OR(s,r,e),o=OR(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function AR(e,t){return n=>n>0?t:e}var jR=(e,t,n)=>e+(t-e)*n,MR=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},NR=[$L,XL,sR],PR=e=>NR.find(t=>t.test(e));function FR(e){let t=PR(e);if(!t)return!1;let n=t.parse(e);return t===sR&&(n=kR(n)),n}var IR=(e,t)=>{let n=FR(e),r=FR(t);if(!n||!r)return AR(e,t);let i={...n};return e=>(i.red=MR(n.red,r.red,e),i.green=MR(n.green,r.green,e),i.blue=MR(n.blue,r.blue,e),i.alpha=jR(n.alpha,r.alpha,e),XL.transform(i))},LR=new Set([`none`,`hidden`]);function RR(e,t){return LR.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zR(e,t){return n=>jR(e,t,n)}function BR(e){return typeof e==`number`?zR:typeof e==`string`?LL(e)?AR:cR.test(e)?IR:WR:Array.isArray(e)?VR:typeof e==`object`?cR.test(e)?IR:HR:AR}function VR(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>BR(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function HR(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=BR(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function UR(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var WR=(e,t)=>{let n=bR(e),r=bR(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?LR.has(e)&&!r.values.length||LR.has(t)&&!n.values.length?RR(e,t):nL(VR(UR(n,r),r.values),SR(r)):AR(e,t)},GR=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function KR(e,t){let n=GR.exec(e);if(!n)return;let r=GR.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>NL(jR(a,o,e))+i}function qR(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return jR(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=KR(e,t);if(n)return n}return BR(e)(e,t)}var JR=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function YR(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var XR=40;function ZR(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=JR.reduce((e,t)=>(e[t]=YR(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=XI.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,XR),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:JR.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<JR.length;t++)o[JR[t]].cancel(e)},state:n,steps:o}}var{schedule:QR,cancel:$R,steps:ez}=ZR(typeof requestAnimationFrame<`u`?requestAnimationFrame:tL,!0,kL),tz=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>QR.update(t,e),stop:()=>$R(t),now:()=>kL.isProcessing?kL.timestamp:ML.now()}},nz=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},rz=2e4;function iz(e,t=50,n=rz,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function az(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(iz(o),rz);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:oL(s)}}var oz=100,sz=10,cz=1,lz=800,uz=.3,dz=.3,fz=.01,pz=2,mz=.005,hz=.5,gz=.01,_z=10,vz=.05,yz=e=>e<0?1/Math.max(1+e,vz):Math.max(1-e,vz);function bz(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cz(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xz(e,t){return e*Math.sqrt(1-t*t)}var Sz=12;function Cz(e,t,n){let r=n;for(let n=1;n<Sz;n++)r-=e(r)/t(r);return r}var wz=.001;function Tz({duration:e=lz,bounce:t=uz}){let n,r,i=yz(t);e=YI(gz,_z,oL(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xz(t,i),o=Math.exp(-r);return wz-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xz(t*t,i);return(-n(t)+wz>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cz(n,r,a),s=o*bz(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:aL(e)}}var Ez=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dz(e,t){if(Ez(e,t))return e}function Oz(e){let t=Dz(e.stiffness),n=Dz(e.damping,!0),r=Dz(e.mass),i={...e,stiffness:t??oz,damping:n??sz,mass:r??cz,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yz(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bz(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Tz(i)),i.isResolvedFromDuration=!0;(!Ez(i.stiffness)||!Ez(i.damping,!0))&&(i.stiffness=oz,i.damping=sz)}return i}function kz(e=dz,t=uz){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Oz({...n}),f=e=>u?0:-oL(e),p=s/(2*Math.sqrt(o*c)),m=oL(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?fz:pz),g.restDelta=n.restDelta||(e?mz:hz)};_();let v,y,b;if(p<1){let e=xz(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>aL(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=aL(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(iz(S),rz),t=nz(t=>S.next(e*t).value,e,30);return e+`ms `+t}};return S}var Az=Object.assign(kz,{applyToOptions:e=>{let t=az(e,100,kz);return e.ease=t.ease,e.duration=aL(t.duration),e.type=`keyframes`,e}});function jz({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Az({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Mz(e,t,n){let r=[],i=XI.mix||qR,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=nL(Array.isArray(t)?t[o]||tL:t,a)),r.push(a)}return r}function Nz(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Mz(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=rL(e[r],e[r+1],n);return s[r](i)};return n?t=>l(YI(e[0],e[a-1],t)):l}function Pz(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=rL(0,t,r);e.push(jR(n,1,i))}}function Fz(e){let t=[0];return Pz(t,e.length-1),t}function Iz(e,t){return e.map(e=>e*t)}function Lz(e,t){return e.map(()=>t||SL).splice(0,e.length-1)}function Rz({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=CL(r)?r.map(OL):OL(r)||SL,s={done:!1,value:t[0]},c=-1;if(!a){for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(c>=0){c=-2;break}c=e-1}}if(c>=0){let r=n&&n.length===t.length?n:Fz(t),i=r[c]*e,a=r[c+1]*e,l=t[c],u=t[c+1],d=Array.isArray(o)?o[c]:o,f=(XI.mix||qR)(l,u),p=t.length-2;return{calculatedDuration:e,next:t=>(s.value=c&&t<i?f(0):c<p&&(t>=a||!e)?typeof u==`number`?u:f(1):f(d(t>=a||!e?1:t<=i?0:(t-i)/(a-i))),s.done=t>=e,s)}}let l=Nz(Iz(n&&n.length===t.length?n:Fz(t),e),t,{ease:Array.isArray(o)?o:Lz(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=l(t),s.done=t>=e,s)}}var zz=5;function Bz(e,t,n){let r=Math.max(t-zz,0);return sL(n-e(r),t-r)}function Vz(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Bz(t=>e.next(t).value,t,e.next(t).value)}function Hz(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a,o,s=0;for(let t=0;t<e.length;t++){let n=e[t];n!==null&&(s++||(a=n),o=n)}let c=i<0||t&&n!==`loop`&&t%2==1?0:s-1;return!c||r===void 0?c?o:a:r}var Uz={decay:jz,inertia:jz,tween:Rz,keyframes:Rz,spring:Az};function Wz(e){typeof e.type==`string`&&(e.type=Uz[e.type])}var Gz=40,Kz=(e,t)=>t-e>Gz&&!XI.useManualTiming?t:e;function qz(e,t){return{kind:e,animation:t,timestamp:ML.now(),frameTimestamp:kL.timestamp,frameIsProcessing:kL.isProcessing}}function Jz(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...qz(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Yz(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...qz(`layout-animation-start`,e),node:t})}catch{}}var Xz=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Zz=e=>e/100,Qz=e=>Math.round(e*1e4)/1e4,$z=class extends Xz{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options,t=ML.now();e&&e.updatedAt!==t&&this.tick(e.updatedAt=t),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Jz(this,this.options)}initAnimation(){let{options:e}=this;Wz(e);let{type:t=Rz,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Rz;this.mixKeyframes=void 0,s!==Rz&&typeof o[0]!=`number`&&(this.mixKeyframes=nL(Zz,e.mixer?.(o[0],o[1])||qR(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=iz(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Kz(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==jz&&(f.value=Hz(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??Qz((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==jz?Hz(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=YI(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return oL(this.calculatedDuration)}get iterationDuration(){return this.duration+oL(this.options.delay??0)}get time(){return oL(this.currentTime)}set time(e){this.state===`finished`&&this.updateFinished(),e=aL(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Vz(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ML.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=oL(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=tz,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(ML.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},eB=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function tB(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(UL)||[];if(!r)return e;let i=n.replace(r,``),a=+!!eB.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var nB=/\b([a-z-]*)\(.*?\)/gu,rB={...DR,getAnimatableNone:e=>{let t=e.match(nB);return t?t.map(tB).join(` `):e}},iB={...DR,getAnimatableNone:e=>{let t=DR.parse(e);return DR.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},aB={...BL,transform:Math.round},oB={rotate:tR,pathRotation:tR,rotateX:tR,rotateY:tR,rotateZ:tR,scale:HL,scaleX:HL,scaleY:HL,scaleZ:HL,skew:tR,skewX:tR,skewY:tR,distance:rR,translateX:rR,translateY:rR,translateZ:rR,x:rR,y:rR,z:rR,perspective:rR,transformPerspective:rR,opacity:VL,originX:oR,originY:oR,originZ:rR},sB={borderWidth:rR,borderTopWidth:rR,borderRightWidth:rR,borderBottomWidth:rR,borderLeftWidth:rR,borderRadius:rR,borderTopLeftRadius:rR,borderTopRightRadius:rR,borderBottomRightRadius:rR,borderBottomLeftRadius:rR,width:rR,maxWidth:rR,height:rR,maxHeight:rR,top:rR,right:rR,bottom:rR,left:rR,inset:rR,insetBlock:rR,insetBlockStart:rR,insetBlockEnd:rR,insetInline:rR,insetInlineStart:rR,insetInlineEnd:rR,padding:rR,paddingTop:rR,paddingRight:rR,paddingBottom:rR,paddingLeft:rR,paddingBlock:rR,paddingBlockStart:rR,paddingBlockEnd:rR,paddingInline:rR,paddingInlineStart:rR,paddingInlineEnd:rR,margin:rR,marginTop:rR,marginRight:rR,marginBottom:rR,marginLeft:rR,marginBlock:rR,marginBlockStart:rR,marginBlockEnd:rR,marginInline:rR,marginInlineStart:rR,marginInlineEnd:rR,fontSize:rR,backgroundPositionX:rR,backgroundPositionY:rR,...oB,zIndex:aB,fillOpacity:VL,strokeOpacity:VL,numOctaves:aB},cB={...sB,color:cR,backgroundColor:cR,outlineColor:cR,fill:cR,stroke:cR,borderColor:cR,borderTopColor:cR,borderRightColor:cR,borderBottomColor:cR,borderLeftColor:cR,filter:rB,WebkitFilter:rB,mask:iB,WebkitMask:iB},lB=e=>cB[e],uB=new Set([rB,iB]),dB,fB,pB;function mB(e,t){if(e===dB&&t===fB)return pB;let n=lB(e);return uB.has(n)||(n=DR),pB=n.getAnimatableNone?n.getAnimatableNone(t):void 0,dB=e,fB=t,pB}function hB(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var gB=e=>e*180/Math.PI,_B=e=>yB(gB(Math.atan2(e[1],e[0]))),vB={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_B,rotateZ:_B,skewX:e=>gB(Math.atan(e[1])),skewY:e=>gB(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},yB=e=>(e%=360,e<0&&(e+=360),e),bB=_B,xB=e=>Math.hypot(e[0],e[1]),SB=e=>Math.hypot(e[4],e[5]),CB={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xB,scaleY:SB,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(xB(e)+SB(e))/2,rotateX:e=>yB(gB(Math.atan2(e[6],e[5]))),rotateY:e=>yB(gB(Math.atan2(-e[2],e[0]))),rotateZ:bB,rotate:bB,skewX:e=>gB(Math.atan(e[4])),skewY:e=>gB(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wB(e){return+!!e.includes(`scale`)}function TB(e,t){if(!e||e===`none`)return wB(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return wB(t);let r=(n[1]?CB:vB)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var EB=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return TB(n,t)},DB=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],OB=new Set([...DB,`pathRotation`]),kB=e=>e===BL||e===rR,AB=new Set([`x`,`y`,`z`]),jB=DB.filter(e=>!AB.has(e));function MB(e){let t=[];return jB.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var NB=new Set([`bottom`,`right`]);function PB(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var FB=({transform:e})=>TB(e,`x`),IB=({transform:e})=>TB(e,`y`),LB={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>PB(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>PB(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:FB,y:IB,translateX:FB,translateY:IB},RB=new Set,zB=!1,BB=!1,VB=!1;function HB(){if(BB){let e=[],t=new Set,n=new Set;RB.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),NB.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=MB(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}BB=!1,zB=!1,RB.forEach(e=>e.complete(VB)),RB.clear()}function UB(){RB.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BB=!0)})}function WB(){VB=!0,UB(),HB(),VB=!1}function GB(e,t,n){if(typeof e==`string`){if(ZI(e)||$I(e))return parseFloat(e);if(!DR.test(e)&&DR.test(n))return mB(t,n)}return e??void 0}var KB=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(RB.add(this),zB||(zB=!0,QR.read(UB),QR.resolveKeyframes(HB))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=GB(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}hB(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),RB.delete(this)}cancel(){this.state===`scheduled`&&(RB.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},qB=e=>e.startsWith(`--`);function JB(e,t,n){qB(t)?e.style.setProperty(t,n):e.style[t]=n}var YB={};function XB(e,t){let n=eL(e);return()=>YB[t]??n()}var ZB=XB(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),QB=XB(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),$B=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,eV={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:$B([0,.65,.55,1]),circOut:$B([.55,0,1,.45]),backIn:$B([.31,.01,.66,-.59]),backOut:$B([.33,1.53,.69,.99])};function tV(e,t){if(e)return typeof e==`function`?QB()?nz(e,t):`ease-out`:TL(e)?$B(e):Array.isArray(e)?e.map(e=>tV(e,t)||eV.easeOut):eV[e]}function nV(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=tV(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function rV(e){return typeof e==`function`&&`applyToOptions`in e}function iV({type:e,...t}){return rV(e)&&QB()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var aV=class extends Xz{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=iV(e);this.animation=nV(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!i){let e=Hz(r,this.options,o,this.speed);this.updateMotionValue?.(e),JB(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Jz(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return oL(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+oL(e)}get time(){return oL(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aL(e),t&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=this.onFinish=null,e&&ZB()?(this.animation.timeline=e,t?.(this.animation),tL):n(this)}},oV={anticipate:gL,backInOut:hL,circInOut:yL};function sV(e){return e in oV}function cV(e){typeof e.ease==`string`&&sV(e.ease)&&(e.ease=oV[e.ease])}var lV=class extends aV{constructor(e){cV(e),Wz(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(ML.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new $z({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?YI(0,10,a):0,s=this.sample(a);n&&r&&JB(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},uV=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(DR.test(e)||e===`0`)&&!e.startsWith(`url(`));function dV(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fV(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=uV(i,t),s=uV(a,t);return!o||!s?!1:dV(e)||(n===`spring`||rV(n))&&r}function pV(e){e.duration=0,e.type=`keyframes`}var mV=new Set([`opacity`,`clipPath`,`filter`,`transform`]),hV=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function gV(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&hV.test(e[t]))return!0;return!1}var _V=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),vV=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),yV=()=>!XI.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function bV(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(mV.has(n)||vV.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return yV()&&(mV.has(n)||vV.has(n)&&gV(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!_V(e)}var xV=(e,t)=>t&&typeof e==`number`?t.transform(e):e,SV={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},CV=DB.length,wV={},TV=(e,t,n=xV(t,oB[e]))=>(wV[e]||(wV[e]=(SV[e]||e)+`(`))+n+`)`,EV=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function DV(e,t,n){let r=``;for(let i=0;i<CV;i++){let a=DB[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=xV(o,sB[a]));EV(a,o)||(r+=TV(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=TV(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var OV=new WeakMap,kV=200,AV=.001,jV=.1,MV=.001,NV=100,PV=100,FV=new Set([`linear`,`easeIn`,`easeOut`,`easeInOut`]),IV=e=>FV.has(e),LV=new WeakMap,RV=(e,t)=>{let n=LV.get(e);return n?.[0]!==t&&(n=[t,`linear(`+Fz(Array(t+1)).map(t=>Qz(e(t))+` `+Qz(t*100)+`%`)+`)`],LV.set(e,n)),n[1]},zV=(e,t)=>Math.min(kV,Math.max(2,Math.ceil((t-e)/10))),BV=(e,t)=>Math.abs(e-t)<=AV,VV=(e,t)=>e-t,HV=(e,t,n)=>Fz(Array(n+1)).map(n=>jR(e,t,n)),UV=e=>e.motionValue.owner,WV=e=>OV.get(e),GV=({state:e})=>e===`idle`||e===`finished`,KV=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),qV=({name:e,motionValue:t})=>e&&DB.includes(e)&&t?.owner?.current instanceof HTMLElement&&yV()&&QB();function JV(e){let t=UV(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(KV(t,`transform`)||`none`)===`none`&&!KV(t,`pathRotation`)&&!t.projection?.isProjecting()&&!_V(e)}var YV=class{constructor(e,t,n,r){this.element=e,this.update=t,this.makeDriver=n,this.animation=r}get js(){return this.driver||=this.makeDriver(this.update)}now(){return this.driver||this.makeDriver!==tz?this.js.now():kL.isProcessing?kL.timestamp:ML.now()}start(e=!0){let t=WV(this.element);!t||t.isJS?this.js.start(e):t.schedule(!1,!e)}stopJS(){this.driver?.stop()}stop(){this.stopJS();let e=WV(this.element);e&&!e.isFinishing&&e.release(this.animation)}},XV,ZV=class extends $z{constructor(e){let t=UV(e).current,{driver:n=tz}=e,r,i=JV(e);e.driver=e=>new YV(t,e,n,r),super(e),r=this;let a=this.driver;a&&(a.animation=this),this.canAccelerate=i;let{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}offsets(){let{keyframes:e,times:t}=this.options;return t||(this.offsetsOf!==e&&(this.offsetsOf=e,this.cachedOffsets=Fz(e)),this.cachedOffsets)}get group(){return WV(UV(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(ML.now()):void 0}tween(){let{keyframes:e,type:t,repeat:n,delay:r=0}=this.options,i=-1;if(n||t!==Rz||this.holdTime!==null)return;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(i>=0)return;i=t-1}let{ease:a}=this.options;CL(a)&&(a=a[i]);let o=this.offsets(),s=e=>this.startTime+(r+o[e]*this.totalDuration)/this.speed;if(i>=0){let e=TL(a)?$B(a):IV(a)?eV[a]:OL(a);return[s(i),s(i+1),typeof e==`string`||BV(e(0),0)&&BV(e(1),1)?e:void 0]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,type:u}=a,d=(u||Rz)===Rz?this.offsets():[0,1],f=n+o/r,p=[];if(this.holdTime!==null||!(i>0))return p;for(let n=Math.max(0,Math.floor((e-f)*r/i));n<=s;n++){let a=f+n*i/r;if(a>t)break;for(let o of d){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&p.push(s)}}return p}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=ML.now(),t=this.sampleAt(e,!0);this.options.motionValue.setWithVelocity(this.holdTime===null?this.sampleAt(e-10,!0):t,t,10)}play(){this.isStopped||((this.group||eH(UV(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.tick(ML.now())}get time(){return this.isAccelerated()?oL(YI(0,this.totalDuration,this.at(ML.now())-(this.options.delay||0))):super.time}set time(e){(XV??=Object.getOwnPropertyDescriptor($z.prototype,`time`).set).call(this,e)}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}},QV,$V=e=>{QV||queueMicrotask(()=>{let e=QV;QV=void 0,e.forEach(e=>e())}),(QV||=[]).push(e)};function eH(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p,m=1/0,h,g=e=>{for(let t of n)if(t.name===e)return!0},_=(t,n)=>{let o={};for(let s of t===void 0?DB:a){let a=r.get(s),c=t===void 0?KV(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},v=(e,t)=>{let n=``;for(let r in e){let i=e[r];(!t||!EV(r,i))&&(n+=TV(r,i)+` `)}return(t?n.trim():n)||`none`},y=(e,t)=>v(_(e,t)),b=(e=_())=>{t.style.transform=v(e,!0)},x=e=>{e.onfinish=e.oncancel=null,e.cancel()},S=(e=!0)=>{clearTimeout(p),m=1/0,h=void 0,e&&b(),s.forEach(({animation:e})=>x(e)),s=[]},C=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),w=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=ML.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(x(e),s=s.filter(e=>e!==r)),F.schedule(!1)}),e.oncancel=()=>s.includes(r)&&F.demote(),s.push(r)},T=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},E=(e,t,n,r)=>{let i=zV(t,n);if(r.length*4>i)return;let a;for(let r of e){let e=r.numberAt(t),i=(r.numberAt((t+n)/2)-e)/(r.numberAt(n)-e);if(i===i){if(a===void 0)a=i;else if(!BV(i,a))return}}let o=HV(t,n,i).concat(r).sort(VV),s=e=>rL(t,n,e),c,l;for(let n of e){let e=n.numberAt(t),r=o.map(t=>n.numberAt(t)-e),i=r[r.length-1],a=r.some(e=>Math.abs(e)*AV>Math.abs(i))?0:i,s=r.map(e=>a?e/a:e);if(a&&!c)c=s,l=t=>(n.numberAt(t)-e)/a;else if(s.some((e,t)=>!BV(e,a&&c[t])))return}if(!c||c.every((e,t)=>BV(e,s(o[t]))))return`linear`;let u=[],d=(e,t=l(e))=>u.push(Qz(t)+` `+Qz(s(e)*100)+`%`);return c.forEach((e,t)=>{t&&Math.abs(e-c[t-1])>.2&&T(l,o[t-1],o[t]).forEach(e=>d(e)),d(o[t],e)}),`linear(`+u+`)`},D=(e,t,n,r)=>{let i=[t],a=[],o=n,s=t;for(let r of e){let e=r.tween();if(e?.[2]!==`linear`){let[i,c]=r.timing(),[l,u]=e||[t,c?n:i];o=Math.min(o,l),s=Math.max(s,u),a.push(r)}}o=Math.max(t,o),s=Math.min(n,s);let c=(e,t)=>a.every(n=>!(Math.abs(n.numberAt((e+t)/2)-(n.numberAt(e)+n.numberAt(t))/2)>(n.name.startsWith(`scale`)?MV:jV))),l=(t,n,r)=>{if(n-t<1||c(t,n))i.push(n);else if(r<4)l(t,(t+n)/2,r+1),l((t+n)/2,n,r+1);else{for(let r of e)i.push(...T(e=>r.numberAt(e),t,n));i.push(n)}},u=s>o?HV(o,s,Math.ceil((s-o)/100)):[];u.push(n);for(let e of r)u.push(e,Math.min(e+.01,n));let d=t;for(let e of u.sort(VV))e>d&&l(d,e,0),d=e;return i.sort(VV)},O=e=>{let t;for(let n of e){let e=n.tween();if(!e||t&&(Math.abs(e[0]-t[0])>1||Math.abs(e[1]-t[1])>1))return;t=[e[0],e[1],!t||e[2]===t[2]?e[2]:void 0]}return t},k=(e,t,n,r,i={fill:`both`},a)=>{let o=r?[]:e.flatMap(e=>e.boundaries(t,n)),s=r||E(e,t,n,o),c=s?[t,n]:D(e,t,n,o),l=c.map(e=>y(e,a)),u={transform:l};return s||(u.offset=c.map(e=>rL(t,n,e))),l.every(e=>e===l[0])&&(b(_(t,a)),u=null),C(u,{...i,duration:n-t,easing:s||`linear`})},A=e=>{let t=ML.now()+e;t<m&&(clearTimeout(p),m=t,p=setTimeout(()=>{m=1/0,F.schedule(!1)},e))},j=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),!a){if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=DB.filter(t=>{if(r.has(t))return!0;let n=i[t]=KV(e,t);return n!==void 0&&!EV(t,n)}),S(!1);let m=!l&&O(d);try{if(c>t){let e;if(m&&m[1]>t){let[n,r,i]=m;if(n-t>PV)return d.forEach(e=>e.sync()),A(h=n-t-PV),!0;e=typeof i==`string`?i:i?RV(i,zV(n,r)):E(d,n,r,[]),e&&w(k(d,n,r,e,{fill:`both`,endDelay:c-r}),n-t,c-n)}e||w(k(d,t,c),0,c-t),p.forEach(e=>e<c-1&&w(C(null,{duration:e-t}),0,e-t))}if(l){let e=u+Math.floor((c-u)/l)*l;w(k(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||S(),!0},M=(e,t)=>{let r,i=0;for(let t of n){let n=o.get(t);if(!n)return!1;let[a,c,l]=n,u=t.at(e),d=t.timing()[0]===1/0;if(l){if(d&&(u===a||!s.length))continue;return!1}let f=(u-a)/c,p=d?0:t.speed/c;if(r===void 0)r=f,i=p;else if(Math.abs(f-r)>1||p!==i)return!1}if(r===void 0)return!0;if(!s.length){if(h===void 0||t&&i)return!1;if(i){let e=(h-r)/i;if(e<1)return!1;A(e)}return!0}for(let{offset:e,end:n,isDone:i}of s){let a=r-e;if(n<1/0&&(i?a<n-1:a<0&&(t||e<=0)||a>=n))return!1}for(let{animation:t,offset:n,isDone:a}of s){if(a)continue;let o=r-n;i&&t.updatePlaybackRate&&t.playState===`running`&&Math.abs(Number(t.currentTime)-o)<20?t.playbackRate!==i&&t.updatePlaybackRate(i):i?(t.playbackRate!==i&&(t.playbackRate=i),t.startTime=e-o/i):(t.startTime=null,t.currentTime=o)}return!0},N=()=>!n.size&&(u=!0,WV(t)===F&&OV.delete(t),F.isJS||S(),!0),P=()=>{let t=ML.now();if(F.isJS||(F.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=KV(e,n.name),o.has(n)||(c=!0))}),F.isFinishing=!1),l=!1,u||(n.forEach(e=>GV(e)&&n.delete(e)),N()))return;for(let e of n)if(!e.canAccelerate)return F.demote(!0);F.isJS&&(F.isJS=!1,c=!0,n.forEach(e=>e.stopJS()));let r=c,a=d;if(c=d=!1,r||!M(t,a)){if(a){if(t-f<NV)return F.demote();f=t}if(!j(t))return F.demote()}else if(h!==void 0&&!a)return;n.forEach(e=>e.timing()[0]===1/0&&e.sync())},F={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,kL.isProcessing?QR.render(P,!1,!0):$V(P)))},release(e){GV(e)&&n.delete(e),N()||F.schedule(!0)},check(){if(!F.isJS){for(let t in i)if(KV(e,t)!==i[t]&&!g(t))return F.schedule(!0,!0)}},demote(e){if(!(F.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),F.isJS=!0,o=new Map,S(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return OV.set(t,F),F}var tH=class extends Xz{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ML.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||KB;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=ML.now();let u=fV(e,i,a,o);u||((XI.instantAnimations||!s)&&l?.(Hz(e,n,t)),e[0]=e[e.length-1],pV(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&bV(n),p=!f&&qV(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=Kz(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new lV(n)}catch{m=new $z(n)}}else m=p?new ZV(n):new $z(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),WB()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},nH=class{constructor(e){this.stop=()=>{for(let e of this.animations)e.stop()},this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){for(let t of this.animations)t.time=e}get speed(){return this.getAll(`speed`)}set speed(e){for(let t of this.animations)t.speed=e}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return rH(this.animations,`duration`)}get iterationDuration(){return rH(this.animations,`iterationDuration`)}play(){for(let e of this.animations)e.play()}pause(){for(let e of this.animations)e.pause()}cancel(){for(let e of this.animations)e.cancel()}complete(){for(let e of this.animations)e.complete()}};function rH(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var iH=class extends nH{then(e,t){return this.finished.finally(e).then(()=>{})}};function aH(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var oH=30,sH=e=>!isNaN(parseFloat(e)),cH={current:void 0},lH=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ML.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ML.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=sH(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new iL)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new iL,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){QR.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){t&&(this.updatedAt=ML.now(),this.stop()),this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){cH.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=ML.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oH)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,oH);return sL(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return new Promise(t=>this.run(e,t))}run(e,t){this.stop(),this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t?.()}),n||(this.animation=r),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function uH(e,t){return new lH(e,t)}function dH(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function fH(e,t){let n=e?.[t]??e?.default??e;return n===e?n:dH(n,e)}var pH={type:`spring`,stiffness:500,damping:25,restSpeed:10},mH=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hH={type:`keyframes`,duration:.8},gH={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},_H=(e,{keyframes:t})=>t.length>2?hH:OB.has(e)?e.startsWith(`scale`)?mH(t[1]):pH:gH,vH=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function yH(e){for(let t in e)if(!vH.has(t))return!0;return!1}var bH=(e,t,n,r={},i,a)=>o=>{let s=fH(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=aL(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};yH(s)||Object.assign(u,_H(e,u)),u.duration&&=aL(u.duration),u.repeatDelay&&=aL(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pV(u),u.delay===0&&(d=!0)),(XI.instantAnimations||XI.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,pV(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Hz(u.keyframes,s);if(e!==void 0){QR.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new $z(u):new tH(u)},xH=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function SH(e){let t=xH.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function CH(e,t,n=1){let[r,i]=SH(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ZI(e)?parseFloat(e):e}return LL(i)?CH(i,t,n+1):i}function wH(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function TH(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...wH(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function EH(e,t,n){return TH(e.getProps(),t,n,e)}var DH=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,OH=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...DB]),kH=e=>Array.isArray(e);function AH(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,uH(n))}function jH(e){return kH(e)?e[e.length-1]||0:e}function MH(e,t){let{transitionEnd:n={},transition:r={},...i}=EH(e,t)||{};i={...i,...n};for(let t in i)AH(e,t,jH(i[t]))}var NH=e=>!!(e&&e.getVelocity);function PH(e){return!!(NH(e)&&e.add)}function FH(e,t){let n=e.getValue(`willChange`);if(PH(n))return n.add(t);if(!n&&XI.WillChange){let n=new XI.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var IH=`data-framer-appear-id`;function LH(e){return e.props[IH]}var RH=typeof window<`u`;function zH({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function BH(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?dH(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&zH(f,t))continue;let o={delay:n,...fH(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){QR.update(()=>r.set(i));continue}let p=!1;if(RH&&window.MotionHandoffAnimation){let n=LH(e);if(n){let e=window.MotionHandoffAnimation(n,t,QR);e!==null&&(o.startTime=e,p=!0)}}FH(e,t);let m=l??e.shouldReduceMotion;r.run(bH(t,r,i,m&&OH.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>QR.update(()=>{o&&MH(e,o)});d.length?Promise.all(d).then(t):t()}return d}function VH(e,t,n={}){let r=EH(e,t,DH(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?BH(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(VH(e,t,{...n,delay:r+(typeof o==`function`?0:o)+aH(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function HH(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>VH(e,t,n))):typeof t==`string`?VH(e,t,n):Promise.all(BH(e,EH(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var UH={test:e=>e===`auto`,parse:e=>e},WH=e=>t=>t.test(e),GH=[BL,rR,nR,tR,aR,iR,UH],KH=e=>GH.find(WH(e));function qH(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||$I(e)}var JH=new Set([`auto`,`none`,`0`]);function YH(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!JH.has(t)&&yR(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=mB(n,i))}var XH=class extends KB{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(zL(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),LL(r))){let i=CH(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!OH.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=KH(r),o=KH(i);if(zL(r)!==zL(i)&&LB[n])this.needsMeasurement=!0;else if(a!==o){if(kB(a)&&kB(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else LB[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||qH(e[t]))&&n.push(t);n.length&&YH(e,n,t)}measure(){let{element:e,name:t}=this;return LB[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},ZH=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],QH=[];function $H(e){eU(e),QH.unshift(e)}function eU(e){JI(QH,e)}function tU(e){return QH.find(t=>t.test(e))}function nU(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?QR.update(()=>l.set(c)):(l.run(bH(o,l,c,s&&OH.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>QR.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function rU(e,t,n,r,i){let a,o=!1,s=nU(r=>{let s=a?.[r]??e.get(t,r);if(!s){let c;if(!i){let i=n[r];c=iU(i)??e.read(t,r,i)}s=uH(c,{owner:i}),o?e(t,{[r]:s}):(a||={})[r]=s}return s},n,r,i);return o=!0,a&&e(t,a),s}function iU(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function aU(e){return QI(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function oU(e){return QI(e)&&`ownerSVGElement`in e}var sU={};function cU(e){return sU.current?.add(e),e}var lU=e=>sU.current?sU.current.bind(e):e;function uU(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:sU.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var dU=class{constructor(e=QR.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function fU(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new dU(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function pU(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(EV(i,a)||(t+=(t&&` `)+TV(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+TV(`rotate`,i)),t||`none`}var mU=new Set([`originX`,`originY`,`originZ`]),hU=(e,t)=>xV(e.get(t)?.get(),sB[t]),gU=(e,t,n,r)=>{let i,a;if(OB.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>DB.indexOf(e)-DB.indexOf(t)))}t.get(`transform`)||(!aU(e)&&!t.get(`transformBox`)&&gU(e,t,`transformBox`,new lH(`fill-box`)),t.set(`transform`,new lH(`none`),()=>{OV.get(e)?.check(),e.style.transform=pU(t)})),a=t.get(`transform`)}else mU.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new lH(``),()=>{let n=hU(t,`originX`)??`50%`,r=hU(t,`originY`)??`50%`,i=hU(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=qB(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=xV(r.getCurrent(),sB[n])};return t.set(n,r,i,a)},_U=e=>aU(e)||oU(e),vU=(e,t)=>{if(OB.has(t))return EB(e,t);let n=getComputedStyle(e),r=qB(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},yU=fU(gU,{test:_U,read:vU});function bU(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function xU(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(OB.has(e))o=!0;else if(FL(e))i[e]=n;else{let t=xV(n,sB[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=DV(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var SU={offset:`stroke-dashoffset`,array:`stroke-dasharray`},CU={offset:`strokeDashoffset`,array:`strokeDasharray`};function wU(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?SU:CU;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var TU=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function EU(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(xU(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of TU)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&wU(d,i,a,o,!1)}function DU(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var OU=(e,t,n,r,i=n)=>{let a=DU(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=bU(i));let o=sB[n]||sB[i],s=a?()=>{e[i]=xV(r.get(),sB[n])}:()=>{let t=xV(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function kU(e,t,n,r){return QR.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new lH(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var AU=fU((e,t,n,r)=>n.startsWith(`path`)&&!OB.has(n)?kU(e,t,n,r):n.startsWith(`attr`)?OU(e,t,n,r,jU(n)):n===`d`?t.set(n,r,()=>{let t=r.get()?.replace(/path\(|["')]/g,``);t===void 0?e.removeAttribute(n):e.setAttribute(n,t)}):(OB.has(n)||mU.has(n)||qB(n)||n in e.style?gU:OU)(e,t,n,r),{test:oU,read:(e,t)=>OB.has(t)?sB[t]?.default||0:qB(t)||TU.includes(t)?vU(e,t)||e.getAttribute(bU(t))||0:(t=jU(t),e.getAttribute(bU(t))??e.getAttribute(t)??void 0)});function jU(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function MU({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function NU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PU(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function FU(e){return e===void 0||e===1}function IU({scale:e,scaleX:t,scaleY:n}){return!FU(e)||!FU(t)||!FU(n)}var LU=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function RU(e){return IU(e)||BU(e)||zU(e)}function zU(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function BU(e){return VU(e.x)||VU(e.y)}function VU(e){return e&&e!==`0%`}function HU(e,t,n){return n+t*(e-n)}function UU(e,t,n,r,i){return i!==void 0&&(e=HU(e,i,r)),HU(e,n,r)+t}function WU(e,t=0,n=1,r,i){e.min=UU(e.min,t,n,r,i),e.max=UU(e.max,t,n,r,i)}function GU(e,{x:t,y:n}){WU(e.x,t.translate,t.scale,t.originPoint),WU(e.y,n.translate,n.scale,n.originPoint)}var KU=.999999999999,qU=1.0000000000001;function JU(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(YU(e.x,-a.scroll.offset.x),YU(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,GU(e,o)),r&&(r.path?.[s]||r)!==a&&RU(a.latestValues)&&QU(e,a.latestValues,a.layout?.layoutBox));t.x<qU&&t.x>KU&&(t.x=1),t.y<qU&&t.y>KU&&(t.y=1)}function YU(e,t){e.min+=t,e.max+=t}function XU(e,t,n,r,i=.5){WU(e,t,n,jR(e.min,e.max,i),r)}function ZU(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function QU(e,t,n){let r=n??e;XU(e.x,ZU(t.x,r.x),t.scaleX,t.scale,t.originX),XU(e.y,ZU(t.y,r.y),t.scaleY,t.scale,t.originY)}function $U(e,t){return MU(PU(e.getBoundingClientRect(),t))}function eW(e,t,n){let r=$U(e,n),{scroll:i}=t;return i&&(YU(r.x,i.offset.x),YU(r.y,i.offset.y)),r}var tW=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),nW={},rW=e=>oU(e)?AU:yU,iW=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=XH}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return $U(this.current)}getProps(){return nW}};function aW(e,t,n,r){if(sU.current?.track(e),r)return nU(e=>r.getValue(e,null),t,n,r);let i=rW(e);return rU(i,e,t,n,new iW(i,e))}var oW=fU((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>QI(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:sW,cancel:cW}=ZR(queueMicrotask,!1);function lW(e,t,n){let r=NH(e)?e:uH(e);return r.run(bH(``,r,t,n)),r.animation}var uW={},dW={value:null,addProjectionMetrics:null,countProjection:void 0};function fW(e,t){let n=ML.now();e=lU(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&($R(r),e(a-t))};return QR.setup(r,!0),cU(()=>$R(r))}function pW(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function mW(e){return oU(e)&&e.tagName===`svg`}function hW(e){return NH(e)?e.get():e}var gW=e=>typeof e==`number`?e:parseFloat(e),_W=ZH.length,vW=e=>typeof e==`number`||rR.test(e);function yW(e,t,n,r,i,a){i?(e.opacity=jR(0,n.opacity??1,xW(r)),e.opacityExit=jR(t.opacity??1,0,SW(r))):a&&(e.opacity=jR(t.opacity??1,n.opacity??1,r));for(let i=0;i<_W;i++){let a=ZH[i],o=bW(t,a),s=bW(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||vW(o)===vW(s)?(e[a]=Math.max(jR(gW(o),gW(s),r),0),(nR.test(s)||nR.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<LU.length;i++){let a=LU[i];(t[a]||n[a])&&(e[a]=jR(t[a]||0,n[a]||0,r))}}function bW(e,t){return e[t]===void 0?e.borderRadius:e[t]}var xW=CW(0,.5,vL),SW=CW(.5,.95,tL);function CW(e,t,n){return r=>r<e?0:r>t?1:n(rL(e,t,r))}var wW=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},TW=(e,t=300)=>{let n=YI(.25,2,t/300),{stiffness:r,damping:i}=Oz({...e,duration:e.duration&&aL(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function EW(e,t){e.min=t.min,e.max=t.max}function DW(e,t){EW(e.x,t.x),EW(e.y,t.y)}function OW(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var kW=.9999,AW=1.0001,jW=-.01,MW=.01;function NW(e){return e.max-e.min}function PW(e,t,n){return Math.abs(e-t)<=n}function FW(e,t,n,r=.5){e.origin=r,e.originPoint=jR(t.min,t.max,e.origin),e.scale=NW(n)/NW(t),e.translate=jR(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kW&&e.scale<=AW||isNaN(e.scale))&&(e.scale=1),(e.translate>=jW&&e.translate<=MW||isNaN(e.translate))&&(e.translate=0)}function IW(e,t,n,r){FW(e.x,t.x,n.x,r?.originX),FW(e.y,t.y,n.y,r?.originY)}function LW(e,t,n,r=0){e.min=(r?jR(n.min,n.max,r):n.min)+t.min,e.max=e.min+NW(t)}function RW(e,t,n,r){LW(e.x,t.x,n.x,r?.x),LW(e.y,t.y,n.y,r?.y)}function zW(e,t,n,r=0){let i=r?jR(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+NW(t)}function BW(e,t,n,r){zW(e.x,t.x,n.x,r?.x),zW(e.y,t.y,n.y,r?.y)}function VW(e,t,n,r,i){return e-=t,e=HU(e,1/n,r),i!==void 0&&(e=HU(e,1/i,r)),e}function HW(e,t=0,n=1,r=.5,i,a=e,o=e){if(nR.test(t)&&(t=parseFloat(t),t=jR(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=jR(a.min,a.max,r);e===a&&(s-=t),e.min=VW(e.min,t,n,s,i),e.max=VW(e.max,t,n,s,i)}function UW(e,t,[n,r,i],a,o){HW(e,t[n],t[r],t[i],t.scale,a,o)}var WW=[`x`,`scaleX`,`originX`],GW=[`y`,`scaleY`,`originY`];function KW(e,t,n,r){UW(e.x,t,WW,n?.x,r?.x),UW(e.y,t,GW,n?.y,r?.y)}var qW=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JW=qW(`applewebkit/`)&&!qW(`chrome/`)?Math.round:tL;function YW(e){e.min=JW(e.min),e.max=JW(e.max)}function XW(e){YW(e.x),YW(e.y)}var ZW=()=>({translate:0,scale:1,origin:0,originPoint:0}),QW=()=>({x:ZW(),y:ZW()}),$W=()=>({min:0,max:0}),eG=()=>({x:$W(),y:$W()});function tG(e){return e.translate===0&&e.scale===1}function nG(e){return tG(e.x)&&tG(e.y)}function rG(e,t){return e.min===t.min&&e.max===t.max}function iG(e,t){return rG(e.x,t.x)&&rG(e.y,t.y)}function aG(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oG(e,t){return aG(e.x,t.x)&&aG(e.y,t.y)}function sG(e){return NW(e.x)/NW(e.y)}function cG(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var lG=class{constructor(){this.members=[]}add(e){qI(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(JI(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(JI(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function uG(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var dG={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(rR.test(e))e=parseFloat(e);else return e}return`${uG(e,t.target.x)}% ${uG(e,t.target.y)}%`}},fG={borderRadius:Object.assign({},dG,{applyTo:ZH.slice()}),borderTopLeftRadius:dG,borderTopRightRadius:dG,borderBottomLeftRadius:dG,borderBottomRightRadius:dG,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=DR.parse(e);if(i.length>5)return r;let a=DR.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=jR(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function pG(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;(i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `);let s=``;if(n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<LU.length;e++){let t=LU[e],r=n[t];r&&(s+=`${t}(${r}deg) `),!e&&n.pathRotation&&(s+=`rotate(${n.pathRotation}deg) `)}}if(s){(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),r+=s;let n=e.x.scale*t.x,i=e.y.scale*t.y;(n!==1||i!==1)&&(r+=`scale(${n}, ${i})`)}else e.x.scale!==1||e.y.scale!==1?r+=`scale(${e.x.scale}, ${e.y.scale})`:!r&&(t.x!==1||t.y!==1)&&(r=`scale(1, 1)`);return r||`none`}function mG(e){return[e(`x`),e(`y`)]}var hG=(e,t)=>e.depth-t.depth,gG=class{constructor(){this.children=[],this.isDirty=!1}add(e){qI(this.children,e),this.isDirty=!0}remove(e){JI(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hG),this.isDirty=!1,this.children.forEach(e)}},_G={hasAnimatedSinceResize:!0,hasEverUpdated:!1},vG=[`z`,`skew`,`skewZ`],yG=1e3,bG=0;function xG(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var SG=e=>e.instance&&OV.get(e.instance)?.demote()&&e.resetSkewAndRotation();function CG(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=LH(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,QR,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&CG(r)}function wG(e){if(e)return e.options.allowProjection===!1?wG(e.parent):e.projection}function TG({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(uW,{...fG,...uW}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:wG(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&pW(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=bG++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(OG),this.nodes.forEach(zG),this.nodes.forEach(BG),this.nodes.forEach(kG),dW.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new gG)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new iL),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=oU(t)&&!mW(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;QR.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=fW(i,250),_G.hasAnimatedSinceResize&&(_G.hasAnimatedSinceResize=!1,this.nodes.forEach(RG)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||qG,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!oG(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...fH(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||RG(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,$R(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(VG),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CG(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;SG(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,SG(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(MG),this.nodes.forEach(jG);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(NG);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(FG),this.nodes.forEach(IG),this.nodes.forEach(LG),this.nodes.forEach(EG),this.nodes.forEach(DG)):this.nodes.forEach(NG),this.clearAllSnapshots();let e=ML.now();kL.delta=YI(0,1e3/60,e-kL.timestamp),kL.timestamp=e,kL.isProcessing=!0,ez.update.process(kL),ez.preRender.process(kL),ez.render.process(kL),kL.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sW.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AG),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,QR.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){QR.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!NW(this.snapshot.measuredBox.x)&&!NW(this.snapshot.measuredBox.y)&&(this.snapshot=void 0),this.snapshot)){let{visualElement:e}=this.options,t=this.currentAnimation?.state===`running`,n=t&&this.animationEdges;t&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);let r=n&&this.motionValue?.getVelocity()||0,i=[0,1,2,3,4,5].map(t=>(t<4?n&&(this.edgeValues?this.edgeVelocity(t):-n[t]*r/1e3):e?.getValue(t<5?`x`:`y`)?.getVelocity())||0);i.some(Boolean)&&(this.snapshot.velocity=i)}}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=eG(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&SG(this);let t=this.projectionDelta&&!nG(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||RU(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),XW(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return eG();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(XG))){let{scroll:e}=this.root;e&&(YU(t.x,e.offset.x),YU(t.y,e.offset.y))}return t}removeElementScroll(e){let t=eG();if(DW(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&DW(t,e),YU(t.x,i.offset.x),YU(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||eG();DW(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(YU(a.x,-n.scroll.offset.x),YU(a.y,-n.scroll.offset.y)),RU(n.latestValues)&&QU(a,n.latestValues,n.layout?.layoutBox)}return!r&&RU(this.latestValues)&&QU(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=eG();DW(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!RU(n.latestValues))continue;let r;n.instance&&(IU(n.latestValues)&&n.updateSnapshot(),r=eG(),DW(r,n.measurePageBox())),KW(t,n.latestValues,n.snapshot?.layoutBox,r)}return RU(this.latestValues)&&KW(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==kL.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=kL.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=eG(),this.targetWithTransforms=eG()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),RW(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):DW(this.target,this.layout.layoutBox),GU(this.target,this.targetDelta)):DW(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),dW.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||IU(this.parent.latestValues)||BU(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=eG(),this.relativeTargetOrigin=eG(),BW(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),DW(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===kL.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;DW(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;JU(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=eG());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(OW(this.prevProjectionDelta.x,this.projectionDelta.x),OW(this.prevProjectionDelta.y,this.projectionDelta.y)),IW(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!cG(this.projectionDelta.x,this.prevProjectionDelta.x)||!cG(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),dW.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=QW(),this.projectionDelta=QW(),this.projectionDeltaWithTransform=QW()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=QW();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=eG(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(KG));this.animationProgress=0;let f,p=n?.interpolateProjection(e),m=this.layout?.layoutBox,h=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((t,n)=>{let{translate:r,scale:i,originPoint:a}=e[n<2?`x`:`y`];return(t-a)*(i-1)+r});h?.every(isFinite)||(h=void 0),this.animationEdges=h,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;let g=r?.velocity,_=r?.relativeVelocity||g;if(_?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=_),g&&h){let t=g.slice(0,4).map((e,t)=>e+(c?g[4+(t>>1)]:0));t.some(Boolean)&&(this.startVelocity=p?wW(e.x.translate,e.y.translate,{x:(t[0]+t[1])/2,y:(t[2]+t[3])/2}):t)}this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n),l=this.edgeValues;for(let t=0;t<2;t++){let r=t?`y`:`x`;l?HG(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):UG(o[r],e[r],n)}if(r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){BW(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(GG(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=ML.now(),i=(r-this.relativeTime)/1e3;this.relativeTime=r;let a=this.relativeVelocity||=[0,0,0,0];for(let r=0;r<4;r++){let o=r<2?`x`:`y`,s=r&1?`max`:`min`;n&&(e[o][s]+=n[r]*t),f&&i>0&&(a[r]=(e[o][s]-f[o][s])/i)}}f&&iG(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=eG(),DW(f,this.relativeTarget)}c&&(this.animationValues=a,yW(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`);let t=this.isSpringLayout=e.type===`spring`;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&=($R(this.pendingAnimation),void 0),this.pendingAnimation=QR.update(()=>{_G.hasAnimatedSinceResize=!0,this.motionValue||=uH(0),this.motionValue.jump(0,!1);let n=this.startVelocity;this.startVelocity=void 0;let r=e,i=0;if(t){if(e.mass===`auto`){let t=this.layout?.layoutBox;r=TW(e,t&&Math.sqrt(NW(t.x)*NW(t.y)))}let t=this.relativeStart;if((n||t)&&!e.repeat){if(typeof n==`number`)i=n;else{let e=n&&this.animationEdges;r={...r,type:r=>{let i=[r.velocity,...n||[]].map((t,n)=>Az({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(Az({...r,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let o=0,s=[],c={calculatedDuration:null,next:t=>{o=t;let n=i[0].next(t),r=n.done;for(let e=1;e<i.length;e++){let{value:n,done:o}=i[e].next(t);e<a?s[e-1]=n:this.impulse=n/1e3,r&&=o}return e&&(this.edgeValues=s),n.done=r,n}};return c.calculatedDuration=iz(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=lW(this.motionValue,[0,1e3],{...r,velocity:i,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}});this.currentAnimation=a,Yz(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(yG),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&YG(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||eG(),JG(i.x,t.x,e.x),JG(i.y,t.y,e.y)}DW(t,i),QU(t,r),IW(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new lG),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!zU(t))return;let n={};for(let t=0;t<vG.length;t++)xG(vG[t],e,n,this.animationValues);for(let t=0;t<LU.length;t++)xG(LU[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=hW(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=hW(t?.pointerEvents)||``),this.hasProjected&&!RU(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=pG(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in uW){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=uW[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?hW(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(jG),this.root.sharedNodes.clear()}}}function EG(e){e.updateLayout(),PG(e)}function DG(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)mG(e=>{let t=NW(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;EW(r[e],a[e])}else YG(i,t.layoutBox,n)&&mG(t=>{let n=NW(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=QW();IW(c,n,t.layoutBox);let l=QW();IW(l,a?e.applyTransform(r,!0):n,s);let u=!nG(c),d=!1,f=e.getClosestProjectingParent();if((!a||f?.options.layoutRoot&&e.resumeFrom?.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=eG();BW(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=eG();BW(l,n,i.layoutBox,s),a&&o(c,l),oG(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function OG(e){dW.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function kG(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AG(e){e.clearSnapshot()}function jG(e){e.clearMeasurements()}function MG(e){e.isLayoutDirty=!0,e.updateLayout()}function NG(e){e.isLayoutDirty=!1}function PG(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;mG(e=>YU(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function FG(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function IG(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function LG(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function RG(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zG(e){e.resolveTargetDelta()}function BG(e){e.calcProjection()}function VG(e){e.resetSkewAndRotation()}function HG(e,t,n,r,i){let a=n.max-n.min,o=a?Math.max(0,(a+i-r)/a):1,s=e.originPoint=t.originPoint;e.origin=t.origin,e.scale=o,e.translate=n.min+r-(s+(n.min-s)*o)}function UG(e,t,n){e.translate=jR(t.translate,0,n),e.scale=jR(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function WG(e,t,n,r){e.min=jR(t.min,n.min,r),e.max=jR(t.max,n.max,r)}function GG(e,t,n,r){WG(e.x,t.x,n.x,r),WG(e.y,t.y,n.y,r)}function KG(e){return e.animationValues?.opacityExit!==void 0}var qG={duration:.45,ease:[.4,0,.1,1]};function JG(e,t,n){e.max=NW(n)+(e.min=t.min)}function YG(e,t,n){return e===`position`||e===`preserve-aspect`&&!PW(sG(t),sG(n),.2)}function XG(e){return e!==e.root&&e.scroll?.wasRoot}function ZG(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var QG=TG({attachResizeListener:(e,t)=>ZG(e,`resize`,t),measureScroll:tW,checkIsScrollRoot:()=>!0}),$G={current:void 0},eK=TG({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$G.current){let e=new QG({});e.mount(window),e.setOptions({layoutScroll:!0}),$G.current=e}return $G.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),tK=new WeakMap;function nK(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function rK(e){return typeof e==`string`||Array.isArray(e)}var iK=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`whilePinch`,`exit`],aK=[`initial`].concat(iK);function oK(e){if(nK(e.animate))return!0;for(let t=0;t<aK.length;t++)if(rK(e[aK[t]]))return!0;return!1}function sK(e){return!!(oK(e)||e.variants)}function cK(e,t,n){for(let r in t){let i=t[r],a=n[r];if(NH(i))e.addValue(r,i);else if(NH(a))e.addValue(r,uH(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,uH(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var lK={current:null},uK={current:!1},dK=typeof window<`u`;function fK(){if(uK.current=!0,dK){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>lK.current=e.matches;e.addEventListener(`change`,t),t()}else lK.current=!1}}var pK=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],mK={};function hK(e){mK=e}function gK(){return mK}var _K=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=KB,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ML.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,QR.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=oK(t),this.isVariantNode=sK(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&NH(t)&&t.set(c[e])}}mount(e){let t=this.presenceContext;if(this.hasBeenMounted&&t?.isPresent!==!1&&!t?.keepValuesOnRemount)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,tK.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(uK.current||fK(),this.shouldReduceMotion=lK.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),$R(this.notifyUpdate),$R(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&mV.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new aV({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:aL(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=OB.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&QR.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),OV.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in mK){let t=mK[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):eG()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&OV.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<pK.length;t++){let n=pK[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=cK(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=uH(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ZI(n)||$I(n))?n=parseFloat(n):typeof n!=`number`&&!DR.test(n)&&DR.test(t)&&(n=mB(e,t)),this.setBaseTarget(e,NH(n)?n.get():n)),NH(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new iL)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){sW.render(this.render)}},vK=class extends _K{constructor(){super(...arguments),this.KeyframeResolver=XH}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;NH(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function yK(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function bK(e,{layout:t,layoutId:n}){return OB.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!uW[e]||e===`opacity`)}function xK(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(NH(r[t])||i&&NH(i[t])||bK(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function SK(e){return window.getComputedStyle(e)}var CK=class extends vK{constructor(){super(...arguments),this.type=`html`,this.renderInstance=yK}mount(e){super.mount(e)}readValueFromInstance(e,t){if(OB.has(t))return this.projection?.isProjecting?wB(t):EB(e,t);{let n=SK(e),r=(FL(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return $U(e,t)}build(e,t,n){xU(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return xK(e,t,n)}},wK=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function TK(e){return{point:{x:e.pageX,y:e.pageY}}}var EK=e=>t=>wK(t)&&e(t,TK(t));function DK(e,t,n,r){return ZG(e,t,EK(n),r)}var OK=new WeakMap,kK,AK=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:oU(r)&&`getBBox`in r?r.getBBox()[t]:r[n],jK=AK(`inline`,`width`,`offsetWidth`),MK=AK(`block`,`height`,`offsetHeight`);function NK({target:e,borderBoxSize:t}){OK.get(e)?.forEach(n=>{n(e,{get width(){return jK(e,t)},get height(){return MK(e,t)}})})}function PK(e){e.forEach(NK)}function FK(){typeof ResizeObserver<`u`&&(kK=new ResizeObserver(PK))}function IK(e,t){kK||FK();let n=uU(e);return n.forEach(e=>{let n=OK.get(e);n||(n=new Set,OK.set(e,n)),n.add(t),kK?.observe(e)}),()=>{n.forEach(e=>{let n=OK.get(e);n?.delete(t),n?.size||kK?.unobserve(e)})}}var LK=new Set,RK;function zK(){RK=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};LK.forEach(t=>t(e))},window.addEventListener(`resize`,RK)}function BK(e){return LK.add(e),RK||zK(),()=>{LK.delete(e),!LK.size&&typeof RK==`function`&&(window.removeEventListener(`resize`,RK),RK=void 0)}}function VK(e,t){return cU(typeof e==`function`?BK(e):IK(e,t))}var HK=(e,t)=>Math.abs(e-t);function UK(e,t){let n=HK(e.x,t.x),r=HK(e.y,t.y);return Math.sqrt(n**2+r**2)}var WK=new Set([`auto`,`scroll`]),GK=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o,immediate:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=qK(this.lastRawMoveEventInfo,this.transformPagePoint));let e=YK(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=UK(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:ML.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=qK(t,this.transformPagePoint),this.hasPendingMove=!0,QR.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=YK(e.type===`pointercancel`?this.lastMoveEventInfo:qK(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!wK(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=TK(e),l=qK(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:ML.now()}];let{onSessionStart:d}=t;d&&d(e,YK(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=nL(DK(this.contextWindow,`pointermove`,this.handlePointerMove,f),DK(this.contextWindow,`pointerup`,this.handlePointerUp,f),DK(this.contextWindow,`pointercancel`,this.handlePointerUp,f)),o&&this.startScrollTracking(o),s&&(this.handlePointerMove(e,c),this.updatePoint())}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(WK.has(e.overflowX)||WK.has(e.overflowY))&&this.scrollPositions.set(t,KK(t)),t=t.parentElement}this.scrollPositions.set(window,KK(window)),this.removeScrollListeners=nL(ZG(window,`scroll`,this.onElementScroll,{capture:!0}),ZG(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=KK(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),QR.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),$R(this.updatePoint)}},KK=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function qK(e,t){return t?{point:t(e.point)}:e}function JK(e,t){return{x:e.x-t.x,y:e.y-t.y}}function YK({point:e},t){return{point:e,delta:JK(e,ZK(t)),offset:JK(e,XK(t)),velocity:QK(t,.1)}}function XK(e){return e[0]}function ZK(e){return e[e.length-1]}function QK(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=ZK(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>aL(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>aL(t)*2&&(r=e[1]);let a=oL(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var $K=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function eq(e){return $K.has(e.tagName)||e.isContentEditable===!0}var tq=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function nq(e){return tq.has(e.tagName)||e.isContentEditable===!0}var rq={x:!1,y:!1};function iq(){return rq.x||rq.y}function aq(e){return e===`x`||e===`y`?rq[e]?null:(rq[e]=!0,()=>{rq[e]=!1}):rq.x||rq.y?null:(rq.x=rq.y=!0,()=>{rq.x=rq.y=!1})}function oq(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?jR(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?jR(n,e,r.max):Math.min(e,n)),e}function sq(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function cq(e,{top:t,left:n,bottom:r,right:i}){return{x:sq(e.x,n,i),y:sq(e.y,t,r)}}function lq(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function uq(e,t){return{x:lq(e.x,t.x),y:lq(e.y,t.y)}}function dq(e,t){let n=.5,r=NW(e),i=NW(t);return i>r?n=rL(t.min,t.max-r,e.min):r>i&&(n=rL(e.min,e.max-i,t.min)),YI(0,1,n)}function fq(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var pq=.35;function mq(e=pq){return e===!1?e=0:e===!0&&(e=pq),{x:hq(e,`left`,`right`),y:hq(e,`top`,`bottom`)}}function hq(e,t,n){return{min:gq(e,t),max:gq(e,n)}}function gq(e,t){return typeof e==`number`?e:e[t]||0}function _q(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var vq=new WeakMap,yq=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=eG(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,t={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let n=e=>{t.snapToCursor&&this.snapToCursor(e),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=aq(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),mG(e=>{let t=this.getAxisMotionValue(e).get()||0;if(LL(t)&&(t=CH(t,this.visualElement.current)||0),rR.test(t))t=parseFloat(t);else if(nR.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=NW(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&QR.update(()=>a(e,t),!1,!0),FH(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},i=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Tq(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&QR.update(()=>a(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},o=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:s}=this.getProps();this.panSession=new GK(e,{onSessionStart:n,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:o},{...t,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&QR.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!wq(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=oq(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;bq(e)?(!this.constraints||this.scroll!==_q(n))&&(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?cq(r.layoutBox,e):!1,this.elastic=mq(t),i!==this.constraints&&!bq(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&mG(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=fq(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!bq(e))return!1;let n=xq(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=_q(r);let i=eW(n,r.root,this.visualElement.getTransformPagePoint()),a=uq(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(NU(a));this.hasMutatedConstraints=!!e,e&&(a=MU(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&wq(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=mG(e=>{if(!wq(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return FH(this.visualElement,e),n.start(bH(e,n,0,t,this.visualElement,!1))}stopAnimation(){mG(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();mG(e=>{if(!wq(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-jR(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!bq(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};mG(e=>{let t=this.getAxisMotionValue(e).get();i[e]=dq({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),mG(t=>{let n=this.getAxisMotionValue(t);if(!wq(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(jR(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;vq.set(this.visualElement,this);let e=this.visualElement.current,t=DK(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&nq(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=bq(t)&&xq(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Cq(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),QR.read(r);let o=ZG(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(mG(t=>{if(!wq(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=pq,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function bq(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var xq=e=>`current`in e?e.current:e;function Sq(e){let t=!0;return()=>{t?t=!1:e()}}function Cq(e,t,n){let r=VK(e,Sq(n)),i=VK(t,Sq(n));return()=>{r(),i()}}function wq(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tq(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Eq(e,t){let n=uU(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},cU(()=>r.abort())]}function Dq(e){return!(e.pointerType===`touch`||iq())}function Oq(e,t,n={}){t=lU(t);let[r,i,a]=Eq(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Dq(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var kq=(e,t)=>t?e===t||kq(e,t.parentElement):!1,Aq=new WeakSet;function jq(e){return t=>{t.key===`Enter`&&e(t)}}function Mq(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Nq=(e,t)=>{let n=!1,r=jq(()=>{n||Aq.has(e)||(n=!0,Mq(e,`down`))}),i=jq(()=>{n&&(n=!1,Mq(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&Mq(e,`cancel`)},{...t,once:!0})};function Pq(e){return wK(e)&&!iq()}var Fq=new WeakSet,Iq=100,Lq=8,Rq=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,zq=e=>e.preventDefault();function Bq(e,t,n={}){t=lU(t);let[r,i,a]=Eq(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!Pq(e)||Fq.has(e))return;n.stopPropagation&&Fq.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=ML.now(),d=aL(c),f=aL(s),p=o.get(r);p?.expire(Rq(p.event,e,Iq))?p=void 0:p&&($R(p.expire),o.delete(r));let m=p?p.count+1:1,h=m>=a,g=h&&(c||l),_=!c,v=0,y;if(Aq.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=aL(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return $R(w);let e=Math.min(1-(S-ML.now())/x,1);C&&e<1&&(e=0),C=!1,y.onHold?.(e),!(e<1)&&(_?y.onRepeat?.(++v):(_=!0,y.onActive?.()),l?(C=!0,S+=x=b):$R(w))},T={...i,capture:!0},E=(t,n)=>{if(wK(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,zq),$R(w),Aq.delete(r),iq()&&(n=!1),n&&!h){let n=ML.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||ML.now()-n>f)return $R(a),o.delete(r),s||y.onComplete?.(t,{success:!1}),!0};o.set(r,{count:m,event:e,handlers:y,expire:a}),QR.update(a,!0)}else y.onComplete?.(t,{success:n&&_})}},D=e=>{E(e,r===window||r===document||n.useGlobalTarget||kq(r,e.target))},O=e=>{E(e,!1)},k=t=>{wK(t)&&((l||!_)&&Rq(e,t,Lq)||a>1&&iq())&&O(t)};window.addEventListener(`pointerup`,D,T),window.addEventListener(`pointercancel`,O,T),(g||a>1)&&window.addEventListener(`pointermove`,k,T),g&&(QR.update(w,!0),r.addEventListener(`contextmenu`,zq,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),aU(e)&&(e.addEventListener(`focus`,()=>Nq(e,i),i),!eq(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Vq(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Nz(i,a,o);return t?s(r):s}var Hq=new Set,Uq=({timestamp:e})=>{Hq.forEach(t=>t.tick(e))},Wq=class extends Xz{constructor(e){super(),this.state=`idle`,this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.factory=e.type,this.generator=this.factory(e);let{driver:t}=e;t&&(this.driver=t(e=>this.tick(e))),this.startTime=this.now(),this.state=`running`,this.driver?this.driver.start():(Hq.size||QR.update(Uq,!0),Hq.add(this))}setTarget(e,t){this.nextTarget=e,this.nextVelocity=t,this.hasNextTarget=!0}retarget(e,t){let{options:n,generator:r}=this;n.keyframes=e,n.velocity=t,this.startTime=this.now(),this.currentTime=0,r.retarget?r.retarget(e,t):this.generator=this.factory(n)}tick(e){let{options:t,hasNextTarget:n}=this,{delay:r=0,onUpdate:i,onPlay:a}=t;this.started||(this.startTime=Kz(this.startTime,e));let o=Math.round(e-this.startTime)-r,s=this.currentTime=Math.max(0,o),c=this.generator.next(s),l=o<0?t.keyframes[0]:c.value;if(n){this.hasNextTarget=!1;let{keyframes:e}=t;e[0]=l,e[1]=this.nextTarget,this.retarget(e,this.nextVelocity??this.getGeneratorVelocity())}(n||!this.started)&&(this.started=!0,a?.()),this.state===`running`&&(i?.(l),c.done&&o>=0&&!n&&!this.hasNextTarget&&this.state===`running`&&(this.notifyFinished(),this.teardown(),this.state=`finished`,t.onComplete?.()))}getGeneratorVelocity(){return Vz(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():ML.now()}teardown(){this.state=`idle`,this.driver?this.driver.stop():(Hq.delete(this),Hq.size||$R(Uq))}};function Gq(e,t,n){let r=e.get(),i=null,a,o=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,s=e=>a(o?e+o:e),c=()=>e.events.animationStart?.notify(),l=()=>{i&&=(i.stop(),null),e.animation=void 0};if(e.attach((t,r)=>{a=r;let o=gW(t);if(i?.state===`running`){i.setTarget(o,n.velocity);return}let u=gW(e.get()),d=i?i.getGeneratorVelocity():e.getVelocity();if(l(),u===o)return;let f=i=new Wq({keyframes:[u,o],velocity:d,restDelta:.001,restSpeed:.01,...n,onUpdate:s,onPlay:c});e.animation=f,f.then(()=>{i===f&&(i=null,e.animation=void 0,e.events.animationComplete?.notify())})},l),NH(t)){let r=n.skipInitialAnimation===!0,i=t=>{r?(r=!1,e.jump(Kq(t,o),!1)):e.set(Kq(t,o))},a=t.on(`change`,i),s=t.get();gW(s)-gW(e.get())&&i(s);let c=e.on(`destroy`,a);return()=>{a(),c(),l()}}return l}function Kq(e,t){return t?e+t:e}function qq(e,t,n){return Gq(e,t,{...n,type:Az})}var Jq=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},Yq=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Xq=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Zq(e,t,n,r){yK(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Yq.has(n)?n:bU(n),t.attrs[n])}function Qq(e,t,n){let r=xK(e,t,n);for(let n in e)if(n!==`children`&&(NH(e[n])||NH(t[n]))){let t=DB.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var $q=class extends vK{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=eG}getBaseTargetFromProps(e,t){return OB.has(t)?super.getBaseTargetFromProps(e,t)??wB(t):e[t]}getDefaultValue(e){return OB.has(e)?this.latestValues[e]??wB(e):void 0}readValueFromInstance(e,t){if(OB.has(t)){let e=lB(t);return e&&e.default||0}if(TU.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Yq.has(t)?t:bU(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qq(e,t,n)}build(e,t,n){EU(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Zq(e,t,n,r)}mount(e){this.isSVGTag=Xq(e.tagName),super.mount(e)}};function eJ(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var tJ=[...iK].reverse(),nJ=e=>e?.out===!0?e:e?.out;function rJ(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>HH(e,t,n))),n=aJ(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&EH(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&nJ(f(l??(g&&g.props.initial))?.transition);if(tJ.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?rK(f)||f===!1?f:void 0:l,y=rK(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||nK(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=iJ(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=EH(e,n,DH(e,t))||{};E={...E,...a,...i},D=nJ(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!eJ(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=EH(s,n)?.transition?.delayChildren;r.delay=aH(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!NH(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=aJ(),i=!0}}}function iJ(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!eJ(t,e):!1}function aJ(){let e={};for(let t of iK)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var oJ=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function sJ(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function cJ(...e){return t=>{let n=!1,r=e.map(e=>{let r=sJ(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():sJ(e[t],null)}}}}function lJ(...e){return v.useCallback(cJ(...e),e)}var uJ=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},dJ=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=uJ(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=uJ(e.offsetParent);return[t/i,n/a]},fJ=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(aU(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=aU(e)&&e.offsetWidth||0,r=aU(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=dJ(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function pJ({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,v.useId)(),c=(0,v.useRef)(null),l=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,v.useContext)(oJ),d=lJ(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,v.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return sW.setup(()=>{let[e,t]=dJ(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),sW.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,S.jsx)(fJ,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:v.cloneElement(e,{ref:d})})}var mJ=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=WI(hJ),d=(0,v.useId)(),f=(0,v.useRef)(),p=(0,v.useRef)(n),m=(0,v.useRef)(r);GI(()=>{p.current=n,m.current=r});let h=!0,g=(0,v.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,S.jsx)(pJ,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,S.jsx)(KI.Provider,{value:g,children:e})};function hJ(){return new Map}function gJ(e=!0){let t=(0,v.useContext)(KI);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var _J=e=>e.key||``;function vJ(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var yJ=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=gJ(o),f=(0,v.useMemo)(()=>vJ(e),[e]),p=o&&!u?[]:f.map(_J),m=(0,v.useRef)(!0),h=WI(()=>new Map),g=(0,v.useRef)(new Set),[_,y]=(0,v.useState)(f),[b,x]=(0,v.useState)(f);GI(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]);let C=(0,v.useRef)();(0,v.useEffect)(()=>()=>{let e=C.current;C.current=void 0,e?.()},[b]),GI(()=>{m.current=!1;for(let e=0;e<b.length;e++){let t=_J(b[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[b,p.length,p.join(`-`)]);let w=[];if(f!==_){let e=[...f],t=0;for(let n of b){let r=p.indexOf(_J(n));r===-1?(e.splice(t++,0,n),w.push(n)):t=r+w.length+1}return w.every(e=>h.get(_J(e)))?e=f:a===`wait`&&(e=w),x(vJ(e)),y(f),null}let{forceRender:T}=(0,v.useContext)(UI);return(0,S.jsx)(S.Fragment,{children:b.map(e=>{let _=_J(e),v=o&&!u?!1:f===b||p.includes(_);return(0,S.jsx)(mJ,{isPresent:v,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(T?.(),y([]),o&&d?.(),C.current=r)},anchorX:s,anchorY:c,children:e},_)})})},bJ=(0,v.createContext)({strict:!1}),xJ={animation:[`variants`,...iK],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},SJ=!1;function CJ(){if(SJ)return;let e={};for(let t in xJ)e[t]={isEnabled:e=>xJ[t].some(t=>!!e[t])};hK(e),SJ=!0}function wJ(){return CJ(),gK()}function TJ(e){let t=wJ();for(let n in e)t[n]={...t[n],...e[n]};hK(t)}var EJ=(0,v.createContext)({});function DJ(e,t){if(oK(e)){let{initial:t,animate:n}=e;return{initial:t===!1||rK(t)?t:void 0,animate:rK(n)?n:void 0}}return e.inherit===!1?{}:t}function OJ(e){let{initial:t,animate:n}=DJ(e,(0,v.useContext)(EJ));return(0,v.useMemo)(()=>({initial:t,animate:n}),[kJ(t),kJ(n)])}function kJ(e){return Array.isArray(e)?e.join(` `):e}var AJ=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jJ(e,t,n){for(let r in t)!NH(t[r])&&!bK(r,n)&&(e[r]=t[r])}function MJ({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=AJ();return xU(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NJ(e,t){let n=e.style||{},r={};return jJ(r,n,e),Object.assign(r,MJ(e,t)),r}function PJ(e,t){let n={},r=NJ(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var FJ=()=>({...AJ(),attrs:{}});function IJ(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=FJ();return EU(n,t,Xq(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return jJ(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var LJ=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.tap.propagate.ignoreStrict.viewport.pinch`.split(`.`));function RJ(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||LJ.has(e)}function zJ(e,t){return e.startsWith(`on`)?!RJ(e):t?.(e)??!RJ(e)}function BJ(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(NH(e[a])||(a===`fx`?e.fx&&(i.fx=``):(zJ(a,r)||n===!0&&RJ(a)||!t&&!RJ(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a])));return i}var VJ=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function HJ(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(VJ.indexOf(e)>-1||/[A-Z]/u.test(e))}function UJ(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??HJ(e)?IJ:PJ)(t,r,i,e),l=BJ(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>NH(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function WJ({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:GJ(n,r,i,e),renderState:t()}}function GJ(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=hW(a[e]);let{initial:o,animate:s}=e,c=oK(e),l=sK(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!nK(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=TH(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var KJ=e=>(t,n)=>{let r=(0,v.useContext)(EJ),i=(0,v.useContext)(KI),a=()=>WJ(e,t,r,i);return n?a():WI(a)},qJ=KJ({scrapeMotionValuesFromProps:xK,createRenderState:AJ}),JJ=KJ({scrapeMotionValuesFromProps:Qq,createRenderState:FJ}),YJ=Symbol.for(`motionComponentSymbol`);function XJ(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var ZJ=(0,v.createContext)({});function QJ(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(EJ),s=(0,v.useContext)(bJ),c=(0,v.useContext)(KI),l=(0,v.useContext)(oJ),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(ZJ);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&i.create(m,n,h),(0,v.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[IH],_=(0,v.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return GI(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),GI(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function $J(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&TJ(r);let a=n?n===`svg`:HJ(e),o=a?JJ:qJ;function s(n,s){let c,l=eY(n);WI(()=>!!$G.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,v.useContext)(oJ),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=OJ(n),m=o(n,d);if(!d&&typeof window<`u`){tY(u,r);let t=nY(u);p.visualElement=QJ(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,S.jsxs)(EJ.Provider,{value:p,children:[c&&p.visualElement?(0,S.jsx)(c,{visualElement:p.visualElement,...u}):null,UJ(e,n,XJ(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[YJ]=e,c}function eY({layoutId:e}){let t=(0,v.useContext)(UI).id;return t&&e!==void 0?t+`-`+e:e}function tY(e,t){(0,v.useContext)(bJ).strict}function nY(e){let{drag:t,layout:n}=wJ();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function rY(e,t){if(typeof Proxy>`u`)return $J;let n=new Map,r=(n,r)=>$J(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,$J(a,void 0,e,t)),n.get(a))})}var iY=(e,t)=>t.isSVG??HJ(e)?new $q(t):new CK(t,{allowProjection:e!==v.Fragment}),aY=class extends Jq{constructor(e){super(e),e.animationState||=rJ(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();nK(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},oY=0,sY={animation:{Feature:aY},exit:{Feature:class extends Jq{constructor(){super(...arguments),this.id=oY++}update(){let{presenceContext:e,animationState:t}=this.node;if(!e||!t)return;let{isPresent:n,onExitComplete:r}=e;if(n===!this.exit)return;if(n){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=EH(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,t.reset(),t.animateChanges()}else t.setActive(`exit`,!1);this.exit=void 0;return}let i=this.exit=t.setActive(`exit`,!0);r&&i.then(()=>{this.exit===i&&(this.exit=!0,r(this.id))})}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id,this.node)),this.update()}unmount(){}}}},cY=class extends Jq{constructor(e){super(e),this.removeGroupControls=tL,this.removeListeners=tL,this.controls=new yq(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tL}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},lY=e=>(t,n)=>{e&&QR.update(()=>e(t,n),!1,!0)},uY=class extends Jq{constructor(){super(...arguments),this.removePointerDownListener=tL}onPointerDown(e){this.session=new GK(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:lY(e),onStart:lY(t),onMove:lY(n),onEnd:(e,t)=>{delete this.session,r&&QR.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=DK(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},dY=!1,fY=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),pY=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},mY=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),dY&&i.root.didUpdate(),i.options.layoutId!==r&&pY(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...fY(this.props),onExitComplete:()=>this.safeToRemove()})),_G.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),pY(o,n)),o.setOptions({...o.options,...fY(this.props)}),dY=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||QR.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),sW.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;dY=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function hY(e){let[t,n]=gJ(),r=(0,v.useContext)(UI);return(0,S.jsx)(mY,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(ZJ),isPresent:t,safeToRemove:n})}var gY={pan:{Feature:uY},drag:{Feature:cY,ProjectionNode:eK,MeasureLayout:hY}};function _Y(e,t,n,r,i){let{props:a}=e,o=`while`+n;!i&&e.animationState&&a[o]&&e.animationState.setActive(o,r===`Start`);let s=a[`on`+n+r];s&&QR.postRender(()=>s(t,TK(t)))}var vY=class extends Jq{mount(){let{current:e}=this.node;e&&(this.unmount=Oq(e,(e,t)=>(_Y(this.node,t,`Hover`,`Start`),e=>_Y(this.node,e,`Hover`,`End`))))}unmount(){}},yY=class extends Jq{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=nL(ZG(this.node.current,`focus`,()=>this.onFocus()),ZG(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function bY(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||_Y(e,t,`Tap`,n,r)}var xY=class extends Jq{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=Bq(e,(e,t)=>(bY(this.node,t,`Start`),{onComplete:(e,{success:t})=>bY(this.node,e,t?``:`Cancel`),onRepeat:()=>bY(this.node,t,``,!0)}),this.options))}update(){let{options:e,node:t}=this,{globalTapTarget:n,propagate:r,tap:i}=t.props;for(let t in e)delete e[t];Object.assign(e,i,{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}},SY=new WeakMap,CY=new WeakMap,wY=e=>{let t=SY.get(e.target);t&&t(e)},TY=e=>{e.forEach(wY)};function EY({root:e,...t}){let n=e||document;CY.has(n)||CY.set(n,{});let r=CY.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(TY,{root:e,...t})),r[i]}function DY(e,t,n){let r=EY(t);return SY.set(e,n),r.observe(e),()=>{SY.delete(e),r.unobserve(e)}}var OY={some:0,all:1},kY=class extends Jq{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:OY[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=DY(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(AY(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function AY({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var jY=rY(Object.assign({},sY,{inView:{Feature:kY},tap:{Feature:xY},focus:{Feature:yY},hover:{Feature:vY}},gY,{layout:{ProjectionNode:eK,MeasureLayout:hY}}),iY);function MY(e,t,n){(0,v.useInsertionEffect)(()=>e.on(t,n),[e,t,n])}function NY(e){let t=WI(()=>uH(e)),{isStatic:n}=(0,v.useContext)(oJ);if(n){let[,n]=(0,v.useState)(e);(0,v.useEffect)(()=>t.on(`change`,n),[])}return t}function PY(e,t){let n=NY(t()),r=()=>n.set(t());return r(),GI(()=>{let t=()=>QR.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),$R(r)}}),n}function FY(e){cH.current=[],e();let t=PY(cH.current,e);return cH.current=void 0,t}function IY(e,t,n){let{isStatic:r}=(0,v.useContext)(oJ),i=()=>NH(e)?e.get():e;if(r)return FY(i);let a=NY(i());return(0,v.useInsertionEffect)(()=>n(a,e,t),[a,JSON.stringify(t)]),a}function LY(e,t={}){return IY(e,t,qq)}function RY(e,t,n,r){if(typeof e==`function`)return FY(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return BY(e,t,n,r);let i=typeof t==`function`?t:Vq(t,n,r),a=Array.isArray(e)?zY(e,i):zY([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function zY(e,t){let n=WI(()=>[]);return PY(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function BY(e,t,n,r){let i=WI(()=>Object.keys(n)),a=WI(()=>({}));for(let o of i)a[o]=RY(e,t,n[o],r);return a}function VY(){!uK.current&&fK();let[e]=(0,v.useState)(lK.current);return e}function HY(e){return typeof e==`object`&&!Array.isArray(e)}function UY(e,t,n,r){return e==null?[]:typeof e==`string`&&HY(t)?uU(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function WY(e,t,n){return e*(t+1)+n*t}function GY(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function KY(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):GY(t,r)??e}function qY(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(JI(e,i),r--)}}function JY(e,t,n,r,i,a){qY(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:jR(i,a,r[o]),easing:wL(n,o)})}function YY(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function XY(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var ZY=`easeInOut`,QY=20;function $Y(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:KY(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=nX(e),{delay:l=0,times:u=Fz(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n;r.mixer||=n.mixer;let x=typeof l==`function`?l(a,s):l,S=c.length,C=rV(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&aX(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=aL(b));let r=az(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Pz(u,T),c.length===1&&c.unshift(null),m&&m<QY){let e=b>0?g/b:0;b=WY(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?fL(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:wL(f,e-1))}YY(u,m,e)}let E=w+b;JY(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(NH(g)){let e=eX(g,c);b(_,v,tX(`default`,e))}else{let e=UY(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=eX(r,c);for(let e in _)b(_[e],rX(v,e),tX(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};m(e,0),a&&(a.duration=p,a.labels=u);let{type:h,...g}=t;return c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(XY);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(rL(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(ZY)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o,u.transition[i]={...g,duration:p,ease:l,times:c,mixer:a.mixer||t.mixer,...n}}}),s}function eX(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function tX(e,t){return t[e]||(t[e]=[]),t[e]}function nX(e){return Array.isArray(e)?e:[e]}function rX(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var iX=e=>typeof e==`number`,aX=e=>e.every(iX);function oX(e,t){return NH(e)||typeof e==`number`||typeof e==`string`&&!HY(t)}function sX(e,t,n,r){let i=[];if(oX(e,t))i.push(lW(e,HY(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=UY(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...aW(r,t,s,tK.get(r))):i.push(...rU(tU(r)??oW,r,t,s))}}return i}function cX(e,t,n,r){let i=[],a=$Y(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=uH(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Az},r),o=t?.reduceMotion??t?.defaultTransition?.reduceMotion;return a.forEach(({keyframes:e,transition:t},n)=>{i.push(...sX(n,e,{...t,reduceMotion:o}))}),i}var lX=0;function uX({repeat:e=0,repeatDelay:t=0,repeatType:n=`loop`,delay:r=0},i,a,o){let s=i+t,c=o===void 0;if(c){let t=Math.max(0,a-r);o=s&&t>0?Math.min(e,Math.ceil(t/s-1e-9)-1):0,a=Math.min(t-o*s,i)}return n!==`loop`&&o%2&&(a=i-a),[o,c?a:r+o*s+a]}function dX(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var fX=(e,t)=>t===void 0?e:{name:e,at:t};function pX(e){e.pause(),e.time=0,e.stop()}var mX=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.motionScope=sU.current,this.isKilled=!1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new iH(n),this.watch()):(this.invalidate(),this.flush())}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+lX++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+lX++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=this.iterationDuration,r=this.time,[i]=uX(this.options,n,r),a=uX(this.options,n,t,i)[1],o=Math.abs(this.speed);return this.speed=a<r?-o:o,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&!this.isKilled&&this.build()}adopt(e){this.group&&=(pX(this.group),void 0),this.isDirty=!1,this.parent=e}build(){let e=this.isWrapped?this.group.iterationDuration:this.totalDuration;this.isDirty=!1,this.isWrapped=!1;let t=this.group,n=0;t&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),t.cancel()):(n=t.animations.length?t.time:0,pX(t)),this.isRebuilding=!1);let{defaultTransition:r,onComplete:i,onUpdate:a,onRepeat:o,onReverseComplete:s,autoplay:c,scope:l,...u}=this.options,d={};l?.reduceMotion!==void 0&&(d.reduceMotion=l.reduceMotion),l?.skipAnimations!==void 0&&(d.skipAnimations=l.skipAnimations),Object.assign(d,u);let f=new Map,p={},m=sU.current;sU.current=this.motionScope;let h;try{h=cX(this.toSequence(f),{defaultTransition:r,...d},l,p)}finally{sU.current=m}let g=p.labels,_=d.duration??p.duration,v=p.duration?_/p.duration:1;if(g.forEach((e,t)=>g.set(t,e*v)),this.markers=[],f.forEach((e,t)=>{e.time=g.get(t),g.delete(t),_=Math.max(_,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=g,this.totalDuration=_,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||a||o){let e=this.clock=uH(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),h.unshift(this.clockAnimation=lW(e,[0,_],{...d,duration:_,ease:`linear`}))}let y=this.group=new iH(h),{delay:b=0,repeat:x=0,repeatDelay:S=0}=this.options,[C,w]=uX(this.options,e,n);n>b&&(n=uX(this.options,_,Math.min(w,_),C)[1]),this.isDone&&n<b+(x+1)*(_+S)-S&&this.newFinished(),this.scrollTimeline?this.detachScroll=y.attachTimeline(this.scrollTimeline):(y.speed=this.playbackSpeed,this.isPaused&&y.pause(),n&&(y.time=n)),this.repeatIndex=this.currentRepeat(),this.prevTime=n||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),fX(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?fX(n,r):r===void 0?n:Array.isArray(n)?dX(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:GY(e,this.labels)??this.time}currentRepeat(){return uX(this.options,this.totalDuration,this.clockAnimation?.time??0)[0]}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat(),o=a>this.repeatIndex?1:-1;for(;a!==this.repeatIndex;){let e=this.speed>0==(i===`loop`||!(this.repeatIndex%2)),n=e?this.totalDuration:0;if(this.cross(t,n))return;this.repeatIndex+=o,r?.(),t=i===`loop`?e?-1:1/0:n}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=uX(this.options,this.totalDuration,e,this.repeatIndex)[1],!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options,r=this.speed<0&&n||t,i=this.resolveFinished;r?.(),i()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e});let{scope:e}=this.options,t=this.motionScope?.add(()=>{this.isKilled=!0,this.stop()});e?.animations.push(this),this.finished.then(()=>{t?.(),e&&JI(e.animations,this)})}};function hX(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e)||e?.sequence)}function gX(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=sU.current?.transition,s={};n!==void 0&&(s.reduceMotion=n),r!==void 0&&(s.skipAnimations=r);let c;if(hX(e)){let r={...s,...i,scope:t};o&&(r.defaultTransition={...o,...r.defaultTransition}),r.reduceMotion=i?.reduceMotion??r.defaultTransition?.reduceMotion??n,c=new mX(e,r)}else{let{onComplete:n,...r}=a||{},l={...s,...o,...r},{onUpdate:u}=r;c=new mX([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...l,onUpdate:void 0}]:[e,i,l]],{...s,onComplete:n,scope:t},sX(e,i,l,t))}return c}return i}var _X=Object.assign(gX(),{addEffect:$H,removeEffect:eU}),vX=jY;function yX({className:e,...t}){return(0,S.jsx)(`kbd`,{"data-slot":`kbd`,className:X(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}var bX={maskImage:`linear-gradient(#000 0 0), linear-gradient(#000 0 0)`,maskClip:`content-box, border-box`,maskComposite:`exclude`};function xX({glareX:e,glareY:t,rimAngle:n,shine:r,rimOpacity:i,glare:a,rim:o,rimWidth:s}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-3xl mix-blend-soft-light`,style:{opacity:r},children:(0,S.jsx)(vX.div,{className:`absolute -inset-1/2`,style:{x:e,y:t,background:`radial-gradient(circle closest-side, rgb(255 255 255 / ${a*.55}) 0%, rgb(255 255 255 / ${a*.12}) 35%, transparent 85%)`}})}),(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-3xl`,style:{opacity:i,padding:s,...bX},children:(0,S.jsx)(vX.div,{className:`absolute top-1/2 left-1/2 aspect-square w-[200%]`,style:{x:`-50%`,y:`-50%`,rotate:n,background:`linear-gradient(0deg, rgb(255 255 255 / ${o}) 16%, rgb(255 255 255 / 0) 45%)`}})})]})}var SX=()=>window.matchMedia(`(prefers-color-scheme: dark)`),CX=e=>{let t=SX();return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)};function wX(e){let t=(0,v.useSyncExternalStore)(CX,()=>SX().matches,()=>!1);return e===`system`?t:e===`dark`}var TX=3,EX=2,DX={text:`Small tools and games,`,highlight:`built with care`};function OX({theme:e,tagline:t=DX,depth:n=0,grain:r=!0,className:i,style:a,selectable:o=!1,pressed:s=!1,children:c}){let l=wX(e.mode),u=n>0,d=e=>u?{transform:`translateZ(${e*n}px)`}:void 0;return(0,S.jsxs)(`div`,{"data-theme":e.name,className:X(`relative flex flex-col rounded-3xl border border-black/[0.07] bg-background p-2 text-foreground select-none`,`shadow-rim`,l&&`dark border-white/10`,u&&`transform-3d`,i),style:{colorScheme:l?`dark`:`light`,...a},children:[u&&Array.from({length:TX},(e,t)=>(0,S.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -inset-px rounded-3xl`,style:{transform:`translateZ(${-(t+1)*EX}px)`,background:`color-mix(in oklab, var(--background), black ${30+t*13}%)`}},t)),r&&(0,S.jsx)(`div`,{"aria-hidden":!0,className:X(`pointer-events-none absolute inset-0 rounded-3xl`,l?`opacity-12 mix-blend-screen`:`opacity-7 mix-blend-multiply`),style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")`}}),(0,S.jsxs)(`div`,{className:X(`relative flex flex-1 flex-col justify-center rounded-inner bg-card p-3.5 text-card-foreground`,`shadow-surface`,u&&`transform-3d`),style:d(10),children:[(0,S.jsxs)(`div`,{className:`text-center`,style:d(6),children:[(0,S.jsx)(`div`,{className:`truncate text-lg leading-tight font-semibold tracking-tight`,children:e.label}),(0,S.jsxs)(`p`,{className:`mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:[t.text,` `,(0,S.jsx)(`span`,{className:`rounded-xs bg-(--selection) px-0.5 whitespace-nowrap text-(--selection-foreground)`,children:t.highlight}),`.`]})]}),(0,S.jsxs)(`div`,{className:`mt-3 flex items-center justify-center gap-1.5 text-3xs font-medium`,style:d(8),children:[(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-success`,children:[(0,S.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),`Live`]}),(0,S.jsx)(`span`,{className:`rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground`,children:`v1.2`})]}),(0,S.jsx)(`div`,{className:`mt-5 flex items-center justify-center`,style:d(14),children:(0,S.jsx)(`span`,{"data-select":!0,className:X(`inline-flex items-center rounded-full bg-primary px-3 py-1 text-xs font-medium text-primary-foreground`,`shadow-glow transition duration-150 ease-out`,o&&!s&&`hover:shadow-glow-lifted hover:brightness-110`,s&&`scale-[0.985] shadow-glow-pressed brightness-95 duration-75`),children:`Select`})})]}),(0,S.jsx)(`div`,{className:`flex items-center justify-between gap-1 px-1.5 pt-2 pb-0.5`,style:d(4),children:[1,2,3,4,5,6,7,8].map(e=>(0,S.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full shadow-swatch`,style:{background:`var(--tint-${e})`}},e))}),c&&(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,style:d(30),children:c})]})}var kX=236,AX=252,jX=168,MX=50,NX=.07,PX=1100,FX=10,IX=24,LX=140,RX=(e,t)=>({type:`spring`,stiffness:e,damping:t}),zX=RX(260,30),BX=RX(380,26),VX=.45,HX=60,UX=100,WX=2,GX=[1.5,3.5,1/0],KX=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]),qX=e=>{if(typeof requestIdleCallback>`u`){let t=window.setTimeout(e,1e3);return()=>clearTimeout(t)}let t=requestIdleCallback(e,{timeout:3e3});return()=>cancelIdleCallback(t)},JX=()=>Math.min(1,window.innerWidth/(kX*2.6)),YX=(e,t)=>`${e.label} ${e.mode}`.toLowerCase().includes(t.trim().toLowerCase()),XX=e=>MX/(360/Math.max(e,IX)),ZX=e=>(e-1)/2>=XX(e),QX=(e,t)=>(e%t+t)%t,$X=(e,t)=>Math.min(t-1,Math.max(0,e)),eZ=(e,t,n)=>{let r=e-t;return ZX(n)?r-n*Math.round(r/n):r},tZ=(e,t)=>ZX(t)?Math.round(e):$X(Math.round(e),t),nZ=(e,t)=>QX(tZ(e,t),t),rZ=.3,iZ=(e,t)=>{if(ZX(t))return e;let n=$X(e,t);return n+(e-n)*rZ};function aZ({tagline:e,open:t,onOpenChange:n,trigger:r,shortcut:i=!0,finalFocus:a,favoriteKey:o=`!`,favoritesOnlyKey:s=`@`}={}){let{theme:c,themes:l,setTheme:u,favorites:d,toggleFavorite:f}=I(),p=l.filter(e=>!e.hidden||e.name===c),m=VY()??!1,[h,g]=(0,v.useState)(!1),_=t??h,[y,b]=(0,v.useState)(0),[x,C]=(0,v.useState)(1),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!1),M=NY(1),N=NY(1/0),P=NY(0),F=(0,v.useRef)(0),R=(0,v.useRef)(null),[z,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(!1),ee=(e,t,n)=>p.filter(r=>YX(r,e)&&(!t||n.includes(r.name))),te=ee(z,H,d),ne=te.length,W=te[y];MY(P,`change`,e=>ne&&b(nZ(e,ne)));let re=(0,v.useRef)(!1),ie=e=>{re.current=!1,F.current=tZ(e,ne),_X(P,F.current,m?{duration:0}:zX)},ae=e=>ie(Math.round(F.current)+e),G=e=>{let t=Math.max(-60,Math.min(HX,e));if(m)return ie(P.get());re.current=!0,F.current=tZ(P.get()+t*VX,ne),_X(P,F.current,{type:`inertia`,velocity:t,power:VX,timeConstant:VX*1e3,modifyTarget:e=>tZ(e,ne),restDelta:.001})},K=(0,v.useEffectEvent)(e=>{!i||_||e.defaultPrevented||e.repeat||e.metaKey||e.ctrlKey||e.altKey||e.key.toLowerCase()!==`t`||L(e.target)||(e.preventDefault(),q(!0))});(0,v.useEffect)(()=>(window.addEventListener(`keydown`,K),()=>window.removeEventListener(`keydown`,K)),[]),(0,v.useEffect)(()=>qX(()=>j(!0)),[]),(0,v.useEffect)(()=>{if(A)return qX(()=>{let e=R.current?.closest(`[hidden]`);e&&(e.style.visibility=`hidden`,e.hidden=!1,e.offsetWidth,e.hidden=!0,e.style.visibility=``)})},[A]),(0,v.useEffect)(()=>{if(!_)return;let e=e=>e.preventDefault();return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)},[_]),(0,v.useEffect)(()=>{if(!_)return;let e=()=>C(JX());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[_]);let q=(e,r)=>{if(!e&&r?.reason===`escape-key`&&z)return ce(``);t===void 0&&g(e),n?.(e)},oe=(0,v.useEffectEvent)(()=>{V(``),U(!1),T(!1),C(JX());let e=Math.max(0,p.findIndex(e=>e.name===c));P.jump(e),b(e),F.current=e,N.jump(GX[0]);let t=e=>requestAnimationFrame(()=>requestAnimationFrame(()=>{N.jump(GX[e]),e<GX.length-1&&t(e+1)}));t(1),m||(M.jump(.4),_X(M,1,BX))});(0,v.useEffect)(()=>{_&&oe()},[_]);let J=e=>{if(!e||e.name===c)return q(!1);let t=document.getElementById(`theme-card-${e.name}`)?.getBoundingClientRect();B(()=>{u(e.name),T(!0),q(!1)},t&&{x:t.left+t.width/2,y:t.top+t.height/2},m)},se=e=>{let t=W?e.indexOf(W):-1,n=Math.max(0,t);P.stop(),P.jump(n),F.current=n,b(n)},ce=e=>{se(ee(e,H,d)),V(e)},le=e=>{se(ee(z,e,d)),U(e)},ue=e=>{H&&se(te.filter(t=>t!==e)),f(e.name)},de=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;if(KX.has(e.key)&&e.target===R.current&&e.preventDefault(),e.key===o||e.key===s){if(e.preventDefault(),e.repeat)return;e.key===s?le(!H):W&&ue(W);return}if(e.key.length===1&&(e.key!==` `||z!==``)&&(e.key!==` `||e.target===R.current))return e.preventDefault(),ce(z+e.key);if(e.key===`Backspace`&&z)return e.preventDefault(),ce(z.slice(0,-1));if(!ne)return;let t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(t)e.preventDefault(),ae(t);else if((e.key===`Enter`||e.key===` `)&&e.target===R.current){if(e.preventDefault(),e.repeat||E)return;if(m)return J(W);D(!0),window.setTimeout(()=>{D(!1),J(W)},LX)}else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=Math.round(F.current),n=ZX(ne)?t-QX(t,ne):0;ie(e.key===`Home`?n:ZX(ne)?n-1:ne-1)}},fe=(0,v.useRef)({last:0,settle:0}),pe=e=>{let t=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(e.deltaMode!==0||Number.isInteger(t)&&Math.abs(t)>=50){if(e.timeStamp-fe.current.last<60)return;fe.current.last=e.timeStamp,ae(Math.sign(t))}else P.stop(),P.set(iZ(P.get()+t/(jX*x),ne)),clearTimeout(fe.current.settle),fe.current.settle=window.setTimeout(()=>ie(P.get()),120)},me=(0,v.useRef)({x:0,y:0,start:0,moved:!1,caught:!1,gesture:`ring`,samples:[]}),he=(0,v.useRef)(null),[ge,_e]=(0,v.useState)(!1);return(0,S.jsxs)(Ty,{open:_,onOpenChange:q,modal:`trap-focus`,onOpenChangeComplete:e=>!e&&T(!1),children:[r===void 0&&(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(Ay,{render:(0,S.jsxs)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Choose a theme`,"aria-keyshortcuts":i?`t`:void 0,className:`relative outline-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0`,children:[(0,S.jsx)(pd,{}),(0,S.jsx)(`span`,{className:`absolute right-1.5 bottom-1.5 size-2 rounded-full bg-primary ring-2 ring-background`})]})})}),(0,S.jsxs)(Kl,{children:[`Theme `,i&&(0,S.jsx)(yX,{children:`T`})]})]}),r&&(0,S.jsx)(Ay,{render:r}),(0,S.jsxs)(sy,{keepMounted:A,children:[(0,S.jsx)(Bv,{className:X(`fixed inset-0 z-50 bg-background/55 duration-200 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,w&&`invisible`)}),(0,S.jsxs)(ay,{initialFocus:R,finalFocus:a,onKeyDown:de,onPointerDown:e=>{if(e.button!==0||e.target.closest(`button`))return;let t=e.pointerType===`touch`,n=e.target.closest(`[data-theme-index]`),r=n!==null&&Math.round(eZ(Number(n.dataset.themeIndex),F.current,ne))===0;if(r&&e.target.closest(`[data-select]`)){k(!0);let e=()=>{k(!1),window.removeEventListener(`pointerup`,e),window.removeEventListener(`pointercancel`,e)};window.addEventListener(`pointerup`,e),window.addEventListener(`pointercancel`,e)}if(me.current.moved=me.current.caught=!1,me.current.gesture=`ring`,ne<2&&!(t&&r))return;let i=re.current&&Math.abs(P.getVelocity())>WX;i&&P.stop(),me.current={x:e.clientX,y:e.clientY,start:P.get(),moved:!1,caught:i,gesture:t?`pending`:`ring`,samples:[{t:e.timeStamp,x:e.clientX}]};let a=e=>{let{current:t}=me,n=e.clientX-t.x;if(t.gesture===`pending`){let i=e.clientY-t.y;if(Math.hypot(n,i)<6)return;t.gesture=Math.abs(i)>Math.abs(n)?r&&!m?`tilt`:`none`:ne<2?`none`:`ring`,k(!1)}if(t.gesture===`tilt`)return he.current?.aim(e.clientX,e.clientY);if(t.gesture===`ring`){for(t.samples.push({t:e.timeStamp,x:e.clientX});t.samples.length>2&&e.timeStamp-t.samples[0].t>UX;)t.samples.shift();!t.moved&&Math.abs(n)<4||(t.moved||(k(!1),P.stop(),t.start=P.get()+n/(jX*x),_e(!0)),t.moved=!0,P.set(iZ(t.start-n/(jX*x),ne)))}},o=e=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),_e(!1),me.current.gesture===`tilt`&&he.current?.release();let{samples:t}=me.current,n=t[0],r=t[t.length-1],i=e.timeStamp-r.t>50||r.t===n.t?0:(r.x-n.x)/(r.t-n.t)*1e3;me.current.moved?G(-i/(jX*x)):me.current.caught&&ie(P.get())};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},onWheel:pe,onClick:e=>{let{moved:t,caught:n,gesture:r}=me.current;if(t||n||r===`tilt`||r===`none`)return;let i=e.target;if(i.closest(`button`))return;let a=i.closest(`[data-theme-index]`);if(!a)return q(!1);let o=Number(a.dataset.themeIndex);if(i.closest(`[data-favorite]`))return ue(te[o]);let s=Math.round(eZ(o,F.current,ne));s===0?J(te[o]):ae(s)},className:X(`fixed inset-0 z-50 flex touch-none flex-col items-center justify-center overflow-hidden text-foreground outline-none select-none duration-200 data-open:duration-75 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,w&&`invisible`),children:[(0,S.jsx)(Vv,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Close`,className:`absolute top-4 right-4`,children:(0,S.jsx)(Fd,{})})}),(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Favorites only`,"aria-pressed":H,"aria-keyshortcuts":s,className:`absolute top-4 right-14`,onMouseDown:e=>e.preventDefault(),onClick:()=>le(!H)}),children:(0,S.jsx)(Dd,{className:X(H&&`fill-current`)})}),(0,S.jsxs)(Kl,{children:[`Favorites only `,(0,S.jsx)(yX,{children:s})]})]}),(0,S.jsxs)(vX.div,{className:`flex w-full flex-col items-center will-change-transform`,style:{scale:M},children:[(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(Ey,{className:`text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Theme`}),(0,S.jsx)(`div`,{"aria-live":`polite`,className:`mt-1 h-9 overflow-hidden`,children:z?(0,S.jsxs)(`div`,{className:`text-3xl font-semibold tracking-tight whitespace-pre`,children:[z,(0,S.jsx)(`span`,{className:`ml-0.5 inline-block h-[0.9em] w-[2px] translate-y-[0.1em] animate-pulse bg-primary`})]}):(0,S.jsx)(vX.div,{initial:!m&&{y:14,opacity:0},animate:{y:0,opacity:1},transition:RX(420,32),className:`text-3xl font-semibold tracking-tight`,children:W?.label},W?.name)}),(0,S.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground tabular-nums`,children:[ne===0?H&&!z?`No favorites yet`:`No theme matches`:z?`${W?.label} · ${y+1} of ${ne}`:`${String(y+1).padStart(2,`0`)} / ${String(ne).padStart(2,`0`)}`,H&&` · favorites`,W?.name===c&&` · current`]})]}),(0,S.jsx)(`div`,{ref:R,tabIndex:0,role:`listbox`,"aria-label":`Themes`,"aria-activedescendant":W?`theme-card-${W.name}`:void 0,className:`relative my-6 w-full outline-none`,style:{height:332*x},children:(0,S.jsx)(`div`,{className:`absolute top-1/2 left-1/2`,style:{transform:`scale(${x})`},children:!w&&te.map((t,n)=>(0,S.jsx)(sZ,{theme:t,index:n,count:ne,position:P,reach:N,isFront:n===y,tilt:n===y&&!ge&&!m,aimRef:he,pressed:n===y&&(E||O),favorite:d.includes(t.name),taglineText:e?.text,taglineHighlight:e?.highlight},t.name))})}),(0,S.jsxs)(`div`,{className:`hidden items-center gap-1.5 text-xs text-muted-foreground sm:flex`,children:[(0,S.jsx)(`span`,{children:`Drag or`}),(0,S.jsx)(yX,{children:`←`}),(0,S.jsx)(yX,{children:`→`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`to browse`}),(0,S.jsx)(yX,{children:`Enter`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`select`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`type to filter`}),(0,S.jsx)(yX,{children:o}),(0,S.jsx)(`span`,{className:`mr-2`,children:`favorite`}),(0,S.jsx)(yX,{children:s}),(0,S.jsx)(`span`,{className:`mr-2`,children:`favorites only`}),(0,S.jsx)(yX,{children:`Esc`}),(0,S.jsx)(`span`,{children:z?`clear`:`close`})]})]})]})]})]})}var oZ=e=>Math.min(1,Math.max(-1,e*2-1)),sZ=(0,v.memo)(function({theme:e,index:t,count:n,position:r,reach:i,isFront:a,tilt:o,aimRef:s,pressed:c,favorite:l,taglineText:u,taglineHighlight:d}){let f=Math.max(n,IX),p=2*Math.PI/f,m=jX*f/(2*Math.PI),h=XX(n),g=RY(r,e=>eZ(t,e,n)),_=RY(g,e=>{let t=e*p,n=1+NX*Math.max(0,1-Math.abs(e));return`translate(-50%, -50%) perspective(${PX}px) translate3d(${m*Math.sin(t)}px, 0, ${m*(Math.cos(t)-1)}px) rotateY(${t*180/Math.PI}deg) scale(${n})`}),y=RY(g,e=>Math.min(1,Math.max(0,h+.5-Math.abs(e)))),b=RY([y,g,i],([e,t,n])=>e<=0||Math.abs(t)>n?`hidden`:`visible`),x=RY(g,e=>100-Math.round(Math.abs(e)*4)),C=RY(g,e=>Math.min(.45,Math.abs(e)*.09)),w=LY(0,{stiffness:320,damping:26}),T=LY(0,{stiffness:320,damping:26}),E=LY(0,{stiffness:200,damping:30}),D=RY(T,e=>-e*FX),O=RY(w,e=>e*FX),k=RY(w,e=>`${e*25}%`),A=RY(T,e=>`${e*25}%`),j=RY([w,T,g],([e,t,n])=>Math.atan2(t,e+n)*180/Math.PI+90),M=RY(E,[0,1],[.25,1]),N=RY(O,e=>-e*1.6),P=RY(D,e=>18+e*.8),F=RY(g,e=>Math.max(0,1-Math.abs(e))),I=RY(F,e=>e<=0?`hidden`:`visible`),L=RY(F,e=>e*.5);(0,v.useEffect)(()=>{o||(w.set(0),T.set(0),E.set(0))},[o,w,T,E]);let R=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!o)return;let e={aim(e,t){let n=R.current?.getBoundingClientRect();n&&(w.set(oZ((e-n.left)/n.width)),T.set(oZ((t-n.top)/n.height)),E.set(1))},release(){w.set(0),T.set(0),E.set(0)}};return s.current=e,()=>{s.current===e&&(s.current=null)}},[o,s,w,T,E]),(0,S.jsxs)(vX.div,{"data-theme-index":t,className:`absolute top-0 left-0 cursor-pointer transform-3d`,style:{width:kX,height:AX,transform:_,opacity:y,visibility:b,zIndex:x},ref:R,onPointerMove:e=>{o&&e.pointerType!==`touch`&&s.current?.aim(e.clientX,e.clientY)},onPointerLeave:e=>{e.pointerType!==`touch`&&(w.set(0),T.set(0),E.set(0))},children:[(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-[8%] top-[12%] bottom-0 rounded-4xl bg-black blur-2xl`,style:{x:N,y:P,z:-40,opacity:L,visibility:I}}),(0,S.jsx)(vX.div,{id:`theme-card-${e.name}`,role:`option`,"aria-selected":a,"aria-label":l?`${e.label}, favorite`:e.label,className:`relative size-full transform-3d`,style:{rotateX:D,rotateY:O},children:(0,S.jsxs)(OX,{theme:e,tagline:u&&d?{text:u,highlight:d}:void 0,depth:1,grain:a,selectable:a,pressed:c,className:`size-full`,children:[(0,S.jsx)(`span`,{"data-favorite":!0,"aria-hidden":!0,className:X(`pointer-events-auto absolute top-1 right-1 flex size-11 items-center justify-center rounded-full transition duration-150 ease-out hover:scale-115`,l?`text-primary`:`text-muted-foreground/60 hover:text-foreground`),children:(0,S.jsx)(Dd,{className:X(`size-4`,l&&`fill-current`)})}),(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`absolute inset-0 rounded-3xl bg-black`,style:{opacity:C}}),(0,S.jsx)(vX.div,{className:`absolute inset-0`,style:{opacity:F,visibility:I},children:(0,S.jsx)(xX,{glareX:k,glareY:A,rimAngle:j,shine:E,rimOpacity:M,glare:.55,rim:.7,rimWidth:.5})})]})})]})}),cZ=Bd(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function lZ({className:e,orientation:t,...n}){return(0,S.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:X(cZ({orientation:t}),e),...n})}function uZ({...e}){return(0,S.jsx)(Xw,{"data-slot":`dropdown-menu`,...e})}function dZ({...e}){return(0,S.jsx)(eT,{"data-slot":`dropdown-menu-trigger`,...e})}function fZ({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,S.jsx)(Rw,{children:(0,S.jsx)(zw,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,S.jsx)(Fw,{"data-slot":`dropdown-menu-content`,className:X(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function pZ({...e}){return(0,S.jsx)(Cw,{"data-slot":`dropdown-menu-group`,...e})}function mZ({className:e,inset:t,...n}){return(0,S.jsx)(ww,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:X(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function hZ({className:e,inset:t,variant:n=`default`,...r}){return(0,S.jsx)(Ew,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:X(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function gZ({className:e,...t}){return(0,S.jsx)(Px,{"data-slot":`dropdown-menu-separator`,className:X(`-mx-1 my-1 h-px bg-border`,e),...t})}function _Z({act:e,open:t,onOpenChange:n,onCloned:r,finalFocus:i}){return(0,S.jsx)(jy,{open:t,onOpenChange:n,children:(0,S.jsxs)(Fy,{className:`sm:max-w-xl`,finalFocus:i,children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`Clone a repo`}),(0,S.jsx)(zy,{children:`Your GitHub repos that aren't cloned yet, newest first. Once cloned, workwork looks for work in it.`})]}),(0,S.jsx)(vZ,{act:e,onCloned:r})]})})}function vZ({act:e,onCloned:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)();if((0,v.useEffect)(()=>{rf.repos().then(r,e=>a(e.message))},[]),i)return(0,S.jsx)(`p`,{className:`text-sm text-destructive`,children:i});if(!n)return(0,S.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(By,{}),` Asking GitHub`]});let u=o.toLowerCase(),d=n.repos.filter(e=>e.name.toLowerCase().includes(u)||e.description.toLowerCase().includes(u)),f=i=>e(async()=>{l(i.name);try{await rf.clone(i.name),t(),r({...n,repos:n.repos.filter(e=>e!==i)})}finally{l(void 0)}});return(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Clones into `,n.root,`/`]}),(0,S.jsx)(Uf,{placeholder:`Search ${n.repos.length} repos`,value:o,onChange:e=>s(e.target.value)}),(0,S.jsxs)(Fx,{className:`max-h-[50svh] overflow-y-auto`,children:[d.map(e=>(0,S.jsx)(Wx,{title:e.name,meta:[e.description,`created ${e.createdAt.slice(0,10)}`].filter(Boolean).join(` · `),children:(0,S.jsxs)(vf,{variant:`outline`,size:`sm`,disabled:c!==void 0,onClick:()=>f(e),children:[c===e.name&&(0,S.jsx)(By,{}),` Clone`]})},e.name)),d.length===0&&(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.repos.length?`No repo matches.`:`Every repo of yours is cloned.`})]})]})}var yZ=Bd(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),bZ=v.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function xZ({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,S.jsx)(nE,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:X(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,S.jsx)(bZ.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function SZ({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=v.useContext(bZ);return(0,S.jsx)($T,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:X(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,yZ({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var CZ=``,wZ={value:`clone-project`,label:`Clone project...`},TZ=100,EZ=e=>`${e.repo} ${e.id}`;function DZ({snapshot:e,act:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(0),o=(0,v.useRef)(null),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(CZ),[p,m]=(0,v.useState)(CZ),[h,g]=(0,v.useState)([`auto`,`skim`,`decide`]),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(TZ),[C,w]=(0,v.useState)(new Map),[T,E]=(0,v.useState)(0),{at:D,count:O,refreshing:k}=e.candidates;(0,v.useEffect)(()=>{let e=!1;return rf.candidates().then(({items:t,repos:n})=>{e||(c(t),u(n))}),()=>{e=!0}},[D,i]),(0,v.useEffect)(()=>{rf.plays().then(e=>w(new Map(e.map(e=>[e.name,e.description]))))},[D]);let A=(0,v.useMemo)(()=>{let t=new Map;for(let n of e.jobs)n.state!==`removed`&&t.set(EZ(n.item),n);return t},[e.jobs]),j={value:CZ,label:`All repos (${s.length})`},M=(0,v.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.repo,(e.get(t.repo)??0)+1);return l.map(t=>({value:t,label:`${Yd(t)} (${e.get(t)??0})`})).sort((e,t)=>e.label.localeCompare(t.label))},[s,l]),N=d===CZ?s:s.filter(e=>e.repo===d),P=new Map;for(let e of N)P.set(e.play,(P.get(e.play)??0)+1);let F=[...P].sort((e,t)=>e[1]-t[1]),I=_.toLowerCase().split(/\s+/).filter(Boolean),L=N.filter(e=>(p===CZ||e.play===p)&&h.includes(e.level)&&I.every(t=>`${Xd(e)} ${e.id} ${e.label}`.toLowerCase().includes(t))),R=(e,n)=>t(()=>rf.queue(e,n)),z=L.filter(e=>!A.has(EZ(e))),B=(0,S.jsxs)(Vd,{children:[(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:k?`Asking workwork`:`No candidates yet`}),(0,S.jsx)(Wd,{children:k?`workwork is looking through every repo under $SRC. That takes a few minutes.`:d===CZ?`Ask workwork for candidates across your repos. It takes a few minutes.`:`There are no candidates for ${Yd(d)}.`})]}),(0,S.jsx)(Gd,{children:(0,S.jsxs)(vf,{variant:`outline`,disabled:k,onClick:()=>t(rf.refreshCandidates),children:[k&&(0,S.jsx)(By,{}),` Ask workwork`]})})]});return(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Uf,{className:`max-w-xs`,placeholder:`Search titles, ids, repos`,value:_,onChange:e=>y(e.target.value)}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,value:h,onValueChange:g,children:[`auto`,`skim`,`decide`].map(e=>(0,S.jsx)(SZ,{value:e,children:e},e))}),(0,S.jsxs)(jE,{items:[j,...M,wZ],value:d,onValueChange:e=>{if(e===wZ.value){r(!0);return}let t=e??CZ;f(t),x(TZ),s.some(e=>e.play===p&&(t===CZ||e.repo===t))||m(CZ)},children:[(0,S.jsx)(PE,{"aria-label":`Repo`,ref:o,children:(0,S.jsx)(NE,{})}),(0,S.jsxs)(FE,{alignItemWithTrigger:!1,children:[(0,S.jsxs)(ME,{children:[(0,S.jsx)(IE,{value:j.value,children:j.label}),M.map(e=>(0,S.jsx)(IE,{value:e.value,children:e.label},e.value))]}),(0,S.jsx)(LE,{}),(0,S.jsx)(ME,{children:(0,S.jsx)(IE,{value:wZ.value,children:wZ.label})})]})]}),(0,S.jsx)(_Z,{act:t,open:n,onOpenChange:r,onCloned:()=>a(e=>e+1),finalFocus:o}),(0,S.jsxs)(`span`,{className:`flex flex-1 items-center justify-end gap-2 text-sm text-muted-foreground`,children:[k?`Asking workwork…`:`${O} candidates${D?`, ${qd(D)}`:``}`,(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh candidates`,disabled:k,onClick:()=>{E(T+1),t(rf.refreshCandidates)}}),children:(0,S.jsx)(yd,{className:T?`refresh-turn`:void 0},T)}),(0,S.jsx)(Kl,{children:k?`Asking workwork, takes a few minutes`:`Ask workwork again`})]})]})]}),N.length===0?B:(0,S.jsxs)(`div`,{className:`flex flex-col gap-6 md:flex-row`,children:[(0,S.jsx)(`nav`,{className:`flex flex-wrap gap-1 md:w-48 md:flex-none md:flex-col`,children:[[CZ,N.length],...F].map(([e,t])=>(0,S.jsxs)(Xl,{disabled:!C.has(e),children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(vf,{variant:p===e?`secondary`:`ghost`,size:`sm`,onClick:()=>{m(e),x(TZ)}}),children:[(0,S.jsx)(`span`,{className:`flex-1 text-left`,children:e||`All plays`}),(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:t})]}),(0,S.jsx)(Kl,{side:`right`,children:C.get(e)})]},e))}),(0,S.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,S.jsxs)(Gx,{title:(0,S.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`span`,{className:`flex-1`,children:[L.length,` matching, `,z.length,` not queued yet`]}),z.length>0&&z.length<=20&&(0,S.jsx)(OZ,{label:`Queue all ${z.length}`,presets:e.settings.presets,onQueue:e=>R(z,e)})]}),children:[(0,S.jsx)(Fx,{children:L.slice(0,b).map(n=>{let r=A.get(EZ(n)),i=(0,S.jsx)(OZ,{label:`Queue`,presets:e.settings.presets,onQueue:e=>R([n],e)});return(0,S.jsx)(Wx,{leading:(0,S.jsx)(lD,{state:dD(r,e.prs)}),title:(0,S.jsx)(pD,{item:n,job:r,play:C.get(n.play),snapshot:e,act:t,actions:!r&&i}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(uD,{state:dD(r,e.prs)}),[n.play,n.level,n.id].join(` · `)]}),children:!r&&i},EZ(n))})}),L.length>b&&(0,S.jsxs)(vf,{variant:`ghost`,onClick:()=>x(b+TZ),children:[`Show `,Math.min(TZ,L.length-b),` more`]})]})})]})]})}function OZ({label:e,presets:t,onQueue:n}){return(0,S.jsxs)(lZ,{children:[(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>n(),children:e}),(0,S.jsxs)(uZ,{children:[(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(dZ,{render:(0,S.jsx)(vf,{variant:`outline`,size:`icon-sm`,"aria-label":`${e} with`})}),children:(0,S.jsx)(Tu,{})}),(0,S.jsxs)(Kl,{children:[e,` for a specific agent or preset`]})]}),(0,S.jsxs)(fZ,{align:`end`,className:`w-auto`,children:[(0,S.jsxs)(pZ,{children:[(0,S.jsx)(mZ,{children:`Agent`}),Kx.map(e=>(0,S.jsx)(hZ,{onClick:()=>n({agent:e}),children:e},e))]}),(0,S.jsx)(gZ,{}),(0,S.jsxs)(pZ,{children:[(0,S.jsx)(mZ,{children:`Preset`}),t.length===0&&(0,S.jsx)(hZ,{disabled:!0,children:`Add presets in Settings`}),t.map((e,t)=>(0,S.jsx)(hZ,{onClick:()=>n(e),children:ef(e)},t))]})]})]})]})}function kZ({snapshot:e,act:t}){let{settings:n,on:r}=e,[i,a]=(0,v.useState)();return(0,S.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,S.jsxs)(Xl,{children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(DE,{orientation:`horizontal`}),children:[(0,S.jsx)(Mx,{id:`auto`,checked:n.auto.on,onCheckedChange:e=>t(()=>rf.saveSettings({...n,auto:{...n.auto,on:e}}))}),(0,S.jsx)(kE,{htmlFor:`auto`,children:`Auto`})]}),(0,S.jsx)(Kl,{children:`Keep the queue topped up from candidates while the factory is on`})]}),(0,S.jsxs)(Xl,{disabled:r,children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`outline`,onClick:e=>{let i={agents:n.agents,limit:n.limit,until:n.until};r?t(rf.turnOff):e.shiftKey?t(()=>rf.turnOn(i)):a(i)}}),children:r?`Turn off`:`Turn on`}),(0,S.jsx)(Kl,{children:`Shift-click to turn on with your defaults`})]}),(0,S.jsx)(jy,{open:i!==void 0,onOpenChange:e=>!e&&a(void 0),children:(0,S.jsxs)(Fy,{children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`Turn the factory on`}),(0,S.jsx)(zy,{children:`For this run only; the defaults are under Settings. Your picks go first, then what auto mode queues.`})]}),i&&(0,S.jsx)(HE,{value:i,onChange:a}),(0,S.jsx)(Ly,{children:(0,S.jsx)(vf,{disabled:!i||Object.keys(i.agents).length===0,onClick:()=>t(async()=>{await rf.turnOn(i),a(void 0)}),children:`Turn on`})})]})})]})}var AZ={communicator:`comm`,builder:`build`,grunt:`grunt`},jZ=e=>e.blocked?MZ[e.blocked]:e.state===`queued`?`working`:void 0,MZ={checkpoint:`waiting for your approval`,paused:`paused`,red:`integration branch red`,asked:`waiting for you`,held:`held by a failure`,review:`merging`},NZ=(e,t)=>e.filter(e=>e.of===t.id&&e.state!==`removed`);function PZ(e,t){return[t,...e].flatMap(e=>[e.added,...e.notes.map(e=>e.at),...e.attempts.map(e=>e.end)]).sort().at(-1)}function FZ({snapshot:e,act:t}){let[n,r]=bx(`goal`,``),i=e.jobs.filter(e=>e.goal&&e.state!==`removed`),a=i.find(e=>e.id===n);return a?(0,S.jsx)(IZ,{goal:a,snapshot:e,act:t,onBack:()=>r(``)}):i.length===0?(0,S.jsx)(Vd,{children:(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:`No goals yet`}),(0,S.jsxs)(Wd,{children:[`A goal is one large task split into a graph of jobs. Start one with`,` `,(0,S.jsx)(`code`,{children:`factory goal new "title" --repo DIR`}),`, or import a plan with`,` `,(0,S.jsx)(`code`,{children:`factory goal import plan.json`}),`.`]})]})}):(0,S.jsx)(Fx,{children:i.map(t=>{let n=NZ(e.jobs,t),i=n.filter(e=>e.state===`done`).length,a=n.reduce((e,t)=>e+t.attempts.length,0),o=t.goal.budget?.attempts;return(0,S.jsx)(Wx,{leading:(0,S.jsx)(lD,{state:t.state}),progress:n.length?i/n.length:0,title:(0,S.jsx)(`button`,{type:`button`,className:`text-left hover:underline`,onClick:()=>r(t.id),children:t.item.title}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(uD,{state:t.state,label:jZ(t)}),(0,S.jsxs)(`span`,{children:[i,`/`,n.length,` done`]}),Ov.map(e=>{let t=n.filter(t=>t.tier===e);return t.length?(0,S.jsxs)(`span`,{children:[AZ[e],` `,t.filter(e=>e.state===`done`).length,`/`,t.length]},e):null}),(0,S.jsxs)(`span`,{children:[a,o?`/${o}`:``,` attempts`]}),(0,S.jsx)(`span`,{children:qd(PZ(n,t))})]}),children:(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open goal`,onClick:()=>r(t.id),children:(0,S.jsx)(Du,{})})},t.id)})})}function IZ({goal:e,snapshot:t,act:n,onBack:r}){let{jobs:i,status:a}=t,o=NZ(i,e),s=e.goal,c=o.filter(e=>e.state===`done`).length,l=o.reduce((e,t)=>e+t.attempts.length,0),u=e.blocked===`red`,d=e.notes.findLast(e=>e.kind===`factory`),f=Mv(e),p=o.flatMap(e=>e.unverified.map(t=>({node:e,need:t}))),m=o.flatMap(e=>e.notes.flatMap((t,n)=>t.kind===`assume`&&!e.notes.some(e=>e.kind===`answer`&&e.re===n)?[{node:e,note:t}]:[]));return(0,S.jsxs)(`div`,{className:`flex flex-col gap-6 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`All goals`,onClick:r,children:(0,S.jsx)(_u,{})}),(0,S.jsx)(`h2`,{className:`font-heading text-lg font-semibold`,children:e.item.title}),(0,S.jsx)(uD,{state:e.state,label:jZ(e)}),(0,S.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.blocked===`paused`?(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`resume`)),children:`Resume`}):e.state!==`done`&&(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`pause`)),children:`Pause`}),e.state!==`done`&&(0,S.jsx)(VZ,{goal:e,act:n}),e.state!==`done`&&(0,S.jsx)(vf,{variant:`ghost`,size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`cancel`)),children:`Cancel goal`})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(Gu,{className:`size-4`}),` goal/`,s.slug]}),(0,S.jsx)(`span`,{className:u?`text-destructive`:``,children:s.gates.length===0?`no goal gates`:`${u?`red`:`green`}: ${s.gates.map(e=>`\`${e}\``).join(`, `)}`}),(0,S.jsxs)(`span`,{children:[c,`/`,o.length,` done`]}),(0,S.jsxs)(`span`,{children:[l,s.budget?` of ${s.budget.attempts}`:``,` attempts`]}),f&&(0,S.jsx)(`a`,{className:`text-primary hover:underline`,href:f,target:`_blank`,rel:`noreferrer`,children:`final PR`})]}),e.blocked===`checkpoint`&&(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md border border-warning/50 bg-warning/10 p-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`flex-1`,children:d?.text??`Waiting for your approval.`}),(0,S.jsx)(vf,{size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`approve`)),children:`Approve`})]}),u&&d&&(0,S.jsxs)(`p`,{className:`rounded-md border border-destructive/40 p-3 text-sm text-destructive`,children:[d.text,`; a fix is queued at the front.`]}),(p.length>0||m.length>0)&&(0,S.jsx)(Gx,{title:`For you to check`,children:(0,S.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:[p.map(({node:e,need:t})=>(0,S.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(cf,{variant:`outline`,children:`unverified`}),(0,S.jsxs)(`span`,{className:`flex-1`,children:[e.item.title,`: `,t]}),(0,S.jsx)(vf,{size:`sm`,variant:`outline`,onClick:()=>n(()=>rf.verify(e.id,t)),children:`Checked`})]},`${e.id} ${t}`)),m.map(({node:e,note:t})=>(0,S.jsx)(BZ,{node:e,question:t.text,assumed:t.assumed??``,act:n},`${e.id} ${t.at}`))]})}),(0,S.jsx)(Gx,{title:`Graph`,children:(0,S.jsx)(LZ,{nodes:o.filter(e=>!e.parent),all:o,snapshot:t,act:n,status:a})})]})}function LZ({nodes:e,all:t,snapshot:n,act:r,status:i}){let[a,o]=(0,v.useState)(),s=Iv(e.filter(e=>!e.branchOf));for(let t of e.filter(e=>e.branchOf))s.set(t.id,s.get(t.branchOf)??0);let c=Lv(t),l=new Set(t.find(e=>e.id===a)?.after??[]),u=[...new Set(s.values())].sort((e,t)=>e-t);return(0,S.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:u.map(a=>(0,S.jsx)(`div`,{className:`flex w-60 shrink-0 flex-col gap-2`,children:e.filter(e=>s.get(e.id)===a).map(e=>{let a=t.filter(t=>t.parent===e.id),s={node:e,snapshot:n,act:r,status:i,onPath:c.has(e.id),dependency:l.has(e.id),onHover:o};return a.length>0?(0,S.jsx)(RZ,{...s,members:a,all:t},e.id):(0,S.jsx)(zZ,{...s},e.id)})},a))})}function RZ({members:e,all:t,...n}){let{node:r,snapshot:i,act:a,status:o}=n,s=e.filter(e=>e.state===`done`).length;return(0,S.jsx)(`div`,{className:`rounded-md border border-dashed p-2`,children:(0,S.jsxs)(JF,{defaultOpen:r.state!==`done`,children:[(0,S.jsxs)(YF,{render:(0,S.jsx)(`button`,{type:`button`,className:`flex w-full items-center gap-2 text-left text-sm font-medium`}),children:[(0,S.jsx)(lD,{state:r.state}),(0,S.jsx)(`span`,{className:`flex-1`,children:r.item.title}),(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s,`/`,e.length]})]}),(0,S.jsx)(XF,{className:`mt-2`,children:(0,S.jsx)(LZ,{nodes:e,all:t,snapshot:i,act:a,status:o})})]})})}function zZ({node:e,snapshot:t,act:n,status:r,onPath:i,dependency:a,onHover:o}){let s=r?.workers.find(t=>t.job===e.id),c=e.notes.findLast(t=>t.kind===`step`&&t.attempt===e.attempts.length+1),l=e.attempts.some(e=>(e.compactions??0)>2);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md border bg-card p-2 text-sm ${a?`ring-2 ring-accent`:i?`border-primary/60`:``}`,onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(void 0),children:[(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(lD,{state:e.state}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere`,children:(0,S.jsx)(pD,{item:e.item,job:e,snapshot:t,act:n,bare:!0})})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[e.tier&&(0,S.jsx)(cf,{variant:`secondary`,children:e.tier}),e.front&&(0,S.jsx)(cf,{variant:`outline`,children:`factory`}),e.blocked&&(0,S.jsx)(`span`,{children:MZ[e.blocked]}),e.attempts.length>0&&(0,S.jsxs)(`span`,{children:[e.attempts.length,` attempt`,e.attempts.length===1?``:`s`]}),l&&(0,S.jsxs)(Xl,{children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(`span`,{className:`flex items-center text-warning`}),children:[(0,S.jsx)(Uu,{className:`size-3.5`}),` heavy`]}),(0,S.jsx)(Kl,{children:`Compacted more than twice; replans split work like this smaller.`})]}),i&&(0,S.jsx)(`span`,{className:`text-primary`,children:`critical path`})]}),s&&(0,S.jsxs)(`div`,{className:`text-xs`,children:[(0,S.jsx)(`span`,{className:`text-primary`,children:s.id}),`, `,Jd(s.since),` min`,s.context?`, ${Math.round(s.context/1e3)}k context`:``,(0,S.jsx)(`div`,{className:`truncate text-muted-foreground`,children:c?`${c.text}${c.of?` (${c.done??0}/${c.of})`:``}`:s.activity??`starting`})]})]})}function BZ({node:e,question:t,assumed:n,act:r}){let[i,a]=(0,v.useState)(``);return(0,S.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(cf,{variant:`outline`,children:`assumed`}),` `,e.item.title,`: assumed`,` `,(0,S.jsx)(`strong`,{children:n}),`, asked `,t]}),(0,S.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),r(()=>rf.answer(e.id,i))},children:[(0,S.jsx)(Uf,{value:i,onChange:e=>a(e.target.value),placeholder:`A different answer queues a change`}),(0,S.jsx)(vf,{type:`submit`,variant:`outline`,size:`sm`,disabled:!i.trim(),children:`Answer`}),(0,S.jsx)(vf,{type:`button`,size:`sm`,onClick:()=>r(()=>rf.answer(e.id,`fine`)),children:`Fine`})]})]})}function VZ({goal:e,act:t}){let[n,r]=(0,v.useState)();return n===void 0?(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>r(``),children:`Replan`}):(0,S.jsxs)(`form`,{className:`flex gap-1`,onSubmit:i=>{i.preventDefault(),t(()=>rf.replan(e.id,n)).then(()=>r(void 0))},children:[(0,S.jsx)(Uf,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),placeholder:`Why replan?`,className:`h-8 w-48`}),(0,S.jsx)(vf,{type:`submit`,size:`sm`,disabled:!n.trim(),children:`Queue`})]})}var HZ={y:14.2,width:3,height:3.4,rx:.6};function UZ({working:e}){return(0,S.jsxs)(`svg`,{viewBox:`0 0 48 48`,width:32,height:32,"aria-hidden":!0,className:e?`logo-working`:void 0,children:[(0,S.jsx)(`rect`,{width:`48`,height:`48`,rx:`10.5`,className:`logo-tile`}),(0,S.jsxs)(`g`,{transform:`translate(6 6) scale(1.5)`,children:[(0,S.jsx)(`g`,{fill:`none`,className:`logo-ink`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,S.jsx)(`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`})}),(0,S.jsx)(`g`,{className:`logo-ink-fill`,children:[6.5,10.5,14.5].map(e=>(0,S.jsx)(`rect`,{className:`logo-window`,x:e,...HZ},e))})]})]})}function WZ({dialog:e,onAnswer:t}){let[n,r]=(0,v.useState)(e.method===`editor`?e.prefill??``:``),i=e.method===`input`||e.method===`editor`;return(0,S.jsx)(jy,{open:!0,onOpenChange:e=>!e&&t({cancelled:!0}),children:(0,S.jsxs)(Fy,{children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:e.title}),e.method===`confirm`&&e.message&&(0,S.jsx)(zy,{children:e.message})]}),e.method===`input`&&(0,S.jsx)(Uf,{autoFocus:!0,value:n,placeholder:e.placeholder,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&t({value:n})}),e.method===`editor`&&(0,S.jsx)(rE,{autoFocus:!0,value:n,onChange:e=>r(e.target.value)}),(0,S.jsxs)(Ly,{children:[e.method===`select`&&e.options.map(e=>(0,S.jsx)(vf,{variant:`outline`,onClick:()=>t({value:e}),children:e},e)),e.method===`confirm`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(vf,{variant:`outline`,onClick:()=>t({confirmed:!1}),children:`No`}),(0,S.jsx)(vf,{autoFocus:!0,onClick:()=>t({confirmed:!0}),children:`Yes`})]}),i&&(0,S.jsx)(vf,{onClick:()=>t({value:n}),children:`Send`})]})]})})}var GZ=[`select`,`confirm`,`input`,`editor`],KZ={messages:[],busy:!1,dialogs:[]};function qZ(e,t){let{messages:n}=e;switch(t.type){case`agent_start`:return{...e,busy:!0,error:void 0};case`agent_settled`:return{...e,busy:!1,dialogs:[]};case`exit`:return{...e,busy:!1,dialogs:[],error:t.error};case`extension_ui_request`:return GZ.includes(t.method)?{...e,dialogs:[...e.dialogs,t]}:e;case`extension_ui_answered`:return{...e,dialogs:e.dialogs.filter(e=>e.id!==t.id)};case`reset`:return KZ;case`message_start`:return{...e,messages:[...n,t.message]};case`message_end`:return{...e,messages:[...n.slice(0,-1),t.message]};case`message_update`:{let r=n.at(-1);if(r?.role!==`assistant`)return e;let i=JZ(r.content,t.assistantMessageEvent);return{...e,messages:[...n.slice(0,-1),{...r,content:i}]}}case`response`:if(!t.success)return{...e,error:t.error};if(t.command===`get_messages`)return{...e,messages:t.data.messages};if(t.command===`get_state`){let n=t.data;return n.model?{...e,model:{name:n.model.name,thinking:n.thinkingLevel}}:e}return e;default:return e}}function JZ(e,t){if(!(`contentIndex`in t))return e;let n=[...e],r=t.contentIndex;if(t.type===`text_start`)n[r]={type:`text`,text:``};else if(t.type===`thinking_start`)n[r]={type:`thinking`};else if(t.type===`text_delta`&&`delta`in t){let e=n[r];n[r]={type:`text`,text:(e?.type===`text`?e.text:``)+t.delta}}else t.type===`toolcall_start`&&`toolName`in t?n[r]={type:`toolCall`,id:t.id,name:t.toolName,arguments:{}}:t.type===`toolcall_end`&&`toolCall`in t&&(n[r]=t.toolCall);return n}function YZ({messages:e,busy:t}){let n=new Map;for(let t of e)t.role===`toolResult`&&n.set(t.toolCallId,t);return e.flatMap((e,r)=>{let i=String(r);if(e.role===`user`)return[{id:i,role:`user`,text:XZ(e.content)}];if(e.role!==`assistant`)return[];let a=e.content.flatMap(e=>e.type===`toolCall`?[ZZ(e,n.get(e.id),t)]:[]),o=e.stopReason===`error`?[e.errorMessage,e.model&&`(${e.provider}/${e.model})`].filter(Boolean).join(` `):void 0;return[{id:i,role:`assistant`,text:[XZ(e.content),o&&`**Error:** ${o}`].filter(Boolean).join(`
|
|
76
|
+
`)[0]:void 0,RI=e=>e>1?` and ${e-1} more`:``,zI=({url:e,urls:t})=>[e,t].flat().filter(e=>typeof e==`string`&&URL.canParse(e)),BI={running:`Running`,complete:`Ran`,error:`Failed to run`},VI={bash:{verbs:BI,subject:({command:e})=>LI(e)},read:{verbs:{running:`Reading`,complete:`Read`,error:`Failed to read`},subject:({path:e})=>LI(e)},edit:{verbs:{running:`Editing`,complete:`Edited`,error:`Failed to edit`},subject:({path:e})=>LI(e)},write:{verbs:{running:`Writing`,complete:`Wrote`,error:`Failed to write`},subject:({path:e})=>LI(e)},grep:{verbs:{running:`Searching for`,complete:`Searched for`,error:`Failed to search for`},subject:({pattern:e})=>LI(e)},find:{verbs:{running:`Finding`,complete:`Found`,error:`Failed to find`},subject:({pattern:e})=>LI(e)},ls:{verbs:{running:`Listing`,complete:`Listed`,error:`Failed to list`},subject:({path:e})=>LI(e)},web_search:{verbs:{running:`Searching`,complete:`Searched`,error:`Failed to search`},subject:({query:e,queries:t})=>{let n=Array.isArray(t)?t:[e];return typeof n[0]==`string`?`for “${n[0]}”${RI(n.length)}`:`the web`},sources:(e,t)=>t?II(t):void 0},fetch_content:{verbs:{running:`Reading`,complete:`Read`,error:`Failed to read`},subject:e=>{let t=zI(e);return t.length?`${new URL(t[0]).hostname}${RI(t.length)}`:`a page`},sources:e=>zI(e).map(e=>({url:e}))}};function HI(e,t,n,r=VI){let i=r[e.name];return i?{label:`${i.verbs[t]} ${i.subject(e.arguments)??``}`.trim(),sources:i.sources?.(e.arguments,n)}:{label:`${BI[t]} ${e.name}`}}var UI=(0,v.createContext)({});function WI(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var GI=typeof window<`u`?v.useLayoutEffect:v.useEffect,KI=(0,v.createContext)(null);function qI(e,t){e.indexOf(t)===-1&&e.push(t)}function JI(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var YI=(e,t,n)=>n>t?t:n<e?e:n,XI={},ZI=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QI=e=>typeof e==`object`&&!!e,$I=e=>/^0[^.\s]+$/u.test(e);function eL(e){let t;return()=>(t===void 0&&(t=e()),t)}var tL=e=>e,nL=(...e)=>e.reduce((e,t)=>n=>t(e(n))),rL=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},iL=class{constructor(){this.subscriptions=[]}add(e){return qI(this.subscriptions,e),()=>this.remove(e)}remove(e){JI(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},aL=e=>e*1e3,oL=e=>e/1e3,sL=(e,t)=>t?1e3/t*e:0,cL=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},lL=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function uL(e,t,n,r){return e===t&&n===r?tL:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=lL(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(lL(s+1e-7,e,n)-i-r)}return lL(s,t,r)}}var dL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fL=e=>t=>1-e(1-t),pL=uL(.33,1.53,.69,.99),mL=fL(pL),hL=dL(mL),gL=e=>e>=1?1:(e*=2)<1?.5*mL(e):.5*(2-2**(-10*(e-1))),_L=e=>1-Math.sin(Math.acos(e)),vL=fL(_L),yL=dL(_L),bL=uL(.42,0,1,1),xL=uL(0,0,.58,1),SL=uL(.42,0,.58,1),CL=e=>Array.isArray(e)&&typeof e[0]!=`number`;function wL(e,t){return CL(e)?e[cL(0,e.length,t)]:e}var TL=e=>Array.isArray(e)&&typeof e[0]==`number`,EL={linear:tL,easeIn:bL,easeInOut:SL,easeOut:xL,circIn:_L,circInOut:yL,circOut:vL,backIn:mL,backInOut:hL,backOut:pL,anticipate:gL},DL=e=>typeof e==`string`,OL=e=>{if(TL(e)){let[t,n,r,i]=e;return uL(t,n,r,i)}return DL(e)?EL[e]:e},kL={delta:0,timestamp:0,isProcessing:!1},AL;function jL(){AL=void 0}var ML={now:()=>(AL===void 0&&ML.set(kL.isProcessing||XI.useManualTiming?kL.timestamp:performance.now()),AL),set:e=>{AL=e,queueMicrotask(jL)}},NL=e=>Math.round(e*1e5)/1e5,PL=e=>t=>typeof t==`string`&&t.startsWith(e),FL=PL(`--`),IL=PL(`var(--`),LL=e=>IL(e)?RL.test(e.split(`/*`)[0].trim()):!1,RL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zL(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var BL={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},VL={...BL,transform:e=>YI(0,1,e)},HL={...BL,default:1},UL=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function WL(e){return e==null}var GL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,KL=(e,t)=>n=>!!(typeof n==`string`&&GL.test(n)&&n.startsWith(e)||t&&!WL(n)&&Object.prototype.hasOwnProperty.call(n,t)),qL=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(UL);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},JL=e=>YI(0,255,e),YL={...BL,transform:e=>Math.round(JL(e))},XL={test:KL(`rgb`,`red`),parse:qL(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+YL.transform(e)+`, `+YL.transform(t)+`, `+YL.transform(n)+`, `+NL(VL.transform(r))+`)`},ZL=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function QL(e){let t=e.length>5?2:1,n=ZL(e,3,t);return{red:parseInt(ZL(e,0,t),16),green:parseInt(ZL(e,1,t),16),blue:parseInt(ZL(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var $L={test:KL(`#`),parse:QL,transform:XL.transform},eR=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tR=eR(`deg`),nR=eR(`%`),rR=eR(`px`),iR=eR(`vh`),aR=eR(`vw`),oR={...nR,parse:e=>nR.parse(e)/100,transform:e=>nR.transform(e*100)},sR={test:KL(`hsl`,`hue`),parse:qL(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+nR.transform(NL(t))+`, `+nR.transform(NL(n))+`, `+NL(VL.transform(r))+`)`},cR={test:e=>XL.test(e)||$L.test(e)||sR.test(e),parse:e=>XL.test(e)?XL.parse(e):sR.test(e)?sR.parse(e):$L.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?XL.transform(e):sR.transform(e),getAnimatableNone:e=>{let t=cR.parse(e);return t.alpha=0,cR.transform(t)}},lR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,uR=new RegExp(UL.source),dR=new RegExp(lR.source,`i`);function fR(e){return isNaN(e)&&typeof e==`string`&&(uR.test(e)||dR.test(e))}var pR=`number`,mR=`color`,hR=`var`,gR=`var(`,_R="${}",vR=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function yR(e){let t=e.toString();return uR.test(t)||dR.test(t)}function bR(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(vR,e=>(cR.test(e)?(r.color.push(a),i.push(mR),n.push(cR.parse(e))):e.startsWith(gR)?(r.var.push(a),i.push(hR),n.push(e)):(r.number.push(a),i.push(pR),n.push(parseFloat(e))),++a,_R)).split(_R),indexes:r,types:i}}function xR(e){return bR(e).values}function SR({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===pR?NL(r[a]):e===mR?cR.transform(r[a]):r[a]}return i}}function CR(e){return SR(bR(e))}var wR=e=>typeof e==`number`?0:cR.test(e)?cR.getAnimatableNone(e):e,TR=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:wR(e);function ER(e){let t=bR(e);return SR(t)(t.values.map((e,n)=>TR(e,t.split[n])))}var DR={test:fR,parse:xR,createTransformer:CR,getAnimatableNone:ER};function OR(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=OR(s,r,e+1/3),a=OR(s,r,e),o=OR(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function AR(e,t){return n=>n>0?t:e}var jR=(e,t,n)=>e+(t-e)*n,MR=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},NR=[$L,XL,sR],PR=e=>NR.find(t=>t.test(e));function FR(e){let t=PR(e);if(!t)return!1;let n=t.parse(e);return t===sR&&(n=kR(n)),n}var IR=(e,t)=>{let n=FR(e),r=FR(t);if(!n||!r)return AR(e,t);let i={...n};return e=>(i.red=MR(n.red,r.red,e),i.green=MR(n.green,r.green,e),i.blue=MR(n.blue,r.blue,e),i.alpha=jR(n.alpha,r.alpha,e),XL.transform(i))},LR=new Set([`none`,`hidden`]);function RR(e,t){return LR.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zR(e,t){return n=>jR(e,t,n)}function BR(e){return typeof e==`number`?zR:typeof e==`string`?LL(e)?AR:cR.test(e)?IR:WR:Array.isArray(e)?VR:typeof e==`object`?cR.test(e)?IR:HR:AR}function VR(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>BR(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function HR(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=BR(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function UR(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var WR=(e,t)=>{let n=bR(e),r=bR(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?LR.has(e)&&!r.values.length||LR.has(t)&&!n.values.length?RR(e,t):nL(VR(UR(n,r),r.values),SR(r)):AR(e,t)},GR=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function KR(e,t){let n=GR.exec(e);if(!n)return;let r=GR.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>NL(jR(a,o,e))+i}function qR(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return jR(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=KR(e,t);if(n)return n}return BR(e)(e,t)}var JR=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function YR(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var XR=40;function ZR(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=JR.reduce((e,t)=>(e[t]=YR(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=XI.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,XR),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:JR.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<JR.length;t++)o[JR[t]].cancel(e)},state:n,steps:o}}var{schedule:QR,cancel:$R,steps:ez}=ZR(typeof requestAnimationFrame<`u`?requestAnimationFrame:tL,!0,kL),tz=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>QR.update(t,e),stop:()=>$R(t),now:()=>kL.isProcessing?kL.timestamp:ML.now()}},nz=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},rz=2e4;function iz(e,t=50,n=rz,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function az(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(iz(o),rz);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:oL(s)}}var oz=100,sz=10,cz=1,lz=800,uz=.3,dz=.3,fz=.01,pz=2,mz=.005,hz=.5,gz=.01,_z=10,vz=.05,yz=e=>e<0?1/Math.max(1+e,vz):Math.max(1-e,vz);function bz(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Cz(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function xz(e,t){return e*Math.sqrt(1-t*t)}var Sz=12;function Cz(e,t,n){let r=n;for(let n=1;n<Sz;n++)r-=e(r)/t(r);return r}var wz=.001;function Tz({duration:e=lz,bounce:t=uz}){let n,r,i=yz(t);e=YI(gz,_z,oL(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=xz(t,i),o=Math.exp(-r);return wz-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=xz(t*t,i);return(-n(t)+wz>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Cz(n,r,a),s=o*bz(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:aL(e)}}var Ez=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Dz(e,t){if(Ez(e,t))return e}function Oz(e){let t=Dz(e.stiffness),n=Dz(e.damping,!0),r=Dz(e.mass),i={...e,stiffness:t??oz,damping:n??sz,mass:r??cz,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=yz(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*bz(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Tz(i)),i.isResolvedFromDuration=!0;(!Ez(i.stiffness)||!Ez(i.damping,!0))&&(i.stiffness=oz,i.damping=sz)}return i}function kz(e=dz,t=uz){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Oz({...n}),f=e=>u?0:-oL(e),p=s/(2*Math.sqrt(o*c)),m=oL(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?fz:pz),g.restDelta=n.restDelta||(e?mz:hz)};_();let v,y,b;if(p<1){let e=xz(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>aL(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=aL(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(iz(S),rz),t=nz(t=>S.next(e*t).value,e,30);return e+`ms `+t}};return S}var Az=Object.assign(kz,{applyToOptions:e=>{let t=az(e,100,kz);return e.ease=t.ease,e.duration=aL(t.duration),e.type=`keyframes`,e}});function jz({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Az({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Mz(e,t,n){let r=[],i=XI.mix||qR,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=nL(Array.isArray(t)?t[o]||tL:t,a)),r.push(a)}return r}function Nz(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Mz(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=rL(e[r],e[r+1],n);return s[r](i)};return n?t=>l(YI(e[0],e[a-1],t)):l}function Pz(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=rL(0,t,r);e.push(jR(n,1,i))}}function Fz(e){let t=[0];return Pz(t,e.length-1),t}function Iz(e,t){return e.map(e=>e*t)}function Lz(e,t){return e.map(()=>t||SL).splice(0,e.length-1)}function Rz({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=CL(r)?r.map(OL):OL(r)||SL,s={done:!1,value:t[0]},c=-1;if(!a){for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(c>=0){c=-2;break}c=e-1}}if(c>=0){let r=n&&n.length===t.length?n:Fz(t),i=r[c]*e,a=r[c+1]*e,l=t[c],u=t[c+1],d=Array.isArray(o)?o[c]:o,f=(XI.mix||qR)(l,u),p=t.length-2;return{calculatedDuration:e,next:t=>(s.value=c&&t<i?f(0):c<p&&(t>=a||!e)?typeof u==`number`?u:f(1):f(d(t>=a||!e?1:t<=i?0:(t-i)/(a-i))),s.done=t>=e,s)}}let l=Nz(Iz(n&&n.length===t.length?n:Fz(t),e),t,{ease:Array.isArray(o)?o:Lz(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=l(t),s.done=t>=e,s)}}var zz=5;function Bz(e,t,n){let r=Math.max(t-zz,0);return sL(n-e(r),t-r)}function Vz(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Bz(t=>e.next(t).value,t,e.next(t).value)}function Hz(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a,o,s=0;for(let t=0;t<e.length;t++){let n=e[t];n!==null&&(s++||(a=n),o=n)}let c=i<0||t&&n!==`loop`&&t%2==1?0:s-1;return!c||r===void 0?c?o:a:r}var Uz={decay:jz,inertia:jz,tween:Rz,keyframes:Rz,spring:Az};function Wz(e){typeof e.type==`string`&&(e.type=Uz[e.type])}var Gz=40,Kz=(e,t)=>t-e>Gz&&!XI.useManualTiming?t:e;function qz(e,t){return{kind:e,animation:t,timestamp:ML.now(),frameTimestamp:kL.timestamp,frameIsProcessing:kL.isProcessing}}function Jz(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...qz(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Yz(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...qz(`layout-animation-start`,e),node:t})}catch{}}var Xz=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Zz=e=>e/100,Qz=e=>Math.round(e*1e4)/1e4,$z=class extends Xz{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options,t=ML.now();e&&e.updatedAt!==t&&this.tick(e.updatedAt=t),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Jz(this,this.options)}initAnimation(){let{options:e}=this;Wz(e);let{type:t=Rz,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Rz;this.mixKeyframes=void 0,s!==Rz&&typeof o[0]!=`number`&&(this.mixKeyframes=nL(Zz,e.mixer?.(o[0],o[1])||qR(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=iz(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Kz(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==jz&&(f.value=Hz(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??Qz((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==jz?Hz(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=YI(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return oL(this.calculatedDuration)}get iterationDuration(){return this.duration+oL(this.options.delay??0)}get time(){return oL(this.currentTime)}set time(e){this.state===`finished`&&this.updateFinished(),e=aL(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Vz(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ML.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=oL(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=tz,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(ML.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},eB=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function tB(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(UL)||[];if(!r)return e;let i=n.replace(r,``),a=+!!eB.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var nB=/\b([a-z-]*)\(.*?\)/gu,rB={...DR,getAnimatableNone:e=>{let t=e.match(nB);return t?t.map(tB).join(` `):e}},iB={...DR,getAnimatableNone:e=>{let t=DR.parse(e);return DR.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},aB={...BL,transform:Math.round},oB={rotate:tR,pathRotation:tR,rotateX:tR,rotateY:tR,rotateZ:tR,scale:HL,scaleX:HL,scaleY:HL,scaleZ:HL,skew:tR,skewX:tR,skewY:tR,distance:rR,translateX:rR,translateY:rR,translateZ:rR,x:rR,y:rR,z:rR,perspective:rR,transformPerspective:rR,opacity:VL,originX:oR,originY:oR,originZ:rR},sB={borderWidth:rR,borderTopWidth:rR,borderRightWidth:rR,borderBottomWidth:rR,borderLeftWidth:rR,borderRadius:rR,borderTopLeftRadius:rR,borderTopRightRadius:rR,borderBottomRightRadius:rR,borderBottomLeftRadius:rR,width:rR,maxWidth:rR,height:rR,maxHeight:rR,top:rR,right:rR,bottom:rR,left:rR,inset:rR,insetBlock:rR,insetBlockStart:rR,insetBlockEnd:rR,insetInline:rR,insetInlineStart:rR,insetInlineEnd:rR,padding:rR,paddingTop:rR,paddingRight:rR,paddingBottom:rR,paddingLeft:rR,paddingBlock:rR,paddingBlockStart:rR,paddingBlockEnd:rR,paddingInline:rR,paddingInlineStart:rR,paddingInlineEnd:rR,margin:rR,marginTop:rR,marginRight:rR,marginBottom:rR,marginLeft:rR,marginBlock:rR,marginBlockStart:rR,marginBlockEnd:rR,marginInline:rR,marginInlineStart:rR,marginInlineEnd:rR,fontSize:rR,backgroundPositionX:rR,backgroundPositionY:rR,...oB,zIndex:aB,fillOpacity:VL,strokeOpacity:VL,numOctaves:aB},cB={...sB,color:cR,backgroundColor:cR,outlineColor:cR,fill:cR,stroke:cR,borderColor:cR,borderTopColor:cR,borderRightColor:cR,borderBottomColor:cR,borderLeftColor:cR,filter:rB,WebkitFilter:rB,mask:iB,WebkitMask:iB},lB=e=>cB[e],uB=new Set([rB,iB]),dB,fB,pB;function mB(e,t){if(e===dB&&t===fB)return pB;let n=lB(e);return uB.has(n)||(n=DR),pB=n.getAnimatableNone?n.getAnimatableNone(t):void 0,dB=e,fB=t,pB}function hB(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var gB=e=>e*180/Math.PI,_B=e=>yB(gB(Math.atan2(e[1],e[0]))),vB={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_B,rotateZ:_B,skewX:e=>gB(Math.atan(e[1])),skewY:e=>gB(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},yB=e=>(e%=360,e<0&&(e+=360),e),bB=_B,xB=e=>Math.hypot(e[0],e[1]),SB=e=>Math.hypot(e[4],e[5]),CB={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xB,scaleY:SB,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(xB(e)+SB(e))/2,rotateX:e=>yB(gB(Math.atan2(e[6],e[5]))),rotateY:e=>yB(gB(Math.atan2(-e[2],e[0]))),rotateZ:bB,rotate:bB,skewX:e=>gB(Math.atan(e[4])),skewY:e=>gB(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wB(e){return+!!e.includes(`scale`)}function TB(e,t){if(!e||e===`none`)return wB(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return wB(t);let r=(n[1]?CB:vB)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var EB=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return TB(n,t)},DB=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],OB=new Set([...DB,`pathRotation`]),kB=e=>e===BL||e===rR,AB=new Set([`x`,`y`,`z`]),jB=DB.filter(e=>!AB.has(e));function MB(e){let t=[];return jB.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var NB=new Set([`bottom`,`right`]);function PB(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var FB=({transform:e})=>TB(e,`x`),IB=({transform:e})=>TB(e,`y`),LB={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>PB(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>PB(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:FB,y:IB,translateX:FB,translateY:IB},RB=new Set,zB=!1,BB=!1,VB=!1;function HB(){if(BB){let e=[],t=new Set,n=new Set;RB.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),NB.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=MB(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}BB=!1,zB=!1,RB.forEach(e=>e.complete(VB)),RB.clear()}function UB(){RB.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BB=!0)})}function WB(){VB=!0,UB(),HB(),VB=!1}function GB(e,t,n){if(typeof e==`string`){if(ZI(e)||$I(e))return parseFloat(e);if(!DR.test(e)&&DR.test(n))return mB(t,n)}return e??void 0}var KB=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(RB.add(this),zB||(zB=!0,QR.read(UB),QR.resolveKeyframes(HB))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=GB(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}hB(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),RB.delete(this)}cancel(){this.state===`scheduled`&&(RB.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},qB=e=>e.startsWith(`--`);function JB(e,t,n){qB(t)?e.style.setProperty(t,n):e.style[t]=n}var YB={};function XB(e,t){let n=eL(e);return()=>YB[t]??n()}var ZB=XB(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),QB=XB(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),$B=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,eV={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:$B([0,.65,.55,1]),circOut:$B([.55,0,1,.45]),backIn:$B([.31,.01,.66,-.59]),backOut:$B([.33,1.53,.69,.99])};function tV(e,t){if(e)return typeof e==`function`?QB()?nz(e,t):`ease-out`:TL(e)?$B(e):Array.isArray(e)?e.map(e=>tV(e,t)||eV.easeOut):eV[e]}function nV(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=tV(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function rV(e){return typeof e==`function`&&`applyToOptions`in e}function iV({type:e,...t}){return rV(e)&&QB()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var aV=class extends Xz{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=iV(e);this.animation=nV(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!i){let e=Hz(r,this.options,o,this.speed);this.updateMotionValue?.(e),JB(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Jz(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return oL(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+oL(e)}get time(){return oL(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aL(e),t&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=this.onFinish=null,e&&ZB()?(this.animation.timeline=e,t?.(this.animation),tL):n(this)}},oV={anticipate:gL,backInOut:hL,circInOut:yL};function sV(e){return e in oV}function cV(e){typeof e.ease==`string`&&sV(e.ease)&&(e.ease=oV[e.ease])}var lV=class extends aV{constructor(e){cV(e),Wz(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(ML.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new $z({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?YI(0,10,a):0,s=this.sample(a);n&&r&&JB(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},uV=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(DR.test(e)||e===`0`)&&!e.startsWith(`url(`));function dV(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fV(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=uV(i,t),s=uV(a,t);return!o||!s?!1:dV(e)||(n===`spring`||rV(n))&&r}function pV(e){e.duration=0,e.type=`keyframes`}var mV=new Set([`opacity`,`clipPath`,`filter`,`transform`]),hV=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function gV(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&hV.test(e[t]))return!0;return!1}var _V=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),vV=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),yV=()=>!XI.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function bV(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(mV.has(n)||vV.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return yV()&&(mV.has(n)||vV.has(n)&&gV(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!_V(e)}var xV=(e,t)=>t&&typeof e==`number`?t.transform(e):e,SV={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},CV=DB.length,wV={},TV=(e,t,n=xV(t,oB[e]))=>(wV[e]||(wV[e]=(SV[e]||e)+`(`))+n+`)`,EV=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function DV(e,t,n){let r=``;for(let i=0;i<CV;i++){let a=DB[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=xV(o,sB[a]));EV(a,o)||(r+=TV(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=TV(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var OV=new WeakMap,kV=200,AV=.001,jV=.1,MV=.001,NV=100,PV=100,FV=new Set([`linear`,`easeIn`,`easeOut`,`easeInOut`]),IV=e=>FV.has(e),LV=new WeakMap,RV=(e,t)=>{let n=LV.get(e);return n?.[0]!==t&&(n=[t,`linear(`+Fz(Array(t+1)).map(t=>Qz(e(t))+` `+Qz(t*100)+`%`)+`)`],LV.set(e,n)),n[1]},zV=(e,t)=>Math.min(kV,Math.max(2,Math.ceil((t-e)/10))),BV=(e,t)=>Math.abs(e-t)<=AV,VV=(e,t)=>e-t,HV=(e,t,n)=>Fz(Array(n+1)).map(n=>jR(e,t,n)),UV=e=>e.motionValue.owner,WV=e=>OV.get(e),GV=({state:e})=>e===`idle`||e===`finished`,KV=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),qV=({name:e,motionValue:t})=>e&&DB.includes(e)&&t?.owner?.current instanceof HTMLElement&&yV()&&QB();function JV(e){let t=UV(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(KV(t,`transform`)||`none`)===`none`&&!KV(t,`pathRotation`)&&!t.projection?.isProjecting()&&!_V(e)}var YV=class{constructor(e,t,n,r){this.element=e,this.update=t,this.makeDriver=n,this.animation=r}get js(){return this.driver||=this.makeDriver(this.update)}now(){return this.driver||this.makeDriver!==tz?this.js.now():kL.isProcessing?kL.timestamp:ML.now()}start(e=!0){let t=WV(this.element);!t||t.isJS?this.js.start(e):t.schedule(!1,!e)}stopJS(){this.driver?.stop()}stop(){this.stopJS();let e=WV(this.element);e&&!e.isFinishing&&e.release(this.animation)}},XV,ZV=class extends $z{constructor(e){let t=UV(e).current,{driver:n=tz}=e,r,i=JV(e);e.driver=e=>new YV(t,e,n,r),super(e),r=this;let a=this.driver;a&&(a.animation=this),this.canAccelerate=i;let{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}offsets(){let{keyframes:e,times:t}=this.options;return t||(this.offsetsOf!==e&&(this.offsetsOf=e,this.cachedOffsets=Fz(e)),this.cachedOffsets)}get group(){return WV(UV(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(ML.now()):void 0}tween(){let{keyframes:e,type:t,repeat:n,delay:r=0}=this.options,i=-1;if(n||t!==Rz||this.holdTime!==null)return;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(i>=0)return;i=t-1}let{ease:a}=this.options;CL(a)&&(a=a[i]);let o=this.offsets(),s=e=>this.startTime+(r+o[e]*this.totalDuration)/this.speed;if(i>=0){let e=TL(a)?$B(a):IV(a)?eV[a]:OL(a);return[s(i),s(i+1),typeof e==`string`||BV(e(0),0)&&BV(e(1),1)?e:void 0]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,type:u}=a,d=(u||Rz)===Rz?this.offsets():[0,1],f=n+o/r,p=[];if(this.holdTime!==null||!(i>0))return p;for(let n=Math.max(0,Math.floor((e-f)*r/i));n<=s;n++){let a=f+n*i/r;if(a>t)break;for(let o of d){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&p.push(s)}}return p}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=ML.now(),t=this.sampleAt(e,!0);this.options.motionValue.setWithVelocity(this.holdTime===null?this.sampleAt(e-10,!0):t,t,10)}play(){this.isStopped||((this.group||eH(UV(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.tick(ML.now())}get time(){return this.isAccelerated()?oL(YI(0,this.totalDuration,this.at(ML.now())-(this.options.delay||0))):super.time}set time(e){(XV??=Object.getOwnPropertyDescriptor($z.prototype,`time`).set).call(this,e)}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}},QV,$V=e=>{QV||queueMicrotask(()=>{let e=QV;QV=void 0,e.forEach(e=>e())}),(QV||=[]).push(e)};function eH(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p,m=1/0,h,g=e=>{for(let t of n)if(t.name===e)return!0},_=(t,n)=>{let o={};for(let s of t===void 0?DB:a){let a=r.get(s),c=t===void 0?KV(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},v=(e,t)=>{let n=``;for(let r in e){let i=e[r];(!t||!EV(r,i))&&(n+=TV(r,i)+` `)}return(t?n.trim():n)||`none`},y=(e,t)=>v(_(e,t)),b=(e=_())=>{t.style.transform=v(e,!0)},x=e=>{e.onfinish=e.oncancel=null,e.cancel()},S=(e=!0)=>{clearTimeout(p),m=1/0,h=void 0,e&&b(),s.forEach(({animation:e})=>x(e)),s=[]},C=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),w=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=ML.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(x(e),s=s.filter(e=>e!==r)),F.schedule(!1)}),e.oncancel=()=>s.includes(r)&&F.demote(),s.push(r)},T=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},E=(e,t,n,r)=>{let i=zV(t,n);if(r.length*4>i)return;let a;for(let r of e){let e=r.numberAt(t),i=(r.numberAt((t+n)/2)-e)/(r.numberAt(n)-e);if(i===i){if(a===void 0)a=i;else if(!BV(i,a))return}}let o=HV(t,n,i).concat(r).sort(VV),s=e=>rL(t,n,e),c,l;for(let n of e){let e=n.numberAt(t),r=o.map(t=>n.numberAt(t)-e),i=r[r.length-1],a=r.some(e=>Math.abs(e)*AV>Math.abs(i))?0:i,s=r.map(e=>a?e/a:e);if(a&&!c)c=s,l=t=>(n.numberAt(t)-e)/a;else if(s.some((e,t)=>!BV(e,a&&c[t])))return}if(!c||c.every((e,t)=>BV(e,s(o[t]))))return`linear`;let u=[],d=(e,t=l(e))=>u.push(Qz(t)+` `+Qz(s(e)*100)+`%`);return c.forEach((e,t)=>{t&&Math.abs(e-c[t-1])>.2&&T(l,o[t-1],o[t]).forEach(e=>d(e)),d(o[t],e)}),`linear(`+u+`)`},D=(e,t,n,r)=>{let i=[t],a=[],o=n,s=t;for(let r of e){let e=r.tween();if(e?.[2]!==`linear`){let[i,c]=r.timing(),[l,u]=e||[t,c?n:i];o=Math.min(o,l),s=Math.max(s,u),a.push(r)}}o=Math.max(t,o),s=Math.min(n,s);let c=(e,t)=>a.every(n=>!(Math.abs(n.numberAt((e+t)/2)-(n.numberAt(e)+n.numberAt(t))/2)>(n.name.startsWith(`scale`)?MV:jV))),l=(t,n,r)=>{if(n-t<1||c(t,n))i.push(n);else if(r<4)l(t,(t+n)/2,r+1),l((t+n)/2,n,r+1);else{for(let r of e)i.push(...T(e=>r.numberAt(e),t,n));i.push(n)}},u=s>o?HV(o,s,Math.ceil((s-o)/100)):[];u.push(n);for(let e of r)u.push(e,Math.min(e+.01,n));let d=t;for(let e of u.sort(VV))e>d&&l(d,e,0),d=e;return i.sort(VV)},O=e=>{let t;for(let n of e){let e=n.tween();if(!e||t&&(Math.abs(e[0]-t[0])>1||Math.abs(e[1]-t[1])>1))return;t=[e[0],e[1],!t||e[2]===t[2]?e[2]:void 0]}return t},k=(e,t,n,r,i={fill:`both`},a)=>{let o=r?[]:e.flatMap(e=>e.boundaries(t,n)),s=r||E(e,t,n,o),c=s?[t,n]:D(e,t,n,o),l=c.map(e=>y(e,a)),u={transform:l};return s||(u.offset=c.map(e=>rL(t,n,e))),l.every(e=>e===l[0])&&(b(_(t,a)),u=null),C(u,{...i,duration:n-t,easing:s||`linear`})},A=e=>{let t=ML.now()+e;t<m&&(clearTimeout(p),m=t,p=setTimeout(()=>{m=1/0,F.schedule(!1)},e))},j=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),!a){if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=DB.filter(t=>{if(r.has(t))return!0;let n=i[t]=KV(e,t);return n!==void 0&&!EV(t,n)}),S(!1);let m=!l&&O(d);try{if(c>t){let e;if(m&&m[1]>t){let[n,r,i]=m;if(n-t>PV)return d.forEach(e=>e.sync()),A(h=n-t-PV),!0;e=typeof i==`string`?i:i?RV(i,zV(n,r)):E(d,n,r,[]),e&&w(k(d,n,r,e,{fill:`both`,endDelay:c-r}),n-t,c-n)}e||w(k(d,t,c),0,c-t),p.forEach(e=>e<c-1&&w(C(null,{duration:e-t}),0,e-t))}if(l){let e=u+Math.floor((c-u)/l)*l;w(k(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||S(),!0},M=(e,t)=>{let r,i=0;for(let t of n){let n=o.get(t);if(!n)return!1;let[a,c,l]=n,u=t.at(e),d=t.timing()[0]===1/0;if(l){if(d&&(u===a||!s.length))continue;return!1}let f=(u-a)/c,p=d?0:t.speed/c;if(r===void 0)r=f,i=p;else if(Math.abs(f-r)>1||p!==i)return!1}if(r===void 0)return!0;if(!s.length){if(h===void 0||t&&i)return!1;if(i){let e=(h-r)/i;if(e<1)return!1;A(e)}return!0}for(let{offset:e,end:n,isDone:i}of s){let a=r-e;if(n<1/0&&(i?a<n-1:a<0&&(t||e<=0)||a>=n))return!1}for(let{animation:t,offset:n,isDone:a}of s){if(a)continue;let o=r-n;i&&t.updatePlaybackRate&&t.playState===`running`&&Math.abs(Number(t.currentTime)-o)<20?t.playbackRate!==i&&t.updatePlaybackRate(i):i?(t.playbackRate!==i&&(t.playbackRate=i),t.startTime=e-o/i):(t.startTime=null,t.currentTime=o)}return!0},N=()=>!n.size&&(u=!0,WV(t)===F&&OV.delete(t),F.isJS||S(),!0),P=()=>{let t=ML.now();if(F.isJS||(F.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=KV(e,n.name),o.has(n)||(c=!0))}),F.isFinishing=!1),l=!1,u||(n.forEach(e=>GV(e)&&n.delete(e)),N()))return;for(let e of n)if(!e.canAccelerate)return F.demote(!0);F.isJS&&(F.isJS=!1,c=!0,n.forEach(e=>e.stopJS()));let r=c,a=d;if(c=d=!1,r||!M(t,a)){if(a){if(t-f<NV)return F.demote();f=t}if(!j(t))return F.demote()}else if(h!==void 0&&!a)return;n.forEach(e=>e.timing()[0]===1/0&&e.sync())},F={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,kL.isProcessing?QR.render(P,!1,!0):$V(P)))},release(e){GV(e)&&n.delete(e),N()||F.schedule(!0)},check(){if(!F.isJS){for(let t in i)if(KV(e,t)!==i[t]&&!g(t))return F.schedule(!0,!0)}},demote(e){if(!(F.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),F.isJS=!0,o=new Map,S(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return OV.set(t,F),F}var tH=class extends Xz{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ML.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||KB;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=ML.now();let u=fV(e,i,a,o);u||((XI.instantAnimations||!s)&&l?.(Hz(e,n,t)),e[0]=e[e.length-1],pV(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&bV(n),p=!f&&qV(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=Kz(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new lV(n)}catch{m=new $z(n)}}else m=p?new ZV(n):new $z(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),WB()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},nH=class{constructor(e){this.stop=()=>{for(let e of this.animations)e.stop()},this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){for(let t of this.animations)t.time=e}get speed(){return this.getAll(`speed`)}set speed(e){for(let t of this.animations)t.speed=e}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return rH(this.animations,`duration`)}get iterationDuration(){return rH(this.animations,`iterationDuration`)}play(){for(let e of this.animations)e.play()}pause(){for(let e of this.animations)e.pause()}cancel(){for(let e of this.animations)e.cancel()}complete(){for(let e of this.animations)e.complete()}};function rH(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var iH=class extends nH{then(e,t){return this.finished.finally(e).then(()=>{})}};function aH(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var oH=30,sH=e=>!isNaN(parseFloat(e)),cH={current:void 0},lH=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ML.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ML.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=sH(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new iL)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new iL,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){QR.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){t&&(this.updatedAt=ML.now(),this.stop()),this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){cH.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=ML.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oH)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,oH);return sL(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return new Promise(t=>this.run(e,t))}run(e,t){this.stop(),this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t?.()}),n||(this.animation=r),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function uH(e,t){return new lH(e,t)}function dH(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function fH(e,t){let n=e?.[t]??e?.default??e;return n===e?n:dH(n,e)}var pH={type:`spring`,stiffness:500,damping:25,restSpeed:10},mH=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hH={type:`keyframes`,duration:.8},gH={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},_H=(e,{keyframes:t})=>t.length>2?hH:OB.has(e)?e.startsWith(`scale`)?mH(t[1]):pH:gH,vH=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function yH(e){for(let t in e)if(!vH.has(t))return!0;return!1}var bH=(e,t,n,r={},i,a)=>o=>{let s=fH(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=aL(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};yH(s)||Object.assign(u,_H(e,u)),u.duration&&=aL(u.duration),u.repeatDelay&&=aL(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pV(u),u.delay===0&&(d=!0)),(XI.instantAnimations||XI.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,pV(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Hz(u.keyframes,s);if(e!==void 0){QR.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new $z(u):new tH(u)},xH=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function SH(e){let t=xH.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function CH(e,t,n=1){let[r,i]=SH(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ZI(e)?parseFloat(e):e}return LL(i)?CH(i,t,n+1):i}function wH(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function TH(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...wH(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function EH(e,t,n){return TH(e.getProps(),t,n,e)}var DH=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,OH=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...DB]),kH=e=>Array.isArray(e);function AH(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,uH(n))}function jH(e){return kH(e)?e[e.length-1]||0:e}function MH(e,t){let{transitionEnd:n={},transition:r={},...i}=EH(e,t)||{};i={...i,...n};for(let t in i)AH(e,t,jH(i[t]))}var NH=e=>!!(e&&e.getVelocity);function PH(e){return!!(NH(e)&&e.add)}function FH(e,t){let n=e.getValue(`willChange`);if(PH(n))return n.add(t);if(!n&&XI.WillChange){let n=new XI.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var IH=`data-framer-appear-id`;function LH(e){return e.props[IH]}var RH=typeof window<`u`;function zH({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function BH(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?dH(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&zH(f,t))continue;let o={delay:n,...fH(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){QR.update(()=>r.set(i));continue}let p=!1;if(RH&&window.MotionHandoffAnimation){let n=LH(e);if(n){let e=window.MotionHandoffAnimation(n,t,QR);e!==null&&(o.startTime=e,p=!0)}}FH(e,t);let m=l??e.shouldReduceMotion;r.run(bH(t,r,i,m&&OH.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>QR.update(()=>{o&&MH(e,o)});d.length?Promise.all(d).then(t):t()}return d}function VH(e,t,n={}){let r=EH(e,t,DH(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?BH(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(VH(e,t,{...n,delay:r+(typeof o==`function`?0:o)+aH(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function HH(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>VH(e,t,n))):typeof t==`string`?VH(e,t,n):Promise.all(BH(e,EH(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var UH={test:e=>e===`auto`,parse:e=>e},WH=e=>t=>t.test(e),GH=[BL,rR,nR,tR,aR,iR,UH],KH=e=>GH.find(WH(e));function qH(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||$I(e)}var JH=new Set([`auto`,`none`,`0`]);function YH(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!JH.has(t)&&yR(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=mB(n,i))}var XH=class extends KB{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(zL(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),LL(r))){let i=CH(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!OH.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=KH(r),o=KH(i);if(zL(r)!==zL(i)&&LB[n])this.needsMeasurement=!0;else if(a!==o){if(kB(a)&&kB(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else LB[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||qH(e[t]))&&n.push(t);n.length&&YH(e,n,t)}measure(){let{element:e,name:t}=this;return LB[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},ZH=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],QH=[];function $H(e){eU(e),QH.unshift(e)}function eU(e){JI(QH,e)}function tU(e){return QH.find(t=>t.test(e))}function nU(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?QR.update(()=>l.set(c)):(l.run(bH(o,l,c,s&&OH.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>QR.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function rU(e,t,n,r,i){let a,o=!1,s=nU(r=>{let s=a?.[r]??e.get(t,r);if(!s){let c;if(!i){let i=n[r];c=iU(i)??e.read(t,r,i)}s=uH(c,{owner:i}),o?e(t,{[r]:s}):(a||={})[r]=s}return s},n,r,i);return o=!0,a&&e(t,a),s}function iU(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function aU(e){return QI(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function oU(e){return QI(e)&&`ownerSVGElement`in e}var sU={};function cU(e){return sU.current?.add(e),e}var lU=e=>sU.current?sU.current.bind(e):e;function uU(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:sU.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var dU=class{constructor(e=QR.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function fU(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new dU(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function pU(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(EV(i,a)||(t+=(t&&` `)+TV(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+TV(`rotate`,i)),t||`none`}var mU=new Set([`originX`,`originY`,`originZ`]),hU=(e,t)=>xV(e.get(t)?.get(),sB[t]),gU=(e,t,n,r)=>{let i,a;if(OB.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>DB.indexOf(e)-DB.indexOf(t)))}t.get(`transform`)||(!aU(e)&&!t.get(`transformBox`)&&gU(e,t,`transformBox`,new lH(`fill-box`)),t.set(`transform`,new lH(`none`),()=>{OV.get(e)?.check(),e.style.transform=pU(t)})),a=t.get(`transform`)}else mU.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new lH(``),()=>{let n=hU(t,`originX`)??`50%`,r=hU(t,`originY`)??`50%`,i=hU(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=qB(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=xV(r.getCurrent(),sB[n])};return t.set(n,r,i,a)},_U=e=>aU(e)||oU(e),vU=(e,t)=>{if(OB.has(t))return EB(e,t);let n=getComputedStyle(e),r=qB(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},yU=fU(gU,{test:_U,read:vU});function bU(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function xU(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(OB.has(e))o=!0;else if(FL(e))i[e]=n;else{let t=xV(n,sB[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=DV(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var SU={offset:`stroke-dashoffset`,array:`stroke-dasharray`},CU={offset:`strokeDashoffset`,array:`strokeDasharray`};function wU(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?SU:CU;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var TU=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function EU(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(xU(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of TU)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&wU(d,i,a,o,!1)}function DU(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var OU=(e,t,n,r,i=n)=>{let a=DU(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=bU(i));let o=sB[n]||sB[i],s=a?()=>{e[i]=xV(r.get(),sB[n])}:()=>{let t=xV(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function kU(e,t,n,r){return QR.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new lH(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var AU=fU((e,t,n,r)=>n.startsWith(`path`)&&!OB.has(n)?kU(e,t,n,r):n.startsWith(`attr`)?OU(e,t,n,r,jU(n)):n===`d`?t.set(n,r,()=>{let t=r.get()?.replace(/path\(|["')]/g,``);t===void 0?e.removeAttribute(n):e.setAttribute(n,t)}):(OB.has(n)||mU.has(n)||qB(n)||n in e.style?gU:OU)(e,t,n,r),{test:oU,read:(e,t)=>OB.has(t)?sB[t]?.default||0:qB(t)||TU.includes(t)?vU(e,t)||e.getAttribute(bU(t))||0:(t=jU(t),e.getAttribute(bU(t))??e.getAttribute(t)??void 0)});function jU(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function MU({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function NU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PU(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function FU(e){return e===void 0||e===1}function IU({scale:e,scaleX:t,scaleY:n}){return!FU(e)||!FU(t)||!FU(n)}var LU=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function RU(e){return IU(e)||BU(e)||zU(e)}function zU(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function BU(e){return VU(e.x)||VU(e.y)}function VU(e){return e&&e!==`0%`}function HU(e,t,n){return n+t*(e-n)}function UU(e,t,n,r,i){return i!==void 0&&(e=HU(e,i,r)),HU(e,n,r)+t}function WU(e,t=0,n=1,r,i){e.min=UU(e.min,t,n,r,i),e.max=UU(e.max,t,n,r,i)}function GU(e,{x:t,y:n}){WU(e.x,t.translate,t.scale,t.originPoint),WU(e.y,n.translate,n.scale,n.originPoint)}var KU=.999999999999,qU=1.0000000000001;function JU(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(YU(e.x,-a.scroll.offset.x),YU(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,GU(e,o)),r&&(r.path?.[s]||r)!==a&&RU(a.latestValues)&&QU(e,a.latestValues,a.layout?.layoutBox));t.x<qU&&t.x>KU&&(t.x=1),t.y<qU&&t.y>KU&&(t.y=1)}function YU(e,t){e.min+=t,e.max+=t}function XU(e,t,n,r,i=.5){WU(e,t,n,jR(e.min,e.max,i),r)}function ZU(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function QU(e,t,n){let r=n??e;XU(e.x,ZU(t.x,r.x),t.scaleX,t.scale,t.originX),XU(e.y,ZU(t.y,r.y),t.scaleY,t.scale,t.originY)}function $U(e,t){return MU(PU(e.getBoundingClientRect(),t))}function eW(e,t,n){let r=$U(e,n),{scroll:i}=t;return i&&(YU(r.x,i.offset.x),YU(r.y,i.offset.y)),r}var tW=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),nW={},rW=e=>oU(e)?AU:yU,iW=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=XH}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return $U(this.current)}getProps(){return nW}};function aW(e,t,n,r){if(sU.current?.track(e),r)return nU(e=>r.getValue(e,null),t,n,r);let i=rW(e);return rU(i,e,t,n,new iW(i,e))}var oW=fU((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>QI(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:sW,cancel:cW}=ZR(queueMicrotask,!1);function lW(e,t,n){let r=NH(e)?e:uH(e);return r.run(bH(``,r,t,n)),r.animation}var uW={},dW={value:null,addProjectionMetrics:null,countProjection:void 0};function fW(e,t){let n=ML.now();e=lU(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&($R(r),e(a-t))};return QR.setup(r,!0),cU(()=>$R(r))}function pW(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function mW(e){return oU(e)&&e.tagName===`svg`}function hW(e){return NH(e)?e.get():e}var gW=e=>typeof e==`number`?e:parseFloat(e),_W=ZH.length,vW=e=>typeof e==`number`||rR.test(e);function yW(e,t,n,r,i,a){i?(e.opacity=jR(0,n.opacity??1,xW(r)),e.opacityExit=jR(t.opacity??1,0,SW(r))):a&&(e.opacity=jR(t.opacity??1,n.opacity??1,r));for(let i=0;i<_W;i++){let a=ZH[i],o=bW(t,a),s=bW(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||vW(o)===vW(s)?(e[a]=Math.max(jR(gW(o),gW(s),r),0),(nR.test(s)||nR.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<LU.length;i++){let a=LU[i];(t[a]||n[a])&&(e[a]=jR(t[a]||0,n[a]||0,r))}}function bW(e,t){return e[t]===void 0?e.borderRadius:e[t]}var xW=CW(0,.5,vL),SW=CW(.5,.95,tL);function CW(e,t,n){return r=>r<e?0:r>t?1:n(rL(e,t,r))}var wW=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},TW=(e,t=300)=>{let n=YI(.25,2,t/300),{stiffness:r,damping:i}=Oz({...e,duration:e.duration&&aL(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function EW(e,t){e.min=t.min,e.max=t.max}function DW(e,t){EW(e.x,t.x),EW(e.y,t.y)}function OW(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var kW=.9999,AW=1.0001,jW=-.01,MW=.01;function NW(e){return e.max-e.min}function PW(e,t,n){return Math.abs(e-t)<=n}function FW(e,t,n,r=.5){e.origin=r,e.originPoint=jR(t.min,t.max,e.origin),e.scale=NW(n)/NW(t),e.translate=jR(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kW&&e.scale<=AW||isNaN(e.scale))&&(e.scale=1),(e.translate>=jW&&e.translate<=MW||isNaN(e.translate))&&(e.translate=0)}function IW(e,t,n,r){FW(e.x,t.x,n.x,r?.originX),FW(e.y,t.y,n.y,r?.originY)}function LW(e,t,n,r=0){e.min=(r?jR(n.min,n.max,r):n.min)+t.min,e.max=e.min+NW(t)}function RW(e,t,n,r){LW(e.x,t.x,n.x,r?.x),LW(e.y,t.y,n.y,r?.y)}function zW(e,t,n,r=0){let i=r?jR(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+NW(t)}function BW(e,t,n,r){zW(e.x,t.x,n.x,r?.x),zW(e.y,t.y,n.y,r?.y)}function VW(e,t,n,r,i){return e-=t,e=HU(e,1/n,r),i!==void 0&&(e=HU(e,1/i,r)),e}function HW(e,t=0,n=1,r=.5,i,a=e,o=e){if(nR.test(t)&&(t=parseFloat(t),t=jR(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=jR(a.min,a.max,r);e===a&&(s-=t),e.min=VW(e.min,t,n,s,i),e.max=VW(e.max,t,n,s,i)}function UW(e,t,[n,r,i],a,o){HW(e,t[n],t[r],t[i],t.scale,a,o)}var WW=[`x`,`scaleX`,`originX`],GW=[`y`,`scaleY`,`originY`];function KW(e,t,n,r){UW(e.x,t,WW,n?.x,r?.x),UW(e.y,t,GW,n?.y,r?.y)}var qW=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JW=qW(`applewebkit/`)&&!qW(`chrome/`)?Math.round:tL;function YW(e){e.min=JW(e.min),e.max=JW(e.max)}function XW(e){YW(e.x),YW(e.y)}var ZW=()=>({translate:0,scale:1,origin:0,originPoint:0}),QW=()=>({x:ZW(),y:ZW()}),$W=()=>({min:0,max:0}),eG=()=>({x:$W(),y:$W()});function tG(e){return e.translate===0&&e.scale===1}function nG(e){return tG(e.x)&&tG(e.y)}function rG(e,t){return e.min===t.min&&e.max===t.max}function iG(e,t){return rG(e.x,t.x)&&rG(e.y,t.y)}function aG(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oG(e,t){return aG(e.x,t.x)&&aG(e.y,t.y)}function sG(e){return NW(e.x)/NW(e.y)}function cG(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var lG=class{constructor(){this.members=[]}add(e){qI(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(JI(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(JI(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function uG(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var dG={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(rR.test(e))e=parseFloat(e);else return e}return`${uG(e,t.target.x)}% ${uG(e,t.target.y)}%`}},fG={borderRadius:Object.assign({},dG,{applyTo:ZH.slice()}),borderTopLeftRadius:dG,borderTopRightRadius:dG,borderBottomLeftRadius:dG,borderBottomRightRadius:dG,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=DR.parse(e);if(i.length>5)return r;let a=DR.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=jR(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function pG(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;(i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `);let s=``;if(n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<LU.length;e++){let t=LU[e],r=n[t];r&&(s+=`${t}(${r}deg) `),!e&&n.pathRotation&&(s+=`rotate(${n.pathRotation}deg) `)}}if(s){(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),r+=s;let n=e.x.scale*t.x,i=e.y.scale*t.y;(n!==1||i!==1)&&(r+=`scale(${n}, ${i})`)}else e.x.scale!==1||e.y.scale!==1?r+=`scale(${e.x.scale}, ${e.y.scale})`:!r&&(t.x!==1||t.y!==1)&&(r=`scale(1, 1)`);return r||`none`}function mG(e){return[e(`x`),e(`y`)]}var hG=(e,t)=>e.depth-t.depth,gG=class{constructor(){this.children=[],this.isDirty=!1}add(e){qI(this.children,e),this.isDirty=!0}remove(e){JI(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hG),this.isDirty=!1,this.children.forEach(e)}},_G={hasAnimatedSinceResize:!0,hasEverUpdated:!1},vG=[`z`,`skew`,`skewZ`],yG=1e3,bG=0;function xG(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var SG=e=>e.instance&&OV.get(e.instance)?.demote()&&e.resetSkewAndRotation();function CG(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=LH(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,QR,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&CG(r)}function wG(e){if(e)return e.options.allowProjection===!1?wG(e.parent):e.projection}function TG({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(uW,{...fG,...uW}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:wG(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&pW(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=bG++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(OG),this.nodes.forEach(zG),this.nodes.forEach(BG),this.nodes.forEach(kG),dW.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new gG)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new iL),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=oU(t)&&!mW(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;QR.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=fW(i,250),_G.hasAnimatedSinceResize&&(_G.hasAnimatedSinceResize=!1,this.nodes.forEach(RG)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||qG,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!oG(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...fH(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||RG(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,$R(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(VG),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CG(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;SG(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,SG(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(MG),this.nodes.forEach(jG);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(NG);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(FG),this.nodes.forEach(IG),this.nodes.forEach(LG),this.nodes.forEach(EG),this.nodes.forEach(DG)):this.nodes.forEach(NG),this.clearAllSnapshots();let e=ML.now();kL.delta=YI(0,1e3/60,e-kL.timestamp),kL.timestamp=e,kL.isProcessing=!0,ez.update.process(kL),ez.preRender.process(kL),ez.render.process(kL),kL.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sW.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AG),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,QR.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){QR.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!NW(this.snapshot.measuredBox.x)&&!NW(this.snapshot.measuredBox.y)&&(this.snapshot=void 0),this.snapshot)){let{visualElement:e}=this.options,t=this.currentAnimation?.state===`running`,n=t&&this.animationEdges;t&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);let r=n&&this.motionValue?.getVelocity()||0,i=[0,1,2,3,4,5].map(t=>(t<4?n&&(this.edgeValues?this.edgeVelocity(t):-n[t]*r/1e3):e?.getValue(t<5?`x`:`y`)?.getVelocity())||0);i.some(Boolean)&&(this.snapshot.velocity=i)}}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=eG(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&SG(this);let t=this.projectionDelta&&!nG(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||RU(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),XW(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return eG();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(XG))){let{scroll:e}=this.root;e&&(YU(t.x,e.offset.x),YU(t.y,e.offset.y))}return t}removeElementScroll(e){let t=eG();if(DW(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&DW(t,e),YU(t.x,i.offset.x),YU(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||eG();DW(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(YU(a.x,-n.scroll.offset.x),YU(a.y,-n.scroll.offset.y)),RU(n.latestValues)&&QU(a,n.latestValues,n.layout?.layoutBox)}return!r&&RU(this.latestValues)&&QU(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=eG();DW(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!RU(n.latestValues))continue;let r;n.instance&&(IU(n.latestValues)&&n.updateSnapshot(),r=eG(),DW(r,n.measurePageBox())),KW(t,n.latestValues,n.snapshot?.layoutBox,r)}return RU(this.latestValues)&&KW(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==kL.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=kL.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=eG(),this.targetWithTransforms=eG()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),RW(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):DW(this.target,this.layout.layoutBox),GU(this.target,this.targetDelta)):DW(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),dW.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||IU(this.parent.latestValues)||BU(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=eG(),this.relativeTargetOrigin=eG(),BW(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),DW(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===kL.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;DW(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;JU(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=eG());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(OW(this.prevProjectionDelta.x,this.projectionDelta.x),OW(this.prevProjectionDelta.y,this.projectionDelta.y)),IW(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!cG(this.projectionDelta.x,this.prevProjectionDelta.x)||!cG(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),dW.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=QW(),this.projectionDelta=QW(),this.projectionDeltaWithTransform=QW()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=QW();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=eG(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(KG));this.animationProgress=0;let f,p=n?.interpolateProjection(e),m=this.layout?.layoutBox,h=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((t,n)=>{let{translate:r,scale:i,originPoint:a}=e[n<2?`x`:`y`];return(t-a)*(i-1)+r});h?.every(isFinite)||(h=void 0),this.animationEdges=h,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;let g=r?.velocity,_=r?.relativeVelocity||g;if(_?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=_),g&&h){let t=g.slice(0,4).map((e,t)=>e+(c?g[4+(t>>1)]:0));t.some(Boolean)&&(this.startVelocity=p?wW(e.x.translate,e.y.translate,{x:(t[0]+t[1])/2,y:(t[2]+t[3])/2}):t)}this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n),l=this.edgeValues;for(let t=0;t<2;t++){let r=t?`y`:`x`;l?HG(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):UG(o[r],e[r],n)}if(r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){BW(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(GG(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=ML.now(),i=(r-this.relativeTime)/1e3;this.relativeTime=r;let a=this.relativeVelocity||=[0,0,0,0];for(let r=0;r<4;r++){let o=r<2?`x`:`y`,s=r&1?`max`:`min`;n&&(e[o][s]+=n[r]*t),f&&i>0&&(a[r]=(e[o][s]-f[o][s])/i)}}f&&iG(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=eG(),DW(f,this.relativeTarget)}c&&(this.animationValues=a,yW(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`);let t=this.isSpringLayout=e.type===`spring`;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&=($R(this.pendingAnimation),void 0),this.pendingAnimation=QR.update(()=>{_G.hasAnimatedSinceResize=!0,this.motionValue||=uH(0),this.motionValue.jump(0,!1);let n=this.startVelocity;this.startVelocity=void 0;let r=e,i=0;if(t){if(e.mass===`auto`){let t=this.layout?.layoutBox;r=TW(e,t&&Math.sqrt(NW(t.x)*NW(t.y)))}let t=this.relativeStart;if((n||t)&&!e.repeat){if(typeof n==`number`)i=n;else{let e=n&&this.animationEdges;r={...r,type:r=>{let i=[r.velocity,...n||[]].map((t,n)=>Az({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(Az({...r,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let o=0,s=[],c={calculatedDuration:null,next:t=>{o=t;let n=i[0].next(t),r=n.done;for(let e=1;e<i.length;e++){let{value:n,done:o}=i[e].next(t);e<a?s[e-1]=n:this.impulse=n/1e3,r&&=o}return e&&(this.edgeValues=s),n.done=r,n}};return c.calculatedDuration=iz(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=lW(this.motionValue,[0,1e3],{...r,velocity:i,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}});this.currentAnimation=a,Yz(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(yG),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&YG(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||eG(),JG(i.x,t.x,e.x),JG(i.y,t.y,e.y)}DW(t,i),QU(t,r),IW(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new lG),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!zU(t))return;let n={};for(let t=0;t<vG.length;t++)xG(vG[t],e,n,this.animationValues);for(let t=0;t<LU.length;t++)xG(LU[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=hW(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=hW(t?.pointerEvents)||``),this.hasProjected&&!RU(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=pG(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in uW){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=uW[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?hW(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(jG),this.root.sharedNodes.clear()}}}function EG(e){e.updateLayout(),PG(e)}function DG(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)mG(e=>{let t=NW(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;EW(r[e],a[e])}else YG(i,t.layoutBox,n)&&mG(t=>{let n=NW(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=QW();IW(c,n,t.layoutBox);let l=QW();IW(l,a?e.applyTransform(r,!0):n,s);let u=!nG(c),d=!1,f=e.getClosestProjectingParent();if((!a||f?.options.layoutRoot&&e.resumeFrom?.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=eG();BW(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=eG();BW(l,n,i.layoutBox,s),a&&o(c,l),oG(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function OG(e){dW.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function kG(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AG(e){e.clearSnapshot()}function jG(e){e.clearMeasurements()}function MG(e){e.isLayoutDirty=!0,e.updateLayout()}function NG(e){e.isLayoutDirty=!1}function PG(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;mG(e=>YU(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function FG(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function IG(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function LG(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function RG(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zG(e){e.resolveTargetDelta()}function BG(e){e.calcProjection()}function VG(e){e.resetSkewAndRotation()}function HG(e,t,n,r,i){let a=n.max-n.min,o=a?Math.max(0,(a+i-r)/a):1,s=e.originPoint=t.originPoint;e.origin=t.origin,e.scale=o,e.translate=n.min+r-(s+(n.min-s)*o)}function UG(e,t,n){e.translate=jR(t.translate,0,n),e.scale=jR(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function WG(e,t,n,r){e.min=jR(t.min,n.min,r),e.max=jR(t.max,n.max,r)}function GG(e,t,n,r){WG(e.x,t.x,n.x,r),WG(e.y,t.y,n.y,r)}function KG(e){return e.animationValues?.opacityExit!==void 0}var qG={duration:.45,ease:[.4,0,.1,1]};function JG(e,t,n){e.max=NW(n)+(e.min=t.min)}function YG(e,t,n){return e===`position`||e===`preserve-aspect`&&!PW(sG(t),sG(n),.2)}function XG(e){return e!==e.root&&e.scroll?.wasRoot}function ZG(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var QG=TG({attachResizeListener:(e,t)=>ZG(e,`resize`,t),measureScroll:tW,checkIsScrollRoot:()=>!0}),$G={current:void 0},eK=TG({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$G.current){let e=new QG({});e.mount(window),e.setOptions({layoutScroll:!0}),$G.current=e}return $G.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),tK=new WeakMap;function nK(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function rK(e){return typeof e==`string`||Array.isArray(e)}var iK=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`whilePinch`,`exit`],aK=[`initial`].concat(iK);function oK(e){if(nK(e.animate))return!0;for(let t=0;t<aK.length;t++)if(rK(e[aK[t]]))return!0;return!1}function sK(e){return!!(oK(e)||e.variants)}function cK(e,t,n){for(let r in t){let i=t[r],a=n[r];if(NH(i))e.addValue(r,i);else if(NH(a))e.addValue(r,uH(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,uH(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var lK={current:null},uK={current:!1},dK=typeof window<`u`;function fK(){if(uK.current=!0,dK){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>lK.current=e.matches;e.addEventListener(`change`,t),t()}else lK.current=!1}}var pK=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],mK={};function hK(e){mK=e}function gK(){return mK}var _K=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=KB,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ML.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,QR.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=oK(t),this.isVariantNode=sK(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&NH(t)&&t.set(c[e])}}mount(e){let t=this.presenceContext;if(this.hasBeenMounted&&t?.isPresent!==!1&&!t?.keepValuesOnRemount)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,tK.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(uK.current||fK(),this.shouldReduceMotion=lK.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),$R(this.notifyUpdate),$R(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&mV.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new aV({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:aL(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=OB.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&QR.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),OV.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in mK){let t=mK[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):eG()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&OV.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<pK.length;t++){let n=pK[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=cK(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=uH(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ZI(n)||$I(n))?n=parseFloat(n):typeof n!=`number`&&!DR.test(n)&&DR.test(t)&&(n=mB(e,t)),this.setBaseTarget(e,NH(n)?n.get():n)),NH(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new iL)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){sW.render(this.render)}},vK=class extends _K{constructor(){super(...arguments),this.KeyframeResolver=XH}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;NH(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function yK(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function bK(e,{layout:t,layoutId:n}){return OB.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!uW[e]||e===`opacity`)}function xK(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(NH(r[t])||i&&NH(i[t])||bK(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function SK(e){return window.getComputedStyle(e)}var CK=class extends vK{constructor(){super(...arguments),this.type=`html`,this.renderInstance=yK}mount(e){super.mount(e)}readValueFromInstance(e,t){if(OB.has(t))return this.projection?.isProjecting?wB(t):EB(e,t);{let n=SK(e),r=(FL(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return $U(e,t)}build(e,t,n){xU(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return xK(e,t,n)}},wK=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function TK(e){return{point:{x:e.pageX,y:e.pageY}}}var EK=e=>t=>wK(t)&&e(t,TK(t));function DK(e,t,n,r){return ZG(e,t,EK(n),r)}var OK=new WeakMap,kK,AK=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:oU(r)&&`getBBox`in r?r.getBBox()[t]:r[n],jK=AK(`inline`,`width`,`offsetWidth`),MK=AK(`block`,`height`,`offsetHeight`);function NK({target:e,borderBoxSize:t}){OK.get(e)?.forEach(n=>{n(e,{get width(){return jK(e,t)},get height(){return MK(e,t)}})})}function PK(e){e.forEach(NK)}function FK(){typeof ResizeObserver<`u`&&(kK=new ResizeObserver(PK))}function IK(e,t){kK||FK();let n=uU(e);return n.forEach(e=>{let n=OK.get(e);n||(n=new Set,OK.set(e,n)),n.add(t),kK?.observe(e)}),()=>{n.forEach(e=>{let n=OK.get(e);n?.delete(t),n?.size||kK?.unobserve(e)})}}var LK=new Set,RK;function zK(){RK=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};LK.forEach(t=>t(e))},window.addEventListener(`resize`,RK)}function BK(e){return LK.add(e),RK||zK(),()=>{LK.delete(e),!LK.size&&typeof RK==`function`&&(window.removeEventListener(`resize`,RK),RK=void 0)}}function VK(e,t){return cU(typeof e==`function`?BK(e):IK(e,t))}var HK=(e,t)=>Math.abs(e-t);function UK(e,t){let n=HK(e.x,t.x),r=HK(e.y,t.y);return Math.sqrt(n**2+r**2)}var WK=new Set([`auto`,`scroll`]),GK=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o,immediate:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=qK(this.lastRawMoveEventInfo,this.transformPagePoint));let e=YK(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=UK(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:ML.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=qK(t,this.transformPagePoint),this.hasPendingMove=!0,QR.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=YK(e.type===`pointercancel`?this.lastMoveEventInfo:qK(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!wK(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=TK(e),l=qK(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:ML.now()}];let{onSessionStart:d}=t;d&&d(e,YK(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=nL(DK(this.contextWindow,`pointermove`,this.handlePointerMove,f),DK(this.contextWindow,`pointerup`,this.handlePointerUp,f),DK(this.contextWindow,`pointercancel`,this.handlePointerUp,f)),o&&this.startScrollTracking(o),s&&(this.handlePointerMove(e,c),this.updatePoint())}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(WK.has(e.overflowX)||WK.has(e.overflowY))&&this.scrollPositions.set(t,KK(t)),t=t.parentElement}this.scrollPositions.set(window,KK(window)),this.removeScrollListeners=nL(ZG(window,`scroll`,this.onElementScroll,{capture:!0}),ZG(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=KK(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),QR.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),$R(this.updatePoint)}},KK=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function qK(e,t){return t?{point:t(e.point)}:e}function JK(e,t){return{x:e.x-t.x,y:e.y-t.y}}function YK({point:e},t){return{point:e,delta:JK(e,ZK(t)),offset:JK(e,XK(t)),velocity:QK(t,.1)}}function XK(e){return e[0]}function ZK(e){return e[e.length-1]}function QK(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=ZK(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>aL(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>aL(t)*2&&(r=e[1]);let a=oL(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var $K=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function eq(e){return $K.has(e.tagName)||e.isContentEditable===!0}var tq=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function nq(e){return tq.has(e.tagName)||e.isContentEditable===!0}var rq={x:!1,y:!1};function iq(){return rq.x||rq.y}function aq(e){return e===`x`||e===`y`?rq[e]?null:(rq[e]=!0,()=>{rq[e]=!1}):rq.x||rq.y?null:(rq.x=rq.y=!0,()=>{rq.x=rq.y=!1})}function oq(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?jR(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?jR(n,e,r.max):Math.min(e,n)),e}function sq(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function cq(e,{top:t,left:n,bottom:r,right:i}){return{x:sq(e.x,n,i),y:sq(e.y,t,r)}}function lq(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function uq(e,t){return{x:lq(e.x,t.x),y:lq(e.y,t.y)}}function dq(e,t){let n=.5,r=NW(e),i=NW(t);return i>r?n=rL(t.min,t.max-r,e.min):r>i&&(n=rL(e.min,e.max-i,t.min)),YI(0,1,n)}function fq(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var pq=.35;function mq(e=pq){return e===!1?e=0:e===!0&&(e=pq),{x:hq(e,`left`,`right`),y:hq(e,`top`,`bottom`)}}function hq(e,t,n){return{min:gq(e,t),max:gq(e,n)}}function gq(e,t){return typeof e==`number`?e:e[t]||0}function _q(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var vq=new WeakMap,yq=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=eG(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,t={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let n=e=>{t.snapToCursor&&this.snapToCursor(e),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=aq(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),mG(e=>{let t=this.getAxisMotionValue(e).get()||0;if(LL(t)&&(t=CH(t,this.visualElement.current)||0),rR.test(t))t=parseFloat(t);else if(nR.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=NW(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&QR.update(()=>a(e,t),!1,!0),FH(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},i=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Tq(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&QR.update(()=>a(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},o=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:s}=this.getProps();this.panSession=new GK(e,{onSessionStart:n,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:o},{...t,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&QR.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!wq(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=oq(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;bq(e)?(!this.constraints||this.scroll!==_q(n))&&(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?cq(r.layoutBox,e):!1,this.elastic=mq(t),i!==this.constraints&&!bq(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&mG(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=fq(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!bq(e))return!1;let n=xq(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=_q(r);let i=eW(n,r.root,this.visualElement.getTransformPagePoint()),a=uq(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(NU(a));this.hasMutatedConstraints=!!e,e&&(a=MU(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&wq(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=mG(e=>{if(!wq(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return FH(this.visualElement,e),n.start(bH(e,n,0,t,this.visualElement,!1))}stopAnimation(){mG(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();mG(e=>{if(!wq(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-jR(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!bq(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};mG(e=>{let t=this.getAxisMotionValue(e).get();i[e]=dq({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),mG(t=>{let n=this.getAxisMotionValue(t);if(!wq(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(jR(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;vq.set(this.visualElement,this);let e=this.visualElement.current,t=DK(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&nq(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=bq(t)&&xq(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Cq(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),QR.read(r);let o=ZG(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(mG(t=>{if(!wq(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=pq,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function bq(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var xq=e=>`current`in e?e.current:e;function Sq(e){let t=!0;return()=>{t?t=!1:e()}}function Cq(e,t,n){let r=VK(e,Sq(n)),i=VK(t,Sq(n));return()=>{r(),i()}}function wq(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tq(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Eq(e,t){let n=uU(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},cU(()=>r.abort())]}function Dq(e){return!(e.pointerType===`touch`||iq())}function Oq(e,t,n={}){t=lU(t);let[r,i,a]=Eq(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Dq(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var kq=(e,t)=>t?e===t||kq(e,t.parentElement):!1,Aq=new WeakSet;function jq(e){return t=>{t.key===`Enter`&&e(t)}}function Mq(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Nq=(e,t)=>{let n=!1,r=jq(()=>{n||Aq.has(e)||(n=!0,Mq(e,`down`))}),i=jq(()=>{n&&(n=!1,Mq(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&Mq(e,`cancel`)},{...t,once:!0})};function Pq(e){return wK(e)&&!iq()}var Fq=new WeakSet,Iq=100,Lq=8,Rq=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,zq=e=>e.preventDefault();function Bq(e,t,n={}){t=lU(t);let[r,i,a]=Eq(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!Pq(e)||Fq.has(e))return;n.stopPropagation&&Fq.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=ML.now(),d=aL(c),f=aL(s),p=o.get(r);p?.expire(Rq(p.event,e,Iq))?p=void 0:p&&($R(p.expire),o.delete(r));let m=p?p.count+1:1,h=m>=a,g=h&&(c||l),_=!c,v=0,y;if(Aq.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=aL(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return $R(w);let e=Math.min(1-(S-ML.now())/x,1);C&&e<1&&(e=0),C=!1,y.onHold?.(e),!(e<1)&&(_?y.onRepeat?.(++v):(_=!0,y.onActive?.()),l?(C=!0,S+=x=b):$R(w))},T={...i,capture:!0},E=(t,n)=>{if(wK(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,zq),$R(w),Aq.delete(r),iq()&&(n=!1),n&&!h){let n=ML.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||ML.now()-n>f)return $R(a),o.delete(r),s||y.onComplete?.(t,{success:!1}),!0};o.set(r,{count:m,event:e,handlers:y,expire:a}),QR.update(a,!0)}else y.onComplete?.(t,{success:n&&_})}},D=e=>{E(e,r===window||r===document||n.useGlobalTarget||kq(r,e.target))},O=e=>{E(e,!1)},k=t=>{wK(t)&&((l||!_)&&Rq(e,t,Lq)||a>1&&iq())&&O(t)};window.addEventListener(`pointerup`,D,T),window.addEventListener(`pointercancel`,O,T),(g||a>1)&&window.addEventListener(`pointermove`,k,T),g&&(QR.update(w,!0),r.addEventListener(`contextmenu`,zq,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),aU(e)&&(e.addEventListener(`focus`,()=>Nq(e,i),i),!eq(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Vq(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Nz(i,a,o);return t?s(r):s}var Hq=new Set,Uq=({timestamp:e})=>{Hq.forEach(t=>t.tick(e))},Wq=class extends Xz{constructor(e){super(),this.state=`idle`,this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.factory=e.type,this.generator=this.factory(e);let{driver:t}=e;t&&(this.driver=t(e=>this.tick(e))),this.startTime=this.now(),this.state=`running`,this.driver?this.driver.start():(Hq.size||QR.update(Uq,!0),Hq.add(this))}setTarget(e,t){this.nextTarget=e,this.nextVelocity=t,this.hasNextTarget=!0}retarget(e,t){let{options:n,generator:r}=this;n.keyframes=e,n.velocity=t,this.startTime=this.now(),this.currentTime=0,r.retarget?r.retarget(e,t):this.generator=this.factory(n)}tick(e){let{options:t,hasNextTarget:n}=this,{delay:r=0,onUpdate:i,onPlay:a}=t;this.started||(this.startTime=Kz(this.startTime,e));let o=Math.round(e-this.startTime)-r,s=this.currentTime=Math.max(0,o),c=this.generator.next(s),l=o<0?t.keyframes[0]:c.value;if(n){this.hasNextTarget=!1;let{keyframes:e}=t;e[0]=l,e[1]=this.nextTarget,this.retarget(e,this.nextVelocity??this.getGeneratorVelocity())}(n||!this.started)&&(this.started=!0,a?.()),this.state===`running`&&(i?.(l),c.done&&o>=0&&!n&&!this.hasNextTarget&&this.state===`running`&&(this.notifyFinished(),this.teardown(),this.state=`finished`,t.onComplete?.()))}getGeneratorVelocity(){return Vz(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():ML.now()}teardown(){this.state=`idle`,this.driver?this.driver.stop():(Hq.delete(this),Hq.size||$R(Uq))}};function Gq(e,t,n){let r=e.get(),i=null,a,o=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,s=e=>a(o?e+o:e),c=()=>e.events.animationStart?.notify(),l=()=>{i&&=(i.stop(),null),e.animation=void 0};if(e.attach((t,r)=>{a=r;let o=gW(t);if(i?.state===`running`){i.setTarget(o,n.velocity);return}let u=gW(e.get()),d=i?i.getGeneratorVelocity():e.getVelocity();if(l(),u===o)return;let f=i=new Wq({keyframes:[u,o],velocity:d,restDelta:.001,restSpeed:.01,...n,onUpdate:s,onPlay:c});e.animation=f,f.then(()=>{i===f&&(i=null,e.animation=void 0,e.events.animationComplete?.notify())})},l),NH(t)){let r=n.skipInitialAnimation===!0,i=t=>{r?(r=!1,e.jump(Kq(t,o),!1)):e.set(Kq(t,o))},a=t.on(`change`,i),s=t.get();gW(s)-gW(e.get())&&i(s);let c=e.on(`destroy`,a);return()=>{a(),c(),l()}}return l}function Kq(e,t){return t?e+t:e}function qq(e,t,n){return Gq(e,t,{...n,type:Az})}var Jq=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},Yq=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Xq=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Zq(e,t,n,r){yK(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Yq.has(n)?n:bU(n),t.attrs[n])}function Qq(e,t,n){let r=xK(e,t,n);for(let n in e)if(n!==`children`&&(NH(e[n])||NH(t[n]))){let t=DB.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var $q=class extends vK{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=eG}getBaseTargetFromProps(e,t){return OB.has(t)?super.getBaseTargetFromProps(e,t)??wB(t):e[t]}getDefaultValue(e){return OB.has(e)?this.latestValues[e]??wB(e):void 0}readValueFromInstance(e,t){if(OB.has(t)){let e=lB(t);return e&&e.default||0}if(TU.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Yq.has(t)?t:bU(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qq(e,t,n)}build(e,t,n){EU(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Zq(e,t,n,r)}mount(e){this.isSVGTag=Xq(e.tagName),super.mount(e)}};function eJ(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var tJ=[...iK].reverse(),nJ=e=>e?.out===!0?e:e?.out;function rJ(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>HH(e,t,n))),n=aJ(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&EH(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&nJ(f(l??(g&&g.props.initial))?.transition);if(tJ.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?rK(f)||f===!1?f:void 0:l,y=rK(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||nK(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=iJ(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=EH(e,n,DH(e,t))||{};E={...E,...a,...i},D=nJ(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!eJ(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=EH(s,n)?.transition?.delayChildren;r.delay=aH(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!NH(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=aJ(),i=!0}}}function iJ(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!eJ(t,e):!1}function aJ(){let e={};for(let t of iK)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var oJ=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function sJ(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function cJ(...e){return t=>{let n=!1,r=e.map(e=>{let r=sJ(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():sJ(e[t],null)}}}}function lJ(...e){return v.useCallback(cJ(...e),e)}var uJ=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},dJ=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=uJ(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=uJ(e.offsetParent);return[t/i,n/a]},fJ=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(aU(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=aU(e)&&e.offsetWidth||0,r=aU(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=dJ(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function pJ({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,v.useId)(),c=(0,v.useRef)(null),l=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,v.useContext)(oJ),d=lJ(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,v.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return sW.setup(()=>{let[e,t]=dJ(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),sW.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,S.jsx)(fJ,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:v.cloneElement(e,{ref:d})})}var mJ=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=WI(hJ),d=(0,v.useId)(),f=(0,v.useRef)(),p=(0,v.useRef)(n),m=(0,v.useRef)(r);GI(()=>{p.current=n,m.current=r});let h=!0,g=(0,v.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,S.jsx)(pJ,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,S.jsx)(KI.Provider,{value:g,children:e})};function hJ(){return new Map}function gJ(e=!0){let t=(0,v.useContext)(KI);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var _J=e=>e.key||``;function vJ(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var yJ=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=gJ(o),f=(0,v.useMemo)(()=>vJ(e),[e]),p=o&&!u?[]:f.map(_J),m=(0,v.useRef)(!0),h=WI(()=>new Map),g=(0,v.useRef)(new Set),[_,y]=(0,v.useState)(f),[b,x]=(0,v.useState)(f);GI(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]);let C=(0,v.useRef)();(0,v.useEffect)(()=>()=>{let e=C.current;C.current=void 0,e?.()},[b]),GI(()=>{m.current=!1;for(let e=0;e<b.length;e++){let t=_J(b[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[b,p.length,p.join(`-`)]);let w=[];if(f!==_){let e=[...f],t=0;for(let n of b){let r=p.indexOf(_J(n));r===-1?(e.splice(t++,0,n),w.push(n)):t=r+w.length+1}return w.every(e=>h.get(_J(e)))?e=f:a===`wait`&&(e=w),x(vJ(e)),y(f),null}let{forceRender:T}=(0,v.useContext)(UI);return(0,S.jsx)(S.Fragment,{children:b.map(e=>{let _=_J(e),v=o&&!u?!1:f===b||p.includes(_);return(0,S.jsx)(mJ,{isPresent:v,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(T?.(),y([]),o&&d?.(),C.current=r)},anchorX:s,anchorY:c,children:e},_)})})},bJ=(0,v.createContext)({strict:!1}),xJ={animation:[`variants`,...iK],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},SJ=!1;function CJ(){if(SJ)return;let e={};for(let t in xJ)e[t]={isEnabled:e=>xJ[t].some(t=>!!e[t])};hK(e),SJ=!0}function wJ(){return CJ(),gK()}function TJ(e){let t=wJ();for(let n in e)t[n]={...t[n],...e[n]};hK(t)}var EJ=(0,v.createContext)({});function DJ(e,t){if(oK(e)){let{initial:t,animate:n}=e;return{initial:t===!1||rK(t)?t:void 0,animate:rK(n)?n:void 0}}return e.inherit===!1?{}:t}function OJ(e){let{initial:t,animate:n}=DJ(e,(0,v.useContext)(EJ));return(0,v.useMemo)(()=>({initial:t,animate:n}),[kJ(t),kJ(n)])}function kJ(e){return Array.isArray(e)?e.join(` `):e}var AJ=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jJ(e,t,n){for(let r in t)!NH(t[r])&&!bK(r,n)&&(e[r]=t[r])}function MJ({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=AJ();return xU(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NJ(e,t){let n=e.style||{},r={};return jJ(r,n,e),Object.assign(r,MJ(e,t)),r}function PJ(e,t){let n={},r=NJ(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var FJ=()=>({...AJ(),attrs:{}});function IJ(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=FJ();return EU(n,t,Xq(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return jJ(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var LJ=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.tap.propagate.ignoreStrict.viewport.pinch`.split(`.`));function RJ(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||LJ.has(e)}function zJ(e,t){return e.startsWith(`on`)?!RJ(e):t?.(e)??!RJ(e)}function BJ(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(NH(e[a])||(a===`fx`?e.fx&&(i.fx=``):(zJ(a,r)||n===!0&&RJ(a)||!t&&!RJ(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a])));return i}var VJ=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function HJ(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(VJ.indexOf(e)>-1||/[A-Z]/u.test(e))}function UJ(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??HJ(e)?IJ:PJ)(t,r,i,e),l=BJ(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>NH(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function WJ({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:GJ(n,r,i,e),renderState:t()}}function GJ(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=hW(a[e]);let{initial:o,animate:s}=e,c=oK(e),l=sK(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!nK(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=TH(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var KJ=e=>(t,n)=>{let r=(0,v.useContext)(EJ),i=(0,v.useContext)(KI),a=()=>WJ(e,t,r,i);return n?a():WI(a)},qJ=KJ({scrapeMotionValuesFromProps:xK,createRenderState:AJ}),JJ=KJ({scrapeMotionValuesFromProps:Qq,createRenderState:FJ}),YJ=Symbol.for(`motionComponentSymbol`);function XJ(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var ZJ=(0,v.createContext)({});function QJ(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(EJ),s=(0,v.useContext)(bJ),c=(0,v.useContext)(KI),l=(0,v.useContext)(oJ),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(ZJ);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&i.create(m,n,h),(0,v.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[IH],_=(0,v.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return GI(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),GI(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function $J(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&TJ(r);let a=n?n===`svg`:HJ(e),o=a?JJ:qJ;function s(n,s){let c,l=eY(n);WI(()=>!!$G.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,v.useContext)(oJ),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=OJ(n),m=o(n,d);if(!d&&typeof window<`u`){tY(u,r);let t=nY(u);p.visualElement=QJ(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,S.jsxs)(EJ.Provider,{value:p,children:[c&&p.visualElement?(0,S.jsx)(c,{visualElement:p.visualElement,...u}):null,UJ(e,n,XJ(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[YJ]=e,c}function eY({layoutId:e}){let t=(0,v.useContext)(UI).id;return t&&e!==void 0?t+`-`+e:e}function tY(e,t){(0,v.useContext)(bJ).strict}function nY(e){let{drag:t,layout:n}=wJ();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function rY(e,t){if(typeof Proxy>`u`)return $J;let n=new Map,r=(n,r)=>$J(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,$J(a,void 0,e,t)),n.get(a))})}var iY=(e,t)=>t.isSVG??HJ(e)?new $q(t):new CK(t,{allowProjection:e!==v.Fragment}),aY=class extends Jq{constructor(e){super(e),e.animationState||=rJ(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();nK(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},oY=0,sY={animation:{Feature:aY},exit:{Feature:class extends Jq{constructor(){super(...arguments),this.id=oY++}update(){let{presenceContext:e,animationState:t}=this.node;if(!e||!t)return;let{isPresent:n,onExitComplete:r}=e;if(n===!this.exit)return;if(n){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=EH(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,t.reset(),t.animateChanges()}else t.setActive(`exit`,!1);this.exit=void 0;return}let i=this.exit=t.setActive(`exit`,!0);r&&i.then(()=>{this.exit===i&&(this.exit=!0,r(this.id))})}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id,this.node)),this.update()}unmount(){}}}},cY=class extends Jq{constructor(e){super(e),this.removeGroupControls=tL,this.removeListeners=tL,this.controls=new yq(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tL}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},lY=e=>(t,n)=>{e&&QR.update(()=>e(t,n),!1,!0)},uY=class extends Jq{constructor(){super(...arguments),this.removePointerDownListener=tL}onPointerDown(e){this.session=new GK(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:lY(e),onStart:lY(t),onMove:lY(n),onEnd:(e,t)=>{delete this.session,r&&QR.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=DK(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},dY=!1,fY=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),pY=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},mY=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),dY&&i.root.didUpdate(),i.options.layoutId!==r&&pY(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...fY(this.props),onExitComplete:()=>this.safeToRemove()})),_G.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),pY(o,n)),o.setOptions({...o.options,...fY(this.props)}),dY=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||QR.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),sW.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;dY=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function hY(e){let[t,n]=gJ(),r=(0,v.useContext)(UI);return(0,S.jsx)(mY,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(ZJ),isPresent:t,safeToRemove:n})}var gY={pan:{Feature:uY},drag:{Feature:cY,ProjectionNode:eK,MeasureLayout:hY}};function _Y(e,t,n,r,i){let{props:a}=e,o=`while`+n;!i&&e.animationState&&a[o]&&e.animationState.setActive(o,r===`Start`);let s=a[`on`+n+r];s&&QR.postRender(()=>s(t,TK(t)))}var vY=class extends Jq{mount(){let{current:e}=this.node;e&&(this.unmount=Oq(e,(e,t)=>(_Y(this.node,t,`Hover`,`Start`),e=>_Y(this.node,e,`Hover`,`End`))))}unmount(){}},yY=class extends Jq{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=nL(ZG(this.node.current,`focus`,()=>this.onFocus()),ZG(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function bY(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||_Y(e,t,`Tap`,n,r)}var xY=class extends Jq{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=Bq(e,(e,t)=>(bY(this.node,t,`Start`),{onComplete:(e,{success:t})=>bY(this.node,e,t?``:`Cancel`),onRepeat:()=>bY(this.node,t,``,!0)}),this.options))}update(){let{options:e,node:t}=this,{globalTapTarget:n,propagate:r,tap:i}=t.props;for(let t in e)delete e[t];Object.assign(e,i,{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}},SY=new WeakMap,CY=new WeakMap,wY=e=>{let t=SY.get(e.target);t&&t(e)},TY=e=>{e.forEach(wY)};function EY({root:e,...t}){let n=e||document;CY.has(n)||CY.set(n,{});let r=CY.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(TY,{root:e,...t})),r[i]}function DY(e,t,n){let r=EY(t);return SY.set(e,n),r.observe(e),()=>{SY.delete(e),r.unobserve(e)}}var OY={some:0,all:1},kY=class extends Jq{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:OY[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=DY(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(AY(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function AY({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var jY=rY(Object.assign({},sY,{inView:{Feature:kY},tap:{Feature:xY},focus:{Feature:yY},hover:{Feature:vY}},gY,{layout:{ProjectionNode:eK,MeasureLayout:hY}}),iY);function MY(e,t,n){(0,v.useInsertionEffect)(()=>e.on(t,n),[e,t,n])}function NY(e){let t=WI(()=>uH(e)),{isStatic:n}=(0,v.useContext)(oJ);if(n){let[,n]=(0,v.useState)(e);(0,v.useEffect)(()=>t.on(`change`,n),[])}return t}function PY(e,t){let n=NY(t()),r=()=>n.set(t());return r(),GI(()=>{let t=()=>QR.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),$R(r)}}),n}function FY(e){cH.current=[],e();let t=PY(cH.current,e);return cH.current=void 0,t}function IY(e,t,n){let{isStatic:r}=(0,v.useContext)(oJ),i=()=>NH(e)?e.get():e;if(r)return FY(i);let a=NY(i());return(0,v.useInsertionEffect)(()=>n(a,e,t),[a,JSON.stringify(t)]),a}function LY(e,t={}){return IY(e,t,qq)}function RY(e,t,n,r){if(typeof e==`function`)return FY(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return BY(e,t,n,r);let i=typeof t==`function`?t:Vq(t,n,r),a=Array.isArray(e)?zY(e,i):zY([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function zY(e,t){let n=WI(()=>[]);return PY(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function BY(e,t,n,r){let i=WI(()=>Object.keys(n)),a=WI(()=>({}));for(let o of i)a[o]=RY(e,t,n[o],r);return a}function VY(){!uK.current&&fK();let[e]=(0,v.useState)(lK.current);return e}function HY(e){return typeof e==`object`&&!Array.isArray(e)}function UY(e,t,n,r){return e==null?[]:typeof e==`string`&&HY(t)?uU(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function WY(e,t,n){return e*(t+1)+n*t}function GY(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function KY(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):GY(t,r)??e}function qY(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(JI(e,i),r--)}}function JY(e,t,n,r,i,a){qY(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:jR(i,a,r[o]),easing:wL(n,o)})}function YY(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function XY(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var ZY=`easeInOut`,QY=20;function $Y(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:KY(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=nX(e),{delay:l=0,times:u=Fz(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n;r.mixer||=n.mixer;let x=typeof l==`function`?l(a,s):l,S=c.length,C=rV(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&aX(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=aL(b));let r=az(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Pz(u,T),c.length===1&&c.unshift(null),m&&m<QY){let e=b>0?g/b:0;b=WY(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?fL(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:wL(f,e-1))}YY(u,m,e)}let E=w+b;JY(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(NH(g)){let e=eX(g,c);b(_,v,tX(`default`,e))}else{let e=UY(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=eX(r,c);for(let e in _)b(_[e],rX(v,e),tX(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};m(e,0),a&&(a.duration=p,a.labels=u);let{type:h,...g}=t;return c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(XY);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(rL(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(ZY)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o,u.transition[i]={...g,duration:p,ease:l,times:c,mixer:a.mixer||t.mixer,...n}}}),s}function eX(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function tX(e,t){return t[e]||(t[e]=[]),t[e]}function nX(e){return Array.isArray(e)?e:[e]}function rX(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var iX=e=>typeof e==`number`,aX=e=>e.every(iX);function oX(e,t){return NH(e)||typeof e==`number`||typeof e==`string`&&!HY(t)}function sX(e,t,n,r){let i=[];if(oX(e,t))i.push(lW(e,HY(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=UY(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...aW(r,t,s,tK.get(r))):i.push(...rU(tU(r)??oW,r,t,s))}}return i}function cX(e,t,n,r){let i=[],a=$Y(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=uH(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Az},r),o=t?.reduceMotion??t?.defaultTransition?.reduceMotion;return a.forEach(({keyframes:e,transition:t},n)=>{i.push(...sX(n,e,{...t,reduceMotion:o}))}),i}var lX=0;function uX({repeat:e=0,repeatDelay:t=0,repeatType:n=`loop`,delay:r=0},i,a,o){let s=i+t,c=o===void 0;if(c){let t=Math.max(0,a-r);o=s&&t>0?Math.min(e,Math.ceil(t/s-1e-9)-1):0,a=Math.min(t-o*s,i)}return n!==`loop`&&o%2&&(a=i-a),[o,c?a:r+o*s+a]}function dX(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var fX=(e,t)=>t===void 0?e:{name:e,at:t};function pX(e){e.pause(),e.time=0,e.stop()}var mX=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.motionScope=sU.current,this.isKilled=!1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new iH(n),this.watch()):(this.invalidate(),this.flush())}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+lX++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+lX++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=this.iterationDuration,r=this.time,[i]=uX(this.options,n,r),a=uX(this.options,n,t,i)[1],o=Math.abs(this.speed);return this.speed=a<r?-o:o,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&!this.isKilled&&this.build()}adopt(e){this.group&&=(pX(this.group),void 0),this.isDirty=!1,this.parent=e}build(){let e=this.isWrapped?this.group.iterationDuration:this.totalDuration;this.isDirty=!1,this.isWrapped=!1;let t=this.group,n=0;t&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),t.cancel()):(n=t.animations.length?t.time:0,pX(t)),this.isRebuilding=!1);let{defaultTransition:r,onComplete:i,onUpdate:a,onRepeat:o,onReverseComplete:s,autoplay:c,scope:l,...u}=this.options,d={};l?.reduceMotion!==void 0&&(d.reduceMotion=l.reduceMotion),l?.skipAnimations!==void 0&&(d.skipAnimations=l.skipAnimations),Object.assign(d,u);let f=new Map,p={},m=sU.current;sU.current=this.motionScope;let h;try{h=cX(this.toSequence(f),{defaultTransition:r,...d},l,p)}finally{sU.current=m}let g=p.labels,_=d.duration??p.duration,v=p.duration?_/p.duration:1;if(g.forEach((e,t)=>g.set(t,e*v)),this.markers=[],f.forEach((e,t)=>{e.time=g.get(t),g.delete(t),_=Math.max(_,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=g,this.totalDuration=_,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||a||o){let e=this.clock=uH(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),h.unshift(this.clockAnimation=lW(e,[0,_],{...d,duration:_,ease:`linear`}))}let y=this.group=new iH(h),{delay:b=0,repeat:x=0,repeatDelay:S=0}=this.options,[C,w]=uX(this.options,e,n);n>b&&(n=uX(this.options,_,Math.min(w,_),C)[1]),this.isDone&&n<b+(x+1)*(_+S)-S&&this.newFinished(),this.scrollTimeline?this.detachScroll=y.attachTimeline(this.scrollTimeline):(y.speed=this.playbackSpeed,this.isPaused&&y.pause(),n&&(y.time=n)),this.repeatIndex=this.currentRepeat(),this.prevTime=n||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),fX(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?fX(n,r):r===void 0?n:Array.isArray(n)?dX(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:GY(e,this.labels)??this.time}currentRepeat(){return uX(this.options,this.totalDuration,this.clockAnimation?.time??0)[0]}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat(),o=a>this.repeatIndex?1:-1;for(;a!==this.repeatIndex;){let e=this.speed>0==(i===`loop`||!(this.repeatIndex%2)),n=e?this.totalDuration:0;if(this.cross(t,n))return;this.repeatIndex+=o,r?.(),t=i===`loop`?e?-1:1/0:n}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=uX(this.options,this.totalDuration,e,this.repeatIndex)[1],!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options,r=this.speed<0&&n||t,i=this.resolveFinished;r?.(),i()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e});let{scope:e}=this.options,t=this.motionScope?.add(()=>{this.isKilled=!0,this.stop()});e?.animations.push(this),this.finished.then(()=>{t?.(),e&&JI(e.animations,this)})}};function hX(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e)||e?.sequence)}function gX(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=sU.current?.transition,s={};n!==void 0&&(s.reduceMotion=n),r!==void 0&&(s.skipAnimations=r);let c;if(hX(e)){let r={...s,...i,scope:t};o&&(r.defaultTransition={...o,...r.defaultTransition}),r.reduceMotion=i?.reduceMotion??r.defaultTransition?.reduceMotion??n,c=new mX(e,r)}else{let{onComplete:n,...r}=a||{},l={...s,...o,...r},{onUpdate:u}=r;c=new mX([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...l,onUpdate:void 0}]:[e,i,l]],{...s,onComplete:n,scope:t},sX(e,i,l,t))}return c}return i}var _X=Object.assign(gX(),{addEffect:$H,removeEffect:eU}),vX=jY;function yX({className:e,...t}){return(0,S.jsx)(`kbd`,{"data-slot":`kbd`,className:X(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}var bX={maskImage:`linear-gradient(#000 0 0), linear-gradient(#000 0 0)`,maskClip:`content-box, border-box`,maskComposite:`exclude`};function xX({glareX:e,glareY:t,rimAngle:n,shine:r,rimOpacity:i,glare:a,rim:o,rimWidth:s}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-3xl mix-blend-soft-light`,style:{opacity:r},children:(0,S.jsx)(vX.div,{className:`absolute -inset-1/2`,style:{x:e,y:t,background:`radial-gradient(circle closest-side, rgb(255 255 255 / ${a*.55}) 0%, rgb(255 255 255 / ${a*.12}) 35%, transparent 85%)`}})}),(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-3xl`,style:{opacity:i,padding:s,...bX},children:(0,S.jsx)(vX.div,{className:`absolute top-1/2 left-1/2 aspect-square w-[200%]`,style:{x:`-50%`,y:`-50%`,rotate:n,background:`linear-gradient(0deg, rgb(255 255 255 / ${o}) 16%, rgb(255 255 255 / 0) 45%)`}})})]})}var SX=()=>window.matchMedia(`(prefers-color-scheme: dark)`),CX=e=>{let t=SX();return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)};function wX(e){let t=(0,v.useSyncExternalStore)(CX,()=>SX().matches,()=>!1);return e===`system`?t:e===`dark`}var TX=3,EX=2,DX={text:`Small tools and games,`,highlight:`built with care`};function OX({theme:e,tagline:t=DX,depth:n=0,grain:r=!0,className:i,style:a,selectable:o=!1,pressed:s=!1,children:c}){let l=wX(e.mode),u=n>0,d=e=>u?{transform:`translateZ(${e*n}px)`}:void 0;return(0,S.jsxs)(`div`,{"data-theme":e.name,className:X(`relative flex flex-col rounded-3xl border border-black/[0.07] bg-background p-2 text-foreground select-none`,`shadow-rim`,l&&`dark border-white/10`,u&&`transform-3d`,i),style:{colorScheme:l?`dark`:`light`,...a},children:[u&&Array.from({length:TX},(e,t)=>(0,S.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -inset-px rounded-3xl`,style:{transform:`translateZ(${-(t+1)*EX}px)`,background:`color-mix(in oklab, var(--background), black ${30+t*13}%)`}},t)),r&&(0,S.jsx)(`div`,{"aria-hidden":!0,className:X(`pointer-events-none absolute inset-0 rounded-3xl`,l?`opacity-12 mix-blend-screen`:`opacity-7 mix-blend-multiply`),style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")`}}),(0,S.jsxs)(`div`,{className:X(`relative flex flex-1 flex-col justify-center rounded-inner bg-card p-3.5 text-card-foreground`,`shadow-surface`,u&&`transform-3d`),style:d(10),children:[(0,S.jsxs)(`div`,{className:`text-center`,style:d(6),children:[(0,S.jsx)(`div`,{className:`truncate text-lg leading-tight font-semibold tracking-tight`,children:e.label}),(0,S.jsxs)(`p`,{className:`mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:[t.text,` `,(0,S.jsx)(`span`,{className:`rounded-xs bg-(--selection) px-0.5 whitespace-nowrap text-(--selection-foreground)`,children:t.highlight}),`.`]})]}),(0,S.jsxs)(`div`,{className:`mt-3 flex items-center justify-center gap-1.5 text-3xs font-medium`,style:d(8),children:[(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-success`,children:[(0,S.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),`Live`]}),(0,S.jsx)(`span`,{className:`rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground`,children:`v1.2`})]}),(0,S.jsx)(`div`,{className:`mt-5 flex items-center justify-center`,style:d(14),children:(0,S.jsx)(`span`,{"data-select":!0,className:X(`inline-flex items-center rounded-full bg-primary px-3 py-1 text-xs font-medium text-primary-foreground`,`shadow-glow transition duration-150 ease-out`,o&&!s&&`hover:shadow-glow-lifted hover:brightness-110`,s&&`scale-[0.985] shadow-glow-pressed brightness-95 duration-75`),children:`Select`})})]}),(0,S.jsx)(`div`,{className:`flex items-center justify-between gap-1 px-1.5 pt-2 pb-0.5`,style:d(4),children:[1,2,3,4,5,6,7,8].map(e=>(0,S.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full shadow-swatch`,style:{background:`var(--tint-${e})`}},e))}),c&&(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,style:d(30),children:c})]})}var kX=236,AX=252,jX=168,MX=50,NX=.07,PX=1100,FX=10,IX=24,LX=140,RX=(e,t)=>({type:`spring`,stiffness:e,damping:t}),zX=RX(260,30),BX=RX(380,26),VX=.45,HX=60,UX=100,WX=2,GX=[1.5,3.5,1/0],KX=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]),qX=e=>{if(typeof requestIdleCallback>`u`){let t=window.setTimeout(e,1e3);return()=>clearTimeout(t)}let t=requestIdleCallback(e,{timeout:3e3});return()=>cancelIdleCallback(t)},JX=()=>Math.min(1,window.innerWidth/(kX*2.6)),YX=(e,t)=>`${e.label} ${e.mode}`.toLowerCase().includes(t.trim().toLowerCase()),XX=e=>MX/(360/Math.max(e,IX)),ZX=e=>(e-1)/2>=XX(e),QX=(e,t)=>(e%t+t)%t,$X=(e,t)=>Math.min(t-1,Math.max(0,e)),eZ=(e,t,n)=>{let r=e-t;return ZX(n)?r-n*Math.round(r/n):r},tZ=(e,t)=>ZX(t)?Math.round(e):$X(Math.round(e),t),nZ=(e,t)=>QX(tZ(e,t),t),rZ=.3,iZ=(e,t)=>{if(ZX(t))return e;let n=$X(e,t);return n+(e-n)*rZ};function aZ({tagline:e,open:t,onOpenChange:n,trigger:r,shortcut:i=!0,finalFocus:a,favoriteKey:o=`!`,favoritesOnlyKey:s=`@`}={}){let{theme:c,themes:l,setTheme:u,favorites:d,toggleFavorite:f}=I(),p=l.filter(e=>!e.hidden||e.name===c),m=VY()??!1,[h,g]=(0,v.useState)(!1),_=t??h,[y,b]=(0,v.useState)(0),[x,C]=(0,v.useState)(1),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!1),M=NY(1),N=NY(1/0),P=NY(0),F=(0,v.useRef)(0),R=(0,v.useRef)(null),[z,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(!1),ee=(e,t,n)=>p.filter(r=>YX(r,e)&&(!t||n.includes(r.name))),te=ee(z,H,d),ne=te.length,W=te[y];MY(P,`change`,e=>ne&&b(nZ(e,ne)));let re=(0,v.useRef)(!1),ie=e=>{re.current=!1,F.current=tZ(e,ne),_X(P,F.current,m?{duration:0}:zX)},ae=e=>ie(Math.round(F.current)+e),G=e=>{let t=Math.max(-60,Math.min(HX,e));if(m)return ie(P.get());re.current=!0,F.current=tZ(P.get()+t*VX,ne),_X(P,F.current,{type:`inertia`,velocity:t,power:VX,timeConstant:VX*1e3,modifyTarget:e=>tZ(e,ne),restDelta:.001})},K=(0,v.useEffectEvent)(e=>{!i||_||e.defaultPrevented||e.repeat||e.metaKey||e.ctrlKey||e.altKey||e.key.toLowerCase()!==`t`||L(e.target)||(e.preventDefault(),q(!0))});(0,v.useEffect)(()=>(window.addEventListener(`keydown`,K),()=>window.removeEventListener(`keydown`,K)),[]),(0,v.useEffect)(()=>qX(()=>j(!0)),[]),(0,v.useEffect)(()=>{if(A)return qX(()=>{let e=R.current?.closest(`[hidden]`);e&&(e.style.visibility=`hidden`,e.hidden=!1,e.offsetWidth,e.hidden=!0,e.style.visibility=``)})},[A]),(0,v.useEffect)(()=>{if(!_)return;let e=e=>e.preventDefault();return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)},[_]),(0,v.useEffect)(()=>{if(!_)return;let e=()=>C(JX());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[_]);let q=(e,r)=>{if(!e&&r?.reason===`escape-key`&&z)return ce(``);t===void 0&&g(e),n?.(e)},oe=(0,v.useEffectEvent)(()=>{V(``),U(!1),T(!1),C(JX());let e=Math.max(0,p.findIndex(e=>e.name===c));P.jump(e),b(e),F.current=e,N.jump(GX[0]);let t=e=>requestAnimationFrame(()=>requestAnimationFrame(()=>{N.jump(GX[e]),e<GX.length-1&&t(e+1)}));t(1),m||(M.jump(.4),_X(M,1,BX))});(0,v.useEffect)(()=>{_&&oe()},[_]);let J=e=>{if(!e||e.name===c)return q(!1);let t=document.getElementById(`theme-card-${e.name}`)?.getBoundingClientRect();B(()=>{u(e.name),T(!0),q(!1)},t&&{x:t.left+t.width/2,y:t.top+t.height/2},m)},se=e=>{let t=W?e.indexOf(W):-1,n=Math.max(0,t);P.stop(),P.jump(n),F.current=n,b(n)},ce=e=>{se(ee(e,H,d)),V(e)},le=e=>{se(ee(z,e,d)),U(e)},ue=e=>{H&&se(te.filter(t=>t!==e)),f(e.name)},de=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;if(KX.has(e.key)&&e.target===R.current&&e.preventDefault(),e.key===o||e.key===s){if(e.preventDefault(),e.repeat)return;e.key===s?le(!H):W&&ue(W);return}if(e.key.length===1&&(e.key!==` `||z!==``)&&(e.key!==` `||e.target===R.current))return e.preventDefault(),ce(z+e.key);if(e.key===`Backspace`&&z)return e.preventDefault(),ce(z.slice(0,-1));if(!ne)return;let t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(t)e.preventDefault(),ae(t);else if((e.key===`Enter`||e.key===` `)&&e.target===R.current){if(e.preventDefault(),e.repeat||E)return;if(m)return J(W);D(!0),window.setTimeout(()=>{D(!1),J(W)},LX)}else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=Math.round(F.current),n=ZX(ne)?t-QX(t,ne):0;ie(e.key===`Home`?n:ZX(ne)?n-1:ne-1)}},fe=(0,v.useRef)({last:0,settle:0}),pe=e=>{let t=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(e.deltaMode!==0||Number.isInteger(t)&&Math.abs(t)>=50){if(e.timeStamp-fe.current.last<60)return;fe.current.last=e.timeStamp,ae(Math.sign(t))}else P.stop(),P.set(iZ(P.get()+t/(jX*x),ne)),clearTimeout(fe.current.settle),fe.current.settle=window.setTimeout(()=>ie(P.get()),120)},me=(0,v.useRef)({x:0,y:0,start:0,moved:!1,caught:!1,gesture:`ring`,samples:[]}),he=(0,v.useRef)(null),[ge,_e]=(0,v.useState)(!1);return(0,S.jsxs)(Ty,{open:_,onOpenChange:q,modal:`trap-focus`,onOpenChangeComplete:e=>!e&&T(!1),children:[r===void 0&&(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(Ay,{render:(0,S.jsxs)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Choose a theme`,"aria-keyshortcuts":i?`t`:void 0,className:`relative outline-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0`,children:[(0,S.jsx)(pd,{}),(0,S.jsx)(`span`,{className:`absolute right-1.5 bottom-1.5 size-2 rounded-full bg-primary ring-2 ring-background`})]})})}),(0,S.jsxs)(Kl,{children:[`Theme `,i&&(0,S.jsx)(yX,{children:`T`})]})]}),r&&(0,S.jsx)(Ay,{render:r}),(0,S.jsxs)(sy,{keepMounted:A,children:[(0,S.jsx)(Bv,{className:X(`fixed inset-0 z-50 bg-background/55 duration-200 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,w&&`invisible`)}),(0,S.jsxs)(ay,{initialFocus:R,finalFocus:a,onKeyDown:de,onPointerDown:e=>{if(e.button!==0||e.target.closest(`button`))return;let t=e.pointerType===`touch`,n=e.target.closest(`[data-theme-index]`),r=n!==null&&Math.round(eZ(Number(n.dataset.themeIndex),F.current,ne))===0;if(r&&e.target.closest(`[data-select]`)){k(!0);let e=()=>{k(!1),window.removeEventListener(`pointerup`,e),window.removeEventListener(`pointercancel`,e)};window.addEventListener(`pointerup`,e),window.addEventListener(`pointercancel`,e)}if(me.current.moved=me.current.caught=!1,me.current.gesture=`ring`,ne<2&&!(t&&r))return;let i=re.current&&Math.abs(P.getVelocity())>WX;i&&P.stop(),me.current={x:e.clientX,y:e.clientY,start:P.get(),moved:!1,caught:i,gesture:t?`pending`:`ring`,samples:[{t:e.timeStamp,x:e.clientX}]};let a=e=>{let{current:t}=me,n=e.clientX-t.x;if(t.gesture===`pending`){let i=e.clientY-t.y;if(Math.hypot(n,i)<6)return;t.gesture=Math.abs(i)>Math.abs(n)?r&&!m?`tilt`:`none`:ne<2?`none`:`ring`,k(!1)}if(t.gesture===`tilt`)return he.current?.aim(e.clientX,e.clientY);if(t.gesture===`ring`){for(t.samples.push({t:e.timeStamp,x:e.clientX});t.samples.length>2&&e.timeStamp-t.samples[0].t>UX;)t.samples.shift();!t.moved&&Math.abs(n)<4||(t.moved||(k(!1),P.stop(),t.start=P.get()+n/(jX*x),_e(!0)),t.moved=!0,P.set(iZ(t.start-n/(jX*x),ne)))}},o=e=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),_e(!1),me.current.gesture===`tilt`&&he.current?.release();let{samples:t}=me.current,n=t[0],r=t[t.length-1],i=e.timeStamp-r.t>50||r.t===n.t?0:(r.x-n.x)/(r.t-n.t)*1e3;me.current.moved?G(-i/(jX*x)):me.current.caught&&ie(P.get())};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},onWheel:pe,onClick:e=>{let{moved:t,caught:n,gesture:r}=me.current;if(t||n||r===`tilt`||r===`none`)return;let i=e.target;if(i.closest(`button`))return;let a=i.closest(`[data-theme-index]`);if(!a)return q(!1);let o=Number(a.dataset.themeIndex);if(i.closest(`[data-favorite]`))return ue(te[o]);let s=Math.round(eZ(o,F.current,ne));s===0?J(te[o]):ae(s)},className:X(`fixed inset-0 z-50 flex touch-none flex-col items-center justify-center overflow-hidden text-foreground outline-none select-none duration-200 data-open:duration-75 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,w&&`invisible`),children:[(0,S.jsx)(Vv,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Close`,className:`absolute top-4 right-4`,children:(0,S.jsx)(Fd,{})})}),(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Favorites only`,"aria-pressed":H,"aria-keyshortcuts":s,className:`absolute top-4 right-14`,onMouseDown:e=>e.preventDefault(),onClick:()=>le(!H)}),children:(0,S.jsx)(Dd,{className:X(H&&`fill-current`)})}),(0,S.jsxs)(Kl,{children:[`Favorites only `,(0,S.jsx)(yX,{children:s})]})]}),(0,S.jsxs)(vX.div,{className:`flex w-full flex-col items-center will-change-transform`,style:{scale:M},children:[(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(Ey,{className:`text-xs font-medium tracking-wider text-muted-foreground uppercase`,children:`Theme`}),(0,S.jsx)(`div`,{"aria-live":`polite`,className:`mt-1 h-9 overflow-hidden`,children:z?(0,S.jsxs)(`div`,{className:`text-3xl font-semibold tracking-tight whitespace-pre`,children:[z,(0,S.jsx)(`span`,{className:`ml-0.5 inline-block h-[0.9em] w-[2px] translate-y-[0.1em] animate-pulse bg-primary`})]}):(0,S.jsx)(vX.div,{initial:!m&&{y:14,opacity:0},animate:{y:0,opacity:1},transition:RX(420,32),className:`text-3xl font-semibold tracking-tight`,children:W?.label},W?.name)}),(0,S.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground tabular-nums`,children:[ne===0?H&&!z?`No favorites yet`:`No theme matches`:z?`${W?.label} · ${y+1} of ${ne}`:`${String(y+1).padStart(2,`0`)} / ${String(ne).padStart(2,`0`)}`,H&&` · favorites`,W?.name===c&&` · current`]})]}),(0,S.jsx)(`div`,{ref:R,tabIndex:0,role:`listbox`,"aria-label":`Themes`,"aria-activedescendant":W?`theme-card-${W.name}`:void 0,className:`relative my-6 w-full outline-none`,style:{height:332*x},children:(0,S.jsx)(`div`,{className:`absolute top-1/2 left-1/2`,style:{transform:`scale(${x})`},children:!w&&te.map((t,n)=>(0,S.jsx)(sZ,{theme:t,index:n,count:ne,position:P,reach:N,isFront:n===y,tilt:n===y&&!ge&&!m,aimRef:he,pressed:n===y&&(E||O),favorite:d.includes(t.name),taglineText:e?.text,taglineHighlight:e?.highlight},t.name))})}),(0,S.jsxs)(`div`,{className:`hidden items-center gap-1.5 text-xs text-muted-foreground sm:flex`,children:[(0,S.jsx)(`span`,{children:`Drag or`}),(0,S.jsx)(yX,{children:`←`}),(0,S.jsx)(yX,{children:`→`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`to browse`}),(0,S.jsx)(yX,{children:`Enter`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`select`}),(0,S.jsx)(`span`,{className:`mr-2`,children:`type to filter`}),(0,S.jsx)(yX,{children:o}),(0,S.jsx)(`span`,{className:`mr-2`,children:`favorite`}),(0,S.jsx)(yX,{children:s}),(0,S.jsx)(`span`,{className:`mr-2`,children:`favorites only`}),(0,S.jsx)(yX,{children:`Esc`}),(0,S.jsx)(`span`,{children:z?`clear`:`close`})]})]})]})]})]})}var oZ=e=>Math.min(1,Math.max(-1,e*2-1)),sZ=(0,v.memo)(function({theme:e,index:t,count:n,position:r,reach:i,isFront:a,tilt:o,aimRef:s,pressed:c,favorite:l,taglineText:u,taglineHighlight:d}){let f=Math.max(n,IX),p=2*Math.PI/f,m=jX*f/(2*Math.PI),h=XX(n),g=RY(r,e=>eZ(t,e,n)),_=RY(g,e=>{let t=e*p,n=1+NX*Math.max(0,1-Math.abs(e));return`translate(-50%, -50%) perspective(${PX}px) translate3d(${m*Math.sin(t)}px, 0, ${m*(Math.cos(t)-1)}px) rotateY(${t*180/Math.PI}deg) scale(${n})`}),y=RY(g,e=>Math.min(1,Math.max(0,h+.5-Math.abs(e)))),b=RY([y,g,i],([e,t,n])=>e<=0||Math.abs(t)>n?`hidden`:`visible`),x=RY(g,e=>100-Math.round(Math.abs(e)*4)),C=RY(g,e=>Math.min(.45,Math.abs(e)*.09)),w=LY(0,{stiffness:320,damping:26}),T=LY(0,{stiffness:320,damping:26}),E=LY(0,{stiffness:200,damping:30}),D=RY(T,e=>-e*FX),O=RY(w,e=>e*FX),k=RY(w,e=>`${e*25}%`),A=RY(T,e=>`${e*25}%`),j=RY([w,T,g],([e,t,n])=>Math.atan2(t,e+n)*180/Math.PI+90),M=RY(E,[0,1],[.25,1]),N=RY(O,e=>-e*1.6),P=RY(D,e=>18+e*.8),F=RY(g,e=>Math.max(0,1-Math.abs(e))),I=RY(F,e=>e<=0?`hidden`:`visible`),L=RY(F,e=>e*.5);(0,v.useEffect)(()=>{o||(w.set(0),T.set(0),E.set(0))},[o,w,T,E]);let R=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!o)return;let e={aim(e,t){let n=R.current?.getBoundingClientRect();n&&(w.set(oZ((e-n.left)/n.width)),T.set(oZ((t-n.top)/n.height)),E.set(1))},release(){w.set(0),T.set(0),E.set(0)}};return s.current=e,()=>{s.current===e&&(s.current=null)}},[o,s,w,T,E]),(0,S.jsxs)(vX.div,{"data-theme-index":t,className:`absolute top-0 left-0 cursor-pointer transform-3d`,style:{width:kX,height:AX,transform:_,opacity:y,visibility:b,zIndex:x},ref:R,onPointerMove:e=>{o&&e.pointerType!==`touch`&&s.current?.aim(e.clientX,e.clientY)},onPointerLeave:e=>{e.pointerType!==`touch`&&(w.set(0),T.set(0),E.set(0))},children:[(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-[8%] top-[12%] bottom-0 rounded-4xl bg-black blur-2xl`,style:{x:N,y:P,z:-40,opacity:L,visibility:I}}),(0,S.jsx)(vX.div,{id:`theme-card-${e.name}`,role:`option`,"aria-selected":a,"aria-label":l?`${e.label}, favorite`:e.label,className:`relative size-full transform-3d`,style:{rotateX:D,rotateY:O},children:(0,S.jsxs)(OX,{theme:e,tagline:u&&d?{text:u,highlight:d}:void 0,depth:1,grain:a,selectable:a,pressed:c,className:`size-full`,children:[(0,S.jsx)(`span`,{"data-favorite":!0,"aria-hidden":!0,className:X(`pointer-events-auto absolute top-1 right-1 flex size-11 items-center justify-center rounded-full transition duration-150 ease-out hover:scale-115`,l?`text-primary`:`text-muted-foreground/60 hover:text-foreground`),children:(0,S.jsx)(Dd,{className:X(`size-4`,l&&`fill-current`)})}),(0,S.jsx)(vX.div,{"aria-hidden":!0,className:`absolute inset-0 rounded-3xl bg-black`,style:{opacity:C}}),(0,S.jsx)(vX.div,{className:`absolute inset-0`,style:{opacity:F,visibility:I},children:(0,S.jsx)(xX,{glareX:k,glareY:A,rimAngle:j,shine:E,rimOpacity:M,glare:.55,rim:.7,rimWidth:.5})})]})})]})}),cZ=Bd(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function lZ({className:e,orientation:t,...n}){return(0,S.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:X(cZ({orientation:t}),e),...n})}function uZ({...e}){return(0,S.jsx)(Xw,{"data-slot":`dropdown-menu`,...e})}function dZ({...e}){return(0,S.jsx)(eT,{"data-slot":`dropdown-menu-trigger`,...e})}function fZ({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,S.jsx)(Rw,{children:(0,S.jsx)(zw,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,S.jsx)(Fw,{"data-slot":`dropdown-menu-content`,className:X(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function pZ({...e}){return(0,S.jsx)(Cw,{"data-slot":`dropdown-menu-group`,...e})}function mZ({className:e,inset:t,...n}){return(0,S.jsx)(ww,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:X(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function hZ({className:e,inset:t,variant:n=`default`,...r}){return(0,S.jsx)(Ew,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:X(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function gZ({className:e,...t}){return(0,S.jsx)(Px,{"data-slot":`dropdown-menu-separator`,className:X(`-mx-1 my-1 h-px bg-border`,e),...t})}function _Z({act:e,open:t,onOpenChange:n,onCloned:r,finalFocus:i}){return(0,S.jsx)(jy,{open:t,onOpenChange:n,children:(0,S.jsxs)(Fy,{className:`sm:max-w-xl`,finalFocus:i,children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`Clone a repo`}),(0,S.jsx)(zy,{children:`Your GitHub repos that aren't cloned yet, newest first. Once cloned, workwork looks for work in it.`})]}),(0,S.jsx)(vZ,{act:e,onCloned:r})]})})}function vZ({act:e,onCloned:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)();if((0,v.useEffect)(()=>{rf.repos().then(r,e=>a(e.message))},[]),i)return(0,S.jsx)(`p`,{className:`text-sm text-destructive`,children:i});if(!n)return(0,S.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(By,{}),` Asking GitHub`]});let u=o.toLowerCase(),d=n.repos.filter(e=>e.name.toLowerCase().includes(u)||e.description.toLowerCase().includes(u)),f=i=>e(async()=>{l(i.name);try{await rf.clone(i.name),t(),r({...n,repos:n.repos.filter(e=>e!==i)})}finally{l(void 0)}});return(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Clones into `,n.root,`/`]}),(0,S.jsx)(Uf,{placeholder:`Search ${n.repos.length} repos`,value:o,onChange:e=>s(e.target.value)}),(0,S.jsxs)(Fx,{className:`max-h-[50svh] overflow-y-auto`,children:[d.map(e=>(0,S.jsx)(Wx,{title:e.name,meta:[e.description,`created ${e.createdAt.slice(0,10)}`].filter(Boolean).join(` · `),children:(0,S.jsxs)(vf,{variant:`outline`,size:`sm`,disabled:c!==void 0,onClick:()=>f(e),children:[c===e.name&&(0,S.jsx)(By,{}),` Clone`]})},e.name)),d.length===0&&(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.repos.length?`No repo matches.`:`Every repo of yours is cloned.`})]})]})}var yZ=Bd(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),bZ=v.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function xZ({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,S.jsx)(nE,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:X(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,S.jsx)(bZ.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function SZ({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=v.useContext(bZ);return(0,S.jsx)($T,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:X(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,yZ({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}var CZ=``,wZ={value:`clone-project`,label:`Clone project...`},TZ=100,EZ=e=>`${e.repo} ${e.id}`;function DZ({snapshot:e,act:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(0),o=(0,v.useRef)(null),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(CZ),[p,m]=(0,v.useState)(CZ),[h,g]=(0,v.useState)([`auto`,`skim`,`decide`]),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(TZ),[C,w]=(0,v.useState)(new Map),[T,E]=(0,v.useState)(0),{at:D,count:O,refreshing:k}=e.candidates;(0,v.useEffect)(()=>{let e=!1;return rf.candidates().then(({items:t,repos:n})=>{e||(c(t),u(n))}),()=>{e=!0}},[D,i]),(0,v.useEffect)(()=>{rf.plays().then(e=>w(new Map(e.map(e=>[e.name,e.description]))))},[D]);let A=(0,v.useMemo)(()=>{let t=new Map;for(let n of e.jobs)n.state!==`removed`&&t.set(EZ(n.item),n);return t},[e.jobs]),j={value:CZ,label:`All repos (${s.length})`},M=(0,v.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.repo,(e.get(t.repo)??0)+1);return l.map(t=>({value:t,label:`${Yd(t)} (${e.get(t)??0})`})).sort((e,t)=>e.label.localeCompare(t.label))},[s,l]),N=d===CZ?s:s.filter(e=>e.repo===d),P=new Map;for(let e of N)P.set(e.play,(P.get(e.play)??0)+1);let F=[...P].sort((e,t)=>e[1]-t[1]),I=_.toLowerCase().split(/\s+/).filter(Boolean),L=N.filter(e=>(p===CZ||e.play===p)&&h.includes(e.level)&&I.every(t=>`${Xd(e)} ${e.id} ${e.label}`.toLowerCase().includes(t))),R=(e,n)=>t(()=>rf.queue(e,n)),z=L.filter(e=>!A.has(EZ(e))),B=(0,S.jsxs)(Vd,{children:[(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:k?`Asking workwork`:`No candidates yet`}),(0,S.jsx)(Wd,{children:k?`workwork is looking through every repo under $SRC. That takes a few minutes.`:d===CZ?`Ask workwork for candidates across your repos. It takes a few minutes.`:`There are no candidates for ${Yd(d)}.`})]}),(0,S.jsx)(Gd,{children:(0,S.jsxs)(vf,{variant:`outline`,disabled:k,onClick:()=>t(rf.refreshCandidates),children:[k&&(0,S.jsx)(By,{}),` Ask workwork`]})})]});return(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Uf,{className:`max-w-xs`,placeholder:`Search titles, ids, repos`,value:_,onChange:e=>y(e.target.value)}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,value:h,onValueChange:g,children:[`auto`,`skim`,`decide`].map(e=>(0,S.jsx)(SZ,{value:e,children:e},e))}),(0,S.jsxs)(jE,{items:[j,...M,wZ],value:d,onValueChange:e=>{if(e===wZ.value){r(!0);return}let t=e??CZ;f(t),x(TZ),s.some(e=>e.play===p&&(t===CZ||e.repo===t))||m(CZ)},children:[(0,S.jsx)(PE,{"aria-label":`Repo`,ref:o,children:(0,S.jsx)(NE,{})}),(0,S.jsxs)(FE,{alignItemWithTrigger:!1,children:[(0,S.jsxs)(ME,{children:[(0,S.jsx)(IE,{value:j.value,children:j.label}),M.map(e=>(0,S.jsx)(IE,{value:e.value,children:e.label},e.value))]}),(0,S.jsx)(LE,{}),(0,S.jsx)(ME,{children:(0,S.jsx)(IE,{value:wZ.value,children:wZ.label})})]})]}),(0,S.jsx)(_Z,{act:t,open:n,onOpenChange:r,onCloned:()=>a(e=>e+1),finalFocus:o}),(0,S.jsxs)(`span`,{className:`flex flex-1 items-center justify-end gap-2 text-sm text-muted-foreground`,children:[k?`Asking workwork…`:`${O} candidates${D?`, ${qd(D)}`:``}`,(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh candidates`,disabled:k,onClick:()=>{E(T+1),t(rf.refreshCandidates)}}),children:(0,S.jsx)(yd,{className:T?`refresh-turn`:void 0},T)}),(0,S.jsx)(Kl,{children:k?`Asking workwork, takes a few minutes`:`Ask workwork again`})]})]})]}),N.length===0?B:(0,S.jsxs)(`div`,{className:`flex flex-col gap-6 md:flex-row`,children:[(0,S.jsx)(`nav`,{className:`flex flex-wrap gap-1 md:w-48 md:flex-none md:flex-col`,children:[[CZ,N.length],...F].map(([e,t])=>(0,S.jsxs)(Xl,{disabled:!C.has(e),children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(vf,{variant:p===e?`secondary`:`ghost`,size:`sm`,onClick:()=>{m(e),x(TZ)}}),children:[(0,S.jsx)(`span`,{className:`flex-1 text-left`,children:e||`All plays`}),(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:t})]}),(0,S.jsx)(Kl,{side:`right`,children:C.get(e)})]},e))}),(0,S.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,S.jsxs)(Gx,{title:(0,S.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`span`,{className:`flex-1`,children:[L.length,` matching, `,z.length,` not queued yet`]}),z.length>0&&z.length<=20&&(0,S.jsx)(OZ,{label:`Queue all ${z.length}`,presets:e.settings.presets,onQueue:e=>R(z,e)})]}),children:[(0,S.jsx)(Fx,{children:L.slice(0,b).map(n=>{let r=A.get(EZ(n)),i=(0,S.jsx)(OZ,{label:`Queue`,presets:e.settings.presets,onQueue:e=>R([n],e)});return(0,S.jsx)(Wx,{leading:(0,S.jsx)(lD,{state:dD(r,e.prs)}),title:(0,S.jsx)(pD,{item:n,job:r,play:C.get(n.play),snapshot:e,act:t,actions:!r&&i}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(uD,{state:dD(r,e.prs)}),[n.play,n.level,n.id].join(` · `)]}),children:!r&&i},EZ(n))})}),L.length>b&&(0,S.jsxs)(vf,{variant:`ghost`,onClick:()=>x(b+TZ),children:[`Show `,Math.min(TZ,L.length-b),` more`]})]})})]})]})}function OZ({label:e,presets:t,onQueue:n}){return(0,S.jsxs)(lZ,{children:[(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>n(),children:e}),(0,S.jsxs)(uZ,{children:[(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(dZ,{render:(0,S.jsx)(vf,{variant:`outline`,size:`icon-sm`,"aria-label":`${e} with`})}),children:(0,S.jsx)(Tu,{})}),(0,S.jsxs)(Kl,{children:[e,` for a specific agent or preset`]})]}),(0,S.jsxs)(fZ,{align:`end`,className:`w-auto`,children:[(0,S.jsxs)(pZ,{children:[(0,S.jsx)(mZ,{children:`Agent`}),Kx.map(e=>(0,S.jsx)(hZ,{onClick:()=>n({agent:e}),children:e},e))]}),(0,S.jsx)(gZ,{}),(0,S.jsxs)(pZ,{children:[(0,S.jsx)(mZ,{children:`Preset`}),t.length===0&&(0,S.jsx)(hZ,{disabled:!0,children:`Add presets in Settings`}),t.map((e,t)=>(0,S.jsx)(hZ,{onClick:()=>n(e),children:ef(e)},t))]})]})]})]})}function kZ({snapshot:e,act:t}){let{settings:n,on:r}=e,[i,a]=(0,v.useState)();return(0,S.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,S.jsxs)(Xl,{children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(DE,{orientation:`horizontal`}),children:[(0,S.jsx)(Mx,{id:`auto`,checked:n.auto.on,onCheckedChange:e=>t(()=>rf.saveSettings({...n,auto:{...n.auto,on:e}}))}),(0,S.jsx)(kE,{htmlFor:`auto`,children:`Auto`})]}),(0,S.jsx)(Kl,{children:`Keep the queue topped up from candidates while the factory is on`})]}),(0,S.jsxs)(Xl,{disabled:r,children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`outline`,onClick:e=>{let i={agents:n.agents,limit:n.limit,until:n.until};r?t(rf.turnOff):e.shiftKey?t(()=>rf.turnOn(i)):a(i)}}),children:r?`Turn off`:`Turn on`}),(0,S.jsx)(Kl,{children:`Shift-click to turn on with your defaults`})]}),(0,S.jsx)(jy,{open:i!==void 0,onOpenChange:e=>!e&&a(void 0),children:(0,S.jsxs)(Fy,{children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`Turn the factory on`}),(0,S.jsx)(zy,{children:`For this run only; the defaults are under Settings. Your picks go first, then what auto mode queues.`})]}),i&&(0,S.jsx)(HE,{value:i,onChange:a}),(0,S.jsx)(Ly,{children:(0,S.jsx)(vf,{disabled:!i||Object.keys(i.agents).length===0,onClick:()=>t(async()=>{await rf.turnOn(i),a(void 0)}),children:`Turn on`})})]})})]})}var AZ={value:`new-project`,label:`New project...`};function jZ({act:e,open:t,onOpenChange:n,onCreated:r}){return(0,S.jsx)(jy,{open:t,onOpenChange:n,children:(0,S.jsxs)(Fy,{className:`sm:max-w-2xl`,children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`New goal`}),(0,S.jsx)(zy,{children:`A goal is one large task, planned into a graph of jobs. Nothing runs until you approve the plan.`})]}),(0,S.jsxs)(lx,{defaultValue:`brief`,children:[(0,S.jsxs)(dx,{children:[(0,S.jsx)(fx,{value:`brief`,children:`From a brief`}),(0,S.jsx)(fx,{value:`plan`,children:`Import a plan`})]}),(0,S.jsx)(px,{value:`brief`,children:(0,S.jsx)(MZ,{act:e,onCreated:r})}),(0,S.jsx)(px,{value:`plan`,children:(0,S.jsx)(NZ,{act:e,onCreated:r})})]})]})})}function MZ({act:e,onCreated:t}){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>{rf.candidates().then(r)},[]);let m=o===AZ.value,h=(n?.repos??[]).map(e=>({value:e,label:Yd(e)})),g=i.trim()&&(m?c.trim():o),_=()=>e(async()=>{p(!0);try{t((await rf.newGoal({title:i,brief:u,...m?{project:c.trim()}:{repo:o}})).id)}finally{p(!1)}});return(0,S.jsxs)(TE,{className:`mt-2`,children:[(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{htmlFor:`goal-title`,children:`Title`}),(0,S.jsx)(Uf,{id:`goal-title`,autoFocus:!0,placeholder:`GPUI client for Tasks`,value:i,onChange:e=>a(e.target.value)})]}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Repo`}),(0,S.jsxs)(jE,{items:[...h,AZ],value:o,onValueChange:e=>s(e??``),children:[(0,S.jsx)(PE,{"aria-label":`Repo`,children:(0,S.jsx)(NE,{placeholder:`Pick a repo`})}),(0,S.jsxs)(FE,{alignItemWithTrigger:!1,children:[(0,S.jsx)(ME,{children:h.map(e=>(0,S.jsx)(IE,{value:e.value,children:e.label},e.value))}),(0,S.jsx)(LE,{}),(0,S.jsx)(ME,{children:(0,S.jsx)(IE,{value:AZ.value,children:AZ.label})})]})]}),m&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Uf,{"aria-label":`Project name`,placeholder:`units`,value:c,onChange:e=>l(e.target.value)}),(0,S.jsxs)(AE,{children:[`Creates `,n?.root,`/`,c.trim()||`<name>`,` and a private GitHub repo of the same name.`]})]})]}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{htmlFor:`goal-brief`,children:`Brief`}),(0,S.jsx)(rE,{id:`goal-brief`,className:`min-h-48`,placeholder:`What done looks like, constraints, links to specs, and the commands that prove it works.`,value:u,onChange:e=>d(e.target.value)}),(0,S.jsx)(AE,{children:`Markdown. A communicator plans it into a graph, which waits for your approval here.`})]}),(0,S.jsx)(Ly,{children:(0,S.jsx)(vf,{disabled:!g||f,onClick:_,children:`Plan it`})})]})}function NZ({act:e,onCreated:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1);return(0,S.jsxs)(TE,{className:`mt-2`,children:[(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{htmlFor:`goal-plan`,children:`Plan`}),(0,S.jsx)(rE,{id:`goal-plan`,className:`min-h-64`,placeholder:`{ "format": "factory-plan/1", "goal": { ... }, "nodes": [ ... ] }`,value:n,onChange:e=>r(e.target.value)}),(0,S.jsx)(AE,{children:`JSON or YAML in factory-plan/1, as in spec/plan-format.md. It's validated before anything changes.`})]}),(0,S.jsx)(Ly,{children:(0,S.jsx)(vf,{disabled:!n.trim()||i,onClick:()=>e(async()=>{a(!0);try{t((await rf.importPlan(n)).id)}finally{a(!1)}}),children:`Import`})})]})}var PZ={communicator:`comm`,builder:`build`,grunt:`grunt`},FZ=e=>e.blocked?IZ[e.blocked]:e.state===`queued`?`working`:void 0,IZ={checkpoint:`waiting for your approval`,paused:`paused`,red:`integration branch red`,asked:`waiting for you`,held:`held by a failure`,review:`merging`},LZ=(e,t)=>e.filter(e=>e.of===t.id&&e.state!==`removed`);function RZ(e,t){return[t,...e].flatMap(e=>[e.added,...e.notes.map(e=>e.at),...e.attempts.map(e=>e.end)]).sort().at(-1)}function zZ({snapshot:e,act:t}){let[n,r]=bx(`goal`,``),[i,a]=(0,v.useState)(!1),o=e.jobs.filter(e=>e.goal&&e.state!==`removed`),s=o.find(e=>e.id===n);if(s)return(0,S.jsx)(BZ,{goal:s,snapshot:e,act:t,onBack:()=>r(``)});let c=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(vf,{variant:`outline`,onClick:()=>a(!0),children:[(0,S.jsx)(_d,{}),` New goal`]}),(0,S.jsx)(jZ,{act:t,open:i,onOpenChange:a,onCreated:e=>{a(!1),r(e)}})]});return o.length===0?(0,S.jsxs)(Vd,{children:[(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:`No goals yet`}),(0,S.jsx)(Wd,{children:`A goal is one large task, planned into a graph of jobs that run on their own branch.`})]}),(0,S.jsx)(Gd,{children:c})]}):(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 pt-2`,children:[(0,S.jsx)(`div`,{className:`flex justify-end`,children:c}),(0,S.jsx)(Fx,{children:o.map(t=>{let n=LZ(e.jobs,t),i=n.filter(e=>e.state===`done`).length,a=n.reduce((e,t)=>e+t.attempts.length,0),o=t.goal.budget?.attempts;return(0,S.jsx)(Wx,{leading:(0,S.jsx)(lD,{state:t.state}),progress:n.length?i/n.length:0,title:(0,S.jsx)(`button`,{type:`button`,className:`text-left hover:underline`,onClick:()=>r(t.id),children:t.item.title}),meta:(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(uD,{state:t.state,label:FZ(t)}),(0,S.jsxs)(`span`,{children:[i,`/`,n.length,` done`]}),Ov.map(e=>{let t=n.filter(t=>t.tier===e);return t.length?(0,S.jsxs)(`span`,{children:[PZ[e],` `,t.filter(e=>e.state===`done`).length,`/`,t.length]},e):null}),(0,S.jsxs)(`span`,{children:[a,o?`/${o}`:``,` attempts`]}),(0,S.jsx)(`span`,{children:qd(RZ(n,t))})]}),children:(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open goal`,onClick:()=>r(t.id),children:(0,S.jsx)(Du,{})})},t.id)})})]})}function BZ({goal:e,snapshot:t,act:n,onBack:r}){let{jobs:i,status:a}=t,o=LZ(i,e),s=e.goal,c=o.filter(e=>e.state===`done`).length,l=o.reduce((e,t)=>e+t.attempts.length,0),u=e.blocked===`red`,d=e.notes.findLast(e=>e.kind===`factory`),f=Mv(e),p=o.flatMap(e=>e.unverified.map(t=>({node:e,need:t}))),m=o.flatMap(e=>e.notes.flatMap((t,n)=>t.kind===`assume`&&!e.notes.some(e=>e.kind===`answer`&&e.re===n)?[{node:e,note:t}]:[]));return(0,S.jsxs)(`div`,{className:`flex flex-col gap-6 pt-2`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`All goals`,onClick:r,children:(0,S.jsx)(_u,{})}),(0,S.jsx)(`h2`,{className:`font-heading text-lg font-semibold`,children:e.item.title}),(0,S.jsx)(uD,{state:e.state,label:FZ(e)}),(0,S.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.blocked===`paused`?(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`resume`)),children:`Resume`}):e.state!==`done`&&(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`pause`)),children:`Pause`}),e.state!==`done`&&(0,S.jsx)(GZ,{goal:e,act:n}),e.state!==`done`&&(0,S.jsx)(vf,{variant:`ghost`,size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`cancel`)),children:`Cancel goal`})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(Gu,{className:`size-4`}),` goal/`,s.slug]}),(0,S.jsx)(`span`,{className:u?`text-destructive`:``,children:s.gates.length===0?`no goal gates`:`${u?`red`:`green`}: ${s.gates.map(e=>`\`${e}\``).join(`, `)}`}),(0,S.jsxs)(`span`,{children:[c,`/`,o.length,` done`]}),(0,S.jsxs)(`span`,{children:[l,s.budget?` of ${s.budget.attempts}`:``,` attempts`]}),f&&(0,S.jsx)(`a`,{className:`text-primary hover:underline`,href:f,target:`_blank`,rel:`noreferrer`,children:`final PR`})]}),e.blocked===`checkpoint`&&(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md border border-warning/50 bg-warning/10 p-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`flex-1`,children:d?.text??`Waiting for your approval.`}),(0,S.jsx)(vf,{size:`sm`,onClick:()=>n(()=>rf.goal(e.id,`approve`)),children:`Approve`})]}),u&&d&&(0,S.jsxs)(`p`,{className:`rounded-md border border-destructive/40 p-3 text-sm text-destructive`,children:[d.text,`; a fix is queued at the front.`]}),(p.length>0||m.length>0)&&(0,S.jsx)(Gx,{title:`For you to check`,children:(0,S.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:[p.map(({node:e,need:t})=>(0,S.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(cf,{variant:`outline`,children:`unverified`}),(0,S.jsxs)(`span`,{className:`flex-1`,children:[e.item.title,`: `,t]}),(0,S.jsx)(vf,{size:`sm`,variant:`outline`,onClick:()=>n(()=>rf.verify(e.id,t)),children:`Checked`})]},`${e.id} ${t}`)),m.map(({node:e,note:t})=>(0,S.jsx)(WZ,{node:e,question:t.text,assumed:t.assumed??``,act:n},`${e.id} ${t.at}`))]})}),(0,S.jsx)(Gx,{title:`Graph`,children:(0,S.jsx)(VZ,{nodes:o.filter(e=>!e.parent),all:o,snapshot:t,act:n,status:a})})]})}function VZ({nodes:e,all:t,snapshot:n,act:r,status:i}){let[a,o]=(0,v.useState)(),s=Iv(e.filter(e=>!e.branchOf));for(let t of e.filter(e=>e.branchOf))s.set(t.id,s.get(t.branchOf)??0);let c=Lv(t),l=new Set(t.find(e=>e.id===a)?.after??[]),u=[...new Set(s.values())].sort((e,t)=>e-t);return(0,S.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:u.map(a=>(0,S.jsx)(`div`,{className:`flex w-60 shrink-0 flex-col gap-2`,children:e.filter(e=>s.get(e.id)===a).map(e=>{let a=t.filter(t=>t.parent===e.id),s={node:e,snapshot:n,act:r,status:i,onPath:c.has(e.id),dependency:l.has(e.id),onHover:o};return a.length>0?(0,S.jsx)(HZ,{...s,members:a,all:t},e.id):(0,S.jsx)(UZ,{...s},e.id)})},a))})}function HZ({members:e,all:t,...n}){let{node:r,snapshot:i,act:a,status:o}=n,s=e.filter(e=>e.state===`done`).length;return(0,S.jsx)(`div`,{className:`rounded-md border border-dashed p-2`,children:(0,S.jsxs)(JF,{defaultOpen:r.state!==`done`,children:[(0,S.jsxs)(YF,{render:(0,S.jsx)(`button`,{type:`button`,className:`flex w-full items-center gap-2 text-left text-sm font-medium`}),children:[(0,S.jsx)(lD,{state:r.state}),(0,S.jsx)(`span`,{className:`flex-1`,children:r.item.title}),(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s,`/`,e.length]})]}),(0,S.jsx)(XF,{className:`mt-2`,children:(0,S.jsx)(VZ,{nodes:e,all:t,snapshot:i,act:a,status:o})})]})})}function UZ({node:e,snapshot:t,act:n,status:r,onPath:i,dependency:a,onHover:o}){let s=r?.workers.find(t=>t.job===e.id),c=e.notes.findLast(t=>t.kind===`step`&&t.attempt===e.attempts.length+1),l=e.attempts.some(e=>(e.compactions??0)>2);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md border bg-card p-2 text-sm ${a?`ring-2 ring-accent`:i?`border-primary/60`:``}`,onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(void 0),children:[(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(lD,{state:e.state}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere`,children:(0,S.jsx)(pD,{item:e.item,job:e,snapshot:t,act:n,bare:!0})})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[e.tier&&(0,S.jsx)(cf,{variant:`secondary`,children:e.tier}),e.front&&(0,S.jsx)(cf,{variant:`outline`,children:`factory`}),e.blocked&&(0,S.jsx)(`span`,{children:IZ[e.blocked]}),e.attempts.length>0&&(0,S.jsxs)(`span`,{children:[e.attempts.length,` attempt`,e.attempts.length===1?``:`s`]}),l&&(0,S.jsxs)(Xl,{children:[(0,S.jsxs)(Gl,{render:(0,S.jsx)(`span`,{className:`flex items-center text-warning`}),children:[(0,S.jsx)(Uu,{className:`size-3.5`}),` heavy`]}),(0,S.jsx)(Kl,{children:`Compacted more than twice; replans split work like this smaller.`})]}),i&&(0,S.jsx)(`span`,{className:`text-primary`,children:`critical path`})]}),s&&(0,S.jsxs)(`div`,{className:`text-xs`,children:[(0,S.jsx)(`span`,{className:`text-primary`,children:s.id}),`, `,Jd(s.since),` min`,s.context?`, ${Math.round(s.context/1e3)}k context`:``,(0,S.jsx)(`div`,{className:`truncate text-muted-foreground`,children:c?`${c.text}${c.of?` (${c.done??0}/${c.of})`:``}`:s.activity??`starting`})]})]})}function WZ({node:e,question:t,assumed:n,act:r}){let[i,a]=(0,v.useState)(``);return(0,S.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(cf,{variant:`outline`,children:`assumed`}),` `,e.item.title,`: assumed`,` `,(0,S.jsx)(`strong`,{children:n}),`, asked `,t]}),(0,S.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),r(()=>rf.answer(e.id,i))},children:[(0,S.jsx)(Uf,{value:i,onChange:e=>a(e.target.value),placeholder:`A different answer queues a change`}),(0,S.jsx)(vf,{type:`submit`,variant:`outline`,size:`sm`,disabled:!i.trim(),children:`Answer`}),(0,S.jsx)(vf,{type:`button`,size:`sm`,onClick:()=>r(()=>rf.answer(e.id,`fine`)),children:`Fine`})]})]})}function GZ({goal:e,act:t}){let[n,r]=(0,v.useState)();return n===void 0?(0,S.jsx)(vf,{variant:`outline`,size:`sm`,onClick:()=>r(``),children:`Replan`}):(0,S.jsxs)(`form`,{className:`flex gap-1`,onSubmit:i=>{i.preventDefault(),t(()=>rf.replan(e.id,n)).then(()=>r(void 0))},children:[(0,S.jsx)(Uf,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),placeholder:`Why replan?`,className:`h-8 w-48`}),(0,S.jsx)(vf,{type:`submit`,size:`sm`,disabled:!n.trim(),children:`Queue`})]})}var KZ={y:14.2,width:3,height:3.4,rx:.6};function qZ({working:e}){return(0,S.jsxs)(`svg`,{viewBox:`0 0 48 48`,width:32,height:32,"aria-hidden":!0,className:e?`logo-working`:void 0,children:[(0,S.jsx)(`rect`,{width:`48`,height:`48`,rx:`10.5`,className:`logo-tile`}),(0,S.jsxs)(`g`,{transform:`translate(6 6) scale(1.5)`,children:[(0,S.jsx)(`g`,{fill:`none`,className:`logo-ink`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,S.jsx)(`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`})}),(0,S.jsx)(`g`,{className:`logo-ink-fill`,children:[6.5,10.5,14.5].map(e=>(0,S.jsx)(`rect`,{className:`logo-window`,x:e,...KZ},e))})]})]})}function JZ({dialog:e,onAnswer:t}){let[n,r]=(0,v.useState)(e.method===`editor`?e.prefill??``:``),i=e.method===`input`||e.method===`editor`;return(0,S.jsx)(jy,{open:!0,onOpenChange:e=>!e&&t({cancelled:!0}),children:(0,S.jsxs)(Fy,{children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:e.title}),e.method===`confirm`&&e.message&&(0,S.jsx)(zy,{children:e.message})]}),e.method===`input`&&(0,S.jsx)(Uf,{autoFocus:!0,value:n,placeholder:e.placeholder,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&t({value:n})}),e.method===`editor`&&(0,S.jsx)(rE,{autoFocus:!0,value:n,onChange:e=>r(e.target.value)}),(0,S.jsxs)(Ly,{children:[e.method===`select`&&e.options.map(e=>(0,S.jsx)(vf,{variant:`outline`,onClick:()=>t({value:e}),children:e},e)),e.method===`confirm`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(vf,{variant:`outline`,onClick:()=>t({confirmed:!1}),children:`No`}),(0,S.jsx)(vf,{autoFocus:!0,onClick:()=>t({confirmed:!0}),children:`Yes`})]}),i&&(0,S.jsx)(vf,{onClick:()=>t({value:n}),children:`Send`})]})]})})}var YZ=[`select`,`confirm`,`input`,`editor`],XZ={messages:[],busy:!1,dialogs:[]};function ZZ(e,t){let{messages:n}=e;switch(t.type){case`agent_start`:return{...e,busy:!0,error:void 0};case`agent_settled`:return{...e,busy:!1,dialogs:[]};case`exit`:return{...e,busy:!1,dialogs:[],error:t.error};case`extension_ui_request`:return YZ.includes(t.method)?{...e,dialogs:[...e.dialogs,t]}:e;case`extension_ui_answered`:return{...e,dialogs:e.dialogs.filter(e=>e.id!==t.id)};case`reset`:return XZ;case`message_start`:return{...e,messages:[...n,t.message]};case`message_end`:return{...e,messages:[...n.slice(0,-1),t.message]};case`message_update`:{let r=n.at(-1);if(r?.role!==`assistant`)return e;let i=QZ(r.content,t.assistantMessageEvent);return{...e,messages:[...n.slice(0,-1),{...r,content:i}]}}case`response`:if(!t.success)return{...e,error:t.error};if(t.command===`get_messages`)return{...e,messages:t.data.messages};if(t.command===`get_state`){let n=t.data;return n.model?{...e,model:{name:n.model.name,thinking:n.thinkingLevel}}:e}return e;default:return e}}function QZ(e,t){if(!(`contentIndex`in t))return e;let n=[...e],r=t.contentIndex;if(t.type===`text_start`)n[r]={type:`text`,text:``};else if(t.type===`thinking_start`)n[r]={type:`thinking`};else if(t.type===`text_delta`&&`delta`in t){let e=n[r];n[r]={type:`text`,text:(e?.type===`text`?e.text:``)+t.delta}}else t.type===`toolcall_start`&&`toolName`in t?n[r]={type:`toolCall`,id:t.id,name:t.toolName,arguments:{}}:t.type===`toolcall_end`&&`toolCall`in t&&(n[r]=t.toolCall);return n}function $Z({messages:e,busy:t}){let n=new Map;for(let t of e)t.role===`toolResult`&&n.set(t.toolCallId,t);return e.flatMap((e,r)=>{let i=String(r);if(e.role===`user`)return[{id:i,role:`user`,text:eQ(e.content)}];if(e.role!==`assistant`)return[];let a=e.content.flatMap(e=>e.type===`toolCall`?[tQ(e,n.get(e.id),t)]:[]),o=e.stopReason===`error`?[e.errorMessage,e.model&&`(${e.provider}/${e.model})`].filter(Boolean).join(` `):void 0;return[{id:i,role:`assistant`,text:[eQ(e.content),o&&`**Error:** ${o}`].filter(Boolean).join(`
|
|
77
77
|
|
|
78
|
-
`),tools:a}]})}function
|
|
78
|
+
`),tools:a}]})}function eQ(e){return typeof e==`string`?e:e.flatMap(e=>e?.type===`text`?[e.text]:[]).join(`
|
|
79
79
|
|
|
80
|
-
`)}function ZZ(e,t,n){let r=t?t.isError?`error`:`complete`:n?`running`:`error`,i=t&&XZ(t.content);return{id:e.id,name:e.name,status:r,output:i,...HI(e,r,i)}}function QZ({agent:e,prompt:t,onPromptChange:n}){let[r,i]=(0,v.useState)(KZ),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let e=new EventSource(`/api/chat`);return e.onopen=()=>i(KZ),e.onmessage=e=>i(t=>qZ(t,JSON.parse(e.data))),()=>e.close()},[]);async function s(e){try{return await e(),o(void 0),!0}catch(e){return o(e.message),!1}}return(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[tf(e),` looks through the candidates and queues jobs once you agree. It never turns the factory on.`]}),(0,S.jsxs)(vf,{variant:`outline`,size:`sm`,disabled:r.messages.length===0,onClick:()=>void s(rf.resetChat),children:[(0,S.jsx)(xd,{}),`New chat`]})]}),r.dialogs[0]&&(0,S.jsx)(WZ,{dialog:r.dialogs[0],onAnswer:e=>void s(()=>rf.answerChat({id:r.dialogs[0].id,...e}))},r.dialogs[0].id),(0,S.jsx)(fI,{messages:YZ(r),prompt:t,onPromptChange:n,busy:r.busy,model:r.model,error:a??r.error,placeholder:`What should the factory work on next?`,emptyTitle:`Plan the queue`,emptyDescription:`For example: pick five auto jobs for tonight that won't conflict.`,onSend:e=>s(()=>rf.chat(e)),onStop:()=>void s(rf.abortChat)})]})}function $Z(e,t){let n=e.agent?ef({...e,agent:e.agent}):``,r=e.after.flatMap(e=>{let n=t.get(e);return n&&n.state!==`done`?[Xd(n.item)]:[]}),i=r.length>0&&`after ${r.join(`, `)}`;return[e.item.play,e.item.level,n,i].filter(Boolean).join(` · `)}function eQ({job:e,byId:t}){return(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(uD,{state:e.state}),$Z(e,t)]})}function tQ({ref:e,children:t}){return(0,S.jsx)(vX.div,{ref:e,layout:`position`,exit:{opacity:0,x:64},transition:{duration:.2},children:t})}function nQ({snapshot:e,act:t,onCandidates:n}){let{jobs:r,status:i,on:a,settings:o}=e,s=new Map(r.map(e=>[e.id,e])),c=r.filter(e=>e.state===`queued`&&e.source===`pick`),l=r.filter(e=>e.state===`queued`&&e.source===`auto`),u=(n,r)=>(0,S.jsx)(pD,{item:n.item,job:n,snapshot:e,act:t,actions:r&&(0,S.jsx)(vf,{variant:`destructive`,size:`sm`,className:`sm:mr-auto`,onClick:()=>t(()=>rf.remove(n.id)),children:`Remove from queue`})}),d=e=>(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Remove from queue`,onClick:()=>t(()=>rf.remove(e.id))}),children:(0,S.jsx)(Fd,{})}),(0,S.jsx)(Kl,{children:`Remove from queue`})]});return(0,S.jsxs)(`div`,{className:`flex flex-col gap-8 pt-2`,children:[a&&i&&i.pools.map(e=>{let t=e.stopped??(e.until?`sleeps until ${Kd(e.until)}`:``);return(0,S.jsx)(Gx,{title:`${e.name}: limits hit ${e.limits} of ${i.limit??`∞`}${t?`, ${t}`:``}`,children:(0,S.jsx)(Fx,{children:i.workers.filter(t=>t.pool===e.name).map(e=>{let t=e.job?s.get(e.job):void 0,n=t?void 0:e.until?`until ${Kd(e.until)}`:e.reason??`waiting for work`,r=Ov.filter(t=>o.tiers[t].includes(e.preset)),i=t?.notes.findLast(e=>e.kind===`step`&&e.attempt===t.attempts.length+1),a=t?.notes.findLast(e=>e.kind!==`step`);return(0,S.jsx)(Wx,{title:(0,S.jsxs)(S.Fragment,{children:[e.id,` `,(0,S.jsx)(cf,{variant:Qd[e.state],children:e.state}),r.map(e=>(0,S.jsx)(cf,{variant:`secondary`,className:`ml-1`,children:e},e))]}),meta:(0,S.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[t&&(0,S.jsxs)(`span`,{className:`flex items-center gap-2 text-foreground`,children:[(0,S.jsx)(lD,{state:t.state}),u(t,!1)]}),(0,S.jsx)(`span`,{children:[n,$d(e),t?`${Jd(e.since)} min`:`since ${Kd(e.since)}`,e.context&&`${Math.round(e.context/1e3)}k context`].filter(Boolean).join(` · `)}),i&&(0,S.jsxs)(`span`,{className:`text-foreground`,children:[i.text,i.of?` (${i.done??0}/${i.of})`:``]}),e.activity&&(0,S.jsx)(`span`,{children:e.activity}),a&&(0,S.jsxs)(`span`,{children:[Kd(a.at),` `,a.kind,`: `,a.text]})]})},e.id)})})},e.name)}),(0,S.jsx)(Gx,{title:`Your picks (${c.length})`,children:c.length===0?(0,S.jsxs)(Vd,{children:[(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:`Nothing picked`}),(0,S.jsx)(Wd,{children:`Picks go before anything auto mode queues. Find work under Candidates.`})]}),(0,S.jsx)(Gd,{children:(0,S.jsx)(vf,{variant:`outline`,onClick:n,children:`Browse candidates`})})]}):(0,S.jsx)(Fx,{children:(0,S.jsx)(yJ,{mode:`popLayout`,initial:!1,children:c.map((e,n)=>(0,S.jsx)(tQ,{children:(0,S.jsxs)(Wx,{leading:(0,S.jsx)(lD,{state:e.state}),title:u(e,!0),meta:(0,S.jsx)(eQ,{job:e,byId:s}),children:[(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move up`,disabled:n===0,onClick:()=>t(()=>rf.move(e.id,n-1)),children:(0,S.jsx)(yu,{})}),(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move down`,disabled:n===c.length-1,onClick:()=>t(()=>rf.move(e.id,n+1)),children:(0,S.jsx)(hu,{})}),d(e)]})},e.id))})})}),(0,S.jsx)(Gx,{title:`Auto (${l.length})`,children:l.length===0?(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o.auto.on?`Auto mode tops this up to 5 jobs per agent while the factory is on.`:`Auto mode is off. Turn it on to keep the queue topped up from workwork.`}):(0,S.jsx)(Fx,{children:(0,S.jsx)(yJ,{mode:`popLayout`,initial:!1,children:l.map(e=>(0,S.jsx)(tQ,{children:(0,S.jsx)(Wx,{leading:(0,S.jsx)(lD,{state:e.state}),title:u(e,!0),meta:(0,S.jsx)(eQ,{job:e,byId:s}),children:d(e)})},e.id))})})})]})}function rQ({snapshot:e,act:t}){let[n,r]=(0,v.useState)(!1);return(0,S.jsxs)(jy,{open:n,onOpenChange:r,children:[(0,S.jsx)(My,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Settings`}),children:(0,S.jsx)(Cd,{})}),(0,S.jsxs)(Fy,{className:`sm:max-w-xl`,children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`Settings`}),(0,S.jsx)(zy,{children:`Defaults for every run, and what auto mode may queue. Closing without saving discards changes.`})]}),(0,S.jsx)(iQ,{snapshot:e,act:t,onSaved:()=>r(!1)})]})]})}function iQ({snapshot:e,act:t,onSaved:n}){let[r,i]=(0,v.useState)(e.settings),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),l={...r,auto:{...r.auto,on:e.settings.auto.on}},u=JSON.stringify(l)===JSON.stringify(e.settings);(0,v.useEffect)(()=>{rf.candidates().then(e=>{o([...new Set(e.items.map(e=>e.play))].sort()),c([...new Set(e.items.map(e=>e.repo))].sort())})},[e.candidates.at]);let d=r.auto,f=e=>i({...r,auto:{...d,...e}});return(0,S.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),t(async()=>{await rf.saveSettings(l),n()})},children:[(0,S.jsxs)(lx,{defaultValue:`runs`,children:[(0,S.jsxs)(dx,{children:[(0,S.jsx)(fx,{value:`runs`,children:`Runs`}),(0,S.jsx)(fx,{value:`presets`,children:`Presets`}),(0,S.jsx)(fx,{value:`tiers`,children:`Tiers`}),(0,S.jsx)(fx,{value:`auto`,children:`Auto mode`}),(0,S.jsx)(fx,{value:`chat`,children:`Live Agent`})]}),(0,S.jsxs)(`div`,{className:`mt-2 grid`,children:[(0,S.jsx)(oQ,{value:`runs`,children:(0,S.jsxs)(TE,{children:[(0,S.jsx)(HE,{value:r,onChange:e=>i({...r,...e})}),(0,S.jsxs)(DE,{orientation:`horizontal`,children:[(0,S.jsx)(kE,{htmlFor:`idle`,children:`Minutes without a sign of life before an attempt times out`}),(0,S.jsx)(Uf,{id:`idle`,type:`number`,className:`w-20`,min:1,value:r.idle,onChange:e=>i({...r,idle:Number(e.target.value)})})]})]})}),(0,S.jsx)(oQ,{value:`presets`,children:(0,S.jsx)(aQ,{value:r.presets,onChange:e=>i({...r,presets:e})})}),(0,S.jsx)(oQ,{value:`tiers`,children:(0,S.jsx)(cQ,{presets:r.presets,value:r.tiers,onChange:e=>i({...r,tiers:e})})}),(0,S.jsx)(oQ,{value:`auto`,children:(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`While the factory is on, auto mode keeps up to 5 jobs per agent queued, cheapest attention first, and never queues a candidate that already had a job. An empty filter allows everything.`}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Levels`}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,value:d.levels,onValueChange:e=>f({levels:e}),children:[`auto`,`skim`,`decide`].map(e=>(0,S.jsx)(SZ,{value:e,children:e},e))})]}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Plays`}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,className:`flex-wrap`,value:d.plays,onValueChange:e=>f({plays:e}),children:a.map(e=>(0,S.jsx)(SZ,{value:e,children:e},e))})]}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Repos`}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,className:`flex-wrap`,value:d.repos,onValueChange:e=>f({repos:e}),children:s.map(e=>(0,S.jsx)(SZ,{value:e,children:Yd(e)},e))})]})]})}),(0,S.jsx)(oQ,{value:`chat`,children:(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`The agent you plan the queue with. Changing it starts a new chat.`}),(0,S.jsxs)(DE,{orientation:`horizontal`,children:[(0,S.jsx)(qE,{label:`Chat agent`,className:`w-24 flex-none`,items:Kx.map(e=>({value:e,label:tf(e)})),value:r.chat.agent,onChange:e=>e&&i({...r,chat:{agent:e}})}),(0,S.jsx)(GE,{agent:r.chat.agent,value:r.chat,onChange:e=>i({...r,chat:{...e,agent:r.chat.agent}})})]})]})})]})]}),(0,S.jsx)(Ly,{children:(0,S.jsx)(vf,{type:`submit`,disabled:u,children:`Save`})})]})}function aQ({value:e,onChange:t}){let n=(n,r)=>t(e.map((e,t)=>t===n?r:e));return(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`Queue a candidate with one of these from the arrow next to its Queue button. Tiers run on them too: workers is how many run at once (empty: one once a tier lists it), and k ctx the context size, in thousands of tokens, where the agent compacts (empty: 90 for Haiku, 200 otherwise).`}),e.map((r,i)=>(0,S.jsxs)(DE,{orientation:`horizontal`,children:[(0,S.jsx)(qE,{label:`Preset agent`,className:`w-24 flex-none`,items:Kx.map(e=>({value:e,label:tf(e)})),value:r.agent,onChange:e=>e&&n(i,{agent:e})}),(0,S.jsx)(GE,{agent:r.agent,value:r,onChange:e=>n(i,{...r,...e,agent:r.agent})}),(0,S.jsx)(Uf,{"aria-label":`Workers`,type:`number`,min:0,className:`w-16`,placeholder:`workers`,value:r.workers??``,onChange:e=>n(i,{...r,workers:e.target.value===``?void 0:Number(e.target.value)})}),(0,S.jsx)(Uf,{"aria-label":`Compact at, thousands of tokens`,type:`number`,min:10,className:`w-20`,placeholder:`k ctx`,value:r.compactAt?r.compactAt/1e3:``,onChange:e=>n(i,{...r,compactAt:e.target.value===``?void 0:Number(e.target.value)*1e3})}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove preset`,onClick:()=>t(e.filter((e,t)=>t!==i)),children:(0,S.jsx)(Fd,{})})]},i)),(0,S.jsxs)(vf,{type:`button`,variant:`outline`,className:`self-start`,onClick:()=>t([...e,{agent:Kx[0]}]),children:[(0,S.jsx)(_d,{}),` Add preset`]})]})}function oQ(e){return(0,S.jsx)(px,{keepMounted:!0,hidden:!1,className:`col-start-1 row-start-1 data-hidden:invisible`,...e})}var sQ={communicator:`decomposition, UX, visual design, copy: anything judged by taste`,builder:`architecture, foundations, tricky logic, reviews`,grunt:`well-specified mechanical work`};function cQ({presets:e,value:t,onChange:n}){let[r,i]=(0,v.useState)(),a=e.map(kv),o=(e,r)=>n({...t,[e]:r}),s=(e,n,r)=>{let i=[...t[e]],[a]=i.splice(n,1);i.splice(r,0,a),o(e,i)};return(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`A goal's node runs on the first preset of its tier whose usage limit isn't hit and that has a free worker. A tier with no presets here runs on the run's agents.`}),Ov.map(e=>{let n=t[e],c=a.filter(e=>!n.includes(e));return(0,S.jsxs)(DE,{children:[(0,S.jsxs)(kE,{children:[e,` `,(0,S.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:sQ[e]})]}),(0,S.jsx)(`ol`,{className:`flex flex-col gap-1`,children:n.map((t,c)=>(0,S.jsxs)(`li`,{draggable:!0,onDragStart:()=>i({tier:e,index:c}),onDragOver:t=>r?.tier===e&&t.preventDefault(),onDrop:()=>{r?.tier===e&&s(e,r.index,c),i(void 0)},className:`flex items-center gap-1 rounded-md border px-2 py-1 text-sm`,children:[(0,S.jsx)(td,{className:`size-4 cursor-grab text-muted-foreground`}),(0,S.jsxs)(`span`,{className:`flex-1`,children:[c+1,`. `,t,!a.includes(t)&&(0,S.jsx)(`span`,{className:`text-destructive`,children:` (no such preset)`})]}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Move up`,disabled:c===0,onClick:()=>s(e,c,c-1),children:(0,S.jsx)(yu,{})}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Move down`,disabled:c===n.length-1,onClick:()=>s(e,c,c+1),children:(0,S.jsx)(hu,{})}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove from tier`,onClick:()=>o(e,n.filter(e=>e!==t)),children:(0,S.jsx)(Fd,{})})]},t))}),c.length>0&&(0,S.jsx)(qE,{label:`Add a preset to ${e}`,className:`w-56`,items:[{value:``,label:`Add a preset…`},...c.map(e=>({value:e,label:e}))],value:``,onChange:t=>t&&o(e,[...n,t])})]},e)})]})}function lQ(){let{snapshot:e,error:t,act:n}=af(),[r,i]=(0,v.useState)(``);return e?(0,S.jsx)(PI,{title:`Live Agent`,agent:(0,S.jsx)(QZ,{agent:e.settings.chat.agent,prompt:r,onPromptChange:i}),children:(0,S.jsx)(uQ,{snapshot:e,error:t,act:n,onAsk:i})}):(0,S.jsx)(`div`,{className:`flex min-h-svh items-center justify-center gap-2 p-4 text-muted-foreground`,children:t??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(By,{}),` Loading`]})})}function uQ({snapshot:e,error:t,act:n,onAsk:r}){let[i,a]=bx(`tab`,`queue`),{isMobile:o,setOpen:s,setOpenMobile:c}=kI(),{on:l,status:u}=e,d=e.jobs.filter(e=>e.state===`queued`&&!e.of&&!e.goal).length,f=e.jobs.filter(e=>e.goal&&e.state!==`removed`&&e.state!==`done`),p=f.filter(e=>e.blocked===`checkpoint`).length,m=l&&u?[`since ${Kd(Zd(u.run))}`,u.limit===null?`always waits for usage resets`:u.limit===1?`stops at usage limits`:`waits for ${u.limit-1} usage reset${u.limit>2?`s`:``}`,u.until&&`until ${Kd(u.until)}`].filter(Boolean).join(` · `):``;return(0,S.jsxs)(`div`,{className:`mx-auto flex min-h-svh w-full max-w-5xl flex-col gap-6 p-4`,children:[(0,S.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,S.jsxs)(`div`,{className:`flex flex-1 items-center gap-2`,children:[(0,S.jsxs)(`h1`,{className:`flex items-center gap-2 font-heading text-xl font-semibold`,children:[(0,S.jsx)(UZ,{working:l}),`Factory`]}),(0,S.jsx)(cf,{variant:l?`accent`:`outline`,children:l?`on`:`off`}),(0,S.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:m})]}),(0,S.jsx)(kZ,{snapshot:e,act:n}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(aZ,{}),(0,S.jsx)(rQ,{snapshot:e,act:n})]})]}),t&&(0,S.jsx)(`p`,{role:`alert`,className:`text-sm wrap-anywhere whitespace-pre-line text-destructive`,children:t}),(0,S.jsxs)(lx,{value:i,onValueChange:a,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`div`,{className:`min-w-0 overflow-x-auto overflow-y-hidden`,children:(0,S.jsxs)(dx,{children:[(0,S.jsxs)(fx,{value:`queue`,children:[(0,S.jsx)(ad,{}),`Queue`,d?` (${d})`:``]}),(0,S.jsxs)(fx,{value:`goals`,children:[(0,S.jsx)(jd,{}),`Goals`,f.length?` (${f.length})`:``,p>0&&(0,S.jsx)(cf,{variant:`accent`,children:p})]}),(0,S.jsxs)(fx,{value:`candidates`,children:[(0,S.jsx)(rd,{}),`Candidates`]}),(0,S.jsxs)(fx,{value:`results`,children:[(0,S.jsx)(dd,{}),`Results`]}),(0,S.jsxs)(fx,{value:`activity`,children:[(0,S.jsx)(pu,{}),`Activity`]})]})}),(0,S.jsx)(`div`,{className:`ml-auto`})]}),(0,S.jsx)(px,{value:`queue`,children:(0,S.jsx)(nQ,{snapshot:e,act:n,onCandidates:()=>a(`candidates`)})}),(0,S.jsx)(px,{value:`goals`,children:(0,S.jsx)(FZ,{snapshot:e,act:n})}),(0,S.jsx)(px,{value:`candidates`,children:(0,S.jsx)(DZ,{snapshot:e,act:n})}),(0,S.jsx)(px,{value:`activity`,children:(0,S.jsx)(ED,{snapshot:e,act:n})}),(0,S.jsx)(px,{value:`results`,children:(0,S.jsx)(eD,{snapshot:e,act:n,onAsk:e=>{r(e),(o?c:s)(!0)}})})]})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(v.StrictMode,{children:(0,S.jsx)(F,{themes:b,storageKey:Zl,children:(0,S.jsx)(Yl,{children:(0,S.jsx)(lQ,{})})})}));
|
|
80
|
+
`)}function tQ(e,t,n){let r=t?t.isError?`error`:`complete`:n?`running`:`error`,i=t&&eQ(t.content);return{id:e.id,name:e.name,status:r,output:i,...HI(e,r,i)}}function nQ({agent:e,prompt:t,onPromptChange:n}){let[r,i]=(0,v.useState)(XZ),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let e=new EventSource(`/api/chat`);return e.onopen=()=>i(XZ),e.onmessage=e=>i(t=>ZZ(t,JSON.parse(e.data))),()=>e.close()},[]);async function s(e){try{return await e(),o(void 0),!0}catch(e){return o(e.message),!1}}return(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[tf(e),` looks through the candidates and queues jobs once you agree. It never turns the factory on.`]}),(0,S.jsxs)(vf,{variant:`outline`,size:`sm`,disabled:r.messages.length===0,onClick:()=>void s(rf.resetChat),children:[(0,S.jsx)(xd,{}),`New chat`]})]}),r.dialogs[0]&&(0,S.jsx)(JZ,{dialog:r.dialogs[0],onAnswer:e=>void s(()=>rf.answerChat({id:r.dialogs[0].id,...e}))},r.dialogs[0].id),(0,S.jsx)(fI,{messages:$Z(r),prompt:t,onPromptChange:n,busy:r.busy,model:r.model,error:a??r.error,placeholder:`What should the factory work on next?`,emptyTitle:`Plan the queue`,emptyDescription:`For example: pick five auto jobs for tonight that won't conflict.`,onSend:e=>s(()=>rf.chat(e)),onStop:()=>void s(rf.abortChat)})]})}function rQ(e,t){let n=e.agent?ef({...e,agent:e.agent}):``,r=e.after.flatMap(e=>{let n=t.get(e);return n&&n.state!==`done`?[Xd(n.item)]:[]}),i=r.length>0&&`after ${r.join(`, `)}`;return[e.item.play,e.item.level,n,i].filter(Boolean).join(` · `)}function iQ({job:e,byId:t}){return(0,S.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(uD,{state:e.state}),rQ(e,t)]})}function aQ({ref:e,children:t}){return(0,S.jsx)(vX.div,{ref:e,layout:`position`,exit:{opacity:0,x:64},transition:{duration:.2},children:t})}function oQ({snapshot:e,act:t,onCandidates:n}){let{jobs:r,status:i,on:a,settings:o}=e,s=new Map(r.map(e=>[e.id,e])),c=r.filter(e=>e.state===`queued`&&e.source===`pick`),l=r.filter(e=>e.state===`queued`&&e.source===`auto`),u=(n,r)=>(0,S.jsx)(pD,{item:n.item,job:n,snapshot:e,act:t,actions:r&&(0,S.jsx)(vf,{variant:`destructive`,size:`sm`,className:`sm:mr-auto`,onClick:()=>t(()=>rf.remove(n.id)),children:`Remove from queue`})}),d=e=>(0,S.jsxs)(Xl,{children:[(0,S.jsx)(Gl,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Remove from queue`,onClick:()=>t(()=>rf.remove(e.id))}),children:(0,S.jsx)(Fd,{})}),(0,S.jsx)(Kl,{children:`Remove from queue`})]});return(0,S.jsxs)(`div`,{className:`flex flex-col gap-8 pt-2`,children:[a&&i&&i.pools.map(e=>{let t=e.stopped??(e.until?`sleeps until ${Kd(e.until)}`:``);return(0,S.jsx)(Gx,{title:`${e.name}: limits hit ${e.limits} of ${i.limit??`∞`}${t?`, ${t}`:``}`,children:(0,S.jsx)(Fx,{children:i.workers.filter(t=>t.pool===e.name).map(e=>{let t=e.job?s.get(e.job):void 0,n=t?void 0:e.until?`until ${Kd(e.until)}`:e.reason??`waiting for work`,r=Ov.filter(t=>o.tiers[t].includes(e.preset)),i=t?.notes.findLast(e=>e.kind===`step`&&e.attempt===t.attempts.length+1),a=t?.notes.findLast(e=>e.kind!==`step`);return(0,S.jsx)(Wx,{title:(0,S.jsxs)(S.Fragment,{children:[e.id,` `,(0,S.jsx)(cf,{variant:Qd[e.state],children:e.state}),r.map(e=>(0,S.jsx)(cf,{variant:`secondary`,className:`ml-1`,children:e},e))]}),meta:(0,S.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[t&&(0,S.jsxs)(`span`,{className:`flex items-center gap-2 text-foreground`,children:[(0,S.jsx)(lD,{state:t.state}),u(t,!1)]}),(0,S.jsx)(`span`,{children:[n,$d(e),t?`${Jd(e.since)} min`:`since ${Kd(e.since)}`,e.context&&`${Math.round(e.context/1e3)}k context`].filter(Boolean).join(` · `)}),i&&(0,S.jsxs)(`span`,{className:`text-foreground`,children:[i.text,i.of?` (${i.done??0}/${i.of})`:``]}),e.activity&&(0,S.jsx)(`span`,{children:e.activity}),a&&(0,S.jsxs)(`span`,{children:[Kd(a.at),` `,a.kind,`: `,a.text]})]})},e.id)})})},e.name)}),(0,S.jsx)(Gx,{title:`Your picks (${c.length})`,children:c.length===0?(0,S.jsxs)(Vd,{children:[(0,S.jsxs)(Hd,{children:[(0,S.jsx)(Ud,{children:`Nothing picked`}),(0,S.jsx)(Wd,{children:`Picks go before anything auto mode queues. Find work under Candidates.`})]}),(0,S.jsx)(Gd,{children:(0,S.jsx)(vf,{variant:`outline`,onClick:n,children:`Browse candidates`})})]}):(0,S.jsx)(Fx,{children:(0,S.jsx)(yJ,{mode:`popLayout`,initial:!1,children:c.map((e,n)=>(0,S.jsx)(aQ,{children:(0,S.jsxs)(Wx,{leading:(0,S.jsx)(lD,{state:e.state}),title:u(e,!0),meta:(0,S.jsx)(iQ,{job:e,byId:s}),children:[(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move up`,disabled:n===0,onClick:()=>t(()=>rf.move(e.id,n-1)),children:(0,S.jsx)(yu,{})}),(0,S.jsx)(vf,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move down`,disabled:n===c.length-1,onClick:()=>t(()=>rf.move(e.id,n+1)),children:(0,S.jsx)(hu,{})}),d(e)]})},e.id))})})}),(0,S.jsx)(Gx,{title:`Auto (${l.length})`,children:l.length===0?(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o.auto.on?`Auto mode tops this up to 5 jobs per agent while the factory is on.`:`Auto mode is off. Turn it on to keep the queue topped up from workwork.`}):(0,S.jsx)(Fx,{children:(0,S.jsx)(yJ,{mode:`popLayout`,initial:!1,children:l.map(e=>(0,S.jsx)(aQ,{children:(0,S.jsx)(Wx,{leading:(0,S.jsx)(lD,{state:e.state}),title:u(e,!0),meta:(0,S.jsx)(iQ,{job:e,byId:s}),children:d(e)})},e.id))})})})]})}function sQ({snapshot:e,act:t}){let[n,r]=(0,v.useState)(!1);return(0,S.jsxs)(jy,{open:n,onOpenChange:r,children:[(0,S.jsx)(My,{render:(0,S.jsx)(vf,{variant:`ghost`,size:`icon`,"aria-label":`Settings`}),children:(0,S.jsx)(Cd,{})}),(0,S.jsxs)(Fy,{className:`sm:max-w-xl`,children:[(0,S.jsxs)(Iy,{children:[(0,S.jsx)(Ry,{children:`Settings`}),(0,S.jsx)(zy,{children:`Defaults for every run, and what auto mode may queue. Closing without saving discards changes.`})]}),(0,S.jsx)(cQ,{snapshot:e,act:t,onSaved:()=>r(!1)})]})]})}function cQ({snapshot:e,act:t,onSaved:n}){let[r,i]=(0,v.useState)(e.settings),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),l={...r,auto:{...r.auto,on:e.settings.auto.on}},u=JSON.stringify(l)===JSON.stringify(e.settings);(0,v.useEffect)(()=>{rf.candidates().then(e=>{o([...new Set(e.items.map(e=>e.play))].sort()),c([...new Set(e.items.map(e=>e.repo))].sort())})},[e.candidates.at]);let d=r.auto,f=e=>i({...r,auto:{...d,...e}});return(0,S.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),t(async()=>{await rf.saveSettings(l),n()})},children:[(0,S.jsxs)(lx,{defaultValue:`runs`,children:[(0,S.jsxs)(dx,{children:[(0,S.jsx)(fx,{value:`runs`,children:`Runs`}),(0,S.jsx)(fx,{value:`presets`,children:`Presets`}),(0,S.jsx)(fx,{value:`tiers`,children:`Tiers`}),(0,S.jsx)(fx,{value:`auto`,children:`Auto mode`}),(0,S.jsx)(fx,{value:`chat`,children:`Live Agent`})]}),(0,S.jsxs)(`div`,{className:`mt-2 grid`,children:[(0,S.jsx)(uQ,{value:`runs`,children:(0,S.jsxs)(TE,{children:[(0,S.jsx)(HE,{value:r,onChange:e=>i({...r,...e})}),(0,S.jsxs)(DE,{orientation:`horizontal`,children:[(0,S.jsx)(kE,{htmlFor:`idle`,children:`Minutes without a sign of life before an attempt times out`}),(0,S.jsx)(Uf,{id:`idle`,type:`number`,className:`w-20`,min:1,value:r.idle,onChange:e=>i({...r,idle:Number(e.target.value)})})]})]})}),(0,S.jsx)(uQ,{value:`presets`,children:(0,S.jsx)(lQ,{value:r.presets,onChange:e=>i({...r,presets:e})})}),(0,S.jsx)(uQ,{value:`tiers`,children:(0,S.jsx)(fQ,{presets:r.presets,value:r.tiers,onChange:e=>i({...r,tiers:e})})}),(0,S.jsx)(uQ,{value:`auto`,children:(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`While the factory is on, auto mode keeps up to 5 jobs per agent queued, cheapest attention first, and never queues a candidate that already had a job. An empty filter allows everything.`}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Levels`}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,value:d.levels,onValueChange:e=>f({levels:e}),children:[`auto`,`skim`,`decide`].map(e=>(0,S.jsx)(SZ,{value:e,children:e},e))})]}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Plays`}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,className:`flex-wrap`,value:d.plays,onValueChange:e=>f({plays:e}),children:a.map(e=>(0,S.jsx)(SZ,{value:e,children:e},e))})]}),(0,S.jsxs)(DE,{children:[(0,S.jsx)(kE,{children:`Repos`}),(0,S.jsx)(xZ,{multiple:!0,variant:`outline`,className:`flex-wrap`,value:d.repos,onValueChange:e=>f({repos:e}),children:s.map(e=>(0,S.jsx)(SZ,{value:e,children:Yd(e)},e))})]})]})}),(0,S.jsx)(uQ,{value:`chat`,children:(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`The agent you plan the queue with. Changing it starts a new chat.`}),(0,S.jsxs)(DE,{orientation:`horizontal`,children:[(0,S.jsx)(qE,{label:`Chat agent`,className:`w-24 flex-none`,items:Kx.map(e=>({value:e,label:tf(e)})),value:r.chat.agent,onChange:e=>e&&i({...r,chat:{agent:e}})}),(0,S.jsx)(GE,{agent:r.chat.agent,value:r.chat,onChange:e=>i({...r,chat:{...e,agent:r.chat.agent}})})]})]})})]})]}),(0,S.jsx)(Ly,{children:(0,S.jsx)(vf,{type:`submit`,disabled:u,children:`Save`})})]})}function lQ({value:e,onChange:t}){let n=(n,r)=>t(e.map((e,t)=>t===n?r:e));return(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`Queue a candidate with one of these from the arrow next to its Queue button. Tiers run on them too: workers is how many run at once (empty: one once a tier lists it), and k ctx the context size, in thousands of tokens, where the agent compacts (empty: 90 for Haiku, 200 otherwise).`}),e.map((r,i)=>(0,S.jsxs)(DE,{orientation:`horizontal`,children:[(0,S.jsx)(qE,{label:`Preset agent`,className:`w-24 flex-none`,items:Kx.map(e=>({value:e,label:tf(e)})),value:r.agent,onChange:e=>e&&n(i,{agent:e})}),(0,S.jsx)(GE,{agent:r.agent,value:r,onChange:e=>n(i,{...r,...e,agent:r.agent})}),(0,S.jsx)(Uf,{"aria-label":`Workers`,type:`number`,min:0,className:`w-16`,placeholder:`workers`,value:r.workers??``,onChange:e=>n(i,{...r,workers:e.target.value===``?void 0:Number(e.target.value)})}),(0,S.jsx)(Uf,{"aria-label":`Compact at, thousands of tokens`,type:`number`,min:10,className:`w-20`,placeholder:`k ctx`,value:r.compactAt?r.compactAt/1e3:``,onChange:e=>n(i,{...r,compactAt:e.target.value===``?void 0:Number(e.target.value)*1e3})}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove preset`,onClick:()=>t(e.filter((e,t)=>t!==i)),children:(0,S.jsx)(Fd,{})})]},i)),(0,S.jsxs)(vf,{type:`button`,variant:`outline`,className:`self-start`,onClick:()=>t([...e,{agent:Kx[0]}]),children:[(0,S.jsx)(_d,{}),` Add preset`]})]})}function uQ(e){return(0,S.jsx)(px,{keepMounted:!0,hidden:!1,className:`col-start-1 row-start-1 data-hidden:invisible`,...e})}var dQ={communicator:`decomposition, UX, visual design, copy: anything judged by taste`,builder:`architecture, foundations, tricky logic, reviews`,grunt:`well-specified mechanical work`};function fQ({presets:e,value:t,onChange:n}){let[r,i]=(0,v.useState)(),a=e.map(kv),o=(e,r)=>n({...t,[e]:r}),s=(e,n,r)=>{let i=[...t[e]],[a]=i.splice(n,1);i.splice(r,0,a),o(e,i)};return(0,S.jsxs)(TE,{children:[(0,S.jsx)(AE,{children:`A goal's node runs on the first preset of its tier whose usage limit isn't hit and that has a free worker. A tier with no presets here runs on the run's agents.`}),Ov.map(e=>{let n=t[e],c=a.filter(e=>!n.includes(e));return(0,S.jsxs)(DE,{children:[(0,S.jsxs)(kE,{children:[e,` `,(0,S.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:dQ[e]})]}),(0,S.jsx)(`ol`,{className:`flex flex-col gap-1`,children:n.map((t,c)=>(0,S.jsxs)(`li`,{draggable:!0,onDragStart:()=>i({tier:e,index:c}),onDragOver:t=>r?.tier===e&&t.preventDefault(),onDrop:()=>{r?.tier===e&&s(e,r.index,c),i(void 0)},className:`flex items-center gap-1 rounded-md border px-2 py-1 text-sm`,children:[(0,S.jsx)(td,{className:`size-4 cursor-grab text-muted-foreground`}),(0,S.jsxs)(`span`,{className:`flex-1`,children:[c+1,`. `,t,!a.includes(t)&&(0,S.jsx)(`span`,{className:`text-destructive`,children:` (no such preset)`})]}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Move up`,disabled:c===0,onClick:()=>s(e,c,c-1),children:(0,S.jsx)(yu,{})}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Move down`,disabled:c===n.length-1,onClick:()=>s(e,c,c+1),children:(0,S.jsx)(hu,{})}),(0,S.jsx)(vf,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove from tier`,onClick:()=>o(e,n.filter(e=>e!==t)),children:(0,S.jsx)(Fd,{})})]},t))}),c.length>0&&(0,S.jsx)(qE,{label:`Add a preset to ${e}`,className:`w-56`,items:[{value:``,label:`Add a preset…`},...c.map(e=>({value:e,label:e}))],value:``,onChange:t=>t&&o(e,[...n,t])})]},e)})]})}function pQ(){let{snapshot:e,error:t,act:n}=af(),[r,i]=(0,v.useState)(``);return e?(0,S.jsx)(PI,{title:`Live Agent`,agent:(0,S.jsx)(nQ,{agent:e.settings.chat.agent,prompt:r,onPromptChange:i}),children:(0,S.jsx)(mQ,{snapshot:e,error:t,act:n,onAsk:i})}):(0,S.jsx)(`div`,{className:`flex min-h-svh items-center justify-center gap-2 p-4 text-muted-foreground`,children:t??(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(By,{}),` Loading`]})})}function mQ({snapshot:e,error:t,act:n,onAsk:r}){let[i,a]=bx(`tab`,`queue`),{isMobile:o,setOpen:s,setOpenMobile:c}=kI(),{on:l,status:u}=e,d=e.jobs.filter(e=>e.state===`queued`&&!e.of&&!e.goal).length,f=e.jobs.filter(e=>e.goal&&e.state!==`removed`&&e.state!==`done`),p=f.filter(e=>e.blocked===`checkpoint`).length,m=l&&u?[`since ${Kd(Zd(u.run))}`,u.limit===null?`always waits for usage resets`:u.limit===1?`stops at usage limits`:`waits for ${u.limit-1} usage reset${u.limit>2?`s`:``}`,u.until&&`until ${Kd(u.until)}`].filter(Boolean).join(` · `):``;return(0,S.jsxs)(`div`,{className:`mx-auto flex min-h-svh w-full max-w-5xl flex-col gap-6 p-4`,children:[(0,S.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,S.jsxs)(`div`,{className:`flex flex-1 items-center gap-2`,children:[(0,S.jsxs)(`h1`,{className:`flex items-center gap-2 font-heading text-xl font-semibold`,children:[(0,S.jsx)(qZ,{working:l}),`Factory`]}),(0,S.jsx)(cf,{variant:l?`accent`:`outline`,children:l?`on`:`off`}),(0,S.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:m})]}),(0,S.jsx)(kZ,{snapshot:e,act:n}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(aZ,{}),(0,S.jsx)(sQ,{snapshot:e,act:n})]})]}),t&&(0,S.jsx)(`p`,{role:`alert`,className:`text-sm wrap-anywhere whitespace-pre-line text-destructive`,children:t}),(0,S.jsxs)(lx,{value:i,onValueChange:a,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`div`,{className:`min-w-0 overflow-x-auto overflow-y-hidden`,children:(0,S.jsxs)(dx,{children:[(0,S.jsxs)(fx,{value:`queue`,children:[(0,S.jsx)(ad,{}),`Queue`,d?` (${d})`:``]}),(0,S.jsxs)(fx,{value:`goals`,children:[(0,S.jsx)(jd,{}),`Goals`,f.length?` (${f.length})`:``,p>0&&(0,S.jsx)(cf,{variant:`accent`,children:p})]}),(0,S.jsxs)(fx,{value:`candidates`,children:[(0,S.jsx)(rd,{}),`Candidates`]}),(0,S.jsxs)(fx,{value:`results`,children:[(0,S.jsx)(dd,{}),`Results`]}),(0,S.jsxs)(fx,{value:`activity`,children:[(0,S.jsx)(pu,{}),`Activity`]})]})}),(0,S.jsx)(`div`,{className:`ml-auto`})]}),(0,S.jsx)(px,{value:`queue`,children:(0,S.jsx)(oQ,{snapshot:e,act:n,onCandidates:()=>a(`candidates`)})}),(0,S.jsx)(px,{value:`goals`,children:(0,S.jsx)(zZ,{snapshot:e,act:n})}),(0,S.jsx)(px,{value:`candidates`,children:(0,S.jsx)(DZ,{snapshot:e,act:n})}),(0,S.jsx)(px,{value:`activity`,children:(0,S.jsx)(ED,{snapshot:e,act:n})}),(0,S.jsx)(px,{value:`results`,children:(0,S.jsx)(eD,{snapshot:e,act:n,onAsk:e=>{r(e),(o?c:s)(!0)}})})]})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(v.StrictMode,{children:(0,S.jsx)(F,{themes:b,storageKey:Zl,children:(0,S.jsx)(Yl,{children:(0,S.jsx)(pQ,{})})})}));
|