@dudousxd/nestjs-telescope-ui 1.24.1 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,14 +30,14 @@ var AB=Object.defineProperty;var sP=e=>{throw TypeError(e)};var CB=(e,t,n)=>t in
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var JB=O,fr=QB;function re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var BR=new Set,af={};function ks(e,t){Fl(e,t),Fl(e+"Capture",t)}function Fl(e,t){for(af[e]=t,e=0;e<t.length;e++)BR.add(t[e])}var Zi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gx=Object.prototype.hasOwnProperty,ZB=/^[: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]*$/,fP={},dP={};function e3(e){return gx.call(dP,e)?!0:gx.call(fP,e)?!1:ZB.test(e)?dP[e]=!0:(fP[e]=!0,!1)}function t3(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function n3(e,t,n,r){if(t===null||typeof t>"u"||t3(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Un(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){dn[e]=new Un(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];dn[t]=new Un(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){dn[e]=new Un(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){dn[e]=new Un(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){dn[e]=new Un(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){dn[e]=new Un(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){dn[e]=new Un(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){dn[e]=new Un(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){dn[e]=new Un(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kw=/[\-:]([a-z])/g;function qw(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Kw,qw);dn[t]=new Un(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Kw,qw);dn[t]=new Un(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Kw,qw);dn[t]=new Un(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){dn[e]=new Un(e,1,!1,e.toLowerCase(),null,!1,!1)});dn.xlinkHref=new Un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){dn[e]=new Un(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gw(e,t,n,r){var i=dn.hasOwnProperty(t)?dn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(n3(t,n,i,r)&&(n=null),r||i===null?e3(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var fo=JB.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qd=Symbol.for("react.element"),Ys=Symbol.for("react.portal"),Qs=Symbol.for("react.fragment"),Xw=Symbol.for("react.strict_mode"),yx=Symbol.for("react.profiler"),UR=Symbol.for("react.provider"),zR=Symbol.for("react.context"),Yw=Symbol.for("react.forward_ref"),vx=Symbol.for("react.suspense"),xx=Symbol.for("react.suspense_list"),Qw=Symbol.for("react.memo"),_o=Symbol.for("react.lazy"),HR=Symbol.for("react.offscreen"),pP=Symbol.iterator;function ic(e){return e===null||typeof e!="object"?null:(e=pP&&e[pP]||e["@@iterator"],typeof e=="function"?e:null)}var jt=Object.assign,Ky;function Cc(e){if(Ky===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ky=t&&t[1]||""}return`
33
+ */var JB=O,fr=QB;function re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var BR=new Set,af={};function ks(e,t){Fl(e,t),Fl(e+"Capture",t)}function Fl(e,t){for(af[e]=t,e=0;e<t.length;e++)BR.add(t[e])}var Zi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gx=Object.prototype.hasOwnProperty,ZB=/^[: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]*$/,fP={},dP={};function e3(e){return gx.call(dP,e)?!0:gx.call(fP,e)?!1:ZB.test(e)?dP[e]=!0:(fP[e]=!0,!1)}function t3(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function n3(e,t,n,r){if(t===null||typeof t>"u"||t3(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Un(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){dn[e]=new Un(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];dn[t]=new Un(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){dn[e]=new Un(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){dn[e]=new Un(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){dn[e]=new Un(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){dn[e]=new Un(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){dn[e]=new Un(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){dn[e]=new Un(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){dn[e]=new Un(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kw=/[\-:]([a-z])/g;function qw(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Kw,qw);dn[t]=new Un(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Kw,qw);dn[t]=new Un(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Kw,qw);dn[t]=new Un(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){dn[e]=new Un(e,1,!1,e.toLowerCase(),null,!1,!1)});dn.xlinkHref=new Un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){dn[e]=new Un(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gw(e,t,n,r){var i=dn.hasOwnProperty(t)?dn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(n3(t,n,i,r)&&(n=null),r||i===null?e3(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var fo=JB.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qd=Symbol.for("react.element"),Ys=Symbol.for("react.portal"),Qs=Symbol.for("react.fragment"),Xw=Symbol.for("react.strict_mode"),yx=Symbol.for("react.profiler"),UR=Symbol.for("react.provider"),zR=Symbol.for("react.context"),Yw=Symbol.for("react.forward_ref"),vx=Symbol.for("react.suspense"),xx=Symbol.for("react.suspense_list"),Qw=Symbol.for("react.memo"),_o=Symbol.for("react.lazy"),HR=Symbol.for("react.offscreen"),pP=Symbol.iterator;function ic(e){return e===null||typeof e!="object"?null:(e=pP&&e[pP]||e["@@iterator"],typeof e=="function"?e:null)}var Et=Object.assign,Ky;function Cc(e){if(Ky===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ky=t&&t[1]||""}return`
34
34
  `+Ky+e}var qy=!1;function Gy(e,t){if(!e||qy)return"";qy=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
35
  `),o=r.stack.split(`
36
36
  `),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
37
- `+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{qy=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cc(e):""}function r3(e){switch(e.tag){case 5:return Cc(e.type);case 16:return Cc("Lazy");case 13:return Cc("Suspense");case 19:return Cc("SuspenseList");case 0:case 2:case 15:return e=Gy(e.type,!1),e;case 11:return e=Gy(e.type.render,!1),e;case 1:return e=Gy(e.type,!0),e;default:return""}}function bx(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qs:return"Fragment";case Ys:return"Portal";case yx:return"Profiler";case Xw:return"StrictMode";case vx:return"Suspense";case xx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zR:return(e.displayName||"Context")+".Consumer";case UR:return(e._context.displayName||"Context")+".Provider";case Yw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qw:return t=e.displayName||null,t!==null?t:bx(e.type)||"Memo";case _o:t=e._payload,e=e._init;try{return bx(e(t))}catch{}}return null}function i3(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bx(t);case 8:return t===Xw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ua(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function VR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function o3(e){var t=VR(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gd(e){e._valueTracker||(e._valueTracker=o3(e))}function WR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=VR(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wx(e,t){var n=t.checked;return jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ua(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function KR(e,t){t=t.checked,t!=null&&Gw(e,"checked",t,!1)}function Sx(e,t){KR(e,t);var n=ua(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ox(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ox(e,t.type,ua(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ox(e,t,n){(t!=="number"||ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tc=Array.isArray;function pl(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=""+ua(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 Px(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return jt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(re(92));if(Tc(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ua(n)}}function qR(e,t){var n=ua(t.value),r=ua(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function yP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function GR(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jx(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?GR(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xd,XR=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xd=Xd||document.createElement("div"),Xd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},a3=["Webkit","ms","Moz","O"];Object.keys(Fc).forEach(function(e){a3.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fc[t]=Fc[e]})});function YR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fc.hasOwnProperty(e)&&Fc[e]?(""+t).trim():t+"px"}function QR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=YR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var s3=jt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ex(e,t){if(t){if(s3[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Ax(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Cx=null;function Jw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tx=null,hl=null,ml=null;function vP(e){if(e=bd(e)){if(typeof Tx!="function")throw Error(re(280));var t=e.stateNode;t&&(t=ug(t),Tx(e.stateNode,e.type,t))}}function JR(e){hl?ml?ml.push(e):ml=[e]:hl=e}function ZR(){if(hl){var e=hl,t=ml;if(ml=hl=null,vP(e),t)for(e=0;e<t.length;e++)vP(t[e])}}function ek(e,t){return e(t)}function tk(){}var Xy=!1;function nk(e,t,n){if(Xy)return e(t,n);Xy=!0;try{return ek(e,t,n)}finally{Xy=!1,(hl!==null||ml!==null)&&(tk(),ZR())}}function lf(e,t){var n=e.stateNode;if(n===null)return null;var r=ug(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var _x=!1;if(Zi)try{var oc={};Object.defineProperty(oc,"passive",{get:function(){_x=!0}}),window.addEventListener("test",oc,oc),window.removeEventListener("test",oc,oc)}catch{_x=!1}function l3(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Bc=!1,fh=null,dh=!1,Rx=null,u3={onError:function(e){Bc=!0,fh=e}};function c3(e,t,n,r,i,o,a,s,l){Bc=!1,fh=null,l3.apply(u3,arguments)}function f3(e,t,n,r,i,o,a,s,l){if(c3.apply(this,arguments),Bc){if(Bc){var u=fh;Bc=!1,fh=null}else throw Error(re(198));dh||(dh=!0,Rx=u)}}function Ns(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function rk(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function xP(e){if(Ns(e)!==e)throw Error(re(188))}function d3(e){var t=e.alternate;if(!t){if(t=Ns(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return xP(i),e;if(o===r)return xP(i),t;o=o.sibling}throw Error(re(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function ik(e){return e=d3(e),e!==null?ok(e):null}function ok(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ok(e);if(t!==null)return t;e=e.sibling}return null}var ak=fr.unstable_scheduleCallback,bP=fr.unstable_cancelCallback,p3=fr.unstable_shouldYield,h3=fr.unstable_requestPaint,Nt=fr.unstable_now,m3=fr.unstable_getCurrentPriorityLevel,Zw=fr.unstable_ImmediatePriority,sk=fr.unstable_UserBlockingPriority,ph=fr.unstable_NormalPriority,g3=fr.unstable_LowPriority,lk=fr.unstable_IdlePriority,og=null,gi=null;function y3(e){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(og,e,void 0,(e.current.flags&128)===128)}catch{}}var Kr=Math.clz32?Math.clz32:b3,v3=Math.log,x3=Math.LN2;function b3(e){return e>>>=0,e===0?32:31-(v3(e)/x3|0)|0}var Yd=64,Qd=4194304;function _c(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=_c(s):(o&=a,o!==0&&(r=_c(o)))}else a=n&~i,a!==0?r=_c(a):o!==0&&(r=_c(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Kr(t),i=1<<n,r|=e[n],t&=~i;return r}function w3(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function S3(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Kr(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=w3(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function kx(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function uk(){var e=Yd;return Yd<<=1,!(Yd&4194240)&&(Yd=64),e}function Yy(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kr(t),e[t]=n}function O3(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Kr(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function eS(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Kr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ye=0;function ck(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fk,tS,dk,pk,hk,Nx=!1,Jd=[],Yo=null,Qo=null,Jo=null,uf=new Map,cf=new Map,No=[],P3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function wP(e,t){switch(e){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Qo=null;break;case"mouseover":case"mouseout":Jo=null;break;case"pointerover":case"pointerout":uf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cf.delete(t.pointerId)}}function ac(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=bd(t),t!==null&&tS(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function j3(e,t,n,r,i){switch(t){case"focusin":return Yo=ac(Yo,e,t,n,r,i),!0;case"dragenter":return Qo=ac(Qo,e,t,n,r,i),!0;case"mouseover":return Jo=ac(Jo,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return uf.set(o,ac(uf.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,cf.set(o,ac(cf.get(o)||null,e,t,n,r,i)),!0}return!1}function mk(e){var t=Ua(e.target);if(t!==null){var n=Ns(t);if(n!==null){if(t=n.tag,t===13){if(t=rk(n),t!==null){e.blockedOn=t,hk(e.priority,function(){dk(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 Hp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$x(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cx=r,n.target.dispatchEvent(r),Cx=null}else return t=bd(n),t!==null&&tS(t),e.blockedOn=n,!1;t.shift()}return!0}function SP(e,t,n){Hp(e)&&n.delete(t)}function E3(){Nx=!1,Yo!==null&&Hp(Yo)&&(Yo=null),Qo!==null&&Hp(Qo)&&(Qo=null),Jo!==null&&Hp(Jo)&&(Jo=null),uf.forEach(SP),cf.forEach(SP)}function sc(e,t){e.blockedOn===t&&(e.blockedOn=null,Nx||(Nx=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,E3)))}function ff(e){function t(i){return sc(i,e)}if(0<Jd.length){sc(Jd[0],e);for(var n=1;n<Jd.length;n++){var r=Jd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yo!==null&&sc(Yo,e),Qo!==null&&sc(Qo,e),Jo!==null&&sc(Jo,e),uf.forEach(t),cf.forEach(t),n=0;n<No.length;n++)r=No[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<No.length&&(n=No[0],n.blockedOn===null);)mk(n),n.blockedOn===null&&No.shift()}var gl=fo.ReactCurrentBatchConfig,mh=!0;function A3(e,t,n,r){var i=Ye,o=gl.transition;gl.transition=null;try{Ye=1,nS(e,t,n,r)}finally{Ye=i,gl.transition=o}}function C3(e,t,n,r){var i=Ye,o=gl.transition;gl.transition=null;try{Ye=4,nS(e,t,n,r)}finally{Ye=i,gl.transition=o}}function nS(e,t,n,r){if(mh){var i=$x(e,t,n,r);if(i===null)av(e,t,r,gh,n),wP(e,r);else if(j3(i,e,t,n,r))r.stopPropagation();else if(wP(e,r),t&4&&-1<P3.indexOf(e)){for(;i!==null;){var o=bd(i);if(o!==null&&fk(o),o=$x(e,t,n,r),o===null&&av(e,t,r,gh,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else av(e,t,r,null,n)}}var gh=null;function $x(e,t,n,r){if(gh=null,e=Jw(r),e=Ua(e),e!==null)if(t=Ns(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rk(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 gh=e,null}function gk(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(m3()){case Zw:return 1;case sk:return 4;case ph:case g3:return 16;case lk:return 536870912;default:return 16}default:return 16}}var Vo=null,rS=null,Vp=null;function yk(){if(Vp)return Vp;var e,t=rS,n=t.length,r,i="value"in Vo?Vo.value:Vo.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return Vp=i.slice(e,1<r?1-r:void 0)}function Wp(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 Zd(){return!0}function OP(){return!1}function hr(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Zd:OP,this.isPropagationStopped=OP,this}return jt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Zd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zd)},persist:function(){},isPersistent:Zd}),t}var Cu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},iS=hr(Cu),xd=jt({},Cu,{view:0,detail:0}),T3=hr(xd),Qy,Jy,lc,ag=jt({},xd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oS,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!==lc&&(lc&&e.type==="mousemove"?(Qy=e.screenX-lc.screenX,Jy=e.screenY-lc.screenY):Jy=Qy=0,lc=e),Qy)},movementY:function(e){return"movementY"in e?e.movementY:Jy}}),PP=hr(ag),_3=jt({},ag,{dataTransfer:0}),R3=hr(_3),k3=jt({},xd,{relatedTarget:0}),Zy=hr(k3),N3=jt({},Cu,{animationName:0,elapsedTime:0,pseudoElement:0}),$3=hr(N3),M3=jt({},Cu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),I3=hr(M3),D3=jt({},Cu,{data:0}),jP=hr(D3),L3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F3={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"},B3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function U3(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=B3[e])?!!t[e]:!1}function oS(){return U3}var z3=jt({},xd,{key:function(e){if(e.key){var t=L3[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F3[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oS,charCode:function(e){return e.type==="keypress"?Wp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),H3=hr(z3),V3=jt({},ag,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),EP=hr(V3),W3=jt({},xd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oS}),K3=hr(W3),q3=jt({},Cu,{propertyName:0,elapsedTime:0,pseudoElement:0}),G3=hr(q3),X3=jt({},ag,{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}),Y3=hr(X3),Q3=[9,13,27,32],aS=Zi&&"CompositionEvent"in window,Uc=null;Zi&&"documentMode"in document&&(Uc=document.documentMode);var J3=Zi&&"TextEvent"in window&&!Uc,vk=Zi&&(!aS||Uc&&8<Uc&&11>=Uc),AP=" ",CP=!1;function xk(e,t){switch(e){case"keyup":return Q3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function Z3(e,t){switch(e){case"compositionend":return bk(t);case"keypress":return t.which!==32?null:(CP=!0,AP);case"textInput":return e=t.data,e===AP&&CP?null:e;default:return null}}function e4(e,t){if(Js)return e==="compositionend"||!aS&&xk(e,t)?(e=yk(),Vp=rS=Vo=null,Js=!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 vk&&t.locale!=="ko"?null:t.data;default:return null}}var t4={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 TP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!t4[e.type]:t==="textarea"}function wk(e,t,n,r){JR(r),t=yh(t,"onChange"),0<t.length&&(n=new iS("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var zc=null,df=null;function n4(e){kk(e,0)}function sg(e){var t=tl(e);if(WR(t))return e}function r4(e,t){if(e==="change")return t}var Sk=!1;if(Zi){var ev;if(Zi){var tv="oninput"in document;if(!tv){var _P=document.createElement("div");_P.setAttribute("oninput","return;"),tv=typeof _P.oninput=="function"}ev=tv}else ev=!1;Sk=ev&&(!document.documentMode||9<document.documentMode)}function RP(){zc&&(zc.detachEvent("onpropertychange",Ok),df=zc=null)}function Ok(e){if(e.propertyName==="value"&&sg(df)){var t=[];wk(t,df,e,Jw(e)),nk(n4,t)}}function i4(e,t,n){e==="focusin"?(RP(),zc=t,df=n,zc.attachEvent("onpropertychange",Ok)):e==="focusout"&&RP()}function o4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sg(df)}function a4(e,t){if(e==="click")return sg(t)}function s4(e,t){if(e==="input"||e==="change")return sg(t)}function l4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yr=typeof Object.is=="function"?Object.is:l4;function pf(e,t){if(Yr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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(!gx.call(t,i)||!Yr(e[i],t[i]))return!1}return!0}function kP(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function NP(e,t){var n=kP(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kP(n)}}function Pk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jk(){for(var e=window,t=ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ch(e.document)}return t}function sS(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")}function u4(e){var t=jk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pk(n.ownerDocument.documentElement,n)){if(r!==null&&sS(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=NP(n,o);var a=NP(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var c4=Zi&&"documentMode"in document&&11>=document.documentMode,Zs=null,Mx=null,Hc=null,Ix=!1;function $P(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ix||Zs==null||Zs!==ch(r)||(r=Zs,"selectionStart"in r&&sS(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}),Hc&&pf(Hc,r)||(Hc=r,r=yh(Mx,"onSelect"),0<r.length&&(t=new iS("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function ep(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var el={animationend:ep("Animation","AnimationEnd"),animationiteration:ep("Animation","AnimationIteration"),animationstart:ep("Animation","AnimationStart"),transitionend:ep("Transition","TransitionEnd")},nv={},Ek={};Zi&&(Ek=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function lg(e){if(nv[e])return nv[e];if(!el[e])return e;var t=el[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ek)return nv[e]=t[n];return e}var Ak=lg("animationend"),Ck=lg("animationiteration"),Tk=lg("animationstart"),_k=lg("transitionend"),Rk=new Map,MP="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function va(e,t){Rk.set(e,t),ks(t,[e])}for(var rv=0;rv<MP.length;rv++){var iv=MP[rv],f4=iv.toLowerCase(),d4=iv[0].toUpperCase()+iv.slice(1);va(f4,"on"+d4)}va(Ak,"onAnimationEnd");va(Ck,"onAnimationIteration");va(Tk,"onAnimationStart");va("dblclick","onDoubleClick");va("focusin","onFocus");va("focusout","onBlur");va(_k,"onTransitionEnd");Fl("onMouseEnter",["mouseout","mouseover"]);Fl("onMouseLeave",["mouseout","mouseover"]);Fl("onPointerEnter",["pointerout","pointerover"]);Fl("onPointerLeave",["pointerout","pointerover"]);ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ks("onBeforeInput",["compositionend","keypress","textInput","paste"]);ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rc="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(" "),p4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rc));function IP(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,f3(r,t,void 0,e),e.currentTarget=null}function kk(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;IP(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;IP(i,s,u),o=l}}}if(dh)throw e=Rx,dh=!1,Rx=null,e}function dt(e,t){var n=t[Ux];n===void 0&&(n=t[Ux]=new Set);var r=e+"__bubble";n.has(r)||(Nk(t,e,2,!1),n.add(r))}function ov(e,t,n){var r=0;t&&(r|=4),Nk(n,e,r,t)}var tp="_reactListening"+Math.random().toString(36).slice(2);function hf(e){if(!e[tp]){e[tp]=!0,BR.forEach(function(n){n!=="selectionchange"&&(p4.has(n)||ov(n,!1,e),ov(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tp]||(t[tp]=!0,ov("selectionchange",!1,t))}}function Nk(e,t,n,r){switch(gk(t)){case 1:var i=A3;break;case 4:i=C3;break;default:i=nS}n=i.bind(null,t,n,e),i=void 0,!_x||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function av(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Ua(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}nk(function(){var u=o,c=Jw(n),f=[];e:{var p=Rk.get(e);if(p!==void 0){var h=iS,v=e;switch(e){case"keypress":if(Wp(n)===0)break e;case"keydown":case"keyup":h=H3;break;case"focusin":v="focus",h=Zy;break;case"focusout":v="blur",h=Zy;break;case"beforeblur":case"afterblur":h=Zy;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=PP;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=R3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=K3;break;case Ak:case Ck:case Tk:h=$3;break;case _k:h=G3;break;case"scroll":h=T3;break;case"wheel":h=Y3;break;case"copy":case"cut":case"paste":h=I3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=EP}var y=(t&4)!==0,x=!y&&e==="scroll",g=y?p!==null?p+"Capture":null:p;y=[];for(var m=u,b;m!==null;){b=m;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,g!==null&&(S=lf(m,g),S!=null&&y.push(mf(m,S,b)))),x)break;m=m.return}0<y.length&&(p=new h(p,v,null,n,c),f.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Cx&&(v=n.relatedTarget||n.fromElement)&&(Ua(v)||v[eo]))break e;if((h||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=u,v=v?Ua(v):null,v!==null&&(x=Ns(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(y=PP,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(y=EP,S="onPointerLeave",g="onPointerEnter",m="pointer"),x=h==null?p:tl(h),b=v==null?p:tl(v),p=new y(S,m+"leave",h,n,c),p.target=x,p.relatedTarget=b,S=null,Ua(c)===u&&(y=new y(g,m+"enter",v,n,c),y.target=b,y.relatedTarget=x,S=y),x=S,h&&v)t:{for(y=h,g=v,m=0,b=y;b;b=Vs(b))m++;for(b=0,S=g;S;S=Vs(S))b++;for(;0<m-b;)y=Vs(y),m--;for(;0<b-m;)g=Vs(g),b--;for(;m--;){if(y===g||g!==null&&y===g.alternate)break t;y=Vs(y),g=Vs(g)}y=null}else y=null;h!==null&&DP(f,p,h,y,!1),v!==null&&x!==null&&DP(f,x,v,y,!0)}}e:{if(p=u?tl(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var w=r4;else if(TP(p))if(Sk)w=s4;else{w=o4;var P=i4}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=a4);if(w&&(w=w(e,u))){wk(f,w,n,c);break e}P&&P(e,p,u),e==="focusout"&&(P=p._wrapperState)&&P.controlled&&p.type==="number"&&Ox(p,"number",p.value)}switch(P=u?tl(u):window,e){case"focusin":(TP(P)||P.contentEditable==="true")&&(Zs=P,Mx=u,Hc=null);break;case"focusout":Hc=Mx=Zs=null;break;case"mousedown":Ix=!0;break;case"contextmenu":case"mouseup":case"dragend":Ix=!1,$P(f,n,c);break;case"selectionchange":if(c4)break;case"keydown":case"keyup":$P(f,n,c)}var j;if(aS)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Js?xk(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(vk&&n.locale!=="ko"&&(Js||E!=="onCompositionStart"?E==="onCompositionEnd"&&Js&&(j=yk()):(Vo=c,rS="value"in Vo?Vo.value:Vo.textContent,Js=!0)),P=yh(u,E),0<P.length&&(E=new jP(E,e,null,n,c),f.push({event:E,listeners:P}),j?E.data=j:(j=bk(n),j!==null&&(E.data=j)))),(j=J3?Z3(e,n):e4(e,n))&&(u=yh(u,"onBeforeInput"),0<u.length&&(c=new jP("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=j))}kk(f,t)})}function mf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function yh(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=lf(e,n),o!=null&&r.unshift(mf(e,o,i)),o=lf(e,t),o!=null&&r.push(mf(e,o,i))),e=e.return}return r}function Vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function DP(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=lf(n,o),l!=null&&a.unshift(mf(n,l,s))):i||(l=lf(n,o),l!=null&&a.push(mf(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var h4=/\r\n?/g,m4=/\u0000|\uFFFD/g;function LP(e){return(typeof e=="string"?e:""+e).replace(h4,`
38
- `).replace(m4,"")}function np(e,t,n){if(t=LP(t),LP(e)!==t&&n)throw Error(re(425))}function vh(){}var Dx=null,Lx=null;function Fx(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bx=typeof setTimeout=="function"?setTimeout:void 0,g4=typeof clearTimeout=="function"?clearTimeout:void 0,FP=typeof Promise=="function"?Promise:void 0,y4=typeof queueMicrotask=="function"?queueMicrotask:typeof FP<"u"?function(e){return FP.resolve(null).then(e).catch(v4)}:Bx;function v4(e){setTimeout(function(){throw e})}function sv(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==="/$"){if(r===0){e.removeChild(i),ff(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ff(t)}function Zo(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==="$?")break;if(t==="/$")return null}}return e}function BP(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Tu=Math.random().toString(36).slice(2),di="__reactFiber$"+Tu,gf="__reactProps$"+Tu,eo="__reactContainer$"+Tu,Ux="__reactEvents$"+Tu,x4="__reactListeners$"+Tu,b4="__reactHandles$"+Tu;function Ua(e){var t=e[di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||n[di]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=BP(e);e!==null;){if(n=e[di])return n;e=BP(e)}return t}e=n,n=e.parentNode}return null}function bd(e){return e=e[di]||e[eo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function tl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function ug(e){return e[gf]||null}var zx=[],nl=-1;function xa(e){return{current:e}}function mt(e){0>nl||(e.current=zx[nl],zx[nl]=null,nl--)}function ut(e,t){nl++,zx[nl]=e.current,e.current=t}var ca={},An=xa(ca),Xn=xa(!1),ps=ca;function Bl(e,t){var n=e.type.contextTypes;if(!n)return ca;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yn(e){return e=e.childContextTypes,e!=null}function xh(){mt(Xn),mt(An)}function UP(e,t,n){if(An.current!==ca)throw Error(re(168));ut(An,t),ut(Xn,n)}function $k(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(re(108,i3(e)||"Unknown",i));return jt({},n,r)}function bh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ca,ps=An.current,ut(An,e),ut(Xn,Xn.current),!0}function zP(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=$k(e,t,ps),r.__reactInternalMemoizedMergedChildContext=e,mt(Xn),mt(An),ut(An,e)):mt(Xn),ut(Xn,n)}var Ii=null,cg=!1,lv=!1;function Mk(e){Ii===null?Ii=[e]:Ii.push(e)}function w4(e){cg=!0,Mk(e)}function ba(){if(!lv&&Ii!==null){lv=!0;var e=0,t=Ye;try{var n=Ii;for(Ye=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ii=null,cg=!1}catch(i){throw Ii!==null&&(Ii=Ii.slice(e+1)),ak(Zw,ba),i}finally{Ye=t,lv=!1}}return null}var rl=[],il=0,wh=null,Sh=0,wr=[],Sr=0,hs=null,Ui=1,zi="";function Ma(e,t){rl[il++]=Sh,rl[il++]=wh,wh=e,Sh=t}function Ik(e,t,n){wr[Sr++]=Ui,wr[Sr++]=zi,wr[Sr++]=hs,hs=e;var r=Ui;e=zi;var i=32-Kr(r)-1;r&=~(1<<i),n+=1;var o=32-Kr(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Ui=1<<32-Kr(t)+i|n<<i|r,zi=o+e}else Ui=1<<o|n<<i|r,zi=e}function lS(e){e.return!==null&&(Ma(e,1),Ik(e,1,0))}function uS(e){for(;e===wh;)wh=rl[--il],rl[il]=null,Sh=rl[--il],rl[il]=null;for(;e===hs;)hs=wr[--Sr],wr[Sr]=null,zi=wr[--Sr],wr[Sr]=null,Ui=wr[--Sr],wr[Sr]=null}var sr=null,ar=null,yt=!1,Vr=null;function Dk(e,t){var n=Pr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function HP(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ar=Zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ar=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hs!==null?{id:Ui,overflow:zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sr=e,ar=null,!0):!1;default:return!1}}function Hx(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vx(e){if(yt){var t=ar;if(t){var n=t;if(!HP(e,t)){if(Hx(e))throw Error(re(418));t=Zo(n.nextSibling);var r=sr;t&&HP(e,t)?Dk(r,n):(e.flags=e.flags&-4097|2,yt=!1,sr=e)}}else{if(Hx(e))throw Error(re(418));e.flags=e.flags&-4097|2,yt=!1,sr=e}}}function VP(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sr=e}function rp(e){if(e!==sr)return!1;if(!yt)return VP(e),yt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fx(e.type,e.memoizedProps)),t&&(t=ar)){if(Hx(e))throw Lk(),Error(re(418));for(;t;)Dk(e,t),t=Zo(t.nextSibling)}if(VP(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ar=Zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ar=null}}else ar=sr?Zo(e.stateNode.nextSibling):null;return!0}function Lk(){for(var e=ar;e;)e=Zo(e.nextSibling)}function Ul(){ar=sr=null,yt=!1}function cS(e){Vr===null?Vr=[e]:Vr.push(e)}var S4=fo.ReactCurrentBatchConfig;function uc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(re(309));var r=n.stateNode}if(!r)throw Error(re(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(re(284));if(!n._owner)throw Error(re(290,e))}return e}function ip(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function WP(e){var t=e._init;return t(e._payload)}function Fk(e){function t(g,m){if(e){var b=g.deletions;b===null?(g.deletions=[m],g.flags|=16):b.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function i(g,m){return g=ra(g,m),g.index=0,g.sibling=null,g}function o(g,m,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<m?(g.flags|=2,m):b):(g.flags|=2,m)):(g.flags|=1048576,m)}function a(g){return e&&g.alternate===null&&(g.flags|=2),g}function s(g,m,b,S){return m===null||m.tag!==6?(m=mv(b,g.mode,S),m.return=g,m):(m=i(m,b),m.return=g,m)}function l(g,m,b,S){var w=b.type;return w===Qs?c(g,m,b.props.children,S,b.key):m!==null&&(m.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===_o&&WP(w)===m.type)?(S=i(m,b.props),S.ref=uc(g,m,b),S.return=g,S):(S=Jp(b.type,b.key,b.props,null,g.mode,S),S.ref=uc(g,m,b),S.return=g,S)}function u(g,m,b,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==b.containerInfo||m.stateNode.implementation!==b.implementation?(m=gv(b,g.mode,S),m.return=g,m):(m=i(m,b.children||[]),m.return=g,m)}function c(g,m,b,S,w){return m===null||m.tag!==7?(m=ss(b,g.mode,S,w),m.return=g,m):(m=i(m,b),m.return=g,m)}function f(g,m,b){if(typeof m=="string"&&m!==""||typeof m=="number")return m=mv(""+m,g.mode,b),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case qd:return b=Jp(m.type,m.key,m.props,null,g.mode,b),b.ref=uc(g,null,m),b.return=g,b;case Ys:return m=gv(m,g.mode,b),m.return=g,m;case _o:var S=m._init;return f(g,S(m._payload),b)}if(Tc(m)||ic(m))return m=ss(m,g.mode,b,null),m.return=g,m;ip(g,m)}return null}function p(g,m,b,S){var w=m!==null?m.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return w!==null?null:s(g,m,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:return b.key===w?l(g,m,b,S):null;case Ys:return b.key===w?u(g,m,b,S):null;case _o:return w=b._init,p(g,m,w(b._payload),S)}if(Tc(b)||ic(b))return w!==null?null:c(g,m,b,S,null);ip(g,b)}return null}function h(g,m,b,S,w){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(b)||null,s(m,g,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case qd:return g=g.get(S.key===null?b:S.key)||null,l(m,g,S,w);case Ys:return g=g.get(S.key===null?b:S.key)||null,u(m,g,S,w);case _o:var P=S._init;return h(g,m,b,P(S._payload),w)}if(Tc(S)||ic(S))return g=g.get(b)||null,c(m,g,S,w,null);ip(m,S)}return null}function v(g,m,b,S){for(var w=null,P=null,j=m,E=m=0,A=null;j!==null&&E<b.length;E++){j.index>E?(A=j,j=null):A=j.sibling;var C=p(g,j,b[E],S);if(C===null){j===null&&(j=A);break}e&&j&&C.alternate===null&&t(g,j),m=o(C,m,E),P===null?w=C:P.sibling=C,P=C,j=A}if(E===b.length)return n(g,j),yt&&Ma(g,E),w;if(j===null){for(;E<b.length;E++)j=f(g,b[E],S),j!==null&&(m=o(j,m,E),P===null?w=j:P.sibling=j,P=j);return yt&&Ma(g,E),w}for(j=r(g,j);E<b.length;E++)A=h(j,g,E,b[E],S),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?E:A.key),m=o(A,m,E),P===null?w=A:P.sibling=A,P=A);return e&&j.forEach(function(T){return t(g,T)}),yt&&Ma(g,E),w}function y(g,m,b,S){var w=ic(b);if(typeof w!="function")throw Error(re(150));if(b=w.call(b),b==null)throw Error(re(151));for(var P=w=null,j=m,E=m=0,A=null,C=b.next();j!==null&&!C.done;E++,C=b.next()){j.index>E?(A=j,j=null):A=j.sibling;var T=p(g,j,C.value,S);if(T===null){j===null&&(j=A);break}e&&j&&T.alternate===null&&t(g,j),m=o(T,m,E),P===null?w=T:P.sibling=T,P=T,j=A}if(C.done)return n(g,j),yt&&Ma(g,E),w;if(j===null){for(;!C.done;E++,C=b.next())C=f(g,C.value,S),C!==null&&(m=o(C,m,E),P===null?w=C:P.sibling=C,P=C);return yt&&Ma(g,E),w}for(j=r(g,j);!C.done;E++,C=b.next())C=h(j,g,E,C.value,S),C!==null&&(e&&C.alternate!==null&&j.delete(C.key===null?E:C.key),m=o(C,m,E),P===null?w=C:P.sibling=C,P=C);return e&&j.forEach(function(_){return t(g,_)}),yt&&Ma(g,E),w}function x(g,m,b,S){if(typeof b=="object"&&b!==null&&b.type===Qs&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:e:{for(var w=b.key,P=m;P!==null;){if(P.key===w){if(w=b.type,w===Qs){if(P.tag===7){n(g,P.sibling),m=i(P,b.props.children),m.return=g,g=m;break e}}else if(P.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===_o&&WP(w)===P.type){n(g,P.sibling),m=i(P,b.props),m.ref=uc(g,P,b),m.return=g,g=m;break e}n(g,P);break}else t(g,P);P=P.sibling}b.type===Qs?(m=ss(b.props.children,g.mode,S,b.key),m.return=g,g=m):(S=Jp(b.type,b.key,b.props,null,g.mode,S),S.ref=uc(g,m,b),S.return=g,g=S)}return a(g);case Ys:e:{for(P=b.key;m!==null;){if(m.key===P)if(m.tag===4&&m.stateNode.containerInfo===b.containerInfo&&m.stateNode.implementation===b.implementation){n(g,m.sibling),m=i(m,b.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=gv(b,g.mode,S),m.return=g,g=m}return a(g);case _o:return P=b._init,x(g,m,P(b._payload),S)}if(Tc(b))return v(g,m,b,S);if(ic(b))return y(g,m,b,S);ip(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,m!==null&&m.tag===6?(n(g,m.sibling),m=i(m,b),m.return=g,g=m):(n(g,m),m=mv(b,g.mode,S),m.return=g,g=m),a(g)):n(g,m)}return x}var zl=Fk(!0),Bk=Fk(!1),Oh=xa(null),Ph=null,ol=null,fS=null;function dS(){fS=ol=Ph=null}function pS(e){var t=Oh.current;mt(Oh),e._currentValue=t}function Wx(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function yl(e,t){Ph=e,fS=ol=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qn=!0),e.firstContext=null)}function Tr(e){var t=e._currentValue;if(fS!==e)if(e={context:e,memoizedValue:t,next:null},ol===null){if(Ph===null)throw Error(re(308));ol=e,Ph.dependencies={lanes:0,firstContext:e}}else ol=ol.next=e;return t}var za=null;function hS(e){za===null?za=[e]:za.push(e)}function Uk(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,hS(t)):(n.next=i.next,i.next=n),t.interleaved=n,to(e,r)}function to(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ro=!1;function mS(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ea(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ve&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,to(e,n)}return i=r.interleaved,i===null?(t.next=t,hS(r)):(t.next=i.next,i.next=t),r.interleaved=t,to(e,n)}function Kp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eS(e,n)}}function KP(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jh(e,t,n,r){var i=e.updateQueue;Ro=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;a=0,c=u=l=null,s=o;do{var p=s.lane,h=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,y=s;switch(p=t,h=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){f=v.call(h,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,p=typeof v=="function"?v.call(h,f,p):v,p==null)break e;f=jt({},f,p);break e;case 2:Ro=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=f):c=c.next=h,a|=p;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(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);gs|=a,e.lanes=a,e.memoizedState=f}}function qP(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(re(191,i));i.call(r)}}}var wd={},yi=xa(wd),yf=xa(wd),vf=xa(wd);function Ha(e){if(e===wd)throw Error(re(174));return e}function gS(e,t){switch(ut(vf,t),ut(yf,e),ut(yi,wd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jx(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jx(t,e)}mt(yi),ut(yi,t)}function Hl(){mt(yi),mt(yf),mt(vf)}function Hk(e){Ha(vf.current);var t=Ha(yi.current),n=jx(t,e.type);t!==n&&(ut(yf,e),ut(yi,n))}function yS(e){yf.current===e&&(mt(yi),mt(yf))}var wt=xa(0);function Eh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 uv=[];function vS(){for(var e=0;e<uv.length;e++)uv[e]._workInProgressVersionPrimary=null;uv.length=0}var qp=fo.ReactCurrentDispatcher,cv=fo.ReactCurrentBatchConfig,ms=0,Pt=null,zt=null,Yt=null,Ah=!1,Vc=!1,xf=0,O4=0;function vn(){throw Error(re(321))}function xS(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function bS(e,t,n,r,i,o){if(ms=o,Pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qp.current=e===null||e.memoizedState===null?A4:C4,e=n(r,i),Vc){o=0;do{if(Vc=!1,xf=0,25<=o)throw Error(re(301));o+=1,Yt=zt=null,t.updateQueue=null,qp.current=T4,e=n(r,i)}while(Vc)}if(qp.current=Ch,t=zt!==null&&zt.next!==null,ms=0,Yt=zt=Pt=null,Ah=!1,t)throw Error(re(300));return e}function wS(){var e=xf!==0;return xf=0,e}function ii(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?Pt.memoizedState=Yt=e:Yt=Yt.next=e,Yt}function _r(){if(zt===null){var e=Pt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=Yt===null?Pt.memoizedState:Yt.next;if(t!==null)Yt=t,zt=e;else{if(e===null)throw Error(re(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Yt===null?Pt.memoizedState=Yt=e:Yt=Yt.next=e}return Yt}function bf(e,t){return typeof t=="function"?t(e):t}function fv(e){var t=_r(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=zt,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((ms&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=f,a=r):l=l.next=f,Pt.lanes|=c,gs|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,Yr(r,t.memoizedState)||(qn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Pt.lanes|=o,gs|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function dv(e){var t=_r(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);Yr(o,t.memoizedState)||(qn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vk(){}function Wk(e,t){var n=Pt,r=_r(),i=t(),o=!Yr(r.memoizedState,i);if(o&&(r.memoizedState=i,qn=!0),r=r.queue,SS(Gk.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Yt!==null&&Yt.memoizedState.tag&1){if(n.flags|=2048,wf(9,qk.bind(null,n,r,i,t),void 0,null),Zt===null)throw Error(re(349));ms&30||Kk(n,t,i)}return i}function Kk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pt.updateQueue,t===null?(t={lastEffect:null,stores:null},Pt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qk(e,t,n,r){t.value=n,t.getSnapshot=r,Xk(t)&&Yk(e)}function Gk(e,t,n){return n(function(){Xk(t)&&Yk(e)})}function Xk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch{return!0}}function Yk(e){var t=to(e,1);t!==null&&qr(t,e,1,-1)}function GP(e){var t=ii();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bf,lastRenderedState:e},t.queue=e,e=e.dispatch=E4.bind(null,Pt,e),[t.memoizedState,e]}function wf(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Pt.updateQueue,t===null?(t={lastEffect:null,stores:null},Pt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Qk(){return _r().memoizedState}function Gp(e,t,n,r){var i=ii();Pt.flags|=e,i.memoizedState=wf(1|t,n,void 0,r===void 0?null:r)}function fg(e,t,n,r){var i=_r();r=r===void 0?null:r;var o=void 0;if(zt!==null){var a=zt.memoizedState;if(o=a.destroy,r!==null&&xS(r,a.deps)){i.memoizedState=wf(t,n,o,r);return}}Pt.flags|=e,i.memoizedState=wf(1|t,n,o,r)}function XP(e,t){return Gp(8390656,8,e,t)}function SS(e,t){return fg(2048,8,e,t)}function Jk(e,t){return fg(4,2,e,t)}function Zk(e,t){return fg(4,4,e,t)}function eN(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tN(e,t,n){return n=n!=null?n.concat([e]):null,fg(4,4,eN.bind(null,t,e),n)}function OS(){}function nN(e,t){var n=_r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xS(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rN(e,t){var n=_r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xS(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function iN(e,t,n){return ms&21?(Yr(n,t)||(n=uk(),Pt.lanes|=n,gs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qn=!0),e.memoizedState=n)}function P4(e,t){var n=Ye;Ye=n!==0&&4>n?n:4,e(!0);var r=cv.transition;cv.transition={};try{e(!1),t()}finally{Ye=n,cv.transition=r}}function oN(){return _r().memoizedState}function j4(e,t,n){var r=na(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},aN(e))sN(t,n);else if(n=Uk(e,t,n,r),n!==null){var i=Ln();qr(n,e,r,i),lN(n,t,r)}}function E4(e,t,n){var r=na(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(aN(e))sN(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Yr(s,a)){var l=t.interleaved;l===null?(i.next=i,hS(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Uk(e,t,i,r),n!==null&&(i=Ln(),qr(n,e,r,i),lN(n,t,r))}}function aN(e){var t=e.alternate;return e===Pt||t!==null&&t===Pt}function sN(e,t){Vc=Ah=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lN(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eS(e,n)}}var Ch={readContext:Tr,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},A4={readContext:Tr,useCallback:function(e,t){return ii().memoizedState=[e,t===void 0?null:t],e},useContext:Tr,useEffect:XP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gp(4194308,4,eN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gp(4,2,e,t)},useMemo:function(e,t){var n=ii();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ii();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=j4.bind(null,Pt,e),[r.memoizedState,e]},useRef:function(e){var t=ii();return e={current:e},t.memoizedState=e},useState:GP,useDebugValue:OS,useDeferredValue:function(e){return ii().memoizedState=e},useTransition:function(){var e=GP(!1),t=e[0];return e=P4.bind(null,e[1]),ii().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pt,i=ii();if(yt){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),Zt===null)throw Error(re(349));ms&30||Kk(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,XP(Gk.bind(null,r,o,e),[e]),r.flags|=2048,wf(9,qk.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ii(),t=Zt.identifierPrefix;if(yt){var n=zi,r=Ui;n=(r&~(1<<32-Kr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xf++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=O4++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},C4={readContext:Tr,useCallback:nN,useContext:Tr,useEffect:SS,useImperativeHandle:tN,useInsertionEffect:Jk,useLayoutEffect:Zk,useMemo:rN,useReducer:fv,useRef:Qk,useState:function(){return fv(bf)},useDebugValue:OS,useDeferredValue:function(e){var t=_r();return iN(t,zt.memoizedState,e)},useTransition:function(){var e=fv(bf)[0],t=_r().memoizedState;return[e,t]},useMutableSource:Vk,useSyncExternalStore:Wk,useId:oN,unstable_isNewReconciler:!1},T4={readContext:Tr,useCallback:nN,useContext:Tr,useEffect:SS,useImperativeHandle:tN,useInsertionEffect:Jk,useLayoutEffect:Zk,useMemo:rN,useReducer:dv,useRef:Qk,useState:function(){return dv(bf)},useDebugValue:OS,useDeferredValue:function(e){var t=_r();return zt===null?t.memoizedState=e:iN(t,zt.memoizedState,e)},useTransition:function(){var e=dv(bf)[0],t=_r().memoizedState;return[e,t]},useMutableSource:Vk,useSyncExternalStore:Wk,useId:oN,unstable_isNewReconciler:!1};function Fr(e,t){if(e&&e.defaultProps){t=jt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Kx(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:jt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var dg={isMounted:function(e){return(e=e._reactInternals)?Ns(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ln(),i=na(e),o=qi(r,i);o.payload=t,n!=null&&(o.callback=n),t=ea(e,o,i),t!==null&&(qr(t,e,i,r),Kp(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ln(),i=na(e),o=qi(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ea(e,o,i),t!==null&&(qr(t,e,i,r),Kp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ln(),r=na(e),i=qi(n,r);i.tag=2,t!=null&&(i.callback=t),t=ea(e,i,r),t!==null&&(qr(t,e,r,n),Kp(t,e,r))}};function YP(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!pf(n,r)||!pf(i,o):!0}function uN(e,t,n){var r=!1,i=ca,o=t.contextType;return typeof o=="object"&&o!==null?o=Tr(o):(i=Yn(t)?ps:An.current,r=t.contextTypes,o=(r=r!=null)?Bl(e,i):ca),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=dg,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function QP(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&&dg.enqueueReplaceState(t,t.state,null)}function qx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},mS(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Tr(o):(o=Yn(t)?ps:An.current,i.context=Bl(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Kx(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&dg.enqueueReplaceState(i,i.state,null),jh(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Vl(e,t){try{var n="",r=t;do n+=r3(r),r=r.return;while(r);var i=n}catch(o){i=`
37
+ `+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{qy=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cc(e):""}function r3(e){switch(e.tag){case 5:return Cc(e.type);case 16:return Cc("Lazy");case 13:return Cc("Suspense");case 19:return Cc("SuspenseList");case 0:case 2:case 15:return e=Gy(e.type,!1),e;case 11:return e=Gy(e.type.render,!1),e;case 1:return e=Gy(e.type,!0),e;default:return""}}function bx(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qs:return"Fragment";case Ys:return"Portal";case yx:return"Profiler";case Xw:return"StrictMode";case vx:return"Suspense";case xx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zR:return(e.displayName||"Context")+".Consumer";case UR:return(e._context.displayName||"Context")+".Provider";case Yw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qw:return t=e.displayName||null,t!==null?t:bx(e.type)||"Memo";case _o:t=e._payload,e=e._init;try{return bx(e(t))}catch{}}return null}function i3(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bx(t);case 8:return t===Xw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ua(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function VR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function o3(e){var t=VR(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gd(e){e._valueTracker||(e._valueTracker=o3(e))}function WR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=VR(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wx(e,t){var n=t.checked;return Et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ua(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function KR(e,t){t=t.checked,t!=null&&Gw(e,"checked",t,!1)}function Sx(e,t){KR(e,t);var n=ua(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ox(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ox(e,t.type,ua(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ox(e,t,n){(t!=="number"||ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tc=Array.isArray;function pl(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=""+ua(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 Px(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return Et({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(re(92));if(Tc(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ua(n)}}function qR(e,t){var n=ua(t.value),r=ua(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function yP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function GR(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jx(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?GR(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xd,XR=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xd=Xd||document.createElement("div"),Xd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},a3=["Webkit","ms","Moz","O"];Object.keys(Fc).forEach(function(e){a3.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fc[t]=Fc[e]})});function YR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fc.hasOwnProperty(e)&&Fc[e]?(""+t).trim():t+"px"}function QR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=YR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var s3=Et({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ex(e,t){if(t){if(s3[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Ax(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Cx=null;function Jw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tx=null,hl=null,ml=null;function vP(e){if(e=bd(e)){if(typeof Tx!="function")throw Error(re(280));var t=e.stateNode;t&&(t=ug(t),Tx(e.stateNode,e.type,t))}}function JR(e){hl?ml?ml.push(e):ml=[e]:hl=e}function ZR(){if(hl){var e=hl,t=ml;if(ml=hl=null,vP(e),t)for(e=0;e<t.length;e++)vP(t[e])}}function ek(e,t){return e(t)}function tk(){}var Xy=!1;function nk(e,t,n){if(Xy)return e(t,n);Xy=!0;try{return ek(e,t,n)}finally{Xy=!1,(hl!==null||ml!==null)&&(tk(),ZR())}}function lf(e,t){var n=e.stateNode;if(n===null)return null;var r=ug(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(re(231,t,typeof n));return n}var _x=!1;if(Zi)try{var oc={};Object.defineProperty(oc,"passive",{get:function(){_x=!0}}),window.addEventListener("test",oc,oc),window.removeEventListener("test",oc,oc)}catch{_x=!1}function l3(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Bc=!1,fh=null,dh=!1,Rx=null,u3={onError:function(e){Bc=!0,fh=e}};function c3(e,t,n,r,i,o,a,s,l){Bc=!1,fh=null,l3.apply(u3,arguments)}function f3(e,t,n,r,i,o,a,s,l){if(c3.apply(this,arguments),Bc){if(Bc){var u=fh;Bc=!1,fh=null}else throw Error(re(198));dh||(dh=!0,Rx=u)}}function Ns(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function rk(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function xP(e){if(Ns(e)!==e)throw Error(re(188))}function d3(e){var t=e.alternate;if(!t){if(t=Ns(e),t===null)throw Error(re(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return xP(i),e;if(o===r)return xP(i),t;o=o.sibling}throw Error(re(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function ik(e){return e=d3(e),e!==null?ok(e):null}function ok(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ok(e);if(t!==null)return t;e=e.sibling}return null}var ak=fr.unstable_scheduleCallback,bP=fr.unstable_cancelCallback,p3=fr.unstable_shouldYield,h3=fr.unstable_requestPaint,Nt=fr.unstable_now,m3=fr.unstable_getCurrentPriorityLevel,Zw=fr.unstable_ImmediatePriority,sk=fr.unstable_UserBlockingPriority,ph=fr.unstable_NormalPriority,g3=fr.unstable_LowPriority,lk=fr.unstable_IdlePriority,og=null,gi=null;function y3(e){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(og,e,void 0,(e.current.flags&128)===128)}catch{}}var Kr=Math.clz32?Math.clz32:b3,v3=Math.log,x3=Math.LN2;function b3(e){return e>>>=0,e===0?32:31-(v3(e)/x3|0)|0}var Yd=64,Qd=4194304;function _c(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=_c(s):(o&=a,o!==0&&(r=_c(o)))}else a=n&~i,a!==0?r=_c(a):o!==0&&(r=_c(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Kr(t),i=1<<n,r|=e[n],t&=~i;return r}function w3(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function S3(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Kr(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=w3(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function kx(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function uk(){var e=Yd;return Yd<<=1,!(Yd&4194240)&&(Yd=64),e}function Yy(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kr(t),e[t]=n}function O3(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Kr(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function eS(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Kr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ye=0;function ck(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fk,tS,dk,pk,hk,Nx=!1,Jd=[],Yo=null,Qo=null,Jo=null,uf=new Map,cf=new Map,No=[],P3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function wP(e,t){switch(e){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Qo=null;break;case"mouseover":case"mouseout":Jo=null;break;case"pointerover":case"pointerout":uf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cf.delete(t.pointerId)}}function ac(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=bd(t),t!==null&&tS(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function j3(e,t,n,r,i){switch(t){case"focusin":return Yo=ac(Yo,e,t,n,r,i),!0;case"dragenter":return Qo=ac(Qo,e,t,n,r,i),!0;case"mouseover":return Jo=ac(Jo,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return uf.set(o,ac(uf.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,cf.set(o,ac(cf.get(o)||null,e,t,n,r,i)),!0}return!1}function mk(e){var t=Ua(e.target);if(t!==null){var n=Ns(t);if(n!==null){if(t=n.tag,t===13){if(t=rk(n),t!==null){e.blockedOn=t,hk(e.priority,function(){dk(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 Hp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$x(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cx=r,n.target.dispatchEvent(r),Cx=null}else return t=bd(n),t!==null&&tS(t),e.blockedOn=n,!1;t.shift()}return!0}function SP(e,t,n){Hp(e)&&n.delete(t)}function E3(){Nx=!1,Yo!==null&&Hp(Yo)&&(Yo=null),Qo!==null&&Hp(Qo)&&(Qo=null),Jo!==null&&Hp(Jo)&&(Jo=null),uf.forEach(SP),cf.forEach(SP)}function sc(e,t){e.blockedOn===t&&(e.blockedOn=null,Nx||(Nx=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,E3)))}function ff(e){function t(i){return sc(i,e)}if(0<Jd.length){sc(Jd[0],e);for(var n=1;n<Jd.length;n++){var r=Jd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yo!==null&&sc(Yo,e),Qo!==null&&sc(Qo,e),Jo!==null&&sc(Jo,e),uf.forEach(t),cf.forEach(t),n=0;n<No.length;n++)r=No[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<No.length&&(n=No[0],n.blockedOn===null);)mk(n),n.blockedOn===null&&No.shift()}var gl=fo.ReactCurrentBatchConfig,mh=!0;function A3(e,t,n,r){var i=Ye,o=gl.transition;gl.transition=null;try{Ye=1,nS(e,t,n,r)}finally{Ye=i,gl.transition=o}}function C3(e,t,n,r){var i=Ye,o=gl.transition;gl.transition=null;try{Ye=4,nS(e,t,n,r)}finally{Ye=i,gl.transition=o}}function nS(e,t,n,r){if(mh){var i=$x(e,t,n,r);if(i===null)av(e,t,r,gh,n),wP(e,r);else if(j3(i,e,t,n,r))r.stopPropagation();else if(wP(e,r),t&4&&-1<P3.indexOf(e)){for(;i!==null;){var o=bd(i);if(o!==null&&fk(o),o=$x(e,t,n,r),o===null&&av(e,t,r,gh,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else av(e,t,r,null,n)}}var gh=null;function $x(e,t,n,r){if(gh=null,e=Jw(r),e=Ua(e),e!==null)if(t=Ns(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rk(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 gh=e,null}function gk(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(m3()){case Zw:return 1;case sk:return 4;case ph:case g3:return 16;case lk:return 536870912;default:return 16}default:return 16}}var Vo=null,rS=null,Vp=null;function yk(){if(Vp)return Vp;var e,t=rS,n=t.length,r,i="value"in Vo?Vo.value:Vo.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return Vp=i.slice(e,1<r?1-r:void 0)}function Wp(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 Zd(){return!0}function OP(){return!1}function hr(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Zd:OP,this.isPropagationStopped=OP,this}return Et(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Zd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zd)},persist:function(){},isPersistent:Zd}),t}var Cu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},iS=hr(Cu),xd=Et({},Cu,{view:0,detail:0}),T3=hr(xd),Qy,Jy,lc,ag=Et({},xd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oS,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!==lc&&(lc&&e.type==="mousemove"?(Qy=e.screenX-lc.screenX,Jy=e.screenY-lc.screenY):Jy=Qy=0,lc=e),Qy)},movementY:function(e){return"movementY"in e?e.movementY:Jy}}),PP=hr(ag),_3=Et({},ag,{dataTransfer:0}),R3=hr(_3),k3=Et({},xd,{relatedTarget:0}),Zy=hr(k3),N3=Et({},Cu,{animationName:0,elapsedTime:0,pseudoElement:0}),$3=hr(N3),M3=Et({},Cu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),I3=hr(M3),D3=Et({},Cu,{data:0}),jP=hr(D3),L3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F3={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"},B3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function U3(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=B3[e])?!!t[e]:!1}function oS(){return U3}var z3=Et({},xd,{key:function(e){if(e.key){var t=L3[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F3[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oS,charCode:function(e){return e.type==="keypress"?Wp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),H3=hr(z3),V3=Et({},ag,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),EP=hr(V3),W3=Et({},xd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oS}),K3=hr(W3),q3=Et({},Cu,{propertyName:0,elapsedTime:0,pseudoElement:0}),G3=hr(q3),X3=Et({},ag,{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}),Y3=hr(X3),Q3=[9,13,27,32],aS=Zi&&"CompositionEvent"in window,Uc=null;Zi&&"documentMode"in document&&(Uc=document.documentMode);var J3=Zi&&"TextEvent"in window&&!Uc,vk=Zi&&(!aS||Uc&&8<Uc&&11>=Uc),AP=" ",CP=!1;function xk(e,t){switch(e){case"keyup":return Q3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function Z3(e,t){switch(e){case"compositionend":return bk(t);case"keypress":return t.which!==32?null:(CP=!0,AP);case"textInput":return e=t.data,e===AP&&CP?null:e;default:return null}}function e4(e,t){if(Js)return e==="compositionend"||!aS&&xk(e,t)?(e=yk(),Vp=rS=Vo=null,Js=!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 vk&&t.locale!=="ko"?null:t.data;default:return null}}var t4={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 TP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!t4[e.type]:t==="textarea"}function wk(e,t,n,r){JR(r),t=yh(t,"onChange"),0<t.length&&(n=new iS("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var zc=null,df=null;function n4(e){kk(e,0)}function sg(e){var t=tl(e);if(WR(t))return e}function r4(e,t){if(e==="change")return t}var Sk=!1;if(Zi){var ev;if(Zi){var tv="oninput"in document;if(!tv){var _P=document.createElement("div");_P.setAttribute("oninput","return;"),tv=typeof _P.oninput=="function"}ev=tv}else ev=!1;Sk=ev&&(!document.documentMode||9<document.documentMode)}function RP(){zc&&(zc.detachEvent("onpropertychange",Ok),df=zc=null)}function Ok(e){if(e.propertyName==="value"&&sg(df)){var t=[];wk(t,df,e,Jw(e)),nk(n4,t)}}function i4(e,t,n){e==="focusin"?(RP(),zc=t,df=n,zc.attachEvent("onpropertychange",Ok)):e==="focusout"&&RP()}function o4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sg(df)}function a4(e,t){if(e==="click")return sg(t)}function s4(e,t){if(e==="input"||e==="change")return sg(t)}function l4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yr=typeof Object.is=="function"?Object.is:l4;function pf(e,t){if(Yr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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(!gx.call(t,i)||!Yr(e[i],t[i]))return!1}return!0}function kP(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function NP(e,t){var n=kP(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kP(n)}}function Pk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jk(){for(var e=window,t=ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ch(e.document)}return t}function sS(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")}function u4(e){var t=jk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pk(n.ownerDocument.documentElement,n)){if(r!==null&&sS(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=NP(n,o);var a=NP(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var c4=Zi&&"documentMode"in document&&11>=document.documentMode,Zs=null,Mx=null,Hc=null,Ix=!1;function $P(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ix||Zs==null||Zs!==ch(r)||(r=Zs,"selectionStart"in r&&sS(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}),Hc&&pf(Hc,r)||(Hc=r,r=yh(Mx,"onSelect"),0<r.length&&(t=new iS("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function ep(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var el={animationend:ep("Animation","AnimationEnd"),animationiteration:ep("Animation","AnimationIteration"),animationstart:ep("Animation","AnimationStart"),transitionend:ep("Transition","TransitionEnd")},nv={},Ek={};Zi&&(Ek=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function lg(e){if(nv[e])return nv[e];if(!el[e])return e;var t=el[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ek)return nv[e]=t[n];return e}var Ak=lg("animationend"),Ck=lg("animationiteration"),Tk=lg("animationstart"),_k=lg("transitionend"),Rk=new Map,MP="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function va(e,t){Rk.set(e,t),ks(t,[e])}for(var rv=0;rv<MP.length;rv++){var iv=MP[rv],f4=iv.toLowerCase(),d4=iv[0].toUpperCase()+iv.slice(1);va(f4,"on"+d4)}va(Ak,"onAnimationEnd");va(Ck,"onAnimationIteration");va(Tk,"onAnimationStart");va("dblclick","onDoubleClick");va("focusin","onFocus");va("focusout","onBlur");va(_k,"onTransitionEnd");Fl("onMouseEnter",["mouseout","mouseover"]);Fl("onMouseLeave",["mouseout","mouseover"]);Fl("onPointerEnter",["pointerout","pointerover"]);Fl("onPointerLeave",["pointerout","pointerover"]);ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ks("onBeforeInput",["compositionend","keypress","textInput","paste"]);ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rc="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(" "),p4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rc));function IP(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,f3(r,t,void 0,e),e.currentTarget=null}function kk(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;IP(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;IP(i,s,u),o=l}}}if(dh)throw e=Rx,dh=!1,Rx=null,e}function dt(e,t){var n=t[Ux];n===void 0&&(n=t[Ux]=new Set);var r=e+"__bubble";n.has(r)||(Nk(t,e,2,!1),n.add(r))}function ov(e,t,n){var r=0;t&&(r|=4),Nk(n,e,r,t)}var tp="_reactListening"+Math.random().toString(36).slice(2);function hf(e){if(!e[tp]){e[tp]=!0,BR.forEach(function(n){n!=="selectionchange"&&(p4.has(n)||ov(n,!1,e),ov(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tp]||(t[tp]=!0,ov("selectionchange",!1,t))}}function Nk(e,t,n,r){switch(gk(t)){case 1:var i=A3;break;case 4:i=C3;break;default:i=nS}n=i.bind(null,t,n,e),i=void 0,!_x||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function av(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Ua(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}nk(function(){var u=o,c=Jw(n),f=[];e:{var p=Rk.get(e);if(p!==void 0){var h=iS,v=e;switch(e){case"keypress":if(Wp(n)===0)break e;case"keydown":case"keyup":h=H3;break;case"focusin":v="focus",h=Zy;break;case"focusout":v="blur",h=Zy;break;case"beforeblur":case"afterblur":h=Zy;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=PP;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=R3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=K3;break;case Ak:case Ck:case Tk:h=$3;break;case _k:h=G3;break;case"scroll":h=T3;break;case"wheel":h=Y3;break;case"copy":case"cut":case"paste":h=I3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=EP}var y=(t&4)!==0,x=!y&&e==="scroll",g=y?p!==null?p+"Capture":null:p;y=[];for(var m=u,b;m!==null;){b=m;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,g!==null&&(S=lf(m,g),S!=null&&y.push(mf(m,S,b)))),x)break;m=m.return}0<y.length&&(p=new h(p,v,null,n,c),f.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Cx&&(v=n.relatedTarget||n.fromElement)&&(Ua(v)||v[eo]))break e;if((h||p)&&(p=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=u,v=v?Ua(v):null,v!==null&&(x=Ns(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(y=PP,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(y=EP,S="onPointerLeave",g="onPointerEnter",m="pointer"),x=h==null?p:tl(h),b=v==null?p:tl(v),p=new y(S,m+"leave",h,n,c),p.target=x,p.relatedTarget=b,S=null,Ua(c)===u&&(y=new y(g,m+"enter",v,n,c),y.target=b,y.relatedTarget=x,S=y),x=S,h&&v)t:{for(y=h,g=v,m=0,b=y;b;b=Vs(b))m++;for(b=0,S=g;S;S=Vs(S))b++;for(;0<m-b;)y=Vs(y),m--;for(;0<b-m;)g=Vs(g),b--;for(;m--;){if(y===g||g!==null&&y===g.alternate)break t;y=Vs(y),g=Vs(g)}y=null}else y=null;h!==null&&DP(f,p,h,y,!1),v!==null&&x!==null&&DP(f,x,v,y,!0)}}e:{if(p=u?tl(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var w=r4;else if(TP(p))if(Sk)w=s4;else{w=o4;var P=i4}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=a4);if(w&&(w=w(e,u))){wk(f,w,n,c);break e}P&&P(e,p,u),e==="focusout"&&(P=p._wrapperState)&&P.controlled&&p.type==="number"&&Ox(p,"number",p.value)}switch(P=u?tl(u):window,e){case"focusin":(TP(P)||P.contentEditable==="true")&&(Zs=P,Mx=u,Hc=null);break;case"focusout":Hc=Mx=Zs=null;break;case"mousedown":Ix=!0;break;case"contextmenu":case"mouseup":case"dragend":Ix=!1,$P(f,n,c);break;case"selectionchange":if(c4)break;case"keydown":case"keyup":$P(f,n,c)}var j;if(aS)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Js?xk(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(vk&&n.locale!=="ko"&&(Js||E!=="onCompositionStart"?E==="onCompositionEnd"&&Js&&(j=yk()):(Vo=c,rS="value"in Vo?Vo.value:Vo.textContent,Js=!0)),P=yh(u,E),0<P.length&&(E=new jP(E,e,null,n,c),f.push({event:E,listeners:P}),j?E.data=j:(j=bk(n),j!==null&&(E.data=j)))),(j=J3?Z3(e,n):e4(e,n))&&(u=yh(u,"onBeforeInput"),0<u.length&&(c=new jP("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=j))}kk(f,t)})}function mf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function yh(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=lf(e,n),o!=null&&r.unshift(mf(e,o,i)),o=lf(e,t),o!=null&&r.push(mf(e,o,i))),e=e.return}return r}function Vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function DP(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=lf(n,o),l!=null&&a.unshift(mf(n,l,s))):i||(l=lf(n,o),l!=null&&a.push(mf(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var h4=/\r\n?/g,m4=/\u0000|\uFFFD/g;function LP(e){return(typeof e=="string"?e:""+e).replace(h4,`
38
+ `).replace(m4,"")}function np(e,t,n){if(t=LP(t),LP(e)!==t&&n)throw Error(re(425))}function vh(){}var Dx=null,Lx=null;function Fx(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bx=typeof setTimeout=="function"?setTimeout:void 0,g4=typeof clearTimeout=="function"?clearTimeout:void 0,FP=typeof Promise=="function"?Promise:void 0,y4=typeof queueMicrotask=="function"?queueMicrotask:typeof FP<"u"?function(e){return FP.resolve(null).then(e).catch(v4)}:Bx;function v4(e){setTimeout(function(){throw e})}function sv(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==="/$"){if(r===0){e.removeChild(i),ff(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ff(t)}function Zo(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==="$?")break;if(t==="/$")return null}}return e}function BP(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Tu=Math.random().toString(36).slice(2),di="__reactFiber$"+Tu,gf="__reactProps$"+Tu,eo="__reactContainer$"+Tu,Ux="__reactEvents$"+Tu,x4="__reactListeners$"+Tu,b4="__reactHandles$"+Tu;function Ua(e){var t=e[di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||n[di]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=BP(e);e!==null;){if(n=e[di])return n;e=BP(e)}return t}e=n,n=e.parentNode}return null}function bd(e){return e=e[di]||e[eo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function tl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function ug(e){return e[gf]||null}var zx=[],nl=-1;function xa(e){return{current:e}}function mt(e){0>nl||(e.current=zx[nl],zx[nl]=null,nl--)}function ut(e,t){nl++,zx[nl]=e.current,e.current=t}var ca={},An=xa(ca),Xn=xa(!1),ps=ca;function Bl(e,t){var n=e.type.contextTypes;if(!n)return ca;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yn(e){return e=e.childContextTypes,e!=null}function xh(){mt(Xn),mt(An)}function UP(e,t,n){if(An.current!==ca)throw Error(re(168));ut(An,t),ut(Xn,n)}function $k(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(re(108,i3(e)||"Unknown",i));return Et({},n,r)}function bh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ca,ps=An.current,ut(An,e),ut(Xn,Xn.current),!0}function zP(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=$k(e,t,ps),r.__reactInternalMemoizedMergedChildContext=e,mt(Xn),mt(An),ut(An,e)):mt(Xn),ut(Xn,n)}var Ii=null,cg=!1,lv=!1;function Mk(e){Ii===null?Ii=[e]:Ii.push(e)}function w4(e){cg=!0,Mk(e)}function ba(){if(!lv&&Ii!==null){lv=!0;var e=0,t=Ye;try{var n=Ii;for(Ye=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ii=null,cg=!1}catch(i){throw Ii!==null&&(Ii=Ii.slice(e+1)),ak(Zw,ba),i}finally{Ye=t,lv=!1}}return null}var rl=[],il=0,wh=null,Sh=0,wr=[],Sr=0,hs=null,Ui=1,zi="";function Ma(e,t){rl[il++]=Sh,rl[il++]=wh,wh=e,Sh=t}function Ik(e,t,n){wr[Sr++]=Ui,wr[Sr++]=zi,wr[Sr++]=hs,hs=e;var r=Ui;e=zi;var i=32-Kr(r)-1;r&=~(1<<i),n+=1;var o=32-Kr(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Ui=1<<32-Kr(t)+i|n<<i|r,zi=o+e}else Ui=1<<o|n<<i|r,zi=e}function lS(e){e.return!==null&&(Ma(e,1),Ik(e,1,0))}function uS(e){for(;e===wh;)wh=rl[--il],rl[il]=null,Sh=rl[--il],rl[il]=null;for(;e===hs;)hs=wr[--Sr],wr[Sr]=null,zi=wr[--Sr],wr[Sr]=null,Ui=wr[--Sr],wr[Sr]=null}var sr=null,ar=null,vt=!1,Vr=null;function Dk(e,t){var n=Pr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function HP(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ar=Zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ar=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hs!==null?{id:Ui,overflow:zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sr=e,ar=null,!0):!1;default:return!1}}function Hx(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vx(e){if(vt){var t=ar;if(t){var n=t;if(!HP(e,t)){if(Hx(e))throw Error(re(418));t=Zo(n.nextSibling);var r=sr;t&&HP(e,t)?Dk(r,n):(e.flags=e.flags&-4097|2,vt=!1,sr=e)}}else{if(Hx(e))throw Error(re(418));e.flags=e.flags&-4097|2,vt=!1,sr=e}}}function VP(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sr=e}function rp(e){if(e!==sr)return!1;if(!vt)return VP(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fx(e.type,e.memoizedProps)),t&&(t=ar)){if(Hx(e))throw Lk(),Error(re(418));for(;t;)Dk(e,t),t=Zo(t.nextSibling)}if(VP(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ar=Zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ar=null}}else ar=sr?Zo(e.stateNode.nextSibling):null;return!0}function Lk(){for(var e=ar;e;)e=Zo(e.nextSibling)}function Ul(){ar=sr=null,vt=!1}function cS(e){Vr===null?Vr=[e]:Vr.push(e)}var S4=fo.ReactCurrentBatchConfig;function uc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(re(309));var r=n.stateNode}if(!r)throw Error(re(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(re(284));if(!n._owner)throw Error(re(290,e))}return e}function ip(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function WP(e){var t=e._init;return t(e._payload)}function Fk(e){function t(g,m){if(e){var b=g.deletions;b===null?(g.deletions=[m],g.flags|=16):b.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function i(g,m){return g=ra(g,m),g.index=0,g.sibling=null,g}function o(g,m,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<m?(g.flags|=2,m):b):(g.flags|=2,m)):(g.flags|=1048576,m)}function a(g){return e&&g.alternate===null&&(g.flags|=2),g}function s(g,m,b,S){return m===null||m.tag!==6?(m=mv(b,g.mode,S),m.return=g,m):(m=i(m,b),m.return=g,m)}function l(g,m,b,S){var w=b.type;return w===Qs?c(g,m,b.props.children,S,b.key):m!==null&&(m.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===_o&&WP(w)===m.type)?(S=i(m,b.props),S.ref=uc(g,m,b),S.return=g,S):(S=Jp(b.type,b.key,b.props,null,g.mode,S),S.ref=uc(g,m,b),S.return=g,S)}function u(g,m,b,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==b.containerInfo||m.stateNode.implementation!==b.implementation?(m=gv(b,g.mode,S),m.return=g,m):(m=i(m,b.children||[]),m.return=g,m)}function c(g,m,b,S,w){return m===null||m.tag!==7?(m=ss(b,g.mode,S,w),m.return=g,m):(m=i(m,b),m.return=g,m)}function f(g,m,b){if(typeof m=="string"&&m!==""||typeof m=="number")return m=mv(""+m,g.mode,b),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case qd:return b=Jp(m.type,m.key,m.props,null,g.mode,b),b.ref=uc(g,null,m),b.return=g,b;case Ys:return m=gv(m,g.mode,b),m.return=g,m;case _o:var S=m._init;return f(g,S(m._payload),b)}if(Tc(m)||ic(m))return m=ss(m,g.mode,b,null),m.return=g,m;ip(g,m)}return null}function p(g,m,b,S){var w=m!==null?m.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return w!==null?null:s(g,m,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:return b.key===w?l(g,m,b,S):null;case Ys:return b.key===w?u(g,m,b,S):null;case _o:return w=b._init,p(g,m,w(b._payload),S)}if(Tc(b)||ic(b))return w!==null?null:c(g,m,b,S,null);ip(g,b)}return null}function h(g,m,b,S,w){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(b)||null,s(m,g,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case qd:return g=g.get(S.key===null?b:S.key)||null,l(m,g,S,w);case Ys:return g=g.get(S.key===null?b:S.key)||null,u(m,g,S,w);case _o:var P=S._init;return h(g,m,b,P(S._payload),w)}if(Tc(S)||ic(S))return g=g.get(b)||null,c(m,g,S,w,null);ip(m,S)}return null}function v(g,m,b,S){for(var w=null,P=null,j=m,E=m=0,A=null;j!==null&&E<b.length;E++){j.index>E?(A=j,j=null):A=j.sibling;var C=p(g,j,b[E],S);if(C===null){j===null&&(j=A);break}e&&j&&C.alternate===null&&t(g,j),m=o(C,m,E),P===null?w=C:P.sibling=C,P=C,j=A}if(E===b.length)return n(g,j),vt&&Ma(g,E),w;if(j===null){for(;E<b.length;E++)j=f(g,b[E],S),j!==null&&(m=o(j,m,E),P===null?w=j:P.sibling=j,P=j);return vt&&Ma(g,E),w}for(j=r(g,j);E<b.length;E++)A=h(j,g,E,b[E],S),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?E:A.key),m=o(A,m,E),P===null?w=A:P.sibling=A,P=A);return e&&j.forEach(function(T){return t(g,T)}),vt&&Ma(g,E),w}function y(g,m,b,S){var w=ic(b);if(typeof w!="function")throw Error(re(150));if(b=w.call(b),b==null)throw Error(re(151));for(var P=w=null,j=m,E=m=0,A=null,C=b.next();j!==null&&!C.done;E++,C=b.next()){j.index>E?(A=j,j=null):A=j.sibling;var T=p(g,j,C.value,S);if(T===null){j===null&&(j=A);break}e&&j&&T.alternate===null&&t(g,j),m=o(T,m,E),P===null?w=T:P.sibling=T,P=T,j=A}if(C.done)return n(g,j),vt&&Ma(g,E),w;if(j===null){for(;!C.done;E++,C=b.next())C=f(g,C.value,S),C!==null&&(m=o(C,m,E),P===null?w=C:P.sibling=C,P=C);return vt&&Ma(g,E),w}for(j=r(g,j);!C.done;E++,C=b.next())C=h(j,g,E,C.value,S),C!==null&&(e&&C.alternate!==null&&j.delete(C.key===null?E:C.key),m=o(C,m,E),P===null?w=C:P.sibling=C,P=C);return e&&j.forEach(function(_){return t(g,_)}),vt&&Ma(g,E),w}function x(g,m,b,S){if(typeof b=="object"&&b!==null&&b.type===Qs&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case qd:e:{for(var w=b.key,P=m;P!==null;){if(P.key===w){if(w=b.type,w===Qs){if(P.tag===7){n(g,P.sibling),m=i(P,b.props.children),m.return=g,g=m;break e}}else if(P.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===_o&&WP(w)===P.type){n(g,P.sibling),m=i(P,b.props),m.ref=uc(g,P,b),m.return=g,g=m;break e}n(g,P);break}else t(g,P);P=P.sibling}b.type===Qs?(m=ss(b.props.children,g.mode,S,b.key),m.return=g,g=m):(S=Jp(b.type,b.key,b.props,null,g.mode,S),S.ref=uc(g,m,b),S.return=g,g=S)}return a(g);case Ys:e:{for(P=b.key;m!==null;){if(m.key===P)if(m.tag===4&&m.stateNode.containerInfo===b.containerInfo&&m.stateNode.implementation===b.implementation){n(g,m.sibling),m=i(m,b.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=gv(b,g.mode,S),m.return=g,g=m}return a(g);case _o:return P=b._init,x(g,m,P(b._payload),S)}if(Tc(b))return v(g,m,b,S);if(ic(b))return y(g,m,b,S);ip(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,m!==null&&m.tag===6?(n(g,m.sibling),m=i(m,b),m.return=g,g=m):(n(g,m),m=mv(b,g.mode,S),m.return=g,g=m),a(g)):n(g,m)}return x}var zl=Fk(!0),Bk=Fk(!1),Oh=xa(null),Ph=null,ol=null,fS=null;function dS(){fS=ol=Ph=null}function pS(e){var t=Oh.current;mt(Oh),e._currentValue=t}function Wx(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function yl(e,t){Ph=e,fS=ol=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qn=!0),e.firstContext=null)}function Tr(e){var t=e._currentValue;if(fS!==e)if(e={context:e,memoizedValue:t,next:null},ol===null){if(Ph===null)throw Error(re(308));ol=e,Ph.dependencies={lanes:0,firstContext:e}}else ol=ol.next=e;return t}var za=null;function hS(e){za===null?za=[e]:za.push(e)}function Uk(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,hS(t)):(n.next=i.next,i.next=n),t.interleaved=n,to(e,r)}function to(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ro=!1;function mS(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ea(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ve&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,to(e,n)}return i=r.interleaved,i===null?(t.next=t,hS(r)):(t.next=i.next,i.next=t),r.interleaved=t,to(e,n)}function Kp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eS(e,n)}}function KP(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jh(e,t,n,r){var i=e.updateQueue;Ro=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;a=0,c=u=l=null,s=o;do{var p=s.lane,h=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,y=s;switch(p=t,h=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){f=v.call(h,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,p=typeof v=="function"?v.call(h,f,p):v,p==null)break e;f=Et({},f,p);break e;case 2:Ro=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=f):c=c.next=h,a|=p;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(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);gs|=a,e.lanes=a,e.memoizedState=f}}function qP(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(re(191,i));i.call(r)}}}var wd={},yi=xa(wd),yf=xa(wd),vf=xa(wd);function Ha(e){if(e===wd)throw Error(re(174));return e}function gS(e,t){switch(ut(vf,t),ut(yf,e),ut(yi,wd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jx(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jx(t,e)}mt(yi),ut(yi,t)}function Hl(){mt(yi),mt(yf),mt(vf)}function Hk(e){Ha(vf.current);var t=Ha(yi.current),n=jx(t,e.type);t!==n&&(ut(yf,e),ut(yi,n))}function yS(e){yf.current===e&&(mt(yi),mt(yf))}var St=xa(0);function Eh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 uv=[];function vS(){for(var e=0;e<uv.length;e++)uv[e]._workInProgressVersionPrimary=null;uv.length=0}var qp=fo.ReactCurrentDispatcher,cv=fo.ReactCurrentBatchConfig,ms=0,jt=null,zt=null,Yt=null,Ah=!1,Vc=!1,xf=0,O4=0;function vn(){throw Error(re(321))}function xS(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function bS(e,t,n,r,i,o){if(ms=o,jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qp.current=e===null||e.memoizedState===null?A4:C4,e=n(r,i),Vc){o=0;do{if(Vc=!1,xf=0,25<=o)throw Error(re(301));o+=1,Yt=zt=null,t.updateQueue=null,qp.current=T4,e=n(r,i)}while(Vc)}if(qp.current=Ch,t=zt!==null&&zt.next!==null,ms=0,Yt=zt=jt=null,Ah=!1,t)throw Error(re(300));return e}function wS(){var e=xf!==0;return xf=0,e}function ii(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?jt.memoizedState=Yt=e:Yt=Yt.next=e,Yt}function _r(){if(zt===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=Yt===null?jt.memoizedState:Yt.next;if(t!==null)Yt=t,zt=e;else{if(e===null)throw Error(re(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Yt===null?jt.memoizedState=Yt=e:Yt=Yt.next=e}return Yt}function bf(e,t){return typeof t=="function"?t(e):t}function fv(e){var t=_r(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=zt,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((ms&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=f,a=r):l=l.next=f,jt.lanes|=c,gs|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,Yr(r,t.memoizedState)||(qn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,jt.lanes|=o,gs|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function dv(e){var t=_r(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);Yr(o,t.memoizedState)||(qn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vk(){}function Wk(e,t){var n=jt,r=_r(),i=t(),o=!Yr(r.memoizedState,i);if(o&&(r.memoizedState=i,qn=!0),r=r.queue,SS(Gk.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Yt!==null&&Yt.memoizedState.tag&1){if(n.flags|=2048,wf(9,qk.bind(null,n,r,i,t),void 0,null),Zt===null)throw Error(re(349));ms&30||Kk(n,t,i)}return i}function Kk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qk(e,t,n,r){t.value=n,t.getSnapshot=r,Xk(t)&&Yk(e)}function Gk(e,t,n){return n(function(){Xk(t)&&Yk(e)})}function Xk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch{return!0}}function Yk(e){var t=to(e,1);t!==null&&qr(t,e,1,-1)}function GP(e){var t=ii();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bf,lastRenderedState:e},t.queue=e,e=e.dispatch=E4.bind(null,jt,e),[t.memoizedState,e]}function wf(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Qk(){return _r().memoizedState}function Gp(e,t,n,r){var i=ii();jt.flags|=e,i.memoizedState=wf(1|t,n,void 0,r===void 0?null:r)}function fg(e,t,n,r){var i=_r();r=r===void 0?null:r;var o=void 0;if(zt!==null){var a=zt.memoizedState;if(o=a.destroy,r!==null&&xS(r,a.deps)){i.memoizedState=wf(t,n,o,r);return}}jt.flags|=e,i.memoizedState=wf(1|t,n,o,r)}function XP(e,t){return Gp(8390656,8,e,t)}function SS(e,t){return fg(2048,8,e,t)}function Jk(e,t){return fg(4,2,e,t)}function Zk(e,t){return fg(4,4,e,t)}function eN(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tN(e,t,n){return n=n!=null?n.concat([e]):null,fg(4,4,eN.bind(null,t,e),n)}function OS(){}function nN(e,t){var n=_r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xS(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rN(e,t){var n=_r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xS(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function iN(e,t,n){return ms&21?(Yr(n,t)||(n=uk(),jt.lanes|=n,gs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qn=!0),e.memoizedState=n)}function P4(e,t){var n=Ye;Ye=n!==0&&4>n?n:4,e(!0);var r=cv.transition;cv.transition={};try{e(!1),t()}finally{Ye=n,cv.transition=r}}function oN(){return _r().memoizedState}function j4(e,t,n){var r=na(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},aN(e))sN(t,n);else if(n=Uk(e,t,n,r),n!==null){var i=Ln();qr(n,e,r,i),lN(n,t,r)}}function E4(e,t,n){var r=na(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(aN(e))sN(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Yr(s,a)){var l=t.interleaved;l===null?(i.next=i,hS(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Uk(e,t,i,r),n!==null&&(i=Ln(),qr(n,e,r,i),lN(n,t,r))}}function aN(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function sN(e,t){Vc=Ah=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lN(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eS(e,n)}}var Ch={readContext:Tr,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},A4={readContext:Tr,useCallback:function(e,t){return ii().memoizedState=[e,t===void 0?null:t],e},useContext:Tr,useEffect:XP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gp(4194308,4,eN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gp(4,2,e,t)},useMemo:function(e,t){var n=ii();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ii();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=j4.bind(null,jt,e),[r.memoizedState,e]},useRef:function(e){var t=ii();return e={current:e},t.memoizedState=e},useState:GP,useDebugValue:OS,useDeferredValue:function(e){return ii().memoizedState=e},useTransition:function(){var e=GP(!1),t=e[0];return e=P4.bind(null,e[1]),ii().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=jt,i=ii();if(vt){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),Zt===null)throw Error(re(349));ms&30||Kk(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,XP(Gk.bind(null,r,o,e),[e]),r.flags|=2048,wf(9,qk.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ii(),t=Zt.identifierPrefix;if(vt){var n=zi,r=Ui;n=(r&~(1<<32-Kr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xf++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=O4++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},C4={readContext:Tr,useCallback:nN,useContext:Tr,useEffect:SS,useImperativeHandle:tN,useInsertionEffect:Jk,useLayoutEffect:Zk,useMemo:rN,useReducer:fv,useRef:Qk,useState:function(){return fv(bf)},useDebugValue:OS,useDeferredValue:function(e){var t=_r();return iN(t,zt.memoizedState,e)},useTransition:function(){var e=fv(bf)[0],t=_r().memoizedState;return[e,t]},useMutableSource:Vk,useSyncExternalStore:Wk,useId:oN,unstable_isNewReconciler:!1},T4={readContext:Tr,useCallback:nN,useContext:Tr,useEffect:SS,useImperativeHandle:tN,useInsertionEffect:Jk,useLayoutEffect:Zk,useMemo:rN,useReducer:dv,useRef:Qk,useState:function(){return dv(bf)},useDebugValue:OS,useDeferredValue:function(e){var t=_r();return zt===null?t.memoizedState=e:iN(t,zt.memoizedState,e)},useTransition:function(){var e=dv(bf)[0],t=_r().memoizedState;return[e,t]},useMutableSource:Vk,useSyncExternalStore:Wk,useId:oN,unstable_isNewReconciler:!1};function Fr(e,t){if(e&&e.defaultProps){t=Et({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Kx(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Et({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var dg={isMounted:function(e){return(e=e._reactInternals)?Ns(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ln(),i=na(e),o=qi(r,i);o.payload=t,n!=null&&(o.callback=n),t=ea(e,o,i),t!==null&&(qr(t,e,i,r),Kp(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ln(),i=na(e),o=qi(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ea(e,o,i),t!==null&&(qr(t,e,i,r),Kp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ln(),r=na(e),i=qi(n,r);i.tag=2,t!=null&&(i.callback=t),t=ea(e,i,r),t!==null&&(qr(t,e,r,n),Kp(t,e,r))}};function YP(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!pf(n,r)||!pf(i,o):!0}function uN(e,t,n){var r=!1,i=ca,o=t.contextType;return typeof o=="object"&&o!==null?o=Tr(o):(i=Yn(t)?ps:An.current,r=t.contextTypes,o=(r=r!=null)?Bl(e,i):ca),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=dg,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function QP(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&&dg.enqueueReplaceState(t,t.state,null)}function qx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},mS(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Tr(o):(o=Yn(t)?ps:An.current,i.context=Bl(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Kx(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&dg.enqueueReplaceState(i,i.state,null),jh(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Vl(e,t){try{var n="",r=t;do n+=r3(r),r=r.return;while(r);var i=n}catch(o){i=`
39
39
  Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:i,digest:null}}function pv(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gx(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _4=typeof WeakMap=="function"?WeakMap:Map;function cN(e,t,n){n=qi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_h||(_h=!0,ib=r),Gx(e,t)},n}function fN(e,t,n){n=qi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Gx(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Gx(e,t),typeof r!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function JP(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _4;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)||(i.add(n),e=V4.bind(null,e,t,n),t.then(e,e))}function ZP(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ej(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=qi(-1,1),t.tag=2,ea(n,t,1))),n.lanes|=1),e)}var R4=fo.ReactCurrentOwner,qn=!1;function Nn(e,t,n,r){t.child=e===null?Bk(t,null,n,r):zl(t,e.child,n,r)}function tj(e,t,n,r,i){n=n.render;var o=t.ref;return yl(t,i),r=bS(e,t,n,r,o,i),n=wS(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,no(e,t,i)):(yt&&n&&lS(t),t.flags|=1,Nn(e,t,r,i),t.child)}function nj(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!RS(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,dN(e,t,o,r,i)):(e=Jp(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:pf,n(a,r)&&e.ref===t.ref)return no(e,t,i)}return t.flags|=1,e=ra(o,r),e.ref=t.ref,e.return=t,t.child=e}function dN(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(pf(o,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(qn=!0);else return t.lanes=e.lanes,no(e,t,i)}return Xx(e,t,n,r,i)}function pN(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(sl,rr),rr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(sl,rr),rr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ut(sl,rr),rr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ut(sl,rr),rr|=r;return Nn(e,t,i,n),t.child}function hN(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xx(e,t,n,r,i){var o=Yn(n)?ps:An.current;return o=Bl(t,o),yl(t,i),n=bS(e,t,n,r,o,i),r=wS(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,no(e,t,i)):(yt&&r&&lS(t),t.flags|=1,Nn(e,t,n,i),t.child)}function rj(e,t,n,r,i){if(Yn(n)){var o=!0;bh(t)}else o=!1;if(yl(t,i),t.stateNode===null)Xp(e,t),uN(t,n,r),qx(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Tr(u):(u=Yn(n)?ps:An.current,u=Bl(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&QP(t,a,r,u),Ro=!1;var p=t.memoizedState;a.state=p,jh(t,r,a,i),l=t.memoizedState,s!==r||p!==l||Xn.current||Ro?(typeof c=="function"&&(Kx(t,n,c,r),l=t.memoizedState),(s=Ro||YP(t,n,s,r,p,l,u))?(f||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=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,zk(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Fr(t.type,s),a.props=u,f=t.pendingProps,p=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Tr(l):(l=Yn(n)?ps:An.current,l=Bl(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||p!==l)&&QP(t,a,r,l),Ro=!1,p=t.memoizedState,a.state=p,jh(t,r,a,i);var v=t.memoizedState;s!==f||p!==v||Xn.current||Ro?(typeof h=="function"&&(Kx(t,n,h,r),v=t.memoizedState),(u=Ro||YP(t,n,u,r,p,v,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,v,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,v,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),a.props=r,a.state=v,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Yx(e,t,n,r,o,i)}function Yx(e,t,n,r,i,o){hN(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&zP(t,n,!1),no(e,t,o);r=t.stateNode,R4.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=zl(t,e.child,null,o),t.child=zl(t,null,s,o)):Nn(e,t,s,o),t.memoizedState=r.state,i&&zP(t,n,!0),t.child}function mN(e){var t=e.stateNode;t.pendingContext?UP(e,t.pendingContext,t.pendingContext!==t.context):t.context&&UP(e,t.context,!1),gS(e,t.containerInfo)}function ij(e,t,n,r,i){return Ul(),cS(i),t.flags|=256,Nn(e,t,n,r),t.child}var Qx={dehydrated:null,treeContext:null,retryLane:0};function Jx(e){return{baseLanes:e,cachePool:null,transitions:null}}function gN(e,t,n){var r=t.pendingProps,i=wt.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ut(wt,i&1),e===null)return Vx(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=mg(a,r,0,null),e=ss(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Jx(n),t.memoizedState=Qx,e):PS(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return k4(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ra(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=ra(s,o):(o=ss(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?Jx(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=Qx,r}return o=e.child,e=o.sibling,r=ra(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function PS(e,t){return t=mg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function op(e,t,n,r){return r!==null&&cS(r),zl(t,e.child,null,n),e=PS(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function k4(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=pv(Error(re(422))),op(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=mg({mode:"visible",children:r.children},i,0,null),o=ss(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&zl(t,e.child,null,a),t.child.memoizedState=Jx(a),t.memoizedState=Qx,o);if(!(t.mode&1))return op(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(re(419)),r=pv(o,r,void 0),op(e,t,a,r)}if(s=(a&e.childLanes)!==0,qn||s){if(r=Zt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,to(e,i),qr(r,e,i,-1))}return _S(),r=pv(Error(re(421))),op(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=W4.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ar=Zo(i.nextSibling),sr=t,yt=!0,Vr=null,e!==null&&(wr[Sr++]=Ui,wr[Sr++]=zi,wr[Sr++]=hs,Ui=e.id,zi=e.overflow,hs=t),t=PS(t,r.children),t.flags|=4096,t)}function oj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wx(e.return,t,n)}function hv(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function yN(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Nn(e,t,r.children,n),r=wt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&oj(e,n,t);else if(e.tag===19)oj(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(wt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Eh(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),hv(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Eh(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}hv(t,!0,n,null,o);break;case"together":hv(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function no(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function N4(e,t,n){switch(t.tag){case 3:mN(t),Ul();break;case 5:Hk(t);break;case 1:Yn(t.type)&&bh(t);break;case 4:gS(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ut(Oh,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ut(wt,wt.current&1),t.flags|=128,null):n&t.child.childLanes?gN(e,t,n):(ut(wt,wt.current&1),e=no(e,t,n),e!==null?e.sibling:null);ut(wt,wt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return yN(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ut(wt,wt.current),r)break;return null;case 22:case 23:return t.lanes=0,pN(e,t,n)}return no(e,t,n)}var vN,Zx,xN,bN;vN=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Zx=function(){};xN=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ha(yi.current);var o=null;switch(n){case"input":i=wx(e,i),r=wx(e,r),o=[];break;case"select":i=jt({},i,{value:void 0}),r=jt({},r,{value:void 0}),o=[];break;case"textarea":i=Px(e,i),r=Px(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vh)}Ex(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(af.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(af.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&dt("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};bN=function(e,t,n,r){n!==r&&(t.flags|=4)};function cc(e,t){if(!yt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xn(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&14680064,r|=i.flags&14680064,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 $4(e,t,n){var r=t.pendingProps;switch(uS(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return Yn(t.type)&&xh(),xn(t),null;case 3:return r=t.stateNode,Hl(),mt(Xn),mt(An),vS(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vr!==null&&(sb(Vr),Vr=null))),Zx(e,t),xn(t),null;case 5:yS(t);var i=Ha(vf.current);if(n=t.type,e!==null&&t.stateNode!=null)xN(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(re(166));return xn(t),null}if(e=Ha(yi.current),rp(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[di]=t,r[gf]=o,e=(t.mode&1)!==0,n){case"dialog":dt("cancel",r),dt("close",r);break;case"iframe":case"object":case"embed":dt("load",r);break;case"video":case"audio":for(i=0;i<Rc.length;i++)dt(Rc[i],r);break;case"source":dt("error",r);break;case"img":case"image":case"link":dt("error",r),dt("load",r);break;case"details":dt("toggle",r);break;case"input":hP(r,o),dt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},dt("invalid",r);break;case"textarea":gP(r,o),dt("invalid",r)}Ex(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&np(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&np(r.textContent,s,e),i=["children",""+s]):af.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&dt("scroll",r)}switch(n){case"input":Gd(r),mP(r,o,!0);break;case"textarea":Gd(r),yP(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=vh)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=GR(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[di]=t,e[gf]=r,vN(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ax(n,r),n){case"dialog":dt("cancel",e),dt("close",e),i=r;break;case"iframe":case"object":case"embed":dt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Rc.length;i++)dt(Rc[i],e);i=r;break;case"source":dt("error",e),i=r;break;case"img":case"image":case"link":dt("error",e),dt("load",e),i=r;break;case"details":dt("toggle",e),i=r;break;case"input":hP(e,r),i=wx(e,r),dt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=jt({},r,{value:void 0}),dt("invalid",e);break;case"textarea":gP(e,r),i=Px(e,r),dt("invalid",e);break;default:i=r}Ex(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?QR(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&XR(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&sf(e,l):typeof l=="number"&&sf(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(af.hasOwnProperty(o)?l!=null&&o==="onScroll"&&dt("scroll",e):l!=null&&Gw(e,o,l,a))}switch(n){case"input":Gd(e),mP(e,r,!1);break;case"textarea":Gd(e),yP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ua(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?pl(e,!!r.multiple,o,!1):r.defaultValue!=null&&pl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=vh)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xn(t),null;case 6:if(e&&t.stateNode!=null)bN(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(n=Ha(vf.current),Ha(yi.current),rp(t)){if(r=t.stateNode,n=t.memoizedProps,r[di]=t,(o=r.nodeValue!==n)&&(e=sr,e!==null))switch(e.tag){case 3:np(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&np(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[di]=t,t.stateNode=r}return xn(t),null;case 13:if(mt(wt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(yt&&ar!==null&&t.mode&1&&!(t.flags&128))Lk(),Ul(),t.flags|=98560,o=!1;else if(o=rp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(re(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(re(317));o[di]=t}else Ul(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xn(t),o=!1}else Vr!==null&&(sb(Vr),Vr=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||wt.current&1?Vt===0&&(Vt=3):_S())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return Hl(),Zx(e,t),e===null&&hf(t.stateNode.containerInfo),xn(t),null;case 10:return pS(t.type._context),xn(t),null;case 17:return Yn(t.type)&&xh(),xn(t),null;case 19:if(mt(wt),o=t.memoizedState,o===null)return xn(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)cc(o,!1);else{if(Vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Eh(e),a!==null){for(t.flags|=128,cc(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ut(wt,wt.current&1|2),t.child}e=e.sibling}o.tail!==null&&Nt()>Wl&&(t.flags|=128,r=!0,cc(o,!1),t.lanes=4194304)}else{if(!r)if(e=Eh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yt)return xn(t),null}else 2*Nt()-o.renderingStartTime>Wl&&n!==1073741824&&(t.flags|=128,r=!0,cc(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Nt(),t.sibling=null,n=wt.current,ut(wt,r?n&1|2:n&1),t):(xn(t),null);case 22:case 23:return TS(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?rr&1073741824&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function M4(e,t){switch(uS(t),t.tag){case 1:return Yn(t.type)&&xh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hl(),mt(Xn),mt(An),vS(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yS(t),null;case 13:if(mt(wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return mt(wt),null;case 4:return Hl(),null;case 10:return pS(t.type._context),null;case 22:case 23:return TS(),null;case 24:return null;default:return null}}var ap=!1,Pn=!1,I4=typeof WeakSet=="function"?WeakSet:Set,he=null;function al(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Tt(e,t,r)}else n.current=null}function eb(e,t,n){try{n()}catch(r){Tt(e,t,r)}}var aj=!1;function D4(e,t){if(Dx=mh,e=jk(),sS(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(s=a+i),f!==o||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===i&&(s=a),p===o&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lx={focusedElem:e,selectionRange:n},mh=!1,he=t;he!==null;)if(t=he,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,he=e;else for(;he!==null;){t=he;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,x=v.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Fr(t.type,y),x);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(S){Tt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,he=e;break}he=t.return}return v=aj,aj=!1,v}function Wc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&eb(t,n,o)}i=i.next}while(i!==r)}}function pg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wN(e){var t=e.alternate;t!==null&&(e.alternate=null,wN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[di],delete t[gf],delete t[Ux],delete t[x4],delete t[b4])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function SN(e){return e.tag===5||e.tag===3||e.tag===4}function sj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SN(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vh));else if(r!==4&&(e=e.child,e!==null))for(nb(e,t,n),e=e.sibling;e!==null;)nb(e,t,n),e=e.sibling}function rb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(rb(e,t,n),e=e.sibling;e!==null;)rb(e,t,n),e=e.sibling}var sn=null,zr=!1;function jo(e,t,n){for(n=n.child;n!==null;)ON(e,t,n),n=n.sibling}function ON(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(og,n)}catch{}switch(n.tag){case 5:Pn||al(n,t);case 6:var r=sn,i=zr;sn=null,jo(e,t,n),sn=r,zr=i,sn!==null&&(zr?(e=sn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):sn.removeChild(n.stateNode));break;case 18:sn!==null&&(zr?(e=sn,n=n.stateNode,e.nodeType===8?sv(e.parentNode,n):e.nodeType===1&&sv(e,n),ff(e)):sv(sn,n.stateNode));break;case 4:r=sn,i=zr,sn=n.stateNode.containerInfo,zr=!0,jo(e,t,n),sn=r,zr=i;break;case 0:case 11:case 14:case 15:if(!Pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&eb(n,t,a),i=i.next}while(i!==r)}jo(e,t,n);break;case 1:if(!Pn&&(al(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Tt(n,t,s)}jo(e,t,n);break;case 21:jo(e,t,n);break;case 22:n.mode&1?(Pn=(r=Pn)||n.memoizedState!==null,jo(e,t,n),Pn=r):jo(e,t,n);break;default:jo(e,t,n)}}function lj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new I4),t.forEach(function(r){var i=K4.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:sn=s.stateNode,zr=!1;break e;case 3:sn=s.stateNode.containerInfo,zr=!0;break e;case 4:sn=s.stateNode.containerInfo,zr=!0;break e}s=s.return}if(sn===null)throw Error(re(160));ON(o,a,i),sn=null,zr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Tt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)PN(t,e),t=t.sibling}function PN(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dr(t,e),ri(e),r&4){try{Wc(3,e,e.return),pg(3,e)}catch(y){Tt(e,e.return,y)}try{Wc(5,e,e.return)}catch(y){Tt(e,e.return,y)}}break;case 1:Dr(t,e),ri(e),r&512&&n!==null&&al(n,n.return);break;case 5:if(Dr(t,e),ri(e),r&512&&n!==null&&al(n,n.return),e.flags&32){var i=e.stateNode;try{sf(i,"")}catch(y){Tt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&KR(i,o),Ax(s,a);var u=Ax(s,o);for(a=0;a<l.length;a+=2){var c=l[a],f=l[a+1];c==="style"?QR(i,f):c==="dangerouslySetInnerHTML"?XR(i,f):c==="children"?sf(i,f):Gw(i,c,f,u)}switch(s){case"input":Sx(i,o);break;case"textarea":qR(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?pl(i,!!o.multiple,h,!1):p!==!!o.multiple&&(o.defaultValue!=null?pl(i,!!o.multiple,o.defaultValue,!0):pl(i,!!o.multiple,o.multiple?[]:"",!1))}i[gf]=o}catch(y){Tt(e,e.return,y)}}break;case 6:if(Dr(t,e),ri(e),r&4){if(e.stateNode===null)throw Error(re(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(y){Tt(e,e.return,y)}}break;case 3:if(Dr(t,e),ri(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ff(t.containerInfo)}catch(y){Tt(e,e.return,y)}break;case 4:Dr(t,e),ri(e);break;case 13:Dr(t,e),ri(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(AS=Nt())),r&4&&lj(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Pn=(u=Pn)||c,Dr(t,e),Pn=u):Dr(t,e),ri(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(he=e,c=e.child;c!==null;){for(f=he=c;he!==null;){switch(p=he,h=p.child,p.tag){case 0:case 11:case 14:case 15:Wc(4,p,p.return);break;case 1:al(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(y){Tt(r,n,y)}}break;case 5:al(p,p.return);break;case 22:if(p.memoizedState!==null){cj(f);continue}}h!==null?(h.return=p,he=h):cj(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=f.stateNode,l=f.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=YR("display",a))}catch(y){Tt(e,e.return,y)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){Tt(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Dr(t,e),ri(e),r&4&&lj(e);break;case 21:break;default:Dr(t,e),ri(e)}}function ri(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(SN(n)){var r=n;break e}n=n.return}throw Error(re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(sf(i,""),r.flags&=-33);var o=sj(e);rb(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=sj(e);nb(e,s,a);break;default:throw Error(re(161))}}catch(l){Tt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function L4(e,t,n){he=e,jN(e)}function jN(e,t,n){for(var r=(e.mode&1)!==0;he!==null;){var i=he,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ap;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||Pn;s=ap;var u=Pn;if(ap=a,(Pn=l)&&!u)for(he=i;he!==null;)a=he,l=a.child,a.tag===22&&a.memoizedState!==null?fj(i):l!==null?(l.return=a,he=l):fj(i);for(;o!==null;)he=o,jN(o),o=o.sibling;he=i,ap=s,Pn=u}uj(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,he=o):uj(e)}}function uj(e){for(;he!==null;){var t=he;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Pn||pg(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Pn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Fr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&qP(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qP(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&ff(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}Pn||t.flags&512&&tb(t)}catch(p){Tt(t,t.return,p)}}if(t===e){he=null;break}if(n=t.sibling,n!==null){n.return=t.return,he=n;break}he=t.return}}function cj(e){for(;he!==null;){var t=he;if(t===e){he=null;break}var n=t.sibling;if(n!==null){n.return=t.return,he=n;break}he=t.return}}function fj(e){for(;he!==null;){var t=he;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pg(4,t)}catch(l){Tt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Tt(t,i,l)}}var o=t.return;try{tb(t)}catch(l){Tt(t,o,l)}break;case 5:var a=t.return;try{tb(t)}catch(l){Tt(t,a,l)}}}catch(l){Tt(t,t.return,l)}if(t===e){he=null;break}var s=t.sibling;if(s!==null){s.return=t.return,he=s;break}he=t.return}}var F4=Math.ceil,Th=fo.ReactCurrentDispatcher,jS=fo.ReactCurrentOwner,Ar=fo.ReactCurrentBatchConfig,Ve=0,Zt=null,It=null,un=0,rr=0,sl=xa(0),Vt=0,Sf=null,gs=0,hg=0,ES=0,Kc=null,Kn=null,AS=0,Wl=1/0,Ni=null,_h=!1,ib=null,ta=null,sp=!1,Wo=null,Rh=0,qc=0,ob=null,Yp=-1,Qp=0;function Ln(){return Ve&6?Nt():Yp!==-1?Yp:Yp=Nt()}function na(e){return e.mode&1?Ve&2&&un!==0?un&-un:S4.transition!==null?(Qp===0&&(Qp=uk()),Qp):(e=Ye,e!==0||(e=window.event,e=e===void 0?16:gk(e.type)),e):1}function qr(e,t,n,r){if(50<qc)throw qc=0,ob=null,Error(re(185));vd(e,n,r),(!(Ve&2)||e!==Zt)&&(e===Zt&&(!(Ve&2)&&(hg|=n),Vt===4&&$o(e,un)),Qn(e,r),n===1&&Ve===0&&!(t.mode&1)&&(Wl=Nt()+500,cg&&ba()))}function Qn(e,t){var n=e.callbackNode;S3(e,t);var r=hh(e,e===Zt?un:0);if(r===0)n!==null&&bP(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&bP(n),t===1)e.tag===0?w4(dj.bind(null,e)):Mk(dj.bind(null,e)),y4(function(){!(Ve&6)&&ba()}),n=null;else{switch(ck(r)){case 1:n=Zw;break;case 4:n=sk;break;case 16:n=ph;break;case 536870912:n=lk;break;default:n=ph}n=NN(n,EN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function EN(e,t){if(Yp=-1,Qp=0,Ve&6)throw Error(re(327));var n=e.callbackNode;if(vl()&&e.callbackNode!==n)return null;var r=hh(e,e===Zt?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=kh(e,r);else{t=r;var i=Ve;Ve|=2;var o=CN();(Zt!==e||un!==t)&&(Ni=null,Wl=Nt()+500,as(e,t));do try{z4();break}catch(s){AN(e,s)}while(!0);dS(),Th.current=o,Ve=i,It!==null?t=0:(Zt=null,un=0,t=Vt)}if(t!==0){if(t===2&&(i=kx(e),i!==0&&(r=i,t=ab(e,i))),t===1)throw n=Sf,as(e,0),$o(e,r),Qn(e,Nt()),n;if(t===6)$o(e,r);else{if(i=e.current.alternate,!(r&30)&&!B4(i)&&(t=kh(e,r),t===2&&(o=kx(e),o!==0&&(r=o,t=ab(e,o))),t===1))throw n=Sf,as(e,0),$o(e,r),Qn(e,Nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(re(345));case 2:Ia(e,Kn,Ni);break;case 3:if($o(e,r),(r&130023424)===r&&(t=AS+500-Nt(),10<t)){if(hh(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ln(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Bx(Ia.bind(null,e,Kn,Ni),t);break}Ia(e,Kn,Ni);break;case 4:if($o(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-Kr(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*F4(r/1960))-r,10<r){e.timeoutHandle=Bx(Ia.bind(null,e,Kn,Ni),r);break}Ia(e,Kn,Ni);break;case 5:Ia(e,Kn,Ni);break;default:throw Error(re(329))}}}return Qn(e,Nt()),e.callbackNode===n?EN.bind(null,e):null}function ab(e,t){var n=Kc;return e.current.memoizedState.isDehydrated&&(as(e,t).flags|=256),e=kh(e,t),e!==2&&(t=Kn,Kn=n,t!==null&&sb(t)),e}function sb(e){Kn===null?Kn=e:Kn.push.apply(Kn,e)}function B4(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Yr(o(),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 $o(e,t){for(t&=~ES,t&=~hg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Kr(t),r=1<<n;e[n]=-1,t&=~r}}function dj(e){if(Ve&6)throw Error(re(327));vl();var t=hh(e,0);if(!(t&1))return Qn(e,Nt()),null;var n=kh(e,t);if(e.tag!==0&&n===2){var r=kx(e);r!==0&&(t=r,n=ab(e,r))}if(n===1)throw n=Sf,as(e,0),$o(e,t),Qn(e,Nt()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ia(e,Kn,Ni),Qn(e,Nt()),null}function CS(e,t){var n=Ve;Ve|=1;try{return e(t)}finally{Ve=n,Ve===0&&(Wl=Nt()+500,cg&&ba())}}function ys(e){Wo!==null&&Wo.tag===0&&!(Ve&6)&&vl();var t=Ve;Ve|=1;var n=Ar.transition,r=Ye;try{if(Ar.transition=null,Ye=1,e)return e()}finally{Ye=r,Ar.transition=n,Ve=t,!(Ve&6)&&ba()}}function TS(){rr=sl.current,mt(sl)}function as(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,g4(n)),It!==null)for(n=It.return;n!==null;){var r=n;switch(uS(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&xh();break;case 3:Hl(),mt(Xn),mt(An),vS();break;case 5:yS(r);break;case 4:Hl();break;case 13:mt(wt);break;case 19:mt(wt);break;case 10:pS(r.type._context);break;case 22:case 23:TS()}n=n.return}if(Zt=e,It=e=ra(e.current,null),un=rr=t,Vt=0,Sf=null,ES=hg=gs=0,Kn=Kc=null,za!==null){for(t=0;t<za.length;t++)if(n=za[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}za=null}return e}function AN(e,t){do{var n=It;try{if(dS(),qp.current=Ch,Ah){for(var r=Pt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ah=!1}if(ms=0,Yt=zt=Pt=null,Vc=!1,xf=0,jS.current=null,n===null||n.return===null){Vt=1,Sf=t,It=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=un,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=ZP(a);if(h!==null){h.flags&=-257,ej(h,a,s,o,t),h.mode&1&&JP(o,u,t),t=h,l=u;var v=t.updateQueue;if(v===null){var y=new Set;y.add(l),t.updateQueue=y}else v.add(l);break e}else{if(!(t&1)){JP(o,u,t),_S();break e}l=Error(re(426))}}else if(yt&&s.mode&1){var x=ZP(a);if(x!==null){!(x.flags&65536)&&(x.flags|=256),ej(x,a,s,o,t),cS(Vl(l,s));break e}}o=l=Vl(l,s),Vt!==4&&(Vt=2),Kc===null?Kc=[o]:Kc.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=cN(o,l,t);KP(o,g);break e;case 1:s=l;var m=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ta===null||!ta.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=fN(o,s,t);KP(o,S);break e}}o=o.return}while(o!==null)}_N(n)}catch(w){t=w,It===n&&n!==null&&(It=n=n.return);continue}break}while(!0)}function CN(){var e=Th.current;return Th.current=Ch,e===null?Ch:e}function _S(){(Vt===0||Vt===3||Vt===2)&&(Vt=4),Zt===null||!(gs&268435455)&&!(hg&268435455)||$o(Zt,un)}function kh(e,t){var n=Ve;Ve|=2;var r=CN();(Zt!==e||un!==t)&&(Ni=null,as(e,t));do try{U4();break}catch(i){AN(e,i)}while(!0);if(dS(),Ve=n,Th.current=r,It!==null)throw Error(re(261));return Zt=null,un=0,Vt}function U4(){for(;It!==null;)TN(It)}function z4(){for(;It!==null&&!p3();)TN(It)}function TN(e){var t=kN(e.alternate,e,rr);e.memoizedProps=e.pendingProps,t===null?_N(e):It=t,jS.current=null}function _N(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=M4(n,t),n!==null){n.flags&=32767,It=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Vt=6,It=null;return}}else if(n=$4(n,t,rr),n!==null){It=n;return}if(t=t.sibling,t!==null){It=t;return}It=t=e}while(t!==null);Vt===0&&(Vt=5)}function Ia(e,t,n){var r=Ye,i=Ar.transition;try{Ar.transition=null,Ye=1,H4(e,t,n,r)}finally{Ar.transition=i,Ye=r}return null}function H4(e,t,n,r){do vl();while(Wo!==null);if(Ve&6)throw Error(re(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(re(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(O3(e,o),e===Zt&&(It=Zt=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sp||(sp=!0,NN(ph,function(){return vl(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Ar.transition,Ar.transition=null;var a=Ye;Ye=1;var s=Ve;Ve|=4,jS.current=null,D4(e,n),PN(n,e),u4(Lx),mh=!!Dx,Lx=Dx=null,e.current=n,L4(n),h3(),Ve=s,Ye=a,Ar.transition=o}else e.current=n;if(sp&&(sp=!1,Wo=e,Rh=i),o=e.pendingLanes,o===0&&(ta=null),y3(n.stateNode),Qn(e,Nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(_h)throw _h=!1,e=ib,ib=null,e;return Rh&1&&e.tag!==0&&vl(),o=e.pendingLanes,o&1?e===ob?qc++:(qc=0,ob=e):qc=0,ba(),null}function vl(){if(Wo!==null){var e=ck(Rh),t=Ar.transition,n=Ye;try{if(Ar.transition=null,Ye=16>e?16:e,Wo===null)var r=!1;else{if(e=Wo,Wo=null,Rh=0,Ve&6)throw Error(re(331));var i=Ve;for(Ve|=4,he=e.current;he!==null;){var o=he,a=o.child;if(he.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(he=u;he!==null;){var c=he;switch(c.tag){case 0:case 11:case 15:Wc(8,c,o)}var f=c.child;if(f!==null)f.return=c,he=f;else for(;he!==null;){c=he;var p=c.sibling,h=c.return;if(wN(c),c===u){he=null;break}if(p!==null){p.return=h,he=p;break}he=h}}}var v=o.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}he=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,he=a;else e:for(;he!==null;){if(o=he,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Wc(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,he=g;break e}he=o.return}}var m=e.current;for(he=m;he!==null;){a=he;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,he=b;else e:for(a=m;he!==null;){if(s=he,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:pg(9,s)}}catch(w){Tt(s,s.return,w)}if(s===a){he=null;break e}var S=s.sibling;if(S!==null){S.return=s.return,he=S;break e}he=s.return}}if(Ve=i,ba(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(og,e)}catch{}r=!0}return r}finally{Ye=n,Ar.transition=t}}return!1}function pj(e,t,n){t=Vl(n,t),t=cN(e,t,1),e=ea(e,t,1),t=Ln(),e!==null&&(vd(e,1,t),Qn(e,t))}function Tt(e,t,n){if(e.tag===3)pj(e,e,n);else for(;t!==null;){if(t.tag===3){pj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ta===null||!ta.has(r))){e=Vl(n,e),e=fN(t,e,1),t=ea(t,e,1),e=Ln(),t!==null&&(vd(t,1,e),Qn(t,e));break}}t=t.return}}function V4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ln(),e.pingedLanes|=e.suspendedLanes&n,Zt===e&&(un&n)===n&&(Vt===4||Vt===3&&(un&130023424)===un&&500>Nt()-AS?as(e,0):ES|=n),Qn(e,t)}function RN(e,t){t===0&&(e.mode&1?(t=Qd,Qd<<=1,!(Qd&130023424)&&(Qd=4194304)):t=1);var n=Ln();e=to(e,t),e!==null&&(vd(e,t,n),Qn(e,n))}function W4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),RN(e,n)}function K4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(re(314))}r!==null&&r.delete(t),RN(e,n)}var kN;kN=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,N4(e,t,n);qn=!!(e.flags&131072)}else qn=!1,yt&&t.flags&1048576&&Ik(t,Sh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xp(e,t),e=t.pendingProps;var i=Bl(t,An.current);yl(t,n),i=bS(null,t,r,e,i,n);var o=wS();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yn(r)?(o=!0,bh(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mS(t),i.updater=dg,t.stateNode=i,i._reactInternals=t,qx(t,r,e,n),t=Yx(null,t,r,!0,o,n)):(t.tag=0,yt&&o&&lS(t),Nn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xp(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=G4(r),e=Fr(r,e),i){case 0:t=Xx(null,t,r,e,n);break e;case 1:t=rj(null,t,r,e,n);break e;case 11:t=tj(null,t,r,e,n);break e;case 14:t=nj(null,t,r,Fr(r.type,e),n);break e}throw Error(re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),Xx(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),rj(e,t,r,i,n);case 3:e:{if(mN(t),e===null)throw Error(re(387));r=t.pendingProps,o=t.memoizedState,i=o.element,zk(e,t),jh(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Vl(Error(re(423)),t),t=ij(e,t,r,n,i);break e}else if(r!==i){i=Vl(Error(re(424)),t),t=ij(e,t,r,n,i);break e}else for(ar=Zo(t.stateNode.containerInfo.firstChild),sr=t,yt=!0,Vr=null,n=Bk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ul(),r===i){t=no(e,t,n);break e}Nn(e,t,r,n)}t=t.child}return t;case 5:return Hk(t),e===null&&Vx(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Fx(r,i)?a=null:o!==null&&Fx(r,o)&&(t.flags|=32),hN(e,t),Nn(e,t,a,n),t.child;case 6:return e===null&&Vx(t),null;case 13:return gN(e,t,n);case 4:return gS(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zl(t,null,r,n):Nn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),tj(e,t,r,i,n);case 7:return Nn(e,t,t.pendingProps,n),t.child;case 8:return Nn(e,t,t.pendingProps.children,n),t.child;case 12:return Nn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,ut(Oh,r._currentValue),r._currentValue=a,o!==null)if(Yr(o.value,a)){if(o.children===i.children&&!Xn.current){t=no(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=qi(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Wx(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(re(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Wx(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Nn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,yl(t,n),i=Tr(i),r=r(i),t.flags|=1,Nn(e,t,r,n),t.child;case 14:return r=t.type,i=Fr(r,t.pendingProps),i=Fr(r.type,i),nj(e,t,r,i,n);case 15:return dN(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),Xp(e,t),t.tag=1,Yn(r)?(e=!0,bh(t)):e=!1,yl(t,n),uN(t,r,i),qx(t,r,i,n),Yx(null,t,r,!0,e,n);case 19:return yN(e,t,n);case 22:return pN(e,t,n)}throw Error(re(156,t.tag))};function NN(e,t){return ak(e,t)}function q4(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.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 Pr(e,t,n,r){return new q4(e,t,n,r)}function RS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function G4(e){if(typeof e=="function")return RS(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yw)return 11;if(e===Qw)return 14}return 2}function ra(e,t){var n=e.alternate;return n===null?(n=Pr(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&14680064,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}function Jp(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")RS(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Qs:return ss(n.children,i,o,t);case Xw:a=8,i|=8;break;case yx:return e=Pr(12,n,t,i|2),e.elementType=yx,e.lanes=o,e;case vx:return e=Pr(13,n,t,i),e.elementType=vx,e.lanes=o,e;case xx:return e=Pr(19,n,t,i),e.elementType=xx,e.lanes=o,e;case HR:return mg(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case UR:a=10;break e;case zR:a=9;break e;case Yw:a=11;break e;case Qw:a=14;break e;case _o:a=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=Pr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ss(e,t,n,r){return e=Pr(7,e,r,t),e.lanes=n,e}function mg(e,t,n,r){return e=Pr(22,e,r,t),e.elementType=HR,e.lanes=n,e.stateNode={isHidden:!1},e}function mv(e,t,n){return e=Pr(6,e,null,t),e.lanes=n,e}function gv(e,t,n){return t=Pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function X4(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yy(0),this.expirationTimes=Yy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yy(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function kS(e,t,n,r,i,o,a,s,l){return e=new X4(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},mS(o),e}function Y4(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ys,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $N(e){if(!e)return ca;e=e._reactInternals;e:{if(Ns(e)!==e||e.tag!==1)throw Error(re(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(re(171))}if(e.tag===1){var n=e.type;if(Yn(n))return $k(e,n,t)}return t}function MN(e,t,n,r,i,o,a,s,l){return e=kS(n,r,!0,e,i,o,a,s,l),e.context=$N(null),n=e.current,r=Ln(),i=na(n),o=qi(r,i),o.callback=t??null,ea(n,o,i),e.current.lanes=i,vd(e,i,r),Qn(e,r),e}function gg(e,t,n,r){var i=t.current,o=Ln(),a=na(i);return n=$N(n),t.context===null?t.context=n:t.pendingContext=n,t=qi(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ea(i,t,a),e!==null&&(qr(e,i,a,o),Kp(e,i,a)),a}function Nh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function hj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function NS(e,t){hj(e,t),(e=e.alternate)&&hj(e,t)}function Q4(){return null}var IN=typeof reportError=="function"?reportError:function(e){console.error(e)};function $S(e){this._internalRoot=e}yg.prototype.render=$S.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));gg(e,t,null,null)};yg.prototype.unmount=$S.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ys(function(){gg(null,e,null,null)}),t[eo]=null}};function yg(e){this._internalRoot=e}yg.prototype.unstable_scheduleHydration=function(e){if(e){var t=pk();e={blockedOn:null,target:e,priority:t};for(var n=0;n<No.length&&t!==0&&t<No[n].priority;n++);No.splice(n,0,e),n===0&&mk(e)}};function MS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function mj(){}function J4(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=Nh(a);o.call(u)}}var a=MN(t,r,e,0,null,!1,!1,"",mj);return e._reactRootContainer=a,e[eo]=a.current,hf(e.nodeType===8?e.parentNode:e),ys(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=Nh(l);s.call(u)}}var l=kS(e,0,!1,null,null,!1,!1,"",mj);return e._reactRootContainer=l,e[eo]=l.current,hf(e.nodeType===8?e.parentNode:e),ys(function(){gg(t,l,n,r)}),l}function xg(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=Nh(a);s.call(l)}}gg(t,a,e,i)}else a=J4(n,t,e,i,r);return Nh(a)}fk=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_c(t.pendingLanes);n!==0&&(eS(t,n|1),Qn(t,Nt()),!(Ve&6)&&(Wl=Nt()+500,ba()))}break;case 13:ys(function(){var r=to(e,1);if(r!==null){var i=Ln();qr(r,e,1,i)}}),NS(e,1)}};tS=function(e){if(e.tag===13){var t=to(e,134217728);if(t!==null){var n=Ln();qr(t,e,134217728,n)}NS(e,134217728)}};dk=function(e){if(e.tag===13){var t=na(e),n=to(e,t);if(n!==null){var r=Ln();qr(n,e,t,r)}NS(e,t)}};pk=function(){return Ye};hk=function(e,t){var n=Ye;try{return Ye=e,t()}finally{Ye=n}};Tx=function(e,t,n){switch(t){case"input":if(Sx(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ug(r);if(!i)throw Error(re(90));WR(r),Sx(r,i)}}}break;case"textarea":qR(e,n);break;case"select":t=n.value,t!=null&&pl(e,!!n.multiple,t,!1)}};ek=CS;tk=ys;var Z4={usingClientEntryPoint:!1,Events:[bd,tl,ug,JR,ZR,CS]},fc={findFiberByHostInstance:Ua,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},eU={bundleType:fc.bundleType,version:fc.version,rendererPackageName:fc.rendererPackageName,rendererConfig:fc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ik(e),e===null?null:e.stateNode},findFiberByHostInstance:fc.findFiberByHostInstance||Q4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lp.isDisabled&&lp.supportsFiber)try{og=lp.inject(eU),gi=lp}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z4;pr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!MS(t))throw Error(re(200));return Y4(e,t,null,n)};pr.createRoot=function(e,t){if(!MS(e))throw Error(re(299));var n=!1,r="",i=IN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=kS(e,1,!1,null,null,n,!1,r,i),e[eo]=t.current,hf(e.nodeType===8?e.parentNode:e),new $S(t)};pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=ik(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return ys(e)};pr.hydrate=function(e,t,n){if(!vg(t))throw Error(re(200));return xg(null,e,t,!0,n)};pr.hydrateRoot=function(e,t,n){if(!MS(e))throw Error(re(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=IN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=MN(t,null,e,1,n??null,i,!1,o,a),e[eo]=t.current,hf(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new yg(t)};pr.render=function(e,t,n){if(!vg(t))throw Error(re(200));return xg(null,e,t,!1,n)};pr.unmountComponentAtNode=function(e){if(!vg(e))throw Error(re(40));return e._reactRootContainer?(ys(function(){xg(null,null,e,!1,function(){e._reactRootContainer=null,e[eo]=null})}),!0):!1};pr.unstable_batchedUpdates=CS;pr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vg(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return xg(e,t,n,!1,r)};pr.version="18.3.1-next-f1338f8080-20240426";function DN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DN)}catch(e){console.error(e)}}DN(),DR.exports=pr;var po=DR.exports,LN,gj=po;LN=gj.createRoot,gj.hydrateRoot;const FN=O.createContext(void 0),ho=e=>{const t=O.useContext(FN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tU=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(FN.Provider,{value:e,children:t})),nU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Io,Uw,pR,rU=(pR=class{constructor(){ye(this,Io,nU);ye(this,Uw,!1)}setTimeoutProvider(e){ue(this,Io,e)}setTimeout(e,t){return F(this,Io).setTimeout(e,t)}clearTimeout(e){F(this,Io).clearTimeout(e)}setInterval(e,t){return F(this,Io).setInterval(e,t)}clearInterval(e){F(this,Io).clearInterval(e)}},Io=new WeakMap,Uw=new WeakMap,pR);const Va=new rU;function iU(e){setTimeout(e,0)}const oU=typeof window>"u"||"Deno"in globalThis;function $n(){}function aU(e,t){return typeof e=="function"?e(t):e}function BN(e){return typeof e=="number"&&e>=0&&e!==1/0}function UN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ct(e,t){return typeof e=="function"?e(t):e}function yj(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==IS(a,t.options))return!1}else if(!Kl(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function vj(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(vs(t.options.mutationKey)!==vs(o))return!1}else if(!Kl(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function IS(e,t){return((t==null?void 0:t.queryKeyHashFn)||vs)(e)}function vs(e){return JSON.stringify(e,(t,n)=>lb(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Kl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let r=0;r<t.length;r++)if(!Kl(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!Kl(e[r],t[r]))return!1;return!0}return!1}const sU=Object.prototype.hasOwnProperty;function zN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=xj(e)&&xj(t);if(!r&&!(lb(e)&&lb(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,s=r?new Array(a):{};let l=0;for(let u=0;u<a;u++){const c=r?u:o[u],f=e[c],p=t[c];if(f===p){s[c]=f,(r?u<i:sU.call(e,c))&&l++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){s[c]=p;continue}const h=zN(f,p,n+1);s[c]=h,h===f&&l++}return i===a&&l===i?e:s}function Zp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function xj(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lb(e){if(!bj(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!bj(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function bj(e){return Object.prototype.toString.call(e)==="[object Object]"}function lU(e){return new Promise(t=>{Va.setTimeout(t,e)})}function ub(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zN(e,t):t}function uU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const DS=Symbol();function HN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===DS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function LS(e,t){return typeof e=="function"?e(...t):!!e}function fU(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}let dU=()=>oU;const FS=()=>dU();var _u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Qa,Do,El,hR,pU=(hR=class extends _u{constructor(){super();ye(this,Qa);ye(this,Do);ye(this,El);ue(this,El,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Do)||this.setEventListener(F(this,El))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Do))==null||t.call(this),ue(this,Do,void 0))}setEventListener(t){var n;ue(this,El,t),(n=F(this,Do))==null||n.call(this),ue(this,Do,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,Qa)!==t&&(ue(this,Qa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,Qa)=="boolean"?F(this,Qa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Qa=new WeakMap,Do=new WeakMap,El=new WeakMap,hR);const BS=new pU,hU=iU;function mU(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=hU;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}const Ht=mU();var Al,Lo,Cl,mR,gU=(mR=class extends _u{constructor(){super();ye(this,Al,!0);ye(this,Lo);ye(this,Cl);ue(this,Cl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,Lo)||this.setEventListener(F(this,Cl))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Lo))==null||t.call(this),ue(this,Lo,void 0))}setEventListener(t){var n;ue(this,Cl,t),(n=F(this,Lo))==null||n.call(this),ue(this,Lo,t(this.setOnline.bind(this)))}setOnline(t){F(this,Al)!==t&&(ue(this,Al,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,Al)}},Al=new WeakMap,Lo=new WeakMap,Cl=new WeakMap,mR);const $h=new gU;function yU(e){return Math.min(1e3*2**e,3e4)}function VN(e){return(e??"online")==="online"?$h.isOnline():!0}var cb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function WN(e){let t=!1,n=0,r,i="pending",o,a;const s=new Promise((m,b)=>{o=m,a=b});s.catch($n);const l=()=>i!=="pending",u=m=>{var b;if(!l()){const S=new cb(m);y(S),(b=e.onCancel)==null||b.call(e,S)}},c=()=>{t=!0},f=()=>{t=!1},p=()=>BS.isFocused()&&(e.networkMode==="always"||$h.isOnline())&&e.canRun(),h=()=>VN(e.networkMode)&&e.canRun(),v=m=>{l()||(r==null||r(),i="resolved",o(m))},y=m=>{l()||(r==null||r(),i="rejected",a(m))},x=()=>new Promise(m=>{var b;r=S=>{(l()||p())&&m(S)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;r=void 0,l()||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(l())return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(S){m=Promise.reject(S)}Promise.resolve(m).then(v).catch(S=>{var A;if(l())return;const w=e.retry??(FS()?0:3),P=e.retryDelay??yU,j=typeof P=="function"?P(n,S):P,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,S);if(t||!E){y(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),lU(j).then(()=>p()?void 0:x()).then(()=>{t?y(S):g()})})};return{promise:s,status:()=>i,cancel:u,continue:()=>(r==null||r(),s),cancelRetry:c,continueRetry:f,canStart:h,start:()=>(h()?g():x().then(g),s)}}var Ja,gR,KN=(gR=class{constructor(){ye(this,Ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),BN(this.gcTime)&&ue(this,Ja,Va.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(FS()?1/0:3e5))}clearGcTimeout(){F(this,Ja)!==void 0&&(Va.clearTimeout(F(this,Ja)),ue(this,Ja,void 0))}},Ja=new WeakMap,gR);function vU(e){return{onFetch:(t,n)=>{var c,f,p,h,v;const r=t.options,i=(p=(f=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=b=>{fU(b,()=>t.signal,()=>y=!0)},g=HN(t.options,t.fetchOptions),m=async(b,S,w)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&b.pages.length)return Promise.resolve(b);const j=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return x(T),T})(),E=await g(j),{maxPages:A}=t.options,C=w?cU:uU;return{pages:C(b.pages,E,A),pageParams:C(b.pageParams,S,A)}};if(i&&o.length){const b=i==="backward",S=b?qN:fb,w={pages:o,pageParams:a};s=await m(w,S(r,w),b)}else{const b=e??o.length;do{const S=l===0?a[0]??r.initialPageParam:fb(r,s);if(l>0&&S==null)break;s=await m(s,S),l++}while(l<b)}return s};t.options.persister?t.fetchFn=()=>{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function fb(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qN(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function xU(e,t){return t?fb(e,t)!=null:!1}function bU(e,t){return!t||!e.getPreviousPageParam?!1:qN(e,t)!=null}var Tl,Za,_l,br,es,Ut,dd,ts,Br,Ri,yR,wU=(yR=class extends KN{constructor(t){super();ye(this,Br);ye(this,Tl);ye(this,Za);ye(this,_l);ye(this,br);ye(this,es);ye(this,Ut);ye(this,dd);ye(this,ts);ue(this,ts,!1),ue(this,dd,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,es,t.client),ue(this,br,F(this,es).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,Za,Sj(this.options)),this.state=t.state??F(this,Za),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Tl)}get promise(){var t;return(t=F(this,Ut))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,dd),...t},t!=null&&t._type&&ue(this,Tl,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Sj(this.options);n.data!==void 0&&(this.setState(wj(n.data,n.dataUpdatedAt)),ue(this,Za,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,br).remove(this)}setData(t,n){const r=ub(this.state.data,t,this.options);return Re(this,Br,Ri).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Re(this,Br,Ri).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=F(this,Ut))==null?void 0:r.promise;return(i=F(this,Ut))==null||i.cancel(t),n?n.then($n).catch($n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Za)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ct(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===DS||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ct(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!UN(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=F(this,Ut))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=F(this,Ut))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(F(this,Ut)&&(F(this,ts)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?F(this,Ut).cancel({revert:!0}):F(this,Ut).cancelRetry()),this.scheduleGc()),F(this,br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Re(this,Br,Ri).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,f,p,h,v,y,x,g,m,b,S;if(this.state.fetchStatus!=="idle"&&((u=F(this,Ut))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,Ut))return F(this,Ut).continueRetry(),F(this,Ut).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(P=>P.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,i=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(ue(this,ts,!0),r.signal)})},o=()=>{const w=HN(this.options,n),j=(()=>{const E={client:F(this,es),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return ue(this,ts,!1),this.options.persister?this.options.persister(w,j,this):w(j)},s=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,es),state:this.state,fetchFn:o};return i(w),w})();(c=F(this,Tl)==="infinite"?vU(this.options.pages):this.options.behavior)==null||c.onFetch(s,this),ue(this,_l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&Re(this,Br,Ri).call(this,{type:"fetch",meta:(p=s.fetchOptions)==null?void 0:p.meta});const l=ue(this,Ut,WN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,onCancel:w=>{w instanceof cb&&w.revert&&this.setState({...F(this,_l),fetchStatus:"idle"}),r.abort()},onFail:(w,P)=>{Re(this,Br,Ri).call(this,{type:"failed",failureCount:w,error:P})},onPause:()=>{Re(this,Br,Ri).call(this,{type:"pause"})},onContinue:()=>{Re(this,Br,Ri).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const w=await l.start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(v=(h=F(this,br).config).onSuccess)==null||v.call(h,w,this),(x=(y=F(this,br).config).onSettled)==null||x.call(y,w,this.state.error,this),w}catch(w){if(w instanceof cb){if(w.silent)return F(this,Ut).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Re(this,Br,Ri).call(this,{type:"error",error:w}),(m=(g=F(this,br).config).onError)==null||m.call(g,w,this),(S=(b=F(this,br).config).onSettled)==null||S.call(b,this.state.data,w,this),w}finally{F(this,Ut)===l&&ue(this,Ut,void 0),this.scheduleGc()}}},Tl=new WeakMap,Za=new WeakMap,_l=new WeakMap,br=new WeakMap,es=new WeakMap,Ut=new WeakMap,dd=new WeakMap,ts=new WeakMap,Br=new WeakSet,Ri=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...GN(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...wj(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,_l,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ht.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),F(this,br).notify({query:this,type:"updated",action:t})})},yR);function GN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wj(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Sj(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rn,Be,pd,kn,ns,Rl,Di,hd,kl,Nl,rs,is,Fo,$l,Ke,kc,db,pb,hb,mb,gb,yb,vb,xb,vR,XN=(vR=class extends _u{constructor(t,n){super();ye(this,Ke);ye(this,Rn);ye(this,Be);ye(this,pd);ye(this,kn);ye(this,ns);ye(this,Rl);ye(this,Di);ye(this,hd);ye(this,kl);ye(this,Nl);ye(this,rs);ye(this,is);ye(this,Fo);ye(this,$l,new Set);this.options=n,ue(this,Rn,t),ue(this,Di,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Be).addObserver(this),Oj(F(this,Be),this.options)?Re(this,Ke,kc).call(this):this.updateResult(),Re(this,Ke,gb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bb(F(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bb(F(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,Ke,yb).call(this),Re(this,Ke,vb).call(this),F(this,Be).removeObserver(this)}setOptions(t){const n=this.options,r=F(this,Be);if(this.options=F(this,Rn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ct(this.options.enabled,F(this,Be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Re(this,Ke,xb).call(this),F(this,Be).setOptions(this.options),n._defaulted&&!Zp(this.options,n)&&F(this,Rn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Be),observer:this});const i=this.hasListeners();i&&Pj(F(this,Be),r,this.options,n)&&Re(this,Ke,kc).call(this),this.updateResult(),i&&(F(this,Be)!==r||Ct(this.options.enabled,F(this,Be))!==Ct(n.enabled,F(this,Be))||Ct(this.options.staleTime,F(this,Be))!==Ct(n.staleTime,F(this,Be)))&&Re(this,Ke,pb).call(this);const o=Re(this,Ke,hb).call(this);i&&(F(this,Be)!==r||Ct(this.options.enabled,F(this,Be))!==Ct(n.enabled,F(this,Be))||o!==F(this,Fo))&&Re(this,Ke,mb).call(this,o)}getOptimisticResult(t){const n=F(this,Rn).getQueryCache().build(F(this,Rn),t),r=this.createResult(n,t);return Zp(this.getCurrentResult(),r)||(ue(this,kn,r),ue(this,Rl,this.options),ue(this,ns,F(this,Be).state)),r}getCurrentResult(){return F(this,kn)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){F(this,$l).add(t)}getCurrentQuery(){return F(this,Be)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,Rn).defaultQueryOptions(t),r=F(this,Rn).getQueryCache().build(F(this,Rn),n);let i=()=>{},o;const a=new Promise(s=>{o=s,i=F(this,Rn).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(i(),s(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const s=this.createResult(r,n);return o==null||o(s),s}).finally(()=>{i()}),a])}fetch(t){return Re(this,Ke,kc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,kn)))}createResult(t,n){var P;const r=F(this,Be),i=this.options,o=F(this,kn),a=F(this,ns),s=F(this,Rl),l=t!==r?t.state:F(this,pd),{state:u}=t;let c={...u},f=!1,p;if(n._optimisticResults){const j=this.hasListeners(),E=!j&&Oj(t,n),A=j&&Pj(t,r,n,i);(E||A)&&(c={...c,...GN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:h,errorUpdatedAt:v,status:y}=c;p=c.data;let x=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let j;o!=null&&o.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(j=o.data,x=!0):j=typeof n.placeholderData=="function"?n.placeholderData((P=F(this,Nl))==null?void 0:P.state.data,F(this,Nl)):n.placeholderData,j!==void 0&&(y="success",p=ub(o==null?void 0:o.data,j,n),f=!0)}if(n.select&&p!==void 0&&!x)if(o&&p===(a==null?void 0:a.data)&&n.select===F(this,hd))p=F(this,kl);else try{ue(this,hd,n.select),p=n.select(p),p=ub(o==null?void 0:o.data,p,n),ue(this,kl,p),ue(this,Di,null)}catch(j){ue(this,Di,j)}else p===void 0&&ue(this,Di,null);F(this,Di)&&(h=F(this,Di),p=F(this,kl),v=Date.now(),y="error",f=!1);const g=c.fetchStatus==="fetching",m=y==="pending",b=y==="error",S=m&&g,w=p!==void 0;return{status:y,fetchStatus:c.fetchStatus,isPending:m,isSuccess:y==="success",isError:b,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!m,isLoadingError:b&&!w,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&w,isStale:US(t,n),refetch:this.refetch,isEnabled:Ct(n.enabled,t)!==!1}}updateResult(){const t=F(this,kn),n=this.createResult(F(this,Be),this.options);if(ue(this,ns,F(this,Be).state),ue(this,Rl,this.options),F(this,ns).data!==void 0&&ue(this,Nl,F(this,Be)),Zp(n,t))return;ue(this,kn,n);const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!F(this,$l).size)return!0;const s=new Set(a??F(this,$l));return this.options.throwOnError&&s.add("error"),Object.keys(F(this,kn)).some(l=>{const u=l;return F(this,kn)[u]!==t[u]&&s.has(u)})})();Ht.batch(()=>{i&&this.listeners.forEach(o=>{o(F(this,kn))}),F(this,Rn).getQueryCache().notify({query:F(this,Be),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,Ke,gb).call(this)}},Rn=new WeakMap,Be=new WeakMap,pd=new WeakMap,kn=new WeakMap,ns=new WeakMap,Rl=new WeakMap,Di=new WeakMap,hd=new WeakMap,kl=new WeakMap,Nl=new WeakMap,rs=new WeakMap,is=new WeakMap,Fo=new WeakMap,$l=new WeakMap,Ke=new WeakSet,kc=function(t){Re(this,Ke,xb).call(this);let n=F(this,Be).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($n)),n},db=function(t){return!FS()&&Ct(this.options.enabled,F(this,Be))!==!1&&BN(t)},pb=function(){Re(this,Ke,yb).call(this);const t=Ct(this.options.staleTime,F(this,Be));if(F(this,kn).isStale||!Re(this,Ke,db).call(this,t))return;const n=UN(F(this,kn).dataUpdatedAt,t)+1;ue(this,rs,Va.setTimeout(()=>{F(this,kn).isStale||this.updateResult()},n))},hb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Be)):this.options.refetchInterval)??!1},mb=function(t){Re(this,Ke,vb).call(this),ue(this,Fo,t),!(F(this,Fo)===0||!Re(this,Ke,db).call(this,F(this,Fo)))&&ue(this,is,Va.setInterval(()=>{(this.options.refetchIntervalInBackground||BS.isFocused())&&Re(this,Ke,kc).call(this)},F(this,Fo)))},gb=function(){Re(this,Ke,pb).call(this),Re(this,Ke,mb).call(this,Re(this,Ke,hb).call(this))},yb=function(){F(this,rs)!==void 0&&(Va.clearTimeout(F(this,rs)),ue(this,rs,void 0))},vb=function(){F(this,is)!==void 0&&(Va.clearInterval(F(this,is)),ue(this,is,void 0))},xb=function(){const t=F(this,Rn).getQueryCache().build(F(this,Rn),this.options);if(t===F(this,Be))return;const n=F(this,Be);ue(this,Be,t),ue(this,pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vR);function SU(e,t){return Ct(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ct(t.retryOnMount,e)===!1)}function Oj(e,t){return SU(e,t)||e.state.data!==void 0&&bb(e,t,t.refetchOnMount)}function bb(e,t,n){if(Ct(t.enabled,e)!==!1&&Ct(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&US(e,t)}return!1}function Pj(e,t,n,r){return(e!==t||Ct(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&US(e,n)}function US(e,t){return Ct(t.enabled,e)!==!1&&e.isStaleByTime(Ct(t.staleTime,e))}var OU=class extends XN{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var h,v;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:a,isRefetchError:s}=r,l=(v=(h=n.fetchMeta)==null?void 0:h.fetchMore)==null?void 0:v.direction,u=a&&l==="forward",c=i&&l==="forward",f=a&&l==="backward",p=i&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:xU(t,n.data),hasPreviousPage:bU(t,n.data),isFetchNextPageError:u,isFetchingNextPage:c,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:s&&!u&&!f,isRefetching:o&&!c&&!p}}},md,li,wn,os,ui,Co,xR,PU=(xR=class extends KN{constructor(t){super();ye(this,ui);ye(this,md);ye(this,li);ye(this,wn);ye(this,os);ue(this,md,t.client),this.mutationId=t.mutationId,ue(this,wn,t.mutationCache),ue(this,li,[]),this.state=t.state||YN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,li).includes(t)||(F(this,li).push(t),this.clearGcTimeout(),F(this,wn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,li,F(this,li).filter(n=>n!==t)),this.scheduleGc(),F(this,wn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,li).length||(this.state.status==="pending"?this.scheduleGc():F(this,wn).remove(this))}continue(){var t;return((t=F(this,os))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var s,l,u,c,f,p,h,v,y,x,g,m,b,S,w,P,j,E;const n=()=>{Re(this,ui,Co).call(this,{type:"continue"})},r={client:F(this,md),meta:this.options.meta,mutationKey:this.options.mutationKey},i=ue(this,os,WN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,C)=>{Re(this,ui,Co).call(this,{type:"failed",failureCount:A,error:C})},onPause:()=>{Re(this,ui,Co).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,wn).canRun(this)})),o=this.state.status==="pending",a=!i.canStart();try{if(o)n();else{Re(this,ui,Co).call(this,{type:"pending",variables:t,isPaused:a}),F(this,wn).config.onMutate&&await F(this,wn).config.onMutate(t,this,r);const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t,r));C!==this.state.context&&Re(this,ui,Co).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const A=await i.start();return await((c=(u=F(this,wn).config).onSuccess)==null?void 0:c.call(u,A,t,this.state.context,this,r)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,A,t,this.state.context,r)),await((v=(h=F(this,wn).config).onSettled)==null?void 0:v.call(h,A,null,this.state.variables,this.state.context,this,r)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,A,null,t,this.state.context,r)),Re(this,ui,Co).call(this,{type:"success",data:A}),A}catch(A){try{await((m=(g=F(this,wn).config).onError)==null?void 0:m.call(g,A,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((S=(b=this.options).onError)==null?void 0:S.call(b,A,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((P=(w=F(this,wn).config).onSettled)==null?void 0:P.call(w,void 0,A,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((E=(j=this.options).onSettled)==null?void 0:E.call(j,void 0,A,t,this.state.context,r))}catch(C){Promise.reject(C)}throw Re(this,ui,Co).call(this,{type:"error",error:A}),A}finally{F(this,os)===i&&ue(this,os,void 0),F(this,wn).runNext(this)}}},md=new WeakMap,li=new WeakMap,wn=new WeakMap,os=new WeakMap,ui=new WeakSet,Co=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ht.batch(()=>{F(this,li).forEach(r=>{r.onMutationUpdate(t)}),F(this,wn).notify({mutation:this,type:"updated",action:t})})},xR);function YN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Li,Ur,gd,bR,jU=(bR=class extends _u{constructor(t={}){super();ye(this,Li);ye(this,Ur);ye(this,gd);this.config=t,ue(this,Li,new Set),ue(this,Ur,new Map),ue(this,gd,0)}build(t,n,r){const i=new PU({client:t,mutationCache:this,mutationId:++Vd(this,gd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){F(this,Li).add(t);const n=up(t);if(typeof n=="string"){const r=F(this,Ur).get(n);r?r.push(t):F(this,Ur).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,Li).delete(t)){const n=up(t);if(typeof n=="string"){const r=F(this,Ur).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&F(this,Ur).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=up(t);if(typeof n=="string"){const i=(r=F(this,Ur).get(n))==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r,i;const n=up(t);return typeof n=="string"?((i=(r=F(this,Ur).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:i.continue())??Promise.resolve():Promise.resolve()}clear(){Ht.batch(()=>{F(this,Li).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,Li).clear(),F(this,Ur).clear()})}getAll(){return Array.from(F(this,Li))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vj(n,r))}findAll(t={}){return this.getAll().filter(n=>vj(t,n))}notify(t){Ht.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ht.batch(()=>Promise.all(t.map(n=>n.continue().catch($n))))}},Li=new WeakMap,Ur=new WeakMap,gd=new WeakMap,bR);function up(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fi,Bo,Sn,Bi,mi,Nc,wb,wR,EU=(wR=class extends _u{constructor(n,r){super();ye(this,mi);ye(this,Fi);ye(this,Bo);ye(this,Sn);ye(this,Bi);ue(this,Fi,n),this.setOptions(r),this.bindMethods(),Re(this,mi,Nc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=F(this,Fi).defaultMutationOptions(n),Zp(this.options,r)||F(this,Fi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Sn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&vs(r.mutationKey)!==vs(this.options.mutationKey)?this.reset():((i=F(this,Sn))==null?void 0:i.state.status)==="pending"&&F(this,Sn).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&F(this,Sn)&&(F(this,Sn).addObserver(this),Re(this,mi,Nc).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,Sn))==null||n.removeObserver(this)}onMutationUpdate(n){Re(this,mi,Nc).call(this),Re(this,mi,wb).call(this,n)}getCurrentResult(){return F(this,Bo)}reset(){var n;(n=F(this,Sn))==null||n.removeObserver(this),ue(this,Sn,void 0),Re(this,mi,Nc).call(this),Re(this,mi,wb).call(this)}mutate(n,r){var i;return ue(this,Bi,r),(i=F(this,Sn))==null||i.removeObserver(this),ue(this,Sn,F(this,Fi).getMutationCache().build(F(this,Fi),this.options)),F(this,Sn).addObserver(this),F(this,Sn).execute(n)}},Fi=new WeakMap,Bo=new WeakMap,Sn=new WeakMap,Bi=new WeakMap,mi=new WeakSet,Nc=function(){var r;const n=((r=F(this,Sn))==null?void 0:r.state)??YN();ue(this,Bo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},wb=function(n){Ht.batch(()=>{var r,i,o,a,s,l,u,c;if(F(this,Bi)&&this.hasListeners()){const f=F(this,Bo).variables,p=F(this,Bo).context,h={client:F(this,Fi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=F(this,Bi)).onSuccess)==null||i.call(r,n.data,f,p,h)}catch(v){Promise.reject(v)}try{(a=(o=F(this,Bi)).onSettled)==null||a.call(o,n.data,null,f,p,h)}catch(v){Promise.reject(v)}}else if((n==null?void 0:n.type)==="error"){try{(l=(s=F(this,Bi)).onError)==null||l.call(s,n.error,f,p,h)}catch(v){Promise.reject(v)}try{(c=(u=F(this,Bi)).onSettled)==null||c.call(u,void 0,n.error,f,p,h)}catch(v){Promise.reject(v)}}}this.listeners.forEach(f=>{f(F(this,Bo))})})},wR),ci,SR,AU=(SR=class extends _u{constructor(t={}){super();ye(this,ci);this.config=t,ue(this,ci,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??IS(i,n);let a=this.get(o);return a||(a=new wU({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){F(this,ci).has(t.queryHash)||(F(this,ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,ci).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ht.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,ci).get(t)}getAll(){return[...F(this,ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yj(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>yj(t,r)):n}notify(t){Ht.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ht.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ht.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ci=new WeakMap,SR),bt,Uo,zo,Ml,Il,Ho,Dl,Ll,OR,CU=(OR=class{constructor(e={}){ye(this,bt);ye(this,Uo);ye(this,zo);ye(this,Ml);ye(this,Il);ye(this,Ho);ye(this,Dl);ye(this,Ll);ue(this,bt,e.queryCache||new AU),ue(this,Uo,e.mutationCache||new jU),ue(this,zo,e.defaultOptions||{}),ue(this,Ml,new Map),ue(this,Il,new Map),ue(this,Ho,0)}mount(){Vd(this,Ho)._++,F(this,Ho)===1&&(ue(this,Dl,BS.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,bt).onFocus())})),ue(this,Ll,$h.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,bt).onOnline())})))}unmount(){var e,t;Vd(this,Ho)._--,F(this,Ho)===0&&((e=F(this,Dl))==null||e.call(this),ue(this,Dl,void 0),(t=F(this,Ll))==null||t.call(this),ue(this,Ll,void 0))}isFetching(e){return F(this,bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Uo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,bt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,bt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ct(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,bt).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var a;const r=this.defaultQueryOptions({queryKey:e}),i=(a=F(this,bt).get(r.queryHash))==null?void 0:a.state.data,o=aU(t,i);if(o!==void 0)return F(this,bt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Ht.batch(()=>F(this,bt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,bt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,bt);Ht.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,bt);return Ht.batch(()=>{const r=n.findAll(e),i=new Set(r);return r.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>i.has(o)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ht.batch(()=>F(this,bt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then($n).catch($n)}invalidateQueries(e,t={}){return Ht.batch(()=>(F(this,bt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ht.batch(()=>F(this,bt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch($n)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($n)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,bt).build(this,t),r=n.isStaleByTime(Ct(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,bt).build(this,t);return n.isStaleByTime(Ct(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($n).catch($n)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($n).catch($n)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return $h.isOnline()?F(this,Uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,bt)}getMutationCache(){return F(this,Uo)}getDefaultOptions(){return F(this,zo)}setDefaultOptions(e){ue(this,zo,e)}setQueryDefaults(e,t){F(this,Ml).set(vs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Ml).values()],n={};return t.forEach(r=>{Kl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,Il).set(vs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Il).values()],n={};return t.forEach(r=>{Kl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,zo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=IS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===DS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,zo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,bt).clear(),F(this,Uo).clear()}},bt=new WeakMap,Uo=new WeakMap,zo=new WeakMap,Ml=new WeakMap,Il=new WeakMap,Ho=new WeakMap,Dl=new WeakMap,Ll=new WeakMap,OR);const QN=O.createContext(!1),TU=()=>O.useContext(QN);QN.Provider;function _U(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const RU=O.createContext(_U()),kU=()=>O.useContext(RU),NU=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?LS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},$U=e=>{O.useEffect(()=>{e.clearReset()},[e])},MU=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||LS(n,[e.error,r])),IU=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},DU=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,LU=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JN(e,t,n){const r=TU(),i=kU(),o=ho(),a=o.defaultQueryOptions(e),s=o.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,IU(a),NU(a,i,s),$U(i);const[u]=O.useState(()=>new t(o,a)),c=u.getOptimisticResult(a),f=!r&&l;if(O.useSyncExternalStore(O.useCallback(p=>{const h=f?u.subscribe(Ht.batchCalls(p)):$n;return u.updateResult(),h},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(a)},[a,u]),DU(a,c))throw LU(a,u,i);if(MU({result:c,errorResetBoundary:i,throwOnError:a.throwOnError,query:s,suspense:a.suspense}))throw c.error;return a.notifyOnChangeProps?c:u.trackResult(c)}function Et(e,t){return JN(e,XN)}function $s(e,t){const n=ho(),[r]=O.useState(()=>new EU(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(a=>r.subscribe(Ht.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=O.useCallback((...a)=>{r.mutate(a[0],a[1]).catch($n)},[r]);if(i.error&&LS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function FU(e,t){return JN(e,OU)}/**
40
+ `+o.stack}return{value:e,source:t,stack:i,digest:null}}function pv(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gx(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _4=typeof WeakMap=="function"?WeakMap:Map;function cN(e,t,n){n=qi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_h||(_h=!0,ib=r),Gx(e,t)},n}function fN(e,t,n){n=qi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Gx(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Gx(e,t),typeof r!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function JP(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _4;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)||(i.add(n),e=V4.bind(null,e,t,n),t.then(e,e))}function ZP(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ej(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=qi(-1,1),t.tag=2,ea(n,t,1))),n.lanes|=1),e)}var R4=fo.ReactCurrentOwner,qn=!1;function Nn(e,t,n,r){t.child=e===null?Bk(t,null,n,r):zl(t,e.child,n,r)}function tj(e,t,n,r,i){n=n.render;var o=t.ref;return yl(t,i),r=bS(e,t,n,r,o,i),n=wS(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,no(e,t,i)):(vt&&n&&lS(t),t.flags|=1,Nn(e,t,r,i),t.child)}function nj(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!RS(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,dN(e,t,o,r,i)):(e=Jp(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:pf,n(a,r)&&e.ref===t.ref)return no(e,t,i)}return t.flags|=1,e=ra(o,r),e.ref=t.ref,e.return=t,t.child=e}function dN(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(pf(o,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(qn=!0);else return t.lanes=e.lanes,no(e,t,i)}return Xx(e,t,n,r,i)}function pN(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(sl,rr),rr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(sl,rr),rr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ut(sl,rr),rr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ut(sl,rr),rr|=r;return Nn(e,t,i,n),t.child}function hN(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xx(e,t,n,r,i){var o=Yn(n)?ps:An.current;return o=Bl(t,o),yl(t,i),n=bS(e,t,n,r,o,i),r=wS(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,no(e,t,i)):(vt&&r&&lS(t),t.flags|=1,Nn(e,t,n,i),t.child)}function rj(e,t,n,r,i){if(Yn(n)){var o=!0;bh(t)}else o=!1;if(yl(t,i),t.stateNode===null)Xp(e,t),uN(t,n,r),qx(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Tr(u):(u=Yn(n)?ps:An.current,u=Bl(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&QP(t,a,r,u),Ro=!1;var p=t.memoizedState;a.state=p,jh(t,r,a,i),l=t.memoizedState,s!==r||p!==l||Xn.current||Ro?(typeof c=="function"&&(Kx(t,n,c,r),l=t.memoizedState),(s=Ro||YP(t,n,s,r,p,l,u))?(f||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=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,zk(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Fr(t.type,s),a.props=u,f=t.pendingProps,p=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Tr(l):(l=Yn(n)?ps:An.current,l=Bl(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||p!==l)&&QP(t,a,r,l),Ro=!1,p=t.memoizedState,a.state=p,jh(t,r,a,i);var v=t.memoizedState;s!==f||p!==v||Xn.current||Ro?(typeof h=="function"&&(Kx(t,n,h,r),v=t.memoizedState),(u=Ro||YP(t,n,u,r,p,v,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,v,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,v,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),a.props=r,a.state=v,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Yx(e,t,n,r,o,i)}function Yx(e,t,n,r,i,o){hN(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&zP(t,n,!1),no(e,t,o);r=t.stateNode,R4.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=zl(t,e.child,null,o),t.child=zl(t,null,s,o)):Nn(e,t,s,o),t.memoizedState=r.state,i&&zP(t,n,!0),t.child}function mN(e){var t=e.stateNode;t.pendingContext?UP(e,t.pendingContext,t.pendingContext!==t.context):t.context&&UP(e,t.context,!1),gS(e,t.containerInfo)}function ij(e,t,n,r,i){return Ul(),cS(i),t.flags|=256,Nn(e,t,n,r),t.child}var Qx={dehydrated:null,treeContext:null,retryLane:0};function Jx(e){return{baseLanes:e,cachePool:null,transitions:null}}function gN(e,t,n){var r=t.pendingProps,i=St.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ut(St,i&1),e===null)return Vx(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=mg(a,r,0,null),e=ss(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Jx(n),t.memoizedState=Qx,e):PS(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return k4(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ra(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=ra(s,o):(o=ss(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?Jx(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=Qx,r}return o=e.child,e=o.sibling,r=ra(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function PS(e,t){return t=mg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function op(e,t,n,r){return r!==null&&cS(r),zl(t,e.child,null,n),e=PS(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function k4(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=pv(Error(re(422))),op(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=mg({mode:"visible",children:r.children},i,0,null),o=ss(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&zl(t,e.child,null,a),t.child.memoizedState=Jx(a),t.memoizedState=Qx,o);if(!(t.mode&1))return op(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(re(419)),r=pv(o,r,void 0),op(e,t,a,r)}if(s=(a&e.childLanes)!==0,qn||s){if(r=Zt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,to(e,i),qr(r,e,i,-1))}return _S(),r=pv(Error(re(421))),op(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=W4.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ar=Zo(i.nextSibling),sr=t,vt=!0,Vr=null,e!==null&&(wr[Sr++]=Ui,wr[Sr++]=zi,wr[Sr++]=hs,Ui=e.id,zi=e.overflow,hs=t),t=PS(t,r.children),t.flags|=4096,t)}function oj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wx(e.return,t,n)}function hv(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function yN(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Nn(e,t,r.children,n),r=St.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&oj(e,n,t);else if(e.tag===19)oj(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(St,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Eh(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),hv(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Eh(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}hv(t,!0,n,null,o);break;case"together":hv(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function no(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function N4(e,t,n){switch(t.tag){case 3:mN(t),Ul();break;case 5:Hk(t);break;case 1:Yn(t.type)&&bh(t);break;case 4:gS(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ut(Oh,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ut(St,St.current&1),t.flags|=128,null):n&t.child.childLanes?gN(e,t,n):(ut(St,St.current&1),e=no(e,t,n),e!==null?e.sibling:null);ut(St,St.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return yN(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ut(St,St.current),r)break;return null;case 22:case 23:return t.lanes=0,pN(e,t,n)}return no(e,t,n)}var vN,Zx,xN,bN;vN=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Zx=function(){};xN=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ha(yi.current);var o=null;switch(n){case"input":i=wx(e,i),r=wx(e,r),o=[];break;case"select":i=Et({},i,{value:void 0}),r=Et({},r,{value:void 0}),o=[];break;case"textarea":i=Px(e,i),r=Px(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vh)}Ex(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(af.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(af.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&dt("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};bN=function(e,t,n,r){n!==r&&(t.flags|=4)};function cc(e,t){if(!vt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xn(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&14680064,r|=i.flags&14680064,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 $4(e,t,n){var r=t.pendingProps;switch(uS(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return Yn(t.type)&&xh(),xn(t),null;case 3:return r=t.stateNode,Hl(),mt(Xn),mt(An),vS(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vr!==null&&(sb(Vr),Vr=null))),Zx(e,t),xn(t),null;case 5:yS(t);var i=Ha(vf.current);if(n=t.type,e!==null&&t.stateNode!=null)xN(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(re(166));return xn(t),null}if(e=Ha(yi.current),rp(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[di]=t,r[gf]=o,e=(t.mode&1)!==0,n){case"dialog":dt("cancel",r),dt("close",r);break;case"iframe":case"object":case"embed":dt("load",r);break;case"video":case"audio":for(i=0;i<Rc.length;i++)dt(Rc[i],r);break;case"source":dt("error",r);break;case"img":case"image":case"link":dt("error",r),dt("load",r);break;case"details":dt("toggle",r);break;case"input":hP(r,o),dt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},dt("invalid",r);break;case"textarea":gP(r,o),dt("invalid",r)}Ex(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&np(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&np(r.textContent,s,e),i=["children",""+s]):af.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&dt("scroll",r)}switch(n){case"input":Gd(r),mP(r,o,!0);break;case"textarea":Gd(r),yP(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=vh)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=GR(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[di]=t,e[gf]=r,vN(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ax(n,r),n){case"dialog":dt("cancel",e),dt("close",e),i=r;break;case"iframe":case"object":case"embed":dt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Rc.length;i++)dt(Rc[i],e);i=r;break;case"source":dt("error",e),i=r;break;case"img":case"image":case"link":dt("error",e),dt("load",e),i=r;break;case"details":dt("toggle",e),i=r;break;case"input":hP(e,r),i=wx(e,r),dt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Et({},r,{value:void 0}),dt("invalid",e);break;case"textarea":gP(e,r),i=Px(e,r),dt("invalid",e);break;default:i=r}Ex(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?QR(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&XR(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&sf(e,l):typeof l=="number"&&sf(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(af.hasOwnProperty(o)?l!=null&&o==="onScroll"&&dt("scroll",e):l!=null&&Gw(e,o,l,a))}switch(n){case"input":Gd(e),mP(e,r,!1);break;case"textarea":Gd(e),yP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ua(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?pl(e,!!r.multiple,o,!1):r.defaultValue!=null&&pl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=vh)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xn(t),null;case 6:if(e&&t.stateNode!=null)bN(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(n=Ha(vf.current),Ha(yi.current),rp(t)){if(r=t.stateNode,n=t.memoizedProps,r[di]=t,(o=r.nodeValue!==n)&&(e=sr,e!==null))switch(e.tag){case 3:np(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&np(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[di]=t,t.stateNode=r}return xn(t),null;case 13:if(mt(St),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&ar!==null&&t.mode&1&&!(t.flags&128))Lk(),Ul(),t.flags|=98560,o=!1;else if(o=rp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(re(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(re(317));o[di]=t}else Ul(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xn(t),o=!1}else Vr!==null&&(sb(Vr),Vr=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||St.current&1?Vt===0&&(Vt=3):_S())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return Hl(),Zx(e,t),e===null&&hf(t.stateNode.containerInfo),xn(t),null;case 10:return pS(t.type._context),xn(t),null;case 17:return Yn(t.type)&&xh(),xn(t),null;case 19:if(mt(St),o=t.memoizedState,o===null)return xn(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)cc(o,!1);else{if(Vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Eh(e),a!==null){for(t.flags|=128,cc(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ut(St,St.current&1|2),t.child}e=e.sibling}o.tail!==null&&Nt()>Wl&&(t.flags|=128,r=!0,cc(o,!1),t.lanes=4194304)}else{if(!r)if(e=Eh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!vt)return xn(t),null}else 2*Nt()-o.renderingStartTime>Wl&&n!==1073741824&&(t.flags|=128,r=!0,cc(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Nt(),t.sibling=null,n=St.current,ut(St,r?n&1|2:n&1),t):(xn(t),null);case 22:case 23:return TS(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?rr&1073741824&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function M4(e,t){switch(uS(t),t.tag){case 1:return Yn(t.type)&&xh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hl(),mt(Xn),mt(An),vS(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yS(t),null;case 13:if(mt(St),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return mt(St),null;case 4:return Hl(),null;case 10:return pS(t.type._context),null;case 22:case 23:return TS(),null;case 24:return null;default:return null}}var ap=!1,Pn=!1,I4=typeof WeakSet=="function"?WeakSet:Set,he=null;function al(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Tt(e,t,r)}else n.current=null}function eb(e,t,n){try{n()}catch(r){Tt(e,t,r)}}var aj=!1;function D4(e,t){if(Dx=mh,e=jk(),sS(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(s=a+i),f!==o||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===i&&(s=a),p===o&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lx={focusedElem:e,selectionRange:n},mh=!1,he=t;he!==null;)if(t=he,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,he=e;else for(;he!==null;){t=he;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,x=v.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Fr(t.type,y),x);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(S){Tt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,he=e;break}he=t.return}return v=aj,aj=!1,v}function Wc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&eb(t,n,o)}i=i.next}while(i!==r)}}function pg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wN(e){var t=e.alternate;t!==null&&(e.alternate=null,wN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[di],delete t[gf],delete t[Ux],delete t[x4],delete t[b4])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function SN(e){return e.tag===5||e.tag===3||e.tag===4}function sj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SN(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vh));else if(r!==4&&(e=e.child,e!==null))for(nb(e,t,n),e=e.sibling;e!==null;)nb(e,t,n),e=e.sibling}function rb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(rb(e,t,n),e=e.sibling;e!==null;)rb(e,t,n),e=e.sibling}var sn=null,zr=!1;function jo(e,t,n){for(n=n.child;n!==null;)ON(e,t,n),n=n.sibling}function ON(e,t,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(og,n)}catch{}switch(n.tag){case 5:Pn||al(n,t);case 6:var r=sn,i=zr;sn=null,jo(e,t,n),sn=r,zr=i,sn!==null&&(zr?(e=sn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):sn.removeChild(n.stateNode));break;case 18:sn!==null&&(zr?(e=sn,n=n.stateNode,e.nodeType===8?sv(e.parentNode,n):e.nodeType===1&&sv(e,n),ff(e)):sv(sn,n.stateNode));break;case 4:r=sn,i=zr,sn=n.stateNode.containerInfo,zr=!0,jo(e,t,n),sn=r,zr=i;break;case 0:case 11:case 14:case 15:if(!Pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&eb(n,t,a),i=i.next}while(i!==r)}jo(e,t,n);break;case 1:if(!Pn&&(al(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Tt(n,t,s)}jo(e,t,n);break;case 21:jo(e,t,n);break;case 22:n.mode&1?(Pn=(r=Pn)||n.memoizedState!==null,jo(e,t,n),Pn=r):jo(e,t,n);break;default:jo(e,t,n)}}function lj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new I4),t.forEach(function(r){var i=K4.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:sn=s.stateNode,zr=!1;break e;case 3:sn=s.stateNode.containerInfo,zr=!0;break e;case 4:sn=s.stateNode.containerInfo,zr=!0;break e}s=s.return}if(sn===null)throw Error(re(160));ON(o,a,i),sn=null,zr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Tt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)PN(t,e),t=t.sibling}function PN(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dr(t,e),ri(e),r&4){try{Wc(3,e,e.return),pg(3,e)}catch(y){Tt(e,e.return,y)}try{Wc(5,e,e.return)}catch(y){Tt(e,e.return,y)}}break;case 1:Dr(t,e),ri(e),r&512&&n!==null&&al(n,n.return);break;case 5:if(Dr(t,e),ri(e),r&512&&n!==null&&al(n,n.return),e.flags&32){var i=e.stateNode;try{sf(i,"")}catch(y){Tt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&KR(i,o),Ax(s,a);var u=Ax(s,o);for(a=0;a<l.length;a+=2){var c=l[a],f=l[a+1];c==="style"?QR(i,f):c==="dangerouslySetInnerHTML"?XR(i,f):c==="children"?sf(i,f):Gw(i,c,f,u)}switch(s){case"input":Sx(i,o);break;case"textarea":qR(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?pl(i,!!o.multiple,h,!1):p!==!!o.multiple&&(o.defaultValue!=null?pl(i,!!o.multiple,o.defaultValue,!0):pl(i,!!o.multiple,o.multiple?[]:"",!1))}i[gf]=o}catch(y){Tt(e,e.return,y)}}break;case 6:if(Dr(t,e),ri(e),r&4){if(e.stateNode===null)throw Error(re(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(y){Tt(e,e.return,y)}}break;case 3:if(Dr(t,e),ri(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ff(t.containerInfo)}catch(y){Tt(e,e.return,y)}break;case 4:Dr(t,e),ri(e);break;case 13:Dr(t,e),ri(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(AS=Nt())),r&4&&lj(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Pn=(u=Pn)||c,Dr(t,e),Pn=u):Dr(t,e),ri(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(he=e,c=e.child;c!==null;){for(f=he=c;he!==null;){switch(p=he,h=p.child,p.tag){case 0:case 11:case 14:case 15:Wc(4,p,p.return);break;case 1:al(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(y){Tt(r,n,y)}}break;case 5:al(p,p.return);break;case 22:if(p.memoizedState!==null){cj(f);continue}}h!==null?(h.return=p,he=h):cj(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=f.stateNode,l=f.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=YR("display",a))}catch(y){Tt(e,e.return,y)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){Tt(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Dr(t,e),ri(e),r&4&&lj(e);break;case 21:break;default:Dr(t,e),ri(e)}}function ri(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(SN(n)){var r=n;break e}n=n.return}throw Error(re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(sf(i,""),r.flags&=-33);var o=sj(e);rb(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=sj(e);nb(e,s,a);break;default:throw Error(re(161))}}catch(l){Tt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function L4(e,t,n){he=e,jN(e)}function jN(e,t,n){for(var r=(e.mode&1)!==0;he!==null;){var i=he,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ap;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||Pn;s=ap;var u=Pn;if(ap=a,(Pn=l)&&!u)for(he=i;he!==null;)a=he,l=a.child,a.tag===22&&a.memoizedState!==null?fj(i):l!==null?(l.return=a,he=l):fj(i);for(;o!==null;)he=o,jN(o),o=o.sibling;he=i,ap=s,Pn=u}uj(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,he=o):uj(e)}}function uj(e){for(;he!==null;){var t=he;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Pn||pg(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Pn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Fr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&qP(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qP(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&ff(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}Pn||t.flags&512&&tb(t)}catch(p){Tt(t,t.return,p)}}if(t===e){he=null;break}if(n=t.sibling,n!==null){n.return=t.return,he=n;break}he=t.return}}function cj(e){for(;he!==null;){var t=he;if(t===e){he=null;break}var n=t.sibling;if(n!==null){n.return=t.return,he=n;break}he=t.return}}function fj(e){for(;he!==null;){var t=he;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pg(4,t)}catch(l){Tt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Tt(t,i,l)}}var o=t.return;try{tb(t)}catch(l){Tt(t,o,l)}break;case 5:var a=t.return;try{tb(t)}catch(l){Tt(t,a,l)}}}catch(l){Tt(t,t.return,l)}if(t===e){he=null;break}var s=t.sibling;if(s!==null){s.return=t.return,he=s;break}he=t.return}}var F4=Math.ceil,Th=fo.ReactCurrentDispatcher,jS=fo.ReactCurrentOwner,Ar=fo.ReactCurrentBatchConfig,Ve=0,Zt=null,It=null,un=0,rr=0,sl=xa(0),Vt=0,Sf=null,gs=0,hg=0,ES=0,Kc=null,Kn=null,AS=0,Wl=1/0,Ni=null,_h=!1,ib=null,ta=null,sp=!1,Wo=null,Rh=0,qc=0,ob=null,Yp=-1,Qp=0;function Ln(){return Ve&6?Nt():Yp!==-1?Yp:Yp=Nt()}function na(e){return e.mode&1?Ve&2&&un!==0?un&-un:S4.transition!==null?(Qp===0&&(Qp=uk()),Qp):(e=Ye,e!==0||(e=window.event,e=e===void 0?16:gk(e.type)),e):1}function qr(e,t,n,r){if(50<qc)throw qc=0,ob=null,Error(re(185));vd(e,n,r),(!(Ve&2)||e!==Zt)&&(e===Zt&&(!(Ve&2)&&(hg|=n),Vt===4&&$o(e,un)),Qn(e,r),n===1&&Ve===0&&!(t.mode&1)&&(Wl=Nt()+500,cg&&ba()))}function Qn(e,t){var n=e.callbackNode;S3(e,t);var r=hh(e,e===Zt?un:0);if(r===0)n!==null&&bP(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&bP(n),t===1)e.tag===0?w4(dj.bind(null,e)):Mk(dj.bind(null,e)),y4(function(){!(Ve&6)&&ba()}),n=null;else{switch(ck(r)){case 1:n=Zw;break;case 4:n=sk;break;case 16:n=ph;break;case 536870912:n=lk;break;default:n=ph}n=NN(n,EN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function EN(e,t){if(Yp=-1,Qp=0,Ve&6)throw Error(re(327));var n=e.callbackNode;if(vl()&&e.callbackNode!==n)return null;var r=hh(e,e===Zt?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=kh(e,r);else{t=r;var i=Ve;Ve|=2;var o=CN();(Zt!==e||un!==t)&&(Ni=null,Wl=Nt()+500,as(e,t));do try{z4();break}catch(s){AN(e,s)}while(!0);dS(),Th.current=o,Ve=i,It!==null?t=0:(Zt=null,un=0,t=Vt)}if(t!==0){if(t===2&&(i=kx(e),i!==0&&(r=i,t=ab(e,i))),t===1)throw n=Sf,as(e,0),$o(e,r),Qn(e,Nt()),n;if(t===6)$o(e,r);else{if(i=e.current.alternate,!(r&30)&&!B4(i)&&(t=kh(e,r),t===2&&(o=kx(e),o!==0&&(r=o,t=ab(e,o))),t===1))throw n=Sf,as(e,0),$o(e,r),Qn(e,Nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(re(345));case 2:Ia(e,Kn,Ni);break;case 3:if($o(e,r),(r&130023424)===r&&(t=AS+500-Nt(),10<t)){if(hh(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ln(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Bx(Ia.bind(null,e,Kn,Ni),t);break}Ia(e,Kn,Ni);break;case 4:if($o(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-Kr(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*F4(r/1960))-r,10<r){e.timeoutHandle=Bx(Ia.bind(null,e,Kn,Ni),r);break}Ia(e,Kn,Ni);break;case 5:Ia(e,Kn,Ni);break;default:throw Error(re(329))}}}return Qn(e,Nt()),e.callbackNode===n?EN.bind(null,e):null}function ab(e,t){var n=Kc;return e.current.memoizedState.isDehydrated&&(as(e,t).flags|=256),e=kh(e,t),e!==2&&(t=Kn,Kn=n,t!==null&&sb(t)),e}function sb(e){Kn===null?Kn=e:Kn.push.apply(Kn,e)}function B4(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Yr(o(),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 $o(e,t){for(t&=~ES,t&=~hg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Kr(t),r=1<<n;e[n]=-1,t&=~r}}function dj(e){if(Ve&6)throw Error(re(327));vl();var t=hh(e,0);if(!(t&1))return Qn(e,Nt()),null;var n=kh(e,t);if(e.tag!==0&&n===2){var r=kx(e);r!==0&&(t=r,n=ab(e,r))}if(n===1)throw n=Sf,as(e,0),$o(e,t),Qn(e,Nt()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ia(e,Kn,Ni),Qn(e,Nt()),null}function CS(e,t){var n=Ve;Ve|=1;try{return e(t)}finally{Ve=n,Ve===0&&(Wl=Nt()+500,cg&&ba())}}function ys(e){Wo!==null&&Wo.tag===0&&!(Ve&6)&&vl();var t=Ve;Ve|=1;var n=Ar.transition,r=Ye;try{if(Ar.transition=null,Ye=1,e)return e()}finally{Ye=r,Ar.transition=n,Ve=t,!(Ve&6)&&ba()}}function TS(){rr=sl.current,mt(sl)}function as(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,g4(n)),It!==null)for(n=It.return;n!==null;){var r=n;switch(uS(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&xh();break;case 3:Hl(),mt(Xn),mt(An),vS();break;case 5:yS(r);break;case 4:Hl();break;case 13:mt(St);break;case 19:mt(St);break;case 10:pS(r.type._context);break;case 22:case 23:TS()}n=n.return}if(Zt=e,It=e=ra(e.current,null),un=rr=t,Vt=0,Sf=null,ES=hg=gs=0,Kn=Kc=null,za!==null){for(t=0;t<za.length;t++)if(n=za[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}za=null}return e}function AN(e,t){do{var n=It;try{if(dS(),qp.current=Ch,Ah){for(var r=jt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ah=!1}if(ms=0,Yt=zt=jt=null,Vc=!1,xf=0,jS.current=null,n===null||n.return===null){Vt=1,Sf=t,It=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=un,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=ZP(a);if(h!==null){h.flags&=-257,ej(h,a,s,o,t),h.mode&1&&JP(o,u,t),t=h,l=u;var v=t.updateQueue;if(v===null){var y=new Set;y.add(l),t.updateQueue=y}else v.add(l);break e}else{if(!(t&1)){JP(o,u,t),_S();break e}l=Error(re(426))}}else if(vt&&s.mode&1){var x=ZP(a);if(x!==null){!(x.flags&65536)&&(x.flags|=256),ej(x,a,s,o,t),cS(Vl(l,s));break e}}o=l=Vl(l,s),Vt!==4&&(Vt=2),Kc===null?Kc=[o]:Kc.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=cN(o,l,t);KP(o,g);break e;case 1:s=l;var m=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ta===null||!ta.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=fN(o,s,t);KP(o,S);break e}}o=o.return}while(o!==null)}_N(n)}catch(w){t=w,It===n&&n!==null&&(It=n=n.return);continue}break}while(!0)}function CN(){var e=Th.current;return Th.current=Ch,e===null?Ch:e}function _S(){(Vt===0||Vt===3||Vt===2)&&(Vt=4),Zt===null||!(gs&268435455)&&!(hg&268435455)||$o(Zt,un)}function kh(e,t){var n=Ve;Ve|=2;var r=CN();(Zt!==e||un!==t)&&(Ni=null,as(e,t));do try{U4();break}catch(i){AN(e,i)}while(!0);if(dS(),Ve=n,Th.current=r,It!==null)throw Error(re(261));return Zt=null,un=0,Vt}function U4(){for(;It!==null;)TN(It)}function z4(){for(;It!==null&&!p3();)TN(It)}function TN(e){var t=kN(e.alternate,e,rr);e.memoizedProps=e.pendingProps,t===null?_N(e):It=t,jS.current=null}function _N(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=M4(n,t),n!==null){n.flags&=32767,It=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Vt=6,It=null;return}}else if(n=$4(n,t,rr),n!==null){It=n;return}if(t=t.sibling,t!==null){It=t;return}It=t=e}while(t!==null);Vt===0&&(Vt=5)}function Ia(e,t,n){var r=Ye,i=Ar.transition;try{Ar.transition=null,Ye=1,H4(e,t,n,r)}finally{Ar.transition=i,Ye=r}return null}function H4(e,t,n,r){do vl();while(Wo!==null);if(Ve&6)throw Error(re(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(re(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(O3(e,o),e===Zt&&(It=Zt=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sp||(sp=!0,NN(ph,function(){return vl(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Ar.transition,Ar.transition=null;var a=Ye;Ye=1;var s=Ve;Ve|=4,jS.current=null,D4(e,n),PN(n,e),u4(Lx),mh=!!Dx,Lx=Dx=null,e.current=n,L4(n),h3(),Ve=s,Ye=a,Ar.transition=o}else e.current=n;if(sp&&(sp=!1,Wo=e,Rh=i),o=e.pendingLanes,o===0&&(ta=null),y3(n.stateNode),Qn(e,Nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(_h)throw _h=!1,e=ib,ib=null,e;return Rh&1&&e.tag!==0&&vl(),o=e.pendingLanes,o&1?e===ob?qc++:(qc=0,ob=e):qc=0,ba(),null}function vl(){if(Wo!==null){var e=ck(Rh),t=Ar.transition,n=Ye;try{if(Ar.transition=null,Ye=16>e?16:e,Wo===null)var r=!1;else{if(e=Wo,Wo=null,Rh=0,Ve&6)throw Error(re(331));var i=Ve;for(Ve|=4,he=e.current;he!==null;){var o=he,a=o.child;if(he.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(he=u;he!==null;){var c=he;switch(c.tag){case 0:case 11:case 15:Wc(8,c,o)}var f=c.child;if(f!==null)f.return=c,he=f;else for(;he!==null;){c=he;var p=c.sibling,h=c.return;if(wN(c),c===u){he=null;break}if(p!==null){p.return=h,he=p;break}he=h}}}var v=o.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}he=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,he=a;else e:for(;he!==null;){if(o=he,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Wc(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,he=g;break e}he=o.return}}var m=e.current;for(he=m;he!==null;){a=he;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,he=b;else e:for(a=m;he!==null;){if(s=he,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:pg(9,s)}}catch(w){Tt(s,s.return,w)}if(s===a){he=null;break e}var S=s.sibling;if(S!==null){S.return=s.return,he=S;break e}he=s.return}}if(Ve=i,ba(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(og,e)}catch{}r=!0}return r}finally{Ye=n,Ar.transition=t}}return!1}function pj(e,t,n){t=Vl(n,t),t=cN(e,t,1),e=ea(e,t,1),t=Ln(),e!==null&&(vd(e,1,t),Qn(e,t))}function Tt(e,t,n){if(e.tag===3)pj(e,e,n);else for(;t!==null;){if(t.tag===3){pj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ta===null||!ta.has(r))){e=Vl(n,e),e=fN(t,e,1),t=ea(t,e,1),e=Ln(),t!==null&&(vd(t,1,e),Qn(t,e));break}}t=t.return}}function V4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ln(),e.pingedLanes|=e.suspendedLanes&n,Zt===e&&(un&n)===n&&(Vt===4||Vt===3&&(un&130023424)===un&&500>Nt()-AS?as(e,0):ES|=n),Qn(e,t)}function RN(e,t){t===0&&(e.mode&1?(t=Qd,Qd<<=1,!(Qd&130023424)&&(Qd=4194304)):t=1);var n=Ln();e=to(e,t),e!==null&&(vd(e,t,n),Qn(e,n))}function W4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),RN(e,n)}function K4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(re(314))}r!==null&&r.delete(t),RN(e,n)}var kN;kN=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,N4(e,t,n);qn=!!(e.flags&131072)}else qn=!1,vt&&t.flags&1048576&&Ik(t,Sh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xp(e,t),e=t.pendingProps;var i=Bl(t,An.current);yl(t,n),i=bS(null,t,r,e,i,n);var o=wS();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yn(r)?(o=!0,bh(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mS(t),i.updater=dg,t.stateNode=i,i._reactInternals=t,qx(t,r,e,n),t=Yx(null,t,r,!0,o,n)):(t.tag=0,vt&&o&&lS(t),Nn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xp(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=G4(r),e=Fr(r,e),i){case 0:t=Xx(null,t,r,e,n);break e;case 1:t=rj(null,t,r,e,n);break e;case 11:t=tj(null,t,r,e,n);break e;case 14:t=nj(null,t,r,Fr(r.type,e),n);break e}throw Error(re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),Xx(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),rj(e,t,r,i,n);case 3:e:{if(mN(t),e===null)throw Error(re(387));r=t.pendingProps,o=t.memoizedState,i=o.element,zk(e,t),jh(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Vl(Error(re(423)),t),t=ij(e,t,r,n,i);break e}else if(r!==i){i=Vl(Error(re(424)),t),t=ij(e,t,r,n,i);break e}else for(ar=Zo(t.stateNode.containerInfo.firstChild),sr=t,vt=!0,Vr=null,n=Bk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ul(),r===i){t=no(e,t,n);break e}Nn(e,t,r,n)}t=t.child}return t;case 5:return Hk(t),e===null&&Vx(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Fx(r,i)?a=null:o!==null&&Fx(r,o)&&(t.flags|=32),hN(e,t),Nn(e,t,a,n),t.child;case 6:return e===null&&Vx(t),null;case 13:return gN(e,t,n);case 4:return gS(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zl(t,null,r,n):Nn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),tj(e,t,r,i,n);case 7:return Nn(e,t,t.pendingProps,n),t.child;case 8:return Nn(e,t,t.pendingProps.children,n),t.child;case 12:return Nn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,ut(Oh,r._currentValue),r._currentValue=a,o!==null)if(Yr(o.value,a)){if(o.children===i.children&&!Xn.current){t=no(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=qi(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Wx(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(re(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Wx(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Nn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,yl(t,n),i=Tr(i),r=r(i),t.flags|=1,Nn(e,t,r,n),t.child;case 14:return r=t.type,i=Fr(r,t.pendingProps),i=Fr(r.type,i),nj(e,t,r,i,n);case 15:return dN(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fr(r,i),Xp(e,t),t.tag=1,Yn(r)?(e=!0,bh(t)):e=!1,yl(t,n),uN(t,r,i),qx(t,r,i,n),Yx(null,t,r,!0,e,n);case 19:return yN(e,t,n);case 22:return pN(e,t,n)}throw Error(re(156,t.tag))};function NN(e,t){return ak(e,t)}function q4(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.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 Pr(e,t,n,r){return new q4(e,t,n,r)}function RS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function G4(e){if(typeof e=="function")return RS(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yw)return 11;if(e===Qw)return 14}return 2}function ra(e,t){var n=e.alternate;return n===null?(n=Pr(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&14680064,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}function Jp(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")RS(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Qs:return ss(n.children,i,o,t);case Xw:a=8,i|=8;break;case yx:return e=Pr(12,n,t,i|2),e.elementType=yx,e.lanes=o,e;case vx:return e=Pr(13,n,t,i),e.elementType=vx,e.lanes=o,e;case xx:return e=Pr(19,n,t,i),e.elementType=xx,e.lanes=o,e;case HR:return mg(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case UR:a=10;break e;case zR:a=9;break e;case Yw:a=11;break e;case Qw:a=14;break e;case _o:a=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=Pr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ss(e,t,n,r){return e=Pr(7,e,r,t),e.lanes=n,e}function mg(e,t,n,r){return e=Pr(22,e,r,t),e.elementType=HR,e.lanes=n,e.stateNode={isHidden:!1},e}function mv(e,t,n){return e=Pr(6,e,null,t),e.lanes=n,e}function gv(e,t,n){return t=Pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function X4(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yy(0),this.expirationTimes=Yy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yy(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function kS(e,t,n,r,i,o,a,s,l){return e=new X4(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},mS(o),e}function Y4(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ys,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $N(e){if(!e)return ca;e=e._reactInternals;e:{if(Ns(e)!==e||e.tag!==1)throw Error(re(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(re(171))}if(e.tag===1){var n=e.type;if(Yn(n))return $k(e,n,t)}return t}function MN(e,t,n,r,i,o,a,s,l){return e=kS(n,r,!0,e,i,o,a,s,l),e.context=$N(null),n=e.current,r=Ln(),i=na(n),o=qi(r,i),o.callback=t??null,ea(n,o,i),e.current.lanes=i,vd(e,i,r),Qn(e,r),e}function gg(e,t,n,r){var i=t.current,o=Ln(),a=na(i);return n=$N(n),t.context===null?t.context=n:t.pendingContext=n,t=qi(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ea(i,t,a),e!==null&&(qr(e,i,a,o),Kp(e,i,a)),a}function Nh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function hj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function NS(e,t){hj(e,t),(e=e.alternate)&&hj(e,t)}function Q4(){return null}var IN=typeof reportError=="function"?reportError:function(e){console.error(e)};function $S(e){this._internalRoot=e}yg.prototype.render=$S.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));gg(e,t,null,null)};yg.prototype.unmount=$S.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ys(function(){gg(null,e,null,null)}),t[eo]=null}};function yg(e){this._internalRoot=e}yg.prototype.unstable_scheduleHydration=function(e){if(e){var t=pk();e={blockedOn:null,target:e,priority:t};for(var n=0;n<No.length&&t!==0&&t<No[n].priority;n++);No.splice(n,0,e),n===0&&mk(e)}};function MS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function mj(){}function J4(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=Nh(a);o.call(u)}}var a=MN(t,r,e,0,null,!1,!1,"",mj);return e._reactRootContainer=a,e[eo]=a.current,hf(e.nodeType===8?e.parentNode:e),ys(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=Nh(l);s.call(u)}}var l=kS(e,0,!1,null,null,!1,!1,"",mj);return e._reactRootContainer=l,e[eo]=l.current,hf(e.nodeType===8?e.parentNode:e),ys(function(){gg(t,l,n,r)}),l}function xg(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=Nh(a);s.call(l)}}gg(t,a,e,i)}else a=J4(n,t,e,i,r);return Nh(a)}fk=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_c(t.pendingLanes);n!==0&&(eS(t,n|1),Qn(t,Nt()),!(Ve&6)&&(Wl=Nt()+500,ba()))}break;case 13:ys(function(){var r=to(e,1);if(r!==null){var i=Ln();qr(r,e,1,i)}}),NS(e,1)}};tS=function(e){if(e.tag===13){var t=to(e,134217728);if(t!==null){var n=Ln();qr(t,e,134217728,n)}NS(e,134217728)}};dk=function(e){if(e.tag===13){var t=na(e),n=to(e,t);if(n!==null){var r=Ln();qr(n,e,t,r)}NS(e,t)}};pk=function(){return Ye};hk=function(e,t){var n=Ye;try{return Ye=e,t()}finally{Ye=n}};Tx=function(e,t,n){switch(t){case"input":if(Sx(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ug(r);if(!i)throw Error(re(90));WR(r),Sx(r,i)}}}break;case"textarea":qR(e,n);break;case"select":t=n.value,t!=null&&pl(e,!!n.multiple,t,!1)}};ek=CS;tk=ys;var Z4={usingClientEntryPoint:!1,Events:[bd,tl,ug,JR,ZR,CS]},fc={findFiberByHostInstance:Ua,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},eU={bundleType:fc.bundleType,version:fc.version,rendererPackageName:fc.rendererPackageName,rendererConfig:fc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ik(e),e===null?null:e.stateNode},findFiberByHostInstance:fc.findFiberByHostInstance||Q4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lp.isDisabled&&lp.supportsFiber)try{og=lp.inject(eU),gi=lp}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z4;pr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!MS(t))throw Error(re(200));return Y4(e,t,null,n)};pr.createRoot=function(e,t){if(!MS(e))throw Error(re(299));var n=!1,r="",i=IN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=kS(e,1,!1,null,null,n,!1,r,i),e[eo]=t.current,hf(e.nodeType===8?e.parentNode:e),new $S(t)};pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=ik(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return ys(e)};pr.hydrate=function(e,t,n){if(!vg(t))throw Error(re(200));return xg(null,e,t,!0,n)};pr.hydrateRoot=function(e,t,n){if(!MS(e))throw Error(re(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=IN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=MN(t,null,e,1,n??null,i,!1,o,a),e[eo]=t.current,hf(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new yg(t)};pr.render=function(e,t,n){if(!vg(t))throw Error(re(200));return xg(null,e,t,!1,n)};pr.unmountComponentAtNode=function(e){if(!vg(e))throw Error(re(40));return e._reactRootContainer?(ys(function(){xg(null,null,e,!1,function(){e._reactRootContainer=null,e[eo]=null})}),!0):!1};pr.unstable_batchedUpdates=CS;pr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vg(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return xg(e,t,n,!1,r)};pr.version="18.3.1-next-f1338f8080-20240426";function DN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DN)}catch(e){console.error(e)}}DN(),DR.exports=pr;var po=DR.exports,LN,gj=po;LN=gj.createRoot,gj.hydrateRoot;const FN=O.createContext(void 0),ho=e=>{const t=O.useContext(FN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tU=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(FN.Provider,{value:e,children:t})),nU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Io,Uw,pR,rU=(pR=class{constructor(){ye(this,Io,nU);ye(this,Uw,!1)}setTimeoutProvider(e){ue(this,Io,e)}setTimeout(e,t){return F(this,Io).setTimeout(e,t)}clearTimeout(e){F(this,Io).clearTimeout(e)}setInterval(e,t){return F(this,Io).setInterval(e,t)}clearInterval(e){F(this,Io).clearInterval(e)}},Io=new WeakMap,Uw=new WeakMap,pR);const Va=new rU;function iU(e){setTimeout(e,0)}const oU=typeof window>"u"||"Deno"in globalThis;function $n(){}function aU(e,t){return typeof e=="function"?e(t):e}function BN(e){return typeof e=="number"&&e>=0&&e!==1/0}function UN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yt(e,t){return typeof e=="function"?e(t):e}function yj(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==IS(a,t.options))return!1}else if(!Kl(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function vj(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(vs(t.options.mutationKey)!==vs(o))return!1}else if(!Kl(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function IS(e,t){return((t==null?void 0:t.queryKeyHashFn)||vs)(e)}function vs(e){return JSON.stringify(e,(t,n)=>lb(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Kl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!Kl(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!Kl(e[r],t[r]))return!1;return!0}return!1}const sU=Object.prototype.hasOwnProperty;function zN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=xj(e)&&xj(t);if(!r&&!(lb(e)&&lb(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,s=r?new Array(a):{};let l=0;for(let u=0;u<a;u++){const c=r?u:o[u],f=e[c],p=t[c];if(f===p){s[c]=f,(r?u<i:sU.call(e,c))&&l++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){s[c]=p;continue}const h=zN(f,p,n+1);s[c]=h,h===f&&l++}return i===a&&l===i?e:s}function Zp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function xj(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lb(e){if(!bj(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!bj(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function bj(e){return Object.prototype.toString.call(e)==="[object Object]"}function lU(e){return new Promise(t=>{Va.setTimeout(t,e)})}function ub(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zN(e,t):t}function uU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cU(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const DS=Symbol();function HN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===DS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function LS(e,t){return typeof e=="function"?e(...t):!!e}function fU(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}let dU=()=>oU;const FS=()=>dU();var _u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Qa,Do,El,hR,pU=(hR=class extends _u{constructor(){super();ye(this,Qa);ye(this,Do);ye(this,El);ue(this,El,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Do)||this.setEventListener(F(this,El))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Do))==null||t.call(this),ue(this,Do,void 0))}setEventListener(t){var n;ue(this,El,t),(n=F(this,Do))==null||n.call(this),ue(this,Do,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,Qa)!==t&&(ue(this,Qa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,Qa)=="boolean"?F(this,Qa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Qa=new WeakMap,Do=new WeakMap,El=new WeakMap,hR);const BS=new pU,hU=iU;function mU(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=hU;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}const Ht=mU();var Al,Lo,Cl,mR,gU=(mR=class extends _u{constructor(){super();ye(this,Al,!0);ye(this,Lo);ye(this,Cl);ue(this,Cl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,Lo)||this.setEventListener(F(this,Cl))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Lo))==null||t.call(this),ue(this,Lo,void 0))}setEventListener(t){var n;ue(this,Cl,t),(n=F(this,Lo))==null||n.call(this),ue(this,Lo,t(this.setOnline.bind(this)))}setOnline(t){F(this,Al)!==t&&(ue(this,Al,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,Al)}},Al=new WeakMap,Lo=new WeakMap,Cl=new WeakMap,mR);const $h=new gU;function yU(e){return Math.min(1e3*2**e,3e4)}function VN(e){return(e??"online")==="online"?$h.isOnline():!0}var cb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function WN(e){let t=!1,n=0,r,i="pending",o,a;const s=new Promise((m,b)=>{o=m,a=b});s.catch($n);const l=()=>i!=="pending",u=m=>{var b;if(!l()){const S=new cb(m);y(S),(b=e.onCancel)==null||b.call(e,S)}},c=()=>{t=!0},f=()=>{t=!1},p=()=>BS.isFocused()&&(e.networkMode==="always"||$h.isOnline())&&e.canRun(),h=()=>VN(e.networkMode)&&e.canRun(),v=m=>{l()||(r==null||r(),i="resolved",o(m))},y=m=>{l()||(r==null||r(),i="rejected",a(m))},x=()=>new Promise(m=>{var b;r=S=>{(l()||p())&&m(S)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;r=void 0,l()||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(l())return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(S){m=Promise.reject(S)}Promise.resolve(m).then(v).catch(S=>{var A;if(l())return;const w=e.retry??(FS()?0:3),P=e.retryDelay??yU,j=typeof P=="function"?P(n,S):P,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,S);if(t||!E){y(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),lU(j).then(()=>p()?void 0:x()).then(()=>{t?y(S):g()})})};return{promise:s,status:()=>i,cancel:u,continue:()=>(r==null||r(),s),cancelRetry:c,continueRetry:f,canStart:h,start:()=>(h()?g():x().then(g),s)}}var Ja,gR,KN=(gR=class{constructor(){ye(this,Ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),BN(this.gcTime)&&ue(this,Ja,Va.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(FS()?1/0:3e5))}clearGcTimeout(){F(this,Ja)!==void 0&&(Va.clearTimeout(F(this,Ja)),ue(this,Ja,void 0))}},Ja=new WeakMap,gR);function vU(e){return{onFetch:(t,n)=>{var c,f,p,h,v;const r=t.options,i=(p=(f=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=b=>{fU(b,()=>t.signal,()=>y=!0)},g=HN(t.options,t.fetchOptions),m=async(b,S,w)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&b.pages.length)return Promise.resolve(b);const j=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return x(T),T})(),E=await g(j),{maxPages:A}=t.options,C=w?cU:uU;return{pages:C(b.pages,E,A),pageParams:C(b.pageParams,S,A)}};if(i&&o.length){const b=i==="backward",S=b?qN:fb,w={pages:o,pageParams:a};s=await m(w,S(r,w),b)}else{const b=e??o.length;do{const S=l===0?a[0]??r.initialPageParam:fb(r,s);if(l>0&&S==null)break;s=await m(s,S),l++}while(l<b)}return s};t.options.persister?t.fetchFn=()=>{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function fb(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qN(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function xU(e,t){return t?fb(e,t)!=null:!1}function bU(e,t){return!t||!e.getPreviousPageParam?!1:qN(e,t)!=null}var Tl,Za,_l,br,es,Ut,dd,ts,Br,Ri,yR,wU=(yR=class extends KN{constructor(t){super();ye(this,Br);ye(this,Tl);ye(this,Za);ye(this,_l);ye(this,br);ye(this,es);ye(this,Ut);ye(this,dd);ye(this,ts);ue(this,ts,!1),ue(this,dd,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,es,t.client),ue(this,br,F(this,es).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,Za,Sj(this.options)),this.state=t.state??F(this,Za),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Tl)}get promise(){var t;return(t=F(this,Ut))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,dd),...t},t!=null&&t._type&&ue(this,Tl,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Sj(this.options);n.data!==void 0&&(this.setState(wj(n.data,n.dataUpdatedAt)),ue(this,Za,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,br).remove(this)}setData(t,n){const r=ub(this.state.data,t,this.options);return Re(this,Br,Ri).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Re(this,Br,Ri).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=F(this,Ut))==null?void 0:r.promise;return(i=F(this,Ut))==null||i.cancel(t),n?n.then($n).catch($n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Za)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>yt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===DS||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!UN(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=F(this,Ut))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=F(this,Ut))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(F(this,Ut)&&(F(this,ts)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?F(this,Ut).cancel({revert:!0}):F(this,Ut).cancelRetry()),this.scheduleGc()),F(this,br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Re(this,Br,Ri).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,f,p,h,v,y,x,g,m,b,S;if(this.state.fetchStatus!=="idle"&&((u=F(this,Ut))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,Ut))return F(this,Ut).continueRetry(),F(this,Ut).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(P=>P.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,i=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(ue(this,ts,!0),r.signal)})},o=()=>{const w=HN(this.options,n),j=(()=>{const E={client:F(this,es),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return ue(this,ts,!1),this.options.persister?this.options.persister(w,j,this):w(j)},s=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,es),state:this.state,fetchFn:o};return i(w),w})();(c=F(this,Tl)==="infinite"?vU(this.options.pages):this.options.behavior)==null||c.onFetch(s,this),ue(this,_l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&Re(this,Br,Ri).call(this,{type:"fetch",meta:(p=s.fetchOptions)==null?void 0:p.meta});const l=ue(this,Ut,WN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,onCancel:w=>{w instanceof cb&&w.revert&&this.setState({...F(this,_l),fetchStatus:"idle"}),r.abort()},onFail:(w,P)=>{Re(this,Br,Ri).call(this,{type:"failed",failureCount:w,error:P})},onPause:()=>{Re(this,Br,Ri).call(this,{type:"pause"})},onContinue:()=>{Re(this,Br,Ri).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const w=await l.start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(v=(h=F(this,br).config).onSuccess)==null||v.call(h,w,this),(x=(y=F(this,br).config).onSettled)==null||x.call(y,w,this.state.error,this),w}catch(w){if(w instanceof cb){if(w.silent)return F(this,Ut).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Re(this,Br,Ri).call(this,{type:"error",error:w}),(m=(g=F(this,br).config).onError)==null||m.call(g,w,this),(S=(b=F(this,br).config).onSettled)==null||S.call(b,this.state.data,w,this),w}finally{F(this,Ut)===l&&ue(this,Ut,void 0),this.scheduleGc()}}},Tl=new WeakMap,Za=new WeakMap,_l=new WeakMap,br=new WeakMap,es=new WeakMap,Ut=new WeakMap,dd=new WeakMap,ts=new WeakMap,Br=new WeakSet,Ri=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...GN(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...wj(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,_l,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ht.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),F(this,br).notify({query:this,type:"updated",action:t})})},yR);function GN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wj(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Sj(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rn,Be,pd,kn,ns,Rl,Di,hd,kl,Nl,rs,is,Fo,$l,Ke,kc,db,pb,hb,mb,gb,yb,vb,xb,vR,XN=(vR=class extends _u{constructor(t,n){super();ye(this,Ke);ye(this,Rn);ye(this,Be);ye(this,pd);ye(this,kn);ye(this,ns);ye(this,Rl);ye(this,Di);ye(this,hd);ye(this,kl);ye(this,Nl);ye(this,rs);ye(this,is);ye(this,Fo);ye(this,$l,new Set);this.options=n,ue(this,Rn,t),ue(this,Di,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Be).addObserver(this),Oj(F(this,Be),this.options)?Re(this,Ke,kc).call(this):this.updateResult(),Re(this,Ke,gb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bb(F(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bb(F(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,Ke,yb).call(this),Re(this,Ke,vb).call(this),F(this,Be).removeObserver(this)}setOptions(t){const n=this.options,r=F(this,Be);if(this.options=F(this,Rn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yt(this.options.enabled,F(this,Be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Re(this,Ke,xb).call(this),F(this,Be).setOptions(this.options),n._defaulted&&!Zp(this.options,n)&&F(this,Rn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Be),observer:this});const i=this.hasListeners();i&&Pj(F(this,Be),r,this.options,n)&&Re(this,Ke,kc).call(this),this.updateResult(),i&&(F(this,Be)!==r||yt(this.options.enabled,F(this,Be))!==yt(n.enabled,F(this,Be))||yt(this.options.staleTime,F(this,Be))!==yt(n.staleTime,F(this,Be)))&&Re(this,Ke,pb).call(this);const o=Re(this,Ke,hb).call(this);i&&(F(this,Be)!==r||yt(this.options.enabled,F(this,Be))!==yt(n.enabled,F(this,Be))||o!==F(this,Fo))&&Re(this,Ke,mb).call(this,o)}getOptimisticResult(t){const n=F(this,Rn).getQueryCache().build(F(this,Rn),t),r=this.createResult(n,t);return Zp(this.getCurrentResult(),r)||(ue(this,kn,r),ue(this,Rl,this.options),ue(this,ns,F(this,Be).state)),r}getCurrentResult(){return F(this,kn)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){F(this,$l).add(t)}getCurrentQuery(){return F(this,Be)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,Rn).defaultQueryOptions(t),r=F(this,Rn).getQueryCache().build(F(this,Rn),n);let i=()=>{},o;const a=new Promise(s=>{o=s,i=F(this,Rn).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(i(),s(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const s=this.createResult(r,n);return o==null||o(s),s}).finally(()=>{i()}),a])}fetch(t){return Re(this,Ke,kc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,kn)))}createResult(t,n){var P;const r=F(this,Be),i=this.options,o=F(this,kn),a=F(this,ns),s=F(this,Rl),l=t!==r?t.state:F(this,pd),{state:u}=t;let c={...u},f=!1,p;if(n._optimisticResults){const j=this.hasListeners(),E=!j&&Oj(t,n),A=j&&Pj(t,r,n,i);(E||A)&&(c={...c,...GN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:h,errorUpdatedAt:v,status:y}=c;p=c.data;let x=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let j;o!=null&&o.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(j=o.data,x=!0):j=typeof n.placeholderData=="function"?n.placeholderData((P=F(this,Nl))==null?void 0:P.state.data,F(this,Nl)):n.placeholderData,j!==void 0&&(y="success",p=ub(o==null?void 0:o.data,j,n),f=!0)}if(n.select&&p!==void 0&&!x)if(o&&p===(a==null?void 0:a.data)&&n.select===F(this,hd))p=F(this,kl);else try{ue(this,hd,n.select),p=n.select(p),p=ub(o==null?void 0:o.data,p,n),ue(this,kl,p),ue(this,Di,null)}catch(j){ue(this,Di,j)}else p===void 0&&ue(this,Di,null);F(this,Di)&&(h=F(this,Di),p=F(this,kl),v=Date.now(),y="error",f=!1);const g=c.fetchStatus==="fetching",m=y==="pending",b=y==="error",S=m&&g,w=p!==void 0;return{status:y,fetchStatus:c.fetchStatus,isPending:m,isSuccess:y==="success",isError:b,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!m,isLoadingError:b&&!w,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&w,isStale:US(t,n),refetch:this.refetch,isEnabled:yt(n.enabled,t)!==!1}}updateResult(){const t=F(this,kn),n=this.createResult(F(this,Be),this.options);if(ue(this,ns,F(this,Be).state),ue(this,Rl,this.options),F(this,ns).data!==void 0&&ue(this,Nl,F(this,Be)),Zp(n,t))return;ue(this,kn,n);const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!F(this,$l).size)return!0;const s=new Set(a??F(this,$l));return this.options.throwOnError&&s.add("error"),Object.keys(F(this,kn)).some(l=>{const u=l;return F(this,kn)[u]!==t[u]&&s.has(u)})})();Ht.batch(()=>{i&&this.listeners.forEach(o=>{o(F(this,kn))}),F(this,Rn).getQueryCache().notify({query:F(this,Be),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,Ke,gb).call(this)}},Rn=new WeakMap,Be=new WeakMap,pd=new WeakMap,kn=new WeakMap,ns=new WeakMap,Rl=new WeakMap,Di=new WeakMap,hd=new WeakMap,kl=new WeakMap,Nl=new WeakMap,rs=new WeakMap,is=new WeakMap,Fo=new WeakMap,$l=new WeakMap,Ke=new WeakSet,kc=function(t){Re(this,Ke,xb).call(this);let n=F(this,Be).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($n)),n},db=function(t){return!FS()&&yt(this.options.enabled,F(this,Be))!==!1&&BN(t)},pb=function(){Re(this,Ke,yb).call(this);const t=yt(this.options.staleTime,F(this,Be));if(F(this,kn).isStale||!Re(this,Ke,db).call(this,t))return;const n=UN(F(this,kn).dataUpdatedAt,t)+1;ue(this,rs,Va.setTimeout(()=>{F(this,kn).isStale||this.updateResult()},n))},hb=function(){return yt(this.options.refetchInterval,F(this,Be))??!1},mb=function(t){Re(this,Ke,vb).call(this),ue(this,Fo,t),!(F(this,Fo)===0||!Re(this,Ke,db).call(this,F(this,Fo)))&&ue(this,is,Va.setInterval(()=>{(this.options.refetchIntervalInBackground||BS.isFocused())&&Re(this,Ke,kc).call(this)},F(this,Fo)))},gb=function(){Re(this,Ke,pb).call(this),Re(this,Ke,mb).call(this,Re(this,Ke,hb).call(this))},yb=function(){F(this,rs)!==void 0&&(Va.clearTimeout(F(this,rs)),ue(this,rs,void 0))},vb=function(){F(this,is)!==void 0&&(Va.clearInterval(F(this,is)),ue(this,is,void 0))},xb=function(){const t=F(this,Rn).getQueryCache().build(F(this,Rn),this.options);if(t===F(this,Be))return;const n=F(this,Be);ue(this,Be,t),ue(this,pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vR);function SU(e,t){return yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&yt(t.retryOnMount,e)===!1)}function Oj(e,t){return SU(e,t)||e.state.data!==void 0&&bb(e,t,t.refetchOnMount)}function bb(e,t,n){if(yt(t.enabled,e)!==!1&&yt(t.staleTime,e)!=="static"){const r=yt(n,e);return r==="always"||r!==!1&&US(e,t)}return!1}function Pj(e,t,n,r){return(e!==t||yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&US(e,n)}function US(e,t){return yt(t.enabled,e)!==!1&&e.isStaleByTime(yt(t.staleTime,e))}var OU=class extends XN{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var h,v;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:a,isRefetchError:s}=r,l=(v=(h=n.fetchMeta)==null?void 0:h.fetchMore)==null?void 0:v.direction,u=a&&l==="forward",c=i&&l==="forward",f=a&&l==="backward",p=i&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:xU(t,n.data),hasPreviousPage:bU(t,n.data),isFetchNextPageError:u,isFetchingNextPage:c,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:s&&!u&&!f,isRefetching:o&&!c&&!p}}},md,li,wn,os,ui,Co,xR,PU=(xR=class extends KN{constructor(t){super();ye(this,ui);ye(this,md);ye(this,li);ye(this,wn);ye(this,os);ue(this,md,t.client),this.mutationId=t.mutationId,ue(this,wn,t.mutationCache),ue(this,li,[]),this.state=t.state||YN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,li).includes(t)||(F(this,li).push(t),this.clearGcTimeout(),F(this,wn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,li,F(this,li).filter(n=>n!==t)),this.scheduleGc(),F(this,wn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,li).length||(this.state.status==="pending"?this.scheduleGc():F(this,wn).remove(this))}continue(){var t;return((t=F(this,os))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var s,l,u,c,f,p,h,v,y,x,g,m,b,S,w,P,j,E;const n=()=>{Re(this,ui,Co).call(this,{type:"continue"})},r={client:F(this,md),meta:this.options.meta,mutationKey:this.options.mutationKey},i=ue(this,os,WN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,C)=>{Re(this,ui,Co).call(this,{type:"failed",failureCount:A,error:C})},onPause:()=>{Re(this,ui,Co).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,wn).canRun(this)})),o=this.state.status==="pending",a=!i.canStart();try{if(o)n();else{Re(this,ui,Co).call(this,{type:"pending",variables:t,isPaused:a}),F(this,wn).config.onMutate&&await F(this,wn).config.onMutate(t,this,r);const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t,r));C!==this.state.context&&Re(this,ui,Co).call(this,{type:"pending",context:C,variables:t,isPaused:a})}const A=await i.start();return await((c=(u=F(this,wn).config).onSuccess)==null?void 0:c.call(u,A,t,this.state.context,this,r)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,A,t,this.state.context,r)),await((v=(h=F(this,wn).config).onSettled)==null?void 0:v.call(h,A,null,this.state.variables,this.state.context,this,r)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,A,null,t,this.state.context,r)),Re(this,ui,Co).call(this,{type:"success",data:A}),A}catch(A){try{await((m=(g=F(this,wn).config).onError)==null?void 0:m.call(g,A,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((S=(b=this.options).onError)==null?void 0:S.call(b,A,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((P=(w=F(this,wn).config).onSettled)==null?void 0:P.call(w,void 0,A,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((E=(j=this.options).onSettled)==null?void 0:E.call(j,void 0,A,t,this.state.context,r))}catch(C){Promise.reject(C)}throw Re(this,ui,Co).call(this,{type:"error",error:A}),A}finally{F(this,os)===i&&ue(this,os,void 0),F(this,wn).runNext(this)}}},md=new WeakMap,li=new WeakMap,wn=new WeakMap,os=new WeakMap,ui=new WeakSet,Co=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ht.batch(()=>{F(this,li).forEach(r=>{r.onMutationUpdate(t)}),F(this,wn).notify({mutation:this,type:"updated",action:t})})},xR);function YN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Li,Ur,gd,bR,jU=(bR=class extends _u{constructor(t={}){super();ye(this,Li);ye(this,Ur);ye(this,gd);this.config=t,ue(this,Li,new Set),ue(this,Ur,new Map),ue(this,gd,0)}build(t,n,r){const i=new PU({client:t,mutationCache:this,mutationId:++Vd(this,gd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){F(this,Li).add(t);const n=up(t);if(typeof n=="string"){const r=F(this,Ur).get(n);r?r.push(t):F(this,Ur).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,Li).delete(t)){const n=up(t);if(typeof n=="string"){const r=F(this,Ur).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&F(this,Ur).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=up(t);if(typeof n=="string"){const i=(r=F(this,Ur).get(n))==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r,i;const n=up(t);return typeof n=="string"?((i=(r=F(this,Ur).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:i.continue())??Promise.resolve():Promise.resolve()}clear(){Ht.batch(()=>{F(this,Li).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,Li).clear(),F(this,Ur).clear()})}getAll(){return Array.from(F(this,Li))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vj(n,r))}findAll(t={}){return this.getAll().filter(n=>vj(t,n))}notify(t){Ht.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ht.batch(()=>Promise.all(t.map(n=>n.continue().catch($n))))}},Li=new WeakMap,Ur=new WeakMap,gd=new WeakMap,bR);function up(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fi,Bo,Sn,Bi,mi,Nc,wb,wR,EU=(wR=class extends _u{constructor(n,r){super();ye(this,mi);ye(this,Fi);ye(this,Bo);ye(this,Sn);ye(this,Bi);ue(this,Fi,n),this.setOptions(r),this.bindMethods(),Re(this,mi,Nc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=F(this,Fi).defaultMutationOptions(n),Zp(this.options,r)||F(this,Fi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Sn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&vs(r.mutationKey)!==vs(this.options.mutationKey)?this.reset():((i=F(this,Sn))==null?void 0:i.state.status)==="pending"&&F(this,Sn).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&F(this,Sn)&&(F(this,Sn).addObserver(this),Re(this,mi,Nc).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,Sn))==null||n.removeObserver(this)}onMutationUpdate(n){Re(this,mi,Nc).call(this),Re(this,mi,wb).call(this,n)}getCurrentResult(){return F(this,Bo)}reset(){var n;(n=F(this,Sn))==null||n.removeObserver(this),ue(this,Sn,void 0),Re(this,mi,Nc).call(this),Re(this,mi,wb).call(this)}mutate(n,r){var i;return ue(this,Bi,r),(i=F(this,Sn))==null||i.removeObserver(this),ue(this,Sn,F(this,Fi).getMutationCache().build(F(this,Fi),this.options)),F(this,Sn).addObserver(this),F(this,Sn).execute(n)}},Fi=new WeakMap,Bo=new WeakMap,Sn=new WeakMap,Bi=new WeakMap,mi=new WeakSet,Nc=function(){var r;const n=((r=F(this,Sn))==null?void 0:r.state)??YN();ue(this,Bo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},wb=function(n){Ht.batch(()=>{var r,i,o,a,s,l,u,c;if(F(this,Bi)&&this.hasListeners()){const f=F(this,Bo).variables,p=F(this,Bo).context,h={client:F(this,Fi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=F(this,Bi)).onSuccess)==null||i.call(r,n.data,f,p,h)}catch(v){Promise.reject(v)}try{(a=(o=F(this,Bi)).onSettled)==null||a.call(o,n.data,null,f,p,h)}catch(v){Promise.reject(v)}}else if((n==null?void 0:n.type)==="error"){try{(l=(s=F(this,Bi)).onError)==null||l.call(s,n.error,f,p,h)}catch(v){Promise.reject(v)}try{(c=(u=F(this,Bi)).onSettled)==null||c.call(u,void 0,n.error,f,p,h)}catch(v){Promise.reject(v)}}}this.listeners.forEach(f=>{f(F(this,Bo))})})},wR),ci,SR,AU=(SR=class extends _u{constructor(t={}){super();ye(this,ci);this.config=t,ue(this,ci,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??IS(i,n);let a=this.get(o);return a||(a=new wU({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){F(this,ci).has(t.queryHash)||(F(this,ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,ci).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ht.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,ci).get(t)}getAll(){return[...F(this,ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yj(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>yj(t,r)):n}notify(t){Ht.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ht.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ht.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ci=new WeakMap,SR),wt,Uo,zo,Ml,Il,Ho,Dl,Ll,OR,CU=(OR=class{constructor(e={}){ye(this,wt);ye(this,Uo);ye(this,zo);ye(this,Ml);ye(this,Il);ye(this,Ho);ye(this,Dl);ye(this,Ll);ue(this,wt,e.queryCache||new AU),ue(this,Uo,e.mutationCache||new jU),ue(this,zo,e.defaultOptions||{}),ue(this,Ml,new Map),ue(this,Il,new Map),ue(this,Ho,0)}mount(){Vd(this,Ho)._++,F(this,Ho)===1&&(ue(this,Dl,BS.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,wt).onFocus())})),ue(this,Ll,$h.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,wt).onOnline())})))}unmount(){var e,t;Vd(this,Ho)._--,F(this,Ho)===0&&((e=F(this,Dl))==null||e.call(this),ue(this,Dl,void 0),(t=F(this,Ll))==null||t.call(this),ue(this,Ll,void 0))}isFetching(e){return F(this,wt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Uo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,wt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,wt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,wt).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var a;const r=this.defaultQueryOptions({queryKey:e}),i=(a=F(this,wt).get(r.queryHash))==null?void 0:a.state.data,o=aU(t,i);if(o!==void 0)return F(this,wt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Ht.batch(()=>F(this,wt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,wt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,wt);Ht.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,wt);return Ht.batch(()=>{const r=n.findAll(e),i=new Set(r);return r.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>i.has(o)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ht.batch(()=>F(this,wt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then($n).catch($n)}invalidateQueries(e,t={}){return Ht.batch(()=>(F(this,wt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ht.batch(()=>F(this,wt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch($n)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($n)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,wt).build(this,t),r=n.isStaleByTime(yt(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,wt).build(this,t);return n.isStaleByTime(yt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($n).catch($n)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($n).catch($n)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return $h.isOnline()?F(this,Uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,wt)}getMutationCache(){return F(this,Uo)}getDefaultOptions(){return F(this,zo)}setDefaultOptions(e){ue(this,zo,e)}setQueryDefaults(e,t){F(this,Ml).set(vs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Ml).values()],n={};return t.forEach(r=>{Kl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,Il).set(vs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Il).values()],n={};return t.forEach(r=>{Kl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,zo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=IS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===DS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,zo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,wt).clear(),F(this,Uo).clear()}},wt=new WeakMap,Uo=new WeakMap,zo=new WeakMap,Ml=new WeakMap,Il=new WeakMap,Ho=new WeakMap,Dl=new WeakMap,Ll=new WeakMap,OR);const QN=O.createContext(!1),TU=()=>O.useContext(QN);QN.Provider;function _U(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const RU=O.createContext(_U()),kU=()=>O.useContext(RU),NU=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?LS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},$U=e=>{O.useEffect(()=>{e.clearReset()},[e])},MU=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||LS(n,[e.error,r])),IU=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},DU=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,LU=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JN(e,t,n){const r=TU(),i=kU(),o=ho(),a=o.defaultQueryOptions(e),s=o.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,IU(a),NU(a,i,s),$U(i);const[u]=O.useState(()=>new t(o,a)),c=u.getOptimisticResult(a),f=!r&&l;if(O.useSyncExternalStore(O.useCallback(p=>{const h=f?u.subscribe(Ht.batchCalls(p)):$n;return u.updateResult(),h},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(a)},[a,u]),DU(a,c))throw LU(a,u,i);if(MU({result:c,errorResetBoundary:i,throwOnError:a.throwOnError,query:s,suspense:a.suspense}))throw c.error;return a.notifyOnChangeProps?c:u.trackResult(c)}function At(e,t){return JN(e,XN)}function $s(e,t){const n=ho(),[r]=O.useState(()=>new EU(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(a=>r.subscribe(Ht.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=O.useCallback((...a)=>{r.mutate(a[0],a[1]).catch($n)},[r]);if(i.error&&LS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function FU(e,t){return JN(e,OU)}/**
41
41
  * @remix-run/router v1.23.4
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -64,7 +64,7 @@ Error generating stack: `+o.message+`
64
64
  * LICENSE.md file in the root directory of this source tree.
65
65
  *
66
66
  * @license MIT
67
- */function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ih.apply(null,arguments)}function f$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kz(e,t){return e.button===0&&(!t||t==="_self")&&!Rz(e)}function jb(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Nz(e,t){let n=jb(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const $z=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Mz=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Iz="6";try{window.__reactRouterVersion=Iz}catch{}const Dz=O.createContext({isTransitioning:!1}),Lz="startTransition",Rj=MR[Lz];function Fz(e){let{basename:t,children:n,future:r,window:i}=e,o=O.useRef();o.current==null&&(o.current=BU({window:i,v5Compat:!0}));let a=o.current,[s,l]=O.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=O.useCallback(f=>{u&&Rj?Rj(()=>l(f)):l(f)},[l,u]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.useEffect(()=>Az(r),[r]),O.createElement(Tz,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}const Bz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Uz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,d$=O.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,p=f$(t,$z),{basename:h}=O.useContext(wa),v,y=!1;if(typeof u=="string"&&Uz.test(u)&&(v=u,Bz))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),w=ql(S.pathname,h);S.origin===b.origin&&w!=null?u=w+S.search+S.hash:y=!0}catch{}let x=cz(u,{relative:i}),g=Hz(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function m(b){r&&r(b),b.defaultPrevented||g(b)}return O.createElement("a",Ih({},p,{href:v||x,onClick:y||o?r:m,ref:n,target:l}))}),eh=O.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:u,children:c}=t,f=f$(t,Mz),p=Og(l,{relative:f.relative}),h=Ru(),v=O.useContext(o$),{navigator:y,basename:x}=O.useContext(wa),g=v!=null&&Wz(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,b=h.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(b=b.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&x&&(S=ql(S,x)||S);const w=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let P=b===m||!a&&b.startsWith(m)&&b.charAt(w)==="/",j=S!=null&&(S===m||!a&&S.startsWith(m)&&S.charAt(m.length)==="/"),E={isActive:P,isPending:j,isTransitioning:g},A=P?r:void 0,C;typeof o=="function"?C=o(E):C=[o,P?"active":null,j?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(E):s;return O.createElement(d$,Ih({},f,{"aria-current":A,className:C,ref:n,style:T,to:l,viewTransition:u}),typeof c=="function"?c(E):c)});var Eb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Eb||(Eb={}));var kj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kj||(kj={}));function zz(e){let t=O.useContext(bg);return t||kt(!1),t}function Hz(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=Oi(),u=Ru(),c=Og(e,{relative:a});return O.useCallback(f=>{if(kz(f,n)){f.preventDefault();let p=r!==void 0?r:Mh(u)===Mh(c);l(e,{replace:p,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[u,l,c,r,i,n,e,o,a,s])}function Vz(e){let t=O.useRef(jb(e)),n=O.useRef(!1),r=Ru(),i=O.useMemo(()=>Nz(r.search,n.current?null:t.current),[r.search]),o=Oi(),a=O.useCallback((s,l)=>{const u=jb(typeof s=="function"?s(i):s);n.current=!0,o("?"+u,l)},[o,i]);return[i,a]}function Wz(e,t){t===void 0&&(t={});let n=O.useContext(Dz);n==null&&kt(!1);let{basename:r}=zz(Eb.useViewTransitionState),i=Og(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=ql(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=ql(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ob(i.pathname,a)!=null||Ob(i.pathname,o)!=null}function Kz(e){return e==="session"||e==="login"}function qz(){return`${typeof window<"u"&&window.__TELESCOPE_BASE__||"/telescope"}/api`}function Gz(e={}){const t=(e.baseUrl??qz()).replace(/\/$/,""),n=e.fetch??globalThis.fetch;async function r(g,m){let b=`${t}${g}`;if(m){const w=new URLSearchParams;for(const[j,E]of Object.entries(m))E!==void 0&&w.set(j,String(E));const P=w.toString();P&&(b+=`?${P}`)}const S=await n(b);if(!S.ok)throw new Error(`Telescope API ${g} failed: ${S.status}`);return await S.json()}async function i(g,m,b){let S=`${t}${g}`;if(m){const P=new URLSearchParams;for(const[E,A]of Object.entries(m))A!==void 0&&P.set(E,String(A));const j=P.toString();j&&(S+=`?${j}`)}const w=await n(S,{method:"POST",headers:{"Content-Type":"application/json"},...b!==void 0?{body:JSON.stringify(b)}:{}});if(!w.ok)throw new Error(`Telescope API ${g} failed: ${w.status}`);return await w.json()}async function o(g){return n(`${t}${g}`)}async function a(g,m){return n(`${t}${g}`,{method:"POST",headers:{"Content-Type":"application/json"},...m!==void 0?{body:JSON.stringify(m)}:{}})}async function s(){const g=await o("/auth/me");return g.ok?{status:"authenticated",user:(await g.json()).user}:g.status===404?{status:"disabled"}:{status:"unauthenticated",modes:await l(g)}}async function l(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"auth"in m&&m.auth!==null&&typeof m.auth=="object"&&"modes"in m.auth&&Array.isArray(m.auth.modes)?m.auth.modes.filter(Kz):[]}async function u(g,m){const b=await a("/auth/login",{username:g,password:m});return b.ok?{ok:!0}:{ok:!1,message:await c(b)}}async function c(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"message"in m&&typeof m.message=="string"?m.message:"Invalid credentials"}async function f(){await a("/auth/logout")}async function p(g){const m=await a("/queries/explain",{entryId:g});return m.ok?{ok:!0,plan:(await m.json()).plan}:{ok:!1,message:await h(m)}}async function h(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"message"in m&&typeof m.message=="string"?m.message:`EXPLAIN failed (${g.status})`}async function v(g,m=!1){const b=m?"?force=true":"",S=await a(`/exceptions/${encodeURIComponent(g)}/diagnose${b}`);if(S.ok){const P=await S.json();return{ok:!0,markdown:P.markdown,cached:P.cached}}return{ok:!1,message:await x(S)}}async function y(g){const m=await o(`/exceptions/${encodeURIComponent(g)}/diagnosis`);return m.status===204||m.status===404||!m.ok?null:{markdown:(await m.json()).markdown,cached:!0}}async function x(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"message"in m&&typeof m.message=="string"?m.message:`Diagnosis failed (${g.status})`}return{baseUrl:t,entries:(g={})=>r("/entries",{type:g.type,tag:g.tag,traceId:g.traceId,batchId:g.batchId,familyHash:g.familyHash,search:g.search,cursor:g.cursor,limit:g.limit}),entry:g=>r(`/entries/${encodeURIComponent(g)}`),pulse:g=>r("/pulse",{window:g}),queues:g=>r("/queues",{window:g}),timeseries:(g={})=>r("/timeseries",{window:g.window,buckets:g.buckets,type:g.type,tag:g.tag}),traces:(g,m)=>r("/traces",{window:g,limit:m}),waterfall:g=>r(`/traces/${encodeURIComponent(g)}/waterfall`),stats:(g,m)=>r("/stats",{type:g,window:m}),tags:(g,m)=>{var b;return r("/tags",{prefix:g,search:((b=m==null?void 0:m.search)==null?void 0:b.trim())||void 0,limit:m==null?void 0:m.limit,offset:m==null?void 0:m.offset})},meta:()=>r("/meta"),extData:(g,m,b)=>{const S=b&&Object.keys(b).length?`?${new URLSearchParams(b).toString()}`:"";return r(`/ext/${encodeURIComponent(g)}/data/${encodeURIComponent(m)}${S}`)},serverStats:()=>r("/server-stats"),serverStatsHistory:()=>r("/server-stats/history"),health:()=>r("/health"),retention:()=>r("/retention"),prunes:()=>r("/prunes"),prune:()=>i("/retention/prune"),explain:p,diagnose:v,cachedDiagnosis:y,profilerStatus:()=>r("/profiles/status"),profiles:g=>r("/profiles",{limit:g}),profile:g=>r(`/profiles/${encodeURIComponent(g)}`),armProfile:(g,m)=>i("/profiles/arm",void 0,{count:g,...m?{label:m}:{}}),liveQueues:()=>r("/queues/live"),schedulesLive:()=>r("/schedules/live"),queueCounts:(g,m)=>r(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/counts`),queueJobs:(g,m,b,S={})=>r(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/jobs`,{state:b,cursor:S.cursor,limit:S.limit}),queueJob:(g,m,b)=>r(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/jobs/${encodeURIComponent(b)}`),queueJobAction:(g,m,b,S)=>i(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/jobs/${encodeURIComponent(b)}/${encodeURIComponent(S)}`),queueAction:(g,m,b,S={})=>i(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/actions/${encodeURIComponent(b)}`,{state:S.state}),queueEnqueue:(g,m,b)=>i(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/enqueue`,void 0,b),auth:{me:s,login:u,logout:f}}}const p$=O.createContext(null),h$=O.createContext(null);function Xz({client:e,children:t}){const n=e??Gz(),[r,i]=O.useState(!1),o=O.useMemo(()=>({paused:r,setPaused:i}),[r]);return d.jsx(p$.Provider,{value:n,children:d.jsx(h$.Provider,{value:o,children:t})})}function Ue(){const e=O.useContext(p$);if(!e)throw new Error("useTelescopeClient must be used within a TelescopeProvider");return e}function m$(){const e=O.useContext(h$);if(!e)throw new Error("useLiveTail must be used within a TelescopeProvider");return e}function hn(){return m$().paused}const zn=3e3,HS=2500;function mn(e,t){return t?!1:e}function Yz(e,t={},n=!1){return{queryKey:["telescope","entries",t],queryFn:()=>e.entries(t),refetchInterval:mn(zn,n)}}function Qz(e,t){return{queryKey:["telescope","entry",t],queryFn:()=>e.entry(t)}}const Nj=50;function Jz(e,t="",n=""){return{queryKey:["telescope","tags","page",t,n],queryFn:({pageParam:r})=>e.tags(t===""?void 0:t,{search:n,limit:Nj,offset:r}),initialPageParam:0,getNextPageParam:(r,i)=>r.length<Nj?void 0:i.reduce((o,a)=>o+a.length,0),staleTime:zn}}function Zz(e,t=!1){return{queryKey:["telescope","meta"],queryFn:()=>e.meta(),refetchInterval:mn(zn,t)}}function e5(e,t,n,r){return{queryKey:["telescope","ext-data",t,n,r],queryFn:()=>e.extData(t,n,r)}}function t5(e,t=!1){return{queryKey:["telescope","server-stats"],queryFn:()=>e.serverStats(),refetchInterval:mn(zn,t)}}function n5(e,t=!1){return{queryKey:["telescope","server-stats-history"],queryFn:()=>e.serverStatsHistory(),refetchInterval:mn(zn,t)}}function r5(e,t=!1){return{queryKey:["telescope","health"],queryFn:()=>e.health(),refetchInterval:mn(zn,t)}}function g$(){return["telescope","retention"]}function i5(e,t=!1){return{queryKey:g$(),queryFn:()=>e.retention(),refetchInterval:mn(zn,t)}}function o5(e,t=!1){return{queryKey:["telescope","prunes"],queryFn:()=>e.prunes(),refetchInterval:mn(zn,t)}}function a5(e,t,n=!1){return{queryKey:["telescope","pulse",t],queryFn:()=>e.pulse(t),refetchInterval:mn(zn,n)}}function s5(e,t,n,r=!1){return{queryKey:["telescope","stats",t,n],queryFn:()=>e.stats(t,n),refetchInterval:mn(zn,r)}}function l5(e,t,n=!1){return{queryKey:["telescope","queues",t],queryFn:()=>e.queues(t),refetchInterval:mn(zn,n)}}function u5(e,t,n=!1){return{queryKey:["telescope","timeseries",t],queryFn:()=>e.timeseries(t),refetchInterval:mn(zn,n)}}function c5(e,t,n,r=!1){return{queryKey:["telescope","traces",t,n],queryFn:()=>e.traces(t,n),refetchInterval:mn(zn,r)}}function f5(e,t){return{queryKey:["telescope","waterfall",t],queryFn:()=>e.waterfall(t),enabled:t!==""}}function y$(){return["telescope","live-queues"]}function VS(e,t){return["telescope","queue-counts",e,t]}function d5(e,t,n,r={}){return["telescope","queue-jobs",e,t,n,r]}function p5(e,t,n){return["telescope","queue-job",e,t,n]}function h5(e,t=!1){return{queryKey:y$(),queryFn:()=>e.liveQueues(),refetchInterval:mn(HS,t)}}function m5(e,t,n,r,i={},o=!1){return{queryKey:d5(t,n,r,i),queryFn:()=>e.queueJobs(t,n,r,i),refetchInterval:mn(HS,o)}}function g5(e,t,n,r){return{queryKey:p5(t,n,r),queryFn:()=>e.queueJob(t,n,r)}}function y5(){return["telescope","live-schedules"]}function v5(e,t=!1){return{queryKey:y5(),queryFn:()=>e.schedulesLive(),refetchInterval:mn(HS,t)}}function v$(){return Et(h5(Ue(),hn()))}function x5(){return Et(v5(Ue(),hn()))}function b5(e,t,n,r={}){return Et(m5(Ue(),e,t,n,r,hn()))}function w5(e,t,n){return Et(g5(Ue(),e,t,n))}function S5(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.queueJobAction(n.driver,n.queue,n.id,n.action),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:VS(r.driver,r.queue)}),t.invalidateQueries({queryKey:["telescope","queue-jobs",r.driver,r.queue]})}})}function x$(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.queueAction(n.driver,n.queue,n.action,n.state!==void 0?{state:n.state}:{}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:VS(r.driver,r.queue)}),t.invalidateQueries({queryKey:["telescope","queue-jobs",r.driver,r.queue]})}})}function O5(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.queueEnqueue(n.driver,n.queue,{...n.name!==void 0?{name:n.name}:{},payload:n.payload}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:y$()}),t.invalidateQueries({queryKey:VS(r.driver,r.queue)}),t.invalidateQueries({queryKey:["telescope","queue-jobs",r.driver,r.queue]})}})}function P5(){return Et(i5(Ue(),hn()))}function j5(){return Et(o5(Ue(),hn()))}function b$(){const e=Ue(),t=ho();return $s({mutationFn:()=>e.prune(),onSuccess:()=>{t.invalidateQueries({queryKey:g$()}),t.invalidateQueries({queryKey:["telescope","prunes"]}),t.invalidateQueries({queryKey:["telescope","entries"]})}})}function E5(){const e=Ue();return $s({mutationFn:t=>e.explain(t)})}function A5(){const e=Ue();return $s({mutationFn:t=>e.diagnose(t.entryId,t.force??!1)})}function C5(e,t,n){return{queryKey:["telescope","cached-diagnosis",t],queryFn:()=>e.cachedDiagnosis(t),enabled:n}}function T5(e,t){return Et(C5(Ue(),e,t))}function w$(e={}){return Et(Yz(Ue(),e,hn()))}function _5(e){return Et(Qz(Ue(),e))}function Is(){return Et(Zz(Ue(),hn()))}function R5(){return Et(t5(Ue(),hn()))}function k5(){return Et(n5(Ue(),hn()))}function N5(e,t,n){return Et(e5(Ue(),e,t,n))}function $5(){return Et(r5(Ue(),hn()))}function M5(e="",t=""){return FU(Jz(Ue(),e,t))}function I5(e,t){return Et(s5(Ue(),e,t,hn()))}function S$(e){return Et(a5(Ue(),e,hn()))}function O$(e){return Et(l5(Ue(),e,hn()))}function WS(e){return Et(u5(Ue(),e,hn()))}function D5(e,t){return Et(c5(Ue(),e,t,hn()))}function L5(e){return Et(f5(Ue(),e))}function F5(e,t=!1){return{queryKey:["telescope","profiler-status"],queryFn:()=>e.profilerStatus(),refetchInterval:mn(zn,t)}}function B5(e,t,n=!1){return{queryKey:["telescope","profiles",t],queryFn:()=>e.profiles(t),refetchInterval:mn(zn,n)}}function U5(e,t){return{queryKey:["telescope","profile",t],queryFn:()=>e.profile(t),enabled:t!==""}}function z5(){return Et(F5(Ue(),hn()))}function H5(e){return Et(B5(Ue(),e,hn()))}function V5(e){return Et(U5(Ue(),e))}function W5(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.armProfile(n.count,n.label),onSuccess:()=>{t.invalidateQueries({queryKey:["telescope","profiler-status"]})}})}function K5(){const e=ho(),t=Ue(),[n,r]=O.useState("connecting");return O.useEffect(()=>{if(typeof EventSource>"u"){r("polling");return}const i=`${t.baseUrl}/stream`,o=new EventSource(i);return o.onopen=()=>r("live"),o.onerror=()=>r("polling"),o.onmessage=a=>{try{const s=JSON.parse(a.data);if(s.heartbeat)return;s.types&&s.types.length>0&&(e.invalidateQueries({queryKey:["telescope","ext-data"]}),e.invalidateQueries({queryKey:["telescope","meta"]}))}catch{}},()=>o.close()},[e,t.baseUrl]),{status:n}}const Gl=[{id:"request",label:"Requests",dot:"bg-emerald-400"},{id:"query",label:"Queries",dot:"bg-sky-400"},{id:"exception",label:"Exceptions",dot:"bg-red-400"},{id:"client_exception",label:"Client errors",dot:"bg-orange-500"},{id:"job",label:"Jobs",dot:"bg-violet-400"},{id:"durable",label:"Workflows",dot:"bg-purple-400"},{id:"mail",label:"Mail",dot:"bg-pink-400"},{id:"cache",label:"Cache",dot:"bg-teal-400"},{id:"schedule",label:"Schedule",dot:"bg-orange-400",query:{type:"job",tag:"schedule"}},{id:"http_client",label:"HTTP Client",dot:"bg-amber-400"},{id:"dump",label:"Dumps",dot:"bg-fuchsia-400"},{id:"event",label:"Events",dot:"bg-indigo-400"},{id:"log",label:"Logs",dot:"bg-zinc-400"},{id:"model",label:"Models",dot:"bg-lime-400"},{id:"redis",label:"Redis",dot:"bg-rose-400"},{id:"inertia",label:"Inertia",dot:"bg-cyan-400"}],q5="bg-zinc-500",Pg=Object.fromEntries(Gl.map(e=>[e.id,e]));function KS(e){var t;return((t=Pg[e])==null?void 0:t.dot)??q5}function jg(e){var t;return((t=Pg[e])==null?void 0:t.label)??e}function G5(e){return e in Pg}function P$(e){var t;return((t=Pg[e])==null?void 0:t.query)??{type:e}}const X5=new Set(["request","exception"]);function Y5(e){const t=(e??[]).map(r=>({id:r.id,label:r.label,dot:r.dot})),n=new Set(Gl.map(r=>r.id));return[...Gl,...t.filter(r=>!n.has(r.id))]}function Q5(e,t){if(t===void 0)return[...e];const n=new Set(t);return e.filter(r=>{var o;if(X5.has(r.id))return!0;const i=((o=r.query)==null?void 0:o.type)??r.id;return n.has(r.id)||n.has(i)})}function j$(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=j$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ae(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=j$(e))&&(r&&(r+=" "),r+=t);return r}const qS="-",J5=e=>{const t=eH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(qS);return s[0]===""&&s.length!==1&&s.shift(),E$(s,t)||Z5(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},E$=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?E$(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(qS);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},$j=/^\[(.+)\]$/,Z5=e=>{if($j.test(e)){const t=$j.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eH=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nH(Object.entries(e.classGroups),n).forEach(([o,a])=>{Ab(a,r,o,t)}),r},Ab=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Mj(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(tH(i)){Ab(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Ab(a,Mj(t,o),n,r)})})},Mj=(e,t)=>{let n=e;return t.split(qS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tH=e=>e.isThemeGetter,nH=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,rH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},A$="!",iH=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let u=0,c=0,f;for(let x=0;x<s.length;x++){let g=s[x];if(u===0){if(g===i&&(r||s.slice(x,x+o)===t)){l.push(s.slice(c,x)),c=x+o;continue}if(g==="/"){f=x;continue}}g==="["?u++:g==="]"&&u--}const p=l.length===0?s:s.substring(c),h=p.startsWith(A$),v=h?p.substring(1):p,y=f&&f>c?f-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:y}};return n?s=>n({className:s,parseClassName:a}):a},oH=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},aH=e=>({cache:rH(e.cacheSize),parseClassName:iH(e),...J5(e)}),sH=/\s+/,lH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(sH);let s="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:c,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let v=!!h,y=r(v?p.substring(0,h):p);if(!y){if(!v){s=u+(s.length>0?" "+s:s);continue}if(y=r(p),!y){s=u+(s.length>0?" "+s:s);continue}v=!1}const x=oH(c).join(":"),g=f?x+A$:x,m=g+y;if(o.includes(m))continue;o.push(m);const b=i(y,v);for(let S=0;S<b.length;++S){const w=b[S];o.push(g+w)}s=u+(s.length>0?" "+s:s)}return s};function uH(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=C$(t))&&(r&&(r+=" "),r+=n);return r}const C$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=C$(e[r]))&&(n&&(n+=" "),n+=t);return n};function cH(e,...t){let n,r,i,o=a;function a(l){const u=t.reduce((c,f)=>f(c),e());return n=aH(u),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=lH(l,n);return i(l,c),c}return function(){return o(uH.apply(null,arguments))}}const ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},T$=/^\[(?:([a-z-]+):)?(.+)\]$/i,fH=/^\d+\/\d+$/,dH=new Set(["px","full","screen"]),pH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hH=/\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$/,mH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ti=e=>xl(e)||dH.has(e)||fH.test(e),Eo=e=>ku(e,"length",jH),xl=e=>!!e&&!Number.isNaN(Number(e)),vv=e=>ku(e,"number",xl),dc=e=>!!e&&Number.isInteger(Number(e)),vH=e=>e.endsWith("%")&&xl(e.slice(0,-1)),ke=e=>T$.test(e),Ao=e=>pH.test(e),xH=new Set(["length","size","percentage"]),bH=e=>ku(e,xH,_$),wH=e=>ku(e,"position",_$),SH=new Set(["image","url"]),OH=e=>ku(e,SH,AH),PH=e=>ku(e,"",EH),pc=()=>!0,ku=(e,t,n)=>{const r=T$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},jH=e=>hH.test(e)&&!mH.test(e),_$=()=>!1,EH=e=>gH.test(e),AH=e=>yH.test(e),CH=()=>{const e=ft("colors"),t=ft("spacing"),n=ft("blur"),r=ft("brightness"),i=ft("borderColor"),o=ft("borderRadius"),a=ft("borderSpacing"),s=ft("borderWidth"),l=ft("contrast"),u=ft("grayscale"),c=ft("hueRotate"),f=ft("invert"),p=ft("gap"),h=ft("gradientColorStops"),v=ft("gradientColorStopPositions"),y=ft("inset"),x=ft("margin"),g=ft("opacity"),m=ft("padding"),b=ft("saturate"),S=ft("scale"),w=ft("sepia"),P=ft("skew"),j=ft("space"),E=ft("translate"),A=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",ke,t],_=()=>[ke,t],R=()=>["",Ti,Eo],$=()=>["auto",xl,ke],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",ke],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[xl,ke];return{cacheSize:500,separator:":",theme:{colors:[pc],spacing:[Ti,Eo],blur:["none","",Ao,ke],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ao,ke],borderSpacing:_(),borderWidth:R(),contrast:z(),grayscale:L(),hueRotate:z(),invert:L(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[vH,Eo],inset:T(),margin:T(),opacity:z(),padding:_(),saturate:z(),scale:z(),sepia:L(),skew:z(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[Ao]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),ke]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dc,ke]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",dc,ke]}],"grid-cols":[{"grid-cols":[pc]}],"col-start-end":[{col:["auto",{span:["full",dc,ke]},ke]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[pc]}],"row-start-end":[{row:["auto",{span:[dc,ke]},ke]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ke,t]}],"min-w":[{"min-w":[ke,t,"min","max","fit"]}],"max-w":[{"max-w":[ke,t,"none","full","min","max","fit","prose",{screen:[Ao]},Ao]}],h:[{h:[ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ao,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vv]}],"font-family":[{font:[pc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ke]}],"line-clamp":[{"line-clamp":["none",xl,vv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ti,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ti,Eo]}],"underline-offset":[{"underline-offset":["auto",Ti,ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),wH]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bH]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OH]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:I()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Ti,ke]}],"outline-w":[{outline:[Ti,Eo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Ti,Eo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ao,PH]}],"shadow-color":[{shadow:[pc]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ao,ke]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ke]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[dc,ke]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ti,Eo,vv]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},TH=cH(CH);function gt(...e){return TH(Ae(e))}const Ij=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dj=Ae,R$=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Dj(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],f=o==null?void 0:o[u];if(c===null)return null;const p=Ij(c)||Ij(f);return i[u][p]}),s=n&&Object.entries(n).reduce((u,c)=>{let[f,p]=c;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:f,className:p,...h}=c;return Object.entries(h).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...o,...s}[y]):{...o,...s}[y]===x})?[...u,f,p]:u},[]);return Dj(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},GS=R$("inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium",{variants:{variant:{muted:"tint-muted",brand:"tint-brand",good:"tint-good",warn:"tint-warn",bad:"tint-bad",outline:"border-line bg-transparent text-muted-foreground"}},defaultVariants:{variant:"muted"}});function XS({className:e,variant:t,...n}){return d.jsx("span",{className:gt(GS({variant:t}),e),...n})}const _H=R$("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded border font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{outline:"border-line bg-transparent text-foreground hover:bg-panel-2",ghost:"border-transparent bg-transparent text-muted-foreground hover:bg-panel-2 hover:text-foreground",solid:"border-transparent bg-primary text-primary-foreground hover:opacity-90",brand:"tint-brand hover:brightness-125",good:"tint-good hover:brightness-125",warn:"tint-warn hover:brightness-125",bad:"tint-bad hover:brightness-125"},size:{xs:"px-2 py-0.5 text-[10px] uppercase tracking-wide",sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm"}},defaultVariants:{variant:"outline",size:"sm"}}),Xe=O.forwardRef(function({className:t,variant:n,size:r,type:i="button",...o},a){return d.jsx("button",{ref:a,type:i,className:gt(_H({variant:n,size:r}),t),...o})});var RH=Array.isArray,Zn=RH,kH=typeof Wd=="object"&&Wd&&Wd.Object===Object&&Wd,k$=kH,NH=k$,$H=typeof self=="object"&&self&&self.Object===Object&&self,MH=NH||$H||Function("return this")(),Pi=MH,IH=Pi,DH=IH.Symbol,Od=DH,Lj=Od,N$=Object.prototype,LH=N$.hasOwnProperty,FH=N$.toString,hc=Lj?Lj.toStringTag:void 0;function BH(e){var t=LH.call(e,hc),n=e[hc];try{e[hc]=void 0;var r=!0}catch{}var i=FH.call(e);return r&&(t?e[hc]=n:delete e[hc]),i}var UH=BH,zH=Object.prototype,HH=zH.toString;function VH(e){return HH.call(e)}var WH=VH,Fj=Od,KH=UH,qH=WH,GH="[object Null]",XH="[object Undefined]",Bj=Fj?Fj.toStringTag:void 0;function YH(e){return e==null?e===void 0?XH:GH:Bj&&Bj in Object(e)?KH(e):qH(e)}var go=YH;function QH(e){return e!=null&&typeof e=="object"}var yo=QH,JH=go,ZH=yo,eV="[object Symbol]";function tV(e){return typeof e=="symbol"||ZH(e)&&JH(e)==eV}var Nu=tV,nV=Zn,rV=Nu,iV=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oV=/^\w*$/;function aV(e,t){if(nV(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||rV(e)?!0:oV.test(e)||!iV.test(e)||t!=null&&e in Object(t)}var YS=aV;function sV(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Sa=sV;const $u=Qe(Sa);var lV=go,uV=Sa,cV="[object AsyncFunction]",fV="[object Function]",dV="[object GeneratorFunction]",pV="[object Proxy]";function hV(e){if(!uV(e))return!1;var t=lV(e);return t==fV||t==dV||t==cV||t==pV}var QS=hV;const Oe=Qe(QS);var mV=Pi,gV=mV["__core-js_shared__"],yV=gV,xv=yV,Uj=function(){var e=/[^.]+$/.exec(xv&&xv.keys&&xv.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vV(e){return!!Uj&&Uj in e}var xV=vV,bV=Function.prototype,wV=bV.toString;function SV(e){if(e!=null){try{return wV.call(e)}catch{}try{return e+""}catch{}}return""}var $$=SV,OV=QS,PV=xV,jV=Sa,EV=$$,AV=/[\\^$.*+?()[\]{}|]/g,CV=/^\[object .+?Constructor\]$/,TV=Function.prototype,_V=Object.prototype,RV=TV.toString,kV=_V.hasOwnProperty,NV=RegExp("^"+RV.call(kV).replace(AV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $V(e){if(!jV(e)||PV(e))return!1;var t=OV(e)?NV:CV;return t.test(EV(e))}var MV=$V;function IV(e,t){return e==null?void 0:e[t]}var DV=IV,LV=MV,FV=DV;function BV(e,t){var n=FV(e,t);return LV(n)?n:void 0}var Ds=BV,UV=Ds,zV=UV(Object,"create"),Eg=zV,zj=Eg;function HV(){this.__data__=zj?zj(null):{},this.size=0}var VV=HV;function WV(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var KV=WV,qV=Eg,GV="__lodash_hash_undefined__",XV=Object.prototype,YV=XV.hasOwnProperty;function QV(e){var t=this.__data__;if(qV){var n=t[e];return n===GV?void 0:n}return YV.call(t,e)?t[e]:void 0}var JV=QV,ZV=Eg,eW=Object.prototype,tW=eW.hasOwnProperty;function nW(e){var t=this.__data__;return ZV?t[e]!==void 0:tW.call(t,e)}var rW=nW,iW=Eg,oW="__lodash_hash_undefined__";function aW(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=iW&&t===void 0?oW:t,this}var sW=aW,lW=VV,uW=KV,cW=JV,fW=rW,dW=sW;function Mu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mu.prototype.clear=lW;Mu.prototype.delete=uW;Mu.prototype.get=cW;Mu.prototype.has=fW;Mu.prototype.set=dW;var pW=Mu;function hW(){this.__data__=[],this.size=0}var mW=hW;function gW(e,t){return e===t||e!==e&&t!==t}var JS=gW,yW=JS;function vW(e,t){for(var n=e.length;n--;)if(yW(e[n][0],t))return n;return-1}var Ag=vW,xW=Ag,bW=Array.prototype,wW=bW.splice;function SW(e){var t=this.__data__,n=xW(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():wW.call(t,n,1),--this.size,!0}var OW=SW,PW=Ag;function jW(e){var t=this.__data__,n=PW(t,e);return n<0?void 0:t[n][1]}var EW=jW,AW=Ag;function CW(e){return AW(this.__data__,e)>-1}var TW=CW,_W=Ag;function RW(e,t){var n=this.__data__,r=_W(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var kW=RW,NW=mW,$W=OW,MW=EW,IW=TW,DW=kW;function Iu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Iu.prototype.clear=NW;Iu.prototype.delete=$W;Iu.prototype.get=MW;Iu.prototype.has=IW;Iu.prototype.set=DW;var Cg=Iu,LW=Ds,FW=Pi,BW=LW(FW,"Map"),ZS=BW,Hj=pW,UW=Cg,zW=ZS;function HW(){this.size=0,this.__data__={hash:new Hj,map:new(zW||UW),string:new Hj}}var VW=HW;function WW(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var KW=WW,qW=KW;function GW(e,t){var n=e.__data__;return qW(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Tg=GW,XW=Tg;function YW(e){var t=XW(this,e).delete(e);return this.size-=t?1:0,t}var QW=YW,JW=Tg;function ZW(e){return JW(this,e).get(e)}var e6=ZW,t6=Tg;function n6(e){return t6(this,e).has(e)}var r6=n6,i6=Tg;function o6(e,t){var n=i6(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var a6=o6,s6=VW,l6=QW,u6=e6,c6=r6,f6=a6;function Du(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Du.prototype.clear=s6;Du.prototype.delete=l6;Du.prototype.get=u6;Du.prototype.has=c6;Du.prototype.set=f6;var e1=Du,M$=e1,d6="Expected a function";function t1(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(d6);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(t1.Cache||M$),n}t1.Cache=M$;var I$=t1;const p6=Qe(I$);var h6=I$,m6=500;function g6(e){var t=h6(e,function(r){return n.size===m6&&n.clear(),r}),n=t.cache;return t}var y6=g6,v6=y6,x6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b6=/\\(\\)?/g,w6=v6(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(x6,function(n,r,i,o){t.push(i?o.replace(b6,"$1"):r||n)}),t}),S6=w6;function O6(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var n1=O6,Vj=Od,P6=n1,j6=Zn,E6=Nu,Wj=Vj?Vj.prototype:void 0,Kj=Wj?Wj.toString:void 0;function D$(e){if(typeof e=="string")return e;if(j6(e))return P6(e,D$)+"";if(E6(e))return Kj?Kj.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var A6=D$,C6=A6;function T6(e){return e==null?"":C6(e)}var L$=T6,_6=Zn,R6=YS,k6=S6,N6=L$;function $6(e,t){return _6(e)?e:R6(e,t)?[e]:k6(N6(e))}var F$=$6,M6=Nu;function I6(e){if(typeof e=="string"||M6(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _g=I6,D6=F$,L6=_g;function F6(e,t){t=D6(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[L6(t[n++])];return n&&n==r?e:void 0}var r1=F6,B6=r1;function U6(e,t,n){var r=e==null?void 0:B6(e,t);return r===void 0?n:r}var B$=U6;const lr=Qe(B$);function z6(e){return e==null}var H6=z6;const _e=Qe(H6);var V6=go,W6=Zn,K6=yo,q6="[object String]";function G6(e){return typeof e=="string"||!W6(e)&&K6(e)&&V6(e)==q6}var X6=G6;const xs=Qe(X6);var U$={exports:{}},Je={};/**
67
+ */function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ih.apply(null,arguments)}function f$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kz(e,t){return e.button===0&&(!t||t==="_self")&&!Rz(e)}function jb(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Nz(e,t){let n=jb(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const $z=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Mz=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Iz="6";try{window.__reactRouterVersion=Iz}catch{}const Dz=O.createContext({isTransitioning:!1}),Lz="startTransition",Rj=MR[Lz];function Fz(e){let{basename:t,children:n,future:r,window:i}=e,o=O.useRef();o.current==null&&(o.current=BU({window:i,v5Compat:!0}));let a=o.current,[s,l]=O.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=O.useCallback(f=>{u&&Rj?Rj(()=>l(f)):l(f)},[l,u]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.useEffect(()=>Az(r),[r]),O.createElement(Tz,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}const Bz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Uz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,d$=O.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,p=f$(t,$z),{basename:h}=O.useContext(wa),v,y=!1;if(typeof u=="string"&&Uz.test(u)&&(v=u,Bz))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),w=ql(S.pathname,h);S.origin===b.origin&&w!=null?u=w+S.search+S.hash:y=!0}catch{}let x=cz(u,{relative:i}),g=Hz(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function m(b){r&&r(b),b.defaultPrevented||g(b)}return O.createElement("a",Ih({},p,{href:v||x,onClick:y||o?r:m,ref:n,target:l}))}),eh=O.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:u,children:c}=t,f=f$(t,Mz),p=Og(l,{relative:f.relative}),h=Ru(),v=O.useContext(o$),{navigator:y,basename:x}=O.useContext(wa),g=v!=null&&Wz(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,b=h.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(b=b.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&x&&(S=ql(S,x)||S);const w=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let P=b===m||!a&&b.startsWith(m)&&b.charAt(w)==="/",j=S!=null&&(S===m||!a&&S.startsWith(m)&&S.charAt(m.length)==="/"),E={isActive:P,isPending:j,isTransitioning:g},A=P?r:void 0,C;typeof o=="function"?C=o(E):C=[o,P?"active":null,j?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(E):s;return O.createElement(d$,Ih({},f,{"aria-current":A,className:C,ref:n,style:T,to:l,viewTransition:u}),typeof c=="function"?c(E):c)});var Eb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Eb||(Eb={}));var kj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kj||(kj={}));function zz(e){let t=O.useContext(bg);return t||kt(!1),t}function Hz(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=Oi(),u=Ru(),c=Og(e,{relative:a});return O.useCallback(f=>{if(kz(f,n)){f.preventDefault();let p=r!==void 0?r:Mh(u)===Mh(c);l(e,{replace:p,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[u,l,c,r,i,n,e,o,a,s])}function Vz(e){let t=O.useRef(jb(e)),n=O.useRef(!1),r=Ru(),i=O.useMemo(()=>Nz(r.search,n.current?null:t.current),[r.search]),o=Oi(),a=O.useCallback((s,l)=>{const u=jb(typeof s=="function"?s(i):s);n.current=!0,o("?"+u,l)},[o,i]);return[i,a]}function Wz(e,t){t===void 0&&(t={});let n=O.useContext(Dz);n==null&&kt(!1);let{basename:r}=zz(Eb.useViewTransitionState),i=Og(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=ql(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=ql(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ob(i.pathname,a)!=null||Ob(i.pathname,o)!=null}function Kz(e){return e==="session"||e==="login"}function qz(){return`${typeof window<"u"&&window.__TELESCOPE_BASE__||"/telescope"}/api`}function Gz(e={}){const t=(e.baseUrl??qz()).replace(/\/$/,""),n=e.fetch??globalThis.fetch;async function r(g,m){let b=`${t}${g}`;if(m){const w=new URLSearchParams;for(const[j,E]of Object.entries(m))E!==void 0&&w.set(j,String(E));const P=w.toString();P&&(b+=`?${P}`)}const S=await n(b);if(!S.ok)throw new Error(`Telescope API ${g} failed: ${S.status}`);return await S.json()}async function i(g,m,b){let S=`${t}${g}`;if(m){const P=new URLSearchParams;for(const[E,A]of Object.entries(m))A!==void 0&&P.set(E,String(A));const j=P.toString();j&&(S+=`?${j}`)}const w=await n(S,{method:"POST",headers:{"Content-Type":"application/json"},...b!==void 0?{body:JSON.stringify(b)}:{}});if(!w.ok)throw new Error(`Telescope API ${g} failed: ${w.status}`);return await w.json()}async function o(g){return n(`${t}${g}`)}async function a(g,m){return n(`${t}${g}`,{method:"POST",headers:{"Content-Type":"application/json"},...m!==void 0?{body:JSON.stringify(m)}:{}})}async function s(){const g=await o("/auth/me");return g.ok?{status:"authenticated",user:(await g.json()).user}:g.status===404?{status:"disabled"}:{status:"unauthenticated",modes:await l(g)}}async function l(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"auth"in m&&m.auth!==null&&typeof m.auth=="object"&&"modes"in m.auth&&Array.isArray(m.auth.modes)?m.auth.modes.filter(Kz):[]}async function u(g,m){const b=await a("/auth/login",{username:g,password:m});return b.ok?{ok:!0}:{ok:!1,message:await c(b)}}async function c(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"message"in m&&typeof m.message=="string"?m.message:"Invalid credentials"}async function f(){await a("/auth/logout")}async function p(g){const m=await a("/queries/explain",{entryId:g});return m.ok?{ok:!0,plan:(await m.json()).plan}:{ok:!1,message:await h(m)}}async function h(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"message"in m&&typeof m.message=="string"?m.message:`EXPLAIN failed (${g.status})`}async function v(g,m=!1){const b=m?"?force=true":"",S=await a(`/exceptions/${encodeURIComponent(g)}/diagnose${b}`);if(S.ok){const P=await S.json();return{ok:!0,markdown:P.markdown,cached:P.cached}}return{ok:!1,message:await x(S)}}async function y(g){const m=await o(`/exceptions/${encodeURIComponent(g)}/diagnosis`);return m.status===204||m.status===404||!m.ok?null:{markdown:(await m.json()).markdown,cached:!0}}async function x(g){const m=await g.json().then(b=>b).catch(()=>null);return m!==null&&typeof m=="object"&&"message"in m&&typeof m.message=="string"?m.message:`Diagnosis failed (${g.status})`}return{baseUrl:t,entries:(g={})=>r("/entries",{type:g.type,tag:g.tag,traceId:g.traceId,batchId:g.batchId,familyHash:g.familyHash,search:g.search,cursor:g.cursor,limit:g.limit}),entry:g=>r(`/entries/${encodeURIComponent(g)}`),pulse:g=>r("/pulse",{window:g}),queues:g=>r("/queues",{window:g}),timeseries:(g={})=>r("/timeseries",{window:g.window,buckets:g.buckets,type:g.type,tag:g.tag}),traces:(g,m)=>r("/traces",{window:g,limit:m}),waterfall:g=>r(`/traces/${encodeURIComponent(g)}/waterfall`),stats:(g,m)=>r("/stats",{type:g,window:m}),tags:(g,m)=>{var b;return r("/tags",{prefix:g,search:((b=m==null?void 0:m.search)==null?void 0:b.trim())||void 0,limit:m==null?void 0:m.limit,offset:m==null?void 0:m.offset})},meta:()=>r("/meta"),extData:(g,m,b)=>{const S=b&&Object.keys(b).length?`?${new URLSearchParams(b).toString()}`:"";return r(`/ext/${encodeURIComponent(g)}/data/${encodeURIComponent(m)}${S}`)},serverStats:()=>r("/server-stats"),serverStatsHistory:()=>r("/server-stats/history"),health:()=>r("/health"),retention:()=>r("/retention"),prunes:()=>r("/prunes"),prune:()=>i("/retention/prune"),explain:p,diagnose:v,cachedDiagnosis:y,profilerStatus:()=>r("/profiles/status"),profiles:g=>r("/profiles",{limit:g}),profile:g=>r(`/profiles/${encodeURIComponent(g)}`),armProfile:(g,m)=>i("/profiles/arm",void 0,{count:g,...m?{label:m}:{}}),liveQueues:()=>r("/queues/live"),schedulesLive:()=>r("/schedules/live"),queueCounts:(g,m)=>r(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/counts`),queueJobs:(g,m,b,S={})=>r(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/jobs`,{state:b,cursor:S.cursor,limit:S.limit}),queueJob:(g,m,b)=>r(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/jobs/${encodeURIComponent(b)}`),queueJobAction:(g,m,b,S)=>i(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/jobs/${encodeURIComponent(b)}/${encodeURIComponent(S)}`),queueAction:(g,m,b,S={})=>i(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/actions/${encodeURIComponent(b)}`,{state:S.state}),queueEnqueue:(g,m,b)=>i(`/queues/live/${encodeURIComponent(g)}/${encodeURIComponent(m)}/enqueue`,void 0,b),auth:{me:s,login:u,logout:f}}}const p$=O.createContext(null),h$=O.createContext(null);function Xz({client:e,children:t}){const n=e??Gz(),[r,i]=O.useState(!1),o=O.useMemo(()=>({paused:r,setPaused:i}),[r]);return d.jsx(p$.Provider,{value:n,children:d.jsx(h$.Provider,{value:o,children:t})})}function Ue(){const e=O.useContext(p$);if(!e)throw new Error("useTelescopeClient must be used within a TelescopeProvider");return e}function m$(){const e=O.useContext(h$);if(!e)throw new Error("useLiveTail must be used within a TelescopeProvider");return e}function hn(){return m$().paused}const zn=3e3,HS=2500;function mn(e,t){return t?!1:e}function Yz(e,t={},n=!1){return{queryKey:["telescope","entries",t],queryFn:()=>e.entries(t),refetchInterval:mn(zn,n)}}function Qz(e,t){return{queryKey:["telescope","entry",t],queryFn:()=>e.entry(t)}}const Nj=50;function Jz(e,t="",n=""){return{queryKey:["telescope","tags","page",t,n],queryFn:({pageParam:r})=>e.tags(t===""?void 0:t,{search:n,limit:Nj,offset:r}),initialPageParam:0,getNextPageParam:(r,i)=>r.length<Nj?void 0:i.reduce((o,a)=>o+a.length,0),staleTime:zn}}function Zz(e,t=!1){return{queryKey:["telescope","meta"],queryFn:()=>e.meta(),refetchInterval:mn(zn,t)}}function e5(e,t,n,r){return{queryKey:["telescope","ext-data",t,n,r],queryFn:()=>e.extData(t,n,r)}}function t5(e,t=!1){return{queryKey:["telescope","server-stats"],queryFn:()=>e.serverStats(),refetchInterval:mn(zn,t)}}function n5(e,t=!1){return{queryKey:["telescope","server-stats-history"],queryFn:()=>e.serverStatsHistory(),refetchInterval:mn(zn,t)}}function r5(e,t=!1){return{queryKey:["telescope","health"],queryFn:()=>e.health(),refetchInterval:mn(zn,t)}}function g$(){return["telescope","retention"]}function i5(e,t=!1){return{queryKey:g$(),queryFn:()=>e.retention(),refetchInterval:mn(zn,t)}}function o5(e,t=!1){return{queryKey:["telescope","prunes"],queryFn:()=>e.prunes(),refetchInterval:mn(zn,t)}}function a5(e,t,n=!1){return{queryKey:["telescope","pulse",t],queryFn:()=>e.pulse(t),refetchInterval:mn(zn,n)}}function s5(e,t,n,r=!1){return{queryKey:["telescope","stats",t,n],queryFn:()=>e.stats(t,n),refetchInterval:mn(zn,r)}}function l5(e,t,n=!1){return{queryKey:["telescope","queues",t],queryFn:()=>e.queues(t),refetchInterval:mn(zn,n)}}function u5(e,t,n=!1){return{queryKey:["telescope","timeseries",t],queryFn:()=>e.timeseries(t),refetchInterval:mn(zn,n)}}function c5(e,t,n,r=!1){return{queryKey:["telescope","traces",t,n],queryFn:()=>e.traces(t,n),refetchInterval:mn(zn,r)}}function f5(e,t){return{queryKey:["telescope","waterfall",t],queryFn:()=>e.waterfall(t),enabled:t!==""}}function y$(){return["telescope","live-queues"]}function VS(e,t){return["telescope","queue-counts",e,t]}function d5(e,t,n,r={}){return["telescope","queue-jobs",e,t,n,r]}function p5(e,t,n){return["telescope","queue-job",e,t,n]}function h5(e,t=!1){return{queryKey:y$(),queryFn:()=>e.liveQueues(),refetchInterval:mn(HS,t)}}function m5(e,t,n,r,i={},o=!1){return{queryKey:d5(t,n,r,i),queryFn:()=>e.queueJobs(t,n,r,i),refetchInterval:mn(HS,o)}}function g5(e,t,n,r){return{queryKey:p5(t,n,r),queryFn:()=>e.queueJob(t,n,r)}}function y5(){return["telescope","live-schedules"]}function v5(e,t=!1){return{queryKey:y5(),queryFn:()=>e.schedulesLive(),refetchInterval:mn(HS,t)}}function v$(){return At(h5(Ue(),hn()))}function x5(){return At(v5(Ue(),hn()))}function b5(e,t,n,r={}){return At(m5(Ue(),e,t,n,r,hn()))}function w5(e,t,n){return At(g5(Ue(),e,t,n))}function S5(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.queueJobAction(n.driver,n.queue,n.id,n.action),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:VS(r.driver,r.queue)}),t.invalidateQueries({queryKey:["telescope","queue-jobs",r.driver,r.queue]})}})}function x$(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.queueAction(n.driver,n.queue,n.action,n.state!==void 0?{state:n.state}:{}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:VS(r.driver,r.queue)}),t.invalidateQueries({queryKey:["telescope","queue-jobs",r.driver,r.queue]})}})}function O5(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.queueEnqueue(n.driver,n.queue,{...n.name!==void 0?{name:n.name}:{},payload:n.payload}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:y$()}),t.invalidateQueries({queryKey:VS(r.driver,r.queue)}),t.invalidateQueries({queryKey:["telescope","queue-jobs",r.driver,r.queue]})}})}function P5(){return At(i5(Ue(),hn()))}function j5(){return At(o5(Ue(),hn()))}function b$(){const e=Ue(),t=ho();return $s({mutationFn:()=>e.prune(),onSuccess:()=>{t.invalidateQueries({queryKey:g$()}),t.invalidateQueries({queryKey:["telescope","prunes"]}),t.invalidateQueries({queryKey:["telescope","entries"]})}})}function E5(){const e=Ue();return $s({mutationFn:t=>e.explain(t)})}function A5(){const e=Ue();return $s({mutationFn:t=>e.diagnose(t.entryId,t.force??!1)})}function C5(e,t,n){return{queryKey:["telescope","cached-diagnosis",t],queryFn:()=>e.cachedDiagnosis(t),enabled:n}}function T5(e,t){return At(C5(Ue(),e,t))}function w$(e={}){return At(Yz(Ue(),e,hn()))}function _5(e){return At(Qz(Ue(),e))}function Is(){return At(Zz(Ue(),hn()))}function R5(){return At(t5(Ue(),hn()))}function k5(){return At(n5(Ue(),hn()))}function N5(e,t,n){return At(e5(Ue(),e,t,n))}function $5(){return At(r5(Ue(),hn()))}function M5(e="",t=""){return FU(Jz(Ue(),e,t))}function I5(e,t){return At(s5(Ue(),e,t,hn()))}function S$(e){return At(a5(Ue(),e,hn()))}function O$(e){return At(l5(Ue(),e,hn()))}function WS(e){return At(u5(Ue(),e,hn()))}function D5(e,t){return At(c5(Ue(),e,t,hn()))}function L5(e){return At(f5(Ue(),e))}function F5(e,t=!1){return{queryKey:["telescope","profiler-status"],queryFn:()=>e.profilerStatus(),refetchInterval:mn(zn,t)}}function B5(e,t,n=!1){return{queryKey:["telescope","profiles",t],queryFn:()=>e.profiles(t),refetchInterval:mn(zn,n)}}function U5(e,t){return{queryKey:["telescope","profile",t],queryFn:()=>e.profile(t),enabled:t!==""}}function z5(){return At(F5(Ue(),hn()))}function H5(e){return At(B5(Ue(),e,hn()))}function V5(e){return At(U5(Ue(),e))}function W5(){const e=Ue(),t=ho();return $s({mutationFn:n=>e.armProfile(n.count,n.label),onSuccess:()=>{t.invalidateQueries({queryKey:["telescope","profiler-status"]})}})}function K5(){const e=ho(),t=Ue(),[n,r]=O.useState("connecting");return O.useEffect(()=>{if(typeof EventSource>"u"){r("polling");return}const i=`${t.baseUrl}/stream`,o=new EventSource(i);return o.onopen=()=>r("live"),o.onerror=()=>r("polling"),o.onmessage=a=>{try{const s=JSON.parse(a.data);if(s.heartbeat)return;s.types&&s.types.length>0&&(e.invalidateQueries({queryKey:["telescope","ext-data"]}),e.invalidateQueries({queryKey:["telescope","meta"]}))}catch{}},()=>o.close()},[e,t.baseUrl]),{status:n}}const Gl=[{id:"request",label:"Requests",dot:"bg-emerald-400"},{id:"query",label:"Queries",dot:"bg-sky-400"},{id:"exception",label:"Exceptions",dot:"bg-red-400"},{id:"client_exception",label:"Client errors",dot:"bg-orange-500"},{id:"job",label:"Jobs",dot:"bg-violet-400"},{id:"durable",label:"Workflows",dot:"bg-purple-400"},{id:"mail",label:"Mail",dot:"bg-pink-400"},{id:"cache",label:"Cache",dot:"bg-teal-400"},{id:"schedule",label:"Schedule",dot:"bg-orange-400",query:{type:"job",tag:"schedule"}},{id:"http_client",label:"HTTP Client",dot:"bg-amber-400"},{id:"dump",label:"Dumps",dot:"bg-fuchsia-400"},{id:"event",label:"Events",dot:"bg-indigo-400"},{id:"log",label:"Logs",dot:"bg-zinc-400"},{id:"model",label:"Models",dot:"bg-lime-400"},{id:"redis",label:"Redis",dot:"bg-rose-400"},{id:"inertia",label:"Inertia",dot:"bg-cyan-400"}],q5="bg-zinc-500",Pg=Object.fromEntries(Gl.map(e=>[e.id,e]));function KS(e){var t;return((t=Pg[e])==null?void 0:t.dot)??q5}function jg(e){var t;return((t=Pg[e])==null?void 0:t.label)??e}function G5(e){return e in Pg}function P$(e){var t;return((t=Pg[e])==null?void 0:t.query)??{type:e}}const X5=new Set(["request","exception"]);function Y5(e){const t=(e??[]).map(r=>({id:r.id,label:r.label,dot:r.dot})),n=new Set(Gl.map(r=>r.id));return[...Gl,...t.filter(r=>!n.has(r.id))]}function Q5(e,t){if(t===void 0)return[...e];const n=new Set(t);return e.filter(r=>{var o;if(X5.has(r.id))return!0;const i=((o=r.query)==null?void 0:o.type)??r.id;return n.has(r.id)||n.has(i)})}function j$(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=j$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ae(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=j$(e))&&(r&&(r+=" "),r+=t);return r}const qS="-",J5=e=>{const t=eH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(qS);return s[0]===""&&s.length!==1&&s.shift(),E$(s,t)||Z5(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},E$=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?E$(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(qS);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},$j=/^\[(.+)\]$/,Z5=e=>{if($j.test(e)){const t=$j.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eH=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nH(Object.entries(e.classGroups),n).forEach(([o,a])=>{Ab(a,r,o,t)}),r},Ab=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Mj(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(tH(i)){Ab(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Ab(a,Mj(t,o),n,r)})})},Mj=(e,t)=>{let n=e;return t.split(qS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tH=e=>e.isThemeGetter,nH=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,rH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},A$="!",iH=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let u=0,c=0,f;for(let x=0;x<s.length;x++){let g=s[x];if(u===0){if(g===i&&(r||s.slice(x,x+o)===t)){l.push(s.slice(c,x)),c=x+o;continue}if(g==="/"){f=x;continue}}g==="["?u++:g==="]"&&u--}const p=l.length===0?s:s.substring(c),h=p.startsWith(A$),v=h?p.substring(1):p,y=f&&f>c?f-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:y}};return n?s=>n({className:s,parseClassName:a}):a},oH=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},aH=e=>({cache:rH(e.cacheSize),parseClassName:iH(e),...J5(e)}),sH=/\s+/,lH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(sH);let s="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:c,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let v=!!h,y=r(v?p.substring(0,h):p);if(!y){if(!v){s=u+(s.length>0?" "+s:s);continue}if(y=r(p),!y){s=u+(s.length>0?" "+s:s);continue}v=!1}const x=oH(c).join(":"),g=f?x+A$:x,m=g+y;if(o.includes(m))continue;o.push(m);const b=i(y,v);for(let S=0;S<b.length;++S){const w=b[S];o.push(g+w)}s=u+(s.length>0?" "+s:s)}return s};function uH(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=C$(t))&&(r&&(r+=" "),r+=n);return r}const C$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=C$(e[r]))&&(n&&(n+=" "),n+=t);return n};function cH(e,...t){let n,r,i,o=a;function a(l){const u=t.reduce((c,f)=>f(c),e());return n=aH(u),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=lH(l,n);return i(l,c),c}return function(){return o(uH.apply(null,arguments))}}const ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},T$=/^\[(?:([a-z-]+):)?(.+)\]$/i,fH=/^\d+\/\d+$/,dH=new Set(["px","full","screen"]),pH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hH=/\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$/,mH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ti=e=>xl(e)||dH.has(e)||fH.test(e),Eo=e=>ku(e,"length",jH),xl=e=>!!e&&!Number.isNaN(Number(e)),vv=e=>ku(e,"number",xl),dc=e=>!!e&&Number.isInteger(Number(e)),vH=e=>e.endsWith("%")&&xl(e.slice(0,-1)),ke=e=>T$.test(e),Ao=e=>pH.test(e),xH=new Set(["length","size","percentage"]),bH=e=>ku(e,xH,_$),wH=e=>ku(e,"position",_$),SH=new Set(["image","url"]),OH=e=>ku(e,SH,AH),PH=e=>ku(e,"",EH),pc=()=>!0,ku=(e,t,n)=>{const r=T$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},jH=e=>hH.test(e)&&!mH.test(e),_$=()=>!1,EH=e=>gH.test(e),AH=e=>yH.test(e),CH=()=>{const e=ft("colors"),t=ft("spacing"),n=ft("blur"),r=ft("brightness"),i=ft("borderColor"),o=ft("borderRadius"),a=ft("borderSpacing"),s=ft("borderWidth"),l=ft("contrast"),u=ft("grayscale"),c=ft("hueRotate"),f=ft("invert"),p=ft("gap"),h=ft("gradientColorStops"),v=ft("gradientColorStopPositions"),y=ft("inset"),x=ft("margin"),g=ft("opacity"),m=ft("padding"),b=ft("saturate"),S=ft("scale"),w=ft("sepia"),P=ft("skew"),j=ft("space"),E=ft("translate"),A=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",ke,t],_=()=>[ke,t],R=()=>["",Ti,Eo],$=()=>["auto",xl,ke],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",ke],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[xl,ke];return{cacheSize:500,separator:":",theme:{colors:[pc],spacing:[Ti,Eo],blur:["none","",Ao,ke],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ao,ke],borderSpacing:_(),borderWidth:R(),contrast:z(),grayscale:L(),hueRotate:z(),invert:L(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[vH,Eo],inset:T(),margin:T(),opacity:z(),padding:_(),saturate:z(),scale:z(),sepia:L(),skew:z(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[Ao]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),ke]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dc,ke]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",dc,ke]}],"grid-cols":[{"grid-cols":[pc]}],"col-start-end":[{col:["auto",{span:["full",dc,ke]},ke]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[pc]}],"row-start-end":[{row:["auto",{span:[dc,ke]},ke]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ke,t]}],"min-w":[{"min-w":[ke,t,"min","max","fit"]}],"max-w":[{"max-w":[ke,t,"none","full","min","max","fit","prose",{screen:[Ao]},Ao]}],h:[{h:[ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ao,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vv]}],"font-family":[{font:[pc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ke]}],"line-clamp":[{"line-clamp":["none",xl,vv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ti,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ti,Eo]}],"underline-offset":[{"underline-offset":["auto",Ti,ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),wH]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bH]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OH]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:I()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Ti,ke]}],"outline-w":[{outline:[Ti,Eo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Ti,Eo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ao,PH]}],"shadow-color":[{shadow:[pc]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ao,ke]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ke]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[dc,ke]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ti,Eo,vv]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},TH=cH(CH);function gt(...e){return TH(Ae(e))}const Ij=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dj=Ae,R$=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Dj(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],f=o==null?void 0:o[u];if(c===null)return null;const p=Ij(c)||Ij(f);return i[u][p]}),s=n&&Object.entries(n).reduce((u,c)=>{let[f,p]=c;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:f,className:p,...h}=c;return Object.entries(h).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...o,...s}[y]):{...o,...s}[y]===x})?[...u,f,p]:u},[]);return Dj(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},GS=R$("inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium",{variants:{variant:{muted:"tint-muted",brand:"tint-brand",good:"tint-good",warn:"tint-warn",bad:"tint-bad",outline:"border-line bg-transparent text-muted-foreground"}},defaultVariants:{variant:"muted"}});function XS({className:e,variant:t,...n}){return d.jsx("span",{className:gt(GS({variant:t}),e),...n})}const _H=R$("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded border font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{outline:"border-line bg-transparent text-foreground hover:bg-panel-2",ghost:"border-transparent bg-transparent text-muted-foreground hover:bg-panel-2 hover:text-foreground",solid:"border-transparent bg-primary text-primary-foreground hover:opacity-90",brand:"tint-brand hover:brightness-125",good:"tint-good hover:brightness-125",warn:"tint-warn hover:brightness-125",bad:"tint-bad hover:brightness-125"},size:{xs:"px-2 py-0.5 text-[10px] uppercase tracking-wide",sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm"}},defaultVariants:{variant:"outline",size:"sm"}}),Xe=O.forwardRef(function({className:t,variant:n,size:r,type:i="button",...o},a){return d.jsx("button",{ref:a,type:i,className:gt(_H({variant:n,size:r}),t),...o})});var RH=Array.isArray,Zn=RH,kH=typeof Wd=="object"&&Wd&&Wd.Object===Object&&Wd,k$=kH,NH=k$,$H=typeof self=="object"&&self&&self.Object===Object&&self,MH=NH||$H||Function("return this")(),Pi=MH,IH=Pi,DH=IH.Symbol,Od=DH,Lj=Od,N$=Object.prototype,LH=N$.hasOwnProperty,FH=N$.toString,hc=Lj?Lj.toStringTag:void 0;function BH(e){var t=LH.call(e,hc),n=e[hc];try{e[hc]=void 0;var r=!0}catch{}var i=FH.call(e);return r&&(t?e[hc]=n:delete e[hc]),i}var UH=BH,zH=Object.prototype,HH=zH.toString;function VH(e){return HH.call(e)}var WH=VH,Fj=Od,KH=UH,qH=WH,GH="[object Null]",XH="[object Undefined]",Bj=Fj?Fj.toStringTag:void 0;function YH(e){return e==null?e===void 0?XH:GH:Bj&&Bj in Object(e)?KH(e):qH(e)}var go=YH;function QH(e){return e!=null&&typeof e=="object"}var yo=QH,JH=go,ZH=yo,eV="[object Symbol]";function tV(e){return typeof e=="symbol"||ZH(e)&&JH(e)==eV}var Nu=tV,nV=Zn,rV=Nu,iV=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oV=/^\w*$/;function aV(e,t){if(nV(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||rV(e)?!0:oV.test(e)||!iV.test(e)||t!=null&&e in Object(t)}var YS=aV;function sV(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Sa=sV;const $u=Qe(Sa);var lV=go,uV=Sa,cV="[object AsyncFunction]",fV="[object Function]",dV="[object GeneratorFunction]",pV="[object Proxy]";function hV(e){if(!uV(e))return!1;var t=lV(e);return t==fV||t==dV||t==cV||t==pV}var QS=hV;const Oe=Qe(QS);var mV=Pi,gV=mV["__core-js_shared__"],yV=gV,xv=yV,Uj=function(){var e=/[^.]+$/.exec(xv&&xv.keys&&xv.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vV(e){return!!Uj&&Uj in e}var xV=vV,bV=Function.prototype,wV=bV.toString;function SV(e){if(e!=null){try{return wV.call(e)}catch{}try{return e+""}catch{}}return""}var $$=SV,OV=QS,PV=xV,jV=Sa,EV=$$,AV=/[\\^$.*+?()[\]{}|]/g,CV=/^\[object .+?Constructor\]$/,TV=Function.prototype,_V=Object.prototype,RV=TV.toString,kV=_V.hasOwnProperty,NV=RegExp("^"+RV.call(kV).replace(AV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $V(e){if(!jV(e)||PV(e))return!1;var t=OV(e)?NV:CV;return t.test(EV(e))}var MV=$V;function IV(e,t){return e==null?void 0:e[t]}var DV=IV,LV=MV,FV=DV;function BV(e,t){var n=FV(e,t);return LV(n)?n:void 0}var Ds=BV,UV=Ds,zV=UV(Object,"create"),Eg=zV,zj=Eg;function HV(){this.__data__=zj?zj(null):{},this.size=0}var VV=HV;function WV(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var KV=WV,qV=Eg,GV="__lodash_hash_undefined__",XV=Object.prototype,YV=XV.hasOwnProperty;function QV(e){var t=this.__data__;if(qV){var n=t[e];return n===GV?void 0:n}return YV.call(t,e)?t[e]:void 0}var JV=QV,ZV=Eg,eW=Object.prototype,tW=eW.hasOwnProperty;function nW(e){var t=this.__data__;return ZV?t[e]!==void 0:tW.call(t,e)}var rW=nW,iW=Eg,oW="__lodash_hash_undefined__";function aW(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=iW&&t===void 0?oW:t,this}var sW=aW,lW=VV,uW=KV,cW=JV,fW=rW,dW=sW;function Mu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mu.prototype.clear=lW;Mu.prototype.delete=uW;Mu.prototype.get=cW;Mu.prototype.has=fW;Mu.prototype.set=dW;var pW=Mu;function hW(){this.__data__=[],this.size=0}var mW=hW;function gW(e,t){return e===t||e!==e&&t!==t}var JS=gW,yW=JS;function vW(e,t){for(var n=e.length;n--;)if(yW(e[n][0],t))return n;return-1}var Ag=vW,xW=Ag,bW=Array.prototype,wW=bW.splice;function SW(e){var t=this.__data__,n=xW(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():wW.call(t,n,1),--this.size,!0}var OW=SW,PW=Ag;function jW(e){var t=this.__data__,n=PW(t,e);return n<0?void 0:t[n][1]}var EW=jW,AW=Ag;function CW(e){return AW(this.__data__,e)>-1}var TW=CW,_W=Ag;function RW(e,t){var n=this.__data__,r=_W(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var kW=RW,NW=mW,$W=OW,MW=EW,IW=TW,DW=kW;function Iu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Iu.prototype.clear=NW;Iu.prototype.delete=$W;Iu.prototype.get=MW;Iu.prototype.has=IW;Iu.prototype.set=DW;var Cg=Iu,LW=Ds,FW=Pi,BW=LW(FW,"Map"),ZS=BW,Hj=pW,UW=Cg,zW=ZS;function HW(){this.size=0,this.__data__={hash:new Hj,map:new(zW||UW),string:new Hj}}var VW=HW;function WW(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var KW=WW,qW=KW;function GW(e,t){var n=e.__data__;return qW(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Tg=GW,XW=Tg;function YW(e){var t=XW(this,e).delete(e);return this.size-=t?1:0,t}var QW=YW,JW=Tg;function ZW(e){return JW(this,e).get(e)}var e6=ZW,t6=Tg;function n6(e){return t6(this,e).has(e)}var r6=n6,i6=Tg;function o6(e,t){var n=i6(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var a6=o6,s6=VW,l6=QW,u6=e6,c6=r6,f6=a6;function Du(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Du.prototype.clear=s6;Du.prototype.delete=l6;Du.prototype.get=u6;Du.prototype.has=c6;Du.prototype.set=f6;var e1=Du,M$=e1,d6="Expected a function";function t1(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(d6);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(t1.Cache||M$),n}t1.Cache=M$;var I$=t1;const p6=Qe(I$);var h6=I$,m6=500;function g6(e){var t=h6(e,function(r){return n.size===m6&&n.clear(),r}),n=t.cache;return t}var y6=g6,v6=y6,x6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b6=/\\(\\)?/g,w6=v6(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(x6,function(n,r,i,o){t.push(i?o.replace(b6,"$1"):r||n)}),t}),S6=w6;function O6(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var n1=O6,Vj=Od,P6=n1,j6=Zn,E6=Nu,Wj=Vj?Vj.prototype:void 0,Kj=Wj?Wj.toString:void 0;function D$(e){if(typeof e=="string")return e;if(j6(e))return P6(e,D$)+"";if(E6(e))return Kj?Kj.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var A6=D$,C6=A6;function T6(e){return e==null?"":C6(e)}var L$=T6,_6=Zn,R6=YS,k6=S6,N6=L$;function $6(e,t){return _6(e)?e:R6(e,t)?[e]:k6(N6(e))}var F$=$6,M6=Nu;function I6(e){if(typeof e=="string"||M6(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _g=I6,D6=F$,L6=_g;function F6(e,t){t=D6(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[L6(t[n++])];return n&&n==r?e:void 0}var r1=F6,B6=r1;function U6(e,t,n){var r=e==null?void 0:B6(e,t);return r===void 0?n:r}var B$=U6;const lr=Qe(B$);function z6(e){return e==null}var H6=z6;const _e=Qe(H6);var V6=go,W6=Zn,K6=yo,q6="[object String]";function G6(e){return typeof e=="string"||!W6(e)&&K6(e)&&V6(e)==q6}var X6=G6;const xs=Qe(X6);var U$={exports:{}},Je={};/**
68
68
  * @license React
69
69
  * react-is.production.min.js
70
70
  *
@@ -83,7 +83,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
83
83
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
84
84
  height and width.`,N,I,a,l,c,f,n);var B=!Array.isArray(h)&&Gi(h.type).endsWith("Chart");return D.Children.map(h,function(k){return D.isValidElement(k)?O.cloneElement(k,pp({width:N,height:I},B?{style:pp({height:"100%",width:"100%",maxHeight:I,maxWidth:N},k.props.style)}:{})):k})},[n,h,l,p,f,c,A,a]);return D.createElement("div",{id:x?"".concat(x):void 0,className:Ae("recharts-responsive-container",g),style:pp(pp({},S),{},{width:a,height:l,minWidth:c,minHeight:f,maxHeight:p}),ref:w},_)}),Hu=function(t){return null};Hu.displayName="Cell";function _f(e){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_f(e)}function YE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(n),!0).forEach(function(r){HZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HZ(e,t,n){return t=VZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VZ(e){var t=WZ(e,"string");return _f(t)=="symbol"?t:t+""}function WZ(e,t){if(_f(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_f(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ws={widthCache:{},cacheCount:0},KZ=2e3,qZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},QE="recharts_measurement_span";function GZ(e){var t=Zb({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Gc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Oa.isSsr)return{width:0,height:0};var r=GZ(n),i=JSON.stringify({text:t,copyStyle:r});if(Ws.widthCache[i])return Ws.widthCache[i];try{var o=document.getElementById(QE);o||(o=document.createElement("span"),o.setAttribute("id",QE),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Zb(Zb({},qZ),r);Object.assign(o.style,a),o.textContent="".concat(t);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Ws.widthCache[i]=l,++Ws.cacheCount>KZ&&(Ws.cacheCount=0,Ws.widthCache={}),l}catch{return{width:0,height:0}}},XZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function Qh(e,t){return ZZ(e)||JZ(e,t)||QZ(e,t)||YZ()}function YZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
85
85
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QZ(e,t){if(e){if(typeof e=="string")return JE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JE(e,t)}}function JE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function ZZ(e){if(Array.isArray(e))return e}function eee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nee(r.key),r)}}function tee(e,t,n){return t&&ZE(e.prototype,t),n&&ZE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nee(e){var t=ree(e,"string");return Rf(t)=="symbol"?t:t+""}function ree(e,t){if(Rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var eA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,iee=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,oee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,qM={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},aee=Object.keys(qM),ll="NaN";function see(e,t){return e*qM[t]}var hp=function(){function e(t,n){eee(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!iee.test(n)&&(this.num=NaN,this.unit=""),aee.includes(n)&&(this.num=see(t,n),this.unit="px")}return tee(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=oee.exec(n))!==null&&r!==void 0?r:[],o=Qh(i,3),a=o[1],s=o[2];return new e(parseFloat(a),s??"")}}])}();function GM(e){if(e.includes(ll))return ll;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=eA.exec(t))!==null&&n!==void 0?n:[],i=Qh(r,4),o=i[1],a=i[2],s=i[3],l=hp.parse(o??""),u=hp.parse(s??""),c=a==="*"?l.multiply(u):l.divide(u);if(c.isNaN())return ll;t=t.replace(eA,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,p=(f=tA.exec(t))!==null&&f!==void 0?f:[],h=Qh(p,4),v=h[1],y=h[2],x=h[3],g=hp.parse(v??""),m=hp.parse(x??""),b=y==="+"?g.add(m):g.subtract(m);if(b.isNaN())return ll;t=t.replace(tA,b.toString())}return t}var nA=/\(([^()]*)\)/;function lee(e){for(var t=e;t.includes("(");){var n=nA.exec(t),r=Qh(n,2),i=r[1];t=t.replace(nA,GM(i))}return t}function uee(e){var t=e.replace(/\s+/g,"");return t=lee(t),t=GM(t),t}function cee(e){try{return uee(e)}catch{return ll}}function _v(e){var t=cee(e.slice(5,-1));return t===ll?"":t}var fee=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],dee=["dx","dy","angle","className","breakAll"];function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e0.apply(this,arguments)}function rA(e,t){if(e==null)return{};var n=pee(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function iA(e,t){return yee(e)||gee(e,t)||mee(e,t)||hee()}function hee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
86
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mee(e,t){if(e){if(typeof e=="string")return oA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oA(e,t)}}function oA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function yee(e){if(Array.isArray(e))return e}var XM=/[ \f\n\r\t\v\u2028\u2029]+/,YM=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];_e(n)||(r?o=n.toString().split(""):o=n.toString().split(XM));var a=o.map(function(l){return{word:l,width:Gc(l,i).width}}),s=r?0:Gc(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}},vee=function(t,n,r,i,o){var a=t.maxLines,s=t.children,l=t.style,u=t.breakAll,c=ne(a),f=s,p=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return N.reduce(function(I,B){var k=B.word,L=B.width,M=I[I.length-1];if(M&&(i==null||o||M.width+L+r<Number(i)))M.words.push(k),M.width+=L+r;else{var z={words:[k],width:L};I.push(z)}return I},[])},h=p(n),v=function(N){return N.reduce(function(I,B){return I.width>B.width?I:B})};if(!c)return h;for(var y="…",x=function(N){var I=f.slice(0,N),B=YM({breakAll:u,style:l,children:I+y}).wordsWithComputedWidth,k=p(B),L=k.length>a||v(k).width>Number(i);return[L,k]},g=0,m=f.length-1,b=0,S;g<=m&&b<=f.length-1;){var w=Math.floor((g+m)/2),P=w-1,j=x(P),E=iA(j,2),A=E[0],C=E[1],T=x(w),_=iA(T,1),R=_[0];if(!A&&!R&&(g=w+1),A&&R&&(m=w-1),!A&&R){S=C;break}b++}return S||h},aA=function(t){var n=_e(t)?[]:t.toString().split(XM);return[{words:n}]},xee=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,a=t.breakAll,s=t.maxLines;if((n||r)&&!Oa.isSsr){var l,u,c=YM({breakAll:a,children:i,style:o});if(c){var f=c.wordsWithComputedWidth,p=c.spaceWidth;l=f,u=p}else return aA(i);return vee({breakAll:a,children:i,maxLines:s,style:o},l,u,n,r)}return aA(i)},sA="#808080",bs=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,a=t.lineHeight,s=a===void 0?"1em":a,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,p=t.textAnchor,h=p===void 0?"start":p,v=t.verticalAnchor,y=v===void 0?"end":v,x=t.fill,g=x===void 0?sA:x,m=rA(t,fee),b=O.useMemo(function(){return xee({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:f,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,f,m.style,m.width]),S=m.dx,w=m.dy,P=m.angle,j=m.className,E=m.breakAll,A=rA(m,dee);if(!Wt(r)||!Wt(o))return null;var C=r+(ne(S)?S:0),T=o+(ne(w)?w:0),_;switch(y){case"start":_=_v("calc(".concat(u,")"));break;case"middle":_=_v("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:_=_v("calc(".concat(b.length-1," * -").concat(s,")"));break}var R=[];if(f){var $=b[0].width,N=m.width;R.push("scale(".concat((ne(N)?N/$:1)/$,")"))}return P&&R.push("rotate(".concat(P,", ").concat(C,", ").concat(T,")")),R.length&&(A.transform=R.join(" ")),D.createElement("text",e0({},ve(A,!0),{x:C,y:T,className:Ae("recharts-text",j),textAnchor:h,fill:g.includes("url")?sA:g}),b.map(function(I,B){var k=I.words.join(E?"":" ");return D.createElement("tspan",{x:C,dy:B===0?_:s,key:"".concat(k,"-").concat(B)},k)}))};function oa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function w1(e){let t,n,r;e.length!==2?(t=oa,n=(s,l)=>oa(e(s),l),r=(s,l)=>e(s)-l):(t=e===oa||e===bee?e:wee,n=e,r=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function wee(){return 0}function QM(e){return e===null?NaN:+e}function*See(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Oee=w1(oa),jd=Oee.right;w1(QM).center;class lA extends Map{constructor(t,n=Eee){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(uA(this,t))}has(t){return super.has(uA(this,t))}set(t,n){return super.set(Pee(this,t),n)}delete(t){return super.delete(jee(this,t))}}function uA({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Pee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Eee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Aee(e=oa){if(e===oa)return JM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function JM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Cee=Math.sqrt(50),Tee=Math.sqrt(10),_ee=Math.sqrt(2);function Jh(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Cee?10:o>=Tee?5:o>=_ee?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?Jh(e,t,n*2):[s,l,u]}function t0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?Jh(t,e,n):Jh(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function n0(e,t,n){return t=+t,e=+e,n=+n,Jh(e,t,n)[2]}function r0(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?n0(t,e,n):n0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function cA(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function fA(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function ZM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?JM:Aee(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/l+p)),v=Math.min(r,Math.floor(t+(l-u)*f/l+p));ZM(e,t,h,v,i)}const o=e[t];let a=n,s=r;for(gc(e,n,t),i(e[r],o)>0&&gc(e,n,r);a<s;){for(gc(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?gc(e,n,s):(++s,gc(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function gc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ree(e,t,n){if(e=Float64Array.from(See(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return fA(e);if(t>=1)return cA(e);var r,i=(r-1)*t,o=Math.floor(i),a=cA(ZM(e,o).subarray(0,o+1)),s=fA(e.subarray(o+1));return a+(s-a)*(i-o)}}function kee(e,t,n=QM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function Nee(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function $r(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function vo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const i0=Symbol("implicit");function S1(){var e=new lA,t=[],n=[],r=i0;function i(o){let a=e.get(o);if(a===void 0){if(r!==i0)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new lA;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return S1(t,n).unknown(r)},$r.apply(i,arguments),i}function kf(){var e=S1().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete e.unknown;function f(){var p=t().length,h=i<r,v=h?i:r,y=h?r:i;o=(y-v)/Math.max(1,p-l+u*2),s&&(o=Math.floor(o)),v+=(y-v-o*(p-l))*c,a=o*(1-l),s&&(v=Math.round(v),a=Math.round(a));var x=Nee(p).map(function(g){return v+o*g});return n(h?x.reverse():x)}return e.domain=function(p){return arguments.length?(t(p),f()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,s=!0,f()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(p){return arguments.length?(s=!!p,f()):s},e.padding=function(p){return arguments.length?(l=Math.min(1,u=+p),f()):l},e.paddingInner=function(p){return arguments.length?(l=Math.min(1,p),f()):l},e.paddingOuter=function(p){return arguments.length?(u=+p,f()):u},e.align=function(p){return arguments.length?(c=Math.max(0,Math.min(1,p)),f()):c},e.copy=function(){return kf(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},$r.apply(f(),arguments)}function eI(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return eI(t())},e}function Xc(){return eI(kf.apply(null,arguments).paddingInner(1))}function O1(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ed(){}var Nf=.7,Zh=1/Nf,wl="\\s*([+-]?\\d+)\\s*",$f="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$ee=/^#([0-9a-f]{3,8})$/,Mee=new RegExp(`^rgb\\(${wl},${wl},${wl}\\)$`),Iee=new RegExp(`^rgb\\(${vi},${vi},${vi}\\)$`),Dee=new RegExp(`^rgba\\(${wl},${wl},${wl},${$f}\\)$`),Lee=new RegExp(`^rgba\\(${vi},${vi},${vi},${$f}\\)$`),Fee=new RegExp(`^hsl\\(${$f},${vi},${vi}\\)$`),Bee=new RegExp(`^hsla\\(${$f},${vi},${vi},${$f}\\)$`),dA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};O1(Ed,Mf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pA,formatHex:pA,formatHex8:Uee,formatHsl:zee,formatRgb:hA,toString:hA});function pA(){return this.rgb().formatHex()}function Uee(){return this.rgb().formatHex8()}function zee(){return nI(this).formatHsl()}function hA(){return this.rgb().formatRgb()}function Mf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=$ee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mA(t):n===3?new Gn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?mp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?mp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Mee.exec(e))?new Gn(t[1],t[2],t[3],1):(t=Iee.exec(e))?new Gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dee.exec(e))?mp(t[1],t[2],t[3],t[4]):(t=Lee.exec(e))?mp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fee.exec(e))?vA(t[1],t[2]/100,t[3]/100,1):(t=Bee.exec(e))?vA(t[1],t[2]/100,t[3]/100,t[4]):dA.hasOwnProperty(e)?mA(dA[e]):e==="transparent"?new Gn(NaN,NaN,NaN,0):null}function mA(e){return new Gn(e>>16&255,e>>8&255,e&255,1)}function mp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Gn(e,t,n,r)}function Hee(e){return e instanceof Ed||(e=Mf(e)),e?(e=e.rgb(),new Gn(e.r,e.g,e.b,e.opacity)):new Gn}function o0(e,t,n,r){return arguments.length===1?Hee(e):new Gn(e,t,n,r??1)}function Gn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}O1(Gn,o0,tI(Ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new Gn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nf:Math.pow(Nf,e),new Gn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Gn(us(this.r),us(this.g),us(this.b),em(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gA,formatHex:gA,formatHex8:Vee,formatRgb:yA,toString:yA}));function gA(){return`#${Ka(this.r)}${Ka(this.g)}${Ka(this.b)}`}function Vee(){return`#${Ka(this.r)}${Ka(this.g)}${Ka(this.b)}${Ka((isNaN(this.opacity)?1:this.opacity)*255)}`}function yA(){const e=em(this.opacity);return`${e===1?"rgb(":"rgba("}${us(this.r)}, ${us(this.g)}, ${us(this.b)}${e===1?")":`, ${e})`}`}function em(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function us(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ka(e){return e=us(e),(e<16?"0":"")+e.toString(16)}function vA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wr(e,t,n,r)}function nI(e){if(e instanceof Wr)return new Wr(e.h,e.s,e.l,e.opacity);if(e instanceof Ed||(e=Mf(e)),!e)return new Wr;if(e instanceof Wr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Wr(a,s,l,e.opacity)}function Wee(e,t,n,r){return arguments.length===1?nI(e):new Wr(e,t,n,r??1)}function Wr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}O1(Wr,Wee,tI(Ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new Wr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nf:Math.pow(Nf,e),new Wr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Gn(Rv(e>=240?e-240:e+120,i,r),Rv(e,i,r),Rv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Wr(xA(this.h),gp(this.s),gp(this.l),em(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=em(this.opacity);return`${e===1?"hsl(":"hsla("}${xA(this.h)}, ${gp(this.s)*100}%, ${gp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xA(e){return e=(e||0)%360,e<0?e+360:e}function gp(e){return Math.max(0,Math.min(1,e||0))}function Rv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const P1=e=>()=>e;function Kee(e,t){return function(n){return e+n*t}}function qee(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Gee(e){return(e=+e)==1?rI:function(t,n){return n-t?qee(t,n,e):P1(isNaN(t)?n:t)}}function rI(e,t){var n=t-e;return n?Kee(e,n):P1(isNaN(e)?t:e)}const bA=function e(t){var n=Gee(t);function r(i,o){var a=n((i=o0(i)).r,(o=o0(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=rI(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function Xee(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function Yee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Qee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Vu(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function Jee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Zee(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Vu(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var a0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kv=new RegExp(a0.source,"g");function ete(e){return function(){return e}}function tte(e){return function(t){return e(t)+""}}function nte(e,t){var n=a0.lastIndex=kv.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=a0.exec(e))&&(i=kv.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:tm(r,i)})),n=kv.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?tte(l[0].x):ete(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function Vu(e,t){var n=typeof t,r;return t==null||n==="boolean"?P1(t):(n==="number"?tm:n==="string"?(r=Mf(t))?(t=r,bA):nte:t instanceof Mf?bA:t instanceof Date?Jee:Yee(t)?Xee:Array.isArray(t)?Qee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Zee:tm)(e,t)}function j1(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function rte(e,t){t===void 0&&(t=e,e=Vu);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function ite(e){return function(){return e}}function nm(e){return+e}var wA=[0,1];function Dn(e){return e}function s0(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ite(isNaN(t)?NaN:.5)}function ote(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ate(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=s0(i,r),o=n(a,o)):(r=s0(r,i),o=n(o,a)),function(s){return o(r(s))}}function ste(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=s0(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=jd(e,s,1,r)-1;return o[l](i[l](s))}}function Ad(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Gg(){var e=wA,t=wA,n=Vu,r,i,o,a=Dn,s,l,u;function c(){var p=Math.min(e.length,t.length);return a!==Dn&&(a=ote(e[0],e[p-1])),s=p>2?ste:ate,l=u=null,f}function f(p){return p==null||isNaN(p=+p)?o:(l||(l=s(e.map(r),t,n)))(r(a(p)))}return f.invert=function(p){return a(i((u||(u=s(t,e.map(r),tm)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,nm),c()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),c()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),n=j1,c()},f.clamp=function(p){return arguments.length?(a=p?!0:Dn,c()):a!==Dn},f.interpolate=function(p){return arguments.length?(n=p,c()):n},f.unknown=function(p){return arguments.length?(o=p,f):o},function(p,h){return r=p,i=h,c()}}function E1(){return Gg()(Dn,Dn)}function lte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function rm(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function eu(e){return e=rm(Math.abs(e)),e?e[1]:NaN}function ute(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function cte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function If(e){if(!(t=fte.exec(e)))throw new Error("invalid format: "+e);var t;return new A1({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}If.prototype=A1.prototype;function A1(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}A1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function dte(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var im;function pte(e,t){var n=rm(e,t);if(!n)return im=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(im=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+rm(e,Math.max(0,t+o-1))[0]}function SA(e,t){var n=rm(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const OA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lte,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>SA(e*100,t),r:SA,s:pte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PA(e){return e}var jA=Array.prototype.map,EA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hte(e){var t=e.grouping===void 0||e.thousands===void 0?PA:ute(jA.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?PA:cte(jA.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,p){f=If(f);var h=f.fill,v=f.align,y=f.sign,x=f.symbol,g=f.zero,m=f.width,b=f.comma,S=f.precision,w=f.trim,P=f.type;P==="n"?(b=!0,P="g"):OA[P]||(S===void 0&&(S=12),w=!0,P="g"),(g||h==="0"&&v==="=")&&(g=!0,h="0",v="=");var j=(p&&p.prefix!==void 0?p.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),E=(x==="$"?r:/[%p]/.test(P)?a:"")+(p&&p.suffix!==void 0?p.suffix:""),A=OA[P],C=/[defgprs%]/.test(P);S=S===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(_){var R=j,$=E,N,I,B;if(P==="c")$=A(_)+$,_="";else{_=+_;var k=_<0||1/_<0;if(_=isNaN(_)?l:A(Math.abs(_),S),w&&(_=dte(_)),k&&+_==0&&y!=="+"&&(k=!1),R=(k?y==="("?y:s:y==="-"||y==="("?"":y)+R,$=(P==="s"&&!isNaN(_)&&im!==void 0?EA[8+im/3]:"")+$+(k&&y==="("?")":""),C){for(N=-1,I=_.length;++N<I;)if(B=_.charCodeAt(N),48>B||B>57){$=(B===46?i+_.slice(N+1):_.slice(N))+$,_=_.slice(0,N);break}}}b&&!g&&(_=t(_,1/0));var L=R.length+_.length+$.length,M=L<m?new Array(m-L+1).join(h):"";switch(b&&g&&(_=t(M+_,M.length?m-$.length:1/0),M=""),v){case"<":_=R+_+$+M;break;case"=":_=R+M+_+$;break;case"^":_=M.slice(0,L=M.length>>1)+R+_+$+M.slice(L);break;default:_=M+R+_+$;break}return o(_)}return T.toString=function(){return f+""},T}function c(f,p){var h=Math.max(-8,Math.min(8,Math.floor(eu(p)/3)))*3,v=Math.pow(10,-h),y=u((f=If(f),f.type="f",f),{suffix:EA[8+h/3]});return function(x){return y(v*x)}}return{format:u,formatPrefix:c}}var yp,C1,iI;mte({thousands:",",grouping:[3],currency:["$",""]});function mte(e){return yp=hte(e),C1=yp.format,iI=yp.formatPrefix,yp}function gte(e){return Math.max(0,-eu(Math.abs(e)))}function yte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(eu(t)/3)))*3-eu(Math.abs(e)))}function vte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,eu(t)-eu(e))+1}function oI(e,t,n,r){var i=r0(e,t,n),o;switch(r=If(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=yte(i,a))&&(r.precision=o),iI(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=vte(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=gte(i))&&(r.precision=o-(r.type==="%")*2);break}}return C1(r)}function Pa(e){var t=e.domain;return e.ticks=function(n){var r=t();return t0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return oI(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=n0(a,s,n),u===l)return r[i]=a,r[o]=s,t(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function om(){var e=E1();return e.copy=function(){return Ad(e,om())},$r.apply(e,arguments),Pa(e)}function aI(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,nm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return aI(e).unknown(t)},e=arguments.length?Array.from(e,nm):[0,1],Pa(n)}function sI(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),e[n]=t.floor(i),e[r]=t.ceil(o),e}function AA(e){return Math.log(e)}function CA(e){return Math.exp(e)}function xte(e){return-Math.log(-e)}function bte(e){return-Math.exp(-e)}function wte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ste(e){return e===10?wte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ote(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function TA(e){return(t,n)=>-e(-t,n)}function T1(e){const t=e(AA,CA),n=t.domain;let r=10,i,o;function a(){return i=Ote(r),o=Ste(r),n()[0]<0?(i=TA(i),o=TA(o),e(xte,bte)):e(AA,CA),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const l=n();let u=l[0],c=l[l.length-1];const f=c<u;f&&([u,c]=[c,u]);let p=i(u),h=i(c),v,y;const x=s==null?10:+s;let g=[];if(!(r%1)&&h-p<x){if(p=Math.floor(p),h=Math.ceil(h),u>0){for(;p<=h;++p)for(v=1;v<r;++v)if(y=p<0?v/o(-p):v*o(p),!(y<u)){if(y>c)break;g.push(y)}}else for(;p<=h;++p)for(v=r-1;v>=1;--v)if(y=p>0?v/o(-p):v*o(p),!(y<u)){if(y>c)break;g.push(y)}g.length*2<x&&(g=t0(u,c,x))}else g=t0(p,h,Math.min(h-p,x)).map(o);return f?g.reverse():g},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=If(l)).precision==null&&(l.trim=!0),l=C1(l)),s===1/0)return l;const u=Math.max(1,r*s/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=u?l(c):""}},t.nice=()=>n(sI(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function lI(){const e=T1(Gg()).domain([1,10]);return e.copy=()=>Ad(e,lI()).base(e.base()),$r.apply(e,arguments),e}function _A(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function RA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function _1(e){var t=1,n=e(_A(t),RA(t));return n.constant=function(r){return arguments.length?e(_A(t=+r),RA(t)):t},Pa(n)}function uI(){var e=_1(Gg());return e.copy=function(){return Ad(e,uI()).constant(e.constant())},$r.apply(e,arguments)}function kA(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Pte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jte(e){return e<0?-e*e:e*e}function R1(e){var t=e(Dn,Dn),n=1;function r(){return n===1?e(Dn,Dn):n===.5?e(Pte,jte):e(kA(n),kA(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Pa(t)}function k1(){var e=R1(Gg());return e.copy=function(){return Ad(e,k1()).exponent(e.exponent())},$r.apply(e,arguments),e}function Ete(){return k1.apply(null,arguments).exponent(.5)}function NA(e){return Math.sign(e)*e*e}function Ate(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cI(){var e=E1(),t=[0,1],n=!1,r;function i(o){var a=Ate(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(NA(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,nm)).map(NA)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return cI(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$r.apply(i,arguments),Pa(i)}function fI(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a<s;)n[a-1]=kee(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[jd(n,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(oa),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return fI().domain(e).range(t).unknown(r)},$r.apply(o,arguments)}function dI(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[jd(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return dI().domain([e,t]).range(i).unknown(o)},$r.apply(Pa(a),arguments)}function pI(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[jd(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return pI().domain(e).range(t).unknown(n)},$r.apply(i,arguments)}const Nv=new Date,$v=new Date;function Kt(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return l;let u;do l.push(u=new Date(+o)),t(o,s),e(o);while(u<o&&o<a);return l},i.filter=o=>Kt(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(Nv.setTime(+o),$v.setTime(+a),e(Nv),e($v),Math.floor(n(Nv,$v))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const am=Kt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);am.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):am);am.range;const Hi=1e3,jr=Hi*60,Vi=jr*60,io=Vi*24,N1=io*7,$A=io*30,Mv=io*365,qa=Kt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getUTCSeconds());qa.range;const $1=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi)},(e,t)=>{e.setTime(+e+t*jr)},(e,t)=>(t-e)/jr,e=>e.getMinutes());$1.range;const M1=Kt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jr)},(e,t)=>(t-e)/jr,e=>e.getUTCMinutes());M1.range;const I1=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi-e.getMinutes()*jr)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getHours());I1.range;const D1=Kt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCHours());D1.range;const Cd=Kt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jr)/io,e=>e.getDate()-1);Cd.range;const Xg=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/io,e=>e.getUTCDate()-1);Xg.range;const hI=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/io,e=>Math.floor(e/io));hI.range;function Ls(e){return Kt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*jr)/N1)}const Yg=Ls(0),sm=Ls(1),Cte=Ls(2),Tte=Ls(3),tu=Ls(4),_te=Ls(5),Rte=Ls(6);Yg.range;sm.range;Cte.range;Tte.range;tu.range;_te.range;Rte.range;function Fs(e){return Kt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/N1)}const Qg=Fs(0),lm=Fs(1),kte=Fs(2),Nte=Fs(3),nu=Fs(4),$te=Fs(5),Mte=Fs(6);Qg.range;lm.range;kte.range;Nte.range;nu.range;$te.range;Mte.range;const L1=Kt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());L1.range;const F1=Kt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());F1.range;const oo=Kt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());oo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});oo.range;const ao=Kt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ao.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ao.range;function mI(e,t,n,r,i,o){const a=[[qa,1,Hi],[qa,5,5*Hi],[qa,15,15*Hi],[qa,30,30*Hi],[o,1,jr],[o,5,5*jr],[o,15,15*jr],[o,30,30*jr],[i,1,Vi],[i,3,3*Vi],[i,6,6*Vi],[i,12,12*Vi],[r,1,io],[r,2,2*io],[n,1,N1],[t,1,$A],[t,3,3*$A],[e,1,Mv]];function s(u,c,f){const p=c<u;p&&([u,c]=[c,u]);const h=f&&typeof f.range=="function"?f:l(u,c,f),v=h?h.range(u,+c+1):[];return p?v.reverse():v}function l(u,c,f){const p=Math.abs(c-u)/f,h=w1(([,,x])=>x).right(a,p);if(h===a.length)return e.every(r0(u/Mv,c/Mv,f));if(h===0)return am.every(Math.max(r0(u,c,f),1));const[v,y]=a[p/a[h-1][2]<a[h][2]/p?h-1:h];return v.every(y)}return[s,l]}const[Ite,Dte]=mI(ao,F1,Qg,hI,D1,M1),[Lte,Fte]=mI(oo,L1,Yg,Cd,I1,$1);function Iv(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Dv(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function yc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Bte(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=vc(i),c=xc(i),f=vc(o),p=xc(o),h=vc(a),v=xc(a),y=vc(s),x=xc(s),g=vc(l),m=xc(l),b={a:B,A:k,b:L,B:M,c:null,d:BA,e:BA,f:une,g:xne,G:wne,H:ane,I:sne,j:lne,L:gI,m:cne,M:fne,p:z,q:U,Q:HA,s:VA,S:dne,u:pne,U:hne,V:mne,w:gne,W:yne,x:null,X:null,y:vne,Y:bne,Z:Sne,"%":zA},S={a:V,A:W,b:Q,B:G,c:null,d:UA,e:UA,f:Ene,g:Ine,G:Lne,H:One,I:Pne,j:jne,L:vI,m:Ane,M:Cne,p:le,q:X,Q:HA,s:VA,S:Tne,u:_ne,U:Rne,V:kne,w:Nne,W:$ne,x:null,X:null,y:Mne,Y:Dne,Z:Fne,"%":zA},w={a:C,A:T,b:_,B:R,c:$,d:LA,e:LA,f:nne,g:DA,G:IA,H:FA,I:FA,j:Jte,L:tne,m:Qte,M:Zte,p:A,q:Yte,Q:ine,s:one,S:ene,u:Wte,U:Kte,V:qte,w:Vte,W:Gte,x:N,X:I,y:DA,Y:IA,Z:Xte,"%":rne};b.x=P(n,b),b.X=P(r,b),b.c=P(t,b),S.x=P(n,S),S.X=P(r,S),S.c=P(t,S);function P(K,ee){return function(ie){var H=[],Z=-1,J=0,se=K.length,we,ae,be;for(ie instanceof Date||(ie=new Date(+ie));++Z<se;)K.charCodeAt(Z)===37&&(H.push(K.slice(J,Z)),(ae=MA[we=K.charAt(++Z)])!=null?we=K.charAt(++Z):ae=we==="e"?" ":"0",(be=ee[we])&&(we=be(ie,ae)),H.push(we),J=Z+1);return H.push(K.slice(J,Z)),H.join("")}}function j(K,ee){return function(ie){var H=yc(1900,void 0,1),Z=E(H,K,ie+="",0),J,se;if(Z!=ie.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(ee&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(J=Dv(yc(H.y,0,1)),se=J.getUTCDay(),J=se>4||se===0?lm.ceil(J):lm(J),J=Xg.offset(J,(H.V-1)*7),H.y=J.getUTCFullYear(),H.m=J.getUTCMonth(),H.d=J.getUTCDate()+(H.w+6)%7):(J=Iv(yc(H.y,0,1)),se=J.getDay(),J=se>4||se===0?sm.ceil(J):sm(J),J=Cd.offset(J,(H.V-1)*7),H.y=J.getFullYear(),H.m=J.getMonth(),H.d=J.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),se="Z"in H?Dv(yc(H.y,0,1)).getUTCDay():Iv(yc(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(se+5)%7:H.w+H.U*7-(se+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,Dv(H)):Iv(H)}}function E(K,ee,ie,H){for(var Z=0,J=ee.length,se=ie.length,we,ae;Z<J;){if(H>=se)return-1;if(we=ee.charCodeAt(Z++),we===37){if(we=ee.charAt(Z++),ae=w[we in MA?ee.charAt(Z++):we],!ae||(H=ae(K,ie,H))<0)return-1}else if(we!=ie.charCodeAt(H++))return-1}return H}function A(K,ee,ie){var H=u.exec(ee.slice(ie));return H?(K.p=c.get(H[0].toLowerCase()),ie+H[0].length):-1}function C(K,ee,ie){var H=h.exec(ee.slice(ie));return H?(K.w=v.get(H[0].toLowerCase()),ie+H[0].length):-1}function T(K,ee,ie){var H=f.exec(ee.slice(ie));return H?(K.w=p.get(H[0].toLowerCase()),ie+H[0].length):-1}function _(K,ee,ie){var H=g.exec(ee.slice(ie));return H?(K.m=m.get(H[0].toLowerCase()),ie+H[0].length):-1}function R(K,ee,ie){var H=y.exec(ee.slice(ie));return H?(K.m=x.get(H[0].toLowerCase()),ie+H[0].length):-1}function $(K,ee,ie){return E(K,t,ee,ie)}function N(K,ee,ie){return E(K,n,ee,ie)}function I(K,ee,ie){return E(K,r,ee,ie)}function B(K){return a[K.getDay()]}function k(K){return o[K.getDay()]}function L(K){return l[K.getMonth()]}function M(K){return s[K.getMonth()]}function z(K){return i[+(K.getHours()>=12)]}function U(K){return 1+~~(K.getMonth()/3)}function V(K){return a[K.getUTCDay()]}function W(K){return o[K.getUTCDay()]}function Q(K){return l[K.getUTCMonth()]}function G(K){return s[K.getUTCMonth()]}function le(K){return i[+(K.getUTCHours()>=12)]}function X(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var ee=P(K+="",b);return ee.toString=function(){return K},ee},parse:function(K){var ee=j(K+="",!1);return ee.toString=function(){return K},ee},utcFormat:function(K){var ee=P(K+="",S);return ee.toString=function(){return K},ee},utcParse:function(K){var ee=j(K+="",!0);return ee.toString=function(){return K},ee}}}var MA={"-":"",_:" ",0:"0"},en=/^\s*\d+/,Ute=/^%/,zte=/[\\^$*+?|[\]().{}]/g;function We(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Hte(e){return e.replace(zte,"\\$&")}function vc(e){return new RegExp("^(?:"+e.map(Hte).join("|")+")","i")}function xc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Vte(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Wte(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Kte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function qte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Gte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function IA(e,t,n){var r=en.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function DA(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xte(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Yte(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Qte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function LA(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Jte(e,t,n){var r=en.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function FA(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Zte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ene(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function tne(e,t,n){var r=en.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function nne(e,t,n){var r=en.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function rne(e,t,n){var r=Ute.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ine(e,t,n){var r=en.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function one(e,t,n){var r=en.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function BA(e,t){return We(e.getDate(),t,2)}function ane(e,t){return We(e.getHours(),t,2)}function sne(e,t){return We(e.getHours()%12||12,t,2)}function lne(e,t){return We(1+Cd.count(oo(e),e),t,3)}function gI(e,t){return We(e.getMilliseconds(),t,3)}function une(e,t){return gI(e,t)+"000"}function cne(e,t){return We(e.getMonth()+1,t,2)}function fne(e,t){return We(e.getMinutes(),t,2)}function dne(e,t){return We(e.getSeconds(),t,2)}function pne(e){var t=e.getDay();return t===0?7:t}function hne(e,t){return We(Yg.count(oo(e)-1,e),t,2)}function yI(e){var t=e.getDay();return t>=4||t===0?tu(e):tu.ceil(e)}function mne(e,t){return e=yI(e),We(tu.count(oo(e),e)+(oo(e).getDay()===4),t,2)}function gne(e){return e.getDay()}function yne(e,t){return We(sm.count(oo(e)-1,e),t,2)}function vne(e,t){return We(e.getFullYear()%100,t,2)}function xne(e,t){return e=yI(e),We(e.getFullYear()%100,t,2)}function bne(e,t){return We(e.getFullYear()%1e4,t,4)}function wne(e,t){var n=e.getDay();return e=n>=4||n===0?tu(e):tu.ceil(e),We(e.getFullYear()%1e4,t,4)}function Sne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+We(t/60|0,"0",2)+We(t%60,"0",2)}function UA(e,t){return We(e.getUTCDate(),t,2)}function One(e,t){return We(e.getUTCHours(),t,2)}function Pne(e,t){return We(e.getUTCHours()%12||12,t,2)}function jne(e,t){return We(1+Xg.count(ao(e),e),t,3)}function vI(e,t){return We(e.getUTCMilliseconds(),t,3)}function Ene(e,t){return vI(e,t)+"000"}function Ane(e,t){return We(e.getUTCMonth()+1,t,2)}function Cne(e,t){return We(e.getUTCMinutes(),t,2)}function Tne(e,t){return We(e.getUTCSeconds(),t,2)}function _ne(e){var t=e.getUTCDay();return t===0?7:t}function Rne(e,t){return We(Qg.count(ao(e)-1,e),t,2)}function xI(e){var t=e.getUTCDay();return t>=4||t===0?nu(e):nu.ceil(e)}function kne(e,t){return e=xI(e),We(nu.count(ao(e),e)+(ao(e).getUTCDay()===4),t,2)}function Nne(e){return e.getUTCDay()}function $ne(e,t){return We(lm.count(ao(e)-1,e),t,2)}function Mne(e,t){return We(e.getUTCFullYear()%100,t,2)}function Ine(e,t){return e=xI(e),We(e.getUTCFullYear()%100,t,2)}function Dne(e,t){return We(e.getUTCFullYear()%1e4,t,4)}function Lne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?nu(e):nu.ceil(e),We(e.getUTCFullYear()%1e4,t,4)}function Fne(){return"+0000"}function zA(){return"%"}function HA(e){return+e}function VA(e){return Math.floor(+e/1e3)}var Ks,bI,wI;Bne({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Bne(e){return Ks=Bte(e),bI=Ks.format,Ks.parse,wI=Ks.utcFormat,Ks.utcParse,Ks}function Une(e){return new Date(e)}function zne(e){return e instanceof Date?+e:+new Date(+e)}function B1(e,t,n,r,i,o,a,s,l,u){var c=E1(),f=c.invert,p=c.domain,h=u(".%L"),v=u(":%S"),y=u("%I:%M"),x=u("%I %p"),g=u("%a %d"),m=u("%b %d"),b=u("%B"),S=u("%Y");function w(P){return(l(P)<P?h:s(P)<P?v:a(P)<P?y:o(P)<P?x:r(P)<P?i(P)<P?g:m:n(P)<P?b:S)(P)}return c.invert=function(P){return new Date(f(P))},c.domain=function(P){return arguments.length?p(Array.from(P,zne)):p().map(Une)},c.ticks=function(P){var j=p();return e(j[0],j[j.length-1],P??10)},c.tickFormat=function(P,j){return j==null?w:u(j)},c.nice=function(P){var j=p();return(!P||typeof P.range!="function")&&(P=t(j[0],j[j.length-1],P??10)),P?p(sI(j,P)):c},c.copy=function(){return Ad(c,B1(e,t,n,r,i,o,a,s,l,u))},c}function Hne(){return $r.apply(B1(Lte,Fte,oo,L1,Yg,Cd,I1,$1,qa,bI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Vne(){return $r.apply(B1(Ite,Dte,ao,F1,Qg,Xg,D1,M1,qa,wI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Jg(){var e=0,t=1,n,r,i,o,a=Dn,s=!1,l;function u(f){return f==null||isNaN(f=+f)?l:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(s=!!f,u):s},u.interpolator=function(f){return arguments.length?(a=f,u):a};function c(f){return function(p){var h,v;return arguments.length?([h,v]=p,a=f(h,v),u):[a(0),a(1)]}}return u.range=c(Vu),u.rangeRound=c(j1),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function ja(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function SI(){var e=Pa(Jg()(Dn));return e.copy=function(){return ja(e,SI())},vo.apply(e,arguments)}function OI(){var e=T1(Jg()).domain([1,10]);return e.copy=function(){return ja(e,OI()).base(e.base())},vo.apply(e,arguments)}function PI(){var e=_1(Jg());return e.copy=function(){return ja(e,PI()).constant(e.constant())},vo.apply(e,arguments)}function U1(){var e=R1(Jg());return e.copy=function(){return ja(e,U1()).exponent(e.exponent())},vo.apply(e,arguments)}function Wne(){return U1.apply(null,arguments).exponent(.5)}function jI(){var e=[],t=Dn;function n(r){if(r!=null&&!isNaN(r=+r))return t((jd(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(oa),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Ree(e,o/r))},n.copy=function(){return jI(t).domain(e)},vo.apply(n,arguments)}function Zg(){var e=0,t=.5,n=1,r=1,i,o,a,s,l,u=Dn,c,f=!1,p;function h(y){return isNaN(y=+y)?p:(y=.5+((y=+c(y))-o)*(r*y<r*o?s:l),u(f?Math.max(0,Math.min(1,y)):y))}h.domain=function(y){return arguments.length?([e,t,n]=y,i=c(e=+e),o=c(t=+t),a=c(n=+n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,h):[e,t,n]},h.clamp=function(y){return arguments.length?(f=!!y,h):f},h.interpolator=function(y){return arguments.length?(u=y,h):u};function v(y){return function(x){var g,m,b;return arguments.length?([g,m,b]=x,u=rte(y,[g,m,b]),h):[u(0),u(.5),u(1)]}}return h.range=v(Vu),h.rangeRound=v(j1),h.unknown=function(y){return arguments.length?(p=y,h):p},function(y){return c=y,i=y(e),o=y(t),a=y(n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,h}}function EI(){var e=Pa(Zg()(Dn));return e.copy=function(){return ja(e,EI())},vo.apply(e,arguments)}function AI(){var e=T1(Zg()).domain([.1,1,10]);return e.copy=function(){return ja(e,AI()).base(e.base())},vo.apply(e,arguments)}function CI(){var e=_1(Zg());return e.copy=function(){return ja(e,CI()).constant(e.constant())},vo.apply(e,arguments)}function z1(){var e=R1(Zg());return e.copy=function(){return ja(e,z1()).exponent(e.exponent())},vo.apply(e,arguments)}function Kne(){return z1.apply(null,arguments).exponent(.5)}const WA=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:kf,scaleDiverging:EI,scaleDivergingLog:AI,scaleDivergingPow:z1,scaleDivergingSqrt:Kne,scaleDivergingSymlog:CI,scaleIdentity:aI,scaleImplicit:i0,scaleLinear:om,scaleLog:lI,scaleOrdinal:S1,scalePoint:Xc,scalePow:k1,scaleQuantile:fI,scaleQuantize:dI,scaleRadial:cI,scaleSequential:SI,scaleSequentialLog:OI,scaleSequentialPow:U1,scaleSequentialQuantile:jI,scaleSequentialSqrt:Wne,scaleSequentialSymlog:PI,scaleSqrt:Ete,scaleSymlog:uI,scaleThreshold:pI,scaleTime:Hne,scaleUtc:Vne,tickFormat:oI},Symbol.toStringTag,{value:"Module"}));var qne=Nu;function Gne(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(a!=null&&(s===void 0?a===a&&!qne(a):n(a,s)))var s=a,l=o}return l}var ey=Gne;function Xne(e,t){return e>t}var TI=Xne,Yne=ey,Qne=TI,Jne=zu;function Zne(e){return e&&e.length?Yne(e,Jne,Qne):void 0}var ere=Zne;const qo=Qe(ere);function tre(e,t){return e<t}var _I=tre,nre=ey,rre=_I,ire=zu;function ore(e){return e&&e.length?nre(e,ire,rre):void 0}var are=ore;const ty=Qe(are);var sre=n1,lre=ji,ure=FM,cre=Zn;function fre(e,t){var n=cre(e)?sre:ure;return n(e,lre(t))}var dre=fre,pre=DM,hre=dre;function mre(e,t){return pre(hre(e,t),1)}var gre=mre;const yre=Qe(gre);var vre=y1;function xre(e,t){return vre(e,t)}var bre=xre;const ws=Qe(bre);var Wu=1e9,wre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},V1,vt=!0,Rr="[DecimalError] ",cs=Rr+"Invalid argument: ",H1=Rr+"Exponent out of range: ",Ku=Math.floor,Fa=Math.pow,Sre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,or,Xt=1e7,ht=7,RI=9007199254740991,um=Ku(RI/ht),me={};me.absoluteValue=me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};me.comparedTo=me.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};me.decimalPlaces=me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ht;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};me.dividedBy=me.div=function(e){return Xi(this,new this.constructor(e))};me.dividedToIntegerBy=me.idiv=function(e){var t=this,n=t.constructor;return ot(Xi(t,new n(e),0,1),n.precision)};me.equals=me.eq=function(e){return!this.cmp(e)};me.exponent=function(){return Lt(this)};me.greaterThan=me.gt=function(e){return this.cmp(e)>0};me.greaterThanOrEqualTo=me.gte=function(e){return this.cmp(e)>=0};me.isInteger=me.isint=function(){return this.e>this.d.length-2};me.isNegative=me.isneg=function(){return this.s<0};me.isPositive=me.ispos=function(){return this.s>0};me.isZero=function(){return this.s===0};me.lessThan=me.lt=function(e){return this.cmp(e)<0};me.lessThanOrEqualTo=me.lte=function(e){return this.cmp(e)<1};me.logarithm=me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(or))throw Error(Rr+"NaN");if(n.s<1)throw Error(Rr+(n.s?"NaN":"-Infinity"));return n.eq(or)?new r(0):(vt=!1,t=Xi(Df(n,o),Df(e,o),o),vt=!0,ot(t,i))};me.minus=me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$I(t,e):kI(t,(e.s=-e.s,e))};me.modulo=me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Rr+"NaN");return n.s?(vt=!1,t=Xi(n,e,0,1).times(e),vt=!0,n.minus(t)):ot(new r(n),i)};me.naturalExponential=me.exp=function(){return NI(this)};me.naturalLogarithm=me.ln=function(){return Df(this)};me.negated=me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};me.plus=me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kI(t,e):$I(t,(e.s=-e.s,e))};me.precision=me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(cs+e);if(t=Lt(i)+1,r=i.d.length-1,n=r*ht+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};me.squareRoot=me.sqrt=function(){var e,t,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Rr+"NaN")}for(e=Lt(s),vt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=pi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ku((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Xi(s,o,a+2)).times(.5),pi(o.d).slice(0,a)===(t=pi(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(ot(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(t!="9999")break;a+=4}return vt=!0,ot(r,n)};me.times=me.mul=function(e){var t,n,r,i,o,a,s,l,u,c=this,f=c.constructor,p=c.d,h=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,n=c.e+e.e,l=p.length,u=h.length,l<u&&(o=p,p=h,h=o,a=l,l=u,u=a),o=[],a=l+u,r=a;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)s=o[i]+h[r]*p[i-r-1]+t,o[i--]=s%Xt|0,t=s/Xt|0;o[i]=(o[i]+t)%Xt|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,vt?ot(e,f.precision):e};me.toDecimalPlaces=me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Si(e,0,Wu),t===void 0?t=r.rounding:Si(t,0,8),ot(n,e+Lt(n)+1,t))};me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ss(r,!0):(Si(e,0,Wu),t===void 0?t=i.rounding:Si(t,0,8),r=ot(new i(r),e+1,t),n=Ss(r,!0,e+1)),n};me.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?Ss(i):(Si(e,0,Wu),t===void 0?t=o.rounding:Si(t,0,8),r=ot(new o(i),e+Lt(i)+1,t),n=Ss(r.abs(),!1,e+Lt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};me.toInteger=me.toint=function(){var e=this,t=e.constructor;return ot(new t(e),Lt(e)+1,t.rounding)};me.toNumber=function(){return+this};me.toPower=me.pow=function(e){var t,n,r,i,o,a,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(or);if(s=new l(s),!s.s){if(e.s<1)throw Error(Rr+"Infinity");return s}if(s.eq(or))return s;if(r=l.precision,e.eq(or))return ot(s,r);if(t=e.e,n=e.d.length-1,a=t>=n,o=s.s,a){if((n=c<0?-c:c)<=RI){for(i=new l(or),t=Math.ceil(r/ht+4),vt=!1;n%2&&(i=i.times(s),qA(i.d,t)),n=Ku(n/2),n!==0;)s=s.times(s),qA(s.d,t);return vt=!0,e.s<0?new l(or).div(i):ot(i,r)}}else if(o<0)throw Error(Rr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,vt=!1,i=e.times(Df(s,r+u)),vt=!0,i=NI(i),i.s=o,i};me.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=Lt(i),r=Ss(i,n<=o.toExpNeg||n>=o.toExpPos)):(Si(e,1,Wu),t===void 0?t=o.rounding:Si(t,0,8),i=ot(new o(i),e,t),n=Lt(i),r=Ss(i,e<=n||n<=o.toExpNeg,e)),r};me.toSignificantDigits=me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Si(e,1,Wu),t===void 0?t=r.rounding:Si(t,0,8)),ot(new r(n),e,t)};me.toString=me.valueOf=me.val=me.toJSON=me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lt(e),n=e.constructor;return Ss(e,t<=n.toExpNeg||t>=n.toExpPos)};function kI(e,t){var n,r,i,o,a,s,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),vt?ot(t,f):t;if(l=e.d,u=t.d,a=e.e,i=t.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=u.length):(r=u,i=a,s=l.length),a=Math.ceil(f/ht),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=u.length,s-o<0&&(o=s,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/Xt|0,l[o]%=Xt;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,vt?ot(t,f):t}function Si(e,t,n){if(e!==~~e||e<t||e>n)throw Error(cs+e)}function pi(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)r=e[t]+"",n=ht-r.length,n&&(o+=ko(n)),o+=r;a=e[t],r=a+"",n=ht-r.length,n&&(o+=ko(n))}else if(a===0)return"0";for(;a%10===0;)a/=10;return o+a}var Xi=function(){function e(r,i){var o,a=0,s=r.length;for(r=r.slice();s--;)o=r[s]*i+a,r[s]=o%Xt|0,a=o/Xt|0;return a&&r.unshift(a),r}function t(r,i,o,a){var s,l;if(o!=a)l=o>a?1:-1;else for(s=l=0;s<o;s++)if(r[s]!=i[s]){l=r[s]>i[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]<i[o]?1:0,r[o]=a*Xt+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,a){var s,l,u,c,f,p,h,v,y,x,g,m,b,S,w,P,j,E,A=r.constructor,C=r.s==i.s?1:-1,T=r.d,_=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(Rr+"Division by zero");for(l=r.e-i.e,j=_.length,w=T.length,h=new A(C),v=h.d=[],u=0;_[u]==(T[u]||0);)++u;if(_[u]>(T[u]||0)&&--l,o==null?m=o=A.precision:a?m=o+(Lt(r)-Lt(i))+1:m=o,m<0)return new A(0);if(m=m/ht+2|0,u=0,j==1)for(c=0,_=_[0],m++;(u<w||c)&&m--;u++)b=c*Xt+(T[u]||0),v[u]=b/_|0,c=b%_|0;else{for(c=Xt/(_[0]+1)|0,c>1&&(_=e(_,c),T=e(T,c),j=_.length,w=T.length),S=j,y=T.slice(0,j),x=y.length;x<j;)y[x++]=0;E=_.slice(),E.unshift(0),P=_[0],_[1]>=Xt/2&&++P;do c=0,s=t(_,y,j,x),s<0?(g=y[0],j!=x&&(g=g*Xt+(y[1]||0)),c=g/P|0,c>1?(c>=Xt&&(c=Xt-1),f=e(_,c),p=f.length,x=y.length,s=t(f,y,p,x),s==1&&(c--,n(f,j<p?E:_,p))):(c==0&&(s=c=1),f=_.slice()),p=f.length,p<x&&f.unshift(0),n(y,f,x),s==-1&&(x=y.length,s=t(_,y,j,x),s<1&&(c++,n(y,j<x?E:_,x))),x=y.length):s===0&&(c++,y=[0]),v[u++]=c,s&&y[0]?y[x++]=T[S]||0:(y=[T[S]],x=1);while((S++<w||y[0]!==void 0)&&m--)}return v[0]||v.shift(),h.e=l,ot(h,a?o+Lt(h)+1:o)}}();function NI(e,t){var n,r,i,o,a,s,l=0,u=0,c=e.constructor,f=c.precision;if(Lt(e)>16)throw Error(H1+Lt(e));if(!e.s)return new c(or);for(vt=!1,s=f,a=new c(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(r=Math.log(Fa(2,u))/Math.LN10*2+5|0,s+=r,n=i=o=new c(or),c.precision=s;;){if(i=ot(i.times(e),s),n=n.times(++l),a=o.plus(Xi(i,n,s)),pi(a.d).slice(0,s)===pi(o.d).slice(0,s)){for(;u--;)o=ot(o.times(o),s);return c.precision=f,t==null?(vt=!0,ot(o,f)):o}o=a}}function Lt(e){for(var t=e.e*ht,n=e.d[0];n>=10;n/=10)t++;return t}function Lv(e,t,n){if(t>e.LN10.sd())throw vt=!0,n&&(e.precision=n),Error(Rr+"LN10 precision limit exceeded");return ot(new e(e.LN10),t)}function ko(e){for(var t="";e--;)t+="0";return t}function Df(e,t){var n,r,i,o,a,s,l,u,c,f=1,p=10,h=e,v=h.d,y=h.constructor,x=y.precision;if(h.s<1)throw Error(Rr+(h.s?"NaN":"-Infinity"));if(h.eq(or))return new y(0);if(t==null?(vt=!1,u=x):u=t,h.eq(10))return t==null&&(vt=!0),Lv(y,u);if(u+=p,y.precision=u,n=pi(v),r=n.charAt(0),o=Lt(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=pi(h.d),r=n.charAt(0),f++;o=Lt(h),r>1?(h=new y("0."+n),o++):h=new y(r+"."+n.slice(1))}else return l=Lv(y,u+2,x).times(o+""),h=Df(new y(r+"."+n.slice(1)),u-p).plus(l),y.precision=x,t==null?(vt=!0,ot(h,x)):h;for(s=a=h=Xi(h.minus(or),h.plus(or),u),c=ot(h.times(h),u),i=3;;){if(a=ot(a.times(c),u),l=s.plus(Xi(a,new y(i),u)),pi(l.d).slice(0,u)===pi(s.d).slice(0,u))return s=s.times(2),o!==0&&(s=s.plus(Lv(y,u+2,x).times(o+""))),s=Xi(s,new y(f),u),y.precision=x,t==null?(vt=!0,ot(s,x)):s;s=l,i+=2}}function KA(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Ku(n/ht),e.d=[],r=(n+1)%ht,n<0&&(r+=ht),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ht;r<i;)e.d.push(+t.slice(r,r+=ht));t=t.slice(r),r=ht-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),vt&&(e.e>um||e.e<-um))throw Error(H1+n)}else e.s=0,e.e=0,e.d=[0];return e}function ot(e,t,n){var r,i,o,a,s,l,u,c,f=e.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=t-a,r<0)r+=ht,i=t,u=f[c=0];else{if(c=Math.ceil((r+1)/ht),o=f.length,c>=o)return e;for(u=o=f[c],a=1;o>=10;o/=10)a++;r%=ht,i=r-ht+a}if(n!==void 0&&(o=Fa(10,a-i-1),s=u/o%10|0,l=t<0||f[c+1]!==void 0||u%o,l=n<4?(s||l)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?u/Fa(10,a-i):0:f[c-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(o=Lt(e),f.length=1,t=t-o-1,f[0]=Fa(10,(ht-t%ht)%ht),e.e=Ku(-t/ht)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=c,o=1,c--):(f.length=c+1,o=Fa(10,ht-r),f[c]=i>0?(u/Fa(10,a-i)%Fa(10,i)|0)*o:0),l)for(;;)if(c==0){(f[0]+=o)==Xt&&(f[0]=1,++e.e);break}else{if(f[c]+=o,f[c]!=Xt)break;f[c--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(vt&&(e.e>um||e.e<-um))throw Error(H1+Lt(e));return e}function $I(e,t){var n,r,i,o,a,s,l,u,c,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),vt?ot(t,h):t;if(l=e.d,f=t.d,r=t.e,u=e.e,l=l.slice(),a=u-r,a){for(c=a<0,c?(n=l,a=-a,s=f.length):(n=f,r=u,s=l.length),i=Math.max(Math.ceil(h/ht),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,c=i<s,c&&(s=i),i=0;i<s;i++)if(l[i]!=f[i]){c=l[i]<f[i];break}a=0}for(c&&(n=l,l=f,f=n,t.s=-t.s),s=l.length,i=f.length-s;i>0;--i)l[s++]=0;for(i=f.length;i>a;){if(l[--i]<f[i]){for(o=i;o&&l[--o]===0;)l[o]=Xt-1;--l[o],l[i]+=Xt}l[i]-=f[i]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,vt?ot(t,h):t):new p(0)}function Ss(e,t,n){var r,i=Lt(e),o=pi(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+ko(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ko(-i-1)+o,n&&(r=n-a)>0&&(o+=ko(r))):i>=a?(o+=ko(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ko(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=ko(r))),e.s<0?"-"+o:o}function qA(e,t){if(e.length>t)return e.length=t,!0}function MI(e){var t,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(cs+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return KA(a,o.toString())}else if(typeof o!="string")throw Error(cs+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,Sre.test(o))KA(a,o);else throw Error(cs+o)}if(i.prototype=me,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=MI,i.config=i.set=Ore,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Ore(e){if(!e||typeof e!="object")throw Error(Rr+"Object expected");var t,n,r,i=["precision",1,Wu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Ku(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(cs+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(cs+n+": "+r);return this}var V1=MI(wre);or=new V1(1);const tt=V1;function Pre(e){return Cre(e)||Are(e)||Ere(e)||jre()}function jre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
86
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mee(e,t){if(e){if(typeof e=="string")return oA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oA(e,t)}}function oA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function yee(e){if(Array.isArray(e))return e}var XM=/[ \f\n\r\t\v\u2028\u2029]+/,YM=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];_e(n)||(r?o=n.toString().split(""):o=n.toString().split(XM));var a=o.map(function(l){return{word:l,width:Gc(l,i).width}}),s=r?0:Gc(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}},vee=function(t,n,r,i,o){var a=t.maxLines,s=t.children,l=t.style,u=t.breakAll,c=ne(a),f=s,p=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return N.reduce(function(I,B){var k=B.word,L=B.width,M=I[I.length-1];if(M&&(i==null||o||M.width+L+r<Number(i)))M.words.push(k),M.width+=L+r;else{var z={words:[k],width:L};I.push(z)}return I},[])},h=p(n),v=function(N){return N.reduce(function(I,B){return I.width>B.width?I:B})};if(!c)return h;for(var y="…",x=function(N){var I=f.slice(0,N),B=YM({breakAll:u,style:l,children:I+y}).wordsWithComputedWidth,k=p(B),L=k.length>a||v(k).width>Number(i);return[L,k]},g=0,m=f.length-1,b=0,S;g<=m&&b<=f.length-1;){var w=Math.floor((g+m)/2),P=w-1,j=x(P),E=iA(j,2),A=E[0],C=E[1],T=x(w),_=iA(T,1),R=_[0];if(!A&&!R&&(g=w+1),A&&R&&(m=w-1),!A&&R){S=C;break}b++}return S||h},aA=function(t){var n=_e(t)?[]:t.toString().split(XM);return[{words:n}]},xee=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,a=t.breakAll,s=t.maxLines;if((n||r)&&!Oa.isSsr){var l,u,c=YM({breakAll:a,children:i,style:o});if(c){var f=c.wordsWithComputedWidth,p=c.spaceWidth;l=f,u=p}else return aA(i);return vee({breakAll:a,children:i,maxLines:s,style:o},l,u,n,r)}return aA(i)},sA="#808080",bs=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,a=t.lineHeight,s=a===void 0?"1em":a,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,p=t.textAnchor,h=p===void 0?"start":p,v=t.verticalAnchor,y=v===void 0?"end":v,x=t.fill,g=x===void 0?sA:x,m=rA(t,fee),b=O.useMemo(function(){return xee({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:f,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,f,m.style,m.width]),S=m.dx,w=m.dy,P=m.angle,j=m.className,E=m.breakAll,A=rA(m,dee);if(!Wt(r)||!Wt(o))return null;var C=r+(ne(S)?S:0),T=o+(ne(w)?w:0),_;switch(y){case"start":_=_v("calc(".concat(u,")"));break;case"middle":_=_v("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:_=_v("calc(".concat(b.length-1," * -").concat(s,")"));break}var R=[];if(f){var $=b[0].width,N=m.width;R.push("scale(".concat((ne(N)?N/$:1)/$,")"))}return P&&R.push("rotate(".concat(P,", ").concat(C,", ").concat(T,")")),R.length&&(A.transform=R.join(" ")),D.createElement("text",e0({},ve(A,!0),{x:C,y:T,className:Ae("recharts-text",j),textAnchor:h,fill:g.includes("url")?sA:g}),b.map(function(I,B){var k=I.words.join(E?"":" ");return D.createElement("tspan",{x:C,dy:B===0?_:s,key:"".concat(k,"-").concat(B)},k)}))};function oa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function w1(e){let t,n,r;e.length!==2?(t=oa,n=(s,l)=>oa(e(s),l),r=(s,l)=>e(s)-l):(t=e===oa||e===bee?e:wee,n=e,r=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function wee(){return 0}function QM(e){return e===null?NaN:+e}function*See(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Oee=w1(oa),jd=Oee.right;w1(QM).center;class lA extends Map{constructor(t,n=Eee){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(uA(this,t))}has(t){return super.has(uA(this,t))}set(t,n){return super.set(Pee(this,t),n)}delete(t){return super.delete(jee(this,t))}}function uA({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Pee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Eee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Aee(e=oa){if(e===oa)return JM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function JM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Cee=Math.sqrt(50),Tee=Math.sqrt(10),_ee=Math.sqrt(2);function Jh(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Cee?10:o>=Tee?5:o>=_ee?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?Jh(e,t,n*2):[s,l,u]}function t0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?Jh(t,e,n):Jh(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function n0(e,t,n){return t=+t,e=+e,n=+n,Jh(e,t,n)[2]}function r0(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?n0(t,e,n):n0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function cA(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function fA(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function ZM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?JM:Aee(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/l+p)),v=Math.min(r,Math.floor(t+(l-u)*f/l+p));ZM(e,t,h,v,i)}const o=e[t];let a=n,s=r;for(gc(e,n,t),i(e[r],o)>0&&gc(e,n,r);a<s;){for(gc(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?gc(e,n,s):(++s,gc(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function gc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ree(e,t,n){if(e=Float64Array.from(See(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return fA(e);if(t>=1)return cA(e);var r,i=(r-1)*t,o=Math.floor(i),a=cA(ZM(e,o).subarray(0,o+1)),s=fA(e.subarray(o+1));return a+(s-a)*(i-o)}}function kee(e,t,n=QM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function Nee(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function $r(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function vo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const i0=Symbol("implicit");function S1(){var e=new lA,t=[],n=[],r=i0;function i(o){let a=e.get(o);if(a===void 0){if(r!==i0)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new lA;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return S1(t,n).unknown(r)},$r.apply(i,arguments),i}function kf(){var e=S1().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete e.unknown;function f(){var p=t().length,h=i<r,v=h?i:r,y=h?r:i;o=(y-v)/Math.max(1,p-l+u*2),s&&(o=Math.floor(o)),v+=(y-v-o*(p-l))*c,a=o*(1-l),s&&(v=Math.round(v),a=Math.round(a));var x=Nee(p).map(function(g){return v+o*g});return n(h?x.reverse():x)}return e.domain=function(p){return arguments.length?(t(p),f()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,s=!0,f()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(p){return arguments.length?(s=!!p,f()):s},e.padding=function(p){return arguments.length?(l=Math.min(1,u=+p),f()):l},e.paddingInner=function(p){return arguments.length?(l=Math.min(1,p),f()):l},e.paddingOuter=function(p){return arguments.length?(u=+p,f()):u},e.align=function(p){return arguments.length?(c=Math.max(0,Math.min(1,p)),f()):c},e.copy=function(){return kf(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},$r.apply(f(),arguments)}function eI(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return eI(t())},e}function Xc(){return eI(kf.apply(null,arguments).paddingInner(1))}function O1(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ed(){}var Nf=.7,Zh=1/Nf,wl="\\s*([+-]?\\d+)\\s*",$f="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$ee=/^#([0-9a-f]{3,8})$/,Mee=new RegExp(`^rgb\\(${wl},${wl},${wl}\\)$`),Iee=new RegExp(`^rgb\\(${vi},${vi},${vi}\\)$`),Dee=new RegExp(`^rgba\\(${wl},${wl},${wl},${$f}\\)$`),Lee=new RegExp(`^rgba\\(${vi},${vi},${vi},${$f}\\)$`),Fee=new RegExp(`^hsl\\(${$f},${vi},${vi}\\)$`),Bee=new RegExp(`^hsla\\(${$f},${vi},${vi},${$f}\\)$`),dA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};O1(Ed,Mf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pA,formatHex:pA,formatHex8:Uee,formatHsl:zee,formatRgb:hA,toString:hA});function pA(){return this.rgb().formatHex()}function Uee(){return this.rgb().formatHex8()}function zee(){return nI(this).formatHsl()}function hA(){return this.rgb().formatRgb()}function Mf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=$ee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mA(t):n===3?new Gn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?mp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?mp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Mee.exec(e))?new Gn(t[1],t[2],t[3],1):(t=Iee.exec(e))?new Gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dee.exec(e))?mp(t[1],t[2],t[3],t[4]):(t=Lee.exec(e))?mp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fee.exec(e))?vA(t[1],t[2]/100,t[3]/100,1):(t=Bee.exec(e))?vA(t[1],t[2]/100,t[3]/100,t[4]):dA.hasOwnProperty(e)?mA(dA[e]):e==="transparent"?new Gn(NaN,NaN,NaN,0):null}function mA(e){return new Gn(e>>16&255,e>>8&255,e&255,1)}function mp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Gn(e,t,n,r)}function Hee(e){return e instanceof Ed||(e=Mf(e)),e?(e=e.rgb(),new Gn(e.r,e.g,e.b,e.opacity)):new Gn}function o0(e,t,n,r){return arguments.length===1?Hee(e):new Gn(e,t,n,r??1)}function Gn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}O1(Gn,o0,tI(Ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new Gn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nf:Math.pow(Nf,e),new Gn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Gn(us(this.r),us(this.g),us(this.b),em(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gA,formatHex:gA,formatHex8:Vee,formatRgb:yA,toString:yA}));function gA(){return`#${Ka(this.r)}${Ka(this.g)}${Ka(this.b)}`}function Vee(){return`#${Ka(this.r)}${Ka(this.g)}${Ka(this.b)}${Ka((isNaN(this.opacity)?1:this.opacity)*255)}`}function yA(){const e=em(this.opacity);return`${e===1?"rgb(":"rgba("}${us(this.r)}, ${us(this.g)}, ${us(this.b)}${e===1?")":`, ${e})`}`}function em(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function us(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ka(e){return e=us(e),(e<16?"0":"")+e.toString(16)}function vA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wr(e,t,n,r)}function nI(e){if(e instanceof Wr)return new Wr(e.h,e.s,e.l,e.opacity);if(e instanceof Ed||(e=Mf(e)),!e)return new Wr;if(e instanceof Wr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Wr(a,s,l,e.opacity)}function Wee(e,t,n,r){return arguments.length===1?nI(e):new Wr(e,t,n,r??1)}function Wr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}O1(Wr,Wee,tI(Ed,{brighter(e){return e=e==null?Zh:Math.pow(Zh,e),new Wr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nf:Math.pow(Nf,e),new Wr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Gn(Rv(e>=240?e-240:e+120,i,r),Rv(e,i,r),Rv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Wr(xA(this.h),gp(this.s),gp(this.l),em(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=em(this.opacity);return`${e===1?"hsl(":"hsla("}${xA(this.h)}, ${gp(this.s)*100}%, ${gp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xA(e){return e=(e||0)%360,e<0?e+360:e}function gp(e){return Math.max(0,Math.min(1,e||0))}function Rv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const P1=e=>()=>e;function Kee(e,t){return function(n){return e+n*t}}function qee(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Gee(e){return(e=+e)==1?rI:function(t,n){return n-t?qee(t,n,e):P1(isNaN(t)?n:t)}}function rI(e,t){var n=t-e;return n?Kee(e,n):P1(isNaN(e)?t:e)}const bA=function e(t){var n=Gee(t);function r(i,o){var a=n((i=o0(i)).r,(o=o0(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=rI(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function Xee(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function Yee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Qee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Vu(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function Jee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Zee(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Vu(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var a0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kv=new RegExp(a0.source,"g");function ete(e){return function(){return e}}function tte(e){return function(t){return e(t)+""}}function nte(e,t){var n=a0.lastIndex=kv.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=a0.exec(e))&&(i=kv.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:tm(r,i)})),n=kv.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?tte(l[0].x):ete(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function Vu(e,t){var n=typeof t,r;return t==null||n==="boolean"?P1(t):(n==="number"?tm:n==="string"?(r=Mf(t))?(t=r,bA):nte:t instanceof Mf?bA:t instanceof Date?Jee:Yee(t)?Xee:Array.isArray(t)?Qee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Zee:tm)(e,t)}function j1(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function rte(e,t){t===void 0&&(t=e,e=Vu);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function ite(e){return function(){return e}}function nm(e){return+e}var wA=[0,1];function Dn(e){return e}function s0(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ite(isNaN(t)?NaN:.5)}function ote(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ate(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=s0(i,r),o=n(a,o)):(r=s0(r,i),o=n(o,a)),function(s){return o(r(s))}}function ste(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=s0(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=jd(e,s,1,r)-1;return o[l](i[l](s))}}function Ad(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Gg(){var e=wA,t=wA,n=Vu,r,i,o,a=Dn,s,l,u;function c(){var p=Math.min(e.length,t.length);return a!==Dn&&(a=ote(e[0],e[p-1])),s=p>2?ste:ate,l=u=null,f}function f(p){return p==null||isNaN(p=+p)?o:(l||(l=s(e.map(r),t,n)))(r(a(p)))}return f.invert=function(p){return a(i((u||(u=s(t,e.map(r),tm)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,nm),c()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),c()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),n=j1,c()},f.clamp=function(p){return arguments.length?(a=p?!0:Dn,c()):a!==Dn},f.interpolate=function(p){return arguments.length?(n=p,c()):n},f.unknown=function(p){return arguments.length?(o=p,f):o},function(p,h){return r=p,i=h,c()}}function E1(){return Gg()(Dn,Dn)}function lte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function rm(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function eu(e){return e=rm(Math.abs(e)),e?e[1]:NaN}function ute(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function cte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function If(e){if(!(t=fte.exec(e)))throw new Error("invalid format: "+e);var t;return new A1({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}If.prototype=A1.prototype;function A1(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}A1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function dte(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var im;function pte(e,t){var n=rm(e,t);if(!n)return im=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(im=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+rm(e,Math.max(0,t+o-1))[0]}function SA(e,t){var n=rm(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const OA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lte,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>SA(e*100,t),r:SA,s:pte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PA(e){return e}var jA=Array.prototype.map,EA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hte(e){var t=e.grouping===void 0||e.thousands===void 0?PA:ute(jA.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?PA:cte(jA.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,p){f=If(f);var h=f.fill,v=f.align,y=f.sign,x=f.symbol,g=f.zero,m=f.width,b=f.comma,S=f.precision,w=f.trim,P=f.type;P==="n"?(b=!0,P="g"):OA[P]||(S===void 0&&(S=12),w=!0,P="g"),(g||h==="0"&&v==="=")&&(g=!0,h="0",v="=");var j=(p&&p.prefix!==void 0?p.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),E=(x==="$"?r:/[%p]/.test(P)?a:"")+(p&&p.suffix!==void 0?p.suffix:""),A=OA[P],C=/[defgprs%]/.test(P);S=S===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function T(_){var R=j,$=E,N,I,B;if(P==="c")$=A(_)+$,_="";else{_=+_;var k=_<0||1/_<0;if(_=isNaN(_)?l:A(Math.abs(_),S),w&&(_=dte(_)),k&&+_==0&&y!=="+"&&(k=!1),R=(k?y==="("?y:s:y==="-"||y==="("?"":y)+R,$=(P==="s"&&!isNaN(_)&&im!==void 0?EA[8+im/3]:"")+$+(k&&y==="("?")":""),C){for(N=-1,I=_.length;++N<I;)if(B=_.charCodeAt(N),48>B||B>57){$=(B===46?i+_.slice(N+1):_.slice(N))+$,_=_.slice(0,N);break}}}b&&!g&&(_=t(_,1/0));var L=R.length+_.length+$.length,M=L<m?new Array(m-L+1).join(h):"";switch(b&&g&&(_=t(M+_,M.length?m-$.length:1/0),M=""),v){case"<":_=R+_+$+M;break;case"=":_=R+M+_+$;break;case"^":_=M.slice(0,L=M.length>>1)+R+_+$+M.slice(L);break;default:_=M+R+_+$;break}return o(_)}return T.toString=function(){return f+""},T}function c(f,p){var h=Math.max(-8,Math.min(8,Math.floor(eu(p)/3)))*3,v=Math.pow(10,-h),y=u((f=If(f),f.type="f",f),{suffix:EA[8+h/3]});return function(x){return y(v*x)}}return{format:u,formatPrefix:c}}var yp,C1,iI;mte({thousands:",",grouping:[3],currency:["$",""]});function mte(e){return yp=hte(e),C1=yp.format,iI=yp.formatPrefix,yp}function gte(e){return Math.max(0,-eu(Math.abs(e)))}function yte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(eu(t)/3)))*3-eu(Math.abs(e)))}function vte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,eu(t)-eu(e))+1}function oI(e,t,n,r){var i=r0(e,t,n),o;switch(r=If(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=yte(i,a))&&(r.precision=o),iI(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=vte(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=gte(i))&&(r.precision=o-(r.type==="%")*2);break}}return C1(r)}function Pa(e){var t=e.domain;return e.ticks=function(n){var r=t();return t0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return oI(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=n0(a,s,n),u===l)return r[i]=a,r[o]=s,t(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function om(){var e=E1();return e.copy=function(){return Ad(e,om())},$r.apply(e,arguments),Pa(e)}function aI(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,nm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return aI(e).unknown(t)},e=arguments.length?Array.from(e,nm):[0,1],Pa(n)}function sI(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),e[n]=t.floor(i),e[r]=t.ceil(o),e}function AA(e){return Math.log(e)}function CA(e){return Math.exp(e)}function xte(e){return-Math.log(-e)}function bte(e){return-Math.exp(-e)}function wte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ste(e){return e===10?wte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ote(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function TA(e){return(t,n)=>-e(-t,n)}function T1(e){const t=e(AA,CA),n=t.domain;let r=10,i,o;function a(){return i=Ote(r),o=Ste(r),n()[0]<0?(i=TA(i),o=TA(o),e(xte,bte)):e(AA,CA),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const l=n();let u=l[0],c=l[l.length-1];const f=c<u;f&&([u,c]=[c,u]);let p=i(u),h=i(c),v,y;const x=s==null?10:+s;let g=[];if(!(r%1)&&h-p<x){if(p=Math.floor(p),h=Math.ceil(h),u>0){for(;p<=h;++p)for(v=1;v<r;++v)if(y=p<0?v/o(-p):v*o(p),!(y<u)){if(y>c)break;g.push(y)}}else for(;p<=h;++p)for(v=r-1;v>=1;--v)if(y=p>0?v/o(-p):v*o(p),!(y<u)){if(y>c)break;g.push(y)}g.length*2<x&&(g=t0(u,c,x))}else g=t0(p,h,Math.min(h-p,x)).map(o);return f?g.reverse():g},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=If(l)).precision==null&&(l.trim=!0),l=C1(l)),s===1/0)return l;const u=Math.max(1,r*s/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=u?l(c):""}},t.nice=()=>n(sI(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function lI(){const e=T1(Gg()).domain([1,10]);return e.copy=()=>Ad(e,lI()).base(e.base()),$r.apply(e,arguments),e}function _A(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function RA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function _1(e){var t=1,n=e(_A(t),RA(t));return n.constant=function(r){return arguments.length?e(_A(t=+r),RA(t)):t},Pa(n)}function uI(){var e=_1(Gg());return e.copy=function(){return Ad(e,uI()).constant(e.constant())},$r.apply(e,arguments)}function kA(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Pte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jte(e){return e<0?-e*e:e*e}function R1(e){var t=e(Dn,Dn),n=1;function r(){return n===1?e(Dn,Dn):n===.5?e(Pte,jte):e(kA(n),kA(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Pa(t)}function k1(){var e=R1(Gg());return e.copy=function(){return Ad(e,k1()).exponent(e.exponent())},$r.apply(e,arguments),e}function Ete(){return k1.apply(null,arguments).exponent(.5)}function NA(e){return Math.sign(e)*e*e}function Ate(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cI(){var e=E1(),t=[0,1],n=!1,r;function i(o){var a=Ate(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(NA(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,nm)).map(NA)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return cI(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$r.apply(i,arguments),Pa(i)}function fI(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a<s;)n[a-1]=kee(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[jd(n,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(oa),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return fI().domain(e).range(t).unknown(r)},$r.apply(o,arguments)}function dI(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[jd(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return dI().domain([e,t]).range(i).unknown(o)},$r.apply(Pa(a),arguments)}function pI(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[jd(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return pI().domain(e).range(t).unknown(n)},$r.apply(i,arguments)}const Nv=new Date,$v=new Date;function Kt(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return l;let u;do l.push(u=new Date(+o)),t(o,s),e(o);while(u<o&&o<a);return l},i.filter=o=>Kt(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(Nv.setTime(+o),$v.setTime(+a),e(Nv),e($v),Math.floor(n(Nv,$v))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const am=Kt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);am.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):am);am.range;const Hi=1e3,jr=Hi*60,Vi=jr*60,io=Vi*24,N1=io*7,$A=io*30,Mv=io*365,qa=Kt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getUTCSeconds());qa.range;const $1=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi)},(e,t)=>{e.setTime(+e+t*jr)},(e,t)=>(t-e)/jr,e=>e.getMinutes());$1.range;const M1=Kt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jr)},(e,t)=>(t-e)/jr,e=>e.getUTCMinutes());M1.range;const I1=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi-e.getMinutes()*jr)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getHours());I1.range;const D1=Kt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCHours());D1.range;const Cd=Kt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jr)/io,e=>e.getDate()-1);Cd.range;const Xg=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/io,e=>e.getUTCDate()-1);Xg.range;const hI=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/io,e=>Math.floor(e/io));hI.range;function Ls(e){return Kt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*jr)/N1)}const Yg=Ls(0),sm=Ls(1),Cte=Ls(2),Tte=Ls(3),tu=Ls(4),_te=Ls(5),Rte=Ls(6);Yg.range;sm.range;Cte.range;Tte.range;tu.range;_te.range;Rte.range;function Fs(e){return Kt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/N1)}const Qg=Fs(0),lm=Fs(1),kte=Fs(2),Nte=Fs(3),nu=Fs(4),$te=Fs(5),Mte=Fs(6);Qg.range;lm.range;kte.range;Nte.range;nu.range;$te.range;Mte.range;const L1=Kt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());L1.range;const F1=Kt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());F1.range;const oo=Kt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());oo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});oo.range;const ao=Kt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ao.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ao.range;function mI(e,t,n,r,i,o){const a=[[qa,1,Hi],[qa,5,5*Hi],[qa,15,15*Hi],[qa,30,30*Hi],[o,1,jr],[o,5,5*jr],[o,15,15*jr],[o,30,30*jr],[i,1,Vi],[i,3,3*Vi],[i,6,6*Vi],[i,12,12*Vi],[r,1,io],[r,2,2*io],[n,1,N1],[t,1,$A],[t,3,3*$A],[e,1,Mv]];function s(u,c,f){const p=c<u;p&&([u,c]=[c,u]);const h=f&&typeof f.range=="function"?f:l(u,c,f),v=h?h.range(u,+c+1):[];return p?v.reverse():v}function l(u,c,f){const p=Math.abs(c-u)/f,h=w1(([,,x])=>x).right(a,p);if(h===a.length)return e.every(r0(u/Mv,c/Mv,f));if(h===0)return am.every(Math.max(r0(u,c,f),1));const[v,y]=a[p/a[h-1][2]<a[h][2]/p?h-1:h];return v.every(y)}return[s,l]}const[Ite,Dte]=mI(ao,F1,Qg,hI,D1,M1),[Lte,Fte]=mI(oo,L1,Yg,Cd,I1,$1);function Iv(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Dv(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function yc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Bte(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=vc(i),c=xc(i),f=vc(o),p=xc(o),h=vc(a),v=xc(a),y=vc(s),x=xc(s),g=vc(l),m=xc(l),b={a:B,A:k,b:L,B:M,c:null,d:BA,e:BA,f:une,g:xne,G:wne,H:ane,I:sne,j:lne,L:gI,m:cne,M:fne,p:z,q:U,Q:HA,s:VA,S:dne,u:pne,U:hne,V:mne,w:gne,W:yne,x:null,X:null,y:vne,Y:bne,Z:Sne,"%":zA},S={a:V,A:W,b:Q,B:G,c:null,d:UA,e:UA,f:Ene,g:Ine,G:Lne,H:One,I:Pne,j:jne,L:vI,m:Ane,M:Cne,p:le,q:X,Q:HA,s:VA,S:Tne,u:_ne,U:Rne,V:kne,w:Nne,W:$ne,x:null,X:null,y:Mne,Y:Dne,Z:Fne,"%":zA},w={a:C,A:T,b:_,B:R,c:$,d:LA,e:LA,f:nne,g:DA,G:IA,H:FA,I:FA,j:Jte,L:tne,m:Qte,M:Zte,p:A,q:Yte,Q:ine,s:one,S:ene,u:Wte,U:Kte,V:qte,w:Vte,W:Gte,x:N,X:I,y:DA,Y:IA,Z:Xte,"%":rne};b.x=P(n,b),b.X=P(r,b),b.c=P(t,b),S.x=P(n,S),S.X=P(r,S),S.c=P(t,S);function P(K,ee){return function(ie){var H=[],Z=-1,J=0,se=K.length,we,ae,be;for(ie instanceof Date||(ie=new Date(+ie));++Z<se;)K.charCodeAt(Z)===37&&(H.push(K.slice(J,Z)),(ae=MA[we=K.charAt(++Z)])!=null?we=K.charAt(++Z):ae=we==="e"?" ":"0",(be=ee[we])&&(we=be(ie,ae)),H.push(we),J=Z+1);return H.push(K.slice(J,Z)),H.join("")}}function j(K,ee){return function(ie){var H=yc(1900,void 0,1),Z=E(H,K,ie+="",0),J,se;if(Z!=ie.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(ee&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(J=Dv(yc(H.y,0,1)),se=J.getUTCDay(),J=se>4||se===0?lm.ceil(J):lm(J),J=Xg.offset(J,(H.V-1)*7),H.y=J.getUTCFullYear(),H.m=J.getUTCMonth(),H.d=J.getUTCDate()+(H.w+6)%7):(J=Iv(yc(H.y,0,1)),se=J.getDay(),J=se>4||se===0?sm.ceil(J):sm(J),J=Cd.offset(J,(H.V-1)*7),H.y=J.getFullYear(),H.m=J.getMonth(),H.d=J.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),se="Z"in H?Dv(yc(H.y,0,1)).getUTCDay():Iv(yc(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(se+5)%7:H.w+H.U*7-(se+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,Dv(H)):Iv(H)}}function E(K,ee,ie,H){for(var Z=0,J=ee.length,se=ie.length,we,ae;Z<J;){if(H>=se)return-1;if(we=ee.charCodeAt(Z++),we===37){if(we=ee.charAt(Z++),ae=w[we in MA?ee.charAt(Z++):we],!ae||(H=ae(K,ie,H))<0)return-1}else if(we!=ie.charCodeAt(H++))return-1}return H}function A(K,ee,ie){var H=u.exec(ee.slice(ie));return H?(K.p=c.get(H[0].toLowerCase()),ie+H[0].length):-1}function C(K,ee,ie){var H=h.exec(ee.slice(ie));return H?(K.w=v.get(H[0].toLowerCase()),ie+H[0].length):-1}function T(K,ee,ie){var H=f.exec(ee.slice(ie));return H?(K.w=p.get(H[0].toLowerCase()),ie+H[0].length):-1}function _(K,ee,ie){var H=g.exec(ee.slice(ie));return H?(K.m=m.get(H[0].toLowerCase()),ie+H[0].length):-1}function R(K,ee,ie){var H=y.exec(ee.slice(ie));return H?(K.m=x.get(H[0].toLowerCase()),ie+H[0].length):-1}function $(K,ee,ie){return E(K,t,ee,ie)}function N(K,ee,ie){return E(K,n,ee,ie)}function I(K,ee,ie){return E(K,r,ee,ie)}function B(K){return a[K.getDay()]}function k(K){return o[K.getDay()]}function L(K){return l[K.getMonth()]}function M(K){return s[K.getMonth()]}function z(K){return i[+(K.getHours()>=12)]}function U(K){return 1+~~(K.getMonth()/3)}function V(K){return a[K.getUTCDay()]}function W(K){return o[K.getUTCDay()]}function Q(K){return l[K.getUTCMonth()]}function G(K){return s[K.getUTCMonth()]}function le(K){return i[+(K.getUTCHours()>=12)]}function X(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var ee=P(K+="",b);return ee.toString=function(){return K},ee},parse:function(K){var ee=j(K+="",!1);return ee.toString=function(){return K},ee},utcFormat:function(K){var ee=P(K+="",S);return ee.toString=function(){return K},ee},utcParse:function(K){var ee=j(K+="",!0);return ee.toString=function(){return K},ee}}}var MA={"-":"",_:" ",0:"0"},en=/^\s*\d+/,Ute=/^%/,zte=/[\\^$*+?|[\]().{}]/g;function We(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Hte(e){return e.replace(zte,"\\$&")}function vc(e){return new RegExp("^(?:"+e.map(Hte).join("|")+")","i")}function xc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Vte(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Wte(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Kte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function qte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Gte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function IA(e,t,n){var r=en.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function DA(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xte(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Yte(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Qte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function LA(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Jte(e,t,n){var r=en.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function FA(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Zte(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ene(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function tne(e,t,n){var r=en.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function nne(e,t,n){var r=en.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function rne(e,t,n){var r=Ute.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ine(e,t,n){var r=en.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function one(e,t,n){var r=en.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function BA(e,t){return We(e.getDate(),t,2)}function ane(e,t){return We(e.getHours(),t,2)}function sne(e,t){return We(e.getHours()%12||12,t,2)}function lne(e,t){return We(1+Cd.count(oo(e),e),t,3)}function gI(e,t){return We(e.getMilliseconds(),t,3)}function une(e,t){return gI(e,t)+"000"}function cne(e,t){return We(e.getMonth()+1,t,2)}function fne(e,t){return We(e.getMinutes(),t,2)}function dne(e,t){return We(e.getSeconds(),t,2)}function pne(e){var t=e.getDay();return t===0?7:t}function hne(e,t){return We(Yg.count(oo(e)-1,e),t,2)}function yI(e){var t=e.getDay();return t>=4||t===0?tu(e):tu.ceil(e)}function mne(e,t){return e=yI(e),We(tu.count(oo(e),e)+(oo(e).getDay()===4),t,2)}function gne(e){return e.getDay()}function yne(e,t){return We(sm.count(oo(e)-1,e),t,2)}function vne(e,t){return We(e.getFullYear()%100,t,2)}function xne(e,t){return e=yI(e),We(e.getFullYear()%100,t,2)}function bne(e,t){return We(e.getFullYear()%1e4,t,4)}function wne(e,t){var n=e.getDay();return e=n>=4||n===0?tu(e):tu.ceil(e),We(e.getFullYear()%1e4,t,4)}function Sne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+We(t/60|0,"0",2)+We(t%60,"0",2)}function UA(e,t){return We(e.getUTCDate(),t,2)}function One(e,t){return We(e.getUTCHours(),t,2)}function Pne(e,t){return We(e.getUTCHours()%12||12,t,2)}function jne(e,t){return We(1+Xg.count(ao(e),e),t,3)}function vI(e,t){return We(e.getUTCMilliseconds(),t,3)}function Ene(e,t){return vI(e,t)+"000"}function Ane(e,t){return We(e.getUTCMonth()+1,t,2)}function Cne(e,t){return We(e.getUTCMinutes(),t,2)}function Tne(e,t){return We(e.getUTCSeconds(),t,2)}function _ne(e){var t=e.getUTCDay();return t===0?7:t}function Rne(e,t){return We(Qg.count(ao(e)-1,e),t,2)}function xI(e){var t=e.getUTCDay();return t>=4||t===0?nu(e):nu.ceil(e)}function kne(e,t){return e=xI(e),We(nu.count(ao(e),e)+(ao(e).getUTCDay()===4),t,2)}function Nne(e){return e.getUTCDay()}function $ne(e,t){return We(lm.count(ao(e)-1,e),t,2)}function Mne(e,t){return We(e.getUTCFullYear()%100,t,2)}function Ine(e,t){return e=xI(e),We(e.getUTCFullYear()%100,t,2)}function Dne(e,t){return We(e.getUTCFullYear()%1e4,t,4)}function Lne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?nu(e):nu.ceil(e),We(e.getUTCFullYear()%1e4,t,4)}function Fne(){return"+0000"}function zA(){return"%"}function HA(e){return+e}function VA(e){return Math.floor(+e/1e3)}var Ks,bI,wI;Bne({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Bne(e){return Ks=Bte(e),bI=Ks.format,Ks.parse,wI=Ks.utcFormat,Ks.utcParse,Ks}function Une(e){return new Date(e)}function zne(e){return e instanceof Date?+e:+new Date(+e)}function B1(e,t,n,r,i,o,a,s,l,u){var c=E1(),f=c.invert,p=c.domain,h=u(".%L"),v=u(":%S"),y=u("%I:%M"),x=u("%I %p"),g=u("%a %d"),m=u("%b %d"),b=u("%B"),S=u("%Y");function w(P){return(l(P)<P?h:s(P)<P?v:a(P)<P?y:o(P)<P?x:r(P)<P?i(P)<P?g:m:n(P)<P?b:S)(P)}return c.invert=function(P){return new Date(f(P))},c.domain=function(P){return arguments.length?p(Array.from(P,zne)):p().map(Une)},c.ticks=function(P){var j=p();return e(j[0],j[j.length-1],P??10)},c.tickFormat=function(P,j){return j==null?w:u(j)},c.nice=function(P){var j=p();return(!P||typeof P.range!="function")&&(P=t(j[0],j[j.length-1],P??10)),P?p(sI(j,P)):c},c.copy=function(){return Ad(c,B1(e,t,n,r,i,o,a,s,l,u))},c}function Hne(){return $r.apply(B1(Lte,Fte,oo,L1,Yg,Cd,I1,$1,qa,bI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Vne(){return $r.apply(B1(Ite,Dte,ao,F1,Qg,Xg,D1,M1,qa,wI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Jg(){var e=0,t=1,n,r,i,o,a=Dn,s=!1,l;function u(f){return f==null||isNaN(f=+f)?l:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(s=!!f,u):s},u.interpolator=function(f){return arguments.length?(a=f,u):a};function c(f){return function(p){var h,v;return arguments.length?([h,v]=p,a=f(h,v),u):[a(0),a(1)]}}return u.range=c(Vu),u.rangeRound=c(j1),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function ja(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function SI(){var e=Pa(Jg()(Dn));return e.copy=function(){return ja(e,SI())},vo.apply(e,arguments)}function OI(){var e=T1(Jg()).domain([1,10]);return e.copy=function(){return ja(e,OI()).base(e.base())},vo.apply(e,arguments)}function PI(){var e=_1(Jg());return e.copy=function(){return ja(e,PI()).constant(e.constant())},vo.apply(e,arguments)}function U1(){var e=R1(Jg());return e.copy=function(){return ja(e,U1()).exponent(e.exponent())},vo.apply(e,arguments)}function Wne(){return U1.apply(null,arguments).exponent(.5)}function jI(){var e=[],t=Dn;function n(r){if(r!=null&&!isNaN(r=+r))return t((jd(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(oa),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Ree(e,o/r))},n.copy=function(){return jI(t).domain(e)},vo.apply(n,arguments)}function Zg(){var e=0,t=.5,n=1,r=1,i,o,a,s,l,u=Dn,c,f=!1,p;function h(y){return isNaN(y=+y)?p:(y=.5+((y=+c(y))-o)*(r*y<r*o?s:l),u(f?Math.max(0,Math.min(1,y)):y))}h.domain=function(y){return arguments.length?([e,t,n]=y,i=c(e=+e),o=c(t=+t),a=c(n=+n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,h):[e,t,n]},h.clamp=function(y){return arguments.length?(f=!!y,h):f},h.interpolator=function(y){return arguments.length?(u=y,h):u};function v(y){return function(x){var g,m,b;return arguments.length?([g,m,b]=x,u=rte(y,[g,m,b]),h):[u(0),u(.5),u(1)]}}return h.range=v(Vu),h.rangeRound=v(j1),h.unknown=function(y){return arguments.length?(p=y,h):p},function(y){return c=y,i=y(e),o=y(t),a=y(n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,h}}function EI(){var e=Pa(Zg()(Dn));return e.copy=function(){return ja(e,EI())},vo.apply(e,arguments)}function AI(){var e=T1(Zg()).domain([.1,1,10]);return e.copy=function(){return ja(e,AI()).base(e.base())},vo.apply(e,arguments)}function CI(){var e=_1(Zg());return e.copy=function(){return ja(e,CI()).constant(e.constant())},vo.apply(e,arguments)}function z1(){var e=R1(Zg());return e.copy=function(){return ja(e,z1()).exponent(e.exponent())},vo.apply(e,arguments)}function Kne(){return z1.apply(null,arguments).exponent(.5)}const WA=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:kf,scaleDiverging:EI,scaleDivergingLog:AI,scaleDivergingPow:z1,scaleDivergingSqrt:Kne,scaleDivergingSymlog:CI,scaleIdentity:aI,scaleImplicit:i0,scaleLinear:om,scaleLog:lI,scaleOrdinal:S1,scalePoint:Xc,scalePow:k1,scaleQuantile:fI,scaleQuantize:dI,scaleRadial:cI,scaleSequential:SI,scaleSequentialLog:OI,scaleSequentialPow:U1,scaleSequentialQuantile:jI,scaleSequentialSqrt:Wne,scaleSequentialSymlog:PI,scaleSqrt:Ete,scaleSymlog:uI,scaleThreshold:pI,scaleTime:Hne,scaleUtc:Vne,tickFormat:oI},Symbol.toStringTag,{value:"Module"}));var qne=Nu;function Gne(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(a!=null&&(s===void 0?a===a&&!qne(a):n(a,s)))var s=a,l=o}return l}var ey=Gne;function Xne(e,t){return e>t}var TI=Xne,Yne=ey,Qne=TI,Jne=zu;function Zne(e){return e&&e.length?Yne(e,Jne,Qne):void 0}var ere=Zne;const qo=Qe(ere);function tre(e,t){return e<t}var _I=tre,nre=ey,rre=_I,ire=zu;function ore(e){return e&&e.length?nre(e,ire,rre):void 0}var are=ore;const ty=Qe(are);var sre=n1,lre=ji,ure=FM,cre=Zn;function fre(e,t){var n=cre(e)?sre:ure;return n(e,lre(t))}var dre=fre,pre=DM,hre=dre;function mre(e,t){return pre(hre(e,t),1)}var gre=mre;const yre=Qe(gre);var vre=y1;function xre(e,t){return vre(e,t)}var bre=xre;const ws=Qe(bre);var Wu=1e9,wre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},V1,xt=!0,Rr="[DecimalError] ",cs=Rr+"Invalid argument: ",H1=Rr+"Exponent out of range: ",Ku=Math.floor,Fa=Math.pow,Sre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,or,Xt=1e7,ht=7,RI=9007199254740991,um=Ku(RI/ht),me={};me.absoluteValue=me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};me.comparedTo=me.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};me.decimalPlaces=me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ht;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};me.dividedBy=me.div=function(e){return Xi(this,new this.constructor(e))};me.dividedToIntegerBy=me.idiv=function(e){var t=this,n=t.constructor;return ot(Xi(t,new n(e),0,1),n.precision)};me.equals=me.eq=function(e){return!this.cmp(e)};me.exponent=function(){return Lt(this)};me.greaterThan=me.gt=function(e){return this.cmp(e)>0};me.greaterThanOrEqualTo=me.gte=function(e){return this.cmp(e)>=0};me.isInteger=me.isint=function(){return this.e>this.d.length-2};me.isNegative=me.isneg=function(){return this.s<0};me.isPositive=me.ispos=function(){return this.s>0};me.isZero=function(){return this.s===0};me.lessThan=me.lt=function(e){return this.cmp(e)<0};me.lessThanOrEqualTo=me.lte=function(e){return this.cmp(e)<1};me.logarithm=me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(or))throw Error(Rr+"NaN");if(n.s<1)throw Error(Rr+(n.s?"NaN":"-Infinity"));return n.eq(or)?new r(0):(xt=!1,t=Xi(Df(n,o),Df(e,o),o),xt=!0,ot(t,i))};me.minus=me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$I(t,e):kI(t,(e.s=-e.s,e))};me.modulo=me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Rr+"NaN");return n.s?(xt=!1,t=Xi(n,e,0,1).times(e),xt=!0,n.minus(t)):ot(new r(n),i)};me.naturalExponential=me.exp=function(){return NI(this)};me.naturalLogarithm=me.ln=function(){return Df(this)};me.negated=me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};me.plus=me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kI(t,e):$I(t,(e.s=-e.s,e))};me.precision=me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(cs+e);if(t=Lt(i)+1,r=i.d.length-1,n=r*ht+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};me.squareRoot=me.sqrt=function(){var e,t,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Rr+"NaN")}for(e=Lt(s),xt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=pi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ku((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Xi(s,o,a+2)).times(.5),pi(o.d).slice(0,a)===(t=pi(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(ot(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(t!="9999")break;a+=4}return xt=!0,ot(r,n)};me.times=me.mul=function(e){var t,n,r,i,o,a,s,l,u,c=this,f=c.constructor,p=c.d,h=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,n=c.e+e.e,l=p.length,u=h.length,l<u&&(o=p,p=h,h=o,a=l,l=u,u=a),o=[],a=l+u,r=a;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)s=o[i]+h[r]*p[i-r-1]+t,o[i--]=s%Xt|0,t=s/Xt|0;o[i]=(o[i]+t)%Xt|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,xt?ot(e,f.precision):e};me.toDecimalPlaces=me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Si(e,0,Wu),t===void 0?t=r.rounding:Si(t,0,8),ot(n,e+Lt(n)+1,t))};me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ss(r,!0):(Si(e,0,Wu),t===void 0?t=i.rounding:Si(t,0,8),r=ot(new i(r),e+1,t),n=Ss(r,!0,e+1)),n};me.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?Ss(i):(Si(e,0,Wu),t===void 0?t=o.rounding:Si(t,0,8),r=ot(new o(i),e+Lt(i)+1,t),n=Ss(r.abs(),!1,e+Lt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};me.toInteger=me.toint=function(){var e=this,t=e.constructor;return ot(new t(e),Lt(e)+1,t.rounding)};me.toNumber=function(){return+this};me.toPower=me.pow=function(e){var t,n,r,i,o,a,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(or);if(s=new l(s),!s.s){if(e.s<1)throw Error(Rr+"Infinity");return s}if(s.eq(or))return s;if(r=l.precision,e.eq(or))return ot(s,r);if(t=e.e,n=e.d.length-1,a=t>=n,o=s.s,a){if((n=c<0?-c:c)<=RI){for(i=new l(or),t=Math.ceil(r/ht+4),xt=!1;n%2&&(i=i.times(s),qA(i.d,t)),n=Ku(n/2),n!==0;)s=s.times(s),qA(s.d,t);return xt=!0,e.s<0?new l(or).div(i):ot(i,r)}}else if(o<0)throw Error(Rr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,xt=!1,i=e.times(Df(s,r+u)),xt=!0,i=NI(i),i.s=o,i};me.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=Lt(i),r=Ss(i,n<=o.toExpNeg||n>=o.toExpPos)):(Si(e,1,Wu),t===void 0?t=o.rounding:Si(t,0,8),i=ot(new o(i),e,t),n=Lt(i),r=Ss(i,e<=n||n<=o.toExpNeg,e)),r};me.toSignificantDigits=me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Si(e,1,Wu),t===void 0?t=r.rounding:Si(t,0,8)),ot(new r(n),e,t)};me.toString=me.valueOf=me.val=me.toJSON=me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lt(e),n=e.constructor;return Ss(e,t<=n.toExpNeg||t>=n.toExpPos)};function kI(e,t){var n,r,i,o,a,s,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),xt?ot(t,f):t;if(l=e.d,u=t.d,a=e.e,i=t.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=u.length):(r=u,i=a,s=l.length),a=Math.ceil(f/ht),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=u.length,s-o<0&&(o=s,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/Xt|0,l[o]%=Xt;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,xt?ot(t,f):t}function Si(e,t,n){if(e!==~~e||e<t||e>n)throw Error(cs+e)}function pi(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)r=e[t]+"",n=ht-r.length,n&&(o+=ko(n)),o+=r;a=e[t],r=a+"",n=ht-r.length,n&&(o+=ko(n))}else if(a===0)return"0";for(;a%10===0;)a/=10;return o+a}var Xi=function(){function e(r,i){var o,a=0,s=r.length;for(r=r.slice();s--;)o=r[s]*i+a,r[s]=o%Xt|0,a=o/Xt|0;return a&&r.unshift(a),r}function t(r,i,o,a){var s,l;if(o!=a)l=o>a?1:-1;else for(s=l=0;s<o;s++)if(r[s]!=i[s]){l=r[s]>i[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]<i[o]?1:0,r[o]=a*Xt+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,a){var s,l,u,c,f,p,h,v,y,x,g,m,b,S,w,P,j,E,A=r.constructor,C=r.s==i.s?1:-1,T=r.d,_=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(Rr+"Division by zero");for(l=r.e-i.e,j=_.length,w=T.length,h=new A(C),v=h.d=[],u=0;_[u]==(T[u]||0);)++u;if(_[u]>(T[u]||0)&&--l,o==null?m=o=A.precision:a?m=o+(Lt(r)-Lt(i))+1:m=o,m<0)return new A(0);if(m=m/ht+2|0,u=0,j==1)for(c=0,_=_[0],m++;(u<w||c)&&m--;u++)b=c*Xt+(T[u]||0),v[u]=b/_|0,c=b%_|0;else{for(c=Xt/(_[0]+1)|0,c>1&&(_=e(_,c),T=e(T,c),j=_.length,w=T.length),S=j,y=T.slice(0,j),x=y.length;x<j;)y[x++]=0;E=_.slice(),E.unshift(0),P=_[0],_[1]>=Xt/2&&++P;do c=0,s=t(_,y,j,x),s<0?(g=y[0],j!=x&&(g=g*Xt+(y[1]||0)),c=g/P|0,c>1?(c>=Xt&&(c=Xt-1),f=e(_,c),p=f.length,x=y.length,s=t(f,y,p,x),s==1&&(c--,n(f,j<p?E:_,p))):(c==0&&(s=c=1),f=_.slice()),p=f.length,p<x&&f.unshift(0),n(y,f,x),s==-1&&(x=y.length,s=t(_,y,j,x),s<1&&(c++,n(y,j<x?E:_,x))),x=y.length):s===0&&(c++,y=[0]),v[u++]=c,s&&y[0]?y[x++]=T[S]||0:(y=[T[S]],x=1);while((S++<w||y[0]!==void 0)&&m--)}return v[0]||v.shift(),h.e=l,ot(h,a?o+Lt(h)+1:o)}}();function NI(e,t){var n,r,i,o,a,s,l=0,u=0,c=e.constructor,f=c.precision;if(Lt(e)>16)throw Error(H1+Lt(e));if(!e.s)return new c(or);for(xt=!1,s=f,a=new c(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(r=Math.log(Fa(2,u))/Math.LN10*2+5|0,s+=r,n=i=o=new c(or),c.precision=s;;){if(i=ot(i.times(e),s),n=n.times(++l),a=o.plus(Xi(i,n,s)),pi(a.d).slice(0,s)===pi(o.d).slice(0,s)){for(;u--;)o=ot(o.times(o),s);return c.precision=f,t==null?(xt=!0,ot(o,f)):o}o=a}}function Lt(e){for(var t=e.e*ht,n=e.d[0];n>=10;n/=10)t++;return t}function Lv(e,t,n){if(t>e.LN10.sd())throw xt=!0,n&&(e.precision=n),Error(Rr+"LN10 precision limit exceeded");return ot(new e(e.LN10),t)}function ko(e){for(var t="";e--;)t+="0";return t}function Df(e,t){var n,r,i,o,a,s,l,u,c,f=1,p=10,h=e,v=h.d,y=h.constructor,x=y.precision;if(h.s<1)throw Error(Rr+(h.s?"NaN":"-Infinity"));if(h.eq(or))return new y(0);if(t==null?(xt=!1,u=x):u=t,h.eq(10))return t==null&&(xt=!0),Lv(y,u);if(u+=p,y.precision=u,n=pi(v),r=n.charAt(0),o=Lt(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=pi(h.d),r=n.charAt(0),f++;o=Lt(h),r>1?(h=new y("0."+n),o++):h=new y(r+"."+n.slice(1))}else return l=Lv(y,u+2,x).times(o+""),h=Df(new y(r+"."+n.slice(1)),u-p).plus(l),y.precision=x,t==null?(xt=!0,ot(h,x)):h;for(s=a=h=Xi(h.minus(or),h.plus(or),u),c=ot(h.times(h),u),i=3;;){if(a=ot(a.times(c),u),l=s.plus(Xi(a,new y(i),u)),pi(l.d).slice(0,u)===pi(s.d).slice(0,u))return s=s.times(2),o!==0&&(s=s.plus(Lv(y,u+2,x).times(o+""))),s=Xi(s,new y(f),u),y.precision=x,t==null?(xt=!0,ot(s,x)):s;s=l,i+=2}}function KA(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Ku(n/ht),e.d=[],r=(n+1)%ht,n<0&&(r+=ht),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ht;r<i;)e.d.push(+t.slice(r,r+=ht));t=t.slice(r),r=ht-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),xt&&(e.e>um||e.e<-um))throw Error(H1+n)}else e.s=0,e.e=0,e.d=[0];return e}function ot(e,t,n){var r,i,o,a,s,l,u,c,f=e.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=t-a,r<0)r+=ht,i=t,u=f[c=0];else{if(c=Math.ceil((r+1)/ht),o=f.length,c>=o)return e;for(u=o=f[c],a=1;o>=10;o/=10)a++;r%=ht,i=r-ht+a}if(n!==void 0&&(o=Fa(10,a-i-1),s=u/o%10|0,l=t<0||f[c+1]!==void 0||u%o,l=n<4?(s||l)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?u/Fa(10,a-i):0:f[c-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(o=Lt(e),f.length=1,t=t-o-1,f[0]=Fa(10,(ht-t%ht)%ht),e.e=Ku(-t/ht)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=c,o=1,c--):(f.length=c+1,o=Fa(10,ht-r),f[c]=i>0?(u/Fa(10,a-i)%Fa(10,i)|0)*o:0),l)for(;;)if(c==0){(f[0]+=o)==Xt&&(f[0]=1,++e.e);break}else{if(f[c]+=o,f[c]!=Xt)break;f[c--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(xt&&(e.e>um||e.e<-um))throw Error(H1+Lt(e));return e}function $I(e,t){var n,r,i,o,a,s,l,u,c,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),xt?ot(t,h):t;if(l=e.d,f=t.d,r=t.e,u=e.e,l=l.slice(),a=u-r,a){for(c=a<0,c?(n=l,a=-a,s=f.length):(n=f,r=u,s=l.length),i=Math.max(Math.ceil(h/ht),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,c=i<s,c&&(s=i),i=0;i<s;i++)if(l[i]!=f[i]){c=l[i]<f[i];break}a=0}for(c&&(n=l,l=f,f=n,t.s=-t.s),s=l.length,i=f.length-s;i>0;--i)l[s++]=0;for(i=f.length;i>a;){if(l[--i]<f[i]){for(o=i;o&&l[--o]===0;)l[o]=Xt-1;--l[o],l[i]+=Xt}l[i]-=f[i]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,xt?ot(t,h):t):new p(0)}function Ss(e,t,n){var r,i=Lt(e),o=pi(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+ko(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ko(-i-1)+o,n&&(r=n-a)>0&&(o+=ko(r))):i>=a?(o+=ko(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ko(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=ko(r))),e.s<0?"-"+o:o}function qA(e,t){if(e.length>t)return e.length=t,!0}function MI(e){var t,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(cs+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return KA(a,o.toString())}else if(typeof o!="string")throw Error(cs+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,Sre.test(o))KA(a,o);else throw Error(cs+o)}if(i.prototype=me,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=MI,i.config=i.set=Ore,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Ore(e){if(!e||typeof e!="object")throw Error(Rr+"Object expected");var t,n,r,i=["precision",1,Wu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Ku(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(cs+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(cs+n+": "+r);return this}var V1=MI(wre);or=new V1(1);const tt=V1;function Pre(e){return Cre(e)||Are(e)||Ere(e)||jre()}function jre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
87
87
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ere(e,t){if(e){if(typeof e=="string")return l0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l0(e,t)}}function Are(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Cre(e){if(Array.isArray(e))return l0(e)}function l0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Tre=function(t){return t},II={},DI=function(t){return t===II},GA=function(t){return function n(){return arguments.length===0||arguments.length===1&&DI(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},_re=function e(t,n){return t===1?n:GA(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i.filter(function(s){return s!==II}).length;return a>=t?n.apply(void 0,i):e(t-a,GA(function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var c=i.map(function(f){return DI(f)?l.shift():f});return n.apply(void 0,Pre(c).concat(l))}))})},ny=function(t){return _re(t.length,t)},u0=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},Rre=ny(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),kre=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Tre;var i=n.reverse(),o=i[0],a=i.slice(1);return function(){return a.reduce(function(s,l){return l(s)},o.apply(void 0,arguments))}},c0=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},LI=function(t){var n=null,r=null;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n&&o.every(function(s,l){return s===n[l]})||(n=o,r=t.apply(void 0,o)),r}};function Nre(e){var t;return e===0?t=1:t=Math.floor(new tt(e).abs().log(10).toNumber())+1,t}function $re(e,t,n){for(var r=new tt(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var Mre=ny(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),Ire=ny(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Dre=ny(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const ry={rangeStep:$re,getDigitCount:Nre,interpolateNumber:Mre,uninterpolateNumber:Ire,uninterpolateTruncation:Dre};function f0(e){return Bre(e)||Fre(e)||FI(e)||Lre()}function Lre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
88
88
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Bre(e){if(Array.isArray(e))return d0(e)}function Lf(e,t){return Hre(e)||zre(e,t)||FI(e,t)||Ure()}function Ure(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
89
89
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FI(e,t){if(e){if(typeof e=="string")return d0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d0(e,t)}}function d0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zre(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function Hre(e){if(Array.isArray(e))return e}function BI(e){var t=Lf(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function UI(e,t,n){if(e.lte(0))return new tt(0);var r=ry.getDigitCount(e.toNumber()),i=new tt(10).pow(r),o=e.div(i),a=r!==1?.05:.1,s=new tt(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return t?l:new tt(Math.ceil(l))}function Vre(e,t,n){var r=1,i=new tt(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new tt(10).pow(ry.getDigitCount(e)-1),i=new tt(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new tt(Math.floor(e)))}else e===0?i=new tt(Math.floor((t-1)/2)):n||(i=new tt(Math.floor(e)));var a=Math.floor((t-1)/2),s=kre(Rre(function(l){return i.add(new tt(l-a).mul(r)).toNumber()}),u0);return s(0,t)}function zI(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new tt(0),tickMin:new tt(0),tickMax:new tt(0)};var o=UI(new tt(t).sub(e).div(n-1),r,i),a;e<=0&&t>=0?a=new tt(0):(a=new tt(e).add(t).div(2),a=a.sub(new tt(a).mod(o)));var s=Math.ceil(a.sub(e).div(o).toNumber()),l=Math.ceil(new tt(t).sub(a).div(o).toNumber()),u=s+l+1;return u>n?zI(e,t,n,r,i+1):(u<n&&(l=t>0?l+(n-u):l,s=t>0?s:s+(n-u)),{step:o,tickMin:a.sub(new tt(s).mul(o)),tickMax:a.add(new tt(l).mul(o))})}function Wre(e){var t=Lf(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=BI([n,r]),l=Lf(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(f0(u0(0,i-1).map(function(){return 1/0}))):[].concat(f0(u0(0,i-1).map(function(){return-1/0})),[c]);return n>r?c0(f):f}if(u===c)return Vre(u,i,o);var p=zI(u,c,a,o),h=p.step,v=p.tickMin,y=p.tickMax,x=ry.rangeStep(v,y.add(new tt(.1).mul(h)),h);return n>r?c0(x):x}function Kre(e,t){var n=Lf(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=BI([r,i]),s=Lf(a,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var c=Math.max(t,2),f=UI(new tt(u).sub(l).div(c-1),o,0),p=[].concat(f0(ry.rangeStep(new tt(l),new tt(u).sub(new tt(.99).mul(f)),f)),[u]);return r>i?c0(p):p}var qre=LI(Wre),Gre=LI(Kre),Xre="Invariant failed";function Os(e,t){throw new Error(Xre)}var Yre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function cm(){return cm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cm.apply(this,arguments)}function Qre(e,t){return tie(e)||eie(e,t)||Zre(e,t)||Jre()}function Jre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -135,7 +135,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
135
135
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xfe(e,t){if(e){if(typeof e=="string")return bT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bT(e,t)}}function bT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Qfe(e){if(Array.isArray(e))return e}function U0(){return U0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U0.apply(this,arguments)}var Jfe=function(t,n){var r;return D.isValidElement(t)?r=D.cloneElement(t,n):Oe(t)?r=t(n):r=D.createElement("line",U0({},n,{className:"recharts-reference-line-line"})),r},Zfe=function(t,n,r,i,o,a,s,l,u){var c=o.x,f=o.y,p=o.width,h=o.height;if(r){var v=u.y,y=t.y.apply(v,{position:a});if(bi(u,"discard")&&!t.y.isInRange(y))return null;var x=[{x:c+p,y},{x:c,y}];return l==="left"?x.reverse():x}if(n){var g=u.x,m=t.x.apply(g,{position:a});if(bi(u,"discard")&&!t.x.isInRange(m))return null;var b=[{x:m,y:f+h},{x:m,y:f}];return s==="top"?b.reverse():b}if(i){var S=u.segment,w=S.map(function(P){return t.apply(P,{position:a})});return bi(u,"discard")&&Oce(w,function(P){return!t.isInRange(P)})?null:w}return null};function ede(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,o=e.yAxisId,a=e.shape,s=e.className,l=e.alwaysShow,u=$fe(),c=q2(i),f=G2(o),p=Dfe();if(!u||!p)return null;Gr(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=X1({x:c.scale,y:f.scale}),v=Wt(t),y=Wt(n),x=r&&r.length===2,g=Zfe(h,v,y,x,p,e.position,c.orientation,f.orientation,e);if(!g)return null;var m=qfe(g,2),b=m[0],S=b.x,w=b.y,P=m[1],j=P.x,E=P.y,A=bi(e,"hidden")?"url(#".concat(u,")"):void 0,C=xT(xT({clipPath:A},ve(e,!0)),{},{x1:S,y1:w,x2:j,y2:E});return D.createElement(Ie,{className:Ae("recharts-reference-line",s)},Jfe(a,C),Qt.renderCallByParent(e,ffe({x1:S,y1:w,x2:j,y2:E})))}var tO=function(e){function t(){return Ffe(this,t),zfe(this,t,arguments)}return Wfe(t,e),Ufe(t,[{key:"render",value:function(){return D.createElement(ede,this.props)}}])}(D.Component);eO(tO,"displayName","ReferenceLine");eO(tO,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function z0(){return z0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z0.apply(this,arguments)}function du(e){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(e)}function wT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ST(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wT(Object(n),!0).forEach(function(r){fy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J2(r.key),r)}}function rde(e,t,n){return t&&nde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ide(e,t,n){return t=$m(t),ode(e,Q2()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function ode(e,t){if(t&&(du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ade(e)}function ade(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q2=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function sde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H0(e,t)}function H0(e,t){return H0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},H0(e,t)}function fy(e,t,n){return t=J2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J2(e){var t=lde(e,"string");return du(t)=="symbol"?t:t+""}function lde(e,t){if(du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ude=function(t){var n=t.x,r=t.y,i=t.xAxis,o=t.yAxis,a=X1({x:i.scale,y:o.scale}),s=a.apply({x:n,y:r},{bandAware:!0});return bi(t,"discard")&&!a.isInRange(s)?null:s},dy=function(e){function t(){return tde(this,t),ide(this,t,arguments)}return sde(t,e),rde(t,[{key:"render",value:function(){var r=this.props,i=r.x,o=r.y,a=r.r,s=r.alwaysShow,l=r.clipPathId,u=Wt(i),c=Wt(o);if(Gr(s===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!c)return null;var f=ude(this.props);if(!f)return null;var p=f.x,h=f.y,v=this.props,y=v.shape,x=v.className,g=bi(this.props,"hidden")?"url(#".concat(l,")"):void 0,m=ST(ST({clipPath:g},ve(this.props,!0)),{},{cx:p,cy:h});return D.createElement(Ie,{className:Ae("recharts-reference-dot",x)},t.renderDot(y,m),Qt.renderCallByParent(this.props,{x:p-a,y:h-a,width:2*a,height:2*a}))}}])}(D.Component);fy(dy,"displayName","ReferenceDot");fy(dy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});fy(dy,"renderDot",function(e,t){var n;return D.isValidElement(e)?n=D.cloneElement(e,t):Oe(e)?n=e(t):n=D.createElement(oy,z0({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function V0(){return V0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V0.apply(this,arguments)}function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function OT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function PT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OT(Object(n),!0).forEach(function(r){py(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eD(r.key),r)}}function dde(e,t,n){return t&&fde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pde(e,t,n){return t=Mm(t),hde(e,Z2()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function hde(e,t){if(t&&(pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mde(e)}function mde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z2=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function gde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W0(e,t)}function W0(e,t){return W0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},W0(e,t)}function py(e,t,n){return t=eD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eD(e){var t=yde(e,"string");return pu(t)=="symbol"?t:t+""}function yde(e,t){if(pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vde=function(t,n,r,i,o){var a=o.x1,s=o.x2,l=o.y1,u=o.y2,c=o.xAxis,f=o.yAxis;if(!c||!f)return null;var p=X1({x:c.scale,y:f.scale}),h={x:t?p.x.apply(a,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(l,{position:"start"}):p.y.rangeMin},v={x:n?p.x.apply(s,{position:"end"}):p.x.rangeMax,y:i?p.y.apply(u,{position:"end"}):p.y.rangeMax};return bi(o,"discard")&&(!p.isInRange(h)||!p.isInRange(v))?null:B2(h,v)},hy=function(e){function t(){return cde(this,t),pde(this,t,arguments)}return gde(t,e),dde(t,[{key:"render",value:function(){var r=this.props,i=r.x1,o=r.x2,a=r.y1,s=r.y2,l=r.className,u=r.alwaysShow,c=r.clipPathId;Gr(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Wt(i),p=Wt(o),h=Wt(a),v=Wt(s),y=this.props.shape;if(!f&&!p&&!h&&!v&&!y)return null;var x=vde(f,p,h,v,this.props);if(!x&&!y)return null;var g=bi(this.props,"hidden")?"url(#".concat(c,")"):void 0;return D.createElement(Ie,{className:Ae("recharts-reference-area",l)},t.renderRect(y,PT(PT({clipPath:g},ve(this.props,!0)),x)),Qt.renderCallByParent(this.props,x))}}])}(D.Component);py(hy,"displayName","ReferenceArea");py(hy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});py(hy,"renderRect",function(e,t){var n;return D.isValidElement(e)?n=D.cloneElement(e,t):Oe(e)?n=e(t):n=D.createElement(q1,V0({},t,{className:"recharts-reference-area-rect"})),n});function tD(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function xde(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return pfe(r,n)}function bde(e,t,n){var r=n==="width",i=e.x,o=e.y,a=e.width,s=e.height;return t===1?{start:r?i:o,end:r?i+a:o+s}:{start:r?i+a:o+s,end:r?i:o}}function Im(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function wde(e,t){return tD(e,t+1)}function Sde(e,t,n,r,i){for(var o=(r||[]).slice(),a=t.start,s=t.end,l=0,u=1,c=a,f=function(){var v=r==null?void 0:r[l];if(v===void 0)return{v:tD(r,u)};var y=l,x,g=function(){return x===void 0&&(x=n(v,y)),x},m=v.coordinate,b=l===0||Im(e,m,g,c,s);b||(l=0,c=a,u+=1),b&&(c=m+e*(g()/2+i),l+=u)},p;u<=o.length;)if(p=f(),p)return p.v;return[]}function id(e){"@babel/helpers - typeof";return id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},id(e)}function jT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jT(Object(n),!0).forEach(function(r){Ode(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ode(e,t,n){return t=Pde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pde(e){var t=jde(e,"string");return id(t)=="symbol"?t:t+""}function jde(e,t){if(id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ede(e,t,n,r,i){for(var o=(r||[]).slice(),a=o.length,s=t.start,l=t.end,u=function(p){var h=o[p],v,y=function(){return v===void 0&&(v=n(h,p)),v};if(p===a-1){var x=e*(h.coordinate+e*y()/2-l);o[p]=h=On(On({},h),{},{tickCoord:x>0?h.coordinate-x*e:h.coordinate})}else o[p]=h=On(On({},h),{},{tickCoord:h.coordinate});var g=Im(e,h.tickCoord,y,s,l);g&&(l=h.tickCoord-e*(y()/2+i),o[p]=On(On({},h),{},{isShow:!0}))},c=a-1;c>=0;c--)u(c);return o}function Ade(e,t,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=t.start,u=t.end;if(o){var c=r[s-1],f=n(c,s-1),p=e*(c.coordinate+e*f/2-u);a[s-1]=c=On(On({},c),{},{tickCoord:p>0?c.coordinate-p*e:c.coordinate});var h=Im(e,c.tickCoord,function(){return f},l,u);h&&(u=c.tickCoord-e*(f/2+i),a[s-1]=On(On({},c),{},{isShow:!0}))}for(var v=o?s-1:s,y=function(m){var b=a[m],S,w=function(){return S===void 0&&(S=n(b,m)),S};if(m===0){var P=e*(b.coordinate-e*w()/2-l);a[m]=b=On(On({},b),{},{tickCoord:P<0?b.coordinate-P*e:b.coordinate})}else a[m]=b=On(On({},b),{},{tickCoord:b.coordinate});var j=Im(e,b.tickCoord,w,l,u);j&&(l=b.tickCoord+e*(w()/2+i),a[m]=On(On({},b),{},{isShow:!0}))},x=0;x<v;x++)y(x);return a}function nO(e,t,n){var r=e.tick,i=e.ticks,o=e.viewBox,a=e.minTickGap,s=e.orientation,l=e.interval,u=e.tickFormatter,c=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(ne(l)||Oa.isSsr)return wde(i,typeof l=="number"&&ne(l)?l:0);var p=[],h=s==="top"||s==="bottom"?"width":"height",v=c&&h==="width"?Gc(c,{fontSize:t,letterSpacing:n}):{width:0,height:0},y=function(b,S){var w=Oe(u)?u(b.value,S):b.value;return h==="width"?xde(Gc(w,{fontSize:t,letterSpacing:n}),v,f):Gc(w,{fontSize:t,letterSpacing:n})[h]},x=i.length>=2?Jt(i[1].coordinate-i[0].coordinate):1,g=bde(o,x,h);return l==="equidistantPreserveStart"?Sde(x,g,y,i,a):(l==="preserveStart"||l==="preserveStartEnd"?p=Ade(x,g,y,i,a,l==="preserveStartEnd"):p=Ede(x,g,y,i,a),p.filter(function(m){return m.isShow}))}var Cde=["viewBox"],Tde=["viewBox"],_de=["ticks"];function hu(e){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hu(e)}function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fl.apply(this,arguments)}function ET(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ET(Object(n),!0).forEach(function(r){rO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wv(e,t){if(e==null)return{};var n=Rde(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rD(r.key),r)}}function Nde(e,t,n){return t&&AT(e.prototype,t),n&&AT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $de(e,t,n){return t=Dm(t),Mde(e,nD()?Reflect.construct(t,n||[],Dm(e).constructor):t.apply(e,n))}function Mde(e,t){if(t&&(hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ide(e)}function Ide(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nD=function(){return!!e})()}function Dm(e){return Dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dm(e)}function Dde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K0(e,t)}function K0(e,t){return K0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},K0(e,t)}function rO(e,t,n){return t=rD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rD(e){var t=Lde(e,"string");return hu(t)=="symbol"?t:t+""}function Lde(e,t){if(hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Gu=function(e){function t(n){var r;return kde(this,t),r=$de(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Dde(t,e),Nde(t,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,a=Wv(r,Cde),s=this.props,l=s.viewBox,u=Wv(s,Tde);return!bl(o,l)||!bl(a,u)||!bl(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,a=i.y,s=i.width,l=i.height,u=i.orientation,c=i.tickSize,f=i.mirror,p=i.tickMargin,h,v,y,x,g,m,b=f?-1:1,S=r.tickSize||c,w=ne(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":h=v=r.coordinate,x=a+ +!f*l,y=x-b*S,m=y-b*p,g=w;break;case"left":y=x=r.coordinate,v=o+ +!f*s,h=v-b*S,g=h-b*p,m=w;break;case"right":y=x=r.coordinate,v=o+ +f*s,h=v+b*S,g=h+b*p,m=w;break;default:h=v=r.coordinate,x=a+ +f*l,y=x+b*S,m=y+b*p,g=w;break}return{line:{x1:h,y1:y,x2:v,y2:x},tick:{x:g,y:m}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,a;switch(i){case"left":a=o?"start":"end";break;case"right":a=o?"end":"start";break;default:a="middle";break}return a}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,a="end";switch(i){case"left":case"right":a="middle";break;case"top":a=o?"start":"end";break;default:a=o?"end":"start";break}return a}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.orientation,u=r.mirror,c=r.axisLine,f=Ft(Ft(Ft({},ve(this.props,!1)),ve(c,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var p=+(l==="top"&&!u||l==="bottom"&&u);f=Ft(Ft({},f),{},{x1:i,y1:o+p*s,x2:i+a,y2:o+p*s})}else{var h=+(l==="left"&&!u||l==="right"&&u);f=Ft(Ft({},f),{},{x1:i+h*a,y1:o,x2:i+h*a,y2:o+s})}return D.createElement("line",fl({},f,{className:Ae("recharts-cartesian-axis-line",lr(c,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var a=this,s=this.props,l=s.tickLine,u=s.stroke,c=s.tick,f=s.tickFormatter,p=s.unit,h=nO(Ft(Ft({},this.props),{},{ticks:r}),i,o),v=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),x=ve(this.props,!1),g=ve(c,!1),m=Ft(Ft({},x),{},{fill:"none"},ve(l,!1)),b=h.map(function(S,w){var P=a.getTickLineCoord(S),j=P.line,E=P.tick,A=Ft(Ft(Ft(Ft({textAnchor:v,verticalAnchor:y},x),{},{stroke:"none",fill:u},g),E),{},{index:w,payload:S,visibleTicksCount:h.length,tickFormatter:f});return D.createElement(Ie,fl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},ro(a.props,S,w)),l&&D.createElement("line",fl({},m,j,{className:Ae("recharts-cartesian-axis-tick-line",lr(l,"className"))})),c&&t.renderTickItem(c,A,"".concat(Oe(f)?f(S.value,w):S.value).concat(p||"")))});return D.createElement("g",{className:"recharts-cartesian-axis-ticks"},b)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,a=i.width,s=i.height,l=i.ticksGenerator,u=i.className,c=i.hide;if(c)return null;var f=this.props,p=f.ticks,h=Wv(f,_de),v=p;return Oe(l)&&(v=p&&p.length>0?l(this.props):l(h)),a<=0||s<=0||!v||!v.length?null:D.createElement(Ie,{className:Ae("recharts-cartesian-axis",u),ref:function(x){r.layerReference=x}},o&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Qt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a,s=Ae(i.className,"recharts-cartesian-axis-tick-value");return D.isValidElement(r)?a=D.cloneElement(r,Ft(Ft({},i),{},{className:s})):Oe(r)?a=r(Ft(Ft({},i),{},{className:s})):a=D.createElement(bs,fl({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(O.Component);rO(Gu,"displayName","CartesianAxis");rO(Gu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Fde=["x1","y1","x2","y2","key"],Bde=["offset"];function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function CT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CT(Object(n),!0).forEach(function(r){Ude(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ude(e,t,n){return t=zde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zde(e){var t=Hde(e,"string");return Ps(t)=="symbol"?t:t+""}function Hde(e,t){if(Ps(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ps(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ga.apply(this,arguments)}function TT(e,t){if(e==null)return{};var n=Vde(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Vde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Wde=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,a=t.width,s=t.height,l=t.ry;return D.createElement("rect",{x:i,y:o,ry:l,width:a,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function iD(e,t){var n;if(D.isValidElement(e))n=D.cloneElement(e,t);else if(Oe(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,a=t.y2,s=t.key,l=TT(t,Fde),u=ve(l,!1);u.offset;var c=TT(u,Bde);n=D.createElement("line",Ga({},c,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function Kde(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var u=jn(jn({},e),{},{x1:t,y1:s,x2:t+n,y2:s,key:"line-".concat(l),index:l});return iD(i,u)});return D.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function qde(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var u=jn(jn({},e),{},{x1:s,y1:t,x2:s,y2:t+n,key:"line-".concat(l),index:l});return iD(i,u)});return D.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function Gde(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,a=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var c=s.map(function(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==c[0]&&c.unshift(0);var f=c.map(function(p,h){var v=!c[h+1],y=v?i+a-p:c[h+1]-p;if(y<=0)return null;var x=h%t.length;return D.createElement("rect",{key:"react-".concat(h),y:p,x:r,height:y,width:o,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return D.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Xde(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,a=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var c=u.map(function(p){return Math.round(p+o-o)}).sort(function(p,h){return p-h});o!==c[0]&&c.unshift(0);var f=c.map(function(p,h){var v=!c[h+1],y=v?o+s-p:c[h+1]-p;if(y<=0)return null;var x=h%r.length;return D.createElement("rect",{key:"react-".concat(h),x:p,y:a,width:y,height:l,stroke:"none",fill:r[x],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return D.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Yde=function(t,n){var r=t.xAxis,i=t.width,o=t.height,a=t.offset;return YI(nO(jn(jn(jn({},Gu.defaultProps),r),{},{ticks:Wi(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},Qde=function(t,n){var r=t.yAxis,i=t.width,o=t.height,a=t.offset;return YI(nO(jn(jn(jn({},Gu.defaultProps),r),{},{ticks:Wi(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},qs={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Rd(e){var t,n,r,i,o,a,s=J1(),l=Z1(),u=Lfe(),c=jn(jn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:qs.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:qs.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:qs.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:qs.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:qs.vertical,verticalFill:(a=e.verticalFill)!==null&&a!==void 0?a:qs.verticalFill,x:ne(e.x)?e.x:u.left,y:ne(e.y)?e.y:u.top,width:ne(e.width)?e.width:u.width,height:ne(e.height)?e.height:u.height}),f=c.x,p=c.y,h=c.width,v=c.height,y=c.syncWithTicks,x=c.horizontalValues,g=c.verticalValues,m=Mfe(),b=Ife();if(!ne(h)||h<=0||!ne(v)||v<=0||!ne(f)||f!==+f||!ne(p)||p!==+p)return null;var S=c.verticalCoordinatesGenerator||Yde,w=c.horizontalCoordinatesGenerator||Qde,P=c.horizontalPoints,j=c.verticalPoints;if((!P||!P.length)&&Oe(w)){var E=x&&x.length,A=w({yAxis:b?jn(jn({},b),{},{ticks:E?x:b.ticks}):void 0,width:s,height:l,offset:u},E?!0:y);Gr(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ps(A),"]")),Array.isArray(A)&&(P=A)}if((!j||!j.length)&&Oe(S)){var C=g&&g.length,T=S({xAxis:m?jn(jn({},m),{},{ticks:C?g:m.ticks}):void 0,width:s,height:l,offset:u},C?!0:y);Gr(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ps(T),"]")),Array.isArray(T)&&(j=T)}return D.createElement("g",{className:"recharts-cartesian-grid"},D.createElement(Wde,{fill:c.fill,fillOpacity:c.fillOpacity,x:c.x,y:c.y,width:c.width,height:c.height,ry:c.ry}),D.createElement(Kde,Ga({},c,{offset:u,horizontalPoints:P,xAxis:m,yAxis:b})),D.createElement(qde,Ga({},c,{offset:u,verticalPoints:j,xAxis:m,yAxis:b})),D.createElement(Gde,Ga({},c,{horizontalPoints:P})),D.createElement(Xde,Ga({},c,{verticalPoints:j})))}Rd.displayName="CartesianGrid";var Jde=["layout","type","stroke","connectNulls","isRange","ref"],Zde=["key"],oD;function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function aD(e,t){if(e==null)return{};var n=epe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function epe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(this,arguments)}function _T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_T(Object(n),!0).forEach(function(r){hi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lD(r.key),r)}}function npe(e,t,n){return t&&RT(e.prototype,t),n&&RT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rpe(e,t,n){return t=Lm(t),ipe(e,sD()?Reflect.construct(t,n||[],Lm(e).constructor):t.apply(e,n))}function ipe(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ope(e)}function ope(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sD=function(){return!!e})()}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(e)}function ape(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q0(e,t)}function q0(e,t){return q0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},q0(e,t)}function hi(e,t,n){return t=lD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lD(e){var t=spe(e,"string");return mu(t)=="symbol"?t:t+""}function spe(e,t){if(mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wo=function(e){function t(){var n;tpe(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=rpe(this,t,[].concat(i)),hi(n,"state",{isAnimationFinished:!0}),hi(n,"id",Fu("recharts-area-")),hi(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Oe(a)&&a()}),hi(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Oe(a)&&a()}),n}return ape(t,e),npe(t,[{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(a&&!s)return null;var l=this.props,u=l.dot,c=l.points,f=l.dataKey,p=ve(this.props,!1),h=ve(u,!0),v=c.map(function(x,g){var m=To(To(To({key:"dot-".concat(g),r:3},p),h),{},{index:g,cx:x.x,cy:x.y,dataKey:f,value:x.value,payload:x.payload,points:c});return t.renderDotItem(u,m)}),y={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return D.createElement(Ie,Xa({className:"recharts-area-dots"},y),v)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,o=i.baseLine,a=i.points,s=i.strokeWidth,l=a[0].x,u=a[a.length-1].x,c=r*Math.abs(l-u),f=qo(a.map(function(p){return p.y||0}));return ne(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(qo(o.map(function(p){return p.y||0})),f)),ne(f)?D.createElement("rect",{x:l<u?l:l-c,y:0,width:c,height:Math.floor(f+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,o=i.baseLine,a=i.points,s=i.strokeWidth,l=a[0].y,u=a[a.length-1].y,c=r*Math.abs(l-u),f=qo(a.map(function(p){return p.x||0}));return ne(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(qo(o.map(function(p){return p.x||0})),f)),ne(f)?D.createElement("rect",{x:0,y:l<u?l:l-c,width:f+(s?parseInt("".concat(s),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,o,a){var s=this.props,l=s.layout,u=s.type,c=s.stroke,f=s.connectNulls,p=s.isRange;s.ref;var h=aD(s,Jde);return D.createElement(Ie,{clipPath:o?"url(#clipPath-".concat(a,")"):null},D.createElement(Ol,Xa({},ve(h,!0),{points:r,connectNulls:f,type:u,baseLine:i,layout:l,stroke:"none",className:"recharts-area-area"})),c!=="none"&&D.createElement(Ol,Xa({},ve(this.props,!1),{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:r})),c!=="none"&&p&&D.createElement(Ol,Xa({},ve(this.props,!1),{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.baseLine,u=a.isAnimationActive,c=a.animationBegin,f=a.animationDuration,p=a.animationEasing,h=a.animationId,v=this.state,y=v.prevPoints,x=v.prevBaseLine;return D.createElement(Qr,{begin:c,duration:f,isActive:u,easing:p,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var m=g.t;if(y){var b=y.length/s.length,S=s.map(function(E,A){var C=Math.floor(A*b);if(y[C]){var T=y[C],_=ln(T.x,E.x),R=ln(T.y,E.y);return To(To({},E),{},{x:_(m),y:R(m)})}return E}),w;if(ne(l)&&typeof l=="number"){var P=ln(x,l);w=P(m)}else if(_e(l)||Lu(l)){var j=ln(x,0);w=j(m)}else w=l.map(function(E,A){var C=Math.floor(A*b);if(x[C]){var T=x[C],_=ln(T.x,E.x),R=ln(T.y,E.y);return To(To({},E),{},{x:_(m),y:R(m)})}return E});return o.renderAreaStatically(S,w,r,i)}return D.createElement(Ie,null,D.createElement("defs",null,D.createElement("clipPath",{id:"animationClipPath-".concat(i)},o.renderClipRect(m))),D.createElement(Ie,{clipPath:"url(#animationClipPath-".concat(i,")")},o.renderAreaStatically(s,l,r,i)))})}},{key:"renderArea",value:function(r,i){var o=this.props,a=o.points,s=o.baseLine,l=o.isAnimationActive,u=this.state,c=u.prevPoints,f=u.prevBaseLine,p=u.totalLength;return l&&a&&a.length&&(!c&&p>0||!ws(c,a)||!ws(f,s))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(a,s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,u=i.top,c=i.left,f=i.xAxis,p=i.yAxis,h=i.width,v=i.height,y=i.isAnimationActive,x=i.id;if(o||!s||!s.length)return null;var g=this.state.isAnimationFinished,m=s.length===1,b=Ae("recharts-area",l),S=f&&f.allowDataOverflow,w=p&&p.allowDataOverflow,P=S||w,j=_e(x)?this.id:x,E=(r=ve(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},A=E.r,C=A===void 0?3:A,T=E.strokeWidth,_=T===void 0?2:T,R=x8(a)?a:{},$=R.clipDot,N=$===void 0?!0:$,I=C*2+_;return D.createElement(Ie,{className:b},S||w?D.createElement("defs",null,D.createElement("clipPath",{id:"clipPath-".concat(j)},D.createElement("rect",{x:S?c:c-h/2,y:w?u:u-v/2,width:S?h:h*2,height:w?v:v*2})),!N&&D.createElement("clipPath",{id:"clipPath-dots-".concat(j)},D.createElement("rect",{x:c-I/2,y:u-I/2,width:h+I,height:v+I}))):null,m?null:this.renderArea(P,j),(a||m)&&this.renderDots(P,N,j),(!y||g)&&xi.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(O.PureComponent);oD=wo;hi(wo,"displayName","Area");hi(wo,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Oa.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});hi(wo,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,a=t.props.baseValue,s=a??o;if(ne(s)&&typeof s=="number")return s;var l=i==="horizontal"?r:n,u=l.scale.domain();if(l.type==="number"){var c=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});hi(wo,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,p=e.offset,h=t.layout,v=u&&u.length,y=oD.getBaseValue(t,n,r,i),x=h==="horizontal",g=!1,m=f.map(function(S,w){var P;v?P=u[c+w]:(P=Dt(S,l),Array.isArray(P)?g=!0:P=[y,P]);var j=P[1]==null||v&&Dt(S,l)==null;return x?{x:eC({axis:r,ticks:o,bandSize:s,entry:S,index:w}),y:j?null:i.scale(P[1]),value:P,payload:S}:{x:j?null:r.scale(P[1]),y:eC({axis:i,ticks:a,bandSize:s,entry:S,index:w}),value:P,payload:S}}),b;return v||g?b=m.map(function(S){var w=Array.isArray(S.value)?S.value[0]:null;return x?{x:S.x,y:w!=null&&S.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:S.y}}):b=x?i.scale(y):r.scale(y),To({points:m,baseLine:b,layout:h,isRange:g},p)});hi(wo,"renderDotItem",function(e,t){var n;if(D.isValidElement(e))n=D.cloneElement(e,t);else if(Oe(e))n=e(t);else{var r=Ae("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=aD(t,Zde);n=D.createElement(oy,Xa({},o,{key:i,className:r}))}return n});function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function lpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function upe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fD(r.key),r)}}function cpe(e,t,n){return t&&upe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fpe(e,t,n){return t=Fm(t),dpe(e,uD()?Reflect.construct(t,n||[],Fm(e).constructor):t.apply(e,n))}function dpe(e,t){if(t&&(gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ppe(e)}function ppe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uD=function(){return!!e})()}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fm(e)}function hpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G0(e,t)}function G0(e,t){return G0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},G0(e,t)}function cD(e,t,n){return t=fD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fD(e){var t=mpe(e,"string");return gu(t)=="symbol"?t:t+""}function mpe(e,t){if(gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function X0(){return X0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X0.apply(this,arguments)}function gpe(e){var t=e.xAxisId,n=J1(),r=Z1(),i=q2(t);return i==null?null:O.createElement(Gu,X0({},i,{className:Ae("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(a){return Wi(a,!0)}}))}var so=function(e){function t(){return lpe(this,t),fpe(this,t,arguments)}return hpe(t,e),cpe(t,[{key:"render",value:function(){return O.createElement(gpe,this.props)}}])}(O.Component);cD(so,"displayName","XAxis");cD(so,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function ype(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vpe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hD(r.key),r)}}function xpe(e,t,n){return t&&vpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bpe(e,t,n){return t=Bm(t),wpe(e,dD()?Reflect.construct(t,n||[],Bm(e).constructor):t.apply(e,n))}function wpe(e,t){if(t&&(yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Spe(e)}function Spe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dD=function(){return!!e})()}function Bm(e){return Bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bm(e)}function Ope(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y0(e,t)}function Y0(e,t){return Y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Y0(e,t)}function pD(e,t,n){return t=hD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hD(e){var t=Ppe(e,"string");return yu(t)=="symbol"?t:t+""}function Ppe(e,t){if(yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Q0(){return Q0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q0.apply(this,arguments)}var jpe=function(t){var n=t.yAxisId,r=J1(),i=Z1(),o=G2(n);return o==null?null:O.createElement(Gu,Q0({},o,{className:Ae("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(s){return Wi(s,!0)}}))},lo=function(e){function t(){return ype(this,t),bpe(this,t,arguments)}return Ope(t,e),xpe(t,[{key:"render",value:function(){return O.createElement(jpe,this.props)}}])}(O.Component);pD(lo,"displayName","YAxis");pD(lo,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function kT(e){return Tpe(e)||Cpe(e)||Ape(e)||Epe()}function Epe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
136
136
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ape(e,t){if(e){if(typeof e=="string")return J0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J0(e,t)}}function Cpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tpe(e){if(Array.isArray(e))return J0(e)}function J0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Z0=function(t,n,r,i,o){var a=ur(t,tO),s=ur(t,dy),l=[].concat(kT(a),kT(s)),u=ur(t,hy),c="".concat(i,"Id"),f=i[0],p=n;if(l.length&&(p=l.reduce(function(y,x){if(x.props[c]===r&&bi(x.props,"extendDomain")&&ne(x.props[f])){var g=x.props[f];return[Math.min(y[0],g),Math.max(y[1],g)]}return y},p)),u.length){var h="".concat(f,"1"),v="".concat(f,"2");p=u.reduce(function(y,x){if(x.props[c]===r&&bi(x.props,"extendDomain")&&ne(x.props[h])&&ne(x.props[v])){var g=x.props[h],m=x.props[v];return[Math.min(y[0],g,m),Math.max(y[1],g,m)]}return y},p)}return o&&o.length&&(p=o.reduce(function(y,x){return ne(x)?[Math.min(y[0],x),Math.max(y[1],x)]:y},p)),p},mD={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,f,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var h=new i(c,f||l,p),v=n?n+u:u;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],h]:l._events[v].push(h):(l._events[v]=h,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,h=f.length,v=new Array(h);p<h;p++)v[p]=f[p].fn;return v},s.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(u,c,f,p,h,v){var y=n?n+u:u;if(!this._events[y])return!1;var x=this._events[y],g=arguments.length,m,b;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),g){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,c),!0;case 3:return x.fn.call(x.context,c,f),!0;case 4:return x.fn.call(x.context,c,f,p),!0;case 5:return x.fn.call(x.context,c,f,p,h),!0;case 6:return x.fn.call(x.context,c,f,p,h,v),!0}for(b=1,m=new Array(g-1);b<g;b++)m[b-1]=arguments[b];x.fn.apply(x.context,m)}else{var S=x.length,w;for(b=0;b<S;b++)switch(x[b].once&&this.removeListener(u,x[b].fn,void 0,!0),g){case 1:x[b].fn.call(x[b].context);break;case 2:x[b].fn.call(x[b].context,c);break;case 3:x[b].fn.call(x[b].context,c,f);break;case 4:x[b].fn.call(x[b].context,c,f,p);break;default:if(!m)for(w=1,m=new Array(g-1);w<g;w++)m[w-1]=arguments[w];x[b].fn.apply(x[b].context,m)}}return!0},s.prototype.on=function(u,c,f){return o(this,u,c,f,!1)},s.prototype.once=function(u,c,f){return o(this,u,c,f,!0)},s.prototype.removeListener=function(u,c,f,p){var h=n?n+u:u;if(!this._events[h])return this;if(!c)return a(this,h),this;var v=this._events[h];if(v.fn)v.fn===c&&(!p||v.once)&&(!f||v.context===f)&&a(this,h);else{for(var y=0,x=[],g=v.length;y<g;y++)(v[y].fn!==c||p&&!v[y].once||f&&v[y].context!==f)&&x.push(v[y]);x.length?this._events[h]=x.length===1?x[0]:x:a(this,h)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(mD);var _pe=mD.exports;const Rpe=Qe(_pe);var Kv=new Rpe,qv="recharts.syncMouseEvents";function od(e){"@babel/helpers - typeof";return od=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},od(e)}function kpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Npe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gD(r.key),r)}}function $pe(e,t,n){return t&&Npe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gv(e,t,n){return t=gD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gD(e){var t=Mpe(e,"string");return od(t)=="symbol"?t:t+""}function Mpe(e,t){if(od(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(od(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ipe=function(){function e(){kpe(this,e),Gv(this,"activeIndex",0),Gv(this,"coordinateList",[]),Gv(this,"layout","horizontal")}return $pe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,a=n.container,s=a===void 0?null:a,l=n.layout,u=l===void 0?null:l,c=n.offset,f=c===void 0?null:c,p=n.mouseHandlerCallback,h=p===void 0?null:p;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=s??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=h??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,a=i.y,s=i.height,l=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,c=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+l+u,p=a+this.offset.top+s/2+c;this.mouseHandlerCallback({pageX:f,pageY:p})}}}])}();function Dpe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ne(r)&&ne(i))return!0}return!1}function Lpe(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function yD(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,a=at(t,n,r,i),s=at(t,n,r,o);return{points:[a,s],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function Fpe(e,t,n){var r,i,o,a;if(e==="horizontal")r=t.x,o=r,i=n.top,a=n.top+n.height;else if(e==="vertical")i=t.y,a=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var s=t.cx,l=t.cy,u=t.innerRadius,c=t.outerRadius,f=t.angle,p=at(s,l,u,f),h=at(s,l,c,f);r=p.x,i=p.y,o=h.x,a=h.y}else return yD(t);return[{x:r,y:i},{x:o,y:a}]}function ad(e){"@babel/helpers - typeof";return ad=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ad(e)}function NT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NT(Object(n),!0).forEach(function(r){Bpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bpe(e,t,n){return t=Upe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Upe(e){var t=zpe(e,"string");return ad(t)=="symbol"?t:t+""}function zpe(e,t){if(ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hpe(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,a=e.activeCoordinate,s=e.activePayload,l=e.offset,u=e.activeTooltipIndex,c=e.tooltipAxisBandSize,f=e.layout,p=e.chartName,h=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!h||!o||!a||p!=="ScatterChart"&&i!=="axis")return null;var v,y=Ol;if(p==="ScatterChart")v=a,y=Qse;else if(p==="BarChart")v=Lpe(f,a,l,c),y=q1;else if(f==="radial"){var x=yD(a),g=x.cx,m=x.cy,b=x.radius,S=x.startAngle,w=x.endAngle;v={cx:g,cy:m,startAngle:S,endAngle:w,innerRadius:b,outerRadius:b},y=c2}else v={points:Fpe(f,a,l)},y=Ol;var P=Sp(Sp(Sp(Sp({stroke:"#ccc",pointerEvents:"none"},l),v),ve(h,!1)),{},{payload:s,payloadIndex:u,className:Ae("recharts-tooltip-cursor",h.className)});return O.isValidElement(h)?O.cloneElement(h,P):O.createElement(y,P)}var Vpe=["item"],Wpe=["children","className","width","height","style","compact","title","desc"];function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function dl(){return dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dl.apply(this,arguments)}function $T(e,t){return Gpe(e)||qpe(e,t)||xD(e,t)||Kpe()}function Kpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
137
137
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qpe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Gpe(e){if(Array.isArray(e))return e}function MT(e,t){if(e==null)return{};var n=Xpe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xpe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ype(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qpe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bD(r.key),r)}}function Jpe(e,t,n){return t&&Qpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zpe(e,t,n){return t=Um(t),ehe(e,vD()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function ehe(e,t){if(t&&(vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return the(e)}function the(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vD=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function nhe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}function ew(e,t){return ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ew(e,t)}function xu(e){return ohe(e)||ihe(e)||xD(e)||rhe()}function rhe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
138
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xD(e,t){if(e){if(typeof e=="string")return tw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tw(e,t)}}function ihe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ohe(e){if(Array.isArray(e))return tw(e)}function tw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IT(Object(n),!0).forEach(function(r){Pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pe(e,t,n){return t=bD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bD(e){var t=ahe(e,"string");return vu(t)=="symbol"?t:t+""}function ahe(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var she={xAxis:["bottom","top"],yAxis:["left","right"]},lhe={width:"100%",height:"100%"},wD={x:0,y:0};function Op(e){return e}var uhe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},che=function(t,n,r,i){var o=n.find(function(c){return c&&c.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var a=o.coordinate,s=i.radius;return q(q(q({},i),at(i.cx,i.cy,s,a)),{},{angle:a,radius:s})}var l=o.coordinate,u=i.angle;return q(q(q({},i),at(i.cx,i.cy,l,u)),{},{angle:u,radius:l})}return wD},my=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,a=(r??[]).reduce(function(s,l){var u=l.props.data;return u&&u.length?[].concat(xu(s),xu(u)):s},[]);return a.length>0?a:t&&t.length&&ne(i)&&ne(o)?t.slice(i,o+1):[]};function SD(e){return e==="number"?[0,"auto"]:void 0}var nw=function(t,n,r,i){var o=t.graphicalItems,a=t.tooltipAxis,s=my(n,t);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(a.dataKey&&!a.allowDuplicatedCategory){var h=f===void 0?s:f;p=Dh(h,a.dataKey,i)}else p=f&&f[r]||s[r];return p?[].concat(xu(l),[K1(u,p)]):l},[])},DT=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},a=uhe(o,r),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=wie(a,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,p=nw(t,n,c,f),h=che(r,s,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:p,activeCoordinate:h}}return null},fhe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,p=t.stackOffset,h=XI(c,o);return r.reduce(function(v,y){var x,g=y.type.defaultProps!==void 0?q(q({},y.type.defaultProps),y.props):y.props,m=g.type,b=g.dataKey,S=g.allowDataOverflow,w=g.allowDuplicatedCategory,P=g.scale,j=g.ticks,E=g.includeHidden,A=g[a];if(v[A])return v;var C=my(t.data,{graphicalItems:i.filter(function(U){var V,W=a in U.props?U.props[a]:(V=U.type.defaultProps)===null||V===void 0?void 0:V[a];return W===A}),dataStartIndex:l,dataEndIndex:u}),T=C.length,_,R,$;Dpe(g.domain,S,m)&&(_=m0(g.domain,null,S),h&&(m==="number"||P!=="auto")&&($=Yc(C,b,"category")));var N=SD(m);if(!_||_.length===0){var I,B=(I=g.domain)!==null&&I!==void 0?I:N;if(b){if(_=Yc(C,b,m),m==="category"&&h){var k=u8(_);w&&k?(R=_,_=Cm(0,T)):w||(_=rC(B,_,y).reduce(function(U,V){return U.indexOf(V)>=0?U:[].concat(xu(U),[V])},[]))}else if(m==="category")w?_=_.filter(function(U){return U!==""&&!_e(U)}):_=rC(B,_,y).reduce(function(U,V){return U.indexOf(V)>=0||V===""||_e(V)?U:[].concat(xu(U),[V])},[]);else if(m==="number"){var L=Eie(C,i.filter(function(U){var V,W,Q=a in U.props?U.props[a]:(V=U.type.defaultProps)===null||V===void 0?void 0:V[a],G="hide"in U.props?U.props.hide:(W=U.type.defaultProps)===null||W===void 0?void 0:W.hide;return Q===A&&(E||!G)}),b,o,c);L&&(_=L)}h&&(m==="number"||P!=="auto")&&($=Yc(C,b,"category"))}else h?_=Cm(0,T):s&&s[A]&&s[A].hasStack&&m==="number"?_=p==="expand"?[0,1]:r2(s[A].stackGroups,l,u):_=GI(C,i.filter(function(U){var V=a in U.props?U.props[a]:U.type.defaultProps[a],W="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return V===A&&(E||!W)}),m,c,!0);if(m==="number")_=Z0(f,_,A,o,j),B&&(_=m0(B,_,S));else if(m==="category"&&B){var M=B,z=_.every(function(U){return M.indexOf(U)>=0});z&&(_=M)}}return q(q({},v),{},Pe({},A,q(q({},g),{},{axisType:o,domain:_,categoricalDomain:$,duplicateDomain:R,originalDomain:(x=g.domain)!==null&&x!==void 0?x:N,isCategorical:h,layout:c})))},{})},dhe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,p=my(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),h=p.length,v=XI(c,o),y=-1;return r.reduce(function(x,g){var m=g.type.defaultProps!==void 0?q(q({},g.type.defaultProps),g.props):g.props,b=m[a],S=SD("number");if(!x[b]){y++;var w;return v?w=Cm(0,h):s&&s[b]&&s[b].hasStack?(w=r2(s[b].stackGroups,l,u),w=Z0(f,w,b,o)):(w=m0(S,GI(p,r.filter(function(P){var j,E,A=a in P.props?P.props[a]:(j=P.type.defaultProps)===null||j===void 0?void 0:j[a],C="hide"in P.props?P.props.hide:(E=P.type.defaultProps)===null||E===void 0?void 0:E.hide;return A===b&&!C}),"number",c),i.defaultProps.allowDataOverflow),w=Z0(f,w,b,o)),q(q({},x),{},Pe({},b,q(q({axisType:o},i.defaultProps),{},{hide:!0,orientation:lr(she,"".concat(o,".").concat(y%2),null),domain:w,originalDomain:S,isCategorical:v,layout:c})))}return x},{})},phe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),p=ur(c,o),h={};return p&&p.length?h=fhe(t,{axes:p,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):a&&a.length&&(h=dhe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},hhe=function(t){var n=Mo(t),r=Wi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:x1(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:pm(n,r)}},LT=function(t){var n=t.children,r=t.defaultShowTooltip,i=ir(n,fa),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},mhe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Gi(n&&n.type);return r&&r.indexOf("Bar")>=0})},FT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ghe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,l=s===void 0?{}:s,u=r.width,c=r.height,f=r.children,p=r.margin||{},h=ir(f,fa),v=ir(f,ls),y=Object.keys(l).reduce(function(w,P){var j=l[P],E=j.orientation;return!j.mirror&&!j.hide?q(q({},w),{},Pe({},E,w[E]+j.width)):w},{left:p.left||0,right:p.right||0}),x=Object.keys(a).reduce(function(w,P){var j=a[P],E=j.orientation;return!j.mirror&&!j.hide?q(q({},w),{},Pe({},E,lr(w,"".concat(E))+j.height)):w},{top:p.top||0,bottom:p.bottom||0}),g=q(q({},x),y),m=g.bottom;h&&(g.bottom+=h.props.height||fa.defaultProps.height),v&&n&&(g=Pie(g,i,r,n));var b=u-g.left-g.right,S=c-g.top-g.bottom;return q(q({brushBottom:m},g),{},{width:Math.max(b,0),height:Math.max(S,0)})},yhe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gy=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,p=function(g,m){var b=m.graphicalItems,S=m.stackGroups,w=m.offset,P=m.updateId,j=m.dataStartIndex,E=m.dataEndIndex,A=g.barSize,C=g.layout,T=g.barGap,_=g.barCategoryGap,R=g.maxBarSize,$=FT(C),N=$.numericAxisName,I=$.cateAxisName,B=mhe(b),k=[];return b.forEach(function(L,M){var z=my(g.data,{graphicalItems:[L],dataStartIndex:j,dataEndIndex:E}),U=L.type.defaultProps!==void 0?q(q({},L.type.defaultProps),L.props):L.props,V=U.dataKey,W=U.maxBarSize,Q=U["".concat(N,"Id")],G=U["".concat(I,"Id")],le={},X=l.reduce(function(je,Se){var ze=m["".concat(Se.axisType,"Map")],te=U["".concat(Se.axisType,"Id")];ze&&ze[te]||Se.axisType==="zAxis"||Os();var pe=ze[te];return q(q({},je),{},Pe(Pe({},Se.axisType,pe),"".concat(Se.axisType,"Ticks"),Wi(pe)))},le),K=X[I],ee=X["".concat(I,"Ticks")],ie=S&&S[Q]&&S[Q].hasStack&&kie(L,S[Q].stackGroups),H=Gi(L.type).indexOf("Bar")>=0,Z=pm(K,ee),J=[],se=B&&Sie({barSize:A,stackGroups:S,totalSize:yhe(X,I)});if(H){var we,ae,be=_e(W)?R:W,ce=(we=(ae=pm(K,ee,!0))!==null&&ae!==void 0?ae:be)!==null&&we!==void 0?we:0;J=Oie({barGap:T,barCategoryGap:_,bandSize:ce!==Z?ce:Z,sizeList:se[G],maxBarSize:be}),ce!==Z&&(J=J.map(function(je){return q(q({},je),{},{position:q(q({},je.position),{},{offset:je.position.offset-ce/2})})}))}var Ee=L&&L.type&&L.type.getComposedData;Ee&&k.push({props:q(q({},Ee(q(q({},X),{},{displayedData:z,props:g,dataKey:V,item:L,bandSize:Z,barPosition:J,offset:w,stackedData:ie,layout:C,dataStartIndex:j,dataEndIndex:E}))),{},Pe(Pe(Pe({key:L.key||"item-".concat(M)},N,X[N]),I,X[I]),"animationId",P)),childIndex:S8(L,g.children),item:L})}),k},h=function(g,m){var b=g.props,S=g.dataStartIndex,w=g.dataEndIndex,P=g.updateId;if(!Qj({props:b}))return null;var j=b.children,E=b.layout,A=b.stackOffset,C=b.data,T=b.reverseStackOrder,_=FT(E),R=_.numericAxisName,$=_.cateAxisName,N=ur(j,r),I=Rie(C,N,"".concat(R,"Id"),"".concat($,"Id"),A,T),B=l.reduce(function(U,V){var W="".concat(V.axisType,"Map");return q(q({},U),{},Pe({},W,phe(b,q(q({},V),{},{graphicalItems:N,stackGroups:V.axisType===R&&I,dataStartIndex:S,dataEndIndex:w}))))},{}),k=ghe(q(q({},B),{},{props:b,graphicalItems:N}),m==null?void 0:m.legendBBox);Object.keys(B).forEach(function(U){B[U]=c(b,B[U],k,U.replace("Map",""),n)});var L=B["".concat($,"Map")],M=hhe(L),z=p(b,q(q({},B),{},{dataStartIndex:S,dataEndIndex:w,updateId:P,graphicalItems:N,stackGroups:I,offset:k}));return q(q({formattedGraphicalItems:z,graphicalItems:N,offset:k,stackGroups:I},M),B)},v=function(x){function g(m){var b,S,w;return Ype(this,g),w=Zpe(this,g,[m]),Pe(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pe(w,"accessibilityManager",new Ipe),Pe(w,"handleLegendBBoxUpdate",function(P){if(P){var j=w.state,E=j.dataStartIndex,A=j.dataEndIndex,C=j.updateId;w.setState(q({legendBBox:P},h({props:w.props,dataStartIndex:E,dataEndIndex:A,updateId:C},q(q({},w.state),{},{legendBBox:P}))))}}),Pe(w,"handleReceiveSyncEvent",function(P,j,E){if(w.props.syncId===P){if(E===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(j)}}),Pe(w,"handleBrushChange",function(P){var j=P.startIndex,E=P.endIndex;if(j!==w.state.dataStartIndex||E!==w.state.dataEndIndex){var A=w.state.updateId;w.setState(function(){return q({dataStartIndex:j,dataEndIndex:E},h({props:w.props,dataStartIndex:j,dataEndIndex:E,updateId:A},w.state))}),w.triggerSyncEvent({dataStartIndex:j,dataEndIndex:E})}}),Pe(w,"handleMouseEnter",function(P){var j=w.getMouseInfo(P);if(j){var E=q(q({},j),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var A=w.props.onMouseEnter;Oe(A)&&A(E,P)}}),Pe(w,"triggeredAfterMouseMove",function(P){var j=w.getMouseInfo(P),E=j?q(q({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(E),w.triggerSyncEvent(E);var A=w.props.onMouseMove;Oe(A)&&A(E,P)}),Pe(w,"handleItemMouseEnter",function(P){w.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),Pe(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Pe(w,"handleMouseMove",function(P){P.persist(),w.throttleTriggeredAfterMouseMove(P)}),Pe(w,"handleMouseLeave",function(P){w.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};w.setState(j),w.triggerSyncEvent(j);var E=w.props.onMouseLeave;Oe(E)&&E(j,P)}),Pe(w,"handleOuterEvent",function(P){var j=w8(P),E=lr(w.props,"".concat(j));if(j&&Oe(E)){var A,C;/.*touch.*/i.test(j)?C=w.getMouseInfo(P.changedTouches[0]):C=w.getMouseInfo(P),E((A=C)!==null&&A!==void 0?A:{},P)}}),Pe(w,"handleClick",function(P){var j=w.getMouseInfo(P);if(j){var E=q(q({},j),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var A=w.props.onClick;Oe(A)&&A(E,P)}}),Pe(w,"handleMouseDown",function(P){var j=w.props.onMouseDown;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"handleMouseUp",function(P){var j=w.props.onMouseUp;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),Pe(w,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&w.handleMouseDown(P.changedTouches[0])}),Pe(w,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&w.handleMouseUp(P.changedTouches[0])}),Pe(w,"handleDoubleClick",function(P){var j=w.props.onDoubleClick;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"handleContextMenu",function(P){var j=w.props.onContextMenu;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"triggerSyncEvent",function(P){w.props.syncId!==void 0&&Kv.emit(qv,w.props.syncId,P,w.eventEmitterSymbol)}),Pe(w,"applySyncEvent",function(P){var j=w.props,E=j.layout,A=j.syncMethod,C=w.state.updateId,T=P.dataStartIndex,_=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)w.setState(q({dataStartIndex:T,dataEndIndex:_},h({props:w.props,dataStartIndex:T,dataEndIndex:_,updateId:C},w.state)));else if(P.activeTooltipIndex!==void 0){var R=P.chartX,$=P.chartY,N=P.activeTooltipIndex,I=w.state,B=I.offset,k=I.tooltipTicks;if(!B)return;if(typeof A=="function")N=A(k,P);else if(A==="value"){N=-1;for(var L=0;L<k.length;L++)if(k[L].value===P.activeLabel){N=L;break}}var M=q(q({},B),{},{x:B.left,y:B.top}),z=Math.min(R,M.x+M.width),U=Math.min($,M.y+M.height),V=k[N]&&k[N].value,W=nw(w.state,w.props.data,N),Q=k[N]?{x:E==="horizontal"?k[N].coordinate:z,y:E==="horizontal"?U:k[N].coordinate}:wD;w.setState(q(q({},P),{},{activeLabel:V,activeCoordinate:Q,activePayload:W,activeTooltipIndex:N}))}else w.setState(P)}),Pe(w,"renderCursor",function(P){var j,E=w.state,A=E.isTooltipActive,C=E.activeCoordinate,T=E.activePayload,_=E.offset,R=E.activeTooltipIndex,$=E.tooltipAxisBandSize,N=w.getTooltipEventType(),I=(j=P.props.active)!==null&&j!==void 0?j:A,B=w.props.layout,k=P.key||"_recharts-cursor";return D.createElement(Hpe,{key:k,activeCoordinate:C,activePayload:T,activeTooltipIndex:R,chartName:n,element:P,isActive:I,layout:B,offset:_,tooltipAxisBandSize:$,tooltipEventType:N})}),Pe(w,"renderPolarAxis",function(P,j,E){var A=lr(P,"type.axisType"),C=lr(w.state,"".concat(A,"Map")),T=P.type.defaultProps,_=T!==void 0?q(q({},T),P.props):P.props,R=C&&C[_["".concat(A,"Id")]];return O.cloneElement(P,q(q({},R),{},{className:Ae(A,R.className),key:P.key||"".concat(j,"-").concat(E),ticks:Wi(R,!0)}))}),Pe(w,"renderPolarGrid",function(P){var j=P.props,E=j.radialLines,A=j.polarAngles,C=j.polarRadius,T=w.state,_=T.radiusAxisMap,R=T.angleAxisMap,$=Mo(_),N=Mo(R),I=N.cx,B=N.cy,k=N.innerRadius,L=N.outerRadius;return O.cloneElement(P,{polarAngles:Array.isArray(A)?A:Wi(N,!0).map(function(M){return M.coordinate}),polarRadius:Array.isArray(C)?C:Wi($,!0).map(function(M){return M.coordinate}),cx:I,cy:B,innerRadius:k,outerRadius:L,key:P.key||"polar-grid",radialLines:E})}),Pe(w,"renderLegend",function(){var P=w.state.formattedGraphicalItems,j=w.props,E=j.children,A=j.width,C=j.height,T=w.props.margin||{},_=A-(T.left||0)-(T.right||0),R=KI({children:E,formattedGraphicalItems:P,legendWidth:_,legendContent:u});if(!R)return null;var $=R.item,N=MT(R,Vpe);return O.cloneElement($,q(q({},N),{},{chartWidth:A,chartHeight:C,margin:T,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Pe(w,"renderTooltip",function(){var P,j=w.props,E=j.children,A=j.accessibilityLayer,C=ir(E,oi);if(!C)return null;var T=w.state,_=T.isTooltipActive,R=T.activeCoordinate,$=T.activePayload,N=T.activeLabel,I=T.offset,B=(P=C.props.active)!==null&&P!==void 0?P:_;return O.cloneElement(C,{viewBox:q(q({},I),{},{x:I.left,y:I.top}),active:B,label:N,payload:B?$:[],coordinate:R,accessibilityLayer:A})}),Pe(w,"renderBrush",function(P){var j=w.props,E=j.margin,A=j.data,C=w.state,T=C.offset,_=C.dataStartIndex,R=C.dataEndIndex,$=C.updateId;return O.cloneElement(P,{key:P.key||"_recharts-brush",onChange:vp(w.handleBrushChange,P.props.onChange),data:A,x:ne(P.props.x)?P.props.x:T.left,y:ne(P.props.y)?P.props.y:T.top+T.height+T.brushBottom-(E.bottom||0),width:ne(P.props.width)?P.props.width:T.width,startIndex:_,endIndex:R,updateId:"brush-".concat($)})}),Pe(w,"renderReferenceElement",function(P,j,E){if(!P)return null;var A=w,C=A.clipPathId,T=w.state,_=T.xAxisMap,R=T.yAxisMap,$=T.offset,N=P.type.defaultProps||{},I=P.props,B=I.xAxisId,k=B===void 0?N.xAxisId:B,L=I.yAxisId,M=L===void 0?N.yAxisId:L;return O.cloneElement(P,{key:P.key||"".concat(j,"-").concat(E),xAxis:_[k],yAxis:R[M],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:C})}),Pe(w,"renderActivePoints",function(P){var j=P.item,E=P.activePoint,A=P.basePoint,C=P.childIndex,T=P.isRange,_=[],R=j.props.key,$=j.item.type.defaultProps!==void 0?q(q({},j.item.type.defaultProps),j.item.props):j.item.props,N=$.activeDot,I=$.dataKey,B=q(q({index:C,dataKey:I,cx:E.x,cy:E.y,r:4,fill:W1(j.item),strokeWidth:2,stroke:"#fff",payload:E.payload,value:E.value},ve(N,!1)),Lh(N));return _.push(g.renderActiveDot(N,B,"".concat(R,"-activePoint-").concat(C))),A?_.push(g.renderActiveDot(N,q(q({},B),{},{cx:A.x,cy:A.y}),"".concat(R,"-basePoint-").concat(C))):T&&_.push(null),_}),Pe(w,"renderGraphicChild",function(P,j,E){var A=w.filterFormatItem(P,j,E);if(!A)return null;var C=w.getTooltipEventType(),T=w.state,_=T.isTooltipActive,R=T.tooltipAxis,$=T.activeTooltipIndex,N=T.activeLabel,I=w.props.children,B=ir(I,oi),k=A.props,L=k.points,M=k.isRange,z=k.baseLine,U=A.item.type.defaultProps!==void 0?q(q({},A.item.type.defaultProps),A.item.props):A.item.props,V=U.activeDot,W=U.hide,Q=U.activeBar,G=U.activeShape,le=!!(!W&&_&&B&&(V||Q||G)),X={};C!=="axis"&&B&&B.props.trigger==="click"?X={onClick:vp(w.handleItemMouseEnter,P.props.onClick)}:C!=="axis"&&(X={onMouseLeave:vp(w.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:vp(w.handleItemMouseEnter,P.props.onMouseEnter)});var K=O.cloneElement(P,q(q({},A.props),X));function ee(Se){return typeof R.dataKey=="function"?R.dataKey(Se.payload):null}if(le)if($>=0){var ie,H;if(R.dataKey&&!R.allowDuplicatedCategory){var Z=typeof R.dataKey=="function"?ee:"payload.".concat(R.dataKey.toString());ie=Dh(L,Z,N),H=M&&z&&Dh(z,Z,N)}else ie=L==null?void 0:L[$],H=M&&z&&z[$];if(G||Q){var J=P.props.activeIndex!==void 0?P.props.activeIndex:$;return[O.cloneElement(P,q(q(q({},A.props),X),{},{activeIndex:J})),null,null]}if(!_e(ie))return[K].concat(xu(w.renderActivePoints({item:A,activePoint:ie,basePoint:H,childIndex:$,isRange:M})))}else{var se,we=(se=w.getItemByXY(w.state.activeCoordinate))!==null&&se!==void 0?se:{graphicalItem:K},ae=we.graphicalItem,be=ae.item,ce=be===void 0?P:be,Ee=ae.childIndex,je=q(q(q({},A.props),X),{},{activeIndex:Ee});return[O.cloneElement(ce,je),null,null]}return M?[K,null,null]:[K,null]}),Pe(w,"renderCustomized",function(P,j,E){return O.cloneElement(P,q(q({key:"recharts-customized-".concat(E)},w.props),w.state))}),Pe(w,"renderMap",{CartesianGrid:{handler:Op,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:Op},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:Op},YAxis:{handler:Op},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=m.id)!==null&&b!==void 0?b:Fu("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=KM(w.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return nhe(g,x),Jpe(g,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,P=b.height,j=b.layout,E=ir(S,oi);if(E){var A=E.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=nw(this.state,w,A,C),_=this.state.tooltipTicks[A].coordinate,R=(this.state.offset.top+P)/2,$=j==="horizontal",N=$?{x:_,y:R}:{y:_,x:R},I=this.state.formattedGraphicalItems.find(function(k){var L=k.item;return L.type.name==="Scatter"});I&&(N=q(q({},N),I.props.points[A].tooltipPosition),T=I.props.points[A].tooltipPayload);var B={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:C,activePayload:T,activeCoordinate:N};this.setState(B),this.renderCursor(E),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,P;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(b){_b([ir(b.children,oi)],[ir(this.props.children,oi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=ir(this.props.children,oi);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),P=XZ(w),j={chartX:Math.round(b.pageX-P.left),chartY:Math.round(b.pageY-P.top)},E=w.width/S.offsetWidth||1,A=this.inRange(j.chartX,j.chartY,E);if(!A)return null;var C=this.state,T=C.xAxisMap,_=C.yAxisMap,R=this.getTooltipEventType(),$=DT(this.state,this.props.data,this.props.layout,A);if(R!=="axis"&&T&&_){var N=Mo(T).scale,I=Mo(_).scale,B=N&&N.invert?N.invert(j.chartX):null,k=I&&I.invert?I.invert(j.chartY):null;return q(q({},j),{},{xValue:B,yValue:k},$)}return $?q(q({},j),$):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,j=b/w,E=S/w;if(P==="horizontal"||P==="vertical"){var A=this.state.offset,C=j>=A.left&&j<=A.left+A.width&&E>=A.top&&E<=A.top+A.height;return C?{x:j,y:E}:null}var T=this.state,_=T.angleAxisMap,R=T.radiusAxisMap;if(_&&R){var $=Mo(_);return aC({x:j,y:E},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=ir(b,oi),P={};w&&S==="axis"&&(w.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=Lh(this.props,this.handleOuterEvent);return q(q({},j),P)}},{key:"addListener",value:function(){Kv.on(qv,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Kv.removeListener(qv,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var P=this.state.formattedGraphicalItems,j=0,E=P.length;j<E;j++){var A=P[j];if(A.item===b||A.props.key===b.key||S===Gi(A.item.type)&&w===A.childIndex)return A}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,S=this.state.offset,w=S.left,P=S.top,j=S.height,E=S.width;return D.createElement("defs",null,D.createElement("clipPath",{id:b},D.createElement("rect",{x:w,y:P,height:j,width:E})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(S,w){var P=$T(w,2),j=P[0],E=P[1];return q(q({},S),{},Pe({},j,E.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(S,w){var P=$T(w,2),j=P[0],E=P[1];return q(q({},S),{},Pe({},j,E.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[b])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(b){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[b])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(b){var S=this.state,w=S.formattedGraphicalItems,P=S.activeItem;if(w&&w.length)for(var j=0,E=w.length;j<E;j++){var A=w[j],C=A.props,T=A.item,_=T.type.defaultProps!==void 0?q(q({},T.type.defaultProps),T.props):T.props,R=Gi(T.type);if(R==="Bar"){var $=(C.data||[]).find(function(k){return Rse(b,k)});if($)return{graphicalItem:A,payload:$}}else if(R==="RadialBar"){var N=(C.data||[]).find(function(k){return aC(b,k)});if(N)return{graphicalItem:A,payload:N}}else if(ly(A,P)||uy(A,P)||Zf(A,P)){var I=xue({graphicalItem:A,activeTooltipItem:P,itemData:_.data}),B=_.activeIndex===void 0?I:_.activeIndex;return{graphicalItem:q(q({},A),{},{childIndex:B}),payload:Zf(A,P)?_.data[I]:A.props.data[I]}}}return null}},{key:"render",value:function(){var b=this;if(!Qj(this))return null;var S=this.props,w=S.children,P=S.className,j=S.width,E=S.height,A=S.style,C=S.compact,T=S.title,_=S.desc,R=MT(S,Wpe),$=ve(R,!1);if(C)return D.createElement(yT,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement(kb,dl({},$,{width:j,height:E,title:T,desc:_}),this.renderClipPath(),Zj(w,this.renderMap)));if(this.props.accessibilityLayer){var N,I;$.tabIndex=(N=this.props.tabIndex)!==null&&N!==void 0?N:0,$.role=(I=this.props.role)!==null&&I!==void 0?I:"application",$.onKeyDown=function(k){b.accessibilityManager.keyboardEvent(k)},$.onFocus=function(){b.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return D.createElement(yT,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement("div",dl({className:Ae("recharts-wrapper",P),style:q({position:"relative",cursor:"default",width:j,height:E},A)},B,{ref:function(L){b.container=L}}),D.createElement(kb,dl({},$,{width:j,height:E,title:T,desc:_,style:lhe}),this.renderClipPath(),Zj(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(O.Component);Pe(v,"displayName",n),Pe(v,"defaultProps",q({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Pe(v,"getDerivedStateFromProps",function(x,g){var m=x.dataKey,b=x.data,S=x.children,w=x.width,P=x.height,j=x.layout,E=x.stackOffset,A=x.margin,C=g.dataStartIndex,T=g.dataEndIndex;if(g.updateId===void 0){var _=LT(x);return q(q(q({},_),{},{updateId:0},h(q(q({props:x},_),{},{updateId:0}),g)),{},{prevDataKey:m,prevData:b,prevWidth:w,prevHeight:P,prevLayout:j,prevStackOffset:E,prevMargin:A,prevChildren:S})}if(m!==g.prevDataKey||b!==g.prevData||w!==g.prevWidth||P!==g.prevHeight||j!==g.prevLayout||E!==g.prevStackOffset||!bl(A,g.prevMargin)){var R=LT(x),$={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},N=q(q({},DT(g,b,j)),{},{updateId:g.updateId+1}),I=q(q(q({},R),$),N);return q(q(q({},I),h(q({props:x},I),g)),{},{prevDataKey:m,prevData:b,prevWidth:w,prevHeight:P,prevLayout:j,prevStackOffset:E,prevMargin:A,prevChildren:S})}if(!_b(S,g.prevChildren)){var B,k,L,M,z=ir(S,fa),U=z&&(B=(k=z.props)===null||k===void 0?void 0:k.startIndex)!==null&&B!==void 0?B:C,V=z&&(L=(M=z.props)===null||M===void 0?void 0:M.endIndex)!==null&&L!==void 0?L:T,W=U!==C||V!==T,Q=!_e(b),G=Q&&!W?g.updateId:g.updateId+1;return q(q({updateId:G},h(q(q({props:x},g),{},{updateId:G,dataStartIndex:U,dataEndIndex:V}),g)),{},{prevChildren:S,dataStartIndex:U,dataEndIndex:V})}return null}),Pe(v,"renderActiveDot",function(x,g,m){var b;return O.isValidElement(x)?b=O.cloneElement(x,g):Oe(x)?b=x(g):b=D.createElement(oy,g),D.createElement(Ie,{className:"recharts-active-dot",key:m},b)});var y=O.forwardRef(function(g,m){return D.createElement(v,dl({},g,{ref:m}))});return y.displayName=v.displayName,y},iO=gy({chartName:"BarChart",GraphicalChild:bo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:so},{axisType:"yAxis",AxisComp:lo}],formatAxisMap:F2}),vhe=gy({chartName:"PieChart",GraphicalChild:xo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:qu},{axisType:"radiusAxis",AxisComp:Td}],formatAxisMap:a2,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),OD=gy({chartName:"AreaChart",GraphicalChild:wo,axisComponents:[{axisType:"xAxis",AxisComp:so},{axisType:"yAxis",AxisComp:lo}],formatAxisMap:F2}),xhe=gy({chartName:"RadialBarChart",GraphicalChild:_d,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:qu},{axisType:"radiusAxis",AxisComp:Td}],formatAxisMap:a2,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const PD=O.createContext(null);function jD(){return O.useContext(PD)??{}}const bhe=["h-full w-full text-[10px]","[&_.recharts-cartesian-grid_line]:stroke-line","[&_.recharts-cartesian-axis-line]:stroke-line","[&_.recharts-cartesian-axis-tick-line]:stroke-line","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground","[&_.recharts-radial-bar-background-sector]:fill-panel-2","[&_.recharts-reference-line_line]:stroke-line","[&_.recharts-brush-texts_text]:fill-muted-foreground","[&_.recharts-sector]:outline-none","[&_.recharts-layer]:outline-none","[&_.recharts-surface]:outline-none"].join(" "),ED={height:18,travellerWidth:8,stroke:"var(--accent)",fill:"color-mix(in srgb, var(--panel-2) 80%, transparent)"};function whe(e){const t={};for(const[n,r]of Object.entries(e))r.color&&(t[`--color-${n}`]=r.color);return t}function Yi(e){return`var(--color-${e})`}function js({config:e,className:t,children:n}){const r=O.useMemo(()=>whe(e),[e]);return d.jsx(PD.Provider,{value:e,children:d.jsx("div",{"data-chart":"",className:gt(bhe,t),style:r,children:d.jsx(zZ,{width:"100%",height:"100%",children:n})})})}const bu=oi,rw=ls;function AD(e){return typeof e=="object"&&e!==null}function CD(e){return Array.isArray(e)?e.filter(AD):[]}function Xr(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e)}function She(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ohe(e){return AD(e.payload)?e.payload:void 0}function Phe(e){return Xr(e.dataKey)??Xr(e.name)}function jhe(e){return Xr(e.dataKey)??Xr(e.name)??Xr(e.value)}function iw(e,t){return e??`series-${t}`}function TD(e,t,n){var i,o;const r=t?(i=n[t])==null?void 0:i.color:void 0;return Xr((o=Ohe(e))==null?void 0:o.color)??r??Xr(e.color)??Xr(e.fill)}function _D(e,t,n){var i;return(t?(i=n[t])==null?void 0:i.label:void 0)??Xr(e.name)??t??""}function wu({active:e,payload:t,label:n,hideLabel:r=!1,hideIndicator:i=!1,labelFormatter:o,valueFormatter:a,className:s}){const l=jD(),u=CD(t);if(!e||u.length===0)return null;const c=Xr(n),f=c===void 0?null:(o==null?void 0:o(c))??c;return d.jsxs("div",{className:gt("min-w-[8rem] rounded border border-line bg-popover px-2 py-1.5 text-[11px] text-popover-foreground shadow-lg",s),children:[!r&&f!==null&&d.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:f}),d.jsx("div",{className:"grid gap-0.5",children:u.map((p,h)=>{const v=Phe(p),y=She(p.value),x=y!==void 0&&a?a(y,v??""):Xr(p.value)??"—",g=TD(p,v,l);return d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[!i&&d.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[2px] border border-line",style:g?{background:g}:void 0}),_D(p,v,l)]}),d.jsx("span",{className:"font-mono tabular-nums text-foreground",children:x})]},iw(v,h))})})]})}function ow({payload:e,hidden:t,onToggle:n,className:r}){const i=jD(),o=CD(e);return o.length===0?null:d.jsx("div",{className:gt("flex flex-wrap items-center justify-center gap-x-2 gap-y-1",r),children:o.map((a,s)=>{const l=jhe(a),u=l!==void 0&&(t==null?void 0:t.has(l))===!0,c=TD(a,l,i),f=d.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:c?{background:c}:void 0}),p=_D(a,l,i);return!n||l===void 0?d.jsxs("span",{className:"flex items-center gap-1.5 px-1 text-[10px] text-muted-foreground",children:[f,p]},iw(l,s)):d.jsxs(Xe,{variant:"ghost",size:"xs","aria-pressed":!u,title:u?`Show ${l}`:`Hide ${l}`,className:gt("gap-1.5 normal-case tracking-normal",u&&"opacity-40"),onClick:()=>n(l),children:[f,p]},iw(l,s))})})}function Ehe(){const[e,t]=O.useState(()=>new Set),n=O.useCallback(i=>{t(o=>{const a=new Set(o);return a.delete(i)||a.add(i),a})},[]),r=O.useCallback(i=>e.has(i),[e]);return{hidden:e,toggle:n,isHidden:r}}function Ahe(e,t){return function(r,...i){const o=new URL(e);return o.searchParams.set("code",r.toString()),i.forEach(a=>o.searchParams.append("args[]",a)),`${t} error #${r}; visit ${o} for the full message.`}}const gn=Ahe("https://base-ui.com/production-error","Base UI"),RD=O.createContext(void 0);function Xu(e){const t=O.useContext(RD);if(!e&&t===void 0)throw new Error(gn(27));return t}const BT={};function Fn(e,t){const n=O.useRef(BT);return n.current===BT&&(n.current=e(t)),n}function Es(e,t,n,r){const i=Fn(kD).current;return The(i,e,t,n,r)&&ND(i,[e,t,n,r]),i.callback}function Che(e){const t=Fn(kD).current;return _he(t,e)&&ND(t,e),t.callback}function kD(){return{callback:null,cleanup:null,refs:[]}}function The(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function _he(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function ND(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const a=o(n);typeof a=="function"&&(r[i]=a);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const a=r[i];typeof a=="function"?a():o(null);break}case"object":{o.current=null;break}}}}}}}const Rhe=parseInt(O.version,10);function oO(e){return Rhe>=e}function UT(e){if(!O.isValidElement(e))return null;const t=e,n=t.props;return(oO(19)?n==null?void 0:n.ref:t.ref)??null}function aw(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function St(){}const da=Object.freeze([]),$t=Object.freeze({});function khe(e,t){const n={};for(const r in e){const i=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](i);o!=null&&Object.assign(n,o);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Nhe(e,t){return typeof e=="function"?e(t):e}function $he(e,t){return typeof e=="function"?e(t):e}const aO={};function As(e,t,n,r,i){if(!n&&!r&&!i&&!e)return zm(t);let o=zm(e);return t&&(o=Mc(o,t)),n&&(o=Mc(o,n)),r&&(o=Mc(o,r)),i&&(o=Mc(o,i)),o}function Mhe(e){if(e.length===0)return aO;if(e.length===1)return zm(e[0]);let t=zm(e[0]);for(let n=1;n<e.length;n+=1)t=Mc(t,e[n]);return t}function zm(e){return sO(e)?{...MD(e,aO)}:Ihe(e)}function Mc(e,t){return sO(t)?MD(t,e):Dhe(e,t)}function Ihe(e){const t={...e};for(const n in t){const r=t[n];$D(n,r)&&(t[n]=ID(r))}return t}function Dhe(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=aw(e.style,r);break}case"className":{e[n]=DD(e.className,r);break}default:$D(n,r)?e[n]=Lhe(e[n],r):e[n]=r}}return e}function $D(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function sO(e){return typeof e=="function"}function MD(e,t){return sO(e)?e(t):e??aO}function Lhe(e,t){return t?e?(...n)=>{const r=n[0];if(LD(r)){const o=r;Hm(o);const a=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),a}const i=t(...n);return e==null||e(...n),i}:ID(t):e}function ID(e){return e&&((...t)=>{const n=t[0];return LD(n)&&Hm(n),e(...t)})}function Hm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function DD(e,t){return t?e?t+" "+e:t:e}function LD(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function tn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=zhe(r));const i=Fhe(t,n,r);if(n.enabled===!1)return null;const o=n.state??$t;return Hhe(e,r,i,o)}function Fhe(e,t,n){const{className:r,style:i}=e,{state:o=$t,ref:a,props:s,stateAttributesMapping:l,enabled:u=!0}=t,c=u?Nhe(r,o):void 0,f=u?$he(i,o):void 0,p=u?khe(o,l):$t,h=u&&s?Bhe(s):void 0,v=u?aw(p,h)??{}:$t;return typeof document<"u"&&(u?Array.isArray(a)?v.ref=Che([v.ref,UT(n),...a]):v.ref=Es(v.ref,UT(n),a):Es(null,null)),u?(c!==void 0&&(v.className=DD(v.className,c)),f!==void 0&&(v.style=aw(v.style,f)),v):$t}function Bhe(e){return Array.isArray(e)?Mhe(e):As(void 0,e)}const Uhe=Symbol.for("react.lazy");function zhe(e){if((e==null?void 0:e.$$typeof)!==Uhe)return e;const t=O.Children.toArray(e)[0];return O.isValidElement(t)?t:e}function Hhe(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=As(n,t.props);return i.ref=n.ref,O.cloneElement(t,i)}if(e&&typeof e=="string")return Vhe(e,n);throw new Error(gn(8))}function Vhe(e,t){return e==="button"?O.createElement("button",{type:"button",...t,key:t.key}):e==="img"?O.createElement("img",{alt:"",...t,key:t.key}):O.createElement(e,t)}const FD="data-starting-style",Whe="data-ending-style",Khe={[FD]:""},qhe={[Whe]:""},lO={transitionStatus(e){return e==="starting"?Khe:e==="ending"?qhe:null}},Ghe="data-open",Xhe="data-closed",Yhe="data-anchor-hidden",BD="data-popup-open",Qhe="data-pressed",Jhe={[BD]:""},Zhe={[BD]:"",[Qhe]:""},eme={[Ghe]:""},tme={[Xhe]:""},nme={[Yhe]:""},UD={open(e){return e?Jhe:null}},rme={open(e){return e?Zhe:null}},yy={open(e){return e?eme:tme},anchorHidden(e){return e?nme:null}},zD={...yy,...lO},ime=O.forwardRef(function(t,n){const{render:r,className:i,style:o,forceRender:a=!1,...s}=t,l=Xu(),u=l.useState("open"),c=l.useState("nested"),f=l.useState("mounted"),p=l.useState("transitionStatus");return tn("div",t,{state:{open:u,transitionStatus:p},ref:[l.context.backdropRef,n],stateAttributesMapping:zD,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},s],enabled:a||!c})});function vy(){return typeof window<"u"}function pn(e){return uO(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function So(e){var t;return(t=(uO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uO(e){return vy()?e instanceof Node||e instanceof ct(e).Node:!1}function Me(e){return vy()?e instanceof Element||e instanceof ct(e).Element:!1}function it(e){return vy()?e instanceof HTMLElement||e instanceof ct(e).HTMLElement:!1}function Su(e){return!vy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}function kd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function ome(e){return/^(table|td|th)$/.test(pn(e))}function xy(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ame=/transform|translate|scale|rotate|perspective|filter/,sme=/paint|layout|strict|content/,$a=e=>!!e&&e!=="none";let Xv;function cO(e){const t=Me(e)?dr(e):e;return $a(t.transform)||$a(t.translate)||$a(t.scale)||$a(t.rotate)||$a(t.perspective)||!fO()&&($a(t.backdropFilter)||$a(t.filter))||ame.test(t.willChange||"")||sme.test(t.contain||"")}function lme(e){let t=pa(e);for(;it(t)&&!aa(t);){if(cO(t))return t;if(xy(t))return null;t=pa(t)}return null}function fO(){return Xv==null&&(Xv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xv}function aa(e){return/^(html|body|#document)$/.test(pn(e))}function dr(e){return ct(e).getComputedStyle(e)}function by(e){return Me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pa(e){if(pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Su(e)&&e.host||So(e);return Su(t)?t.host:t}function HD(e){const t=pa(e);return aa(t)?(e.ownerDocument||e).body:it(t)&&kd(t)?t:HD(t)}function sd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=HD(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=ct(i);if(o){const s=sw(a);return t.concat(a,a.visualViewport||[],kd(i)?i:[],s&&n?sd(s):[])}else return t.concat(i,sd(i,[],n))}function sw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const dO={...MR},Yv=dO.useInsertionEffect,ume=Yv&&Yv!==dO.useLayoutEffect?Yv:e=>e();function de(e){const t=Fn(cme).current;return t.next=e,ume(t.effect),t.trampoline}function cme(){const e={next:void 0,callback:fme,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function fme(){}const dme=()=>{},fe=typeof document<"u"?O.useLayoutEffect:dme,VD=O.createContext(void 0);function pO(e=!1){const t=O.useContext(VD);if(t===void 0&&!e)throw new Error(gn(16));return t}function pme(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,a=r&&t!==!1,s=r&&t===!1;return{props:O.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(u.tabIndex=i,!o&&n&&(u.tabIndex=t?i:-1)),(o&&(t||a)||!o&&n)&&(u["aria-disabled"]=n),o&&(!t||s)&&(u.disabled=n),u},[r,n,t,a,s,o,i])}}function He(e){return(e==null?void 0:e.ownerDocument)||document}function Qv(e,t,{detail:n=0}={}){e.dispatchEvent(new(ct(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hO(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:o}=e,a=O.useRef(null),s=pO(!0),l=o??s!==void 0,{props:u}=pme({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),c=O.useCallback(()=>{const h=a.current;Jv(h)&&l&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,l]);fe(c,[c]);const f=O.useCallback((h={})=>{const{onClick:v,onMouseDown:y,onKeyUp:x,onKeyDown:g,onPointerDown:m,...b}=h;return As({onClick(S){if(t){S.preventDefault();return}v==null||v(S)},onMouseDown(S){t||y==null||y(S)},onKeyDown(S){if(t||(Hm(S),g==null||g(S),S.baseUIHandlerPrevented))return;const w=S.target===S.currentTarget,P=S.currentTarget,j=Jv(P),E=!i&&hme(P),A=w&&(i?j:!E),C=S.key==="Enter",T=S.key===" ",_=P.getAttribute("role"),R=(_==null?void 0:_.startsWith("menuitem"))||_==="option"||_==="gridcell";if(w&&l&&T){if(S.defaultPrevented&&R)return;S.preventDefault(),(!i||j)&&(S.preventBaseUIHandler(),Qv(P,S));return}if(!A||i||!T&&!C){w&&E&&T&&S.preventDefault();return}S.defaultPrevented||(S.preventDefault(),C&&(S.preventBaseUIHandler(),Qv(P,S)))},onKeyUp(S){if(!t){if(Hm(S),x==null||x(S),S.target===S.currentTarget&&i&&l&&Jv(S.currentTarget)&&S.key===" "){S.preventDefault();return}S.baseUIHandlerPrevented||S.target===S.currentTarget&&!i&&!l&&!S.defaultPrevented&&S.key===" "&&(S.preventBaseUIHandler(),Qv(S.currentTarget,S))}},onPointerDown(S){if(t){S.preventDefault();return}m==null||m(S)}},i?{type:"button"}:{role:"button"},u,b)},[t,u,l,i]),p=de(h=>{a.current=h,c()});return{getButtonProps:f,buttonRef:p}}function Jv(e){return it(e)&&e.tagName==="BUTTON"}function hme(e){return it(e)&&e.tagName==="A"&&!!e.href}const ha="none",Nd="trigger-press",Wn="trigger-hover",nh="trigger-focus",mO="outside-press",Zv="item-press",wy="focus-out",gO="escape-key",zT="list-navigation",mme="cancel-open",WD="disabled",HT="missing",VT="initial",KD="imperative-action",gme="window-resize";function $e(e,t,n,r){let i=!1,o=!1;const a=r??$t;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...a}}let WT=0;function yme(e,t="mui"){const[n,r]=O.useState(e),i=e||n;return O.useEffect(()=>{n==null&&(WT+=1,r(`${t}-${WT}`))},[n,t]),i}const KT=dO.useId;function Sy(e,t){if(KT!==void 0){const n=KT();return e??(t?`${t}-${n}`:n)}return yme(e,t)}function Yu(e){return Sy(e,"base-ui")}const vme=O.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...s}=t,l=Xu(),u=Yu(a);return l.useSyncedValueWithCleanup("descriptionElementId",u),tn("p",t,{ref:n,props:[{id:u},s]})});function yO(e){O.useEffect(e,da)}const Pc=0;class Jr{constructor(){Ze(this,"currentId",Pc);Ze(this,"clear",()=>{this.currentId!==Pc&&(clearTimeout(this.currentId),this.currentId=Pc)});Ze(this,"disposeEffect",()=>this.clear)}static create(){return new Jr}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Pc,n()},t)}isStarted(){return this.currentId!==Pc}}function cr(){const e=Fn(Jr.create).current;return yO(e.disposeEffect),e}function xme(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:bme,platform:wme,maxTouchPoints:Sme}=xme(),Oy=bme.toLowerCase(),ld=wme.toLowerCase(),Py=/^i(os$|p)/.test(ld)||ld==="macintel"&&Sme>1,qT="android",lw=ld===qT||Oy.includes(qT),qD=!Py&&ld.startsWith("mac");ld.startsWith("win");const Ome=qD||Py;var PR;const Oo=typeof CSS<"u"&&!!((PR=CSS.supports)!=null&&PR.call(CSS,"-webkit-backdrop-filter:none"));!Oo&&Oy.includes("firefox");!Oo&&Oy.includes("chrom");const Pme=Ome,vO=/jsdom|happydom/.test(Oy);function ai(e){e.preventDefault(),e.stopPropagation()}function jme(e){return"nativeEvent"in e}function jy(e){return e.pointerType===""&&e.isTrusted?!0:lw&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xO(e){return vO?!1:!lw&&e.width===0&&e.height===0||lw&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function sa(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Eme(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Mn(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function xe(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Su(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function cn(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const uw="data-base-ui-focusable",GD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ey="ArrowLeft",Ay="ArrowRight",XD="ArrowUp",bO="ArrowDown",cw="data-trigger-disabled";function Vm(e,t){if(!Me(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(cw);for(const[,r]of t.entries())if(xe(r,n))return!r.hasAttribute(cw);return!1}function ex(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ame(e){return e.matches("html,body")}function Cy(e){return it(e)&&e.matches(GD)}function Cme(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${GD}`))!=null}function fw(e){return e?e.getAttribute("role")==="combobox"&&Cy(e):!1}function Tme(e){if(!e||vO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Wm(e){return e?e.hasAttribute(uw)?e:e.querySelector(`[${uw}]`)||e:null}function _me(e,t){return t!=null&&!sa(t)?0:typeof e=="function"?e():e}function Cs(e,t,n){const r=_me(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function GT(e){return typeof e=="function"?e():e}function YD(e,t){return t||e==="click"||e==="mousedown"}function Rme(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const QD=O.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Jr,currentIdRef:{current:null},currentContextRef:{current:null}});function kme(e,t){e.current=t.current}function Nme(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=O.useRef(n),o=O.useRef(n),a=O.useRef(null),s=O.useRef(null),l=cr();return fe(()=>{if(o.current=n,!a.current){i.current=n;return}i.current={open:Cs(i.current,"open"),close:Cs(n,"close")}},[n,a,i,o]),d.jsx(QD.Provider,{value:O.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:o,currentIdRef:a,timeoutMs:r,currentContextRef:s,timeout:l}),[r,l]),children:t})}function $me(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),o=O.useContext(QD),{currentIdRef:a,delayRef:s,timeoutMs:l,initialDelayRef:u,currentContextRef:c,hasProvider:f,timeout:p}=o,[h,v]=O.useState(!1),y=O.useRef(n);return fe(()=>{y.current=n},[n]),fe(()=>{function x(){var g;(g=c.current)==null||g.setIsInstantPhase(!1),a.current=null,c.current=null,s.current=u.current,p.clear()}if(a.current&&!n&&a.current===i){if(v(!1),l){const g=i;return p.start(l,()=>{r.select("open")||a.current&&a.current!==g||x()}),()=>{(y.current||a.current!==g)&&p.clear()}}x()}},[n,i,a,s,l,u,c,p,r]),fe(()=>{if(!n)return;const x=c.current,g=a.current;p.clear(),c.current={onOpenChange:r.setOpen,setIsInstantPhase:v},a.current=i,s.current={open:0,close:Cs(u.current,"close")},g!==null&&g!==i?(v(!0),x==null||x.setIsInstantPhase(!0),x==null||x.onOpenChange(!1,$e(ha))):(v(!1),x==null||x.setIsInstantPhase(!1))},[n,i,r,a,s,u,c,p]),fe(()=>()=>{if(a.current===i){if(c.current=null,!y.current)return;a.current=null,kme(s,u),p.clear()}},[c,a,s,i,u,p]),O.useMemo(()=>({activeIdRef:a,hasProvider:f,delayRef:s,isInstantPhase:h}),[a,f,s,h])}function Ne(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wi(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Rt(e){const t=Fn(Mme,e).current;return t.next=e,fe(t.effect),t}function Mme(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Pp=null;class Ime{constructor(){Ze(this,"callbacks",[]);Ze(this,"callbacksCount",0);Ze(this,"nextId",1);Ze(this,"startId",1);Ze(this,"isScheduled",!1);Ze(this,"tick",t=>{var i;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(i=n[o])==null||i.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let jp=new Ime;class fi{constructor(){Ze(this,"currentId",Pp);Ze(this,"cancel",()=>{this.currentId!==Pp&&(jp.cancel(this.currentId),this.currentId=Pp)});Ze(this,"disposeEffect",()=>this.cancel)}static create(){return new fi}static request(t){return jp.request(t)}static cancel(t){return jp.cancel(t)}request(t){this.cancel(),this.currentId=jp.request(()=>{this.currentId=Pp,t()})}}function Ou(){const e=Fn(fi.create).current;return yO(e.disposeEffect),e}const JD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ZD={...JD,position:"fixed",top:0,left:0},Dme={...JD,position:"absolute"},Km=O.forwardRef(function(t,n){const[r,i]=O.useState();fe(()=>{Pme&&Oo&&i("button")},[]);const o={tabIndex:0,role:r};return d.jsx("span",{...t,ref:n,style:ZD,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Pu=Math.min,Qi=Math.max,qm=Math.round,Ep=Math.floor,Ji=e=>({x:e,y:e}),Lme={left:"right",right:"left",bottom:"top",top:"bottom"};function eL(e,t,n){return Qi(e,Pu(t,n))}function ma(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function wO(e){return e==="x"?"y":"x"}function SO(e){return e==="y"?"height":"width"}function Er(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function OO(e){return wO(Er(e))}function Fme(e,t,n){n===void 0&&(n=!1);const r=uo(e),i=OO(e),o=SO(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Gm(a)),[a,Gm(a)]}function Bme(e){const t=Gm(e);return[dw(e),t,dw(t)]}function dw(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const XT=["left","right"],YT=["right","left"],Ume=["top","bottom"],zme=["bottom","top"];function Hme(e,t,n){switch(e){case"top":case"bottom":return n?t?YT:XT:t?XT:YT;case"left":case"right":return t?Ume:zme;default:return[]}}function Vme(e,t,n,r){const i=uo(e);let o=Hme(Cr(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(dw)))),o}function Gm(e){const t=Cr(e);return Lme[t]+e.slice(t.length)}function Wme(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function tL(e){return typeof e!="number"?Wme(e):{top:e,right:e,bottom:e,left:e}}function ud(e){const{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 ef(e,t){return t<0||t>=e.length}function rh(e,t){return Ki(e.current,{disabledIndices:t})}function pw(e,t){return Ki(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ki(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let o=t;do o+=n?-i:i;while(o>=0&&o<=e.length-1&&Pl(e,o,r));return o}function Pl(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const i=e[t];return i?!Ty(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function Kme(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Ty(e,t=e?dr(e):null){return!e||!e.isConnected||!t||Kme(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const qme='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Gme(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Su(n)?n.host:null}function hw(e){for(const t of Array.from(e.children))if(pn(t)==="summary")return t;return null}function Xme(e,t){const n=hw(t);return!!n&&(e===n||xe(n,e))}function nL(e){const t=e?pn(e):"";return e!=null&&e.matches(qme)&&(t!=="summary"||e.parentElement!=null&&pn(e.parentElement)==="details"&&hw(e.parentElement)===e)&&(t!=="details"||hw(e)==null)&&(t!=="input"||e.type!=="hidden")}function rL(e){if(!nL(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Gme(t)){const n=t!==e,r=pn(t)==="slot";if(t.hasAttribute("inert")||n&&pn(t)==="details"&&!t.open&&!Xme(e,t)||t.hasAttribute("hidden")||!r&&!Yme(t,n))return!1}return!0}function Yme(e,t){const n=dr(e);return t?n.display!=="none":Ty(e,n)}function iL(e){const t=e.tabIndex;if(t<0){const n=pn(e);if(n==="details"||n==="audio"||n==="video"||it(e)&&e.isContentEditable)return 0}return t}function tx(e){if(pn(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Qme(e,t){const n=tx(e);if(!n)return!0;const r=t.find(i=>{const o=tx(i);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(i=>{const o=tx(i);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function oL(e){if(it(e)&&pn(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return it(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function aL(e,t){oL(e).forEach(n=>{nL(n)&&t.push(n),aL(n,t)})}function sL(e,t,n){oL(e).forEach(r=>{it(r)&&r.matches(t)&&n.push(r),sL(r,t,n)})}function PO(e){return rL(e)&&iL(e)>=0}function lL(e){const t=[];return aL(e,t),t.filter(rL)}function _y(e){const t=lL(e);return t.filter(n=>iL(n)>=0&&Qme(n,t))}function uL(e,t){const n=_y(e),r=n.length;if(r===0)return;const i=Mn(He(e)),o=n.indexOf(i),a=o===-1?t===1?0:r-1:o+t;return n[a]}function cL(e){return uL(He(e).body,1)||e}function fL(e){return uL(He(e).body,-1)||e}function tf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!xe(n,r)}function Jme(e){_y(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function QT(e){const t=[];sL(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ga(e,t,n=!0){return e.filter(i=>i.parentId===t).flatMap(i=>{var o;return[...!n||(o=i.context)!=null&&o.open?[i]:[],...ga(e,i.id,n)]})}function JT(e,t){var i;let n=[],r=(i=e.find(o=>o.id===t))==null?void 0:i.parentId;for(;r;){const o=e.find(a=>a.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function cd(e){return`data-base-ui-${e}`}let Ap=0;function ih(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ap);function o(){i&&!i()||e==null||e.focus({preventScroll:n})}if(r)return o(),St;const a=requestAnimationFrame(o);return Ap=a,()=>{Ap===a&&(cancelAnimationFrame(a),Ap=0)}}const nx={inert:new WeakMap,"aria-hidden":new WeakMap},ZT="data-base-ui-inert",mw={inert:new WeakSet,"aria-hidden":new WeakSet};let jc=new WeakMap,rx=0;function Zme(e){return mw[e]}function dL(e){return e?Su(e)?e.host:dL(e.parentNode):null}const e_=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=dL(n);return e.contains(r)?r:null}).filter(n=>n!=null),t_=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},n_=(e,t,n)=>{const r=[],i=o=>{!o||n.has(o)||Array.from(o.children).forEach(a=>{pn(a)!=="script"&&(t.has(a)?i(a):r.push(a))})};return i(e),r};function ege(e,t,n,r,{mark:i=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let a=null,s=null;const l=e_(t,e),u=i?n_(t,t_(l),new Set(l)):[],c=[],f=[];if(o){const p=nx[o],h=Zme(o);s=h,a=p;const v=e_(t,Array.from(t.querySelectorAll("[aria-live]"))),y=l.concat(v);n_(t,t_(y),new Set(y)).forEach(g=>{const m=g.getAttribute(o),b=m!==null&&m!=="false",S=(p.get(g)||0)+1;p.set(g,S),c.push(g),S===1&&b&&h.add(g),b||g.setAttribute(o,o==="inert"?"":"true")})}return i&&u.forEach(p=>{const h=(jc.get(p)||0)+1;jc.set(p,h),f.push(p),h===1&&p.setAttribute(ZT,"")}),rx+=1,()=>{a&&c.forEach(p=>{const v=(a.get(p)||0)-1;a.set(p,v),v||(!(s!=null&&s.has(p))&&o&&p.removeAttribute(o),s==null||s.delete(p))}),i&&f.forEach(p=>{const h=(jc.get(p)||0)-1;jc.set(p,h),h||p.removeAttribute(ZT)}),rx-=1,rx||(nx.inert=new WeakMap,nx["aria-hidden"]=new WeakMap,mw.inert=new WeakSet,mw["aria-hidden"]=new WeakSet,jc=new WeakMap)}}function r_(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,o=He(e[0]).body;return ege(e,o,n,r,{mark:i})}const tge={style:{transition:"none"}},nge="data-base-ui-click-trigger",rge={fallbackAxisSide:"none"},ige={fallbackAxisSide:"end"},oge={clipPath:"inset(50%)",position:"fixed",top:0,left:0},pL=O.createContext(null),hL=()=>O.useContext(pL),age=cd("portal");function mL(e={}){const{ref:t,container:n,componentProps:r=$t,elementProps:i}=e,o=Sy(),a=hL(),s=a==null?void 0:a.portalNode,[l,u]=O.useState(null),[c,f]=O.useState(null),p=de(x=>{x!==null&&f(x)}),h=O.useRef(null);fe(()=>{if(n===null){h.current&&(h.current=null,f(null),u(null));return}const x=(n&&(uO(n)?n:n.current))??s??document.body;if(x==null){h.current&&(h.current=null,f(null),u(null));return}h.current!==x&&(h.current=x,f(null),u(x))},[n,s]);const v=tn("div",r,{ref:[t,p],props:[{id:o,[age]:""},i]}),y=l&&v?po.createPortal(v,l):null;return{node:c,nodeId:O.isValidElement(v)?v.props.id:void 0,subtree:y}}const gL=O.forwardRef(function(t,n){const{render:r,className:i,style:o,children:a,container:s,portalOwnerRole:l,...u}=t,{node:c,nodeId:f,subtree:p}=mL({container:s,ref:n,componentProps:t,elementProps:u}),h=O.useRef(null),v=O.useRef(null),y=O.useRef(null),x=O.useRef(null),[g,m]=O.useState(null),b=O.useRef(!1),S=g==null?void 0:g.modal,w=g==null?void 0:g.open,P=!!g&&!g.modal&&g.open&&!!c;O.useEffect(()=>{if(!c||S)return;function E(A){c&&A.relatedTarget&&tf(A)&&(A.type==="focusin"?b.current&&(QT(c),b.current=!1):(Jme(c),b.current=!0))}return wi(Ne(c,"focusin",E,!0),Ne(c,"focusout",E,!0))},[c,S]),fe(()=>{!c||w!==!0||!b.current||(QT(c),b.current=!1)},[w,c]);const j=O.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:v,beforeInsideRef:y,afterInsideRef:x,portalNode:c,setFocusManagerState:m}),[c]);return d.jsxs(O.Fragment,{children:[p,d.jsxs(pL.Provider,{value:j,children:[P&&c&&d.jsx(Km,{"data-type":"outside",ref:h,onFocus:E=>{var A;if(tf(E,c))(A=y.current)==null||A.focus();else{const C=g?g.domReference:null,T=fL(C);T==null||T.focus()}}}),P&&c&&d.jsx("span",{role:l,"aria-owns":f,style:oge}),c&&po.createPortal(a,c),P&&c&&d.jsx(Km,{"data-type":"outside",ref:v,onFocus:E=>{var A;if(tf(E,c))(A=x.current)==null||A.focus();else{const C=g?g.domReference:null,T=cL(C);T==null||T.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,$e(wy,E.nativeEvent)))}}})]})]})});function sge(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const lge=O.createContext(null),uge=O.createContext(null),Ry=()=>{var e;return((e=O.useContext(lge))==null?void 0:e.id)||null},Qu=e=>{const t=O.useContext(uge);return e??t};function ki(e){return e==null?e:"current"in e?e.current:e}function cge(e,t){const n=ct(cn(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const i_=20;let Xo=[];function jO(){Xo=Xo.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function o_(e){jO(),e&&pn(e)!=="body"&&(Xo.push(new WeakRef(e)),Xo.length>i_&&(Xo=Xo.slice(-i_)))}function a_(){var e;return jO(),(e=Xo[Xo.length-1])==null?void 0:e.deref()}function fge(e){return e?PO(e)?e:_y(e)[0]||e:null}function s_(e){var i;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((i=e.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=lL(e).filter(o=>{const a=o.getAttribute("data-tabindex")||"";return PO(o)||o.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function yL(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:o=!0,restoreFocus:a=!1,modal:s=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:c,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:h,getInsideElements:v}=e,y="rootStore"in t?t.rootStore:t,x=y.useState("open"),g=y.useState("domReferenceElement"),m=y.useState("floatingElement"),{events:b,dataRef:S}=y.context,w=de(()=>{var H;return(H=S.current.floatingContext)==null?void 0:H.nodeId}),P=i===!1,j=fw(g)&&P,E=Rt(i),A=Rt(o),C=Rt(u),T=Rt(x),_=Qu(h),R=hL(),$=O.useRef(!1),N=O.useRef(!1),I=O.useRef(!1),B=O.useRef(null),k=O.useRef(""),L=O.useRef(""),M=O.useRef(null),z=O.useRef(null),U=Es(M,p,R==null?void 0:R.beforeInsideRef),V=Es(z,R==null?void 0:R.afterInsideRef),W=cr(),Q=cr(),G=Ou(),le=R!=null,X=Wm(m),K=de((H=X)=>H?_y(H):[]),ee=de(()=>(v==null?void 0:v().filter(H=>H!=null))??[]);O.useEffect(()=>{if(r||!s)return;function H(J){J.key==="Tab"&&xe(X,Mn(He(X)))&&K().length===0&&!j&&ai(J)}const Z=He(X);return Ne(Z,"keydown",H)},[r,X,s,j,K]),O.useEffect(()=>{if(r||!x)return;const H=He(X);function Z(){I.current=!1}function J(we){const ae=cn(we),be=ee(),ce=xe(m,ae)||xe(g,ae)||xe(R==null?void 0:R.portalNode,ae)||be.some(Ee=>Ee===ae||xe(Ee,ae));I.current=!ce,L.current=we.pointerType||"keyboard",ae!=null&&ae.closest(`[${nge}]`)&&(N.current=!0,Q.start(0,()=>{N.current=!1}))}function se(){L.current="keyboard"}return wi(Ne(H,"pointerdown",J,!0),Ne(H,"pointerup",Z,!0),Ne(H,"pointercancel",Z,!0),Ne(H,"keydown",se,!0),Z)},[r,m,g,X,x,R,Q,ee]),O.useEffect(()=>{if(r||!l)return;const H=He(X);function Z(){N.current=!0,Q.start(0,()=>{N.current=!1})}function J(be){const ce=cn(be);PO(ce)&&(B.current=ce)}function se(be){const ce=be.relatedTarget,Ee=be.currentTarget,je=cn(be);s&&ce==null&&je!=null&&xe(m,je)&&o_(je),queueMicrotask(()=>{const Se=w(),ze=y.context.triggerElements,te=ee(),pe=(ce==null?void 0:ce.hasAttribute(cd("focus-guard")))&&[M.current,z.current,R==null?void 0:R.beforeInsideRef.current,R==null?void 0:R.afterInsideRef.current,R==null?void 0:R.beforeOutsideRef.current,R==null?void 0:R.afterOutsideRef.current,ki(f),ki(c)].includes(ce),oe=!(xe(g,ce)||xe(m,ce)||xe(ce,m)||xe(R==null?void 0:R.portalNode,ce)||te.some(Y=>Y===ce||xe(Y,ce))||ze.hasMatchingElement(Y=>xe(Y,ce))||pe||_&&(ga(_.nodesRef.current,Se).find(Y=>{var ge,Ce;return xe((ge=Y.context)==null?void 0:ge.elements.floating,ce)||xe((Ce=Y.context)==null?void 0:Ce.elements.domReference,ce)})||JT(_.nodesRef.current,Se).find(Y=>{var ge,Ce,Fe;return[(ge=Y.context)==null?void 0:ge.elements.floating,Wm((Ce=Y.context)==null?void 0:Ce.elements.floating)].includes(ce)||((Fe=Y.context)==null?void 0:Fe.elements.domReference)===ce})));if(Ee===g&&X&&s_(X),a&&Ee!==g&&!Ty(je)&&Mn(H)===H.body){if(it(X)&&(X.focus(),a==="popup")){G.request(()=>{X.focus()});return}const Y=K(),ge=B.current,Ce=(ge&&Y.includes(ge)?ge:null)||Y[Y.length-1]||X;it(Ce)&&Ce.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(j||!s)&&ce&&oe&&!N.current&&(j||ce!==a_())&&($.current=!0,y.setOpen(!1,$e(wy,be)))})}function we(){I.current||(S.current.insideReactTree=!0,W.start(0,()=>{S.current.insideReactTree=!1}))}const ae=it(g)?g:null;if(!(!m&&!ae))return wi(ae&&Ne(ae,"focusout",se),ae&&Ne(ae,"pointerdown",Z),m&&Ne(m,"focusin",J),m&&Ne(m,"focusout",se),m&&R&&Ne(m,"focusout",we,!0))},[r,g,m,X,s,_,R,y,l,a,K,j,w,S,W,Q,G,c,f,ee]),O.useEffect(()=>{var Ee,je,Se;if(r||!m||!x)return;const H=Array.from(((Ee=R==null?void 0:R.portalNode)==null?void 0:Ee.querySelectorAll(`[${cd("portal")}]`))||[]),J=(Se=(je=(_?JT(_.nodesRef.current,w()):[]).find(ze=>{var te;return fw(((te=ze.context)==null?void 0:te.elements.domReference)||null)}))==null?void 0:je.context)==null?void 0:Se.elements.domReference,we=[...[m,...H,M.current,z.current,R==null?void 0:R.beforeOutsideRef.current,R==null?void 0:R.afterOutsideRef.current,...ee()],J,ki(f),ki(c),j?g:null].filter(ze=>ze!=null),ae=r_(we,{ariaHidden:s||j,mark:!1}),be=[m,...H].filter(ze=>ze!=null),ce=r_(be);return()=>{ce(),ae()}},[x,r,g,m,s,R,j,_,w,c,f,ee]),fe(()=>{if(!x||r||!it(X))return;k.current="",L.current="";const H=He(X),Z=Mn(H);queueMicrotask(()=>{const J=E.current,se=typeof J=="function"?J(C.current||""):J;if(se===void 0||se===!1||xe(X,Z))return;let ae=null;const be=()=>(ae==null&&(ae=K(X)),ae[0]||X);let ce;se===!0||se===null?ce=be():ce=ki(se),ce=ce||be();const Ee=xe(X,Mn(H));ih(ce,{preventScroll:ce===X,shouldFocus(){if(!T.current)return!1;if(Ee)return!0;const je=Mn(H);return!(je!==ce&&xe(X,je))}})})},[r,x,X,K,E,C,T]),fe(()=>{if(r||!X)return;const H=He(X),Z=Mn(H),J=C.current==null;o_(Z);function se(ae){if(ae.open||(k.current=cge(ae.nativeEvent,L.current)),ae.reason===Wn&&ae.nativeEvent.type==="mouseleave"&&($.current=!0),ae.reason===mO)if(ae.nested)$.current=!1;else if(jy(ae.nativeEvent)||xO(ae.nativeEvent))$.current=!1;else{let be=!1;He(X).createElement("div").focus({get preventScroll(){return be=!0,!1}}),be?$.current=!1:$.current=!0}}b.on("openchange",se);function we(ae){const be=A.current;let ce=typeof be=="function"?be(ae):be;if(ce===void 0||ce===!1)return null;ce===null&&(ce=!0);const Ee=g!=null&&g.isConnected?g:null,je=Z!=null&&Z.isConnected&&pn(Z)!=="body"?Z:null;let Se=J?je||Ee:Ee||je;return Se||(Se=a_()||null),typeof ce=="boolean"?Se:ki(ce)||Se||null}return()=>{b.off("openchange",se);const ae=Mn(H),be=ee(),ce=xe(m,ae)||be.some(ze=>ze===ae||xe(ze,ae))||_&&ga(_.nodesRef.current,w(),!1).some(ze=>{var te;return xe((te=ze.context)==null?void 0:te.elements.floating,ae)}),Ee=A.current,je=k.current,Se=we(je);queueMicrotask(()=>{const ze=fge(Se),te=typeof Ee!="boolean";if(Ee&&!$.current&&it(ze)&&(!(!te&&ze!==ae&&ae!==H.body)||ce)){const pe={preventScroll:!0};je==="keyboard"&&(pe.focusVisible=!0),ze.focus(pe)}$.current=!1})}},[r,m,X,A,C,b,_,g,w,ee]),fe(()=>{if(!Oo||x||!m)return;const H=Mn(He(m));!it(H)||!Cy(H)||xe(m,H)&&H.blur()},[x,m]),fe(()=>{if(!(r||!R))return R.setFocusManagerState({modal:s,closeOnFocusOut:l,open:x,onOpenChange:y.setOpen,domReference:g}),()=>{R.setFocusManagerState(null)}},[r,R,s,x,y,l,g]),fe(()=>{if(!(r||!X))return s_(X),()=>{queueMicrotask(jO)}},[r,X]);const ie=!r&&(s?!j:!0)&&(le||s);return d.jsxs(O.Fragment,{children:[ie&&d.jsx(Km,{"data-type":"inside",ref:U,onFocus:H=>{var Z;if(s){const J=K();ih(J[J.length-1])}else if(R!=null&&R.portalNode)if($.current=!1,tf(H,R.portalNode)){const J=cL(g);J==null||J.focus()}else(Z=ki(f??R.beforeOutsideRef))==null||Z.focus()}}),n,ie&&d.jsx(Km,{"data-type":"inside",ref:V,onFocus:H=>{var Z;if(s)ih(K()[0]);else if(R!=null&&R.portalNode)if(l&&($.current=!0),tf(H,R.portalNode)){const J=fL(g);J==null||J.focus()}else(Z=ki(c??R.afterOutsideRef))==null||Z.focus()}})]})}function dge(e,t={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:a=!0,touchOpenDelay:s=0,reason:l=Nd}=t,u="rootStore"in e?e.rootStore:e,c=u.context.dataRef,f=O.useRef(void 0),p=Ou(),h=cr(),v=O.useMemo(()=>{function y(g,m,b,S){const w=$e(l,m,b);g&&S==="touch"&&s>0?h.start(s,()=>{u.setOpen(!0,w)}):u.setOpen(g,w)}function x(g,m,b){const S=c.current.openEvent,w=u.select("domReferenceElement")!==m;return g&&w||!g||!i?!0:S&&a?!b(S.type):!1}return{onPointerDown(g){f.current=sa(g.pointerType,!0)&&xO(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const m=f.current,b=g.nativeEvent,S=u.select("open");if(g.button!==0||r==="click"||sa(m,!0)&&o)return;const w=x(S,g.currentTarget,E=>E==="click"||E==="mousedown"),P=cn(b);if(Cy(P)){y(w,b,P,m);return}const j=g.currentTarget;p.request(()=>{y(w,b,j,m)})},onClick(g){if(r==="mousedown-only")return;const m=f.current;if(r==="mousedown"&&m){f.current=void 0;return}if(sa(m,!0)&&o)return;const b=u.select("open"),S=x(b,g.currentTarget,w=>w==="click"||w==="mousedown"||w==="keydown"||w==="keyup");y(S,g.nativeEvent,g.currentTarget,m)},onKeyDown(){f.current=void 0}}},[c,r,o,l,u,a,i,p,h,s]);return O.useMemo(()=>n?{reference:v}:$t,[n,v])}function pge(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){var h;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",s=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(((h=t.dataRef.current.openEvent)==null?void 0:h.type)||"")&&t.pointerType!=="touch";let u=o.width,c=o.height,f=o.x,p=o.y;return n==null&&t.x&&a&&(n=o.x-t.x),r==null&&t.y&&s&&(r=o.y-t.y),f-=n||0,p-=r||0,u=0,c=0,!i||l?(u=t.axis==="y"?o.width:0,c=t.axis==="x"?o.height:0,f=a&&t.x!=null?t.x:f,p=s&&t.y!=null?t.y:p):i&&!l&&(c=t.axis==="x"?o.height:c,u=t.axis==="y"?o.width:u),i=!0,{width:u,height:c,x:f,y:p,top:p,right:f+u,bottom:p+c,left:f}}}}function l_(e){return e!=null&&e.clientX!=null}function hge(e,t={}){const{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,o=i.useState("open"),a=i.useState("floatingElement"),s=i.useState("domReferenceElement"),l=i.context.dataRef,u=O.useRef(!1),c=O.useRef(null),[f,p]=O.useState(),[h,v]=O.useState([]),y=de(S=>{i.set("positionReference",S)}),x=de((S,w,P)=>{u.current||l.current.openEvent&&!l_(l.current.openEvent)||i.set("positionReference",pge(P??s,{x:S,y:w,axis:r,dataRef:l,pointerType:f}))}),g=de(S=>{o?c.current||(x(S.clientX,S.clientY,S.currentTarget),v([])):x(S.clientX,S.clientY,S.currentTarget)}),m=sa(f)?a:o;O.useEffect(()=>{if(!n){y(s);return}if(!m)return;function S(){var j;(j=c.current)==null||j.call(c),c.current=null}const w=ct(a);function P(j){const E=cn(j);xe(a,E)?S():x(j.clientX,j.clientY)}return!l.current.openEvent||l_(l.current.openEvent)?c.current=Ne(w,"mousemove",P):y(s),S},[m,n,a,l,s,i,x,y,h]),O.useEffect(()=>()=>{i.set("positionReference",null)},[i]),O.useEffect(()=>{n&&!a&&(u.current=!1)},[n,a]),O.useEffect(()=>{!n&&o&&(u.current=!0)},[n,o]);const b=O.useMemo(()=>{function S(w){p(w.pointerType)}return{onPointerDown:S,onPointerEnter:S,onMouseMove:g,onMouseEnter:g}},[g]);return O.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function mge(){return!1}function gge(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function EO(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:o="sloppy",referencePress:a=mge,bubbles:s,externalTree:l}=t,u="rootStore"in e?e.rootStore:e,c=u.useState("open"),f=u.useState("floatingElement"),{dataRef:p,events:h}=u.context,v=Qu(l),y=de(typeof i=="function"?i:()=>!1),x=typeof i=="function"?y:i,g=x!==!1,m=de(()=>o),{escapeKey:b,outsidePress:S}=gge(s),w=O.useRef(!1),P=O.useRef(!1),j=O.useRef(!1),E=O.useRef(!1),A=O.useRef(!1),C=O.useRef(""),T=O.useRef(null),_=cr(),R=cr(),$=de(()=>{R.clear(),p.current.insideReactTree=!1}),N=de(W=>{var le;const Q=(le=p.current.floatingContext)==null?void 0:le.nodeId;return(v?ga(v.nodesRef.current,Q):[]).some(X=>{var K;return((K=X.context)==null?void 0:K.open)&&!X.context.dataRef.current[W]})}),I=de(W=>ex(W,u.select("floatingElement"))||ex(W,u.select("domReferenceElement"))),B=de(W=>{a()&&u.setOpen(!1,$e(Nd,W.nativeEvent))}),k=de(W=>{if(!c||!n||!r||W.key!=="Escape"||A.current||!b&&N("__escapeKeyBubbles"))return;const Q=jme(W)?W.nativeEvent:W,G=$e(gO,Q);u.setOpen(!1,G),G.isCanceled||W.preventDefault(),!b&&!G.isPropagationAllowed&&W.stopPropagation()}),L=de(()=>{p.current.insideReactTree=!0,R.start(0,$)}),M=de(W=>{if(!c||!n||W.button!==0)return;const Q=cn(W.nativeEvent);xe(u.select("floatingElement"),Q)&&(w.current||(w.current=!0,P.current=!1))}),z=de(W=>{!c||!n||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&w.current&&(P.current=!0)});O.useEffect(()=>{function W(Q){Q.open||(E.current=!1)}return h.on("openchange",W),()=>{h.off("openchange",W)}},[h]),O.useEffect(()=>{if(!c||!n)return c||(E.current=!1),$;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=S;const W=new Jr,Q=new Jr,G=He(f);function le(){W.clear(),A.current=!0}function X(){W.start(Oo?5:0,()=>{A.current=!1})}function K(){j.current=!0,Q.start(0,()=>{j.current=!1})}function ee(){w.current=!1,P.current=!1}function ie(){const oe=C.current,Y=oe==="pen"||!oe?"mouse":oe,ge=m(),Ce=typeof ge=="function"?ge():ge;return typeof Ce=="string"?Ce:Ce[Y]}function H(oe){const Y=ie();return Y==="intentional"&&oe.type!=="click"||Y==="sloppy"&&oe.type==="click"}function Z(oe){var Ce;const Y=(Ce=p.current.floatingContext)==null?void 0:Ce.nodeId,ge=v&&ga(v.nodesRef.current,Y).some(Fe=>{var nn;return ex(oe,(nn=Fe.context)==null?void 0:nn.elements.floating)});return I(oe)||ge}function J(oe){if(H(oe)){oe.type!=="click"&&!I(oe)&&(Q.clear(),j.current=!1),$();return}if(p.current.insideReactTree){$();return}const Y=cn(oe),ge=`[${cd("inert")}]`,Ce=Me(Y)?Y.getRootNode():null,Fe=Array.from((Su(Ce)?Ce:He(u.select("floatingElement"))).querySelectorAll(ge)),nn=u.context.triggerElements;if(Y&&(nn.hasElement(Y)||nn.hasMatchingElement(xt=>xe(xt,Y))))return;let Tn=Me(Y)?Y:null;for(;Tn&&!aa(Tn);){const xt=pa(Tn);if(aa(xt)||!Me(xt))break;Tn=xt}if(!(Fe.length&&Me(Y)&&!Ame(Y)&&!xe(Y,u.select("floatingElement"))&&Fe.every(xt=>!xe(Tn,xt)))){if(it(Y)&&!("touches"in oe)){const xt=aa(Y),yn=dr(Y),er=/auto|scroll/,_n=xt||er.test(yn.overflowX),ti=xt||er.test(yn.overflowY),Mr=_n&&Y.clientWidth>0&&Y.scrollWidth>Y.clientWidth,Ei=ti&&Y.clientHeight>0&&Y.scrollHeight>Y.clientHeight,mr=yn.direction==="rtl",Ai=Ei&&(mr?oe.offsetX<=Y.offsetWidth-Y.clientWidth:oe.offsetX>Y.clientWidth),Ir=Mr&&oe.offsetY>Y.clientHeight;if(Ai||Ir)return}if(!Z(oe)){if(ie()==="intentional"){if(oe.detail!==0&&!jy(oe)&&!E.current)return;if(j.current){Q.clear(),j.current=!1;return}}typeof x=="function"&&!x(oe)||N("__outsidePressBubbles")||(u.setOpen(!1,$e(mO,oe)),$())}}}function se(oe){ie()!=="sloppy"||oe.pointerType==="touch"||!u.select("open")||!n||I(oe)||J(oe)}function we(oe){if(ie()!=="sloppy"||!u.select("open")||!n||I(oe))return;const Y=oe.touches[0];Y&&(T.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},_.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function ae(oe,Y){const ge=cn(oe);if(!ge)return;const Ce=Ne(ge,oe.type,()=>{Y(oe),Ce()})}function be(oe){C.current="touch",ae(oe,we)}function ce(oe){_.clear(),oe.type==="pointerdown"&&(oe.button===0&&(E.current=!0),C.current=oe.pointerType),!(oe.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)&&ae(oe,Y=>{Y.type==="pointerdown"?se(Y):J(Y)})}function Ee(oe){if(oe.type==="pointercancel"&&(E.current=!1),!w.current)return;const Y=P.current;if(ee(),ie()==="intentional"){if(oe.type==="pointercancel"){Y&&K();return}if(!Z(oe)){if(Y){K();return}typeof x=="function"&&!x(oe)||(Q.clear(),j.current=!0,$())}}}function je(oe){if(ie()!=="sloppy"||!T.current||I(oe))return;const Y=oe.touches[0];if(!Y)return;const ge=Math.abs(Y.clientX-T.current.startX),Ce=Math.abs(Y.clientY-T.current.startY),Fe=Math.sqrt(ge*ge+Ce*Ce);Fe>5&&(T.current.dismissOnTouchEnd=!0),Fe>10&&(J(oe),_.clear(),T.current=null)}function Se(oe){ae(oe,je)}function ze(oe){ie()!=="sloppy"||!T.current||I(oe)||(T.current.dismissOnTouchEnd&&J(oe),_.clear(),T.current=null)}function te(oe){ae(oe,ze)}const pe=wi(r&&wi(Ne(G,"keydown",k),Ne(G,"compositionstart",le),Ne(G,"compositionend",X)),g&&wi(Ne(G,"click",ce,!0),Ne(G,"pointerdown",ce,!0),Ne(G,"pointerup",Ee,!0),Ne(G,"pointercancel",Ee,!0),Ne(G,"mousedown",ce,!0),Ne(G,"mouseup",Ee,!0),Ne(G,"touchstart",be,{capture:!0,passive:!0}),Ne(G,"touchmove",Se,{capture:!0,passive:!0}),Ne(G,"touchend",te,{capture:!0,passive:!0})));return()=>{pe(),W.clear(),Q.clear(),ee(),j.current=!1,$()}},[p,f,r,g,x,c,n,b,S,k,$,m,N,I,v,u,_]);const U=O.useMemo(()=>({onKeyDown:k,onPointerDown:B,onClick:B}),[k,B]),V=O.useMemo(()=>({onKeyDown:k,onPointerDown:z,onMouseDown:z,onClickCapture:L,onMouseDownCapture(W){L(),M(W)},onPointerDownCapture(W){L(),M(W)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[k,L,M,z]);return O.useMemo(()=>n?{reference:U,floating:V,trigger:U}:{},[n,U,V])}function u_(e,t,n){let{reference:r,floating:i}=e;const o=Er(t),a=OO(t),s=SO(a),l=Cr(t),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}const v=uo(t);return v&&(h[a]+=p*(v==="end"?1:-1)*(n&&u?-1:1)),h}async function yge(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=ma(t,e),v=tL(h),x=s[p?f==="floating"?"reference":"floating":f],g=ud(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),m=f==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=await(o.isElement==null?void 0:o.isElement(b))&&await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1},w=ud(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:b,strategy:l}):m);return{top:(g.top-w.top+v.top)/S.y,bottom:(w.bottom-g.bottom+v.bottom)/S.y,left:(g.left-w.left+v.left)/S.x,right:(w.right-g.right+v.right)/S.x}}const vge=50,xge=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:yge},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=u_(u,r,l),p=r,h=0;const v={};for(let y=0;y<o.length;y++){const x=o[y];if(!x)continue;const{name:g,fn:m}=x,{x:b,y:S,data:w,reset:P}=await m({x:c,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:v,rects:u,platform:s,elements:{reference:e,floating:t}});c=b??c,f=S??f,v[g]={...v[g],...w},P&&h<vge&&(h++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(u=P.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:c,y:f}=u_(u,p,l)),y=-1)}return{x:c,y:f,placement:p,strategy:i,middlewareData:v}},bge=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=ma(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=Cr(i),m=Er(s),b=Cr(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=p||(b||!y?[Gm(s)]:Bme(s)),P=v!=="none";!p&&P&&w.push(...Vme(s,y,v,S));const j=[s,...w],E=await l.detectOverflow(t,x),A=[];let C=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(E[g]),f){const $=Fme(i,a,S);A.push(E[$[0]],E[$[1]])}if(C=[...C,{placement:i,overflows:A}],!A.every($=>$<=0)){var T,_;const $=(((T=o.flip)==null?void 0:T.index)||0)+1,N=j[$];if(N&&(!(f==="alignment"?m!==Er(N):!1)||C.every(k=>Er(k.placement)===m?k.overflows[0]>0:!0)))return{data:{index:$,overflows:C},reset:{placement:N}};let I=(_=C.filter(B=>B.overflows[0]<=0).sort((B,k)=>B.overflows[1]-k.overflows[1])[0])==null?void 0:_.placement;if(!I)switch(h){case"bestFit":{var R;const B=(R=C.filter(k=>{if(P){const L=Er(k.placement);return L===m||L==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(L=>L>0).reduce((L,M)=>L+M,0)]).sort((k,L)=>k[1]-L[1])[0])==null?void 0:R[0];B&&(I=B);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}},vL=new Set(["left","top"]);async function wge(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Cr(n),s=uo(n),l=Er(n)==="y",u=vL.has(a)?-1:1,c=o&&l?-1:1,f=ma(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof v=="number"&&(h=s==="end"?v*-1:v),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const Sge=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await wge(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},Oge=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:m=>{let{x:b,y:S}=m;return{x:b,y:S}}},...u}=ma(e,t),c={x:n,y:r},f=await o.detectOverflow(t,u),p=Er(i),h=wO(p);let v=c[h],y=c[p];const x=(m,b)=>eL(b+f[m==="y"?"top":"left"],b,b-f[m==="y"?"bottom":"right"]);a&&(v=x(h,v)),s&&(y=x(p,y));const g=l.fn({...t,[h]:v,[p]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:a,[p]:s}}}}}},Pge=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:o,placement:a,rects:s,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=ma(e,t),p={x:i,y:o},h=Er(a),v=wO(h);let y=p[v],x=p[h];const g=ma(u,t),m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(r=g.crossAxis)!=null?r:0};if(c){const w=v==="y"?"height":"width",P=s.reference[v]-s.floating[w]+m.mainAxis,j=s.reference[v]+s.reference[w]-m.mainAxis;y<P?y=P:y>j&&(y=j)}if(f){var b,S;const w=v==="y"?"width":"height",P=vL.has(Cr(a)),j=s.reference[h]-s.floating[w]+(P&&((b=l.offset)==null?void 0:b[h])||0)+(P?0:m.crossAxis),E=s.reference[h]+s.reference[w]+(P?0:((S=l.offset)==null?void 0:S[h])||0)-(P?m.crossAxis:0);x<j?x=j:x>E&&(x=E)}return{[v]:y,[h]:x}}}},jge=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=ma(e,t),l=await i.detectOverflow(t,s),u=Cr(n),c=uo(n),f=Er(n)==="y",{width:p,height:h}=r.floating;let v,y;u==="top"||u==="bottom"?(v=u,y=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=u,v=c==="end"?"top":"bottom");const x=h-l.top-l.bottom,g=p-l.left-l.right,m=Pu(h-l[v],x),b=Pu(p-l[y],g),S=t.middlewareData.shift,w=!S;let P=m,j=b;S!=null&&S.enabled.x&&(j=g),S!=null&&S.enabled.y&&(P=x),w&&!c&&(f?j=p-2*Qi(l.left,l.right):P=h-2*Qi(l.top,l.bottom)),await a({...t,availableWidth:j,availableHeight:P});const E=await i.getDimensions(o.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function xL(e){const t=dr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=it(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=qm(n)!==o||qm(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function AO(e){return Me(e)?e:e.contextElement}function jl(e){const t=AO(e);if(!it(t))return Ji(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=xL(t);let a=(o?qm(n.width):n.width)/r,s=(o?qm(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Ege=Ji(0);function bL(e){const t=ct(e);return!fO()||!t.visualViewport?Ege:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Age(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ct(e)}function Ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=AO(e);let a=Ji(1);t&&(r?Me(r)&&(a=jl(r)):a=jl(e));const s=Age(o,n,r)?bL(o):Ji(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o&&r){const p=ct(o),h=Me(r)?ct(r):r;let v=p,y=sw(v);for(;y&&h!==v;){const x=jl(y),g=y.getBoundingClientRect(),m=dr(y),b=g.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,S=g.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=b,u+=S,v=ct(y),y=sw(v)}}return ud({width:c,height:f,x:l,y:u})}function ky(e,t){const n=by(e).scrollLeft;return t?t.left+n:Ts(So(e)).left+n}function wL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ky(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Cge(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=So(r),s=t?xy(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Ji(1);const c=Ji(0),f=it(r);if((f||!o)&&((pn(r)!=="body"||kd(a))&&(l=by(r)),f)){const h=Ts(r);u=jl(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=a&&!f&&!o?wL(a,l):Ji(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}}function Tge(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _ge(e){const t=by(e),n=e.ownerDocument.body,r=Qi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+ky(e);const a=-t.scrollTop;return dr(n).direction==="rtl"&&(o+=Qi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:a}}const Rge=25;function kge(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=ct(e),o=So(e),a=i.visualViewport;let s=o.clientWidth,l=o.clientHeight,u=0,c=0;if(a){const p=!fO()||t==="fixed";r?p||(u=-a.offsetLeft,c=-a.offsetTop):(s=a.width,l=a.height,p&&(u=a.offsetLeft,c=a.offsetTop))}if(ky(o)<=0){const p=o.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(o.clientWidth-h.clientWidth-y),g=getComputedStyle(o).scrollbarGutter==="stable both-edges"?x/2:x;g<=Rge&&(s-=g)}return{width:s,height:l,x:u,y:c}}function Nge(e,t){const n=Ts(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jl(e),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:a,height:s,x:l,y:u}}function c_(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=kge(e,n,t);else if(t==="document")r=_ge(So(e));else if(Me(t))r=Nge(t,n);else{const i=bL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ud(r)}function $ge(e,t){const n=t.get(e);if(n)return n;let r=sd(e,[],!1).filter(s=>Me(s)&&pn(s)!=="body"),i=null;const o=dr(e).position==="fixed";let a=o?pa(e):e;for(;Me(a)&&!aa(a);){const s=dr(a),l=cO(a),u=i?i.position:o?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?r=r.filter(f=>f!==a):i=s,a=pa(a)}return t.set(e,r),r}function Mge(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?xy(t)?[]:$ge(t,this._c):[].concat(n),r],s=c_(t,a[0],i);let l=s.top,u=s.right,c=s.bottom,f=s.left;for(let p=1;p<a.length;p++){const h=c_(t,a[p],i);l=Qi(h.top,l),u=Pu(h.right,u),c=Pu(h.bottom,c),f=Qi(h.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function Ige(e){const{width:t,height:n}=xL(e);return{width:t,height:n}}function Dge(e,t,n){const r=it(t),i=So(t),o=n==="fixed",a=Ts(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Ji(0);if((r||!o)&&((pn(t)!=="body"||kd(i))&&(s=by(t)),r)){const p=Ts(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!r&&i&&(l.x=ky(i));const u=i&&!r&&!o?wL(i,s):Ji(0),c=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:a.width,height:a.height}}function ix(e){return dr(e).position==="static"}function f_(e,t){if(!it(e)||dr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return So(e)===n&&(n=n.ownerDocument.body),n}function SL(e,t){const n=ct(e);if(xy(e))return n;if(!it(e)){let i=pa(e);for(;i&&!aa(i);){if(Me(i)&&!ix(i))return i;i=pa(i)}return n}let r=f_(e,t);for(;r&&ome(r)&&ix(r);)r=f_(r,t);return r&&aa(r)&&ix(r)&&!cO(r)?n:r||lme(e)||n}const Lge=async function(e){const t=this.getOffsetParent||SL,n=this.getDimensions,r=await n(e.floating);return{reference:Dge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fge(e){return dr(e).direction==="rtl"}const OL={convertOffsetParentRelativeRectToViewportRelativeRect:Cge,getDocumentElement:So,getClippingRect:Mge,getOffsetParent:SL,getElementRects:Lge,getClientRects:Tge,getDimensions:Ige,getScale:jl,isElement:Me,isRTL:Fge};function PL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bge(e,t,n){let r=null,i;const o=So(e);function a(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),a();const p=e.getBoundingClientRect(),{left:h,top:v,width:y,height:x}=p;if(c||t(),!y||!x)return;const g=Ep(v),m=Ep(o.clientWidth-(h+y)),b=Ep(o.clientHeight-(v+x)),S=Ep(h),P={rootMargin:-g+"px "+-m+"px "+-b+"px "+-S+"px",threshold:Qi(0,Pu(1,f))||1};let j=!0;function E(A){const C=A[0].intersectionRatio;if(!PL(p,e.getBoundingClientRect()))return s();if(C!==f){if(!j)return s();C?s(!1,C):i=setTimeout(()=>{s(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(E,{...P,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,P)}r.observe(e)}const l=ct(e),u=()=>s(n);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),a()}}function d_(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=AO(e),c=i||o?[...u?sd(u):[],...t?sd(t):[]]:[];c.forEach(g=>{i&&g.addEventListener("scroll",n),o&&g.addEventListener("resize",n)});const f=u&&s?Bge(u,n,o):null;let p=-1,h=null;a&&(h=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let v,y=l?Ts(e):null;l&&x();function x(){const g=Ts(e);y&&!PL(y,g)&&n(),y=g,v=requestAnimationFrame(x)}return n(),()=>{var g;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const Uge=Sge,zge=Oge,Hge=bge,Vge=jge,Wge=Pge,Kge=(e,t,n)=>{const r=new Map,i=n??{},o={...OL,...i.platform,_c:r};return xge(e,t,{...i,platform:o})};var qge=typeof document<"u",Gge=function(){},oh=qge?O.useLayoutEffect:Gge;function Xm(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(!Xm(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;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Xm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function p_(e,t){const n=jL(e);return Math.round(t*n)/n}function ox(e){const t=O.useRef(e);return oh(()=>{t.current=e}),t}function Xge(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=O.useState(r);Xm(p,r)||h(r);const[v,y]=O.useState(null),[x,g]=O.useState(null),m=O.useCallback(k=>{k!==P.current&&(P.current=k,y(k))},[]),b=O.useCallback(k=>{k!==j.current&&(j.current=k,g(k))},[]),S=o||v,w=a||x,P=O.useRef(null),j=O.useRef(null),E=O.useRef(c),A=l!=null,C=ox(l),T=ox(i),_=ox(u),R=O.useCallback(()=>{if(!P.current||!j.current)return;const k={placement:t,strategy:n,middleware:p};T.current&&(k.platform=T.current),Kge(P.current,j.current,k).then(L=>{const M={...L,isPositioned:_.current!==!1};$.current&&!Xm(E.current,M)&&(E.current=M,po.flushSync(()=>{f(M)}))})},[p,t,n,T,_]);oh(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const $=O.useRef(!1);oh(()=>($.current=!0,()=>{$.current=!1}),[]),oh(()=>{if(S&&(P.current=S),w&&(j.current=w),S&&w){if(C.current)return C.current(S,w,R);R()}},[S,w,R,C,A]);const N=O.useMemo(()=>({reference:P,floating:j,setReference:m,setFloating:b}),[m,b]),I=O.useMemo(()=>({reference:S,floating:w}),[S,w]),B=O.useMemo(()=>{const k={position:n,left:0,top:0};if(!I.floating)return k;const L=p_(I.floating,c.x),M=p_(I.floating,c.y);return s?{...k,transform:"translate("+L+"px, "+M+"px)",...jL(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:M}},[n,s,I.floating,c.x,c.y]);return O.useMemo(()=>({...c,update:R,refs:N,elements:I,floatingStyles:B}),[c,R,N,I,B])}const Yge=(e,t)=>{const n=Uge(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qge=(e,t)=>{const n=zge(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jge=(e,t)=>({fn:Wge(e).fn,options:[e,t]}),Zge=(e,t)=>{const n=Hge(e);return{name:n.name,fn:n.fn,options:[e,t]}},eye=(e,t)=>{const n=Vge(e);return{name:n.name,fn:n.fn,options:[e,t]}};var EL={exports:{}},AL={};/**
138
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xD(e,t){if(e){if(typeof e=="string")return tw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tw(e,t)}}function ihe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ohe(e){if(Array.isArray(e))return tw(e)}function tw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IT(Object(n),!0).forEach(function(r){Pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pe(e,t,n){return t=bD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bD(e){var t=ahe(e,"string");return vu(t)=="symbol"?t:t+""}function ahe(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var she={xAxis:["bottom","top"],yAxis:["left","right"]},lhe={width:"100%",height:"100%"},wD={x:0,y:0};function Op(e){return e}var uhe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},che=function(t,n,r,i){var o=n.find(function(c){return c&&c.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var a=o.coordinate,s=i.radius;return q(q(q({},i),at(i.cx,i.cy,s,a)),{},{angle:a,radius:s})}var l=o.coordinate,u=i.angle;return q(q(q({},i),at(i.cx,i.cy,l,u)),{},{angle:u,radius:l})}return wD},my=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,a=(r??[]).reduce(function(s,l){var u=l.props.data;return u&&u.length?[].concat(xu(s),xu(u)):s},[]);return a.length>0?a:t&&t.length&&ne(i)&&ne(o)?t.slice(i,o+1):[]};function SD(e){return e==="number"?[0,"auto"]:void 0}var nw=function(t,n,r,i){var o=t.graphicalItems,a=t.tooltipAxis,s=my(n,t);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(a.dataKey&&!a.allowDuplicatedCategory){var h=f===void 0?s:f;p=Dh(h,a.dataKey,i)}else p=f&&f[r]||s[r];return p?[].concat(xu(l),[K1(u,p)]):l},[])},DT=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},a=uhe(o,r),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=wie(a,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,p=nw(t,n,c,f),h=che(r,s,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:p,activeCoordinate:h}}return null},fhe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,p=t.stackOffset,h=XI(c,o);return r.reduce(function(v,y){var x,g=y.type.defaultProps!==void 0?q(q({},y.type.defaultProps),y.props):y.props,m=g.type,b=g.dataKey,S=g.allowDataOverflow,w=g.allowDuplicatedCategory,P=g.scale,j=g.ticks,E=g.includeHidden,A=g[a];if(v[A])return v;var C=my(t.data,{graphicalItems:i.filter(function(U){var V,W=a in U.props?U.props[a]:(V=U.type.defaultProps)===null||V===void 0?void 0:V[a];return W===A}),dataStartIndex:l,dataEndIndex:u}),T=C.length,_,R,$;Dpe(g.domain,S,m)&&(_=m0(g.domain,null,S),h&&(m==="number"||P!=="auto")&&($=Yc(C,b,"category")));var N=SD(m);if(!_||_.length===0){var I,B=(I=g.domain)!==null&&I!==void 0?I:N;if(b){if(_=Yc(C,b,m),m==="category"&&h){var k=u8(_);w&&k?(R=_,_=Cm(0,T)):w||(_=rC(B,_,y).reduce(function(U,V){return U.indexOf(V)>=0?U:[].concat(xu(U),[V])},[]))}else if(m==="category")w?_=_.filter(function(U){return U!==""&&!_e(U)}):_=rC(B,_,y).reduce(function(U,V){return U.indexOf(V)>=0||V===""||_e(V)?U:[].concat(xu(U),[V])},[]);else if(m==="number"){var L=Eie(C,i.filter(function(U){var V,W,Q=a in U.props?U.props[a]:(V=U.type.defaultProps)===null||V===void 0?void 0:V[a],G="hide"in U.props?U.props.hide:(W=U.type.defaultProps)===null||W===void 0?void 0:W.hide;return Q===A&&(E||!G)}),b,o,c);L&&(_=L)}h&&(m==="number"||P!=="auto")&&($=Yc(C,b,"category"))}else h?_=Cm(0,T):s&&s[A]&&s[A].hasStack&&m==="number"?_=p==="expand"?[0,1]:r2(s[A].stackGroups,l,u):_=GI(C,i.filter(function(U){var V=a in U.props?U.props[a]:U.type.defaultProps[a],W="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return V===A&&(E||!W)}),m,c,!0);if(m==="number")_=Z0(f,_,A,o,j),B&&(_=m0(B,_,S));else if(m==="category"&&B){var M=B,z=_.every(function(U){return M.indexOf(U)>=0});z&&(_=M)}}return q(q({},v),{},Pe({},A,q(q({},g),{},{axisType:o,domain:_,categoricalDomain:$,duplicateDomain:R,originalDomain:(x=g.domain)!==null&&x!==void 0?x:N,isCategorical:h,layout:c})))},{})},dhe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,p=my(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),h=p.length,v=XI(c,o),y=-1;return r.reduce(function(x,g){var m=g.type.defaultProps!==void 0?q(q({},g.type.defaultProps),g.props):g.props,b=m[a],S=SD("number");if(!x[b]){y++;var w;return v?w=Cm(0,h):s&&s[b]&&s[b].hasStack?(w=r2(s[b].stackGroups,l,u),w=Z0(f,w,b,o)):(w=m0(S,GI(p,r.filter(function(P){var j,E,A=a in P.props?P.props[a]:(j=P.type.defaultProps)===null||j===void 0?void 0:j[a],C="hide"in P.props?P.props.hide:(E=P.type.defaultProps)===null||E===void 0?void 0:E.hide;return A===b&&!C}),"number",c),i.defaultProps.allowDataOverflow),w=Z0(f,w,b,o)),q(q({},x),{},Pe({},b,q(q({axisType:o},i.defaultProps),{},{hide:!0,orientation:lr(she,"".concat(o,".").concat(y%2),null),domain:w,originalDomain:S,isCategorical:v,layout:c})))}return x},{})},phe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),p=ur(c,o),h={};return p&&p.length?h=fhe(t,{axes:p,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):a&&a.length&&(h=dhe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},hhe=function(t){var n=Mo(t),r=Wi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:x1(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:pm(n,r)}},LT=function(t){var n=t.children,r=t.defaultShowTooltip,i=ir(n,fa),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},mhe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Gi(n&&n.type);return r&&r.indexOf("Bar")>=0})},FT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ghe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,l=s===void 0?{}:s,u=r.width,c=r.height,f=r.children,p=r.margin||{},h=ir(f,fa),v=ir(f,ls),y=Object.keys(l).reduce(function(w,P){var j=l[P],E=j.orientation;return!j.mirror&&!j.hide?q(q({},w),{},Pe({},E,w[E]+j.width)):w},{left:p.left||0,right:p.right||0}),x=Object.keys(a).reduce(function(w,P){var j=a[P],E=j.orientation;return!j.mirror&&!j.hide?q(q({},w),{},Pe({},E,lr(w,"".concat(E))+j.height)):w},{top:p.top||0,bottom:p.bottom||0}),g=q(q({},x),y),m=g.bottom;h&&(g.bottom+=h.props.height||fa.defaultProps.height),v&&n&&(g=Pie(g,i,r,n));var b=u-g.left-g.right,S=c-g.top-g.bottom;return q(q({brushBottom:m},g),{},{width:Math.max(b,0),height:Math.max(S,0)})},yhe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gy=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,p=function(g,m){var b=m.graphicalItems,S=m.stackGroups,w=m.offset,P=m.updateId,j=m.dataStartIndex,E=m.dataEndIndex,A=g.barSize,C=g.layout,T=g.barGap,_=g.barCategoryGap,R=g.maxBarSize,$=FT(C),N=$.numericAxisName,I=$.cateAxisName,B=mhe(b),k=[];return b.forEach(function(L,M){var z=my(g.data,{graphicalItems:[L],dataStartIndex:j,dataEndIndex:E}),U=L.type.defaultProps!==void 0?q(q({},L.type.defaultProps),L.props):L.props,V=U.dataKey,W=U.maxBarSize,Q=U["".concat(N,"Id")],G=U["".concat(I,"Id")],le={},X=l.reduce(function(je,Se){var ze=m["".concat(Se.axisType,"Map")],te=U["".concat(Se.axisType,"Id")];ze&&ze[te]||Se.axisType==="zAxis"||Os();var pe=ze[te];return q(q({},je),{},Pe(Pe({},Se.axisType,pe),"".concat(Se.axisType,"Ticks"),Wi(pe)))},le),K=X[I],ee=X["".concat(I,"Ticks")],ie=S&&S[Q]&&S[Q].hasStack&&kie(L,S[Q].stackGroups),H=Gi(L.type).indexOf("Bar")>=0,Z=pm(K,ee),J=[],se=B&&Sie({barSize:A,stackGroups:S,totalSize:yhe(X,I)});if(H){var we,ae,be=_e(W)?R:W,ce=(we=(ae=pm(K,ee,!0))!==null&&ae!==void 0?ae:be)!==null&&we!==void 0?we:0;J=Oie({barGap:T,barCategoryGap:_,bandSize:ce!==Z?ce:Z,sizeList:se[G],maxBarSize:be}),ce!==Z&&(J=J.map(function(je){return q(q({},je),{},{position:q(q({},je.position),{},{offset:je.position.offset-ce/2})})}))}var Ee=L&&L.type&&L.type.getComposedData;Ee&&k.push({props:q(q({},Ee(q(q({},X),{},{displayedData:z,props:g,dataKey:V,item:L,bandSize:Z,barPosition:J,offset:w,stackedData:ie,layout:C,dataStartIndex:j,dataEndIndex:E}))),{},Pe(Pe(Pe({key:L.key||"item-".concat(M)},N,X[N]),I,X[I]),"animationId",P)),childIndex:S8(L,g.children),item:L})}),k},h=function(g,m){var b=g.props,S=g.dataStartIndex,w=g.dataEndIndex,P=g.updateId;if(!Qj({props:b}))return null;var j=b.children,E=b.layout,A=b.stackOffset,C=b.data,T=b.reverseStackOrder,_=FT(E),R=_.numericAxisName,$=_.cateAxisName,N=ur(j,r),I=Rie(C,N,"".concat(R,"Id"),"".concat($,"Id"),A,T),B=l.reduce(function(U,V){var W="".concat(V.axisType,"Map");return q(q({},U),{},Pe({},W,phe(b,q(q({},V),{},{graphicalItems:N,stackGroups:V.axisType===R&&I,dataStartIndex:S,dataEndIndex:w}))))},{}),k=ghe(q(q({},B),{},{props:b,graphicalItems:N}),m==null?void 0:m.legendBBox);Object.keys(B).forEach(function(U){B[U]=c(b,B[U],k,U.replace("Map",""),n)});var L=B["".concat($,"Map")],M=hhe(L),z=p(b,q(q({},B),{},{dataStartIndex:S,dataEndIndex:w,updateId:P,graphicalItems:N,stackGroups:I,offset:k}));return q(q({formattedGraphicalItems:z,graphicalItems:N,offset:k,stackGroups:I},M),B)},v=function(x){function g(m){var b,S,w;return Ype(this,g),w=Zpe(this,g,[m]),Pe(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pe(w,"accessibilityManager",new Ipe),Pe(w,"handleLegendBBoxUpdate",function(P){if(P){var j=w.state,E=j.dataStartIndex,A=j.dataEndIndex,C=j.updateId;w.setState(q({legendBBox:P},h({props:w.props,dataStartIndex:E,dataEndIndex:A,updateId:C},q(q({},w.state),{},{legendBBox:P}))))}}),Pe(w,"handleReceiveSyncEvent",function(P,j,E){if(w.props.syncId===P){if(E===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(j)}}),Pe(w,"handleBrushChange",function(P){var j=P.startIndex,E=P.endIndex;if(j!==w.state.dataStartIndex||E!==w.state.dataEndIndex){var A=w.state.updateId;w.setState(function(){return q({dataStartIndex:j,dataEndIndex:E},h({props:w.props,dataStartIndex:j,dataEndIndex:E,updateId:A},w.state))}),w.triggerSyncEvent({dataStartIndex:j,dataEndIndex:E})}}),Pe(w,"handleMouseEnter",function(P){var j=w.getMouseInfo(P);if(j){var E=q(q({},j),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var A=w.props.onMouseEnter;Oe(A)&&A(E,P)}}),Pe(w,"triggeredAfterMouseMove",function(P){var j=w.getMouseInfo(P),E=j?q(q({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(E),w.triggerSyncEvent(E);var A=w.props.onMouseMove;Oe(A)&&A(E,P)}),Pe(w,"handleItemMouseEnter",function(P){w.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),Pe(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Pe(w,"handleMouseMove",function(P){P.persist(),w.throttleTriggeredAfterMouseMove(P)}),Pe(w,"handleMouseLeave",function(P){w.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};w.setState(j),w.triggerSyncEvent(j);var E=w.props.onMouseLeave;Oe(E)&&E(j,P)}),Pe(w,"handleOuterEvent",function(P){var j=w8(P),E=lr(w.props,"".concat(j));if(j&&Oe(E)){var A,C;/.*touch.*/i.test(j)?C=w.getMouseInfo(P.changedTouches[0]):C=w.getMouseInfo(P),E((A=C)!==null&&A!==void 0?A:{},P)}}),Pe(w,"handleClick",function(P){var j=w.getMouseInfo(P);if(j){var E=q(q({},j),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var A=w.props.onClick;Oe(A)&&A(E,P)}}),Pe(w,"handleMouseDown",function(P){var j=w.props.onMouseDown;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"handleMouseUp",function(P){var j=w.props.onMouseUp;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),Pe(w,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&w.handleMouseDown(P.changedTouches[0])}),Pe(w,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&w.handleMouseUp(P.changedTouches[0])}),Pe(w,"handleDoubleClick",function(P){var j=w.props.onDoubleClick;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"handleContextMenu",function(P){var j=w.props.onContextMenu;if(Oe(j)){var E=w.getMouseInfo(P);j(E,P)}}),Pe(w,"triggerSyncEvent",function(P){w.props.syncId!==void 0&&Kv.emit(qv,w.props.syncId,P,w.eventEmitterSymbol)}),Pe(w,"applySyncEvent",function(P){var j=w.props,E=j.layout,A=j.syncMethod,C=w.state.updateId,T=P.dataStartIndex,_=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)w.setState(q({dataStartIndex:T,dataEndIndex:_},h({props:w.props,dataStartIndex:T,dataEndIndex:_,updateId:C},w.state)));else if(P.activeTooltipIndex!==void 0){var R=P.chartX,$=P.chartY,N=P.activeTooltipIndex,I=w.state,B=I.offset,k=I.tooltipTicks;if(!B)return;if(typeof A=="function")N=A(k,P);else if(A==="value"){N=-1;for(var L=0;L<k.length;L++)if(k[L].value===P.activeLabel){N=L;break}}var M=q(q({},B),{},{x:B.left,y:B.top}),z=Math.min(R,M.x+M.width),U=Math.min($,M.y+M.height),V=k[N]&&k[N].value,W=nw(w.state,w.props.data,N),Q=k[N]?{x:E==="horizontal"?k[N].coordinate:z,y:E==="horizontal"?U:k[N].coordinate}:wD;w.setState(q(q({},P),{},{activeLabel:V,activeCoordinate:Q,activePayload:W,activeTooltipIndex:N}))}else w.setState(P)}),Pe(w,"renderCursor",function(P){var j,E=w.state,A=E.isTooltipActive,C=E.activeCoordinate,T=E.activePayload,_=E.offset,R=E.activeTooltipIndex,$=E.tooltipAxisBandSize,N=w.getTooltipEventType(),I=(j=P.props.active)!==null&&j!==void 0?j:A,B=w.props.layout,k=P.key||"_recharts-cursor";return D.createElement(Hpe,{key:k,activeCoordinate:C,activePayload:T,activeTooltipIndex:R,chartName:n,element:P,isActive:I,layout:B,offset:_,tooltipAxisBandSize:$,tooltipEventType:N})}),Pe(w,"renderPolarAxis",function(P,j,E){var A=lr(P,"type.axisType"),C=lr(w.state,"".concat(A,"Map")),T=P.type.defaultProps,_=T!==void 0?q(q({},T),P.props):P.props,R=C&&C[_["".concat(A,"Id")]];return O.cloneElement(P,q(q({},R),{},{className:Ae(A,R.className),key:P.key||"".concat(j,"-").concat(E),ticks:Wi(R,!0)}))}),Pe(w,"renderPolarGrid",function(P){var j=P.props,E=j.radialLines,A=j.polarAngles,C=j.polarRadius,T=w.state,_=T.radiusAxisMap,R=T.angleAxisMap,$=Mo(_),N=Mo(R),I=N.cx,B=N.cy,k=N.innerRadius,L=N.outerRadius;return O.cloneElement(P,{polarAngles:Array.isArray(A)?A:Wi(N,!0).map(function(M){return M.coordinate}),polarRadius:Array.isArray(C)?C:Wi($,!0).map(function(M){return M.coordinate}),cx:I,cy:B,innerRadius:k,outerRadius:L,key:P.key||"polar-grid",radialLines:E})}),Pe(w,"renderLegend",function(){var P=w.state.formattedGraphicalItems,j=w.props,E=j.children,A=j.width,C=j.height,T=w.props.margin||{},_=A-(T.left||0)-(T.right||0),R=KI({children:E,formattedGraphicalItems:P,legendWidth:_,legendContent:u});if(!R)return null;var $=R.item,N=MT(R,Vpe);return O.cloneElement($,q(q({},N),{},{chartWidth:A,chartHeight:C,margin:T,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Pe(w,"renderTooltip",function(){var P,j=w.props,E=j.children,A=j.accessibilityLayer,C=ir(E,oi);if(!C)return null;var T=w.state,_=T.isTooltipActive,R=T.activeCoordinate,$=T.activePayload,N=T.activeLabel,I=T.offset,B=(P=C.props.active)!==null&&P!==void 0?P:_;return O.cloneElement(C,{viewBox:q(q({},I),{},{x:I.left,y:I.top}),active:B,label:N,payload:B?$:[],coordinate:R,accessibilityLayer:A})}),Pe(w,"renderBrush",function(P){var j=w.props,E=j.margin,A=j.data,C=w.state,T=C.offset,_=C.dataStartIndex,R=C.dataEndIndex,$=C.updateId;return O.cloneElement(P,{key:P.key||"_recharts-brush",onChange:vp(w.handleBrushChange,P.props.onChange),data:A,x:ne(P.props.x)?P.props.x:T.left,y:ne(P.props.y)?P.props.y:T.top+T.height+T.brushBottom-(E.bottom||0),width:ne(P.props.width)?P.props.width:T.width,startIndex:_,endIndex:R,updateId:"brush-".concat($)})}),Pe(w,"renderReferenceElement",function(P,j,E){if(!P)return null;var A=w,C=A.clipPathId,T=w.state,_=T.xAxisMap,R=T.yAxisMap,$=T.offset,N=P.type.defaultProps||{},I=P.props,B=I.xAxisId,k=B===void 0?N.xAxisId:B,L=I.yAxisId,M=L===void 0?N.yAxisId:L;return O.cloneElement(P,{key:P.key||"".concat(j,"-").concat(E),xAxis:_[k],yAxis:R[M],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:C})}),Pe(w,"renderActivePoints",function(P){var j=P.item,E=P.activePoint,A=P.basePoint,C=P.childIndex,T=P.isRange,_=[],R=j.props.key,$=j.item.type.defaultProps!==void 0?q(q({},j.item.type.defaultProps),j.item.props):j.item.props,N=$.activeDot,I=$.dataKey,B=q(q({index:C,dataKey:I,cx:E.x,cy:E.y,r:4,fill:W1(j.item),strokeWidth:2,stroke:"#fff",payload:E.payload,value:E.value},ve(N,!1)),Lh(N));return _.push(g.renderActiveDot(N,B,"".concat(R,"-activePoint-").concat(C))),A?_.push(g.renderActiveDot(N,q(q({},B),{},{cx:A.x,cy:A.y}),"".concat(R,"-basePoint-").concat(C))):T&&_.push(null),_}),Pe(w,"renderGraphicChild",function(P,j,E){var A=w.filterFormatItem(P,j,E);if(!A)return null;var C=w.getTooltipEventType(),T=w.state,_=T.isTooltipActive,R=T.tooltipAxis,$=T.activeTooltipIndex,N=T.activeLabel,I=w.props.children,B=ir(I,oi),k=A.props,L=k.points,M=k.isRange,z=k.baseLine,U=A.item.type.defaultProps!==void 0?q(q({},A.item.type.defaultProps),A.item.props):A.item.props,V=U.activeDot,W=U.hide,Q=U.activeBar,G=U.activeShape,le=!!(!W&&_&&B&&(V||Q||G)),X={};C!=="axis"&&B&&B.props.trigger==="click"?X={onClick:vp(w.handleItemMouseEnter,P.props.onClick)}:C!=="axis"&&(X={onMouseLeave:vp(w.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:vp(w.handleItemMouseEnter,P.props.onMouseEnter)});var K=O.cloneElement(P,q(q({},A.props),X));function ee(Se){return typeof R.dataKey=="function"?R.dataKey(Se.payload):null}if(le)if($>=0){var ie,H;if(R.dataKey&&!R.allowDuplicatedCategory){var Z=typeof R.dataKey=="function"?ee:"payload.".concat(R.dataKey.toString());ie=Dh(L,Z,N),H=M&&z&&Dh(z,Z,N)}else ie=L==null?void 0:L[$],H=M&&z&&z[$];if(G||Q){var J=P.props.activeIndex!==void 0?P.props.activeIndex:$;return[O.cloneElement(P,q(q(q({},A.props),X),{},{activeIndex:J})),null,null]}if(!_e(ie))return[K].concat(xu(w.renderActivePoints({item:A,activePoint:ie,basePoint:H,childIndex:$,isRange:M})))}else{var se,we=(se=w.getItemByXY(w.state.activeCoordinate))!==null&&se!==void 0?se:{graphicalItem:K},ae=we.graphicalItem,be=ae.item,ce=be===void 0?P:be,Ee=ae.childIndex,je=q(q(q({},A.props),X),{},{activeIndex:Ee});return[O.cloneElement(ce,je),null,null]}return M?[K,null,null]:[K,null]}),Pe(w,"renderCustomized",function(P,j,E){return O.cloneElement(P,q(q({key:"recharts-customized-".concat(E)},w.props),w.state))}),Pe(w,"renderMap",{CartesianGrid:{handler:Op,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:Op},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:Op},YAxis:{handler:Op},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=m.id)!==null&&b!==void 0?b:Fu("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=KM(w.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return nhe(g,x),Jpe(g,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,P=b.height,j=b.layout,E=ir(S,oi);if(E){var A=E.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,T=nw(this.state,w,A,C),_=this.state.tooltipTicks[A].coordinate,R=(this.state.offset.top+P)/2,$=j==="horizontal",N=$?{x:_,y:R}:{y:_,x:R},I=this.state.formattedGraphicalItems.find(function(k){var L=k.item;return L.type.name==="Scatter"});I&&(N=q(q({},N),I.props.points[A].tooltipPosition),T=I.props.points[A].tooltipPayload);var B={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:C,activePayload:T,activeCoordinate:N};this.setState(B),this.renderCursor(E),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,P;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(b){_b([ir(b.children,oi)],[ir(this.props.children,oi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=ir(this.props.children,oi);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),P=XZ(w),j={chartX:Math.round(b.pageX-P.left),chartY:Math.round(b.pageY-P.top)},E=w.width/S.offsetWidth||1,A=this.inRange(j.chartX,j.chartY,E);if(!A)return null;var C=this.state,T=C.xAxisMap,_=C.yAxisMap,R=this.getTooltipEventType(),$=DT(this.state,this.props.data,this.props.layout,A);if(R!=="axis"&&T&&_){var N=Mo(T).scale,I=Mo(_).scale,B=N&&N.invert?N.invert(j.chartX):null,k=I&&I.invert?I.invert(j.chartY):null;return q(q({},j),{},{xValue:B,yValue:k},$)}return $?q(q({},j),$):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,j=b/w,E=S/w;if(P==="horizontal"||P==="vertical"){var A=this.state.offset,C=j>=A.left&&j<=A.left+A.width&&E>=A.top&&E<=A.top+A.height;return C?{x:j,y:E}:null}var T=this.state,_=T.angleAxisMap,R=T.radiusAxisMap;if(_&&R){var $=Mo(_);return aC({x:j,y:E},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=ir(b,oi),P={};w&&S==="axis"&&(w.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=Lh(this.props,this.handleOuterEvent);return q(q({},j),P)}},{key:"addListener",value:function(){Kv.on(qv,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Kv.removeListener(qv,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var P=this.state.formattedGraphicalItems,j=0,E=P.length;j<E;j++){var A=P[j];if(A.item===b||A.props.key===b.key||S===Gi(A.item.type)&&w===A.childIndex)return A}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,S=this.state.offset,w=S.left,P=S.top,j=S.height,E=S.width;return D.createElement("defs",null,D.createElement("clipPath",{id:b},D.createElement("rect",{x:w,y:P,height:j,width:E})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(S,w){var P=$T(w,2),j=P[0],E=P[1];return q(q({},S),{},Pe({},j,E.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(S,w){var P=$T(w,2),j=P[0],E=P[1];return q(q({},S),{},Pe({},j,E.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[b])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(b){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[b])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(b){var S=this.state,w=S.formattedGraphicalItems,P=S.activeItem;if(w&&w.length)for(var j=0,E=w.length;j<E;j++){var A=w[j],C=A.props,T=A.item,_=T.type.defaultProps!==void 0?q(q({},T.type.defaultProps),T.props):T.props,R=Gi(T.type);if(R==="Bar"){var $=(C.data||[]).find(function(k){return Rse(b,k)});if($)return{graphicalItem:A,payload:$}}else if(R==="RadialBar"){var N=(C.data||[]).find(function(k){return aC(b,k)});if(N)return{graphicalItem:A,payload:N}}else if(ly(A,P)||uy(A,P)||Zf(A,P)){var I=xue({graphicalItem:A,activeTooltipItem:P,itemData:_.data}),B=_.activeIndex===void 0?I:_.activeIndex;return{graphicalItem:q(q({},A),{},{childIndex:B}),payload:Zf(A,P)?_.data[I]:A.props.data[I]}}}return null}},{key:"render",value:function(){var b=this;if(!Qj(this))return null;var S=this.props,w=S.children,P=S.className,j=S.width,E=S.height,A=S.style,C=S.compact,T=S.title,_=S.desc,R=MT(S,Wpe),$=ve(R,!1);if(C)return D.createElement(yT,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement(kb,dl({},$,{width:j,height:E,title:T,desc:_}),this.renderClipPath(),Zj(w,this.renderMap)));if(this.props.accessibilityLayer){var N,I;$.tabIndex=(N=this.props.tabIndex)!==null&&N!==void 0?N:0,$.role=(I=this.props.role)!==null&&I!==void 0?I:"application",$.onKeyDown=function(k){b.accessibilityManager.keyboardEvent(k)},$.onFocus=function(){b.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return D.createElement(yT,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement("div",dl({className:Ae("recharts-wrapper",P),style:q({position:"relative",cursor:"default",width:j,height:E},A)},B,{ref:function(L){b.container=L}}),D.createElement(kb,dl({},$,{width:j,height:E,title:T,desc:_,style:lhe}),this.renderClipPath(),Zj(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(O.Component);Pe(v,"displayName",n),Pe(v,"defaultProps",q({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Pe(v,"getDerivedStateFromProps",function(x,g){var m=x.dataKey,b=x.data,S=x.children,w=x.width,P=x.height,j=x.layout,E=x.stackOffset,A=x.margin,C=g.dataStartIndex,T=g.dataEndIndex;if(g.updateId===void 0){var _=LT(x);return q(q(q({},_),{},{updateId:0},h(q(q({props:x},_),{},{updateId:0}),g)),{},{prevDataKey:m,prevData:b,prevWidth:w,prevHeight:P,prevLayout:j,prevStackOffset:E,prevMargin:A,prevChildren:S})}if(m!==g.prevDataKey||b!==g.prevData||w!==g.prevWidth||P!==g.prevHeight||j!==g.prevLayout||E!==g.prevStackOffset||!bl(A,g.prevMargin)){var R=LT(x),$={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},N=q(q({},DT(g,b,j)),{},{updateId:g.updateId+1}),I=q(q(q({},R),$),N);return q(q(q({},I),h(q({props:x},I),g)),{},{prevDataKey:m,prevData:b,prevWidth:w,prevHeight:P,prevLayout:j,prevStackOffset:E,prevMargin:A,prevChildren:S})}if(!_b(S,g.prevChildren)){var B,k,L,M,z=ir(S,fa),U=z&&(B=(k=z.props)===null||k===void 0?void 0:k.startIndex)!==null&&B!==void 0?B:C,V=z&&(L=(M=z.props)===null||M===void 0?void 0:M.endIndex)!==null&&L!==void 0?L:T,W=U!==C||V!==T,Q=!_e(b),G=Q&&!W?g.updateId:g.updateId+1;return q(q({updateId:G},h(q(q({props:x},g),{},{updateId:G,dataStartIndex:U,dataEndIndex:V}),g)),{},{prevChildren:S,dataStartIndex:U,dataEndIndex:V})}return null}),Pe(v,"renderActiveDot",function(x,g,m){var b;return O.isValidElement(x)?b=O.cloneElement(x,g):Oe(x)?b=x(g):b=D.createElement(oy,g),D.createElement(Ie,{className:"recharts-active-dot",key:m},b)});var y=O.forwardRef(function(g,m){return D.createElement(v,dl({},g,{ref:m}))});return y.displayName=v.displayName,y},iO=gy({chartName:"BarChart",GraphicalChild:bo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:so},{axisType:"yAxis",AxisComp:lo}],formatAxisMap:F2}),vhe=gy({chartName:"PieChart",GraphicalChild:xo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:qu},{axisType:"radiusAxis",AxisComp:Td}],formatAxisMap:a2,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),OD=gy({chartName:"AreaChart",GraphicalChild:wo,axisComponents:[{axisType:"xAxis",AxisComp:so},{axisType:"yAxis",AxisComp:lo}],formatAxisMap:F2}),xhe=gy({chartName:"RadialBarChart",GraphicalChild:_d,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:qu},{axisType:"radiusAxis",AxisComp:Td}],formatAxisMap:a2,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const PD=O.createContext(null);function jD(){return O.useContext(PD)??{}}const bhe=["h-full w-full text-[10px]","[&_.recharts-cartesian-grid_line]:stroke-line","[&_.recharts-cartesian-axis-line]:stroke-line","[&_.recharts-cartesian-axis-tick-line]:stroke-line","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground","[&_.recharts-radial-bar-background-sector]:fill-panel-2","[&_.recharts-reference-line_line]:stroke-line","[&_.recharts-brush-texts_text]:fill-muted-foreground","[&_.recharts-sector]:outline-none","[&_.recharts-layer]:outline-none","[&_.recharts-surface]:outline-none"].join(" "),ED={height:18,travellerWidth:8,stroke:"var(--accent)",fill:"color-mix(in srgb, var(--panel-2) 80%, transparent)"};function whe(e){const t={};for(const[n,r]of Object.entries(e))r.color&&(t[`--color-${n}`]=r.color);return t}function Yi(e){return`var(--color-${e})`}function js({config:e,className:t,children:n}){const r=O.useMemo(()=>whe(e),[e]);return d.jsx(PD.Provider,{value:e,children:d.jsx("div",{"data-chart":"",className:gt(bhe,t),style:r,children:d.jsx(zZ,{width:"100%",height:"100%",children:n})})})}const bu=oi,rw=ls;function AD(e){return typeof e=="object"&&e!==null}function CD(e){return Array.isArray(e)?e.filter(AD):[]}function Xr(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e)}function She(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ohe(e){return AD(e.payload)?e.payload:void 0}function Phe(e){return Xr(e.dataKey)??Xr(e.name)}function jhe(e){return Xr(e.dataKey)??Xr(e.name)??Xr(e.value)}function iw(e,t){return e??`series-${t}`}function TD(e,t,n){var i,o;const r=t?(i=n[t])==null?void 0:i.color:void 0;return Xr((o=Ohe(e))==null?void 0:o.color)??r??Xr(e.color)??Xr(e.fill)}function _D(e,t,n){var i;return(t?(i=n[t])==null?void 0:i.label:void 0)??Xr(e.name)??t??""}function wu({active:e,payload:t,label:n,hideLabel:r=!1,hideIndicator:i=!1,labelFormatter:o,valueFormatter:a,className:s}){const l=jD(),u=CD(t);if(!e||u.length===0)return null;const c=Xr(n),f=c===void 0?null:(o==null?void 0:o(c))??c;return d.jsxs("div",{className:gt("min-w-[8rem] rounded border border-line bg-popover px-2 py-1.5 text-[11px] text-popover-foreground shadow-lg",s),children:[!r&&f!==null&&d.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:f}),d.jsx("div",{className:"grid gap-0.5",children:u.map((p,h)=>{const v=Phe(p),y=She(p.value),x=y!==void 0&&a?a(y,v??""):Xr(p.value)??"—",g=TD(p,v,l);return d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[!i&&d.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[2px] border border-line",style:g?{background:g}:void 0}),_D(p,v,l)]}),d.jsx("span",{className:"font-mono tabular-nums text-foreground",children:x})]},iw(v,h))})})]})}function ow({payload:e,hidden:t,onToggle:n,className:r}){const i=jD(),o=CD(e);return o.length===0?null:d.jsx("div",{className:gt("flex flex-wrap items-center justify-center gap-x-2 gap-y-1",r),children:o.map((a,s)=>{const l=jhe(a),u=l!==void 0&&(t==null?void 0:t.has(l))===!0,c=TD(a,l,i),f=d.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:c?{background:c}:void 0}),p=_D(a,l,i);return!n||l===void 0?d.jsxs("span",{className:"flex items-center gap-1.5 px-1 text-[10px] text-muted-foreground",children:[f,p]},iw(l,s)):d.jsxs(Xe,{variant:"ghost",size:"xs","aria-pressed":!u,title:u?`Show ${l}`:`Hide ${l}`,className:gt("gap-1.5 normal-case tracking-normal",u&&"opacity-40"),onClick:()=>n(l),children:[f,p]},iw(l,s))})})}function Ehe(){const[e,t]=O.useState(()=>new Set),n=O.useCallback(i=>{t(o=>{const a=new Set(o);return a.delete(i)||a.add(i),a})},[]),r=O.useCallback(i=>e.has(i),[e]);return{hidden:e,toggle:n,isHidden:r}}function Ahe(e,t){return function(r,...i){const o=new URL(e);return o.searchParams.set("code",r.toString()),i.forEach(a=>o.searchParams.append("args[]",a)),`${t} error #${r}; visit ${o} for the full message.`}}const gn=Ahe("https://base-ui.com/production-error","Base UI"),RD=O.createContext(void 0);function Xu(e){const t=O.useContext(RD);if(!e&&t===void 0)throw new Error(gn(27));return t}const BT={};function Fn(e,t){const n=O.useRef(BT);return n.current===BT&&(n.current=e(t)),n}function Es(e,t,n,r){const i=Fn(kD).current;return The(i,e,t,n,r)&&ND(i,[e,t,n,r]),i.callback}function Che(e){const t=Fn(kD).current;return _he(t,e)&&ND(t,e),t.callback}function kD(){return{callback:null,cleanup:null,refs:[]}}function The(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function _he(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function ND(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const a=o(n);typeof a=="function"&&(r[i]=a);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const o=t[i];if(o!=null)switch(typeof o){case"function":{const a=r[i];typeof a=="function"?a():o(null);break}case"object":{o.current=null;break}}}}}}}const Rhe=parseInt(O.version,10);function oO(e){return Rhe>=e}function UT(e){if(!O.isValidElement(e))return null;const t=e,n=t.props;return(oO(19)?n==null?void 0:n.ref:t.ref)??null}function aw(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ot(){}const da=Object.freeze([]),$t=Object.freeze({});function khe(e,t){const n={};for(const r in e){const i=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](i);o!=null&&Object.assign(n,o);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Nhe(e,t){return typeof e=="function"?e(t):e}function $he(e,t){return typeof e=="function"?e(t):e}const aO={};function As(e,t,n,r,i){if(!n&&!r&&!i&&!e)return zm(t);let o=zm(e);return t&&(o=Mc(o,t)),n&&(o=Mc(o,n)),r&&(o=Mc(o,r)),i&&(o=Mc(o,i)),o}function Mhe(e){if(e.length===0)return aO;if(e.length===1)return zm(e[0]);let t=zm(e[0]);for(let n=1;n<e.length;n+=1)t=Mc(t,e[n]);return t}function zm(e){return sO(e)?{...MD(e,aO)}:Ihe(e)}function Mc(e,t){return sO(t)?MD(t,e):Dhe(e,t)}function Ihe(e){const t={...e};for(const n in t){const r=t[n];$D(n,r)&&(t[n]=ID(r))}return t}function Dhe(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=aw(e.style,r);break}case"className":{e[n]=DD(e.className,r);break}default:$D(n,r)?e[n]=Lhe(e[n],r):e[n]=r}}return e}function $D(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function sO(e){return typeof e=="function"}function MD(e,t){return sO(e)?e(t):e??aO}function Lhe(e,t){return t?e?(...n)=>{const r=n[0];if(LD(r)){const o=r;Hm(o);const a=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),a}const i=t(...n);return e==null||e(...n),i}:ID(t):e}function ID(e){return e&&((...t)=>{const n=t[0];return LD(n)&&Hm(n),e(...t)})}function Hm(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function DD(e,t){return t?e?t+" "+e:t:e}function LD(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function tn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=zhe(r));const i=Fhe(t,n,r);if(n.enabled===!1)return null;const o=n.state??$t;return Hhe(e,r,i,o)}function Fhe(e,t,n){const{className:r,style:i}=e,{state:o=$t,ref:a,props:s,stateAttributesMapping:l,enabled:u=!0}=t,c=u?Nhe(r,o):void 0,f=u?$he(i,o):void 0,p=u?khe(o,l):$t,h=u&&s?Bhe(s):void 0,v=u?aw(p,h)??{}:$t;return typeof document<"u"&&(u?Array.isArray(a)?v.ref=Che([v.ref,UT(n),...a]):v.ref=Es(v.ref,UT(n),a):Es(null,null)),u?(c!==void 0&&(v.className=DD(v.className,c)),f!==void 0&&(v.style=aw(v.style,f)),v):$t}function Bhe(e){return Array.isArray(e)?Mhe(e):As(void 0,e)}const Uhe=Symbol.for("react.lazy");function zhe(e){if((e==null?void 0:e.$$typeof)!==Uhe)return e;const t=O.Children.toArray(e)[0];return O.isValidElement(t)?t:e}function Hhe(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=As(n,t.props);return i.ref=n.ref,O.cloneElement(t,i)}if(e&&typeof e=="string")return Vhe(e,n);throw new Error(gn(8))}function Vhe(e,t){return e==="button"?O.createElement("button",{type:"button",...t,key:t.key}):e==="img"?O.createElement("img",{alt:"",...t,key:t.key}):O.createElement(e,t)}const FD="data-starting-style",Whe="data-ending-style",Khe={[FD]:""},qhe={[Whe]:""},lO={transitionStatus(e){return e==="starting"?Khe:e==="ending"?qhe:null}},Ghe="data-open",Xhe="data-closed",Yhe="data-anchor-hidden",BD="data-popup-open",Qhe="data-pressed",Jhe={[BD]:""},Zhe={[BD]:"",[Qhe]:""},eme={[Ghe]:""},tme={[Xhe]:""},nme={[Yhe]:""},UD={open(e){return e?Jhe:null}},rme={open(e){return e?Zhe:null}},yy={open(e){return e?eme:tme},anchorHidden(e){return e?nme:null}},zD={...yy,...lO},ime=O.forwardRef(function(t,n){const{render:r,className:i,style:o,forceRender:a=!1,...s}=t,l=Xu(),u=l.useState("open"),c=l.useState("nested"),f=l.useState("mounted"),p=l.useState("transitionStatus");return tn("div",t,{state:{open:u,transitionStatus:p},ref:[l.context.backdropRef,n],stateAttributesMapping:zD,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},s],enabled:a||!c})});function vy(){return typeof window<"u"}function pn(e){return uO(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function So(e){var t;return(t=(uO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uO(e){return vy()?e instanceof Node||e instanceof ct(e).Node:!1}function Me(e){return vy()?e instanceof Element||e instanceof ct(e).Element:!1}function it(e){return vy()?e instanceof HTMLElement||e instanceof ct(e).HTMLElement:!1}function Su(e){return!vy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}function kd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function ome(e){return/^(table|td|th)$/.test(pn(e))}function xy(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ame=/transform|translate|scale|rotate|perspective|filter/,sme=/paint|layout|strict|content/,$a=e=>!!e&&e!=="none";let Xv;function cO(e){const t=Me(e)?dr(e):e;return $a(t.transform)||$a(t.translate)||$a(t.scale)||$a(t.rotate)||$a(t.perspective)||!fO()&&($a(t.backdropFilter)||$a(t.filter))||ame.test(t.willChange||"")||sme.test(t.contain||"")}function lme(e){let t=pa(e);for(;it(t)&&!aa(t);){if(cO(t))return t;if(xy(t))return null;t=pa(t)}return null}function fO(){return Xv==null&&(Xv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xv}function aa(e){return/^(html|body|#document)$/.test(pn(e))}function dr(e){return ct(e).getComputedStyle(e)}function by(e){return Me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pa(e){if(pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Su(e)&&e.host||So(e);return Su(t)?t.host:t}function HD(e){const t=pa(e);return aa(t)?(e.ownerDocument||e).body:it(t)&&kd(t)?t:HD(t)}function sd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=HD(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=ct(i);if(o){const s=sw(a);return t.concat(a,a.visualViewport||[],kd(i)?i:[],s&&n?sd(s):[])}else return t.concat(i,sd(i,[],n))}function sw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const dO={...MR},Yv=dO.useInsertionEffect,ume=Yv&&Yv!==dO.useLayoutEffect?Yv:e=>e();function de(e){const t=Fn(cme).current;return t.next=e,ume(t.effect),t.trampoline}function cme(){const e={next:void 0,callback:fme,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function fme(){}const dme=()=>{},fe=typeof document<"u"?O.useLayoutEffect:dme,VD=O.createContext(void 0);function pO(e=!1){const t=O.useContext(VD);if(t===void 0&&!e)throw new Error(gn(16));return t}function pme(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,a=r&&t!==!1,s=r&&t===!1;return{props:O.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(u.tabIndex=i,!o&&n&&(u.tabIndex=t?i:-1)),(o&&(t||a)||!o&&n)&&(u["aria-disabled"]=n),o&&(!t||s)&&(u.disabled=n),u},[r,n,t,a,s,o,i])}}function He(e){return(e==null?void 0:e.ownerDocument)||document}function Qv(e,t,{detail:n=0}={}){e.dispatchEvent(new(ct(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hO(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:o}=e,a=O.useRef(null),s=pO(!0),l=o??s!==void 0,{props:u}=pme({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),c=O.useCallback(()=>{const h=a.current;Jv(h)&&l&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,l]);fe(c,[c]);const f=O.useCallback((h={})=>{const{onClick:v,onMouseDown:y,onKeyUp:x,onKeyDown:g,onPointerDown:m,...b}=h;return As({onClick(S){if(t){S.preventDefault();return}v==null||v(S)},onMouseDown(S){t||y==null||y(S)},onKeyDown(S){if(t||(Hm(S),g==null||g(S),S.baseUIHandlerPrevented))return;const w=S.target===S.currentTarget,P=S.currentTarget,j=Jv(P),E=!i&&hme(P),A=w&&(i?j:!E),C=S.key==="Enter",T=S.key===" ",_=P.getAttribute("role"),R=(_==null?void 0:_.startsWith("menuitem"))||_==="option"||_==="gridcell";if(w&&l&&T){if(S.defaultPrevented&&R)return;S.preventDefault(),(!i||j)&&(S.preventBaseUIHandler(),Qv(P,S));return}if(!A||i||!T&&!C){w&&E&&T&&S.preventDefault();return}S.defaultPrevented||(S.preventDefault(),C&&(S.preventBaseUIHandler(),Qv(P,S)))},onKeyUp(S){if(!t){if(Hm(S),x==null||x(S),S.target===S.currentTarget&&i&&l&&Jv(S.currentTarget)&&S.key===" "){S.preventDefault();return}S.baseUIHandlerPrevented||S.target===S.currentTarget&&!i&&!l&&!S.defaultPrevented&&S.key===" "&&(S.preventBaseUIHandler(),Qv(S.currentTarget,S))}},onPointerDown(S){if(t){S.preventDefault();return}m==null||m(S)}},i?{type:"button"}:{role:"button"},u,b)},[t,u,l,i]),p=de(h=>{a.current=h,c()});return{getButtonProps:f,buttonRef:p}}function Jv(e){return it(e)&&e.tagName==="BUTTON"}function hme(e){return it(e)&&e.tagName==="A"&&!!e.href}const ha="none",Nd="trigger-press",Wn="trigger-hover",nh="trigger-focus",mO="outside-press",Zv="item-press",wy="focus-out",gO="escape-key",zT="list-navigation",mme="cancel-open",WD="disabled",HT="missing",VT="initial",KD="imperative-action",gme="window-resize";function $e(e,t,n,r){let i=!1,o=!1;const a=r??$t;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...a}}let WT=0;function yme(e,t="mui"){const[n,r]=O.useState(e),i=e||n;return O.useEffect(()=>{n==null&&(WT+=1,r(`${t}-${WT}`))},[n,t]),i}const KT=dO.useId;function Sy(e,t){if(KT!==void 0){const n=KT();return e??(t?`${t}-${n}`:n)}return yme(e,t)}function Yu(e){return Sy(e,"base-ui")}const vme=O.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...s}=t,l=Xu(),u=Yu(a);return l.useSyncedValueWithCleanup("descriptionElementId",u),tn("p",t,{ref:n,props:[{id:u},s]})});function yO(e){O.useEffect(e,da)}const Pc=0;class Jr{constructor(){Ze(this,"currentId",Pc);Ze(this,"clear",()=>{this.currentId!==Pc&&(clearTimeout(this.currentId),this.currentId=Pc)});Ze(this,"disposeEffect",()=>this.clear)}static create(){return new Jr}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Pc,n()},t)}isStarted(){return this.currentId!==Pc}}function cr(){const e=Fn(Jr.create).current;return yO(e.disposeEffect),e}function xme(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:bme,platform:wme,maxTouchPoints:Sme}=xme(),Oy=bme.toLowerCase(),ld=wme.toLowerCase(),Py=/^i(os$|p)/.test(ld)||ld==="macintel"&&Sme>1,qT="android",lw=ld===qT||Oy.includes(qT),qD=!Py&&ld.startsWith("mac");ld.startsWith("win");const Ome=qD||Py;var PR;const Oo=typeof CSS<"u"&&!!((PR=CSS.supports)!=null&&PR.call(CSS,"-webkit-backdrop-filter:none"));!Oo&&Oy.includes("firefox");!Oo&&Oy.includes("chrom");const Pme=Ome,vO=/jsdom|happydom/.test(Oy);function ai(e){e.preventDefault(),e.stopPropagation()}function jme(e){return"nativeEvent"in e}function jy(e){return e.pointerType===""&&e.isTrusted?!0:lw&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xO(e){return vO?!1:!lw&&e.width===0&&e.height===0||lw&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function sa(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Eme(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Mn(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function xe(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Su(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function cn(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const uw="data-base-ui-focusable",GD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ey="ArrowLeft",Ay="ArrowRight",XD="ArrowUp",bO="ArrowDown",cw="data-trigger-disabled";function Vm(e,t){if(!Me(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(cw);for(const[,r]of t.entries())if(xe(r,n))return!r.hasAttribute(cw);return!1}function ex(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ame(e){return e.matches("html,body")}function Cy(e){return it(e)&&e.matches(GD)}function Cme(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${GD}`))!=null}function fw(e){return e?e.getAttribute("role")==="combobox"&&Cy(e):!1}function Tme(e){if(!e||vO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Wm(e){return e?e.hasAttribute(uw)?e:e.querySelector(`[${uw}]`)||e:null}function _me(e,t){return t!=null&&!sa(t)?0:typeof e=="function"?e():e}function Cs(e,t,n){const r=_me(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function GT(e){return typeof e=="function"?e():e}function YD(e,t){return t||e==="click"||e==="mousedown"}function Rme(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const QD=O.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Jr,currentIdRef:{current:null},currentContextRef:{current:null}});function kme(e,t){e.current=t.current}function Nme(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=O.useRef(n),o=O.useRef(n),a=O.useRef(null),s=O.useRef(null),l=cr();return fe(()=>{if(o.current=n,!a.current){i.current=n;return}i.current={open:Cs(i.current,"open"),close:Cs(n,"close")}},[n,a,i,o]),d.jsx(QD.Provider,{value:O.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:o,currentIdRef:a,timeoutMs:r,currentContextRef:s,timeout:l}),[r,l]),children:t})}function $me(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),o=O.useContext(QD),{currentIdRef:a,delayRef:s,timeoutMs:l,initialDelayRef:u,currentContextRef:c,hasProvider:f,timeout:p}=o,[h,v]=O.useState(!1),y=O.useRef(n);return fe(()=>{y.current=n},[n]),fe(()=>{function x(){var g;(g=c.current)==null||g.setIsInstantPhase(!1),a.current=null,c.current=null,s.current=u.current,p.clear()}if(a.current&&!n&&a.current===i){if(v(!1),l){const g=i;return p.start(l,()=>{r.select("open")||a.current&&a.current!==g||x()}),()=>{(y.current||a.current!==g)&&p.clear()}}x()}},[n,i,a,s,l,u,c,p,r]),fe(()=>{if(!n)return;const x=c.current,g=a.current;p.clear(),c.current={onOpenChange:r.setOpen,setIsInstantPhase:v},a.current=i,s.current={open:0,close:Cs(u.current,"close")},g!==null&&g!==i?(v(!0),x==null||x.setIsInstantPhase(!0),x==null||x.onOpenChange(!1,$e(ha))):(v(!1),x==null||x.setIsInstantPhase(!1))},[n,i,r,a,s,u,c,p]),fe(()=>()=>{if(a.current===i){if(c.current=null,!y.current)return;a.current=null,kme(s,u),p.clear()}},[c,a,s,i,u,p]),O.useMemo(()=>({activeIdRef:a,hasProvider:f,delayRef:s,isInstantPhase:h}),[a,f,s,h])}function Ne(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wi(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Rt(e){const t=Fn(Mme,e).current;return t.next=e,fe(t.effect),t}function Mme(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Pp=null;class Ime{constructor(){Ze(this,"callbacks",[]);Ze(this,"callbacksCount",0);Ze(this,"nextId",1);Ze(this,"startId",1);Ze(this,"isScheduled",!1);Ze(this,"tick",t=>{var i;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(i=n[o])==null||i.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let jp=new Ime;class fi{constructor(){Ze(this,"currentId",Pp);Ze(this,"cancel",()=>{this.currentId!==Pp&&(jp.cancel(this.currentId),this.currentId=Pp)});Ze(this,"disposeEffect",()=>this.cancel)}static create(){return new fi}static request(t){return jp.request(t)}static cancel(t){return jp.cancel(t)}request(t){this.cancel(),this.currentId=jp.request(()=>{this.currentId=Pp,t()})}}function Ou(){const e=Fn(fi.create).current;return yO(e.disposeEffect),e}const JD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ZD={...JD,position:"fixed",top:0,left:0},Dme={...JD,position:"absolute"},Km=O.forwardRef(function(t,n){const[r,i]=O.useState();fe(()=>{Pme&&Oo&&i("button")},[]);const o={tabIndex:0,role:r};return d.jsx("span",{...t,ref:n,style:ZD,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Pu=Math.min,Qi=Math.max,qm=Math.round,Ep=Math.floor,Ji=e=>({x:e,y:e}),Lme={left:"right",right:"left",bottom:"top",top:"bottom"};function eL(e,t,n){return Qi(e,Pu(t,n))}function ma(e,t){return typeof e=="function"?e(t):e}function Cr(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function wO(e){return e==="x"?"y":"x"}function SO(e){return e==="y"?"height":"width"}function Er(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function OO(e){return wO(Er(e))}function Fme(e,t,n){n===void 0&&(n=!1);const r=uo(e),i=OO(e),o=SO(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Gm(a)),[a,Gm(a)]}function Bme(e){const t=Gm(e);return[dw(e),t,dw(t)]}function dw(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const XT=["left","right"],YT=["right","left"],Ume=["top","bottom"],zme=["bottom","top"];function Hme(e,t,n){switch(e){case"top":case"bottom":return n?t?YT:XT:t?XT:YT;case"left":case"right":return t?Ume:zme;default:return[]}}function Vme(e,t,n,r){const i=uo(e);let o=Hme(Cr(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(dw)))),o}function Gm(e){const t=Cr(e);return Lme[t]+e.slice(t.length)}function Wme(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function tL(e){return typeof e!="number"?Wme(e):{top:e,right:e,bottom:e,left:e}}function ud(e){const{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 ef(e,t){return t<0||t>=e.length}function rh(e,t){return Ki(e.current,{disabledIndices:t})}function pw(e,t){return Ki(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ki(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let o=t;do o+=n?-i:i;while(o>=0&&o<=e.length-1&&Pl(e,o,r));return o}function Pl(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const i=e[t];return i?!Ty(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function Kme(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Ty(e,t=e?dr(e):null){return!e||!e.isConnected||!t||Kme(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const qme='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Gme(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Su(n)?n.host:null}function hw(e){for(const t of Array.from(e.children))if(pn(t)==="summary")return t;return null}function Xme(e,t){const n=hw(t);return!!n&&(e===n||xe(n,e))}function nL(e){const t=e?pn(e):"";return e!=null&&e.matches(qme)&&(t!=="summary"||e.parentElement!=null&&pn(e.parentElement)==="details"&&hw(e.parentElement)===e)&&(t!=="details"||hw(e)==null)&&(t!=="input"||e.type!=="hidden")}function rL(e){if(!nL(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Gme(t)){const n=t!==e,r=pn(t)==="slot";if(t.hasAttribute("inert")||n&&pn(t)==="details"&&!t.open&&!Xme(e,t)||t.hasAttribute("hidden")||!r&&!Yme(t,n))return!1}return!0}function Yme(e,t){const n=dr(e);return t?n.display!=="none":Ty(e,n)}function iL(e){const t=e.tabIndex;if(t<0){const n=pn(e);if(n==="details"||n==="audio"||n==="video"||it(e)&&e.isContentEditable)return 0}return t}function tx(e){if(pn(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Qme(e,t){const n=tx(e);if(!n)return!0;const r=t.find(i=>{const o=tx(i);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(i=>{const o=tx(i);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function oL(e){if(it(e)&&pn(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return it(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function aL(e,t){oL(e).forEach(n=>{nL(n)&&t.push(n),aL(n,t)})}function sL(e,t,n){oL(e).forEach(r=>{it(r)&&r.matches(t)&&n.push(r),sL(r,t,n)})}function PO(e){return rL(e)&&iL(e)>=0}function lL(e){const t=[];return aL(e,t),t.filter(rL)}function _y(e){const t=lL(e);return t.filter(n=>iL(n)>=0&&Qme(n,t))}function uL(e,t){const n=_y(e),r=n.length;if(r===0)return;const i=Mn(He(e)),o=n.indexOf(i),a=o===-1?t===1?0:r-1:o+t;return n[a]}function cL(e){return uL(He(e).body,1)||e}function fL(e){return uL(He(e).body,-1)||e}function tf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!xe(n,r)}function Jme(e){_y(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function QT(e){const t=[];sL(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ga(e,t,n=!0){return e.filter(i=>i.parentId===t).flatMap(i=>{var o;return[...!n||(o=i.context)!=null&&o.open?[i]:[],...ga(e,i.id,n)]})}function JT(e,t){var i;let n=[],r=(i=e.find(o=>o.id===t))==null?void 0:i.parentId;for(;r;){const o=e.find(a=>a.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function cd(e){return`data-base-ui-${e}`}let Ap=0;function ih(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ap);function o(){i&&!i()||e==null||e.focus({preventScroll:n})}if(r)return o(),Ot;const a=requestAnimationFrame(o);return Ap=a,()=>{Ap===a&&(cancelAnimationFrame(a),Ap=0)}}const nx={inert:new WeakMap,"aria-hidden":new WeakMap},ZT="data-base-ui-inert",mw={inert:new WeakSet,"aria-hidden":new WeakSet};let jc=new WeakMap,rx=0;function Zme(e){return mw[e]}function dL(e){return e?Su(e)?e.host:dL(e.parentNode):null}const e_=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=dL(n);return e.contains(r)?r:null}).filter(n=>n!=null),t_=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},n_=(e,t,n)=>{const r=[],i=o=>{!o||n.has(o)||Array.from(o.children).forEach(a=>{pn(a)!=="script"&&(t.has(a)?i(a):r.push(a))})};return i(e),r};function ege(e,t,n,r,{mark:i=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let a=null,s=null;const l=e_(t,e),u=i?n_(t,t_(l),new Set(l)):[],c=[],f=[];if(o){const p=nx[o],h=Zme(o);s=h,a=p;const v=e_(t,Array.from(t.querySelectorAll("[aria-live]"))),y=l.concat(v);n_(t,t_(y),new Set(y)).forEach(g=>{const m=g.getAttribute(o),b=m!==null&&m!=="false",S=(p.get(g)||0)+1;p.set(g,S),c.push(g),S===1&&b&&h.add(g),b||g.setAttribute(o,o==="inert"?"":"true")})}return i&&u.forEach(p=>{const h=(jc.get(p)||0)+1;jc.set(p,h),f.push(p),h===1&&p.setAttribute(ZT,"")}),rx+=1,()=>{a&&c.forEach(p=>{const v=(a.get(p)||0)-1;a.set(p,v),v||(!(s!=null&&s.has(p))&&o&&p.removeAttribute(o),s==null||s.delete(p))}),i&&f.forEach(p=>{const h=(jc.get(p)||0)-1;jc.set(p,h),h||p.removeAttribute(ZT)}),rx-=1,rx||(nx.inert=new WeakMap,nx["aria-hidden"]=new WeakMap,mw.inert=new WeakSet,mw["aria-hidden"]=new WeakSet,jc=new WeakMap)}}function r_(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,o=He(e[0]).body;return ege(e,o,n,r,{mark:i})}const tge={style:{transition:"none"}},nge="data-base-ui-click-trigger",rge={fallbackAxisSide:"none"},ige={fallbackAxisSide:"end"},oge={clipPath:"inset(50%)",position:"fixed",top:0,left:0},pL=O.createContext(null),hL=()=>O.useContext(pL),age=cd("portal");function mL(e={}){const{ref:t,container:n,componentProps:r=$t,elementProps:i}=e,o=Sy(),a=hL(),s=a==null?void 0:a.portalNode,[l,u]=O.useState(null),[c,f]=O.useState(null),p=de(x=>{x!==null&&f(x)}),h=O.useRef(null);fe(()=>{if(n===null){h.current&&(h.current=null,f(null),u(null));return}const x=(n&&(uO(n)?n:n.current))??s??document.body;if(x==null){h.current&&(h.current=null,f(null),u(null));return}h.current!==x&&(h.current=x,f(null),u(x))},[n,s]);const v=tn("div",r,{ref:[t,p],props:[{id:o,[age]:""},i]}),y=l&&v?po.createPortal(v,l):null;return{node:c,nodeId:O.isValidElement(v)?v.props.id:void 0,subtree:y}}const gL=O.forwardRef(function(t,n){const{render:r,className:i,style:o,children:a,container:s,portalOwnerRole:l,...u}=t,{node:c,nodeId:f,subtree:p}=mL({container:s,ref:n,componentProps:t,elementProps:u}),h=O.useRef(null),v=O.useRef(null),y=O.useRef(null),x=O.useRef(null),[g,m]=O.useState(null),b=O.useRef(!1),S=g==null?void 0:g.modal,w=g==null?void 0:g.open,P=!!g&&!g.modal&&g.open&&!!c;O.useEffect(()=>{if(!c||S)return;function E(A){c&&A.relatedTarget&&tf(A)&&(A.type==="focusin"?b.current&&(QT(c),b.current=!1):(Jme(c),b.current=!0))}return wi(Ne(c,"focusin",E,!0),Ne(c,"focusout",E,!0))},[c,S]),fe(()=>{!c||w!==!0||!b.current||(QT(c),b.current=!1)},[w,c]);const j=O.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:v,beforeInsideRef:y,afterInsideRef:x,portalNode:c,setFocusManagerState:m}),[c]);return d.jsxs(O.Fragment,{children:[p,d.jsxs(pL.Provider,{value:j,children:[P&&c&&d.jsx(Km,{"data-type":"outside",ref:h,onFocus:E=>{var A;if(tf(E,c))(A=y.current)==null||A.focus();else{const C=g?g.domReference:null,T=fL(C);T==null||T.focus()}}}),P&&c&&d.jsx("span",{role:l,"aria-owns":f,style:oge}),c&&po.createPortal(a,c),P&&c&&d.jsx(Km,{"data-type":"outside",ref:v,onFocus:E=>{var A;if(tf(E,c))(A=x.current)==null||A.focus();else{const C=g?g.domReference:null,T=cL(C);T==null||T.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,$e(wy,E.nativeEvent)))}}})]})]})});function sge(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const lge=O.createContext(null),uge=O.createContext(null),Ry=()=>{var e;return((e=O.useContext(lge))==null?void 0:e.id)||null},Qu=e=>{const t=O.useContext(uge);return e??t};function ki(e){return e==null?e:"current"in e?e.current:e}function cge(e,t){const n=ct(cn(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const i_=20;let Xo=[];function jO(){Xo=Xo.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function o_(e){jO(),e&&pn(e)!=="body"&&(Xo.push(new WeakRef(e)),Xo.length>i_&&(Xo=Xo.slice(-i_)))}function a_(){var e;return jO(),(e=Xo[Xo.length-1])==null?void 0:e.deref()}function fge(e){return e?PO(e)?e:_y(e)[0]||e:null}function s_(e){var i;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((i=e.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=lL(e).filter(o=>{const a=o.getAttribute("data-tabindex")||"";return PO(o)||o.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function yL(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:o=!0,restoreFocus:a=!1,modal:s=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:c,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:h,getInsideElements:v}=e,y="rootStore"in t?t.rootStore:t,x=y.useState("open"),g=y.useState("domReferenceElement"),m=y.useState("floatingElement"),{events:b,dataRef:S}=y.context,w=de(()=>{var H;return(H=S.current.floatingContext)==null?void 0:H.nodeId}),P=i===!1,j=fw(g)&&P,E=Rt(i),A=Rt(o),C=Rt(u),T=Rt(x),_=Qu(h),R=hL(),$=O.useRef(!1),N=O.useRef(!1),I=O.useRef(!1),B=O.useRef(null),k=O.useRef(""),L=O.useRef(""),M=O.useRef(null),z=O.useRef(null),U=Es(M,p,R==null?void 0:R.beforeInsideRef),V=Es(z,R==null?void 0:R.afterInsideRef),W=cr(),Q=cr(),G=Ou(),le=R!=null,X=Wm(m),K=de((H=X)=>H?_y(H):[]),ee=de(()=>(v==null?void 0:v().filter(H=>H!=null))??[]);O.useEffect(()=>{if(r||!s)return;function H(J){J.key==="Tab"&&xe(X,Mn(He(X)))&&K().length===0&&!j&&ai(J)}const Z=He(X);return Ne(Z,"keydown",H)},[r,X,s,j,K]),O.useEffect(()=>{if(r||!x)return;const H=He(X);function Z(){I.current=!1}function J(we){const ae=cn(we),be=ee(),ce=xe(m,ae)||xe(g,ae)||xe(R==null?void 0:R.portalNode,ae)||be.some(Ee=>Ee===ae||xe(Ee,ae));I.current=!ce,L.current=we.pointerType||"keyboard",ae!=null&&ae.closest(`[${nge}]`)&&(N.current=!0,Q.start(0,()=>{N.current=!1}))}function se(){L.current="keyboard"}return wi(Ne(H,"pointerdown",J,!0),Ne(H,"pointerup",Z,!0),Ne(H,"pointercancel",Z,!0),Ne(H,"keydown",se,!0),Z)},[r,m,g,X,x,R,Q,ee]),O.useEffect(()=>{if(r||!l)return;const H=He(X);function Z(){N.current=!0,Q.start(0,()=>{N.current=!1})}function J(be){const ce=cn(be);PO(ce)&&(B.current=ce)}function se(be){const ce=be.relatedTarget,Ee=be.currentTarget,je=cn(be);s&&ce==null&&je!=null&&xe(m,je)&&o_(je),queueMicrotask(()=>{const Se=w(),ze=y.context.triggerElements,te=ee(),pe=(ce==null?void 0:ce.hasAttribute(cd("focus-guard")))&&[M.current,z.current,R==null?void 0:R.beforeInsideRef.current,R==null?void 0:R.afterInsideRef.current,R==null?void 0:R.beforeOutsideRef.current,R==null?void 0:R.afterOutsideRef.current,ki(f),ki(c)].includes(ce),oe=!(xe(g,ce)||xe(m,ce)||xe(ce,m)||xe(R==null?void 0:R.portalNode,ce)||te.some(Y=>Y===ce||xe(Y,ce))||ze.hasMatchingElement(Y=>xe(Y,ce))||pe||_&&(ga(_.nodesRef.current,Se).find(Y=>{var ge,Ce;return xe((ge=Y.context)==null?void 0:ge.elements.floating,ce)||xe((Ce=Y.context)==null?void 0:Ce.elements.domReference,ce)})||JT(_.nodesRef.current,Se).find(Y=>{var ge,Ce,Fe;return[(ge=Y.context)==null?void 0:ge.elements.floating,Wm((Ce=Y.context)==null?void 0:Ce.elements.floating)].includes(ce)||((Fe=Y.context)==null?void 0:Fe.elements.domReference)===ce})));if(Ee===g&&X&&s_(X),a&&Ee!==g&&!Ty(je)&&Mn(H)===H.body){if(it(X)&&(X.focus(),a==="popup")){G.request(()=>{X.focus()});return}const Y=K(),ge=B.current,Ce=(ge&&Y.includes(ge)?ge:null)||Y[Y.length-1]||X;it(Ce)&&Ce.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(j||!s)&&ce&&oe&&!N.current&&(j||ce!==a_())&&($.current=!0,y.setOpen(!1,$e(wy,be)))})}function we(){I.current||(S.current.insideReactTree=!0,W.start(0,()=>{S.current.insideReactTree=!1}))}const ae=it(g)?g:null;if(!(!m&&!ae))return wi(ae&&Ne(ae,"focusout",se),ae&&Ne(ae,"pointerdown",Z),m&&Ne(m,"focusin",J),m&&Ne(m,"focusout",se),m&&R&&Ne(m,"focusout",we,!0))},[r,g,m,X,s,_,R,y,l,a,K,j,w,S,W,Q,G,c,f,ee]),O.useEffect(()=>{var Ee,je,Se;if(r||!m||!x)return;const H=Array.from(((Ee=R==null?void 0:R.portalNode)==null?void 0:Ee.querySelectorAll(`[${cd("portal")}]`))||[]),J=(Se=(je=(_?JT(_.nodesRef.current,w()):[]).find(ze=>{var te;return fw(((te=ze.context)==null?void 0:te.elements.domReference)||null)}))==null?void 0:je.context)==null?void 0:Se.elements.domReference,we=[...[m,...H,M.current,z.current,R==null?void 0:R.beforeOutsideRef.current,R==null?void 0:R.afterOutsideRef.current,...ee()],J,ki(f),ki(c),j?g:null].filter(ze=>ze!=null),ae=r_(we,{ariaHidden:s||j,mark:!1}),be=[m,...H].filter(ze=>ze!=null),ce=r_(be);return()=>{ce(),ae()}},[x,r,g,m,s,R,j,_,w,c,f,ee]),fe(()=>{if(!x||r||!it(X))return;k.current="",L.current="";const H=He(X),Z=Mn(H);queueMicrotask(()=>{const J=E.current,se=typeof J=="function"?J(C.current||""):J;if(se===void 0||se===!1||xe(X,Z))return;let ae=null;const be=()=>(ae==null&&(ae=K(X)),ae[0]||X);let ce;se===!0||se===null?ce=be():ce=ki(se),ce=ce||be();const Ee=xe(X,Mn(H));ih(ce,{preventScroll:ce===X,shouldFocus(){if(!T.current)return!1;if(Ee)return!0;const je=Mn(H);return!(je!==ce&&xe(X,je))}})})},[r,x,X,K,E,C,T]),fe(()=>{if(r||!X)return;const H=He(X),Z=Mn(H),J=C.current==null;o_(Z);function se(ae){if(ae.open||(k.current=cge(ae.nativeEvent,L.current)),ae.reason===Wn&&ae.nativeEvent.type==="mouseleave"&&($.current=!0),ae.reason===mO)if(ae.nested)$.current=!1;else if(jy(ae.nativeEvent)||xO(ae.nativeEvent))$.current=!1;else{let be=!1;He(X).createElement("div").focus({get preventScroll(){return be=!0,!1}}),be?$.current=!1:$.current=!0}}b.on("openchange",se);function we(ae){const be=A.current;let ce=typeof be=="function"?be(ae):be;if(ce===void 0||ce===!1)return null;ce===null&&(ce=!0);const Ee=g!=null&&g.isConnected?g:null,je=Z!=null&&Z.isConnected&&pn(Z)!=="body"?Z:null;let Se=J?je||Ee:Ee||je;return Se||(Se=a_()||null),typeof ce=="boolean"?Se:ki(ce)||Se||null}return()=>{b.off("openchange",se);const ae=Mn(H),be=ee(),ce=xe(m,ae)||be.some(ze=>ze===ae||xe(ze,ae))||_&&ga(_.nodesRef.current,w(),!1).some(ze=>{var te;return xe((te=ze.context)==null?void 0:te.elements.floating,ae)}),Ee=A.current,je=k.current,Se=we(je);queueMicrotask(()=>{const ze=fge(Se),te=typeof Ee!="boolean";if(Ee&&!$.current&&it(ze)&&(!(!te&&ze!==ae&&ae!==H.body)||ce)){const pe={preventScroll:!0};je==="keyboard"&&(pe.focusVisible=!0),ze.focus(pe)}$.current=!1})}},[r,m,X,A,C,b,_,g,w,ee]),fe(()=>{if(!Oo||x||!m)return;const H=Mn(He(m));!it(H)||!Cy(H)||xe(m,H)&&H.blur()},[x,m]),fe(()=>{if(!(r||!R))return R.setFocusManagerState({modal:s,closeOnFocusOut:l,open:x,onOpenChange:y.setOpen,domReference:g}),()=>{R.setFocusManagerState(null)}},[r,R,s,x,y,l,g]),fe(()=>{if(!(r||!X))return s_(X),()=>{queueMicrotask(jO)}},[r,X]);const ie=!r&&(s?!j:!0)&&(le||s);return d.jsxs(O.Fragment,{children:[ie&&d.jsx(Km,{"data-type":"inside",ref:U,onFocus:H=>{var Z;if(s){const J=K();ih(J[J.length-1])}else if(R!=null&&R.portalNode)if($.current=!1,tf(H,R.portalNode)){const J=cL(g);J==null||J.focus()}else(Z=ki(f??R.beforeOutsideRef))==null||Z.focus()}}),n,ie&&d.jsx(Km,{"data-type":"inside",ref:V,onFocus:H=>{var Z;if(s)ih(K()[0]);else if(R!=null&&R.portalNode)if(l&&($.current=!0),tf(H,R.portalNode)){const J=fL(g);J==null||J.focus()}else(Z=ki(c??R.afterOutsideRef))==null||Z.focus()}})]})}function dge(e,t={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:a=!0,touchOpenDelay:s=0,reason:l=Nd}=t,u="rootStore"in e?e.rootStore:e,c=u.context.dataRef,f=O.useRef(void 0),p=Ou(),h=cr(),v=O.useMemo(()=>{function y(g,m,b,S){const w=$e(l,m,b);g&&S==="touch"&&s>0?h.start(s,()=>{u.setOpen(!0,w)}):u.setOpen(g,w)}function x(g,m,b){const S=c.current.openEvent,w=u.select("domReferenceElement")!==m;return g&&w||!g||!i?!0:S&&a?!b(S.type):!1}return{onPointerDown(g){f.current=sa(g.pointerType,!0)&&xO(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const m=f.current,b=g.nativeEvent,S=u.select("open");if(g.button!==0||r==="click"||sa(m,!0)&&o)return;const w=x(S,g.currentTarget,E=>E==="click"||E==="mousedown"),P=cn(b);if(Cy(P)){y(w,b,P,m);return}const j=g.currentTarget;p.request(()=>{y(w,b,j,m)})},onClick(g){if(r==="mousedown-only")return;const m=f.current;if(r==="mousedown"&&m){f.current=void 0;return}if(sa(m,!0)&&o)return;const b=u.select("open"),S=x(b,g.currentTarget,w=>w==="click"||w==="mousedown"||w==="keydown"||w==="keyup");y(S,g.nativeEvent,g.currentTarget,m)},onKeyDown(){f.current=void 0}}},[c,r,o,l,u,a,i,p,h,s]);return O.useMemo(()=>n?{reference:v}:$t,[n,v])}function pge(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){var h;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",s=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(((h=t.dataRef.current.openEvent)==null?void 0:h.type)||"")&&t.pointerType!=="touch";let u=o.width,c=o.height,f=o.x,p=o.y;return n==null&&t.x&&a&&(n=o.x-t.x),r==null&&t.y&&s&&(r=o.y-t.y),f-=n||0,p-=r||0,u=0,c=0,!i||l?(u=t.axis==="y"?o.width:0,c=t.axis==="x"?o.height:0,f=a&&t.x!=null?t.x:f,p=s&&t.y!=null?t.y:p):i&&!l&&(c=t.axis==="x"?o.height:c,u=t.axis==="y"?o.width:u),i=!0,{width:u,height:c,x:f,y:p,top:p,right:f+u,bottom:p+c,left:f}}}}function l_(e){return e!=null&&e.clientX!=null}function hge(e,t={}){const{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,o=i.useState("open"),a=i.useState("floatingElement"),s=i.useState("domReferenceElement"),l=i.context.dataRef,u=O.useRef(!1),c=O.useRef(null),[f,p]=O.useState(),[h,v]=O.useState([]),y=de(S=>{i.set("positionReference",S)}),x=de((S,w,P)=>{u.current||l.current.openEvent&&!l_(l.current.openEvent)||i.set("positionReference",pge(P??s,{x:S,y:w,axis:r,dataRef:l,pointerType:f}))}),g=de(S=>{o?c.current||(x(S.clientX,S.clientY,S.currentTarget),v([])):x(S.clientX,S.clientY,S.currentTarget)}),m=sa(f)?a:o;O.useEffect(()=>{if(!n){y(s);return}if(!m)return;function S(){var j;(j=c.current)==null||j.call(c),c.current=null}const w=ct(a);function P(j){const E=cn(j);xe(a,E)?S():x(j.clientX,j.clientY)}return!l.current.openEvent||l_(l.current.openEvent)?c.current=Ne(w,"mousemove",P):y(s),S},[m,n,a,l,s,i,x,y,h]),O.useEffect(()=>()=>{i.set("positionReference",null)},[i]),O.useEffect(()=>{n&&!a&&(u.current=!1)},[n,a]),O.useEffect(()=>{!n&&o&&(u.current=!0)},[n,o]);const b=O.useMemo(()=>{function S(w){p(w.pointerType)}return{onPointerDown:S,onPointerEnter:S,onMouseMove:g,onMouseEnter:g}},[g]);return O.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function mge(){return!1}function gge(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function EO(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:o="sloppy",referencePress:a=mge,bubbles:s,externalTree:l}=t,u="rootStore"in e?e.rootStore:e,c=u.useState("open"),f=u.useState("floatingElement"),{dataRef:p,events:h}=u.context,v=Qu(l),y=de(typeof i=="function"?i:()=>!1),x=typeof i=="function"?y:i,g=x!==!1,m=de(()=>o),{escapeKey:b,outsidePress:S}=gge(s),w=O.useRef(!1),P=O.useRef(!1),j=O.useRef(!1),E=O.useRef(!1),A=O.useRef(!1),C=O.useRef(""),T=O.useRef(null),_=cr(),R=cr(),$=de(()=>{R.clear(),p.current.insideReactTree=!1}),N=de(W=>{var le;const Q=(le=p.current.floatingContext)==null?void 0:le.nodeId;return(v?ga(v.nodesRef.current,Q):[]).some(X=>{var K;return((K=X.context)==null?void 0:K.open)&&!X.context.dataRef.current[W]})}),I=de(W=>ex(W,u.select("floatingElement"))||ex(W,u.select("domReferenceElement"))),B=de(W=>{a()&&u.setOpen(!1,$e(Nd,W.nativeEvent))}),k=de(W=>{if(!c||!n||!r||W.key!=="Escape"||A.current||!b&&N("__escapeKeyBubbles"))return;const Q=jme(W)?W.nativeEvent:W,G=$e(gO,Q);u.setOpen(!1,G),G.isCanceled||W.preventDefault(),!b&&!G.isPropagationAllowed&&W.stopPropagation()}),L=de(()=>{p.current.insideReactTree=!0,R.start(0,$)}),M=de(W=>{if(!c||!n||W.button!==0)return;const Q=cn(W.nativeEvent);xe(u.select("floatingElement"),Q)&&(w.current||(w.current=!0,P.current=!1))}),z=de(W=>{!c||!n||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&w.current&&(P.current=!0)});O.useEffect(()=>{function W(Q){Q.open||(E.current=!1)}return h.on("openchange",W),()=>{h.off("openchange",W)}},[h]),O.useEffect(()=>{if(!c||!n)return c||(E.current=!1),$;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=S;const W=new Jr,Q=new Jr,G=He(f);function le(){W.clear(),A.current=!0}function X(){W.start(Oo?5:0,()=>{A.current=!1})}function K(){j.current=!0,Q.start(0,()=>{j.current=!1})}function ee(){w.current=!1,P.current=!1}function ie(){const oe=C.current,Y=oe==="pen"||!oe?"mouse":oe,ge=m(),Ce=typeof ge=="function"?ge():ge;return typeof Ce=="string"?Ce:Ce[Y]}function H(oe){const Y=ie();return Y==="intentional"&&oe.type!=="click"||Y==="sloppy"&&oe.type==="click"}function Z(oe){var Ce;const Y=(Ce=p.current.floatingContext)==null?void 0:Ce.nodeId,ge=v&&ga(v.nodesRef.current,Y).some(Fe=>{var nn;return ex(oe,(nn=Fe.context)==null?void 0:nn.elements.floating)});return I(oe)||ge}function J(oe){if(H(oe)){oe.type!=="click"&&!I(oe)&&(Q.clear(),j.current=!1),$();return}if(p.current.insideReactTree){$();return}const Y=cn(oe),ge=`[${cd("inert")}]`,Ce=Me(Y)?Y.getRootNode():null,Fe=Array.from((Su(Ce)?Ce:He(u.select("floatingElement"))).querySelectorAll(ge)),nn=u.context.triggerElements;if(Y&&(nn.hasElement(Y)||nn.hasMatchingElement(bt=>xe(bt,Y))))return;let Tn=Me(Y)?Y:null;for(;Tn&&!aa(Tn);){const bt=pa(Tn);if(aa(bt)||!Me(bt))break;Tn=bt}if(!(Fe.length&&Me(Y)&&!Ame(Y)&&!xe(Y,u.select("floatingElement"))&&Fe.every(bt=>!xe(Tn,bt)))){if(it(Y)&&!("touches"in oe)){const bt=aa(Y),yn=dr(Y),er=/auto|scroll/,_n=bt||er.test(yn.overflowX),ti=bt||er.test(yn.overflowY),Mr=_n&&Y.clientWidth>0&&Y.scrollWidth>Y.clientWidth,Ei=ti&&Y.clientHeight>0&&Y.scrollHeight>Y.clientHeight,mr=yn.direction==="rtl",Ai=Ei&&(mr?oe.offsetX<=Y.offsetWidth-Y.clientWidth:oe.offsetX>Y.clientWidth),Ir=Mr&&oe.offsetY>Y.clientHeight;if(Ai||Ir)return}if(!Z(oe)){if(ie()==="intentional"){if(oe.detail!==0&&!jy(oe)&&!E.current)return;if(j.current){Q.clear(),j.current=!1;return}}typeof x=="function"&&!x(oe)||N("__outsidePressBubbles")||(u.setOpen(!1,$e(mO,oe)),$())}}}function se(oe){ie()!=="sloppy"||oe.pointerType==="touch"||!u.select("open")||!n||I(oe)||J(oe)}function we(oe){if(ie()!=="sloppy"||!u.select("open")||!n||I(oe))return;const Y=oe.touches[0];Y&&(T.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},_.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function ae(oe,Y){const ge=cn(oe);if(!ge)return;const Ce=Ne(ge,oe.type,()=>{Y(oe),Ce()})}function be(oe){C.current="touch",ae(oe,we)}function ce(oe){_.clear(),oe.type==="pointerdown"&&(oe.button===0&&(E.current=!0),C.current=oe.pointerType),!(oe.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)&&ae(oe,Y=>{Y.type==="pointerdown"?se(Y):J(Y)})}function Ee(oe){if(oe.type==="pointercancel"&&(E.current=!1),!w.current)return;const Y=P.current;if(ee(),ie()==="intentional"){if(oe.type==="pointercancel"){Y&&K();return}if(!Z(oe)){if(Y){K();return}typeof x=="function"&&!x(oe)||(Q.clear(),j.current=!0,$())}}}function je(oe){if(ie()!=="sloppy"||!T.current||I(oe))return;const Y=oe.touches[0];if(!Y)return;const ge=Math.abs(Y.clientX-T.current.startX),Ce=Math.abs(Y.clientY-T.current.startY),Fe=Math.sqrt(ge*ge+Ce*Ce);Fe>5&&(T.current.dismissOnTouchEnd=!0),Fe>10&&(J(oe),_.clear(),T.current=null)}function Se(oe){ae(oe,je)}function ze(oe){ie()!=="sloppy"||!T.current||I(oe)||(T.current.dismissOnTouchEnd&&J(oe),_.clear(),T.current=null)}function te(oe){ae(oe,ze)}const pe=wi(r&&wi(Ne(G,"keydown",k),Ne(G,"compositionstart",le),Ne(G,"compositionend",X)),g&&wi(Ne(G,"click",ce,!0),Ne(G,"pointerdown",ce,!0),Ne(G,"pointerup",Ee,!0),Ne(G,"pointercancel",Ee,!0),Ne(G,"mousedown",ce,!0),Ne(G,"mouseup",Ee,!0),Ne(G,"touchstart",be,{capture:!0,passive:!0}),Ne(G,"touchmove",Se,{capture:!0,passive:!0}),Ne(G,"touchend",te,{capture:!0,passive:!0})));return()=>{pe(),W.clear(),Q.clear(),ee(),j.current=!1,$()}},[p,f,r,g,x,c,n,b,S,k,$,m,N,I,v,u,_]);const U=O.useMemo(()=>({onKeyDown:k,onPointerDown:B,onClick:B}),[k,B]),V=O.useMemo(()=>({onKeyDown:k,onPointerDown:z,onMouseDown:z,onClickCapture:L,onMouseDownCapture(W){L(),M(W)},onPointerDownCapture(W){L(),M(W)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[k,L,M,z]);return O.useMemo(()=>n?{reference:U,floating:V,trigger:U}:{},[n,U,V])}function u_(e,t,n){let{reference:r,floating:i}=e;const o=Er(t),a=OO(t),s=SO(a),l=Cr(t),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}const v=uo(t);return v&&(h[a]+=p*(v==="end"?1:-1)*(n&&u?-1:1)),h}async function yge(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=ma(t,e),v=tL(h),x=s[p?f==="floating"?"reference":"floating":f],g=ud(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),m=f==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=await(o.isElement==null?void 0:o.isElement(b))&&await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1},w=ud(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:b,strategy:l}):m);return{top:(g.top-w.top+v.top)/S.y,bottom:(w.bottom-g.bottom+v.bottom)/S.y,left:(g.left-w.left+v.left)/S.x,right:(w.right-g.right+v.right)/S.x}}const vge=50,xge=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:yge},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=u_(u,r,l),p=r,h=0;const v={};for(let y=0;y<o.length;y++){const x=o[y];if(!x)continue;const{name:g,fn:m}=x,{x:b,y:S,data:w,reset:P}=await m({x:c,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:v,rects:u,platform:s,elements:{reference:e,floating:t}});c=b??c,f=S??f,v[g]={...v[g],...w},P&&h<vge&&(h++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(u=P.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:c,y:f}=u_(u,p,l)),y=-1)}return{x:c,y:f,placement:p,strategy:i,middlewareData:v}},bge=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=ma(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const g=Cr(i),m=Er(s),b=Cr(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=p||(b||!y?[Gm(s)]:Bme(s)),P=v!=="none";!p&&P&&w.push(...Vme(s,y,v,S));const j=[s,...w],E=await l.detectOverflow(t,x),A=[];let C=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(E[g]),f){const $=Fme(i,a,S);A.push(E[$[0]],E[$[1]])}if(C=[...C,{placement:i,overflows:A}],!A.every($=>$<=0)){var T,_;const $=(((T=o.flip)==null?void 0:T.index)||0)+1,N=j[$];if(N&&(!(f==="alignment"?m!==Er(N):!1)||C.every(k=>Er(k.placement)===m?k.overflows[0]>0:!0)))return{data:{index:$,overflows:C},reset:{placement:N}};let I=(_=C.filter(B=>B.overflows[0]<=0).sort((B,k)=>B.overflows[1]-k.overflows[1])[0])==null?void 0:_.placement;if(!I)switch(h){case"bestFit":{var R;const B=(R=C.filter(k=>{if(P){const L=Er(k.placement);return L===m||L==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(L=>L>0).reduce((L,M)=>L+M,0)]).sort((k,L)=>k[1]-L[1])[0])==null?void 0:R[0];B&&(I=B);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}},vL=new Set(["left","top"]);async function wge(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Cr(n),s=uo(n),l=Er(n)==="y",u=vL.has(a)?-1:1,c=o&&l?-1:1,f=ma(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof v=="number"&&(h=s==="end"?v*-1:v),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const Sge=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await wge(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},Oge=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:m=>{let{x:b,y:S}=m;return{x:b,y:S}}},...u}=ma(e,t),c={x:n,y:r},f=await o.detectOverflow(t,u),p=Er(i),h=wO(p);let v=c[h],y=c[p];const x=(m,b)=>eL(b+f[m==="y"?"top":"left"],b,b-f[m==="y"?"bottom":"right"]);a&&(v=x(h,v)),s&&(y=x(p,y));const g=l.fn({...t,[h]:v,[p]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:a,[p]:s}}}}}},Pge=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:o,placement:a,rects:s,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=ma(e,t),p={x:i,y:o},h=Er(a),v=wO(h);let y=p[v],x=p[h];const g=ma(u,t),m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(r=g.crossAxis)!=null?r:0};if(c){const w=v==="y"?"height":"width",P=s.reference[v]-s.floating[w]+m.mainAxis,j=s.reference[v]+s.reference[w]-m.mainAxis;y<P?y=P:y>j&&(y=j)}if(f){var b,S;const w=v==="y"?"width":"height",P=vL.has(Cr(a)),j=s.reference[h]-s.floating[w]+(P&&((b=l.offset)==null?void 0:b[h])||0)+(P?0:m.crossAxis),E=s.reference[h]+s.reference[w]+(P?0:((S=l.offset)==null?void 0:S[h])||0)-(P?m.crossAxis:0);x<j?x=j:x>E&&(x=E)}return{[v]:y,[h]:x}}}},jge=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=ma(e,t),l=await i.detectOverflow(t,s),u=Cr(n),c=uo(n),f=Er(n)==="y",{width:p,height:h}=r.floating;let v,y;u==="top"||u==="bottom"?(v=u,y=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=u,v=c==="end"?"top":"bottom");const x=h-l.top-l.bottom,g=p-l.left-l.right,m=Pu(h-l[v],x),b=Pu(p-l[y],g),S=t.middlewareData.shift,w=!S;let P=m,j=b;S!=null&&S.enabled.x&&(j=g),S!=null&&S.enabled.y&&(P=x),w&&!c&&(f?j=p-2*Qi(l.left,l.right):P=h-2*Qi(l.top,l.bottom)),await a({...t,availableWidth:j,availableHeight:P});const E=await i.getDimensions(o.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function xL(e){const t=dr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=it(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=qm(n)!==o||qm(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function AO(e){return Me(e)?e:e.contextElement}function jl(e){const t=AO(e);if(!it(t))return Ji(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=xL(t);let a=(o?qm(n.width):n.width)/r,s=(o?qm(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Ege=Ji(0);function bL(e){const t=ct(e);return!fO()||!t.visualViewport?Ege:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Age(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ct(e)}function Ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=AO(e);let a=Ji(1);t&&(r?Me(r)&&(a=jl(r)):a=jl(e));const s=Age(o,n,r)?bL(o):Ji(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o&&r){const p=ct(o),h=Me(r)?ct(r):r;let v=p,y=sw(v);for(;y&&h!==v;){const x=jl(y),g=y.getBoundingClientRect(),m=dr(y),b=g.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,S=g.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=b,u+=S,v=ct(y),y=sw(v)}}return ud({width:c,height:f,x:l,y:u})}function ky(e,t){const n=by(e).scrollLeft;return t?t.left+n:Ts(So(e)).left+n}function wL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ky(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Cge(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=So(r),s=t?xy(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Ji(1);const c=Ji(0),f=it(r);if((f||!o)&&((pn(r)!=="body"||kd(a))&&(l=by(r)),f)){const h=Ts(r);u=jl(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=a&&!f&&!o?wL(a,l):Ji(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}}function Tge(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _ge(e){const t=by(e),n=e.ownerDocument.body,r=Qi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+ky(e);const a=-t.scrollTop;return dr(n).direction==="rtl"&&(o+=Qi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:a}}const Rge=25;function kge(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=ct(e),o=So(e),a=i.visualViewport;let s=o.clientWidth,l=o.clientHeight,u=0,c=0;if(a){const p=!fO()||t==="fixed";r?p||(u=-a.offsetLeft,c=-a.offsetTop):(s=a.width,l=a.height,p&&(u=a.offsetLeft,c=a.offsetTop))}if(ky(o)<=0){const p=o.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(o.clientWidth-h.clientWidth-y),g=getComputedStyle(o).scrollbarGutter==="stable both-edges"?x/2:x;g<=Rge&&(s-=g)}return{width:s,height:l,x:u,y:c}}function Nge(e,t){const n=Ts(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=jl(e),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:a,height:s,x:l,y:u}}function c_(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=kge(e,n,t);else if(t==="document")r=_ge(So(e));else if(Me(t))r=Nge(t,n);else{const i=bL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ud(r)}function $ge(e,t){const n=t.get(e);if(n)return n;let r=sd(e,[],!1).filter(s=>Me(s)&&pn(s)!=="body"),i=null;const o=dr(e).position==="fixed";let a=o?pa(e):e;for(;Me(a)&&!aa(a);){const s=dr(a),l=cO(a),u=i?i.position:o?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?r=r.filter(f=>f!==a):i=s,a=pa(a)}return t.set(e,r),r}function Mge(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?xy(t)?[]:$ge(t,this._c):[].concat(n),r],s=c_(t,a[0],i);let l=s.top,u=s.right,c=s.bottom,f=s.left;for(let p=1;p<a.length;p++){const h=c_(t,a[p],i);l=Qi(h.top,l),u=Pu(h.right,u),c=Pu(h.bottom,c),f=Qi(h.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function Ige(e){const{width:t,height:n}=xL(e);return{width:t,height:n}}function Dge(e,t,n){const r=it(t),i=So(t),o=n==="fixed",a=Ts(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Ji(0);if((r||!o)&&((pn(t)!=="body"||kd(i))&&(s=by(t)),r)){const p=Ts(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!r&&i&&(l.x=ky(i));const u=i&&!r&&!o?wL(i,s):Ji(0),c=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:a.width,height:a.height}}function ix(e){return dr(e).position==="static"}function f_(e,t){if(!it(e)||dr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return So(e)===n&&(n=n.ownerDocument.body),n}function SL(e,t){const n=ct(e);if(xy(e))return n;if(!it(e)){let i=pa(e);for(;i&&!aa(i);){if(Me(i)&&!ix(i))return i;i=pa(i)}return n}let r=f_(e,t);for(;r&&ome(r)&&ix(r);)r=f_(r,t);return r&&aa(r)&&ix(r)&&!cO(r)?n:r||lme(e)||n}const Lge=async function(e){const t=this.getOffsetParent||SL,n=this.getDimensions,r=await n(e.floating);return{reference:Dge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fge(e){return dr(e).direction==="rtl"}const OL={convertOffsetParentRelativeRectToViewportRelativeRect:Cge,getDocumentElement:So,getClippingRect:Mge,getOffsetParent:SL,getElementRects:Lge,getClientRects:Tge,getDimensions:Ige,getScale:jl,isElement:Me,isRTL:Fge};function PL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bge(e,t,n){let r=null,i;const o=So(e);function a(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),a();const p=e.getBoundingClientRect(),{left:h,top:v,width:y,height:x}=p;if(c||t(),!y||!x)return;const g=Ep(v),m=Ep(o.clientWidth-(h+y)),b=Ep(o.clientHeight-(v+x)),S=Ep(h),P={rootMargin:-g+"px "+-m+"px "+-b+"px "+-S+"px",threshold:Qi(0,Pu(1,f))||1};let j=!0;function E(A){const C=A[0].intersectionRatio;if(!PL(p,e.getBoundingClientRect()))return s();if(C!==f){if(!j)return s();C?s(!1,C):i=setTimeout(()=>{s(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(E,{...P,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,P)}r.observe(e)}const l=ct(e),u=()=>s(n);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),a()}}function d_(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=AO(e),c=i||o?[...u?sd(u):[],...t?sd(t):[]]:[];c.forEach(g=>{i&&g.addEventListener("scroll",n),o&&g.addEventListener("resize",n)});const f=u&&s?Bge(u,n,o):null;let p=-1,h=null;a&&(h=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let v,y=l?Ts(e):null;l&&x();function x(){const g=Ts(e);y&&!PL(y,g)&&n(),y=g,v=requestAnimationFrame(x)}return n(),()=>{var g;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const Uge=Sge,zge=Oge,Hge=bge,Vge=jge,Wge=Pge,Kge=(e,t,n)=>{const r=new Map,i=n??{},o={...OL,...i.platform,_c:r};return xge(e,t,{...i,platform:o})};var qge=typeof document<"u",Gge=function(){},oh=qge?O.useLayoutEffect:Gge;function Xm(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(!Xm(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;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Xm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function p_(e,t){const n=jL(e);return Math.round(t*n)/n}function ox(e){const t=O.useRef(e);return oh(()=>{t.current=e}),t}function Xge(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=O.useState(r);Xm(p,r)||h(r);const[v,y]=O.useState(null),[x,g]=O.useState(null),m=O.useCallback(k=>{k!==P.current&&(P.current=k,y(k))},[]),b=O.useCallback(k=>{k!==j.current&&(j.current=k,g(k))},[]),S=o||v,w=a||x,P=O.useRef(null),j=O.useRef(null),E=O.useRef(c),A=l!=null,C=ox(l),T=ox(i),_=ox(u),R=O.useCallback(()=>{if(!P.current||!j.current)return;const k={placement:t,strategy:n,middleware:p};T.current&&(k.platform=T.current),Kge(P.current,j.current,k).then(L=>{const M={...L,isPositioned:_.current!==!1};$.current&&!Xm(E.current,M)&&(E.current=M,po.flushSync(()=>{f(M)}))})},[p,t,n,T,_]);oh(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const $=O.useRef(!1);oh(()=>($.current=!0,()=>{$.current=!1}),[]),oh(()=>{if(S&&(P.current=S),w&&(j.current=w),S&&w){if(C.current)return C.current(S,w,R);R()}},[S,w,R,C,A]);const N=O.useMemo(()=>({reference:P,floating:j,setReference:m,setFloating:b}),[m,b]),I=O.useMemo(()=>({reference:S,floating:w}),[S,w]),B=O.useMemo(()=>{const k={position:n,left:0,top:0};if(!I.floating)return k;const L=p_(I.floating,c.x),M=p_(I.floating,c.y);return s?{...k,transform:"translate("+L+"px, "+M+"px)",...jL(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:M}},[n,s,I.floating,c.x,c.y]);return O.useMemo(()=>({...c,update:R,refs:N,elements:I,floatingStyles:B}),[c,R,N,I,B])}const Yge=(e,t)=>{const n=Uge(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qge=(e,t)=>{const n=zge(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jge=(e,t)=>({fn:Wge(e).fn,options:[e,t]}),Zge=(e,t)=>{const n=Hge(e);return{name:n.name,fn:n.fn,options:[e,t]}},eye=(e,t)=>{const n=Vge(e);return{name:n.name,fn:n.fn,options:[e,t]}};var EL={exports:{}},AL={};/**
139
139
  * @license React
140
140
  * use-sync-external-store-shim.production.js
141
141
  *
@@ -151,9 +151,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
151
151
  *
152
152
  * This source code is licensed under the MIT license found in the
153
153
  * LICENSE file in the root directory of this source tree.
154
- */var $y=O,cye=Ny;function fye(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dye=typeof Object.is=="function"?Object.is:fye,pye=cye.useSyncExternalStore,hye=$y.useRef,mye=$y.useEffect,gye=$y.useMemo,yye=$y.useDebugValue;TL.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=hye(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=gye(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var v=a.value;if(i(v,h))return f=v}return f=h}if(v=f,dye(c,h))return v;var y=r(h);return i!==void 0&&i(v,y)?(c=h,v):(c=h,f=y)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var s=pye(e,o[0],o[1]);return mye(function(){a.hasValue=!0,a.value=s},[s]),yye(s),s};CL.exports=TL;var _L=CL.exports;const gw=[];let yw;function vye(){return yw}function xye(e){gw.push(e)}function CO(e){const t=(n,r)=>{const i=Fn(wye).current;let o;try{yw=i;for(const a of gw)a.before(i);o=e(n,r);for(const a of gw)a.after(i);i.didInitialize=!0}finally{yw=void 0}return o};return t.displayName=e.displayName||e.name,t}function bye(e){return O.forwardRef(CO(e))}function wye(){return{didInitialize:!1}}const Sye=oO(19),Oye=Sye?jye:Eye;function RL(e,t,n,r,i){return Oye(e,t,n,r,i)}function Pye(e,t,n,r,i){const o=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return Ny.useSyncExternalStore(e.subscribe,o,o)}xye({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){const 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=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),Ny.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function jye(e,t,n,r,i){const o=vye();if(!o)return Pye(e,t,n,r,i);const a=o.syncIndex;o.syncIndex+=1;let s;return o.didInitialize?(s=o.syncHooks[a],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(o.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)},o.syncHooks.push(s)),s.value}function Eye(e,t,n,r,i){return _L.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}class Aye{constructor(t){Ze(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ze(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return RL(this,t,n,r,i)}}class My extends Aye{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){O.useDebugValue(t);const r=this;fe(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;fe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);fe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){O.useDebugValue(t);const r=this,i=n!==void 0;fe(()=>{i&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,i])}select(t,n,r,i){const o=this.selectors[t];return o(this.state,n,r,i)}useState(t,n,r,i){return O.useDebugValue(t),RL(this,this.selectors[t],n,r,i)}useContextCallback(t,n){O.useDebugValue(t);const r=de(n??St);this.context[t]=r}useStateSetter(t){const n=O.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(o=>{const a=r(o);if(!Object.is(i,a)){const s=i;i=a,n(a,s,this)}})}}const Cye={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};class TO extends My{constructor(n){const{syncOnly:r,nested:i,onOpenChange:o,triggerElements:a,...s}=n;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:sge(),nested:i,triggerElements:a},Cye);Ze(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&Eme(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});Ze(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const i={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",i)});Ze(this,"setOpen",(n,r)=>{var i,o,a,s;if(this.syncOnly){(o=(i=this.context).onOpenChange)==null||o.call(i,n,r);return}this.dispatchOpenChange(n,r),(s=(a=this.context).onOpenChange)==null||s.call(a,n,r)});this.syncOnly=r}}function Tye(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:o,onOpenChange:a}=e,s=t.useState("open"),l=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),c=t.context.triggerElements,f=a,p=O.useRef(null);r===void 0&&p.current===null&&(p.current=new TO({open:s,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:c,onOpenChange:f,floatingId:i,syncOnly:!0,nested:o}));const h=r??p.current;return t.useSyncedValue("floatingId",i),fe(()=>{const v={open:s,floatingId:i,referenceElement:l,floatingElement:u};Me(l)&&(v.domReferenceElement=l),h.state.positionReference===h.state.referenceElement&&(v.positionReference=l),h.update(v)},[s,i,l,u,h]),h.context.onOpenChange=f,h.context.nested=o,h}function kL(e,t=!1,n=!1,r=!1){const[i,o]=O.useState(e&&t?"idle":void 0),[a,s]=O.useState(e&&!r);return e&&!a&&(s(!0),o("starting")),!e&&a&&i!=="ending"&&!n&&o("ending"),!e&&!a&&i==="ending"&&o(void 0),fe(()=>{if(!e&&a&&i!=="ending"&&n){const l=fi.request(()=>{o("ending")});return()=>{fi.cancel(l)}}},[e,a,i,n]),fe(()=>{if(!e||t)return;const l=fi.request(()=>{o(void 0)});return()=>{fi.cancel(l)}},[t,e]),fe(()=>{if(!e||!t)return;e&&a&&i!=="idle"&&o("starting");const l=fi.request(()=>{o("idle")});return()=>{fi.cancel(l)}},[t,e,a,i]),{mounted:a,setMounted:s,transitionStatus:i}}let Cp=null;function _ye(e){if(!Cp){const t=[];Cp=t,queueMicrotask(()=>{Cp=null,po.flushSync(()=>{for(const n of t)n()})})}Cp.push(e)}function Rye(e,t=!1,n=!1){const r=Ou();return de((i,o=null)=>{r.cancel();const a=ki(e);if(a==null)return;const s=a,l=()=>{if(!n){po.flushSync(i);return}_ye(()=>{o!=null&&o.aborted||i()})};if(typeof s.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function u(){Promise.all(s.getAnimations().map(c=>c.finished)).then(()=>{o!=null&&o.aborted||l()},()=>{if(o!=null&&o.aborted)return;if(s.getAnimations().some(f=>f.pending||f.playState!=="finished")){u();return}l()})}if(t){const c=FD;if(!s.hasAttribute(c)){r.request(u);return}const f=new MutationObserver(()=>{s.hasAttribute(c)||(f.disconnect(),u())});f.observe(s,{attributes:!0,attributeFilter:[c]}),o==null||o.addEventListener("abort",()=>f.disconnect(),{once:!0});return}r.request(u)})}function $d(e){const{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:o}=e,a=de(o),s=Rye(r,n,i);O.useEffect(()=>{if(!t)return;const l=new AbortController;return s(a,l.signal),()=>{l.abort()}},[t,n,a,s])}const _O={tabIndex:-1,[uw]:""};function kye(e){return t=>t==="touch"?e.current:!0}function NL(e,t=!1){const n=Sy(),r=Ry()!=null,i=Fn(()=>e(n,r)).current;return Tye({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function $L({handle:e,store:t}){return fe(()=>e.attachStore(t),[e,t]),null}function h_(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function Nye(e,t){const n=O.useRef(null);return de(r=>{const i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;const o=i.store;o.context.triggerElements.getById(i.id)===i.element&&(o.context.triggerElements.delete(i.id),h_(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),h_(t))})}function ML(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);const o=(n==null?void 0:n.id)??null;let a=e.activeTriggerId,s=e.activeTriggerElement;return(o||t)&&(a=o,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:a,activeTriggerElement:s}}function $ye(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Mye(e,t,n,r={}){var c,f,p;const i=n.reason,o=i===Wn,a=t&&i===nh,s=!t&&(i===Nd||i===gO),l=$ye(n);if((f=(c=e.context).onOpenChange)==null||f.call(c,t,n),n.isCanceled)return;(p=r.onBeforeDispatch)==null||p.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const h=ML(e.state,t,n.trigger,l()),v={...r.extraState,...h};a?v.instantType="focus":s?v.instantType="dismiss":o&&(v.instantType=void 0),e.update(v)};o?po.flushSync(u):u()}function Iye(e,t,n,r){const i=n.useState("isMountedByTrigger",e),o=Nye(e,n),a=de(l=>{const u=n.select("open"),c=n.select("activeTriggerId");if(c===e){const f={activeTriggerElement:l,...u?r:null};n.update(f);return}if(c==null&&u){const f={activeTriggerId:e??null,activeTriggerElement:l,...r};n.update(f)}}),s=de(l=>{o(l),l&&a(l)});return fe(()=>(s(t.current),()=>s(null)),[s,t,n,e]),fe(()=>{if(i){const l={activeTriggerElement:t.current,...r};n.update(l)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function IL(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),i=e.useState("open"),o=e.useState("triggerCount"),a=e.useState("activeTriggerId"),s=e.useState("activeTriggerElement");fe(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const l=e.context.triggerElements.size,u={};e.state.triggerCount!==l&&(u.triggerCount=l);const c=e.select("activeTriggerId");let f=null;if(c){const p=e.context.triggerElements.getById(c);if(p)r.current=c,p!==e.state.activeTriggerElement&&(u.activeTriggerElement=p);else{for(const[h,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){u.activeTriggerId=h,u.activeTriggerElement=v,r.current=h;break}u.activeTriggerId===void 0&&(r.current===c?f=c:r.current=null)}}else r.current=null;if(!f&&!c&&l===1){const p=e.context.triggerElements.entries().next();if(!p.done){const[h,v]=p.value;u.activeTriggerId=h,u.activeTriggerElement=v,r.current=h}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const p=$e(ha);e.setOpen(!1,p),p.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,o,a,s,n])}function DL(e,t,n,r){const{mounted:i,setMounted:o,transitionStatus:a}=kL(e,!1,!1,r),s=t.useState("preventUnmountingOnClose"),l=e?!1:s;t.useSyncedValues({mounted:i,transitionStatus:a,preventUnmountingOnClose:l});const u=de(()=>{var c,f;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),(f=(c=t.context).onOpenChangeComplete)==null||f.call(c,!1)});return $d({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:a}}function LL(e,t){e.useSyncedValues(t),fe(()=>()=>{e.update({activeTriggerProps:$t,inactiveTriggerProps:$t,popupProps:$t})},[e])}function Dye(e,t){fe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),fe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class RO{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function FL(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new TO({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,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:$t,inactiveTriggerProps:$t,popupProps:$t}}const nf=e=>e.triggerIdProp??e.activeTriggerId,kO=e=>e.openProp??e.open,m_=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function BL(e,t){return t!==void 0&&kO(e)&&nf(e)===t}function Lye(e,t){return BL(e,t)?!0:t!==void 0&&kO(e)&&nf(e)==null&&e.triggerCount===1}const UL={open:kO,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:nf,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:m_,isTriggerActive:(e,t)=>t!==void 0&&nf(e)===t,isOpenedByTrigger:(e,t)=>BL(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nf(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Lye(e,t)?m_(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Fye(e){const t=O.useCallback(r=>e===void 0?St:e.subscribeStore(r),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return Ny.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function Bye(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Sy(),o=Ry()!=null,a=Fn(()=>new TO({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new RO,floatingId:i,syncOnly:!1,nested:o})).current;return fe(()=>{const s={open:t,floatingId:i};r.reference!==void 0&&(s.referenceElement=r.reference,s.domReferenceElement=Me(r.reference)?r.reference:null),r.floating!==void 0&&(s.floatingElement=r.floating),a.update(s)},[t,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=o,a}function Uye(e){return zye(e,e.rootContext)}function zye(e,t){const{nodeId:n,externalTree:r}=e,i=t.useState("referenceElement"),o=t.useState("floatingElement"),a=t.useState("domReferenceElement"),s=t.useState("open"),l=t.useState("floatingId"),[u,c]=O.useState(null),[f,p]=O.useState(void 0),[h,v]=O.useState(void 0),y=O.useRef(null),x=Qu(r),g=O.useMemo(()=>({reference:i,floating:o,domReference:a}),[i,o,a]),m=Xge({...e,elements:{...g,...u&&{reference:u}}}),b=Me(f)?f:null,S=h===void 0?t.state.floatingElement:h;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?a:b),t.useSyncedValue("floatingElement",S);const w=O.useCallback(T=>{const _=Me(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;c(_),m.refs.setReference(_)},[m.refs]),P=O.useCallback(T=>{(Me(T)||T===null)&&(y.current=T,p(T)),(Me(m.refs.reference.current)||m.refs.reference.current===null||T!==null&&!Me(T))&&m.refs.setReference(T)},[m.refs,p]),j=O.useCallback(T=>{v(T),m.refs.setFloating(T)},[m.refs]),E=O.useMemo(()=>({...m.refs,setReference:P,setFloating:j,setPositionReference:w,domReference:y}),[m.refs,P,j,w]),A=O.useMemo(()=>({...m.elements,domReference:a}),[m.elements,a]),C=O.useMemo(()=>({...m,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:E,elements:A,nodeId:n,rootStore:t}),[m,E,A,n,t,s,l]);return fe(()=>{a&&(y.current=a)},[a]),fe(()=>{t.context.dataRef.current.floatingContext=C;const T=x==null?void 0:x.nodesRef.current.find(_=>_.id===n);T&&(T.context=C)}),O.useMemo(()=>({...m,context:C,refs:E,elements:A,rootStore:t}),[m,E,A,C,t])}const sx=qD&&Oo;function Hye(e,t={}){const{enabled:n=!0,delay:r}=t,i="rootStore"in e?e.rootStore:e,{events:o,dataRef:a}=i.context,s=O.useRef(!1),l=O.useRef(null),u=O.useRef(!0),c=cr();O.useEffect(()=>{const p=i.select("domReferenceElement");if(!n)return;const h=ct(p);function v(){const g=i.select("domReferenceElement");!i.select("open")&&it(g)&&g===Mn(He(g))&&(s.current=!0,l.current=g)}function y(){u.current=!0}function x(){u.current=!1}return wi(Ne(h,"blur",v),sx&&Ne(h,"keydown",y,!0),sx&&Ne(h,"pointerdown",x,!0))},[i,n]),O.useEffect(()=>{if(!n)return;function p(h){if(h.reason===Nd||h.reason===gO){const v=i.select("domReferenceElement");Me(v)&&(l.current=v,s.current=!0)}}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,n,i]);const f=O.useMemo(()=>{function p(){s.current=!1,l.current=null}return{onMouseLeave(){p()},onFocus(h){const v=h.currentTarget;if(s.current){if(l.current===v)return;p()}const y=cn(h.nativeEvent);if(Me(y)){if(sx&&!h.relatedTarget){if(!u.current&&!Cy(y))return}else if(!Tme(y))return}const x=Vm(h.relatedTarget,i.context.triggerElements),{nativeEvent:g,currentTarget:m}=h,b=typeof r=="function"?r():r;if(i.select("open")&&x||b===0||b===void 0){i.setOpen(!0,$e(nh,g,m));return}c.start(b,()=>{s.current||i.setOpen(!0,$e(nh,g,m))})},onBlur(h){p();const v=h.relatedTarget,y=h.nativeEvent,x=Me(v)&&v.hasAttribute(cd("focus-guard"))&&v.getAttribute("data-type")==="outside";c.start(0,()=>{var S;const g=i.select("domReferenceElement"),m=Mn(He(g));!v&&m===g||xe((S=a.current.floatingContext)==null?void 0:S.refs.floating.current,m)||xe(g,m)||x||Vm(v??m,i.context.triggerElements)||i.setOpen(!1,$e(nh,y))})}}},[a,r,i,c]);return O.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}class NO{constructor(){Ze(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Ze(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Jr,this.restTimeout=new Jr,this.handleCloseOptions=void 0}static create(){return new NO}}const Ym=new WeakMap;function Qm(e){var n,r,i;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ym.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty("pointer-events"),Ym.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function zL(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t,o=Ym.get(n);o&&o!==e&&Qm(o),Qm(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ym.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function $O(e){const t=e.context.dataRef.current,n=Fn(()=>t.hoverInteractionState??NO.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),yO(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Vye(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,o="rootStore"in e?e.rootStore:e,a=o.useState("open"),s=o.useState("floatingElement"),l=o.useState("domReferenceElement"),{dataRef:u}=o.context,c=Qu(),f=Ry(),p=$O(o),h=cr(),v=de(()=>{var g;return YD((g=u.current.openEvent)==null?void 0:g.type,p.interactedInside)}),y=de(()=>{var g;return Rme((g=u.current.openEvent)==null?void 0:g.type)}),x=de(()=>{Qm(p)});fe(()=>{a||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,x())},[a,p,x]),O.useEffect(()=>x,[x]),fe(()=>{var g,m,b,S,w;if(n&&a&&(g=p.handleCloseOptions)!=null&&g.blockPointerEvents&&y()&&Me(l)&&s){const P=l,j=s,E=He(s),A=(b=(m=c==null?void 0:c.nodesRef.current.find(R=>R.id===f))==null?void 0:m.context)==null?void 0:b.elements.floating;A&&(A.style.pointerEvents="");const C=p.pointerEventsScopeElement!==j?p.pointerEventsScopeElement:null,T=A!==j?A:null,_=((w=(S=p.handleCloseOptions)==null?void 0:S.getScope)==null?void 0:w.call(S))??C??T??P.closest("[data-rootownerid]")??E.body;return zL(p,{scopeElement:_,referenceElement:P,floatingElement:j}),()=>{x()}}},[n,a,l,s,p,y,c,f,x]),O.useEffect(()=>{if(!n)return;function g(){return!!(c&&f&&ga(c.nodesRef.current,f).length>0)}function m(E){const A=Cs(r,"close",p.pointerType),C=()=>{o.setOpen(!1,$e(Wn,E)),c==null||c.events.emit("floating.closed",E)};A?p.openChangeTimeout.start(A,C):(p.openChangeTimeout.clear(),C())}function b(E){const A=cn(E);if(!Cme(A)){p.interactedInside=!1;return}p.interactedInside=(A==null?void 0:A.closest("[aria-haspopup]"))!=null}function S(){p.openChangeTimeout.clear(),h.clear(),c==null||c.events.off("floating.closed",P),x()}function w(E){var _;if(g()&&c){c.events.on("floating.closed",P);return}if(Vm(E.relatedTarget,o.context.triggerElements))return;const A=((_=u.current.floatingContext)==null?void 0:_.nodeId)??i,C=E.relatedTarget;if(!(c&&A&&Me(C)&&ga(c.nodesRef.current,A,!1).some(R=>{var $;return xe(($=R.context)==null?void 0:$.elements.floating,C)}))){if(p.handler){p.handler(E);return}x(),y()&&!v()&&m(E)}}function P(E){!c||!f||g()||h.start(0,()=>{c.events.off("floating.closed",P),o.setOpen(!1,$e(Wn,E)),c.events.emit("floating.closed",E)})}const j=s;return wi(j&&Ne(j,"mouseenter",S),j&&Ne(j,"mouseleave",w),j&&Ne(j,"pointerdown",b,!0),()=>{c==null||c.events.off("floating.closed",P)})},[n,s,o,u,r,i,y,v,x,p,c,f,h])}const Wye={current:null};function Kye(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:o=!1,restMs:a=0,move:s=!0,triggerElementRef:l=Wye,externalTree:u,isActiveTrigger:c=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:h,guardStaleOpen:v=!1}=t,y="rootStore"in e?e.rootStore:e,{dataRef:x,events:g}=y.context,m=Qu(u),b=$O(y),S=O.useRef(!1),w=Rt(i),P=Rt(r),j=Rt(a),E=Rt(n),A=Rt(h),C=Rt(p),T=de(()=>{var I;return YD((I=x.current.openEvent)==null?void 0:I.type,b.interactedInside)}),_=de(()=>{var I;return((I=A.current)==null?void 0:I.call(A))!==!1}),R=de((I,B,k)=>{const L=y.context.triggerElements;if(L.hasElement(B))return!I||!xe(I,B);if(!Me(k))return!1;const M=k;return L.hasMatchingElement(z=>xe(z,M))&&(!I||!xe(I,M))}),$=de(()=>{if(!b.handler)return;He(y.select("domReferenceElement")).removeEventListener("mousemove",b.handler),b.handler=void 0}),N=de(()=>{Qm(b)});return c&&(b.handleCloseOptions=i==null?void 0:i.__options),O.useEffect(()=>$,[$]),O.useEffect(()=>{if(!n)return;function I(B){B.open?S.current=!1:(S.current=B.reason===Wn,$(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return g.on("openchange",I),()=>{g.off("openchange",I)}},[n,g,b,$]),O.useEffect(()=>{if(!n)return;function I(U,V=!0){const W=Cs(P.current,"close",b.pointerType);W?b.openChangeTimeout.start(W,()=>{y.setOpen(!1,$e(Wn,U)),m==null||m.events.emit("floating.closed",U)}):V&&(b.openChangeTimeout.clear(),y.setOpen(!1,$e(Wn,U)),m==null||m.events.emit("floating.closed",U))}const B=l.current??(c?y.select("domReferenceElement"):null);if(!Me(B))return;function k(U){var ae;if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,o&&!sa(b.pointerType))return;const V=GT(j.current),W=Cs(P.current,"open",b.pointerType),Q=cn(U),G=U.currentTarget??null,le=y.select("domReferenceElement");let X=G;if(Me(Q)&&!y.context.triggerElements.hasElement(Q)){for(const be of y.context.triggerElements.elements())if(xe(be,Q)){X=be;break}}Me(G)&&Me(le)&&!y.context.triggerElements.hasElement(G)&&xe(G,le)&&(X=le);const K=X==null?!1:R(le,X,Q),ee=y.select("open"),ie=((ae=C.current)==null?void 0:ae.call(C))??y.select("transitionStatus")==="ending",H=!ee&&ie&&S.current,Z=!K&&Me(X)&&Me(le)&&xe(le,X)&&H,J=V>0&&!W,se=K&&(ee||H)||Z,we=!ee||K;if(se){_()&&y.setOpen(!0,$e(Wn,U,X));return}J||(W?b.openChangeTimeout.start(W,()=>{we&&_()&&y.setOpen(!0,$e(Wn,U,X))}):we&&_()&&y.setOpen(!0,$e(Wn,U,X)))}function L(U){if(T()){N();return}$();const V=y.select("domReferenceElement"),W=He(V);b.restTimeout.clear(),b.restTimeoutPending=!1;const Q=x.current.floatingContext??(f==null?void 0:f());if(Vm(U.relatedTarget,y.context.triggerElements))return;if(w.current&&Q){y.select("open")||b.openChangeTimeout.clear();const le=l.current;b.handler=w.current({...Q,tree:m,x:U.clientX,y:U.clientY,onClose(){N(),$(),E.current&&!T()&&le===y.select("domReferenceElement")&&I(U,!0)}}),W.addEventListener("mousemove",b.handler),b.handler(U);return}(b.pointerType==="touch"?!xe(y.select("floatingElement"),U.relatedTarget):!0)&&I(U)}function M(U){xe(B,U.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}const z=v?Ne(B,"mouseout",M):void 0;return s?wi(Ne(B,"mousemove",k,{once:!0}),Ne(B,"mouseenter",k),Ne(B,"mouseleave",L),z):wi(Ne(B,"mouseenter",k),Ne(B,"mouseleave",L),z)},[$,N,x,P,y,n,w,b,c,R,T,o,s,j,l,m,E,f,C,_,v]),O.useMemo(()=>{if(!n)return;function I(B){b.pointerType=B.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(B){var Q,G,le;const{nativeEvent:k}=B,L=B.currentTarget,M=y.select("domReferenceElement"),z=y.select("open"),U=R(M,L,B.target);if(o&&!sa(b.pointerType))return;if(z&&U&&((Q=b.handleCloseOptions)!=null&&Q.blockPointerEvents)){const X=y.select("floatingElement");if(X){const K=((le=(G=b.handleCloseOptions)==null?void 0:G.getScope)==null?void 0:le.call(G))??L.ownerDocument.body;zL(b,{scopeElement:K,referenceElement:L,floatingElement:X})}}const V=GT(j.current);if(z&&!U||V===0||!U&&b.restTimeoutPending&&B.movementX**2+B.movementY**2<2)return;b.restTimeout.clear();function W(){if(b.restTimeoutPending=!1,T())return;const X=y.select("open");!b.blockMouseMove&&(!X||U)&&_()&&y.setOpen(!0,$e(Wn,k,L))}b.pointerType==="touch"?po.flushSync(()=>{W()}):U&&z?W():(b.restTimeoutPending=!0,b.restTimeout.start(V,W))}}},[n,b,T,R,o,y,j,_])}const qye="Escape";function g_(e){return Oo&&e.movementX===0&&e.movementY===0}function Iy(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Tp(e,t){return Iy(t,e===XD||e===bO,e===Ey||e===Ay)}function lx(e,t,n){return Iy(t,e===bO,n?e===Ey:e===Ay)||e==="Enter"||e===" "||e===""}function Gye(e,t,n){return Iy(t,n?e===Ey:e===Ay,e===bO)}function Xye(e,t,n,r){const i=n?e===Ay:e===Ey,o=e===XD;return t==="both"||t==="horizontal"&&r?e===qye:Iy(t,i,o)}function Yye(e,t){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:o=!0,selectedIndex:a=null,allowEscape:s=!1,loopFocus:l=!1,nested:u=!1,rtl:c=!1,virtual:f=!1,focusItemOnOpen:p="auto",focusItemOnHover:h=!0,openOnArrowKeyDown:v=!0,disabledIndices:y=void 0,orientation:x="vertical",parentOrientation:g,id:m,resetOnPointerLeave:b=!0,externalTree:S,grid:w}=t,P=w!=null,j="rootStore"in e?e.rootStore:e,E=j.useState("open"),A=j.useState("floatingElement"),C=j.useState("domReferenceElement"),T=j.context.dataRef,_=Wm(A),R=fw(C),$=Rt(_),N=Ry(),I=Qu(S),B=O.useRef(p),k=O.useRef(a??-1),L=O.useRef(null),M=O.useRef(!0),z=de(te=>{i(k.current===-1?null:k.current,te)}),U=O.useRef(!!A),V=O.useRef(E),W=O.useRef(!1),Q=O.useRef(!1),G=O.useRef(null),le=Rt(y),X=Rt(E),K=Rt(a),ee=Rt(b),ie=Ou(),H=Ou(),Z=de(()=>{function te(ge){f?I==null||I.events.emit("virtualfocus",ge):G.current=ih(ge,{sync:W.current,preventScroll:!0})}const pe=n.current[k.current],oe=Q.current;pe&&te(pe),(W.current?ge=>ge():ge=>ie.request(ge))(()=>{var Fe;const ge=n.current[k.current]||pe;if(!ge)return;pe||te(ge),ce&&(oe||!M.current)&&((Fe=ge.scrollIntoView)==null||Fe.call(ge,{block:"nearest",inline:"nearest"}))})});fe(()=>{T.current.orientation=x},[T,x]),fe(()=>{o&&(E&&A?(k.current=a??-1,B.current&&a!=null&&(Q.current=!0,z())):U.current&&(k.current=-1,z()))},[o,E,A,a,z]),fe(()=>{if(o){if(!E){W.current=!1;return}if(A)if(r==null){if(W.current=!1,K.current!=null)return;if(U.current&&(k.current=-1,Z()),(!V.current||!U.current)&&B.current&&(L.current!=null||B.current===!0&&L.current==null)){let te=0;const pe=()=>{n.current[0]==null?(te<2&&(te?Y=>H.request(Y):queueMicrotask)(pe),te+=1):(k.current=L.current==null||lx(L.current,x,c)||u?rh(n):pw(n),L.current=null,z())};pe()}}else ef(n.current,r)||(k.current=r,Z(),Q.current=!1)}},[o,E,A,r,K,u,n,x,c,z,Z,H]),fe(()=>{var ge,Ce;if(!o||A||!I||f||!U.current)return;const te=I.nodesRef.current,pe=(Ce=(ge=te.find(Fe=>Fe.id===N))==null?void 0:ge.context)==null?void 0:Ce.elements.floating,oe=Mn(He(C??pe??null)),Y=te.some(Fe=>Fe.context&&xe(Fe.context.elements.floating,oe));pe&&!Y&&M.current&&pe.focus({preventScroll:!0})},[o,A,C,I,N,f]),fe(()=>{V.current=E,U.current=!!A}),fe(()=>{E||(L.current=null,B.current=p)},[E,p]);const J=r!=null,se=de(te=>{if(!X.current)return;const pe=n.current.indexOf(te.currentTarget);pe!==-1&&(k.current!==pe||r!==pe)&&(k.current=pe,z(te))}),we=de(()=>{var te,pe,oe;return g??((oe=(pe=(te=I==null?void 0:I.nodesRef.current.find(Y=>Y.id===N))==null?void 0:te.context)==null?void 0:pe.dataRef)==null?void 0:oe.current.orientation)}),ae=de(()=>rh(n,le.current)),be=de(te=>{if(M.current=!1,W.current=!0,te.which===229||!X.current&&te.currentTarget===$.current)return;if(u&&Xye(te.key,x,c,P)){Tp(te.key,we())||ai(te),j.setOpen(!1,$e(zT,te.nativeEvent)),it(C)&&(f?I==null||I.events.emit("virtualfocus",C):C.focus());return}const pe=k.current,oe=rh(n,y),Y=pw(n,y);if(R||(te.key==="Home"&&(ai(te),k.current=oe,z(te)),te.key==="End"&&(ai(te),k.current=Y,z(te))),w!=null){const ge=w(te,k.current,n,x,l,c,y,oe,Y);if(ge!=null&&(k.current=ge,z(te)),x==="both")return}if(Tp(te.key,x)){if(ai(te),E&&!f&&Mn(te.currentTarget.ownerDocument)===te.currentTarget){k.current=lx(te.key,x,c)?oe:Y,z(te);return}lx(te.key,x,c)?l?pe>=Y?s&&pe!==n.current.length?k.current=-1:(W.current=!1,k.current=oe):k.current=Ki(n.current,{startingIndex:pe,disabledIndices:y}):k.current=Math.min(Y,Ki(n.current,{startingIndex:pe,disabledIndices:y})):l?pe<=oe?s&&pe!==-1?k.current=n.current.length:(W.current=!1,k.current=Y):k.current=Ki(n.current,{startingIndex:pe,decrement:!0,disabledIndices:y}):k.current=Math.max(oe,Ki(n.current,{startingIndex:pe,decrement:!0,disabledIndices:y})),ef(n.current,k.current)&&(k.current=-1),z(te)}}),ce=O.useMemo(()=>({onFocus(pe){W.current=!0,se(pe)},onClick:({currentTarget:pe})=>pe.focus({preventScroll:!0}),onMouseMove(pe){g_(pe)||(W.current=!0,Q.current=!1,h&&se(pe))},onPointerLeave(pe){var Y;if(!X.current||!M.current||pe.pointerType==="touch")return;W.current=!0;const oe=pe.relatedTarget;if(!(!h||n.current.includes(oe))&&ee.current&&((Y=G.current)==null||Y.call(G),G.current=null,k.current=-1,z(pe),!f)){const ge=$.current,Ce=Mn(He(ge));ge&&xe(ge,Ce)&&ge.focus({preventScroll:!0})}}}),[se,X,$,h,n,z,ee,f]),Ee=O.useMemo(()=>f&&E&&J&&{"aria-activedescendant":`${m}-${r}`},[f,E,J,m,r]),je=O.useMemo(()=>({...R?{}:Ee,onKeyDown(te){if(te.key==="Tab"&&te.shiftKey&&E&&!f){const pe=cn(te.nativeEvent);if(pe&&!xe($.current,pe))return;ai(te),j.setOpen(!1,$e(wy,te.nativeEvent)),it(C)&&C.focus();return}be(te)},onPointerMove(te){g_(te)||(M.current=!0)}}),[Ee,be,$,R,j,E,f,C]),Se=O.useMemo(()=>{function te(Y){j.setOpen(!0,$e(zT,Y.nativeEvent,Y.currentTarget))}function pe(Y){p==="auto"&&jy(Y.nativeEvent)&&(B.current=!f)}function oe(Y){B.current=p,p==="auto"&&xO(Y.nativeEvent)&&(B.current=!0)}return{onKeyDown(Y){const ge=j.select("open");M.current=!1;const Ce=Y.key.startsWith("Arrow"),Fe=Gye(Y.key,we(),c),nn=Tp(Y.key,x),Tn=(u?Fe:nn)||Y.key==="Enter"||Y.key.trim()==="";if(f&&ge)return be(Y);if(!(!ge&&!v&&Ce)){if(Tn){const xt=Tp(Y.key,we());L.current=u&&xt?null:Y.key}if(u){Fe&&(ai(Y),ge?(k.current=ae(),z(Y)):te(Y));return}nn&&(K.current!=null&&(k.current=K.current),ai(Y),!ge&&v?te(Y):be(Y),ge&&z(Y))}},onFocus(Y){j.select("open")&&!f&&(k.current=-1,z(Y))},onPointerDown:oe,onPointerEnter:oe,onMouseDown:pe,onClick:pe}},[be,p,ae,u,z,j,v,x,we,c,K,f]),ze=O.useMemo(()=>({...Ee,...Se}),[Ee,Se]);return O.useMemo(()=>o?{reference:ze,floating:je,item:ce,trigger:Se}:{},[o,ze,je,Se,ce])}function Qye(e,t){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:o,disabledIndices:a,onTyping:s,enabled:l=!0,resetMs:u=750,selectedIndex:c=null}=t,f="rootStore"in e?e.rootStore:e,p=f.useState("open"),h=cr(),v=O.useRef(""),y=O.useRef(c??i??-1),x=O.useRef(null),g=de(S=>{function w($){return r==null?void 0:r.current[$]}function P($){const N=w($);return N&&!Ty(N)||N!=null&&N.matches(":disabled")?!1:a==null||!Pl(da,$,a)}function j($,N,I=0){if($.length===0)return-1;const B=(I%$.length+$.length)%$.length,k=N.toLowerCase();for(let L=0;L<$.length;L+=1){const M=(B+L)%$.length,z=$[M];if(!(!(z!=null&&z.toLowerCase().startsWith(k))||!P(M)))return M}return-1}const E=n.current;if(v.current.length>0&&S.key===" "&&(ai(S),s==null||s(!0)),v.current.length>0&&v.current[0]!==" "&&j(E,v.current)===-1&&S.key!==" "&&(s==null||s(!1)),E==null||S.key.length!==1||S.ctrlKey||S.metaKey||S.altKey)return;p&&S.key!==" "&&(ai(S),s==null||s(!0));const A=v.current==="";A&&(y.current=c??i??-1),E.every(($,N)=>{var I,B;return $&&P(N)?((I=$[0])==null?void 0:I.toLowerCase())!==((B=$[1])==null?void 0:B.toLowerCase()):!0})&&v.current===S.key&&(v.current="",y.current=x.current),v.current+=S.key,h.start(u,()=>{v.current="",y.current=x.current,s==null||s(!1)});const _=((A?c??i??-1:y.current)??0)+1,R=j(E,v.current,_);R!==-1?(o==null||o(R),x.current=R):S.key!==" "&&(v.current="",s==null||s(!1))}),m=de(S=>{const w=S.relatedTarget,P=f.select("domReferenceElement"),j=f.select("floatingElement");xe(P,w)||xe(j,w)||(h.clear(),v.current="",y.current=x.current,s==null||s(!1))});fe(()=>{!p&&c!==null||(h.clear(),x.current=null,v.current!==""&&(v.current=""))},[p,c,h]);const b=O.useMemo(()=>({onKeyDown:g,onBlur:m}),[g,m]);return O.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}const y_=.1,Jye=y_*y_,et=.5;function _p(e,t,n,r,i,o){return r>=t!=o>=t&&e<=(i-n)*(t-r)/(o-r)+n}function Rp(e,t,n,r,i,o,a,s,l,u){let c=!1;return _p(e,t,n,r,i,o)&&(c=!c),_p(e,t,i,o,a,s)&&(c=!c),_p(e,t,a,s,l,u)&&(c=!c),_p(e,t,l,u,n,r)&&(c=!c),c}function Zye(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function kp(e,t,n,r,i,o){const a=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,o),u=Math.max(r,o);return e>=a&&e<=s&&t>=l&&t<=u}function eve(e={}){const{blockPointerEvents:t=!1}=e,n=new Jr,r=({x:i,y:o,placement:a,elements:s,onClose:l,nodeId:u,tree:c})=>{const f=a==null?void 0:a.split("-")[0];let p=!1,h=null,v=null,y=typeof performance<"u"?performance.now():0;function x(m,b){const S=performance.now(),w=S-y;if(h===null||v===null||w===0)return h=m,v=b,y=S,!1;const P=m-h,j=b-v,E=P*P+j*j,A=w*w*Jye;return h=m,v=b,y=S,E<A}function g(){n.clear(),l()}return function(b){n.clear();const S=s.domReference,w=s.floating;if(!S||!w||f==null||i==null||o==null)return;const{clientX:P,clientY:j}=b,E=cn(b),A=b.type==="mouseleave",C=xe(w,E),T=xe(S,E);if(C&&(p=!0,!A))return;if(T&&(p=!1,!A)){p=!0;return}if(A&&Me(b.relatedTarget)&&xe(w,b.relatedTarget))return;function _(){return!!(c&&ga(c.nodesRef.current,u).length>0)}function R(){_()||g()}if(_())return;const $=S.getBoundingClientRect(),N=w.getBoundingClientRect(),I=i>N.right-N.width/2,B=o>N.bottom-N.height/2,k=N.width>$.width,L=N.height>$.height,M=(k?$:N).left,z=(k?$:N).right,U=(L?$:N).top,V=(L?$:N).bottom;if(f==="top"&&o>=$.bottom-1||f==="bottom"&&o<=$.top+1||f==="left"&&i>=$.right-1||f==="right"&&i<=$.left+1){R();return}let W=!1;switch(f){case"top":W=kp(P,j,M,$.top+1,z,N.bottom-1);break;case"bottom":W=kp(P,j,M,N.top+1,z,$.bottom-1);break;case"left":W=kp(P,j,N.right-1,V,$.left+1,U);break;case"right":W=kp(P,j,$.right-1,V,N.left+1,U);break}if(W)return;if(p&&!Zye(P,j,$)){R();return}if(!A&&x(P,j)){R();return}let Q=!1;switch(f){case"top":{const G=k?et/2:et*4,le=k||I?i+G:i-G,X=k?i-G:I?i+G:i-G,K=o+et+1,ee=I||k?N.bottom-et:N.top,ie=I?k?N.bottom-et:N.top:N.bottom-et;Q=Rp(P,j,le,K,X,K,N.left,ee,N.right,ie);break}case"bottom":{const G=k?et/2:et*4,le=k||I?i+G:i-G,X=k?i-G:I?i+G:i-G,K=o-et,ee=I||k?N.top+et:N.bottom,ie=I?k?N.top+et:N.bottom:N.top+et;Q=Rp(P,j,le,K,X,K,N.left,ee,N.right,ie);break}case"left":{const G=L?et/2:et*4,le=L||B?o+G:o-G,X=L?o-G:B?o+G:o-G,K=i+et+1,ee=B||L?N.right-et:N.left,ie=B?L?N.right-et:N.left:N.right-et;Q=Rp(P,j,ee,N.top,ie,N.bottom,K,le,K,X);break}case"right":{const G=L?et/2:et*4,le=L||B?o+G:o-G,X=L?o-G:B?o+G:o-G,K=i-et,ee=B||L?N.left+et:N.right,ie=B?L?N.left+et:N.right:N.left+et;Q=Rp(P,j,K,le,K,X,ee,N.top,ie,N.bottom);break}}Q?p||n.start(40,R):R()}};return r.__options={...e,blockPointerEvents:t},r}const HL=O.createContext(void 0);function tve(){const e=O.useContext(HL);if(e===void 0)throw new Error(gn(26));return e}const vw="ArrowUp",xw="ArrowDown",bw="ArrowLeft",ww="ArrowRight",Sw="Home",Ow="End",MO=new Set([vw,xw,bw,ww,Sw,Ow]),nve="Shift",rve=[nve,"Control","Alt","Meta"];function ive(e){return it(e)&&e.tagName==="INPUT"}function v_(e){return!!(ive(e)&&e.selectionStart!=null||it(e)&&e.tagName==="TEXTAREA")}function x_(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,o=e.scrollTop;const a=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const l=b_(e,t,"left"),u=Np(e),c=Np(t);n==="ltr"&&(l+t.offsetWidth+c.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?i=l+t.offsetWidth+c.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:l-c.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(i=l-c.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(l-c.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?i=l-c.scrollMarginLeft-u.scrollPaddingLeft:l+t.offsetWidth+c.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(i=l+t.offsetWidth+c.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(s&&r!=="horizontal"){const l=b_(e,t,"top"),u=Np(e),c=Np(t);l-c.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?o=l-c.scrollMarginTop-u.scrollPaddingTop:l+t.offsetHeight+c.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(o=l+t.offsetHeight+c.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:i,top:o,behavior:"auto"})}function b_(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Np(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const ove="--nested-dialogs",ave="data-nested-dialog-open",sve={...yy,...lO,nestedDialogOpen(e){return e?{[ave]:""}:null}},lve=O.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,initialFocus:s,...l}=t,u=Xu(),c=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),h=u.useState("popupProps"),v=u.useState("modal"),y=u.useState("mounted"),x=u.useState("nested"),g=u.useState("nestedOpenDialogCount"),m=u.useState("open"),b=u.useState("openMethod"),S=u.useState("titleElementId"),w=u.useState("transitionStatus"),P=u.useState("role"),j=p.useState("floatingId");tve(),$d({open:m,ref:u.context.popupRef,onComplete(){var R,$;m&&(($=(R=u.context).onOpenChangeComplete)==null||$.call(R,!0))}});const E=s===void 0?kye(u.context.popupRef):s,A=g>0,C=u.useStateSetter("popupElement"),_=tn("div",t,{state:{open:m,nested:x,transitionStatus:w,nestedDialogOpen:A},props:[h,{id:j,"aria-labelledby":S,"aria-describedby":c,role:P,..._O,hidden:!y,onKeyDown(R){MO.has(R.key)&&R.stopPropagation()},style:{[ove]:g}},l],ref:[n,u.context.popupRef,C],stateAttributesMapping:sve});return d.jsx(yL,{context:p,openInteractionType:b,disabled:!y,closeOnFocusOut:!f,initialFocus:E,returnFocus:a,modal:v!==!1,restoreFocus:"popup",children:_})});function VL(e){return oO(19)?e:e?"true":void 0}const WL=O.forwardRef(function(t,n){const{cutout:r,...i}=t;let o;if(r){const a=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return d.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),uve=O.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,o=Xu(),a=o.useState("mounted"),s=o.useState("modal"),l=o.useState("open");return a||r?d.jsx(HL.Provider,{value:r,children:d.jsxs(gL,{ref:n,...i,children:[a&&s===!0&&d.jsx(WL,{ref:o.context.internalBackdropRef,inert:VL(!l)}),t.children]})}):null});let w_={},S_={},O_="";function Dy(e,t){return kd(e)?e:t}function P_(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Dy(t,n)).overflowY)}function cve(e){if(typeof document>"u")return!1;const t=He(e);return ct(t).innerWidth-t.documentElement.clientWidth>0}function fve(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=He(e),r=n.documentElement,i=n.body,o=Dy(r,i),a=o.style.overflowY,s=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const l=o.offsetWidth;o.style.overflowY="hidden";const u=o.offsetWidth;return o.style.overflowY=a,r.style.scrollbarGutter=s,l===u}function dve(e){const t=He(e),n=t.documentElement,r=t.body,i=Dy(n,r),o={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,o)}}function pve(e){var h;const t=He(e),n=t.documentElement,r=t.body,i=ct(n);let o=0,a=0,s=!1;const l=fi.create();if(Oo&&(((h=i.visualViewport)==null?void 0:h.scale)??1)!==1)return()=>{};function u(){const v=i.getComputedStyle(n),y=i.getComputedStyle(r),m=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,a=n.scrollLeft,w_={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},O_=n.style.scrollBehavior,S_={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,w=v.overflowY==="scroll"||y.overflowY==="scroll",P=v.overflowX==="scroll"||y.overflowX==="scroll",j=Math.max(0,i.innerWidth-r.clientWidth),E=Math.max(0,i.innerHeight-r.clientHeight),A=parseFloat(y.marginTop)+parseFloat(y.marginBottom),C=parseFloat(y.marginLeft)+parseFloat(y.marginRight),T=Dy(n,r);if(s=fve(e),s){n.style.scrollbarGutter=m,T.style.overflowY="hidden",T.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:m,overflowY:"hidden",overflowX:"hidden"}),(b||w)&&(n.style.overflowY="scroll"),(S||P)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:A||E?`calc(100dvh - ${A+E}px)`:"100dvh",width:C||j?`calc(100vw - ${C+j}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,w_),Object.assign(r.style,S_),s||(n.scrollTop=o,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=O_)}function f(){c(),l.request(u)}u();const p=Ne(i,"resize",f);return()=>{l.cancel(),c(),typeof i.removeEventListener=="function"&&p()}}class hve{constructor(){Ze(this,"lockCount",0);Ze(this,"restore",null);Ze(this,"timeoutLock",Jr.create());Ze(this,"timeoutUnlock",Jr.create());Ze(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Ze(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=He(t),r=n.documentElement,i=n.body,o=ct(r);if(P_(o,r,i)){const s=new o.MutationObserver(()=>{P_(o,r,i)||(s.disconnect(),this.restore=null,this.lock(t))}),l={attributes:!0};s.observe(r,l),s.observe(i,l),this.restore=()=>s.disconnect();return}const a=Py||!cve(t);this.restore=a?dve(t):pve(t)}}const mve=new hve;function KL(e=!0,t=null){fe(()=>{if(e)return mve.acquire(t)},[e,t])}function gve({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),i=e.useState("disablePointerDismissal"),o=e.useState("modal"),a=e.useState("popupElement"),s=e.useState("floatingRootContext"),[l,u]=O.useState(0),[c,f]=O.useState(0),p=l===0,h=EO(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(v){if(!e.context.outsidePressEnabledRef.current||"button"in v&&v.button!==0)return!1;if("touches"in v){if(v.type==="touchend"){if(v.changedTouches.length!==1||v.touches.length!==0)return!1}else if(v.touches.length!==1)return!1}const y=cn(v);if(p&&!i){if(o){const x=e.context.internalBackdropRef.current,g=e.context.backdropRef.current;return x||g?x===y||g===y||xe(y,a)&&!(y!=null&&y.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:p});return KL(r&&o===!0,a),e.useContextCallback("onNestedDialogOpen",(v,y)=>{u(v),f(y)}),fe(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,c+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,c,t]),LL(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:c}),null}const yve={...UL,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class vve extends My{constructor(n,r,i){const o=new RO,a=xve(n,o,r,i);super(a,bve(o),yve);Ze(this,"setOpen",(n,r)=>{var i,o;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(o=(i=this.context).onOpenChange)==null||o.call(i,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(ML(this.state,n,r.trigger)))})}}function xve(e,t,n,r=!1){return{...FL(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function bve(e){return{popupRef:O.createRef(),backdropRef:O.createRef(),internalBackdropRef:O.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function wve(e,t){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:a,disablePointerDismissal:s=!1,modal:l=!0,actionsRef:u,handle:c,triggerId:f,defaultTriggerId:p=null}=t,h=e==="drawer",v=l,y=s,x="dialog",g=Xu(!0),m=g!=null,b={modal:v,disablePointerDismissal:y,nested:m,role:x},S=NL((C,T)=>new vve({open:i,openProp:r,activeTriggerId:p,triggerIdProp:f,...b},C,T),!0);S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",f),S.useSyncedValues(b),S.useContextCallback("onOpenChange",o),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("open"),P=S.useState("mounted"),j=S.useState("payload");Dye(S,w),IL(S);const{forceUnmount:E}=DL(w,S);O.useImperativeHandle(u,()=>({unmount:E,close:()=>S.setOpen(!1,$e(KD))}),[E,S]);const A=w||P;return d.jsxs(RD.Provider,{value:S,children:[c&&d.jsx($L,{handle:c,store:S}),A&&d.jsx(gve,{store:S,parentContext:g==null?void 0:g.context,isDrawer:h}),typeof n=="function"?n({payload:j}):n]})}const Sve=CO(function(t){return wve("dialog",t)}),Ove=O.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...s}=t,l=Xu(),u=Yu(a);return l.useSyncedValueWithCleanup("titleElementId",u),tn("h2",t,{ref:n,props:[{id:u},s]})});function Pve(e){const t=O.useRef(""),n=O.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:O.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function qL(e,t){const n=O.useRef(e),r=de(t);fe(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function jve(e,t){const n=de((o,a)=>{(typeof e=="function"?e():e)||t(a||(Py?"touch":""))}),{onClick:r,onPointerDown:i}=Pve(n);return O.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function Eve(e){const[t,n]=O.useState(null),r=jve(e,n);return qL(e,i=>{i&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}const GL=Sve,Ave=O.forwardRef(function({className:t,...n},r){return d.jsx(ime,{ref:r,className:gt("fixed inset-0 z-40 bg-black/60 backdrop-blur-[2px]",t),...n})}),XL=O.forwardRef(function({className:t,placement:n="center",children:r,...i},o){const a=n==="right"?"inset-y-0 right-0 w-full max-w-xl border-l":n==="top"?"left-1/2 top-[12vh] w-[min(36rem,92vw)] -translate-x-1/2 rounded-lg border":"left-1/2 top-1/2 w-[min(36rem,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-lg border";return d.jsxs(uve,{children:[d.jsx(Ave,{}),d.jsx(lve,{ref:o,className:gt("fixed z-50 border-line bg-panel-2 text-foreground shadow-2xl focus:outline-none font-mono",a,t),...i,children:r})]})}),Cve=O.forwardRef(function({className:t,...n},r){return d.jsx(Ove,{ref:r,className:gt("text-sm font-semibold text-foreground",t),...n})});O.forwardRef(function({className:t,...n},r){return d.jsx(vme,{ref:r,className:gt("text-xs text-muted-foreground",t),...n})});const _s=O.forwardRef(function({className:t,...n},r){return d.jsx("input",{ref:r,className:gt("rounded border border-input bg-panel px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n})});function Tve(e){const t=O.useRef(!0);t.current&&(t.current=!1,e())}function _ve(e){const[t,n]=O.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function YL(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Pw({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=O.useRef(e!==void 0),[o,a]=O.useState(t),s=i&&e!==void 0?e:o,l=O.useCallback(u=>{i||a(u)},[]);return[s,l]}const QL=O.createContext(void 0),JL=O.createContext(void 0),ZL=O.createContext(void 0);function Aa(){const e=O.useContext(QL);if(e===void 0)throw new Error(gn(60));return e}function IO(){const e=O.useContext(JL);if(e===void 0)throw new Error(gn(101));return e}function eF(){const e=O.useContext(ZL);if(e===void 0)throw new Error(gn(61));return e}const Rve="data-valid",kve="data-invalid",Nve={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},$ve={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Mve={disabled:!1,...$ve},Ive={valid(e){return e===null?null:e?{[Rve]:""}:{[kve]:""}}},Dve={invalid:void 0,name:void 0,validityData:{state:Nve,errors:[],error:"",value:"",initialValue:null},setValidityData:St,disabled:void 0,setTouched:St,setDirty:St,setFilled:St,setFocused:St,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Mve,registerFieldControl:St,validation:{getValidationProps:(e,t=$t)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:St,getInputControl:()=>null,commit:async()=>{},change:St}},Lve=O.createContext(Dve);function DO(e=!0){const t=O.useContext(Lve);if(t.setValidityData===St&&!e)throw new Error(gn(28));return t}function Fve(e,t,n,r,i=!0,o){const{registerFieldControl:a}=DO(),s=Fn(()=>Symbol());fe(()=>{const l=s.current;if(!i){a(l,void 0);return}a(l,{controlRef:e,getValue:r,id:t,name:o,value:n})},[e,i,r,t,o,a,s,n]),fe(()=>{const l=s.current;return()=>{a(l,void 0)}},[a,s])}const Bve=O.createContext({controlId:void 0,registerControlId:St,resetControlId:St,labelId:void 0,setLabelId:St,messageIds:[],setMessageIds:St,getDescriptionProps:e=>e});function tF(){return O.useContext(Bve)}function nF(e={}){const{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:o}=tF(),a=Yu(),s=Fn(()=>Symbol()),l=O.useRef(!1),u=O.useRef(!1),c=de(()=>{!l.current||i===St||(l.current=!1,i(s.current,void 0))});return fe(()=>{if(!n||i===St){c();return}let f;if(t!==void 0)u.current=!0,f=t;else if(u.current)f=a;else{o();return}if(f===void 0){c();return}l.current=!0,i(s.current,f)},[t,n,i,o,a,s,c]),fe(()=>c,[c]),(n?r:void 0)??t??a}function Uve(e,t,n=Object.is){const{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}const rF=(e,t)=>Object.is(e,t);function Rs(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function zve(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Uve(e,t,(r,i)=>Rs(r,i,n)):e!==t}function jw(e,t,n){return e?e.some(r=>r===void 0?!1:Rs(t,r,n)):!1}function ah(e,t,n){return e?e.findIndex(r=>r===void 0?!1:Rs(r,t,n)):-1}function Hve(e,t){if(t!==rF)return r=>jw(e,r,t);const n=new Set(e);return n.delete(void 0),r=>n.has(r)&&(r!==0||e.some(i=>Object.is(r,i)))}function iF(e,t,n,r){const i=r&&Array.isArray(t)?e.findIndex(Hve(t,n)):ah(e,t,n);return i===-1?null:i}function Vve(e,t,n,r,i,o){return jw(r,t,i)?o!=null&&e>o&&jw(r,n[o],i)?o:e:e===o?iF(n,r,i,!0):o}function Wve(e,t,n){return e.filter(r=>!Rs(t,r,n))}function Ew(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Kve(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function oF(e){return Kve(e==null?void 0:e[0])}function qve(e){return oF(e)?e.flatMap(t=>t.items):e}function Gve(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(oF(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function aF(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ew(e)}function Xs(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ew(e.value):Ew(e)}function sF(e,t,n){function r(){return aF(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){const o=qve(t);if(e==null||typeof e!="object"){const a=o.find(s=>s.value===e);return a&&a.label!=null?a.label:r()}if("value"in e){const a=o.find(s=>s&&s.value===e.value);if(a&&a.label!=null)return a.label}}return r()}function Xve(e,t,n){return e.reduce((r,i,o)=>(o>0&&r.push(", "),r.push(d.jsx(O.Fragment,{children:sF(i,t,n)},o)),r),[])}const Yve={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xs(t,r)!==""},hasNullItemLabel:(e,t)=>t?Gve(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(i=>Rs(t,i,n)):Rs(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},Qve=O.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:St,validationMode:"onSubmit",submitCountRef:{current:0}});function Jve(){return O.useContext(Qve)}function Ic(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Mi=1;function lF(e,t){return Math.max(0,e-t)}function Zve(e,t){if(t<=0)return 0;const n=Ic(e,0,t),r=n,i=t-n,o=r<=Mi,a=i<=Mi;return o&&a?r<=i?0:t:o?0:a?t:n}function exe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:a=!1,onOpenChange:s,name:l,form:u,autoComplete:c,disabled:f=!1,readOnly:p=!1,required:h=!1,modal:v=!0,actionsRef:y,inputRef:x,onOpenChangeComplete:g,items:m,multiple:b=!1,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:P=rF,highlightItemOnHover:j=!0,children:E}=e,{clearErrors:A}=Jve(),{setDirty:C,setTouched:T,setFocused:_,validityData:R,setFilled:$,name:N,disabled:I,validation:B,validationMode:k}=DO(),L=nF({id:t}),M=I||f,z=N??l,[U,V]=Pw({controlled:n,default:b?r??da:r,name:"Select",state:"value"}),[W,Q]=Pw({controlled:o,default:a,name:"Select",state:"open"}),G=O.useRef([]),le=O.useRef([]),X=O.useRef(null),K=O.useRef(null),ee=O.useRef(0),ie=O.useRef(null),H=O.useRef([]),Z=O.useRef(!1),J=O.useRef(null),se=O.useRef(null),we=O.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ae=O.useRef(!1),be=O.useRef(U),{mounted:ce,setMounted:Ee,transitionStatus:je}=kL(W),{openMethod:Se,triggerProps:ze}=Eve(W),te=Fn(()=>new My({id:L,labelId:void 0,modal:v,multiple:b,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:P,value:U,open:W,mounted:ce,transitionStatus:je,items:m,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:$t,triggerProps:$t,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:St,setOpen:St,handleScrollArrowVisibility:St,onOpenChangeComplete:St,listRef:G,popupRef:X,scrollHandlerRef:K,scrollArrowsMountedCountRef:ee,valueRef:ie,valuesRef:H,labelsRef:le,typingRef:Z,selectionRef:we,firstItemTextRef:J,selectedItemTextRef:se,alignItemWithTriggerActiveRef:ae,initialValueRef:be},Yve)).current,pe=te.useState("activeIndex"),oe=te.useState("selectedIndex"),Y=te.useState("triggerElement"),ge=te.useState("positionerElement"),Ce=_ve(Se),Fe=Se??Ce,nn=O.useMemo(()=>b?"":Xs(U,w),[b,U,w]),Tn=O.useMemo(()=>b&&Array.isArray(U)?U.map(De=>Xs(De,w)):Xs(U,w),[b,U,w]),xt=Rt(Y),yn=de(()=>Tn);Fve(xt,L,U,yn,!M,l);const er=b?Array.isArray(U)&&U.length>0:U!=null&&nn!=="";fe(()=>{$(er)},[er,$]),fe(function(){const rt=iF(H.current,U,P,b);rt===null&&(se.current=null),!W&&te.set("selectedIndex",rt)},[b,W,U,P,te]),qL(U,()=>{A(z),C(zve(U,R.initialValue,P)),B.change(U)});const _n=de((De,rt)=>{s==null||s(De,rt),!rt.isCanceled&&(Q(De),!De&&(rt.reason===wy||rt.reason===mO)&&(T(!0),_(!1),k==="onBlur"&&B.commit(U)))}),ti=de(()=>{Ee(!1),te.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),g==null||g(!1)});$d({enabled:!y,open:W,ref:X,onComplete(){W||ti()}}),O.useImperativeHandle(y,()=>({unmount:ti}),[ti]);const Mr=de((De,rt)=>{i==null||i(De,rt),!rt.isCanceled&&V(De)}),Ei=de(De=>{const rt=lF(De.scrollHeight,De.clientHeight),Hn=Zve(De.scrollTop,rt),Ci=Hn>0,ni=Hn<rt;te.set("scrollUpArrowVisible",Ci),te.set("scrollDownArrowVisible",ni)}),mr=Bye({open:W,onOpenChange:_n,elements:{reference:Y,floating:ge}}),Ai=dge(mr,{enabled:!M,event:"mousedown"}),Ir=EO(mr),qt=Yye(mr,{enabled:!M,listRef:G,activeIndex:pe,selectedIndex:oe,disabledIndices:da,onNavigate(De){De===null&&!W||te.set("activeIndex",De)},focusItemOnHover:j}),Te=Qye(mr,{enabled:!M&&(W||!p&&!b),listRef:le,activeIndex:pe,selectedIndex:oe,disabledIndices:De=>YL(G.current[De]),onMatch(De){W?te.set("activeIndex",De):Mr(H.current[De],$e(ha))},onTyping(De){Z.current=De}}),At=O.useMemo(()=>As(Te.reference,qt.reference,Ir.reference,Ai.reference,ze),[Ai.reference,Te.reference,qt.reference,Ir.reference,ze]),rn=O.useMemo(()=>As(_O,Te.floating,qt.floating,Ir.floating),[Te.floating,qt.floating,Ir.floating]),on=qt.item??$t;te.useContextCallback("setValue",Mr),te.useContextCallback("setOpen",_n),te.useContextCallback("handleScrollArrowVisibility",Ei),te.useContextCallback("onOpenChangeComplete",g),Tve(()=>{te.update({popupProps:rn,triggerProps:At})}),te.useSyncedValues({id:L,modal:v,multiple:b,value:U,open:W,mounted:ce,transitionStatus:je,popupProps:rn,triggerProps:At,items:m,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:P,openMethod:Fe});const gr=O.useMemo(()=>({disabled:M,readOnly:p,required:h,multiple:b,highlightItemOnHover:j,itemProps:on}),[M,p,h,b,j,on]),tr=Es(x,B.inputRef),Ta=b?void 0:z,Po=O.useMemo(()=>!b||!Array.isArray(U)||!z?null:U.map(De=>{const rt=Xs(De,w);return d.jsx("input",{type:"hidden",form:u,name:z,value:rt,disabled:M},rt)}),[b,U,u,z,w,M]);return d.jsxs(QL.Provider,{value:te,children:[d.jsx(JL.Provider,{value:gr,children:d.jsx(ZL.Provider,{value:mr,children:E})}),d.jsx("input",{...B.getValidationProps(M,{onFocus(){var De;(De=te.state.triggerElement)==null||De.focus({focusVisible:!0})},onChange(De){if(De.nativeEvent.defaultPrevented||M||p)return;const rt=De.currentTarget.value,Hn=$e(ha,De.nativeEvent);function Ci(){if(b)return;const ni=rt.toLowerCase();let _a=H.current.findIndex(Hs=>Xs(Hs,w).toLowerCase()===ni||aF(Hs,S).toLowerCase()===ni);_a===-1&&(_a=H.current.findIndex((Hs,Hd)=>{const rc=le.current[Hd];return rc!=null&&rc.toLowerCase()===ni}));const nc=H.current[_a];nc!=null&&Mr(nc,Hn)}te.set("forceMount",!0),queueMicrotask(Ci)}}),id:L&&Ta==null?`${L}-hidden-input`:void 0,form:u,name:Ta,autoComplete:c,value:nn,disabled:M,required:h&&!(b&&er),readOnly:p,ref:tr,style:z?Dme:ZD,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Po]})}function txe(e,t){return e??t}const $p=5;function nxe(e,t){const n=rxe(t);return e.clientX>=n.left-$p&&e.clientX<=n.right+$p&&e.clientY>=n.top-$p&&e.clientY<=n.bottom+$p}function rxe(e){const t=e.getBoundingClientRect(),n=ct(e);if(vO)return t;const r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const a=parseFloat(r.width)||0,s=parseFloat(r.height)||0,l=parseFloat(i.width)||0,u=parseFloat(i.height)||0,c=Math.max(t.width,a,l),f=Math.max(t.height,s,u),p=c-t.width,h=f-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-h/2,bottom:t.bottom+h/2}}const ixe="data-popup-side",oxe=400,axe={...rme,...Ive,popupSide:e=>e?{[ixe]:e}:null,value:()=>null},sxe=O.forwardRef(function(t,n){var ee;const{render:r,className:i,id:o,disabled:a=!1,nativeButton:s=!0,style:l,...u}=t,{setTouched:c,setFocused:f,validationMode:p,validation:h,state:v,disabled:y}=DO(),{labelId:x}=tF(),g=Aa(),{readOnly:m,required:b,disabled:S}=IO(),w=y||S||a,P=g.useState("open"),j=g.useState("mounted"),E=g.useState("value"),A=g.useState("triggerProps"),C=g.useState("positionerElement"),T=g.useState("listElement"),_=g.useState("popupSide"),R=g.useState("id"),$=g.useState("labelId"),N=g.useState("hasSelectedValue"),I=j&&C?_:null,B=o??R,k=txe(x,$);nF({id:o});const L=Rt(C),M=O.useRef(null),{getButtonProps:z,buttonRef:U}=hO({disabled:w,native:s}),V=g.useStateSetter("triggerElement"),W=cr(),Q=cr(),G=cr();O.useEffect(()=>{if(P)return G.start(oxe,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{G.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Q.clear()},[P,g,Q,G]);const le=As(A,{id:B,role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-controls":P?(T==null?void 0:T.id)??((ee=Wm(C))==null?void 0:ee.id):void 0,"aria-labelledby":k,"aria-readonly":m||void 0,"aria-required":b||void 0,tabIndex:w?-1:0,onFocus(ie){f(!0),P&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,$e(ha,ie.nativeEvent)),W.start(0,()=>{g.set("forceMount",!0)})},onBlur(ie){xe(C,ie.relatedTarget)||(c(!0),f(!1),p==="onBlur"&&h.commit(E))},onMouseDown(ie){if(P)return;const H=He(ie.currentTarget);function Z(J){if(!M.current)return;const se=J.target;xe(M.current,se)||xe(L.current,se)||nxe(J,M.current)||g.context.setOpen(!1,$e(mme,J))}Q.start(0,()=>{H.addEventListener("mouseup",Z,{once:!0})})}},u,z),X=h.getValidationProps(w,le);X.role="combobox";const K={...v,open:P,disabled:w,value:E,readOnly:m,popupSide:I,placeholder:!N};return tn("button",t,{ref:[n,M,U,V],state:K,stateAttributesMapping:axe,props:X})}),lxe={value:()=>null},uxe=O.forwardRef(function(t,n){const{className:r,render:i,children:o,placeholder:a,style:s,...l}=t,u=Aa(),c=u.useState("value"),f=u.useState("items"),p=u.useState("itemToStringLabel"),h=u.useState("hasSelectedValue"),v=!h&&a!=null&&o==null,y=u.useState("hasNullItemLabel",v),x={value:c,placeholder:!h};let g=null;return typeof o=="function"?g=o(c):o!=null?g=o:v&&!y?g=a:Array.isArray(c)?g=Xve(c,f,p):g=sF(c,f,p),tn("span",t,{state:x,ref:[n,u.context.valueRef],props:[{children:g},l],stateAttributesMapping:lxe})}),cxe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,...a}=t,u={open:Aa().useState("open")};return tn("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:UD})}),fxe=O.forwardRef(function(t,n){const r=Aa(),i=r.useState("mounted"),o=r.useState("forceMount");return i||o?d.jsx(gL,{ref:n,...t}):null}),uF=O.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function dxe(){return O.useContext(uF)}function LO(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=de(i),[,a]=O.useState(!1),s=Fn(hxe).current,l=Fn(pxe).current,u=O.useRef(0),c=O.useRef(!0),f=O.useRef(null),p=O.useRef(null),h=de(()=>{c.current||(c.current=!0,a(w=>!w))}),v=de((w,P)=>{l.set(w,P),h()}),y=de(w=>{l.delete(w),h()}),x=de(w=>{const P=new Map;return n.current.length=0,r&&(r.current.length=0),w.forEach(j=>{var E,A;P.set(j.element,{...j.registration.metadata??{},index:j.index}),n.current[j.index]=j.element,r&&(r.current[j.index]=j.registration.label!==void 0?j.registration.label:((A=(E=j.registration.textRef)==null?void 0:E.current)==null?void 0:A.textContent)??j.element.textContent)}),u.current=n.current.length,P});function g(w){var E;if((E=p.current)==null||E.disconnect(),p.current=null,typeof MutationObserver!="function"||w.length<2)return;const P=new MutationObserver(A=>{if(!yxe(A))return;let C=null;for(const T of w)if(T.isConnected){if(C&&cF(C,T)>0){P.disconnect(),h();return}C=T}});p.current=P;const j=new Set;for(let A=1;A<w.length;A+=1){const C=gxe(w[A-1],w[A]);C&&j.add(C)}j.forEach(A=>P.observe(A,{childList:!0}))}const m=de(()=>{const[w,P]=mxe(l),j=x(w),E=f.current,A=!E||E.length!==w.length||w.some((C,T)=>{const _=E[T];return C.index!==_.index||C.element!==_.element||C.registration.index!==_.registration.index||C.registration.metadata!==_.registration.metadata});g(P),f.current=w,c.current=!1,A&&(s.forEach(C=>C(j)),o(j))});fe(()=>(!c.current&&f.current&&x(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,x]),fe(()=>{c.current&&m()}),fe(()=>()=>{var w;(w=p.current)==null||w.disconnect(),c.current=!0},[]);const b=de(w=>(s.add(w),()=>{s.delete(w)})),S=O.useMemo(()=>({register:v,unregister:y,subscribeMapChange:b,nextIndexRef:u}),[v,y,b,u]);return d.jsx(uF.Provider,{value:S,children:t})}function pxe(){return new Map}function hxe(){return new Set}function mxe(e){const t=new Set,n=[],r=[];e.forEach((o,a)=>{if(!a.isConnected)return;const s=o.index,l={index:s??-1,element:a,registration:o};s===null?r.push(l):s>=0&&(t.add(s),n.push(l))});let i=0;return r.sort((o,a)=>cF(o.element,a.element)),r.forEach(o=>{for(;t.has(i);)i+=1;o.index=i,n.push(o),i+=1}),t.size>0&&n.sort((o,a)=>o.index-a.index),[n,r.map(o=>o.element)]}function gxe(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function yxe(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function cF(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const vxe=O.createContext(void 0);function FO(){const e=O.useContext(vxe);return(e==null?void 0:e.direction)??"ltr"}const xxe=e=>({name:"arrow",options:e,async fn(t){var L,M;const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:f="real"}=ma(e,t)||{};if(u==null)return{};const p=tL(c),h={x:n,y:r},v=OO(i),y=SO(v),x=await a.getDimensions(u),g=v==="y",m=g?"top":"left",b=g?"bottom":"right",S=g?"clientHeight":"clientWidth",w=o.reference[y]+o.reference[v]-h[v]-o.floating[y],P=h[v]-o.reference[v],j=f==="real"?await((L=a.getOffsetParent)==null?void 0:L.call(a,u)):s.floating;let E=s.floating[S]||o.floating[y];(!E||!await((M=a.isElement)==null?void 0:M.call(a,j)))&&(E=s.floating[S]||o.floating[y]);const A=w/2-P/2,C=E/2-x[y]/2-1,T=Math.min(p[m],C),_=Math.min(p[b],C),R=T,$=E-x[y]-_,N=E/2-x[y]/2+A,I=eL(R,N,$),B=!l.arrow&&uo(i)!=null&&N!==I&&o.reference[y]/2-(N<R?T:_)-x[y]/2<0,k=B?N<R?N-R:N-$:0;return{[v]:h[v]+k,data:{[v]:I,centerOffset:N-I-k,...B&&{alignmentOffset:k}},reset:B}}}),bxe=(e,t)=>{const{name:n,fn:r}=xxe(e);return{name:n,fn:r,options:[e,t]}},wxe={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,o=t===0&&n===0&&r===0&&i===0,a=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-t>=0||a.bottom-n>=0||a.left-t>=0||o}}}},Sxe={sideX:"left",sideY:"top"},Oxe="--available-width",Pxe="--available-height",jxe="--anchor-width",Exe="--anchor-height",Axe="--transform-origin",j_=Oxe,E_=Pxe;function fF(e,t,n){const 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 A_(e,t,n){const{rects:r,placement:i}=e;return{side:fF(t,Cr(i),n),align:uo(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function dF(e){return Cxe(e,Uye)}function Cxe(e,t){var Ir,qt;const{anchor:n,positionMethod:r="absolute",side:i="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,collisionBoundary:l,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:h,keepMounted:v=!1,floatingRootContext:y,mounted:x,collisionAvoidance:g,shift:m,nodeId:b,adaptiveOrigin:S,lazyFlip:w=!1,externalTree:P}=e,[j,E]=O.useState(null);!x&&j!==null&&E(null);const A=g.side||"flip",C=g.align||"flip",T=g.fallbackAxisSide||"end",_=(m==null?void 0:m.crossAxis)??!1,R=m==null?void 0:m.rootBoundary,$=typeof n=="function"?n:void 0,N=de($),I=$?N:n,B=Rt(n),k=Rt(x),M=FO()==="rtl",z=j||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[i],U=a==="center"?z:`${z}-${a}`;let V=u;typeof V=="number"?V={top:V,right:V,bottom:V,left:V}:V&&(V={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0});const W=1,Q=i==="bottom"?W:0,G=i==="top"?W:0,le=i==="right"?W:0,X=i==="left"?W:0,K={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:V},ee=O.useRef(null),ie=Rt(o),H=Rt(s),Z=typeof o!="function"?o:0,J=typeof s!="function"?s:0,se=[];h&&se.push(h),se.push(Yge(Te=>{const At=A_(Te,i,M),rn=typeof ie.current=="function"?ie.current(At):ie.current,on=typeof H.current=="function"?H.current(At):H.current;return{mainAxis:rn,crossAxis:on,alignmentAxis:on}},[Z,J,M,i]));const we=C==="none"&&A!=="shift",ae=!we&&(c||_||A==="shift"),be=A==="none"?null:Zge({...K,padding:{top:V.top+W+Q,right:V.right+W+X,bottom:V.bottom+W+G,left:V.left+W+le},mainAxis:!_&&A==="flip",crossAxis:C==="flip"?"alignment":!1,fallbackAxisSideDirection:T}),ce=we?null:Qge({...K,rootBoundary:R,mainAxis:C!=="none",crossAxis:ae,limiter:c||_?void 0:Jge(Te=>{if(!ee.current)return{};const{width:At,height:rn}=ee.current.getBoundingClientRect(),on=Er(Cr(Te.placement)),gr=on==="y"?At:rn,tr=on==="y"?V.left+V.right:V.top+V.bottom;return{offset:gr/2+tr/2}})},[K,c,_,R,V,C]);A==="shift"||C==="shift"||a==="center"?se.push(ce,be):se.push(be,ce),se.push(eye({...K,apply({elements:{floating:Te},availableWidth:At,availableHeight:rn,rects:on}){if(!k.current)return;const gr=Te.style;gr.setProperty(j_,`${At}px`),gr.setProperty(E_,`${rn}px`);const tr=ct(Te).devicePixelRatio||1,{x:Ta,y:Po,width:De,height:rt}=on.reference,Hn=(Math.round((Ta+De)*tr)-Math.round(Ta*tr))/tr,Ci=(Math.round((Po+rt)*tr)-Math.round(Po*tr))/tr;gr.setProperty(jxe,`${Hn}px`),gr.setProperty(Exe,`${Ci}px`)}}),bxe(Te=>({element:ee.current||He(Te.elements.floating).createElement("div"),padding:ee.current?f:0,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Te){var nc,Hs,Hd,rc,oP,aP;const{elements:{floating:At},middlewareData:rn,placement:on,platform:gr,rects:tr,y:Ta}=Te,Po=Cr(on),De=uo(on),rt=Er(Po)==="y",Hn=ee.current,Ci=typeof o=="function"?o(A_(Te,i,M)):o;let ni;if(!Hn&&De&&Math.abs(rt?((nc=rn.shift)==null?void 0:nc.x)||0:((Hs=rn.shift)==null?void 0:Hs.y)||0)<=1)ni=De==="start"===(rt&&((Hd=gr.isRTL)==null?void 0:Hd.call(gr,At))===!0)?"100%":"0%";else{const jB=rt?((rc=rn.arrow)==null?void 0:rc.x)||0:((oP=rn.arrow)==null?void 0:oP.y)||0,EB=rt?(Hn==null?void 0:Hn.clientWidth)||0:(Hn==null?void 0:Hn.clientHeight)||0;ni=`${jB+EB/2}px`}let _a=Po==="top"||Po==="left"?`calc(100% + ${Ci}px)`:`${-Ci}px`;return ae&&rt&&Math.abs(((aP=rn.shift)==null?void 0:aP.y)||0)>Ci&&(_a=`${tr.reference.y+tr.reference.height/2-Ta}px`),At.style.setProperty(Axe,rt?`${ni} ${_a}`:`${_a} ${ni}`),{}}},wxe,S),fe(()=>{!x&&y&&y.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,y]);const Ee=O.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:je,elements:Se,x:ze,y:te,middlewareData:pe,update:oe,placement:Y,context:ge,isPositioned:Ce,floatingStyles:Fe}=t({rootContext:y,open:v?x:void 0,placement:U,middleware:se,strategy:r,whileElementsMounted:v?void 0:(...Te)=>d_(...Te,Ee),nodeId:b,externalTree:P}),{sideX:nn,sideY:Tn}=pe.adaptiveOrigin||Sxe,xt=Ce?r:"fixed",yn=O.useMemo(()=>{let Te;return Ce?S?Te={position:xt,[nn]:ze,[Tn]:te}:Te={...Fe,position:xt}:Te={position:xt,top:0,left:0},Te[j_]="100vw",Te[E_]="100vh",Ce||(Te.opacity=0),Te},[S,xt,nn,ze,Tn,te,Fe,Ce]),er=O.useRef(null);fe(()=>{if(!x)return;const Te=B.current,At=typeof Te=="function"?Te():Te,on=(C_(At)?At.current:At)||null||null;on!==er.current&&(je.setPositionReference(on),er.current=on)},[x,je,I,B]),O.useEffect(()=>{if(!x)return;const Te=B.current;typeof Te!="function"&&C_(Te)&&Te.current!==er.current&&(je.setPositionReference(Te.current),er.current=Te.current)},[x,je,I,B]),O.useEffect(()=>{if(v&&x&&Se.reference&&Se.floating)return d_(Se.reference,Se.floating,oe,Ee)},[v,x,Se,oe,Ee]);const _n=Cr(Y),ti=fF(i,_n,M),Mr=uo(Y)||"center",Ei=!!((Ir=pe.hide)!=null&&Ir.referenceHidden);fe(()=>{w&&x&&Ce&&_n!==z&&E(_n)},[w,x,Ce,_n,z]);const mr=O.useMemo(()=>{var Te,At;return{position:"absolute",top:(Te=pe.arrow)==null?void 0:Te.y,left:(At=pe.arrow)==null?void 0:At.x}},[pe.arrow]),Ai=((qt=pe.arrow)==null?void 0:qt.centerOffset)!==0;return O.useMemo(()=>({positionerStyles:yn,arrowStyles:mr,arrowRef:ee,arrowUncentered:Ai,side:ti,align:Mr,physicalSide:_n,anchorHidden:Ei,refs:je,context:ge,isPositioned:Ce,update:oe}),[yn,mr,ee,Ai,ti,Mr,_n,Ei,je,ge,Ce,oe])}function C_(e){return e!=null&&"current"in e}const pF=O.createContext(void 0);function Txe(){const e=O.useContext(pF);if(!e)throw new Error(gn(59));return e}function Jm(e,t){e&&Object.assign(e.style,t)}const _xe={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function BO(e){return e==="starting"?tge:$t}function hF(e,t,{styles:n,transitionStatus:r,props:i,refs:o,hidden:a,inert:s=!1}){const l={...n};return s&&(l.pointerEvents="none"),tn("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:a,style:l},BO(r),i],stateAttributesMapping:yy})}const Rxe=20;function kxe(e,t,n,r){const[i,o]=O.useState(!1);fe(()=>{if(!e||!t||n==null){o(!1);return}const a=He(n).documentElement.clientWidth,s=n.offsetWidth;o(a>0&&s>0&&s>=a-Rxe)},[e,t,n]),KL(e&&(!t||i),r)}const Nxe={position:"fixed"},$xe=O.forwardRef(function(t,n){const{anchor:r,className:i,render:o,positionMethod:a,side:s,align:l,sideOffset:u,alignOffset:c,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:h,sticky:v,disableAnchorTracking:y,alignItemWithTrigger:x=!0,collisionAvoidance:g=rge,style:m,...b}=t,S=Aa(),w=eF(),P=S.useState("open"),j=S.useState("mounted"),E=S.useState("modal"),A=S.useState("value"),C=S.useState("openMethod"),T=S.useState("positionerElement"),_=S.useState("triggerElement"),R=S.useState("isItemEqualToValue"),$=S.useState("transitionStatus"),N=O.useRef(null),I=O.useRef(null),[B,k]=O.useState(x),L=j&&B&&C!=="touch";!j&&B!==x&&k(x),O.useImperativeHandle(S.context.alignItemWithTriggerActiveRef,()=>L),kxe((L||E)&&P,C==="touch",T,_);const M=dF({anchor:r,floatingRootContext:w,positionMethod:a,mounted:j,side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:v,disableAnchorTracking:y??L,collisionAvoidance:g,keepMounted:!0}),z=L?"none":M.side,U=L?Nxe:M.positionerStyles,V={open:P,side:z,align:M.align,anchorHidden:M.anchorHidden};fe(()=>{S.set("popupSide",M.side)},[S,M.side]);const W=S.useStateSetter("positionerElement"),Q=hF(t,V,{styles:U,transitionStatus:$,props:b,refs:[n,W],hidden:!j,inert:!P}),G=O.useRef(0),le=de(K=>{if(S.context.valuesRef.current.length===0)return;const ee=G.current;G.current=K.size;const ie=$e(ha);if(ee!==0&&!S.state.multiple&&A!==null&&ah(S.context.valuesRef.current,A,R)===-1){const Z=S.context.initialValueRef.current,se=Z!=null&&ah(S.context.valuesRef.current,Z,R)!==-1?Z:null;S.context.setValue(se,ie),se===null&&(S.set("selectedIndex",null),S.context.selectedItemTextRef.current=null)}if(ee!==0&&S.state.multiple&&Array.isArray(A)){const H=A.filter(Z=>ah(S.context.valuesRef.current,Z,R)!==-1);H.length!==A.length&&(S.context.setValue(H,ie),H.length===0&&(S.set("selectedIndex",null),S.context.selectedItemTextRef.current=null))}if(P&&L){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const H={height:""};Jm(T,H),Jm(S.context.popupRef.current,H)}}),X=O.useMemo(()=>({...M,side:z,alignItemWithTriggerActive:L,setControlledAlignItemWithTrigger:k,scrollUpArrowRef:N,scrollDownArrowRef:I}),[M,z,L,k]);return d.jsx(LO,{elementsRef:S.context.listRef,labelsRef:S.context.labelsRef,onMapChange:le,children:d.jsxs(pF.Provider,{value:X,children:[j&&E&&d.jsx(WL,{inert:VL(!P),cutout:_}),Q]})})}),Mp="base-ui-disable-scrollbar",T_={className:Mp,getElement(e){return d.jsx("style",{nonce:e,href:Mp,precedence:"base-ui:low",children:`.${Mp}{scrollbar-width:none}.${Mp}::-webkit-scrollbar{display:none}`})}},Mxe=O.createContext(void 0);function Ixe(e){return O.useContext(Mxe)}const Dxe=O.createContext(void 0),Lxe={disableStyleElements:!1};function Fxe(){return O.useContext(Dxe)??Lxe}const __="--transform-origin",Bxe={...yy,...lO},Uxe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,...s}=t,l=Aa(),{multiple:u,readOnly:c,highlightItemOnHover:f}=IO(),p=eF(),{side:h,align:v,alignItemWithTriggerActive:y,isPositioned:x,setControlledAlignItemWithTrigger:g}=Txe(),m=Ixe()!=null,b=FO(),{nonce:S,disableStyleElements:w}=Fxe(),P=l.useState("id"),j=l.useState("open"),E=l.useState("openMethod"),A=l.useState("mounted"),C=l.useState("popupProps"),T=l.useState("transitionStatus"),_=l.useState("triggerElement"),R=l.useState("positionerElement"),$=l.useState("listElement"),N=O.useRef(!1),I=O.useRef(!1),B=O.useRef({}),k=Ou(),L=de(V=>{if(!R||!l.context.popupRef.current||!I.current)return;const W=R.style.top==="0px",Q=R.style.bottom==="0px";if(N.current||!y||!W&&!Q){l.context.handleScrollArrowVisibility(V);return}const G=k_(R),le=Dc(R.getBoundingClientRect().height,"y",G),X=He(R),K=ct(R),ee=K.getComputedStyle(R),ie=parseFloat(ee.marginTop),H=parseFloat(ee.marginBottom),Z=R_(K.getComputedStyle(l.context.popupRef.current)),J=Math.min(X.documentElement.clientHeight-ie-H,Z),se=V.scrollTop,we=Ip(V);let ae=null;const be=Se=>{R.style.height=`${Se}px`},ce=W?we-se:se,Ee=Math.min(le+ce,J);if(ce<=Mi){const Se=Ic(ce,0,J-le);Se>0&&be(le+Se),V.scrollTop=W?we:0,J-(le+Se)<=Mi&&(N.current=!0),l.context.handleScrollArrowVisibility(V);return}if(J-Ee>Mi)ae=W?1/0:0;else if(Q&&se<we){const Se=le+ce-J;ae=se-(ce-Se)}const je=Math.ceil(Ee);if(je!==0&&be(je),ae!=null){const Se=Ic(ae,0,Ip(V));Math.abs(V.scrollTop-Se)>Mi&&(V.scrollTop=Se)}je>=J-Mi&&(N.current=!0),l.context.handleScrollArrowVisibility(V)});O.useImperativeHandle(l.context.scrollHandlerRef,()=>L,[L]),$d({open:j,ref:l.context.popupRef,onComplete(){j&&l.context.onOpenChangeComplete(!0)}});const M={open:j,transitionStatus:T,side:h,align:v};fe(()=>{!R||!l.context.popupRef.current||Object.keys(B.current).length||(B.current={top:R.style.top||"0",left:R.style.left||"0",right:R.style.right,height:R.style.height,bottom:R.style.bottom,minHeight:R.style.minHeight,maxHeight:R.style.maxHeight,marginTop:R.style.marginTop,marginBottom:R.style.marginBottom})},[l,R]),fe(()=>{j||y||(I.current=!1,N.current=!1,Jm(R,B.current))},[j,y,R]),fe(()=>{var Q,G;const V=l.context.popupRef.current;if(!j||!_||!R||!V||y&&!x||l.state.transitionStatus==="ending")return;if(I.current=!0,V.style.removeProperty(__),!y){k.request(()=>l.context.handleScrollArrowVisibility($||V));return}const W=zxe(V);try{let le=l.context.selectedItemTextRef.current;le!=null&&le.isConnected||(le=!l.select("hasSelectedValue")&&((Q=l.context.firstItemTextRef.current)!=null&&Q.isConnected)?l.context.firstItemTextRef.current:null);const X=l.context.valueRef.current,K=ct(R),ee=K.getComputedStyle(R),ie=K.getComputedStyle(V),H=He(_),Z=k_(_),J=Dp(_.getBoundingClientRect(),Z),se=Dp(R.getBoundingClientRect(),Z),we=J.height,ae=$||V,be=ae.scrollHeight,ce=parseFloat(ie.borderBottomWidth),Ee=parseFloat(ee.marginTop)||10,je=parseFloat(ee.marginBottom)||10,Se=parseFloat(ee.minHeight)||100,ze=R_(ie),te=5,pe=5,oe=20,Y=H.documentElement.clientHeight-Ee-je,ge=H.documentElement.clientWidth,Ce=Y-J.bottom+we;let Fe,nn=b==="rtl"?J.right-se.width:J.left,Tn=0;if(le&&X){const qt=Dp(X.getBoundingClientRect(),Z);Fe=Dp(le.getBoundingClientRect(),Z),nn=se.left+(b==="rtl"?qt.right-Fe.right:qt.left-Fe.left);const Te=qt.top-J.top+qt.height/2;Tn=Fe.top-se.top+Fe.height/2-Te}const xt=Ce+Tn+je+ce;let yn=Math.min(Y,xt);const er=Y-Ee-je,_n=xt-yn,ti=ge-pe;R.style.left=`${Ic(nn,te,ti-se.width)}px`,R.style.height=`${yn}px`,R.style.maxHeight="none",R.style.marginTop=`${Ee}px`,R.style.marginBottom=`${je}px`,V.style.height="100%";const Mr=Ip(ae),Ei=_n>=Mr-Mi;Ei&&(yn=Math.min(Y,se.height)-(_n-Mr));const mr=J.top<oe||J.bottom>Y-oe||Math.ceil(yn)+Mi<Math.min(be,Se),Ai=(((G=K.visualViewport)==null?void 0:G.scale)??1)!==1&&Oo;if(mr||Ai){Jm(R,B.current),g(!1);return}const Ir=Math.max(Se,yn);if(Ei){const qt=Math.max(0,Y-xt);R.style.top=se.height>=er?"0":`${qt}px`,R.style.height=`${yn}px`,ae.scrollTop=Ip(ae)}else R.style.bottom="0",ae.scrollTop=_n;if(Fe){const qt=se.top,Te=se.height,At=Fe.top+Fe.height/2,rn=Ic(Te>0?(At-qt)/Te*100:50,0,100);V.style.setProperty(__,`50% ${rn}%`)}(Ir===Y||yn>=ze)&&(N.current=!0),l.context.handleScrollArrowVisibility(ae),f&&l.state.selectedIndex===null&&l.state.activeIndex===null&&l.context.listRef.current[0]!=null&&l.set("activeIndex",0)}finally{W()}},[l,j,R,_,y,g,k,$,f,b,x]),O.useEffect(()=>{if(!y||!R||!j)return;const V=ct(R);function W(Q){l.context.setOpen(!1,$e(gme,Q))}return Ne(V,"resize",W)},[l,y,R,j]);const z={...$?{role:"presentation"}:{role:"listbox","aria-multiselectable":u||void 0,"aria-readonly":c||void 0,id:`${P}-list`},onKeyDown(V){m&&MO.has(V.key)&&V.stopPropagation()},onScroll(V){$||L(V.currentTarget)},...y&&{style:$?{height:"100%"}:_xe},className:!$&&y?T_.className:void 0},U=tn("div",t,{ref:[n,l.context.popupRef],state:M,stateAttributesMapping:Bxe,props:[C,z,BO(T),s]});return d.jsxs(O.Fragment,{children:[!w&&T_.getElement(S),d.jsx(yL,{context:p,modal:!1,disabled:!A,openInteractionType:E,returnFocus:a,restoreFocus:!0,children:U})]})});function R_(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function Ip(e){return lF(e.scrollHeight,e.clientHeight)}function k_(e){return OL.getScale(e)}function Dc(e,t,n){return e/n[t]}function Dp(e,t){return ud({x:Dc(e.x,"x",t),y:Dc(e.y,"y",t),width:Dc(e.width,"x",t),height:Dc(e.height,"y",t)})}const N_=[["transform","none"],["scale","1"],["translate","0 0"]];function zxe(e){const{style:t}=e,n={};for(const[r,i]of N_)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of N_){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}function mF(e={}){const{guess:t,label:n,metadata:r,textRef:i,index:o}=e,{register:a,unregister:s,subscribeMapChange:l,nextIndexRef:u}=dxe(),c=O.useRef(-1),[f,p]=O.useState(o==null&&t?()=>{if(c.current===-1){const x=u.current;u.current+=1,c.current=x}return c.current}:-1),h=o??f,v=O.useRef(null),y=O.useCallback(x=>{const g=v.current;g&&s(g),v.current=x,x&&a(x,{metadata:r??null,index:o??null,label:n,textRef:i})},[o,a,s,r,n,i]);return fe(()=>{if(o==null)return l(x=>{var m;const g=v.current?(m=x.get(v.current))==null?void 0:m.index:null;g!=null&&p(g)})},[o,l]),{ref:y,index:h}}const gF=O.createContext(void 0);function Hxe(){const e=O.useContext(gF);if(!e)throw new Error(gn(57));return e}const Vxe=O.memo(O.forwardRef(function(t,n){const{render:r,className:i,style:o,value:a=null,label:s,disabled:l=!1,nativeButton:u=!1,...c}=t,f=O.useRef(null),p=mF({guess:!0,label:s,textRef:f}),h=Aa(),{itemProps:v,multiple:y,disabled:x,readOnly:g}=IO(),m=x||l,b=h.useState("isActive",p.index),S=h.useState("open"),w=h.useState("isSelected",a),P=h.useState("isSelectedByFocus",p.index),j=h.useState("isItemEqualToValue"),E=p.index,A=O.useRef(null);fe(()=>{const M=h.context.valuesRef.current;return M[E]=a,()=>{delete M[E]}},[E,a,h]),fe(()=>{const M=h.state.value,z=h.state.selectedIndex;let U=z,V;y&&Array.isArray(M)?(U=Vve(E,a,h.context.valuesRef.current,M,j,z),V=U===E,E===z&&!V&&(h.context.selectedItemTextRef.current=null)):(V=M!==void 0&&Rs(a,M,j),V&&(U=E)),h.set("selectedIndex",U),V&&f.current&&(h.context.selectedItemTextRef.current=f.current)},[E,y,j,h,a]);const C=O.useRef("mouse"),T=O.useRef(!1),{getButtonProps:_,buttonRef:R}=hO({disabled:m,focusableWhenDisabled:!0,native:u,composite:!0}),$={disabled:m,selected:w,highlighted:b};function N(M){if(x||g)return;const z=h.state.value;if(y){const U=Array.isArray(z)?z:[],V=w?Wve(U,a,j):[...U,a];h.context.setValue(V,$e(Zv,M))}else h.context.setValue(a,$e(Zv,M)),h.context.setOpen(!1,$e(Zv,M))}function I(){h.context.selectionRef.current.dragY=0}const B={role:"option","aria-selected":w,tabIndex:S&&b?0:-1,onKeyDown(M){h.set("activeIndex",E),M.key===" "&&h.context.typingRef.current&&M.preventDefault()},onClick(M){const z=C.current!=="touch",U=M.nativeEvent.pointerType,V=z&&jy(M.nativeEvent)&&(U!==void 0||b),W=z&&!V&&!T.current;T.current=!1,!(m||W)&&N(M.nativeEvent)},onPointerEnter(M){C.current=M.pointerType},onPointerMove(M){if(M.pointerType==="mouse"&&M.buttons===1){const z=h.context.selectionRef.current;z.dragY+=M.movementY,z.dragY**2>=64&&(z.allowUnselectedMouseUp=!0)}},onPointerDown(M){C.current=M.pointerType,T.current=!0,I()},onMouseUp(){var U;if(I(),m||C.current==="touch"||T.current)return;const M=!h.context.selectionRef.current.allowSelectedMouseUp&&w,z=!h.context.selectionRef.current.allowUnselectedMouseUp&&!w;M||z||(T.current=!0,(U=A.current)==null||U.click(),T.current=!1)}},k=tn("div",t,{ref:[R,n,p.ref,A],state:$,props:[v,B,c,_]}),L=O.useMemo(()=>({selected:w,index:E,textRef:f,selectedByFocus:P}),[w,E,f,P]);return d.jsx(gF.Provider,{value:L,children:k})})),Wxe=O.memo(O.forwardRef(function(t,n){const{index:r,textRef:i,selectedByFocus:o}=Hxe(),a=Aa(),{render:s,className:l,style:u,...c}=t,f=O.useCallback(h=>{h&&(r===0&&(a.context.firstItemTextRef.current=h),o&&(a.context.selectedItemTextRef.current=h))},[a,r,o]);return tn("div",t,{ref:[f,n,i],props:c})})),Kxe=O.createContext(void 0);function qxe(){const e=O.useContext(Kxe);if(e===void 0)throw new Error(gn(56));return e}const Gxe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...s}=t,{setLabelId:l}=qxe(),u=Yu(a);return fe(()=>(l(u),()=>{l(f=>f===u?void 0:f)}),[u,l]),tn("div",t,{ref:n,props:[{id:u,"aria-hidden":!0},s]})}),Aw=exe,Cw=uxe,Tw=O.forwardRef(function({className:t,children:n,...r},i){return d.jsxs(sxe,{ref:i,className:gt("inline-flex items-center justify-between gap-1.5 rounded border border-line bg-panel px-2 py-1 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",t),...r,children:[n,d.jsx(cxe,{className:"text-muted-foreground","aria-hidden":"true",children:"▾"})]})}),_w=O.forwardRef(function({className:t,children:n,side:r="bottom",align:i="start",...o},a){return d.jsx(fxe,{children:d.jsx($xe,{side:r,align:i,sideOffset:4,className:"z-50",children:d.jsx(Uxe,{ref:a,className:gt("min-w-[6rem] overflow-hidden rounded border border-line bg-popover p-1 text-popover-foreground shadow-lg font-mono",t),...o,children:n})})})}),Lc=O.forwardRef(function({className:t,children:n,...r},i){return d.jsx(Vxe,{ref:i,className:gt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1 text-xs text-foreground outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-panel data-[selected]:text-brand",t),...r,children:d.jsx(Wxe,{children:n})})});O.forwardRef(function({className:t,...n},r){return d.jsx(Gxe,{ref:r,className:gt("px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",t),...n})});const Md=O.forwardRef(function({className:t,containerClassName:n,...r},i){return d.jsx("div",{className:gt("w-full overflow-x-auto",n),children:d.jsx("table",{ref:i,className:gt("w-full border-collapse text-xs",t),...r})})}),Id=O.forwardRef(function({className:t,...n},r){return d.jsx("thead",{ref:r,className:gt("border-b border-line text-left text-[10px] uppercase tracking-wide text-muted-foreground",t),...n})}),Dd=O.forwardRef(function({className:t,...n},r){return d.jsx("tbody",{ref:r,className:gt("divide-y divide-line-soft",t),...n})}),kr=O.forwardRef(function({className:t,...n},r){return d.jsx("tr",{ref:r,className:gt("transition-colors",t),...n})}),Ge=O.forwardRef(function({className:t,...n},r){return d.jsx("th",{ref:r,className:gt("px-3 py-2 font-normal",t),...n})}),nt=O.forwardRef(function({className:t,...n},r){return d.jsx("td",{ref:r,className:gt("px-3 py-2 align-top",t),...n})}),yF=O.createContext(void 0);function vF(){const e=O.useContext(yF);if(e===void 0)throw new Error(gn(64));return e}const Xxe="data-activation-direction",UO={tabActivationDirection:e=>({[Xxe]:e})},Yxe=O.forwardRef(function(t,n){const{className:r,defaultValue:i=0,onValueChange:o,orientation:a="horizontal",render:s,value:l,style:u,...c}=t,f=t.defaultValue!==void 0,p=O.useRef([]),[h,v]=O.useState(()=>new Map),[y,x]=Pw({controlled:l,default:i,name:"Tabs",state:"value"}),g=l!==void 0,[m,b]=O.useState(()=>new Map),S=O.useRef(void 0),w=O.useCallback(X=>Rw(m,X),[m]),[P,j]=O.useState(()=>({previousValue:y,tabActivationDirection:"none"})),{previousValue:E,tabActivationDirection:A}=P;let C=A,T=!1;E!==y&&(C=$_(E,y,a,m),T=E!=null&&y!=null&&w(y)==null);const _=T?E:y,R=E!==_||A!==C;fe(()=>{R&&j({previousValue:_,tabActivationDirection:C})},[_,R,C]);const $=de((X,K)=>{const ee=$_(y,X,a,m);K.activationDirection=ee,o==null||o(X,K),!K.isCanceled&&x(X)}),N=de((X,K)=>{o==null||o(X,$e(K,void 0,void 0,{activationDirection:"none"}))}),I=de((X,K)=>(v(ee=>{const ie=new Map(ee);return ie.set(X,K),ie}),()=>{v(ee=>{if(ee.get(X)!==K)return ee;const ie=new Map(ee);return ie.delete(X),ie})})),B=O.useCallback(X=>h.get(X),[h]),k=O.useCallback(X=>{for(const K of m.values())if(X===K.value)return K.id},[m]),L=O.useMemo(()=>({getTabElementBySelectedValue:w,getTabIdByPanelValue:k,getTabPanelIdByValue:B,onValueChange:$,orientation:a,registerMountedTabPanel:I,setTabMap:b,tabActivationDirection:C,value:y}),[w,k,B,$,a,I,b,C,y]),M=O.useMemo(()=>{for(const X of m.values())if(X.value===y)return X},[m,y]),z=O.useMemo(()=>{for(const X of m.values())if(!X.disabled)return X.value},[m]),U=O.useRef(!f),V=O.useRef(i),W=O.useRef(f),Q=O.useRef(!1);fe(()=>{var H;if(g)return;function X(Z,J){x(Z),j({previousValue:Z,tabActivationDirection:"none"}),N(Z,J),U.current=!1}if(m.size===0){Q.current&&y!==null&&!((H=S.current)!=null&&H.isConnected)&&X(null,HT);return}Q.current=!0,S.current=m.keys().next().value;const K=M==null?void 0:M.disabled,ee=M==null&&y!==null;if(!K&&y===V.current&&(W.current=!1),W.current&&K&&y===V.current)return;const ie=U.current;if(K||ee){const Z=z??null;if(y===Z){U.current=!1;return}let J=HT;ie?J=VT:K&&(J=WD),X(Z,J);return}ie&&M!=null&&(N(y,VT),U.current=!1)},[z,g,N,M,x,m,y]);const le=tn("div",t,{state:{orientation:a,tabActivationDirection:C},ref:n,props:c,stateAttributesMapping:UO});return d.jsx(yF.Provider,{value:L,children:d.jsx(LO,{elementsRef:p,children:le})})});function Rw(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function $_(e,t,n,r){if(e==null||t==null)return"none";const[i,o,a]=n==="horizontal"?["left","left","right"]:["top","up","down"],s=Rw(r,e),l=Rw(r,t);if(s==null||l==null)return s!==l&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?a:o:"none";const u=s.getBoundingClientRect()[i],c=l.getBoundingClientRect()[i];return c<u?o:c>u?a:"none"}const zO="data-composite-item-active";function Qxe(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=pO(),{ref:i,index:o}=mF(e),a=n===o,s=O.useRef(null),l=Es(i,s);return{compositeProps:{tabIndex:a?0:-1,onFocus(){r(o)},onMouseMove(){const c=s.current;if(!t||!c)return;const f=c.hasAttribute("disabled")||c.ariaDisabled==="true";!a&&!f&&c.focus()}},compositeRef:l,index:o}}const xF=O.createContext(void 0);function Jxe(){const e=O.useContext(xF);if(e===void 0)throw new Error(gn(65));return e}const Zxe=O.forwardRef(function(t,n){const{className:r,disabled:i=!1,render:o,value:a,id:s,nativeButton:l=!0,style:u,...c}=t,{value:f,getTabPanelIdByValue:p,onValueChange:h,orientation:v,tabActivationDirection:y}=vF(),{activateOnFocus:x,registerTabResizeObserverElement:g,tabsListElement:m}=Jxe(),{highlightedIndex:b,onHighlightedIndexChange:S}=pO(),w=Yu(s),P=O.useMemo(()=>({disabled:i,id:w,value:a}),[i,w,a]),{compositeProps:j,compositeRef:E,index:A}=Qxe({metadata:P}),C=a===f,T=O.useRef(!1),_=O.useRef(null),R=de(Q=>{var G;(G=_.current)==null||G.call(_),_.current=Q?g(Q):null});fe(()=>{if(T.current){T.current=!1;return}if(!(C&&A>-1&&b!==A))return;const Q=m;if(Q!=null){const G=Mn(He(Q));if(G&&xe(Q,G))return}i||S(A)},[C,A,b,S,i,m]);const{getButtonProps:$,buttonRef:N}=hO({disabled:i,native:l,focusableWhenDisabled:!0}),I=p(a),B=O.useRef(!1),k=O.useRef(!1);function L(Q){h(a,$e(ha,Q.nativeEvent,void 0,{activationDirection:"none"}))}function M(Q){C||i||L(Q)}function z(Q){C||i||x&&(!B.current||k.current)&&L(Q)}function U(Q){if(C||i)return;B.current=!0,k.current=Q.button===0;const G=He(Q.currentTarget);function le(){B.current=!1,k.current=!1,G.removeEventListener("pointerup",le),G.removeEventListener("pointercancel",le)}G.addEventListener("pointerup",le),G.addEventListener("pointercancel",le)}return tn("button",t,{state:{disabled:i,active:C,orientation:v,tabActivationDirection:y},ref:[n,N,E,R],props:[j,{role:"tab","aria-controls":I,"aria-selected":C,id:w,onClick:M,onFocus:z,onPointerDown:U,[zO]:C?"":void 0,onKeyDownCapture(){T.current=!0}},c,$],stateAttributesMapping:UO})});function ebe(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:i,direction:o,highlightedIndex:a,onHighlightedIndexChange:s,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:c,disabledIndices:f,modifierKeys:p=da}=e,[h,v]=O.useState(0),y=r!=null,x=O.useRef(null),g=Es(x,l),m=O.useRef([]),b=O.useRef(!1),S=O.useRef(null),w=a??h,P=de((T,_=!1)=>{if(S.current=m.current[T]??null,(s??v)(T),_){const R=m.current[T];x_(x.current,R,o,n)}}),j=de(T=>{var N;if(T.size===0)return;if(b.current){const I=m.current,B=I.indexOf(S.current);if(B===-1){const k=I[w];!k||Pl(I,w,f)?P(tbe(I,f)):S.current=k}else B!==w&&P(B);return}b.current=!0;const _=Array.from(T.keys()),R=_.find(I=>I==null?void 0:I.hasAttribute(zO))??null,$=R?((N=T.get(R))==null?void 0:N.index)??-1:-1;if($!==-1)P($);else if(Pl(_,w,f)){const I=Ki(_,{disabledIndices:f});ef(_,I)||P(I)}x_(x.current,R,o,n)});fe(()=>{if(f==null||a!=null||!b.current)return;const T=m.current;if(Pl(T,w,f)){const _=Ki(T,{disabledIndices:f});ef(T,_)||P(_)}},[f,a,w,m,P]);const E=de((T,_,R)=>i?i(T,_,R,m):R),A=de(T=>{const _=T.key===Sw||T.key===Ow;if(!MO.has(T.key)||!u&&_||nbe(T,p)||!x.current)return;const $=o==="rtl",N=$?bw:ww,I=$?ww:bw,B=n==="vertical"?xw:N,k=n==="vertical"?vw:I,L=cn(T.nativeEvent);if(L!=null&&v_(L)&&!YL(L)){const Q=L.selectionStart,G=L.selectionEnd,le=L.value;if(Q==null||T.shiftKey||Q!==G||T.key!==k&&Q<le.length||T.key!==B&&Q>0)return}let M=w;const z=rh(m,f),U=pw(m,f);r!=null&&(M=r({disabledIndices:f,elementsRef:m,event:T,highlightedIndex:w,loopFocus:t,maxIndex:U,minIndex:z,onLoop:E,orientation:n,rtl:$}));const V=n!=="vertical"&&T.key===N||n!=="horizontal"&&T.key===xw,W=n!=="vertical"&&T.key===I||n!=="horizontal"&&T.key===vw;u&&(T.key===Sw?M=z:T.key===Ow&&(M=U)),M===w&&(V||W)&&(t&&M===U&&V?(M=z,i&&(M=i(T,w,M,m))):t&&M===z&&W?(M=U,i&&(M=i(T,w,M,m))):M=Ki(m.current,{startingIndex:M,decrement:W,disabledIndices:f})),M!==w&&!ef(m.current,M)&&(c&&T.stopPropagation(),(y||_||V||W)&&T.preventDefault(),P(M,!0),queueMicrotask(()=>{var Q;(Q=m.current[M])==null||Q.focus()}))});return{props:{ref:g,onFocus(T){const _=x.current,R=cn(T.nativeEvent);!_||R==null||!v_(R)||R.setSelectionRange(0,R.value.length)},onKeyDown:A},highlightedIndex:w,onHighlightedIndexChange:P,elementsRef:m,onMapChange:j,relayKeyboardEvent:A}}function tbe(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const i=e[r];if(!(!i||Pl(e,r,t))){if(i.hasAttribute(zO))return r;n===-1&&(n=r)}}return Math.max(n,0)}function nbe(e,t){for(const n of rve)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function rbe(e){const{render:t,className:n,style:r,refs:i=da,props:o=da,state:a=$t,stateAttributesMapping:s,highlightedIndex:l,onHighlightedIndexChange:u,orientation:c,grid:f,loopFocus:p,onLoop:h,enableHomeAndEndKeys:v,onMapChange:y,stopEventPropagation:x=!0,rootRef:g,disabledIndices:m,modifierKeys:b,highlightItemOnHover:S=!1,tag:w="div",...P}=e,j=FO(),{props:E,highlightedIndex:A,onHighlightedIndexChange:C,elementsRef:T,onMapChange:_,relayKeyboardEvent:R}=ebe({grid:f,loopFocus:p,onLoop:h,orientation:c,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:g,stopEventPropagation:x,enableHomeAndEndKeys:v,direction:j,disabledIndices:m,modifierKeys:b}),$=tn(w,e,{state:a,ref:i,props:[E,...o,P],stateAttributesMapping:s}),N=O.useMemo(()=>({highlightedIndex:A,onHighlightedIndexChange:C,highlightItemOnHover:S,relayKeyboardEvent:R}),[A,C,S,R]);return d.jsx(VD.Provider,{value:N,children:d.jsx(LO,{elementsRef:T,onMapChange:I=>{y==null||y(I),_(I)},children:$})})}const ibe=O.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:i,loopFocus:o=!0,render:a,style:s,...l}=t,{orientation:u,setTabMap:c,tabActivationDirection:f}=vF(),[p,h]=O.useState(0),[v,y]=O.useState(null),x=O.useRef(new Set),g=O.useRef(new Set),m=O.useRef(null);fe(()=>{if(typeof ResizeObserver>"u")return;const E=new ResizeObserver(()=>{x.current.forEach(A=>{A()})});return m.current=E,v&&E.observe(v),g.current.forEach(A=>{E.observe(A)}),()=>{E.disconnect(),m.current=null}},[v]);const b=de(E=>(x.current.add(E),()=>{x.current.delete(E)})),S=de(E=>{var A;return g.current.add(E),(A=m.current)==null||A.observe(E),()=>{var C;g.current.delete(E),(C=m.current)==null||C.unobserve(E)}}),w={orientation:u,tabActivationDirection:f},P={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},j=O.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:b,registerTabResizeObserverElement:S,tabsListElement:v}),[r,b,S,v]);return d.jsx(xF.Provider,{value:j,children:d.jsx(rbe,{render:a,className:i,style:s,state:w,refs:[n,y],props:[P,l],stateAttributesMapping:UO,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:o,orientation:u,onHighlightedIndexChange:h,onMapChange:c,disabledIndices:da})})}),obe=Yxe,abe=O.forwardRef(function({className:t,...n},r){return d.jsx(ibe,{ref:r,className:gt("flex flex-wrap gap-1 border-b border-line pb-2",t),...n})}),sbe=O.forwardRef(function({className:t,...n},r){return d.jsx(Zxe,{ref:r,className:gt("flex items-baseline gap-1.5 rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-panel hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[active]:bg-panel-2 data-[active]:text-foreground",t),...n})}),bF=O.createContext(void 0);function Ly(e){const t=O.useContext(bF);if(t===void 0&&!e)throw new Error(gn(72));return t}const lbe={...UL,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,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class ube extends My{constructor(n,r,i){const o=new RO;super(cbe(n,o,r,i),fbe(o),lbe);Ze(this,"setOpen",(n,r)=>{Mye(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,$e(Nd,n))}}function cbe(e,t,n,r=!1){return{...FL(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 fbe(e){return{popupRef:O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const dbe=CO(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:o=!1,trackCursorAxis:a="none",actionsRef:s,onOpenChange:l,onOpenChangeComplete:u,handle:c,triggerId:f,defaultTriggerId:p=null,children:h}=t,v=NL((T,_)=>new ube({open:r,openProp:i,activeTriggerId:p,triggerIdProp:f},T,_));v.useControlledProp("openProp",i),v.useControlledProp("triggerIdProp",f),v.useContextCallback("onOpenChange",l),v.useContextCallback("onOpenChangeComplete",u);const y=v.useState("open"),x=!n&&y,g=v.useState("activeTriggerId"),m=v.useState("mounted"),b=v.useState("payload");v.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:o,disabled:n}),IL(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:S,transitionStatus:w}=DL(x,v),P=v.useState("isInstantPhase"),j=v.useState("instantType"),E=v.useState("lastOpenChangeReason"),A=O.useRef(null);fe(()=>{y&&n&&v.setOpen(!1,$e(WD))},[y,n,v]),fe(()=>{w==="ending"&&E===ha||w!=="ending"&&P?(j!=="delay"&&(A.current=j),v.set("instantType","delay")):A.current!==null&&(v.set("instantType",A.current),A.current=null)},[w,P,E,j,v]),fe(()=>{x&&g==null&&v.set("payload",void 0)},[v,g,x]),O.useImperativeHandle(s,()=>({unmount:S,close:()=>v.setOpen(!1,$e(KD))}),[S,v]);const C=x||m||!n&&a!=="none";return d.jsxs(bF.Provider,{value:v,children:[c&&d.jsx($L,{handle:c,store:v}),C&&d.jsx(pbe,{store:v,disabled:n,trackCursorAxis:a}),typeof h=="function"?h({payload:b}):h]})});function pbe({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),i=EO(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=hge(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),a=O.useMemo(()=>As(o.reference,i.reference),[o.reference,i.reference]);return LL(e,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??$t}),null}const wF=O.createContext(void 0);function hbe(){return O.useContext(wF)}const mbe=600,SF="data-base-ui-tooltip-trigger";function M_(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(Me(i))return i}}const t=e.target;return Me(t)?t:null}function gbe(e){let t=e;for(;t;){const n=t.closest(`[${SF}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Me(r.host)?r.host:null}return null}const ybe=bye(function(t,n){const{render:r,className:i,style:o,handle:a,payload:s,disabled:l,delay:u,closeOnClick:c=!0,closeDelay:f,id:p,...h}=t,v=Ly(!0),x=Fye(a)??v;if(!x)throw new Error(gn(82));const g=Yu(p),m=x.useState("isTriggerActive",g),b=x.useState("isOpenedByTrigger",g),S=x.useState("floatingRootContext"),w=O.useRef(null),P=f??0,{registerTrigger:j,isMountedByThisTrigger:E}=Iye(g,w,x,{payload:s,closeOnClick:c,closeDelay:P}),A=hbe(),{activeIdRef:C,delayRef:T,isInstantPhase:_,hasProvider:R}=$me(S,{open:b}),$=$O(S);x.useSyncedValue("isInstantPhase",_);const N=x.useState("disabled"),I=l??N,B=Rt(I),k=x.useState("trackCursorAxis"),L=x.useState("disableHoverablePopup"),M=O.useRef(!1),z=cr(),U=O.useRef(void 0);function V(){return R&&C.current!=null?0:u??A??mbe}function W(Z){const J=w.current;if(!J||!Z)return!1;const se=gbe(Z);return se!==null&&se!==J&&xe(J,se)}function Q(Z){const J=W(Z);return M.current=J,J&&($.openChangeTimeout.clear(),$.restTimeout.clear(),$.restTimeoutPending=!1,z.clear()),J}const G=Kye(S,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!L&&k!=="both"?eve():null,restMs:V,delay(){return f==null&&R?{close:Cs(T.current,"close")}:{close:P}},triggerElementRef:w,isActiveTrigger:m,isClosing:()=>x.select("transitionStatus")==="ending",shouldOpen(){return!M.current}}),le=Hye(S,{enabled:!I}).reference,X=Z=>{const J=M.current,se=M_(Z),we=Q(se),ae=w.current,be=ae&&se&&xe(ae,se);if(we&&x.select("open")&&x.select("lastOpenChangeReason")===Wn){x.setOpen(!1,$e(Wn,Z));return}if(J&&!we&&be&&!B.current&&!x.select("open")&&ae&&sa(U.current)){const ce=()=>{!M.current&&!B.current&&!x.select("open")&&x.setOpen(!0,$e(Wn,Z,ae))},Ee=V();Ee===0?(z.clear(),ce()):z.start(Ee,ce)}},K=x.useState("triggerProps",E);return tn("button",t,{state:{open:b},ref:[n,j,w],props:[G,le,E||k!=="none"?K:void 0,{onMouseOver(Z){X(Z.nativeEvent)},onFocus(Z){W(M_(Z.nativeEvent))&&Z.preventBaseUIHandler()},onMouseLeave(){M.current=!1,z.clear(),U.current=void 0},onPointerEnter(Z){U.current=Z.pointerType},onPointerDown(Z){U.current=Z.pointerType,x.set("closeOnClick",c),c&&!x.select("open")&&x.cancelPendingOpen(Z.nativeEvent)},onClick(Z){c&&!x.select("open")&&x.cancelPendingOpen(Z.nativeEvent)},id:g,[cw]:I?"":void 0,[SF]:I?void 0:""},h],stateAttributesMapping:UD})}),OF=O.createContext(void 0);function vbe(){const e=O.useContext(OF);if(e===void 0)throw new Error(gn(70));return e}const xbe=O.forwardRef(function(t,n){const{children:r,container:i,className:o,render:a,style:s,...l}=t,{node:u,subtree:c}=mL({container:i,ref:n,componentProps:t,elementProps:l});return!c&&!u?null:d.jsxs(O.Fragment,{children:[c,u&&po.createPortal(r,u)]})}),bbe=O.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Ly().useState("mounted")||r?d.jsx(OF.Provider,{value:r,children:d.jsx(xbe,{ref:n,...i})}):null}),PF=O.createContext(void 0);function wbe(){const e=O.useContext(PF);if(e===void 0)throw new Error(gn(71));return e}const Sbe=O.forwardRef(function(t,n){const{render:r,className:i,anchor:o,positionMethod:a="absolute",side:s="top",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:h=5,sticky:v=!1,disableAnchorTracking:y=!1,collisionAvoidance:x=ige,style:g,...m}=t,b=Ly(),S=vbe(),w=b.useState("open"),P=b.useState("mounted"),j=b.useState("trackCursorAxis"),E=b.useState("disableHoverablePopup"),A=b.useState("floatingRootContext"),C=b.useState("instantType"),T=b.useState("transitionStatus"),_=b.useState("adaptiveOrigin"),R=dF({anchor:o,positionMethod:a,floatingRootContext:A,mounted:P,side:s,sideOffset:u,align:l,alignOffset:c,collisionBoundary:f,collisionPadding:p,sticky:v,arrowPadding:h,disableAnchorTracking:y,keepMounted:S,collisionAvoidance:x,adaptiveOrigin:_}),$=O.useMemo(()=>({open:w,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:j!=="none"?"tracking-cursor":C}),[w,R.side,R.align,R.anchorHidden,j,C]),N=hF(t,$,{styles:R.positionerStyles,transitionStatus:T,props:m,refs:[n,b.useStateSetter("positionerElement")],hidden:!P,inert:!w||j==="both"||E});return d.jsx(PF.Provider,{value:R,children:N})}),Obe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,...a}=t,s=Ly(),{side:l,align:u}=wbe(),c=s.useState("open"),f=s.useState("instantType"),p=s.useState("transitionStatus"),h=s.useState("popupProps"),v=s.useState("floatingRootContext"),y=s.useState("disabled"),x=s.useState("closeDelay");$d({open:c,ref:s.context.popupRef,onComplete(){var S,w;c&&((w=(S=s.context).onOpenChangeComplete)==null||w.call(S,!0))}}),Vye(v,{enabled:!y,closeDelay:x});const g=s.useStateSetter("popupElement");return tn("div",t,{state:{open:c,side:l,align:u,instant:f,transitionStatus:p},ref:[n,s.context.popupRef,g],props:[_O,h,BO(p),a],stateAttributesMapping:zD})}),Pbe=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,o=O.useMemo(()=>({open:n,close:r}),[n,r]);return d.jsx(wF.Provider,{value:n,children:d.jsx(Nme,{delay:o,timeoutMs:i,children:t.children})})},jbe=Pbe,HO=dbe,VO=ybe,WO=O.forwardRef(function({className:t,side:n="top",sideOffset:r=6,...i},o){return d.jsx(bbe,{children:d.jsx(Sbe,{side:n,sideOffset:r,className:"z-50",children:d.jsx(Obe,{ref:o,className:gt("max-w-xs rounded border border-line bg-popover px-2 py-1 text-[11px] leading-snug text-popover-foreground shadow-lg font-mono",t),...i})})})}),Ebe=new Set(["get","set","delete","clear"]);function Abe(e){if(typeof e!="object"||e===null||!("operation"in e)||!("hit"in e)||!("key"in e))return!1;const{operation:t,hit:n,key:r}=e;return typeof t!="string"||!Ebe.has(t)||n!==null&&typeof n!="boolean"?!1:typeof r=="string"}function Ec(e,t){return{label:e,variant:t,className:GS({variant:t})}}function Cbe(e){if(!Abe(e))return null;const t=typeof e.tier=="string"?` ${e.tier.toUpperCase()}`:"";if(e.operation==="set")return Ec(`SET${t}`,"muted");if(e.operation==="delete")return Ec("DEL","muted");if(e.operation==="clear")return Ec("CLEAR","muted");if(e.hit===!0){const n=e.stale===!0;return Ec(`${n?"HIT·STALE":"HIT"}${t}`,n?"warn":"good")}return e.hit===!1?Ec(`MISS${t}`,"warn"):null}function jF({content:e}){const t=Cbe(e);return t===null?null:d.jsx(XS,{variant:t.variant,children:t.label})}function Tbe(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.component!="string")return null;const n=typeof t.props=="object"&&t.props!==null?t.props:{},r=typeof n.deferred=="object"&&n.deferred!==null?n.deferred:{};return{isPartial:t.isPartial===!0,versionMismatch:t.versionMismatch===!0,pageBytes:typeof t.pageBytes=="number"?t.pageBytes:0,deferred:r}}function Lp(e,t){return{label:e,variant:t,className:GS({variant:t})}}function EF(e){if(!Number.isFinite(e)||e<=0)return"0 B";if(e<1024)return`${e} B`;const t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}function _be(e){const t=Tbe(e);if(t===null)return[];const n=[];return t.versionMismatch&&n.push(Lp("409","bad")),t.isPartial&&n.push(Lp("partial","warn")),Object.keys(t.deferred).length>0&&n.push(Lp("deferred","brand")),n.push(Lp(EF(t.pageBytes),"muted")),n}function AF({content:e}){const t=_be(e);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center gap-1",children:t.map(n=>d.jsx(XS,{variant:n.variant,children:n.label},n.label))})}const Eu="user:";function CF(e){for(const t of e)if(t.startsWith(Eu)&&t.length>Eu.length)return t;return null}function KO(e){return e.slice(Eu.length)}function TF(e){return`#/entries?tag=${encodeURIComponent(e)}`}const Rbe=Eu;function kbe(e){return e.startsWith(Eu)&&e.length>Eu.length}function Zm(e){const t=e.content;if(typeof t=="object"&&t!==null){const n=t;if(typeof n.uri=="string")return typeof n.method=="string"?`${n.method} ${n.uri}`:n.uri;if(typeof n.sql=="string")return n.sql;if(typeof n.queue=="string"&&typeof n.name=="string")return`${n.queue}:${n.name}`;if(e.type==="dump")return typeof n.label=="string"&&n.label.length>0?n.label:$be(n.value);if(e.type==="event"&&typeof n.name=="string")return n.name;if(e.type==="model"&&typeof n.action=="string"){const r=typeof n.entity=="string"?n.entity:"",i=n.id===null||n.id===void 0?"":`#${String(n.id)}`;return`${n.action} ${r}${i}`}if(e.type==="redis"&&typeof n.command=="string")return`${n.command} ${Nbe(n.args)}`.trim();if(e.type==="inertia"&&typeof n.component=="string"){const r=typeof n.method=="string"?n.method:"",i=n.isPartial===!0?" (partial)":"";return`${r} → ${n.component}${i}`.trim()}if(e.type==="log"&&typeof n.message=="string")return`[${typeof n.level=="string"?n.level:"log"}] ${n.message}`;if(typeof n.message=="string")return n.message;if(typeof n.url=="string")return typeof n.method=="string"?`${n.method} ${n.url}`:n.url}return e.type}function Nbe(e){if(!Array.isArray(e)||e.length===0)return"";const t=e.map(n=>typeof n=="string"?n:String(n)).join(" ");return t.length>60?`${t.slice(0,60)}…`:t}function $be(e){if(typeof e=="string")return e;let t;try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>80?`${t.slice(0,80)}…`:t}function _F({entries:e,onSelect:t}){return d.jsxs(Md,{className:"text-left",children:[d.jsx(Id,{children:d.jsxs(kr,{children:[d.jsx(Ge,{className:"px-0 py-2",children:"Time"}),d.jsx(Ge,{className:"px-0",children:"Type"}),d.jsx(Ge,{className:"px-0",children:"Summary"}),d.jsx(Ge,{className:"px-0",children:"Duration"}),d.jsx(Ge,{className:"px-0",children:"Tags"})]})}),d.jsx(Dd,{children:e.map(n=>{const r=CF(n.tags),i=n.tags.filter(o=>o!==r);return d.jsxs(kr,{onClick:()=>t==null?void 0:t(n.id),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(t==null||t(n.id))},className:"cursor-pointer hover:bg-panel",children:[d.jsx(nt,{className:"px-0 py-1.5 align-middle text-muted-foreground",children:new Date(n.createdAt).toLocaleTimeString()}),d.jsx(nt,{className:"px-0 py-1.5 align-middle text-brand",children:n.type}),d.jsx(nt,{className:"max-w-md truncate px-0 py-1.5 align-middle text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.type==="cache"?d.jsx(jF,{content:n.content}):null,n.type==="inertia"?d.jsx(AF,{content:n.content}):null,d.jsx("span",{className:"truncate",children:Zm(n)})]})}),d.jsx(nt,{className:"px-0 py-1.5 align-middle text-muted-foreground",children:n.durationMs!=null?`${n.durationMs}ms`:"—"}),d.jsx(nt,{className:"px-0 py-1.5 align-middle text-muted-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.traceId!==null&&d.jsxs("a",{href:`#/traces/${n.traceId}`,title:`View trace ${n.traceId}`,onClick:o=>o.stopPropagation(),className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-brand hover:bg-panel-2",children:["trace:",n.traceId.slice(0,6)]}),r!==null&&d.jsx("a",{href:TF(r),title:`View all activity for user ${KO(r)}`,onClick:o=>o.stopPropagation(),className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-good hover:bg-panel-2",children:r}),i.length>0&&d.jsx("span",{children:i.join(" ")})]})})]},n.id)})})]})}function Mbe({batch:e,currentId:t,onSelect:n}){return d.jsx("ol",{className:"space-y-1",children:[...e].sort((r,i)=>r.sequence-i.sequence).map(r=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n(r.id),className:`flex w-full justify-between gap-4 px-2 py-1 text-left text-xs ${r.id===t?"bg-panel-2 text-brand":"text-muted-foreground hover:bg-panel"}`,children:[d.jsxs("span",{children:[d.jsx("span",{className:"text-brand",children:r.type})," ",Zm(r)]}),d.jsx("span",{className:"text-muted-foreground",children:r.durationMs!=null?`${r.durationMs}ms`:""})]})},r.id))})}const Ibe={request:"bg-sky-500",query:"bg-amber-500",http_client:"bg-violet-500",job:"bg-emerald-500",cache:"bg-teal-500",exception:"bg-rose-500",event:"bg-indigo-500",log:"bg-zinc-500",mail:"bg-pink-500",redis:"bg-red-500"};function Dbe(e){return Ibe[e]??"bg-zinc-600"}function sh(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function Lbe(e){const t=[],n=r=>{for(const i of r)t.push(i),i.children.length>0&&n(i.children)};return n(e),t}function Fbe({span:e,totalDurationMs:t,onSelect:n}){const r=t>0?t:1,i=Math.min(100,e.offsetMs/r*100),o=Math.max(.5,Math.min(100-i,e.durationMs/r*100));return d.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n(e.id),"data-testid":"waterfall-row",className:"flex w-full items-center gap-2 rounded px-1 py-0.5 text-left text-[11px] hover:bg-panel-2",children:[d.jsxs("span",{className:"min-w-0 flex-shrink-0 truncate font-mono text-foreground",style:{width:"40%",paddingLeft:`${e.depth*12}px`},title:e.label,children:[d.jsx("span",{className:"mr-1 text-muted-foreground",children:e.type}),e.label]}),d.jsx("span",{className:"relative h-3 flex-1 rounded bg-panel",children:d.jsx("span",{className:`absolute top-0 h-3 rounded ${Dbe(e.type)}`,style:{left:`${i}%`,width:`${o}%`},title:`${sh(e.offsetMs)} +${sh(e.durationMs)}`})}),d.jsx("span",{className:"w-16 flex-shrink-0 text-right tabular-nums text-muted-foreground",children:sh(e.durationMs)})]})}function Bbe({waterfall:e,onSelect:t}){const n=Lbe(e.spans);return n.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No spans in this trace"}):d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{className:"mb-1 flex items-center justify-between text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx("span",{children:"Span"}),d.jsxs("span",{children:["Total ",sh(e.totalDurationMs)]})]}),n.map(r=>d.jsx(Fbe,{span:r,totalDurationMs:e.totalDurationMs,onSelect:t},r.id))]})}function Ube(e,t=.002){const n=e.totalMs>0?e.totalMs:1,r=[],i=(o,a,s,l,u)=>{if(l<t)return;r.push({key:u,node:o,depth:a,x:s,width:l});const c=[...o.children].sort((p,h)=>h.totalMs-p.totalMs);let f=s;for(let p=0;p<c.length;p++){const h=c[p];if(h===void 0)continue;const v=h.totalMs/n*1;i(h,a+1,f,v,`${u}.${p}`),f+=v}};return i(e,0,0,1,"0"),r}function zbe(e){return e.reduce((t,n)=>Math.max(t,n.depth),0)+1}function Hbe(e){let t=0;for(let o=0;o<e.length;o++)t=t*31+e.charCodeAt(o)|0;const n=Math.abs(t)%46,r=55+Math.abs(t>>8)%25,i=45+Math.abs(t>>16)%12;return`hsl(${n}, ${r}%, ${i}%)`}function fd(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}const ux=18;function Vbe({tree:e}){const[t,n]=O.useState("0"),r=O.useMemo(()=>Ube(e),[e]),i=zbe(r),o=r.find(f=>f.key===t)??r[0],a=(o==null?void 0:o.x)??0,s=(o==null?void 0:o.width)??1,l=(o==null?void 0:o.depth)??0;if(e.totalMs<=0||r.length===0)return d.jsx("div",{className:"flex h-24 items-center justify-center rounded-lg border border-line bg-panel/40 text-xs text-muted-foreground",children:"No samples — the capture was empty."});const u=r.filter(f=>f.key===t||f.key.startsWith(`${t}.`)),c=i-l;return d.jsxs("div",{children:[t!=="0"&&d.jsx("button",{type:"button",onClick:()=>n("0"),className:"mb-2 rounded border border-line px-2 py-0.5 text-[10px] text-foreground hover:bg-panel-2",children:"← Reset zoom"}),d.jsx("div",{"data-testid":"flamegraph",className:"relative w-full overflow-hidden rounded-lg border border-line bg-background",style:{height:c*ux+2},children:u.map(f=>{const p=(f.x-a)/s*100,h=f.width/s*100,v=(f.depth-l)*ux,y=(f.node.totalMs/e.totalMs*100).toFixed(1);return d.jsx("button",{type:"button",onClick:()=>n(f.key),title:`${f.node.name}${f.node.file?` — ${f.node.file}`:""}
154
+ */var $y=O,cye=Ny;function fye(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dye=typeof Object.is=="function"?Object.is:fye,pye=cye.useSyncExternalStore,hye=$y.useRef,mye=$y.useEffect,gye=$y.useMemo,yye=$y.useDebugValue;TL.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=hye(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=gye(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var v=a.value;if(i(v,h))return f=v}return f=h}if(v=f,dye(c,h))return v;var y=r(h);return i!==void 0&&i(v,y)?(c=h,v):(c=h,f=y)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var s=pye(e,o[0],o[1]);return mye(function(){a.hasValue=!0,a.value=s},[s]),yye(s),s};CL.exports=TL;var _L=CL.exports;const gw=[];let yw;function vye(){return yw}function xye(e){gw.push(e)}function CO(e){const t=(n,r)=>{const i=Fn(wye).current;let o;try{yw=i;for(const a of gw)a.before(i);o=e(n,r);for(const a of gw)a.after(i);i.didInitialize=!0}finally{yw=void 0}return o};return t.displayName=e.displayName||e.name,t}function bye(e){return O.forwardRef(CO(e))}function wye(){return{didInitialize:!1}}const Sye=oO(19),Oye=Sye?jye:Eye;function RL(e,t,n,r,i){return Oye(e,t,n,r,i)}function Pye(e,t,n,r,i){const o=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return Ny.useSyncExternalStore(e.subscribe,o,o)}xye({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){const 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=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),Ny.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function jye(e,t,n,r,i){const o=vye();if(!o)return Pye(e,t,n,r,i);const a=o.syncIndex;o.syncIndex+=1;let s;return o.didInitialize?(s=o.syncHooks[a],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(o.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)},o.syncHooks.push(s)),s.value}function Eye(e,t,n,r,i){return _L.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,i))}class Aye{constructor(t){Ze(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ze(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return RL(this,t,n,r,i)}}class My extends Aye{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){O.useDebugValue(t);const r=this;fe(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;fe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);fe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){O.useDebugValue(t);const r=this,i=n!==void 0;fe(()=>{i&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,i])}select(t,n,r,i){const o=this.selectors[t];return o(this.state,n,r,i)}useState(t,n,r,i){return O.useDebugValue(t),RL(this,this.selectors[t],n,r,i)}useContextCallback(t,n){O.useDebugValue(t);const r=de(n??Ot);this.context[t]=r}useStateSetter(t){const n=O.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(o=>{const a=r(o);if(!Object.is(i,a)){const s=i;i=a,n(a,s,this)}})}}const Cye={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};class TO extends My{constructor(n){const{syncOnly:r,nested:i,onOpenChange:o,triggerElements:a,...s}=n;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:sge(),nested:i,triggerElements:a},Cye);Ze(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&Eme(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});Ze(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const i={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",i)});Ze(this,"setOpen",(n,r)=>{var i,o,a,s;if(this.syncOnly){(o=(i=this.context).onOpenChange)==null||o.call(i,n,r);return}this.dispatchOpenChange(n,r),(s=(a=this.context).onOpenChange)==null||s.call(a,n,r)});this.syncOnly=r}}function Tye(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:o,onOpenChange:a}=e,s=t.useState("open"),l=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),c=t.context.triggerElements,f=a,p=O.useRef(null);r===void 0&&p.current===null&&(p.current=new TO({open:s,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:c,onOpenChange:f,floatingId:i,syncOnly:!0,nested:o}));const h=r??p.current;return t.useSyncedValue("floatingId",i),fe(()=>{const v={open:s,floatingId:i,referenceElement:l,floatingElement:u};Me(l)&&(v.domReferenceElement=l),h.state.positionReference===h.state.referenceElement&&(v.positionReference=l),h.update(v)},[s,i,l,u,h]),h.context.onOpenChange=f,h.context.nested=o,h}function kL(e,t=!1,n=!1,r=!1){const[i,o]=O.useState(e&&t?"idle":void 0),[a,s]=O.useState(e&&!r);return e&&!a&&(s(!0),o("starting")),!e&&a&&i!=="ending"&&!n&&o("ending"),!e&&!a&&i==="ending"&&o(void 0),fe(()=>{if(!e&&a&&i!=="ending"&&n){const l=fi.request(()=>{o("ending")});return()=>{fi.cancel(l)}}},[e,a,i,n]),fe(()=>{if(!e||t)return;const l=fi.request(()=>{o(void 0)});return()=>{fi.cancel(l)}},[t,e]),fe(()=>{if(!e||!t)return;e&&a&&i!=="idle"&&o("starting");const l=fi.request(()=>{o("idle")});return()=>{fi.cancel(l)}},[t,e,a,i]),{mounted:a,setMounted:s,transitionStatus:i}}let Cp=null;function _ye(e){if(!Cp){const t=[];Cp=t,queueMicrotask(()=>{Cp=null,po.flushSync(()=>{for(const n of t)n()})})}Cp.push(e)}function Rye(e,t=!1,n=!1){const r=Ou();return de((i,o=null)=>{r.cancel();const a=ki(e);if(a==null)return;const s=a,l=()=>{if(!n){po.flushSync(i);return}_ye(()=>{o!=null&&o.aborted||i()})};if(typeof s.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function u(){Promise.all(s.getAnimations().map(c=>c.finished)).then(()=>{o!=null&&o.aborted||l()},()=>{if(o!=null&&o.aborted)return;if(s.getAnimations().some(f=>f.pending||f.playState!=="finished")){u();return}l()})}if(t){const c=FD;if(!s.hasAttribute(c)){r.request(u);return}const f=new MutationObserver(()=>{s.hasAttribute(c)||(f.disconnect(),u())});f.observe(s,{attributes:!0,attributeFilter:[c]}),o==null||o.addEventListener("abort",()=>f.disconnect(),{once:!0});return}r.request(u)})}function $d(e){const{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:o}=e,a=de(o),s=Rye(r,n,i);O.useEffect(()=>{if(!t)return;const l=new AbortController;return s(a,l.signal),()=>{l.abort()}},[t,n,a,s])}const _O={tabIndex:-1,[uw]:""};function kye(e){return t=>t==="touch"?e.current:!0}function NL(e,t=!1){const n=Sy(),r=Ry()!=null,i=Fn(()=>e(n,r)).current;return Tye({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function $L({handle:e,store:t}){return fe(()=>e.attachStore(t),[e,t]),null}function h_(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function Nye(e,t){const n=O.useRef(null);return de(r=>{const i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;const o=i.store;o.context.triggerElements.getById(i.id)===i.element&&(o.context.triggerElements.delete(i.id),h_(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),h_(t))})}function ML(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);const o=(n==null?void 0:n.id)??null;let a=e.activeTriggerId,s=e.activeTriggerElement;return(o||t)&&(a=o,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:a,activeTriggerElement:s}}function $ye(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Mye(e,t,n,r={}){var c,f,p;const i=n.reason,o=i===Wn,a=t&&i===nh,s=!t&&(i===Nd||i===gO),l=$ye(n);if((f=(c=e.context).onOpenChange)==null||f.call(c,t,n),n.isCanceled)return;(p=r.onBeforeDispatch)==null||p.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const h=ML(e.state,t,n.trigger,l()),v={...r.extraState,...h};a?v.instantType="focus":s?v.instantType="dismiss":o&&(v.instantType=void 0),e.update(v)};o?po.flushSync(u):u()}function Iye(e,t,n,r){const i=n.useState("isMountedByTrigger",e),o=Nye(e,n),a=de(l=>{const u=n.select("open"),c=n.select("activeTriggerId");if(c===e){const f={activeTriggerElement:l,...u?r:null};n.update(f);return}if(c==null&&u){const f={activeTriggerId:e??null,activeTriggerElement:l,...r};n.update(f)}}),s=de(l=>{o(l),l&&a(l)});return fe(()=>(s(t.current),()=>s(null)),[s,t,n,e]),fe(()=>{if(i){const l={activeTriggerElement:t.current,...r};n.update(l)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function IL(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),i=e.useState("open"),o=e.useState("triggerCount"),a=e.useState("activeTriggerId"),s=e.useState("activeTriggerElement");fe(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const l=e.context.triggerElements.size,u={};e.state.triggerCount!==l&&(u.triggerCount=l);const c=e.select("activeTriggerId");let f=null;if(c){const p=e.context.triggerElements.getById(c);if(p)r.current=c,p!==e.state.activeTriggerElement&&(u.activeTriggerElement=p);else{for(const[h,v]of e.context.triggerElements.entries())if(v===e.state.activeTriggerElement){u.activeTriggerId=h,u.activeTriggerElement=v,r.current=h;break}u.activeTriggerId===void 0&&(r.current===c?f=c:r.current=null)}}else r.current=null;if(!f&&!c&&l===1){const p=e.context.triggerElements.entries().next();if(!p.done){const[h,v]=p.value;u.activeTriggerId=h,u.activeTriggerElement=v,r.current=h}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const p=$e(ha);e.setOpen(!1,p),p.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,o,a,s,n])}function DL(e,t,n,r){const{mounted:i,setMounted:o,transitionStatus:a}=kL(e,!1,!1,r),s=t.useState("preventUnmountingOnClose"),l=e?!1:s;t.useSyncedValues({mounted:i,transitionStatus:a,preventUnmountingOnClose:l});const u=de(()=>{var c,f;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),(f=(c=t.context).onOpenChangeComplete)==null||f.call(c,!1)});return $d({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:a}}function LL(e,t){e.useSyncedValues(t),fe(()=>()=>{e.update({activeTriggerProps:$t,inactiveTriggerProps:$t,popupProps:$t})},[e])}function Dye(e,t){fe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),fe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class RO{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function FL(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new TO({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,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:$t,inactiveTriggerProps:$t,popupProps:$t}}const nf=e=>e.triggerIdProp??e.activeTriggerId,kO=e=>e.openProp??e.open,m_=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function BL(e,t){return t!==void 0&&kO(e)&&nf(e)===t}function Lye(e,t){return BL(e,t)?!0:t!==void 0&&kO(e)&&nf(e)==null&&e.triggerCount===1}const UL={open:kO,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:nf,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:m_,isTriggerActive:(e,t)=>t!==void 0&&nf(e)===t,isOpenedByTrigger:(e,t)=>BL(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nf(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Lye(e,t)?m_(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Fye(e){const t=O.useCallback(r=>e===void 0?Ot:e.subscribeStore(r),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return Ny.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function Bye(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Sy(),o=Ry()!=null,a=Fn(()=>new TO({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new RO,floatingId:i,syncOnly:!1,nested:o})).current;return fe(()=>{const s={open:t,floatingId:i};r.reference!==void 0&&(s.referenceElement=r.reference,s.domReferenceElement=Me(r.reference)?r.reference:null),r.floating!==void 0&&(s.floatingElement=r.floating),a.update(s)},[t,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=o,a}function Uye(e){return zye(e,e.rootContext)}function zye(e,t){const{nodeId:n,externalTree:r}=e,i=t.useState("referenceElement"),o=t.useState("floatingElement"),a=t.useState("domReferenceElement"),s=t.useState("open"),l=t.useState("floatingId"),[u,c]=O.useState(null),[f,p]=O.useState(void 0),[h,v]=O.useState(void 0),y=O.useRef(null),x=Qu(r),g=O.useMemo(()=>({reference:i,floating:o,domReference:a}),[i,o,a]),m=Xge({...e,elements:{...g,...u&&{reference:u}}}),b=Me(f)?f:null,S=h===void 0?t.state.floatingElement:h;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?a:b),t.useSyncedValue("floatingElement",S);const w=O.useCallback(T=>{const _=Me(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;c(_),m.refs.setReference(_)},[m.refs]),P=O.useCallback(T=>{(Me(T)||T===null)&&(y.current=T,p(T)),(Me(m.refs.reference.current)||m.refs.reference.current===null||T!==null&&!Me(T))&&m.refs.setReference(T)},[m.refs,p]),j=O.useCallback(T=>{v(T),m.refs.setFloating(T)},[m.refs]),E=O.useMemo(()=>({...m.refs,setReference:P,setFloating:j,setPositionReference:w,domReference:y}),[m.refs,P,j,w]),A=O.useMemo(()=>({...m.elements,domReference:a}),[m.elements,a]),C=O.useMemo(()=>({...m,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:E,elements:A,nodeId:n,rootStore:t}),[m,E,A,n,t,s,l]);return fe(()=>{a&&(y.current=a)},[a]),fe(()=>{t.context.dataRef.current.floatingContext=C;const T=x==null?void 0:x.nodesRef.current.find(_=>_.id===n);T&&(T.context=C)}),O.useMemo(()=>({...m,context:C,refs:E,elements:A,rootStore:t}),[m,E,A,C,t])}const sx=qD&&Oo;function Hye(e,t={}){const{enabled:n=!0,delay:r}=t,i="rootStore"in e?e.rootStore:e,{events:o,dataRef:a}=i.context,s=O.useRef(!1),l=O.useRef(null),u=O.useRef(!0),c=cr();O.useEffect(()=>{const p=i.select("domReferenceElement");if(!n)return;const h=ct(p);function v(){const g=i.select("domReferenceElement");!i.select("open")&&it(g)&&g===Mn(He(g))&&(s.current=!0,l.current=g)}function y(){u.current=!0}function x(){u.current=!1}return wi(Ne(h,"blur",v),sx&&Ne(h,"keydown",y,!0),sx&&Ne(h,"pointerdown",x,!0))},[i,n]),O.useEffect(()=>{if(!n)return;function p(h){if(h.reason===Nd||h.reason===gO){const v=i.select("domReferenceElement");Me(v)&&(l.current=v,s.current=!0)}}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,n,i]);const f=O.useMemo(()=>{function p(){s.current=!1,l.current=null}return{onMouseLeave(){p()},onFocus(h){const v=h.currentTarget;if(s.current){if(l.current===v)return;p()}const y=cn(h.nativeEvent);if(Me(y)){if(sx&&!h.relatedTarget){if(!u.current&&!Cy(y))return}else if(!Tme(y))return}const x=Vm(h.relatedTarget,i.context.triggerElements),{nativeEvent:g,currentTarget:m}=h,b=typeof r=="function"?r():r;if(i.select("open")&&x||b===0||b===void 0){i.setOpen(!0,$e(nh,g,m));return}c.start(b,()=>{s.current||i.setOpen(!0,$e(nh,g,m))})},onBlur(h){p();const v=h.relatedTarget,y=h.nativeEvent,x=Me(v)&&v.hasAttribute(cd("focus-guard"))&&v.getAttribute("data-type")==="outside";c.start(0,()=>{var S;const g=i.select("domReferenceElement"),m=Mn(He(g));!v&&m===g||xe((S=a.current.floatingContext)==null?void 0:S.refs.floating.current,m)||xe(g,m)||x||Vm(v??m,i.context.triggerElements)||i.setOpen(!1,$e(nh,y))})}}},[a,r,i,c]);return O.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}class NO{constructor(){Ze(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Ze(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Jr,this.restTimeout=new Jr,this.handleCloseOptions=void 0}static create(){return new NO}}const Ym=new WeakMap;function Qm(e){var n,r,i;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ym.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty("pointer-events"),Ym.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function zL(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t,o=Ym.get(n);o&&o!==e&&Qm(o),Qm(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ym.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function $O(e){const t=e.context.dataRef.current,n=Fn(()=>t.hoverInteractionState??NO.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),yO(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Vye(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,o="rootStore"in e?e.rootStore:e,a=o.useState("open"),s=o.useState("floatingElement"),l=o.useState("domReferenceElement"),{dataRef:u}=o.context,c=Qu(),f=Ry(),p=$O(o),h=cr(),v=de(()=>{var g;return YD((g=u.current.openEvent)==null?void 0:g.type,p.interactedInside)}),y=de(()=>{var g;return Rme((g=u.current.openEvent)==null?void 0:g.type)}),x=de(()=>{Qm(p)});fe(()=>{a||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,x())},[a,p,x]),O.useEffect(()=>x,[x]),fe(()=>{var g,m,b,S,w;if(n&&a&&(g=p.handleCloseOptions)!=null&&g.blockPointerEvents&&y()&&Me(l)&&s){const P=l,j=s,E=He(s),A=(b=(m=c==null?void 0:c.nodesRef.current.find(R=>R.id===f))==null?void 0:m.context)==null?void 0:b.elements.floating;A&&(A.style.pointerEvents="");const C=p.pointerEventsScopeElement!==j?p.pointerEventsScopeElement:null,T=A!==j?A:null,_=((w=(S=p.handleCloseOptions)==null?void 0:S.getScope)==null?void 0:w.call(S))??C??T??P.closest("[data-rootownerid]")??E.body;return zL(p,{scopeElement:_,referenceElement:P,floatingElement:j}),()=>{x()}}},[n,a,l,s,p,y,c,f,x]),O.useEffect(()=>{if(!n)return;function g(){return!!(c&&f&&ga(c.nodesRef.current,f).length>0)}function m(E){const A=Cs(r,"close",p.pointerType),C=()=>{o.setOpen(!1,$e(Wn,E)),c==null||c.events.emit("floating.closed",E)};A?p.openChangeTimeout.start(A,C):(p.openChangeTimeout.clear(),C())}function b(E){const A=cn(E);if(!Cme(A)){p.interactedInside=!1;return}p.interactedInside=(A==null?void 0:A.closest("[aria-haspopup]"))!=null}function S(){p.openChangeTimeout.clear(),h.clear(),c==null||c.events.off("floating.closed",P),x()}function w(E){var _;if(g()&&c){c.events.on("floating.closed",P);return}if(Vm(E.relatedTarget,o.context.triggerElements))return;const A=((_=u.current.floatingContext)==null?void 0:_.nodeId)??i,C=E.relatedTarget;if(!(c&&A&&Me(C)&&ga(c.nodesRef.current,A,!1).some(R=>{var $;return xe(($=R.context)==null?void 0:$.elements.floating,C)}))){if(p.handler){p.handler(E);return}x(),y()&&!v()&&m(E)}}function P(E){!c||!f||g()||h.start(0,()=>{c.events.off("floating.closed",P),o.setOpen(!1,$e(Wn,E)),c.events.emit("floating.closed",E)})}const j=s;return wi(j&&Ne(j,"mouseenter",S),j&&Ne(j,"mouseleave",w),j&&Ne(j,"pointerdown",b,!0),()=>{c==null||c.events.off("floating.closed",P)})},[n,s,o,u,r,i,y,v,x,p,c,f,h])}const Wye={current:null};function Kye(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:o=!1,restMs:a=0,move:s=!0,triggerElementRef:l=Wye,externalTree:u,isActiveTrigger:c=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:h,guardStaleOpen:v=!1}=t,y="rootStore"in e?e.rootStore:e,{dataRef:x,events:g}=y.context,m=Qu(u),b=$O(y),S=O.useRef(!1),w=Rt(i),P=Rt(r),j=Rt(a),E=Rt(n),A=Rt(h),C=Rt(p),T=de(()=>{var I;return YD((I=x.current.openEvent)==null?void 0:I.type,b.interactedInside)}),_=de(()=>{var I;return((I=A.current)==null?void 0:I.call(A))!==!1}),R=de((I,B,k)=>{const L=y.context.triggerElements;if(L.hasElement(B))return!I||!xe(I,B);if(!Me(k))return!1;const M=k;return L.hasMatchingElement(z=>xe(z,M))&&(!I||!xe(I,M))}),$=de(()=>{if(!b.handler)return;He(y.select("domReferenceElement")).removeEventListener("mousemove",b.handler),b.handler=void 0}),N=de(()=>{Qm(b)});return c&&(b.handleCloseOptions=i==null?void 0:i.__options),O.useEffect(()=>$,[$]),O.useEffect(()=>{if(!n)return;function I(B){B.open?S.current=!1:(S.current=B.reason===Wn,$(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return g.on("openchange",I),()=>{g.off("openchange",I)}},[n,g,b,$]),O.useEffect(()=>{if(!n)return;function I(U,V=!0){const W=Cs(P.current,"close",b.pointerType);W?b.openChangeTimeout.start(W,()=>{y.setOpen(!1,$e(Wn,U)),m==null||m.events.emit("floating.closed",U)}):V&&(b.openChangeTimeout.clear(),y.setOpen(!1,$e(Wn,U)),m==null||m.events.emit("floating.closed",U))}const B=l.current??(c?y.select("domReferenceElement"):null);if(!Me(B))return;function k(U){var ae;if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,o&&!sa(b.pointerType))return;const V=GT(j.current),W=Cs(P.current,"open",b.pointerType),Q=cn(U),G=U.currentTarget??null,le=y.select("domReferenceElement");let X=G;if(Me(Q)&&!y.context.triggerElements.hasElement(Q)){for(const be of y.context.triggerElements.elements())if(xe(be,Q)){X=be;break}}Me(G)&&Me(le)&&!y.context.triggerElements.hasElement(G)&&xe(G,le)&&(X=le);const K=X==null?!1:R(le,X,Q),ee=y.select("open"),ie=((ae=C.current)==null?void 0:ae.call(C))??y.select("transitionStatus")==="ending",H=!ee&&ie&&S.current,Z=!K&&Me(X)&&Me(le)&&xe(le,X)&&H,J=V>0&&!W,se=K&&(ee||H)||Z,we=!ee||K;if(se){_()&&y.setOpen(!0,$e(Wn,U,X));return}J||(W?b.openChangeTimeout.start(W,()=>{we&&_()&&y.setOpen(!0,$e(Wn,U,X))}):we&&_()&&y.setOpen(!0,$e(Wn,U,X)))}function L(U){if(T()){N();return}$();const V=y.select("domReferenceElement"),W=He(V);b.restTimeout.clear(),b.restTimeoutPending=!1;const Q=x.current.floatingContext??(f==null?void 0:f());if(Vm(U.relatedTarget,y.context.triggerElements))return;if(w.current&&Q){y.select("open")||b.openChangeTimeout.clear();const le=l.current;b.handler=w.current({...Q,tree:m,x:U.clientX,y:U.clientY,onClose(){N(),$(),E.current&&!T()&&le===y.select("domReferenceElement")&&I(U,!0)}}),W.addEventListener("mousemove",b.handler),b.handler(U);return}(b.pointerType==="touch"?!xe(y.select("floatingElement"),U.relatedTarget):!0)&&I(U)}function M(U){xe(B,U.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}const z=v?Ne(B,"mouseout",M):void 0;return s?wi(Ne(B,"mousemove",k,{once:!0}),Ne(B,"mouseenter",k),Ne(B,"mouseleave",L),z):wi(Ne(B,"mouseenter",k),Ne(B,"mouseleave",L),z)},[$,N,x,P,y,n,w,b,c,R,T,o,s,j,l,m,E,f,C,_,v]),O.useMemo(()=>{if(!n)return;function I(B){b.pointerType=B.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(B){var Q,G,le;const{nativeEvent:k}=B,L=B.currentTarget,M=y.select("domReferenceElement"),z=y.select("open"),U=R(M,L,B.target);if(o&&!sa(b.pointerType))return;if(z&&U&&((Q=b.handleCloseOptions)!=null&&Q.blockPointerEvents)){const X=y.select("floatingElement");if(X){const K=((le=(G=b.handleCloseOptions)==null?void 0:G.getScope)==null?void 0:le.call(G))??L.ownerDocument.body;zL(b,{scopeElement:K,referenceElement:L,floatingElement:X})}}const V=GT(j.current);if(z&&!U||V===0||!U&&b.restTimeoutPending&&B.movementX**2+B.movementY**2<2)return;b.restTimeout.clear();function W(){if(b.restTimeoutPending=!1,T())return;const X=y.select("open");!b.blockMouseMove&&(!X||U)&&_()&&y.setOpen(!0,$e(Wn,k,L))}b.pointerType==="touch"?po.flushSync(()=>{W()}):U&&z?W():(b.restTimeoutPending=!0,b.restTimeout.start(V,W))}}},[n,b,T,R,o,y,j,_])}const qye="Escape";function g_(e){return Oo&&e.movementX===0&&e.movementY===0}function Iy(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Tp(e,t){return Iy(t,e===XD||e===bO,e===Ey||e===Ay)}function lx(e,t,n){return Iy(t,e===bO,n?e===Ey:e===Ay)||e==="Enter"||e===" "||e===""}function Gye(e,t,n){return Iy(t,n?e===Ey:e===Ay,e===bO)}function Xye(e,t,n,r){const i=n?e===Ay:e===Ey,o=e===XD;return t==="both"||t==="horizontal"&&r?e===qye:Iy(t,i,o)}function Yye(e,t){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:o=!0,selectedIndex:a=null,allowEscape:s=!1,loopFocus:l=!1,nested:u=!1,rtl:c=!1,virtual:f=!1,focusItemOnOpen:p="auto",focusItemOnHover:h=!0,openOnArrowKeyDown:v=!0,disabledIndices:y=void 0,orientation:x="vertical",parentOrientation:g,id:m,resetOnPointerLeave:b=!0,externalTree:S,grid:w}=t,P=w!=null,j="rootStore"in e?e.rootStore:e,E=j.useState("open"),A=j.useState("floatingElement"),C=j.useState("domReferenceElement"),T=j.context.dataRef,_=Wm(A),R=fw(C),$=Rt(_),N=Ry(),I=Qu(S),B=O.useRef(p),k=O.useRef(a??-1),L=O.useRef(null),M=O.useRef(!0),z=de(te=>{i(k.current===-1?null:k.current,te)}),U=O.useRef(!!A),V=O.useRef(E),W=O.useRef(!1),Q=O.useRef(!1),G=O.useRef(null),le=Rt(y),X=Rt(E),K=Rt(a),ee=Rt(b),ie=Ou(),H=Ou(),Z=de(()=>{function te(ge){f?I==null||I.events.emit("virtualfocus",ge):G.current=ih(ge,{sync:W.current,preventScroll:!0})}const pe=n.current[k.current],oe=Q.current;pe&&te(pe),(W.current?ge=>ge():ge=>ie.request(ge))(()=>{var Fe;const ge=n.current[k.current]||pe;if(!ge)return;pe||te(ge),ce&&(oe||!M.current)&&((Fe=ge.scrollIntoView)==null||Fe.call(ge,{block:"nearest",inline:"nearest"}))})});fe(()=>{T.current.orientation=x},[T,x]),fe(()=>{o&&(E&&A?(k.current=a??-1,B.current&&a!=null&&(Q.current=!0,z())):U.current&&(k.current=-1,z()))},[o,E,A,a,z]),fe(()=>{if(o){if(!E){W.current=!1;return}if(A)if(r==null){if(W.current=!1,K.current!=null)return;if(U.current&&(k.current=-1,Z()),(!V.current||!U.current)&&B.current&&(L.current!=null||B.current===!0&&L.current==null)){let te=0;const pe=()=>{n.current[0]==null?(te<2&&(te?Y=>H.request(Y):queueMicrotask)(pe),te+=1):(k.current=L.current==null||lx(L.current,x,c)||u?rh(n):pw(n),L.current=null,z())};pe()}}else ef(n.current,r)||(k.current=r,Z(),Q.current=!1)}},[o,E,A,r,K,u,n,x,c,z,Z,H]),fe(()=>{var ge,Ce;if(!o||A||!I||f||!U.current)return;const te=I.nodesRef.current,pe=(Ce=(ge=te.find(Fe=>Fe.id===N))==null?void 0:ge.context)==null?void 0:Ce.elements.floating,oe=Mn(He(C??pe??null)),Y=te.some(Fe=>Fe.context&&xe(Fe.context.elements.floating,oe));pe&&!Y&&M.current&&pe.focus({preventScroll:!0})},[o,A,C,I,N,f]),fe(()=>{V.current=E,U.current=!!A}),fe(()=>{E||(L.current=null,B.current=p)},[E,p]);const J=r!=null,se=de(te=>{if(!X.current)return;const pe=n.current.indexOf(te.currentTarget);pe!==-1&&(k.current!==pe||r!==pe)&&(k.current=pe,z(te))}),we=de(()=>{var te,pe,oe;return g??((oe=(pe=(te=I==null?void 0:I.nodesRef.current.find(Y=>Y.id===N))==null?void 0:te.context)==null?void 0:pe.dataRef)==null?void 0:oe.current.orientation)}),ae=de(()=>rh(n,le.current)),be=de(te=>{if(M.current=!1,W.current=!0,te.which===229||!X.current&&te.currentTarget===$.current)return;if(u&&Xye(te.key,x,c,P)){Tp(te.key,we())||ai(te),j.setOpen(!1,$e(zT,te.nativeEvent)),it(C)&&(f?I==null||I.events.emit("virtualfocus",C):C.focus());return}const pe=k.current,oe=rh(n,y),Y=pw(n,y);if(R||(te.key==="Home"&&(ai(te),k.current=oe,z(te)),te.key==="End"&&(ai(te),k.current=Y,z(te))),w!=null){const ge=w(te,k.current,n,x,l,c,y,oe,Y);if(ge!=null&&(k.current=ge,z(te)),x==="both")return}if(Tp(te.key,x)){if(ai(te),E&&!f&&Mn(te.currentTarget.ownerDocument)===te.currentTarget){k.current=lx(te.key,x,c)?oe:Y,z(te);return}lx(te.key,x,c)?l?pe>=Y?s&&pe!==n.current.length?k.current=-1:(W.current=!1,k.current=oe):k.current=Ki(n.current,{startingIndex:pe,disabledIndices:y}):k.current=Math.min(Y,Ki(n.current,{startingIndex:pe,disabledIndices:y})):l?pe<=oe?s&&pe!==-1?k.current=n.current.length:(W.current=!1,k.current=Y):k.current=Ki(n.current,{startingIndex:pe,decrement:!0,disabledIndices:y}):k.current=Math.max(oe,Ki(n.current,{startingIndex:pe,decrement:!0,disabledIndices:y})),ef(n.current,k.current)&&(k.current=-1),z(te)}}),ce=O.useMemo(()=>({onFocus(pe){W.current=!0,se(pe)},onClick:({currentTarget:pe})=>pe.focus({preventScroll:!0}),onMouseMove(pe){g_(pe)||(W.current=!0,Q.current=!1,h&&se(pe))},onPointerLeave(pe){var Y;if(!X.current||!M.current||pe.pointerType==="touch")return;W.current=!0;const oe=pe.relatedTarget;if(!(!h||n.current.includes(oe))&&ee.current&&((Y=G.current)==null||Y.call(G),G.current=null,k.current=-1,z(pe),!f)){const ge=$.current,Ce=Mn(He(ge));ge&&xe(ge,Ce)&&ge.focus({preventScroll:!0})}}}),[se,X,$,h,n,z,ee,f]),Ee=O.useMemo(()=>f&&E&&J&&{"aria-activedescendant":`${m}-${r}`},[f,E,J,m,r]),je=O.useMemo(()=>({...R?{}:Ee,onKeyDown(te){if(te.key==="Tab"&&te.shiftKey&&E&&!f){const pe=cn(te.nativeEvent);if(pe&&!xe($.current,pe))return;ai(te),j.setOpen(!1,$e(wy,te.nativeEvent)),it(C)&&C.focus();return}be(te)},onPointerMove(te){g_(te)||(M.current=!0)}}),[Ee,be,$,R,j,E,f,C]),Se=O.useMemo(()=>{function te(Y){j.setOpen(!0,$e(zT,Y.nativeEvent,Y.currentTarget))}function pe(Y){p==="auto"&&jy(Y.nativeEvent)&&(B.current=!f)}function oe(Y){B.current=p,p==="auto"&&xO(Y.nativeEvent)&&(B.current=!0)}return{onKeyDown(Y){const ge=j.select("open");M.current=!1;const Ce=Y.key.startsWith("Arrow"),Fe=Gye(Y.key,we(),c),nn=Tp(Y.key,x),Tn=(u?Fe:nn)||Y.key==="Enter"||Y.key.trim()==="";if(f&&ge)return be(Y);if(!(!ge&&!v&&Ce)){if(Tn){const bt=Tp(Y.key,we());L.current=u&&bt?null:Y.key}if(u){Fe&&(ai(Y),ge?(k.current=ae(),z(Y)):te(Y));return}nn&&(K.current!=null&&(k.current=K.current),ai(Y),!ge&&v?te(Y):be(Y),ge&&z(Y))}},onFocus(Y){j.select("open")&&!f&&(k.current=-1,z(Y))},onPointerDown:oe,onPointerEnter:oe,onMouseDown:pe,onClick:pe}},[be,p,ae,u,z,j,v,x,we,c,K,f]),ze=O.useMemo(()=>({...Ee,...Se}),[Ee,Se]);return O.useMemo(()=>o?{reference:ze,floating:je,item:ce,trigger:Se}:{},[o,ze,je,Se,ce])}function Qye(e,t){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:o,disabledIndices:a,onTyping:s,enabled:l=!0,resetMs:u=750,selectedIndex:c=null}=t,f="rootStore"in e?e.rootStore:e,p=f.useState("open"),h=cr(),v=O.useRef(""),y=O.useRef(c??i??-1),x=O.useRef(null),g=de(S=>{function w($){return r==null?void 0:r.current[$]}function P($){const N=w($);return N&&!Ty(N)||N!=null&&N.matches(":disabled")?!1:a==null||!Pl(da,$,a)}function j($,N,I=0){if($.length===0)return-1;const B=(I%$.length+$.length)%$.length,k=N.toLowerCase();for(let L=0;L<$.length;L+=1){const M=(B+L)%$.length,z=$[M];if(!(!(z!=null&&z.toLowerCase().startsWith(k))||!P(M)))return M}return-1}const E=n.current;if(v.current.length>0&&S.key===" "&&(ai(S),s==null||s(!0)),v.current.length>0&&v.current[0]!==" "&&j(E,v.current)===-1&&S.key!==" "&&(s==null||s(!1)),E==null||S.key.length!==1||S.ctrlKey||S.metaKey||S.altKey)return;p&&S.key!==" "&&(ai(S),s==null||s(!0));const A=v.current==="";A&&(y.current=c??i??-1),E.every(($,N)=>{var I,B;return $&&P(N)?((I=$[0])==null?void 0:I.toLowerCase())!==((B=$[1])==null?void 0:B.toLowerCase()):!0})&&v.current===S.key&&(v.current="",y.current=x.current),v.current+=S.key,h.start(u,()=>{v.current="",y.current=x.current,s==null||s(!1)});const _=((A?c??i??-1:y.current)??0)+1,R=j(E,v.current,_);R!==-1?(o==null||o(R),x.current=R):S.key!==" "&&(v.current="",s==null||s(!1))}),m=de(S=>{const w=S.relatedTarget,P=f.select("domReferenceElement"),j=f.select("floatingElement");xe(P,w)||xe(j,w)||(h.clear(),v.current="",y.current=x.current,s==null||s(!1))});fe(()=>{!p&&c!==null||(h.clear(),x.current=null,v.current!==""&&(v.current=""))},[p,c,h]);const b=O.useMemo(()=>({onKeyDown:g,onBlur:m}),[g,m]);return O.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}const y_=.1,Jye=y_*y_,et=.5;function _p(e,t,n,r,i,o){return r>=t!=o>=t&&e<=(i-n)*(t-r)/(o-r)+n}function Rp(e,t,n,r,i,o,a,s,l,u){let c=!1;return _p(e,t,n,r,i,o)&&(c=!c),_p(e,t,i,o,a,s)&&(c=!c),_p(e,t,a,s,l,u)&&(c=!c),_p(e,t,l,u,n,r)&&(c=!c),c}function Zye(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function kp(e,t,n,r,i,o){const a=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,o),u=Math.max(r,o);return e>=a&&e<=s&&t>=l&&t<=u}function eve(e={}){const{blockPointerEvents:t=!1}=e,n=new Jr,r=({x:i,y:o,placement:a,elements:s,onClose:l,nodeId:u,tree:c})=>{const f=a==null?void 0:a.split("-")[0];let p=!1,h=null,v=null,y=typeof performance<"u"?performance.now():0;function x(m,b){const S=performance.now(),w=S-y;if(h===null||v===null||w===0)return h=m,v=b,y=S,!1;const P=m-h,j=b-v,E=P*P+j*j,A=w*w*Jye;return h=m,v=b,y=S,E<A}function g(){n.clear(),l()}return function(b){n.clear();const S=s.domReference,w=s.floating;if(!S||!w||f==null||i==null||o==null)return;const{clientX:P,clientY:j}=b,E=cn(b),A=b.type==="mouseleave",C=xe(w,E),T=xe(S,E);if(C&&(p=!0,!A))return;if(T&&(p=!1,!A)){p=!0;return}if(A&&Me(b.relatedTarget)&&xe(w,b.relatedTarget))return;function _(){return!!(c&&ga(c.nodesRef.current,u).length>0)}function R(){_()||g()}if(_())return;const $=S.getBoundingClientRect(),N=w.getBoundingClientRect(),I=i>N.right-N.width/2,B=o>N.bottom-N.height/2,k=N.width>$.width,L=N.height>$.height,M=(k?$:N).left,z=(k?$:N).right,U=(L?$:N).top,V=(L?$:N).bottom;if(f==="top"&&o>=$.bottom-1||f==="bottom"&&o<=$.top+1||f==="left"&&i>=$.right-1||f==="right"&&i<=$.left+1){R();return}let W=!1;switch(f){case"top":W=kp(P,j,M,$.top+1,z,N.bottom-1);break;case"bottom":W=kp(P,j,M,N.top+1,z,$.bottom-1);break;case"left":W=kp(P,j,N.right-1,V,$.left+1,U);break;case"right":W=kp(P,j,$.right-1,V,N.left+1,U);break}if(W)return;if(p&&!Zye(P,j,$)){R();return}if(!A&&x(P,j)){R();return}let Q=!1;switch(f){case"top":{const G=k?et/2:et*4,le=k||I?i+G:i-G,X=k?i-G:I?i+G:i-G,K=o+et+1,ee=I||k?N.bottom-et:N.top,ie=I?k?N.bottom-et:N.top:N.bottom-et;Q=Rp(P,j,le,K,X,K,N.left,ee,N.right,ie);break}case"bottom":{const G=k?et/2:et*4,le=k||I?i+G:i-G,X=k?i-G:I?i+G:i-G,K=o-et,ee=I||k?N.top+et:N.bottom,ie=I?k?N.top+et:N.bottom:N.top+et;Q=Rp(P,j,le,K,X,K,N.left,ee,N.right,ie);break}case"left":{const G=L?et/2:et*4,le=L||B?o+G:o-G,X=L?o-G:B?o+G:o-G,K=i+et+1,ee=B||L?N.right-et:N.left,ie=B?L?N.right-et:N.left:N.right-et;Q=Rp(P,j,ee,N.top,ie,N.bottom,K,le,K,X);break}case"right":{const G=L?et/2:et*4,le=L||B?o+G:o-G,X=L?o-G:B?o+G:o-G,K=i-et,ee=B||L?N.left+et:N.right,ie=B?L?N.left+et:N.right:N.left+et;Q=Rp(P,j,K,le,K,X,ee,N.top,ie,N.bottom);break}}Q?p||n.start(40,R):R()}};return r.__options={...e,blockPointerEvents:t},r}const HL=O.createContext(void 0);function tve(){const e=O.useContext(HL);if(e===void 0)throw new Error(gn(26));return e}const vw="ArrowUp",xw="ArrowDown",bw="ArrowLeft",ww="ArrowRight",Sw="Home",Ow="End",MO=new Set([vw,xw,bw,ww,Sw,Ow]),nve="Shift",rve=[nve,"Control","Alt","Meta"];function ive(e){return it(e)&&e.tagName==="INPUT"}function v_(e){return!!(ive(e)&&e.selectionStart!=null||it(e)&&e.tagName==="TEXTAREA")}function x_(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,o=e.scrollTop;const a=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const l=b_(e,t,"left"),u=Np(e),c=Np(t);n==="ltr"&&(l+t.offsetWidth+c.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?i=l+t.offsetWidth+c.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:l-c.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(i=l-c.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(l-c.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?i=l-c.scrollMarginLeft-u.scrollPaddingLeft:l+t.offsetWidth+c.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(i=l+t.offsetWidth+c.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(s&&r!=="horizontal"){const l=b_(e,t,"top"),u=Np(e),c=Np(t);l-c.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?o=l-c.scrollMarginTop-u.scrollPaddingTop:l+t.offsetHeight+c.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(o=l+t.offsetHeight+c.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:i,top:o,behavior:"auto"})}function b_(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Np(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const ove="--nested-dialogs",ave="data-nested-dialog-open",sve={...yy,...lO,nestedDialogOpen(e){return e?{[ave]:""}:null}},lve=O.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,initialFocus:s,...l}=t,u=Xu(),c=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),h=u.useState("popupProps"),v=u.useState("modal"),y=u.useState("mounted"),x=u.useState("nested"),g=u.useState("nestedOpenDialogCount"),m=u.useState("open"),b=u.useState("openMethod"),S=u.useState("titleElementId"),w=u.useState("transitionStatus"),P=u.useState("role"),j=p.useState("floatingId");tve(),$d({open:m,ref:u.context.popupRef,onComplete(){var R,$;m&&(($=(R=u.context).onOpenChangeComplete)==null||$.call(R,!0))}});const E=s===void 0?kye(u.context.popupRef):s,A=g>0,C=u.useStateSetter("popupElement"),_=tn("div",t,{state:{open:m,nested:x,transitionStatus:w,nestedDialogOpen:A},props:[h,{id:j,"aria-labelledby":S,"aria-describedby":c,role:P,..._O,hidden:!y,onKeyDown(R){MO.has(R.key)&&R.stopPropagation()},style:{[ove]:g}},l],ref:[n,u.context.popupRef,C],stateAttributesMapping:sve});return d.jsx(yL,{context:p,openInteractionType:b,disabled:!y,closeOnFocusOut:!f,initialFocus:E,returnFocus:a,modal:v!==!1,restoreFocus:"popup",children:_})});function VL(e){return oO(19)?e:e?"true":void 0}const WL=O.forwardRef(function(t,n){const{cutout:r,...i}=t;let o;if(r){const a=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return d.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),uve=O.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,o=Xu(),a=o.useState("mounted"),s=o.useState("modal"),l=o.useState("open");return a||r?d.jsx(HL.Provider,{value:r,children:d.jsxs(gL,{ref:n,...i,children:[a&&s===!0&&d.jsx(WL,{ref:o.context.internalBackdropRef,inert:VL(!l)}),t.children]})}):null});let w_={},S_={},O_="";function Dy(e,t){return kd(e)?e:t}function P_(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Dy(t,n)).overflowY)}function cve(e){if(typeof document>"u")return!1;const t=He(e);return ct(t).innerWidth-t.documentElement.clientWidth>0}function fve(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=He(e),r=n.documentElement,i=n.body,o=Dy(r,i),a=o.style.overflowY,s=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const l=o.offsetWidth;o.style.overflowY="hidden";const u=o.offsetWidth;return o.style.overflowY=a,r.style.scrollbarGutter=s,l===u}function dve(e){const t=He(e),n=t.documentElement,r=t.body,i=Dy(n,r),o={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,o)}}function pve(e){var h;const t=He(e),n=t.documentElement,r=t.body,i=ct(n);let o=0,a=0,s=!1;const l=fi.create();if(Oo&&(((h=i.visualViewport)==null?void 0:h.scale)??1)!==1)return()=>{};function u(){const v=i.getComputedStyle(n),y=i.getComputedStyle(r),m=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,a=n.scrollLeft,w_={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},O_=n.style.scrollBehavior,S_={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,w=v.overflowY==="scroll"||y.overflowY==="scroll",P=v.overflowX==="scroll"||y.overflowX==="scroll",j=Math.max(0,i.innerWidth-r.clientWidth),E=Math.max(0,i.innerHeight-r.clientHeight),A=parseFloat(y.marginTop)+parseFloat(y.marginBottom),C=parseFloat(y.marginLeft)+parseFloat(y.marginRight),T=Dy(n,r);if(s=fve(e),s){n.style.scrollbarGutter=m,T.style.overflowY="hidden",T.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:m,overflowY:"hidden",overflowX:"hidden"}),(b||w)&&(n.style.overflowY="scroll"),(S||P)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:A||E?`calc(100dvh - ${A+E}px)`:"100dvh",width:C||j?`calc(100vw - ${C+j}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,w_),Object.assign(r.style,S_),s||(n.scrollTop=o,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=O_)}function f(){c(),l.request(u)}u();const p=Ne(i,"resize",f);return()=>{l.cancel(),c(),typeof i.removeEventListener=="function"&&p()}}class hve{constructor(){Ze(this,"lockCount",0);Ze(this,"restore",null);Ze(this,"timeoutLock",Jr.create());Ze(this,"timeoutUnlock",Jr.create());Ze(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Ze(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=He(t),r=n.documentElement,i=n.body,o=ct(r);if(P_(o,r,i)){const s=new o.MutationObserver(()=>{P_(o,r,i)||(s.disconnect(),this.restore=null,this.lock(t))}),l={attributes:!0};s.observe(r,l),s.observe(i,l),this.restore=()=>s.disconnect();return}const a=Py||!cve(t);this.restore=a?dve(t):pve(t)}}const mve=new hve;function KL(e=!0,t=null){fe(()=>{if(e)return mve.acquire(t)},[e,t])}function gve({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),i=e.useState("disablePointerDismissal"),o=e.useState("modal"),a=e.useState("popupElement"),s=e.useState("floatingRootContext"),[l,u]=O.useState(0),[c,f]=O.useState(0),p=l===0,h=EO(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(v){if(!e.context.outsidePressEnabledRef.current||"button"in v&&v.button!==0)return!1;if("touches"in v){if(v.type==="touchend"){if(v.changedTouches.length!==1||v.touches.length!==0)return!1}else if(v.touches.length!==1)return!1}const y=cn(v);if(p&&!i){if(o){const x=e.context.internalBackdropRef.current,g=e.context.backdropRef.current;return x||g?x===y||g===y||xe(y,a)&&!(y!=null&&y.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:p});return KL(r&&o===!0,a),e.useContextCallback("onNestedDialogOpen",(v,y)=>{u(v),f(y)}),fe(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,c+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,c,t]),LL(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:c}),null}const yve={...UL,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class vve extends My{constructor(n,r,i){const o=new RO,a=xve(n,o,r,i);super(a,bve(o),yve);Ze(this,"setOpen",(n,r)=>{var i,o;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(o=(i=this.context).onOpenChange)==null||o.call(i,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(ML(this.state,n,r.trigger)))})}}function xve(e,t,n,r=!1){return{...FL(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function bve(e){return{popupRef:O.createRef(),backdropRef:O.createRef(),internalBackdropRef:O.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function wve(e,t){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:a,disablePointerDismissal:s=!1,modal:l=!0,actionsRef:u,handle:c,triggerId:f,defaultTriggerId:p=null}=t,h=e==="drawer",v=l,y=s,x="dialog",g=Xu(!0),m=g!=null,b={modal:v,disablePointerDismissal:y,nested:m,role:x},S=NL((C,T)=>new vve({open:i,openProp:r,activeTriggerId:p,triggerIdProp:f,...b},C,T),!0);S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",f),S.useSyncedValues(b),S.useContextCallback("onOpenChange",o),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("open"),P=S.useState("mounted"),j=S.useState("payload");Dye(S,w),IL(S);const{forceUnmount:E}=DL(w,S);O.useImperativeHandle(u,()=>({unmount:E,close:()=>S.setOpen(!1,$e(KD))}),[E,S]);const A=w||P;return d.jsxs(RD.Provider,{value:S,children:[c&&d.jsx($L,{handle:c,store:S}),A&&d.jsx(gve,{store:S,parentContext:g==null?void 0:g.context,isDrawer:h}),typeof n=="function"?n({payload:j}):n]})}const Sve=CO(function(t){return wve("dialog",t)}),Ove=O.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...s}=t,l=Xu(),u=Yu(a);return l.useSyncedValueWithCleanup("titleElementId",u),tn("h2",t,{ref:n,props:[{id:u},s]})});function Pve(e){const t=O.useRef(""),n=O.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:O.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function qL(e,t){const n=O.useRef(e),r=de(t);fe(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function jve(e,t){const n=de((o,a)=>{(typeof e=="function"?e():e)||t(a||(Py?"touch":""))}),{onClick:r,onPointerDown:i}=Pve(n);return O.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function Eve(e){const[t,n]=O.useState(null),r=jve(e,n);return qL(e,i=>{i&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}const GL=Sve,Ave=O.forwardRef(function({className:t,...n},r){return d.jsx(ime,{ref:r,className:gt("fixed inset-0 z-40 bg-black/60 backdrop-blur-[2px]",t),...n})}),XL=O.forwardRef(function({className:t,placement:n="center",children:r,...i},o){const a=n==="right"?"inset-y-0 right-0 w-full max-w-xl border-l":n==="top"?"left-1/2 top-[12vh] w-[min(36rem,92vw)] -translate-x-1/2 rounded-lg border":"left-1/2 top-1/2 w-[min(36rem,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-lg border";return d.jsxs(uve,{children:[d.jsx(Ave,{}),d.jsx(lve,{ref:o,className:gt("fixed z-50 border-line bg-panel-2 text-foreground shadow-2xl focus:outline-none font-mono",a,t),...i,children:r})]})}),Cve=O.forwardRef(function({className:t,...n},r){return d.jsx(Ove,{ref:r,className:gt("text-sm font-semibold text-foreground",t),...n})});O.forwardRef(function({className:t,...n},r){return d.jsx(vme,{ref:r,className:gt("text-xs text-muted-foreground",t),...n})});const _s=O.forwardRef(function({className:t,...n},r){return d.jsx("input",{ref:r,className:gt("rounded border border-input bg-panel px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n})});function Tve(e){const t=O.useRef(!0);t.current&&(t.current=!1,e())}function _ve(e){const[t,n]=O.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function YL(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Pw({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=O.useRef(e!==void 0),[o,a]=O.useState(t),s=i&&e!==void 0?e:o,l=O.useCallback(u=>{i||a(u)},[]);return[s,l]}const QL=O.createContext(void 0),JL=O.createContext(void 0),ZL=O.createContext(void 0);function Aa(){const e=O.useContext(QL);if(e===void 0)throw new Error(gn(60));return e}function IO(){const e=O.useContext(JL);if(e===void 0)throw new Error(gn(101));return e}function eF(){const e=O.useContext(ZL);if(e===void 0)throw new Error(gn(61));return e}const Rve="data-valid",kve="data-invalid",Nve={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},$ve={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Mve={disabled:!1,...$ve},Ive={valid(e){return e===null?null:e?{[Rve]:""}:{[kve]:""}}},Dve={invalid:void 0,name:void 0,validityData:{state:Nve,errors:[],error:"",value:"",initialValue:null},setValidityData:Ot,disabled:void 0,setTouched:Ot,setDirty:Ot,setFilled:Ot,setFocused:Ot,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Mve,registerFieldControl:Ot,validation:{getValidationProps:(e,t=$t)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Ot,getInputControl:()=>null,commit:async()=>{},change:Ot}},Lve=O.createContext(Dve);function DO(e=!0){const t=O.useContext(Lve);if(t.setValidityData===Ot&&!e)throw new Error(gn(28));return t}function Fve(e,t,n,r,i=!0,o){const{registerFieldControl:a}=DO(),s=Fn(()=>Symbol());fe(()=>{const l=s.current;if(!i){a(l,void 0);return}a(l,{controlRef:e,getValue:r,id:t,name:o,value:n})},[e,i,r,t,o,a,s,n]),fe(()=>{const l=s.current;return()=>{a(l,void 0)}},[a,s])}const Bve=O.createContext({controlId:void 0,registerControlId:Ot,resetControlId:Ot,labelId:void 0,setLabelId:Ot,messageIds:[],setMessageIds:Ot,getDescriptionProps:e=>e});function tF(){return O.useContext(Bve)}function nF(e={}){const{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:o}=tF(),a=Yu(),s=Fn(()=>Symbol()),l=O.useRef(!1),u=O.useRef(!1),c=de(()=>{!l.current||i===Ot||(l.current=!1,i(s.current,void 0))});return fe(()=>{if(!n||i===Ot){c();return}let f;if(t!==void 0)u.current=!0,f=t;else if(u.current)f=a;else{o();return}if(f===void 0){c();return}l.current=!0,i(s.current,f)},[t,n,i,o,a,s,c]),fe(()=>c,[c]),(n?r:void 0)??t??a}function Uve(e,t,n=Object.is){const{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}const rF=(e,t)=>Object.is(e,t);function Rs(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function zve(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Uve(e,t,(r,i)=>Rs(r,i,n)):e!==t}function jw(e,t,n){return e?e.some(r=>r===void 0?!1:Rs(t,r,n)):!1}function ah(e,t,n){return e?e.findIndex(r=>r===void 0?!1:Rs(r,t,n)):-1}function Hve(e,t){if(t!==rF)return r=>jw(e,r,t);const n=new Set(e);return n.delete(void 0),r=>n.has(r)&&(r!==0||e.some(i=>Object.is(r,i)))}function iF(e,t,n,r){const i=r&&Array.isArray(t)?e.findIndex(Hve(t,n)):ah(e,t,n);return i===-1?null:i}function Vve(e,t,n,r,i,o){return jw(r,t,i)?o!=null&&e>o&&jw(r,n[o],i)?o:e:e===o?iF(n,r,i,!0):o}function Wve(e,t,n){return e.filter(r=>!Rs(t,r,n))}function Ew(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Kve(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function oF(e){return Kve(e==null?void 0:e[0])}function qve(e){return oF(e)?e.flatMap(t=>t.items):e}function Gve(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(oF(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function aF(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ew(e)}function Xs(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ew(e.value):Ew(e)}function sF(e,t,n){function r(){return aF(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){const o=qve(t);if(e==null||typeof e!="object"){const a=o.find(s=>s.value===e);return a&&a.label!=null?a.label:r()}if("value"in e){const a=o.find(s=>s&&s.value===e.value);if(a&&a.label!=null)return a.label}}return r()}function Xve(e,t,n){return e.reduce((r,i,o)=>(o>0&&r.push(", "),r.push(d.jsx(O.Fragment,{children:sF(i,t,n)},o)),r),[])}const Yve={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xs(t,r)!==""},hasNullItemLabel:(e,t)=>t?Gve(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(i=>Rs(t,i,n)):Rs(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},Qve=O.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Ot,validationMode:"onSubmit",submitCountRef:{current:0}});function Jve(){return O.useContext(Qve)}function Ic(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Mi=1;function lF(e,t){return Math.max(0,e-t)}function Zve(e,t){if(t<=0)return 0;const n=Ic(e,0,t),r=n,i=t-n,o=r<=Mi,a=i<=Mi;return o&&a?r<=i?0:t:o?0:a?t:n}function exe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:a=!1,onOpenChange:s,name:l,form:u,autoComplete:c,disabled:f=!1,readOnly:p=!1,required:h=!1,modal:v=!0,actionsRef:y,inputRef:x,onOpenChangeComplete:g,items:m,multiple:b=!1,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:P=rF,highlightItemOnHover:j=!0,children:E}=e,{clearErrors:A}=Jve(),{setDirty:C,setTouched:T,setFocused:_,validityData:R,setFilled:$,name:N,disabled:I,validation:B,validationMode:k}=DO(),L=nF({id:t}),M=I||f,z=N??l,[U,V]=Pw({controlled:n,default:b?r??da:r,name:"Select",state:"value"}),[W,Q]=Pw({controlled:o,default:a,name:"Select",state:"open"}),G=O.useRef([]),le=O.useRef([]),X=O.useRef(null),K=O.useRef(null),ee=O.useRef(0),ie=O.useRef(null),H=O.useRef([]),Z=O.useRef(!1),J=O.useRef(null),se=O.useRef(null),we=O.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ae=O.useRef(!1),be=O.useRef(U),{mounted:ce,setMounted:Ee,transitionStatus:je}=kL(W),{openMethod:Se,triggerProps:ze}=Eve(W),te=Fn(()=>new My({id:L,labelId:void 0,modal:v,multiple:b,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:P,value:U,open:W,mounted:ce,transitionStatus:je,items:m,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:$t,triggerProps:$t,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Ot,setOpen:Ot,handleScrollArrowVisibility:Ot,onOpenChangeComplete:Ot,listRef:G,popupRef:X,scrollHandlerRef:K,scrollArrowsMountedCountRef:ee,valueRef:ie,valuesRef:H,labelsRef:le,typingRef:Z,selectionRef:we,firstItemTextRef:J,selectedItemTextRef:se,alignItemWithTriggerActiveRef:ae,initialValueRef:be},Yve)).current,pe=te.useState("activeIndex"),oe=te.useState("selectedIndex"),Y=te.useState("triggerElement"),ge=te.useState("positionerElement"),Ce=_ve(Se),Fe=Se??Ce,nn=O.useMemo(()=>b?"":Xs(U,w),[b,U,w]),Tn=O.useMemo(()=>b&&Array.isArray(U)?U.map(De=>Xs(De,w)):Xs(U,w),[b,U,w]),bt=Rt(Y),yn=de(()=>Tn);Fve(bt,L,U,yn,!M,l);const er=b?Array.isArray(U)&&U.length>0:U!=null&&nn!=="";fe(()=>{$(er)},[er,$]),fe(function(){const rt=iF(H.current,U,P,b);rt===null&&(se.current=null),!W&&te.set("selectedIndex",rt)},[b,W,U,P,te]),qL(U,()=>{A(z),C(zve(U,R.initialValue,P)),B.change(U)});const _n=de((De,rt)=>{s==null||s(De,rt),!rt.isCanceled&&(Q(De),!De&&(rt.reason===wy||rt.reason===mO)&&(T(!0),_(!1),k==="onBlur"&&B.commit(U)))}),ti=de(()=>{Ee(!1),te.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),g==null||g(!1)});$d({enabled:!y,open:W,ref:X,onComplete(){W||ti()}}),O.useImperativeHandle(y,()=>({unmount:ti}),[ti]);const Mr=de((De,rt)=>{i==null||i(De,rt),!rt.isCanceled&&V(De)}),Ei=de(De=>{const rt=lF(De.scrollHeight,De.clientHeight),Hn=Zve(De.scrollTop,rt),Ci=Hn>0,ni=Hn<rt;te.set("scrollUpArrowVisible",Ci),te.set("scrollDownArrowVisible",ni)}),mr=Bye({open:W,onOpenChange:_n,elements:{reference:Y,floating:ge}}),Ai=dge(mr,{enabled:!M,event:"mousedown"}),Ir=EO(mr),qt=Yye(mr,{enabled:!M,listRef:G,activeIndex:pe,selectedIndex:oe,disabledIndices:da,onNavigate(De){De===null&&!W||te.set("activeIndex",De)},focusItemOnHover:j}),Te=Qye(mr,{enabled:!M&&(W||!p&&!b),listRef:le,activeIndex:pe,selectedIndex:oe,disabledIndices:De=>YL(G.current[De]),onMatch(De){W?te.set("activeIndex",De):Mr(H.current[De],$e(ha))},onTyping(De){Z.current=De}}),Ct=O.useMemo(()=>As(Te.reference,qt.reference,Ir.reference,Ai.reference,ze),[Ai.reference,Te.reference,qt.reference,Ir.reference,ze]),rn=O.useMemo(()=>As(_O,Te.floating,qt.floating,Ir.floating),[Te.floating,qt.floating,Ir.floating]),on=qt.item??$t;te.useContextCallback("setValue",Mr),te.useContextCallback("setOpen",_n),te.useContextCallback("handleScrollArrowVisibility",Ei),te.useContextCallback("onOpenChangeComplete",g),Tve(()=>{te.update({popupProps:rn,triggerProps:Ct})}),te.useSyncedValues({id:L,modal:v,multiple:b,value:U,open:W,mounted:ce,transitionStatus:je,popupProps:rn,triggerProps:Ct,items:m,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:P,openMethod:Fe});const gr=O.useMemo(()=>({disabled:M,readOnly:p,required:h,multiple:b,highlightItemOnHover:j,itemProps:on}),[M,p,h,b,j,on]),tr=Es(x,B.inputRef),Ta=b?void 0:z,Po=O.useMemo(()=>!b||!Array.isArray(U)||!z?null:U.map(De=>{const rt=Xs(De,w);return d.jsx("input",{type:"hidden",form:u,name:z,value:rt,disabled:M},rt)}),[b,U,u,z,w,M]);return d.jsxs(QL.Provider,{value:te,children:[d.jsx(JL.Provider,{value:gr,children:d.jsx(ZL.Provider,{value:mr,children:E})}),d.jsx("input",{...B.getValidationProps(M,{onFocus(){var De;(De=te.state.triggerElement)==null||De.focus({focusVisible:!0})},onChange(De){if(De.nativeEvent.defaultPrevented||M||p)return;const rt=De.currentTarget.value,Hn=$e(ha,De.nativeEvent);function Ci(){if(b)return;const ni=rt.toLowerCase();let _a=H.current.findIndex(Hs=>Xs(Hs,w).toLowerCase()===ni||aF(Hs,S).toLowerCase()===ni);_a===-1&&(_a=H.current.findIndex((Hs,Hd)=>{const rc=le.current[Hd];return rc!=null&&rc.toLowerCase()===ni}));const nc=H.current[_a];nc!=null&&Mr(nc,Hn)}te.set("forceMount",!0),queueMicrotask(Ci)}}),id:L&&Ta==null?`${L}-hidden-input`:void 0,form:u,name:Ta,autoComplete:c,value:nn,disabled:M,required:h&&!(b&&er),readOnly:p,ref:tr,style:z?Dme:ZD,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Po]})}function txe(e,t){return e??t}const $p=5;function nxe(e,t){const n=rxe(t);return e.clientX>=n.left-$p&&e.clientX<=n.right+$p&&e.clientY>=n.top-$p&&e.clientY<=n.bottom+$p}function rxe(e){const t=e.getBoundingClientRect(),n=ct(e);if(vO)return t;const r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const a=parseFloat(r.width)||0,s=parseFloat(r.height)||0,l=parseFloat(i.width)||0,u=parseFloat(i.height)||0,c=Math.max(t.width,a,l),f=Math.max(t.height,s,u),p=c-t.width,h=f-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-h/2,bottom:t.bottom+h/2}}const ixe="data-popup-side",oxe=400,axe={...rme,...Ive,popupSide:e=>e?{[ixe]:e}:null,value:()=>null},sxe=O.forwardRef(function(t,n){var ee;const{render:r,className:i,id:o,disabled:a=!1,nativeButton:s=!0,style:l,...u}=t,{setTouched:c,setFocused:f,validationMode:p,validation:h,state:v,disabled:y}=DO(),{labelId:x}=tF(),g=Aa(),{readOnly:m,required:b,disabled:S}=IO(),w=y||S||a,P=g.useState("open"),j=g.useState("mounted"),E=g.useState("value"),A=g.useState("triggerProps"),C=g.useState("positionerElement"),T=g.useState("listElement"),_=g.useState("popupSide"),R=g.useState("id"),$=g.useState("labelId"),N=g.useState("hasSelectedValue"),I=j&&C?_:null,B=o??R,k=txe(x,$);nF({id:o});const L=Rt(C),M=O.useRef(null),{getButtonProps:z,buttonRef:U}=hO({disabled:w,native:s}),V=g.useStateSetter("triggerElement"),W=cr(),Q=cr(),G=cr();O.useEffect(()=>{if(P)return G.start(oxe,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{G.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Q.clear()},[P,g,Q,G]);const le=As(A,{id:B,role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-controls":P?(T==null?void 0:T.id)??((ee=Wm(C))==null?void 0:ee.id):void 0,"aria-labelledby":k,"aria-readonly":m||void 0,"aria-required":b||void 0,tabIndex:w?-1:0,onFocus(ie){f(!0),P&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,$e(ha,ie.nativeEvent)),W.start(0,()=>{g.set("forceMount",!0)})},onBlur(ie){xe(C,ie.relatedTarget)||(c(!0),f(!1),p==="onBlur"&&h.commit(E))},onMouseDown(ie){if(P)return;const H=He(ie.currentTarget);function Z(J){if(!M.current)return;const se=J.target;xe(M.current,se)||xe(L.current,se)||nxe(J,M.current)||g.context.setOpen(!1,$e(mme,J))}Q.start(0,()=>{H.addEventListener("mouseup",Z,{once:!0})})}},u,z),X=h.getValidationProps(w,le);X.role="combobox";const K={...v,open:P,disabled:w,value:E,readOnly:m,popupSide:I,placeholder:!N};return tn("button",t,{ref:[n,M,U,V],state:K,stateAttributesMapping:axe,props:X})}),lxe={value:()=>null},uxe=O.forwardRef(function(t,n){const{className:r,render:i,children:o,placeholder:a,style:s,...l}=t,u=Aa(),c=u.useState("value"),f=u.useState("items"),p=u.useState("itemToStringLabel"),h=u.useState("hasSelectedValue"),v=!h&&a!=null&&o==null,y=u.useState("hasNullItemLabel",v),x={value:c,placeholder:!h};let g=null;return typeof o=="function"?g=o(c):o!=null?g=o:v&&!y?g=a:Array.isArray(c)?g=Xve(c,f,p):g=sF(c,f,p),tn("span",t,{state:x,ref:[n,u.context.valueRef],props:[{children:g},l],stateAttributesMapping:lxe})}),cxe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,...a}=t,u={open:Aa().useState("open")};return tn("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:UD})}),fxe=O.forwardRef(function(t,n){const r=Aa(),i=r.useState("mounted"),o=r.useState("forceMount");return i||o?d.jsx(gL,{ref:n,...t}):null}),uF=O.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function dxe(){return O.useContext(uF)}function LO(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,o=de(i),[,a]=O.useState(!1),s=Fn(hxe).current,l=Fn(pxe).current,u=O.useRef(0),c=O.useRef(!0),f=O.useRef(null),p=O.useRef(null),h=de(()=>{c.current||(c.current=!0,a(w=>!w))}),v=de((w,P)=>{l.set(w,P),h()}),y=de(w=>{l.delete(w),h()}),x=de(w=>{const P=new Map;return n.current.length=0,r&&(r.current.length=0),w.forEach(j=>{var E,A;P.set(j.element,{...j.registration.metadata??{},index:j.index}),n.current[j.index]=j.element,r&&(r.current[j.index]=j.registration.label!==void 0?j.registration.label:((A=(E=j.registration.textRef)==null?void 0:E.current)==null?void 0:A.textContent)??j.element.textContent)}),u.current=n.current.length,P});function g(w){var E;if((E=p.current)==null||E.disconnect(),p.current=null,typeof MutationObserver!="function"||w.length<2)return;const P=new MutationObserver(A=>{if(!yxe(A))return;let C=null;for(const T of w)if(T.isConnected){if(C&&cF(C,T)>0){P.disconnect(),h();return}C=T}});p.current=P;const j=new Set;for(let A=1;A<w.length;A+=1){const C=gxe(w[A-1],w[A]);C&&j.add(C)}j.forEach(A=>P.observe(A,{childList:!0}))}const m=de(()=>{const[w,P]=mxe(l),j=x(w),E=f.current,A=!E||E.length!==w.length||w.some((C,T)=>{const _=E[T];return C.index!==_.index||C.element!==_.element||C.registration.index!==_.registration.index||C.registration.metadata!==_.registration.metadata});g(P),f.current=w,c.current=!1,A&&(s.forEach(C=>C(j)),o(j))});fe(()=>(!c.current&&f.current&&x(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,x]),fe(()=>{c.current&&m()}),fe(()=>()=>{var w;(w=p.current)==null||w.disconnect(),c.current=!0},[]);const b=de(w=>(s.add(w),()=>{s.delete(w)})),S=O.useMemo(()=>({register:v,unregister:y,subscribeMapChange:b,nextIndexRef:u}),[v,y,b,u]);return d.jsx(uF.Provider,{value:S,children:t})}function pxe(){return new Map}function hxe(){return new Set}function mxe(e){const t=new Set,n=[],r=[];e.forEach((o,a)=>{if(!a.isConnected)return;const s=o.index,l={index:s??-1,element:a,registration:o};s===null?r.push(l):s>=0&&(t.add(s),n.push(l))});let i=0;return r.sort((o,a)=>cF(o.element,a.element)),r.forEach(o=>{for(;t.has(i);)i+=1;o.index=i,n.push(o),i+=1}),t.size>0&&n.sort((o,a)=>o.index-a.index),[n,r.map(o=>o.element)]}function gxe(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function yxe(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function cF(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const vxe=O.createContext(void 0);function FO(){const e=O.useContext(vxe);return(e==null?void 0:e.direction)??"ltr"}const xxe=e=>({name:"arrow",options:e,async fn(t){var L,M;const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:f="real"}=ma(e,t)||{};if(u==null)return{};const p=tL(c),h={x:n,y:r},v=OO(i),y=SO(v),x=await a.getDimensions(u),g=v==="y",m=g?"top":"left",b=g?"bottom":"right",S=g?"clientHeight":"clientWidth",w=o.reference[y]+o.reference[v]-h[v]-o.floating[y],P=h[v]-o.reference[v],j=f==="real"?await((L=a.getOffsetParent)==null?void 0:L.call(a,u)):s.floating;let E=s.floating[S]||o.floating[y];(!E||!await((M=a.isElement)==null?void 0:M.call(a,j)))&&(E=s.floating[S]||o.floating[y]);const A=w/2-P/2,C=E/2-x[y]/2-1,T=Math.min(p[m],C),_=Math.min(p[b],C),R=T,$=E-x[y]-_,N=E/2-x[y]/2+A,I=eL(R,N,$),B=!l.arrow&&uo(i)!=null&&N!==I&&o.reference[y]/2-(N<R?T:_)-x[y]/2<0,k=B?N<R?N-R:N-$:0;return{[v]:h[v]+k,data:{[v]:I,centerOffset:N-I-k,...B&&{alignmentOffset:k}},reset:B}}}),bxe=(e,t)=>{const{name:n,fn:r}=xxe(e);return{name:n,fn:r,options:[e,t]}},wxe={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,o=t===0&&n===0&&r===0&&i===0,a=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-t>=0||a.bottom-n>=0||a.left-t>=0||o}}}},Sxe={sideX:"left",sideY:"top"},Oxe="--available-width",Pxe="--available-height",jxe="--anchor-width",Exe="--anchor-height",Axe="--transform-origin",j_=Oxe,E_=Pxe;function fF(e,t,n){const 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 A_(e,t,n){const{rects:r,placement:i}=e;return{side:fF(t,Cr(i),n),align:uo(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function dF(e){return Cxe(e,Uye)}function Cxe(e,t){var Ir,qt;const{anchor:n,positionMethod:r="absolute",side:i="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,collisionBoundary:l,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:h,keepMounted:v=!1,floatingRootContext:y,mounted:x,collisionAvoidance:g,shift:m,nodeId:b,adaptiveOrigin:S,lazyFlip:w=!1,externalTree:P}=e,[j,E]=O.useState(null);!x&&j!==null&&E(null);const A=g.side||"flip",C=g.align||"flip",T=g.fallbackAxisSide||"end",_=(m==null?void 0:m.crossAxis)??!1,R=m==null?void 0:m.rootBoundary,$=typeof n=="function"?n:void 0,N=de($),I=$?N:n,B=Rt(n),k=Rt(x),M=FO()==="rtl",z=j||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[i],U=a==="center"?z:`${z}-${a}`;let V=u;typeof V=="number"?V={top:V,right:V,bottom:V,left:V}:V&&(V={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0});const W=1,Q=i==="bottom"?W:0,G=i==="top"?W:0,le=i==="right"?W:0,X=i==="left"?W:0,K={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:V},ee=O.useRef(null),ie=Rt(o),H=Rt(s),Z=typeof o!="function"?o:0,J=typeof s!="function"?s:0,se=[];h&&se.push(h),se.push(Yge(Te=>{const Ct=A_(Te,i,M),rn=typeof ie.current=="function"?ie.current(Ct):ie.current,on=typeof H.current=="function"?H.current(Ct):H.current;return{mainAxis:rn,crossAxis:on,alignmentAxis:on}},[Z,J,M,i]));const we=C==="none"&&A!=="shift",ae=!we&&(c||_||A==="shift"),be=A==="none"?null:Zge({...K,padding:{top:V.top+W+Q,right:V.right+W+X,bottom:V.bottom+W+G,left:V.left+W+le},mainAxis:!_&&A==="flip",crossAxis:C==="flip"?"alignment":!1,fallbackAxisSideDirection:T}),ce=we?null:Qge({...K,rootBoundary:R,mainAxis:C!=="none",crossAxis:ae,limiter:c||_?void 0:Jge(Te=>{if(!ee.current)return{};const{width:Ct,height:rn}=ee.current.getBoundingClientRect(),on=Er(Cr(Te.placement)),gr=on==="y"?Ct:rn,tr=on==="y"?V.left+V.right:V.top+V.bottom;return{offset:gr/2+tr/2}})},[K,c,_,R,V,C]);A==="shift"||C==="shift"||a==="center"?se.push(ce,be):se.push(be,ce),se.push(eye({...K,apply({elements:{floating:Te},availableWidth:Ct,availableHeight:rn,rects:on}){if(!k.current)return;const gr=Te.style;gr.setProperty(j_,`${Ct}px`),gr.setProperty(E_,`${rn}px`);const tr=ct(Te).devicePixelRatio||1,{x:Ta,y:Po,width:De,height:rt}=on.reference,Hn=(Math.round((Ta+De)*tr)-Math.round(Ta*tr))/tr,Ci=(Math.round((Po+rt)*tr)-Math.round(Po*tr))/tr;gr.setProperty(jxe,`${Hn}px`),gr.setProperty(Exe,`${Ci}px`)}}),bxe(Te=>({element:ee.current||He(Te.elements.floating).createElement("div"),padding:ee.current?f:0,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Te){var nc,Hs,Hd,rc,oP,aP;const{elements:{floating:Ct},middlewareData:rn,placement:on,platform:gr,rects:tr,y:Ta}=Te,Po=Cr(on),De=uo(on),rt=Er(Po)==="y",Hn=ee.current,Ci=typeof o=="function"?o(A_(Te,i,M)):o;let ni;if(!Hn&&De&&Math.abs(rt?((nc=rn.shift)==null?void 0:nc.x)||0:((Hs=rn.shift)==null?void 0:Hs.y)||0)<=1)ni=De==="start"===(rt&&((Hd=gr.isRTL)==null?void 0:Hd.call(gr,Ct))===!0)?"100%":"0%";else{const jB=rt?((rc=rn.arrow)==null?void 0:rc.x)||0:((oP=rn.arrow)==null?void 0:oP.y)||0,EB=rt?(Hn==null?void 0:Hn.clientWidth)||0:(Hn==null?void 0:Hn.clientHeight)||0;ni=`${jB+EB/2}px`}let _a=Po==="top"||Po==="left"?`calc(100% + ${Ci}px)`:`${-Ci}px`;return ae&&rt&&Math.abs(((aP=rn.shift)==null?void 0:aP.y)||0)>Ci&&(_a=`${tr.reference.y+tr.reference.height/2-Ta}px`),Ct.style.setProperty(Axe,rt?`${ni} ${_a}`:`${_a} ${ni}`),{}}},wxe,S),fe(()=>{!x&&y&&y.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,y]);const Ee=O.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:je,elements:Se,x:ze,y:te,middlewareData:pe,update:oe,placement:Y,context:ge,isPositioned:Ce,floatingStyles:Fe}=t({rootContext:y,open:v?x:void 0,placement:U,middleware:se,strategy:r,whileElementsMounted:v?void 0:(...Te)=>d_(...Te,Ee),nodeId:b,externalTree:P}),{sideX:nn,sideY:Tn}=pe.adaptiveOrigin||Sxe,bt=Ce?r:"fixed",yn=O.useMemo(()=>{let Te;return Ce?S?Te={position:bt,[nn]:ze,[Tn]:te}:Te={...Fe,position:bt}:Te={position:bt,top:0,left:0},Te[j_]="100vw",Te[E_]="100vh",Ce||(Te.opacity=0),Te},[S,bt,nn,ze,Tn,te,Fe,Ce]),er=O.useRef(null);fe(()=>{if(!x)return;const Te=B.current,Ct=typeof Te=="function"?Te():Te,on=(C_(Ct)?Ct.current:Ct)||null||null;on!==er.current&&(je.setPositionReference(on),er.current=on)},[x,je,I,B]),O.useEffect(()=>{if(!x)return;const Te=B.current;typeof Te!="function"&&C_(Te)&&Te.current!==er.current&&(je.setPositionReference(Te.current),er.current=Te.current)},[x,je,I,B]),O.useEffect(()=>{if(v&&x&&Se.reference&&Se.floating)return d_(Se.reference,Se.floating,oe,Ee)},[v,x,Se,oe,Ee]);const _n=Cr(Y),ti=fF(i,_n,M),Mr=uo(Y)||"center",Ei=!!((Ir=pe.hide)!=null&&Ir.referenceHidden);fe(()=>{w&&x&&Ce&&_n!==z&&E(_n)},[w,x,Ce,_n,z]);const mr=O.useMemo(()=>{var Te,Ct;return{position:"absolute",top:(Te=pe.arrow)==null?void 0:Te.y,left:(Ct=pe.arrow)==null?void 0:Ct.x}},[pe.arrow]),Ai=((qt=pe.arrow)==null?void 0:qt.centerOffset)!==0;return O.useMemo(()=>({positionerStyles:yn,arrowStyles:mr,arrowRef:ee,arrowUncentered:Ai,side:ti,align:Mr,physicalSide:_n,anchorHidden:Ei,refs:je,context:ge,isPositioned:Ce,update:oe}),[yn,mr,ee,Ai,ti,Mr,_n,Ei,je,ge,Ce,oe])}function C_(e){return e!=null&&"current"in e}const pF=O.createContext(void 0);function Txe(){const e=O.useContext(pF);if(!e)throw new Error(gn(59));return e}function Jm(e,t){e&&Object.assign(e.style,t)}const _xe={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function BO(e){return e==="starting"?tge:$t}function hF(e,t,{styles:n,transitionStatus:r,props:i,refs:o,hidden:a,inert:s=!1}){const l={...n};return s&&(l.pointerEvents="none"),tn("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:a,style:l},BO(r),i],stateAttributesMapping:yy})}const Rxe=20;function kxe(e,t,n,r){const[i,o]=O.useState(!1);fe(()=>{if(!e||!t||n==null){o(!1);return}const a=He(n).documentElement.clientWidth,s=n.offsetWidth;o(a>0&&s>0&&s>=a-Rxe)},[e,t,n]),KL(e&&(!t||i),r)}const Nxe={position:"fixed"},$xe=O.forwardRef(function(t,n){const{anchor:r,className:i,render:o,positionMethod:a,side:s,align:l,sideOffset:u,alignOffset:c,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:h,sticky:v,disableAnchorTracking:y,alignItemWithTrigger:x=!0,collisionAvoidance:g=rge,style:m,...b}=t,S=Aa(),w=eF(),P=S.useState("open"),j=S.useState("mounted"),E=S.useState("modal"),A=S.useState("value"),C=S.useState("openMethod"),T=S.useState("positionerElement"),_=S.useState("triggerElement"),R=S.useState("isItemEqualToValue"),$=S.useState("transitionStatus"),N=O.useRef(null),I=O.useRef(null),[B,k]=O.useState(x),L=j&&B&&C!=="touch";!j&&B!==x&&k(x),O.useImperativeHandle(S.context.alignItemWithTriggerActiveRef,()=>L),kxe((L||E)&&P,C==="touch",T,_);const M=dF({anchor:r,floatingRootContext:w,positionMethod:a,mounted:j,side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:v,disableAnchorTracking:y??L,collisionAvoidance:g,keepMounted:!0}),z=L?"none":M.side,U=L?Nxe:M.positionerStyles,V={open:P,side:z,align:M.align,anchorHidden:M.anchorHidden};fe(()=>{S.set("popupSide",M.side)},[S,M.side]);const W=S.useStateSetter("positionerElement"),Q=hF(t,V,{styles:U,transitionStatus:$,props:b,refs:[n,W],hidden:!j,inert:!P}),G=O.useRef(0),le=de(K=>{if(S.context.valuesRef.current.length===0)return;const ee=G.current;G.current=K.size;const ie=$e(ha);if(ee!==0&&!S.state.multiple&&A!==null&&ah(S.context.valuesRef.current,A,R)===-1){const Z=S.context.initialValueRef.current,se=Z!=null&&ah(S.context.valuesRef.current,Z,R)!==-1?Z:null;S.context.setValue(se,ie),se===null&&(S.set("selectedIndex",null),S.context.selectedItemTextRef.current=null)}if(ee!==0&&S.state.multiple&&Array.isArray(A)){const H=A.filter(Z=>ah(S.context.valuesRef.current,Z,R)!==-1);H.length!==A.length&&(S.context.setValue(H,ie),H.length===0&&(S.set("selectedIndex",null),S.context.selectedItemTextRef.current=null))}if(P&&L){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const H={height:""};Jm(T,H),Jm(S.context.popupRef.current,H)}}),X=O.useMemo(()=>({...M,side:z,alignItemWithTriggerActive:L,setControlledAlignItemWithTrigger:k,scrollUpArrowRef:N,scrollDownArrowRef:I}),[M,z,L,k]);return d.jsx(LO,{elementsRef:S.context.listRef,labelsRef:S.context.labelsRef,onMapChange:le,children:d.jsxs(pF.Provider,{value:X,children:[j&&E&&d.jsx(WL,{inert:VL(!P),cutout:_}),Q]})})}),Mp="base-ui-disable-scrollbar",T_={className:Mp,getElement(e){return d.jsx("style",{nonce:e,href:Mp,precedence:"base-ui:low",children:`.${Mp}{scrollbar-width:none}.${Mp}::-webkit-scrollbar{display:none}`})}},Mxe=O.createContext(void 0);function Ixe(e){return O.useContext(Mxe)}const Dxe=O.createContext(void 0),Lxe={disableStyleElements:!1};function Fxe(){return O.useContext(Dxe)??Lxe}const __="--transform-origin",Bxe={...yy,...lO},Uxe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,finalFocus:a,...s}=t,l=Aa(),{multiple:u,readOnly:c,highlightItemOnHover:f}=IO(),p=eF(),{side:h,align:v,alignItemWithTriggerActive:y,isPositioned:x,setControlledAlignItemWithTrigger:g}=Txe(),m=Ixe()!=null,b=FO(),{nonce:S,disableStyleElements:w}=Fxe(),P=l.useState("id"),j=l.useState("open"),E=l.useState("openMethod"),A=l.useState("mounted"),C=l.useState("popupProps"),T=l.useState("transitionStatus"),_=l.useState("triggerElement"),R=l.useState("positionerElement"),$=l.useState("listElement"),N=O.useRef(!1),I=O.useRef(!1),B=O.useRef({}),k=Ou(),L=de(V=>{if(!R||!l.context.popupRef.current||!I.current)return;const W=R.style.top==="0px",Q=R.style.bottom==="0px";if(N.current||!y||!W&&!Q){l.context.handleScrollArrowVisibility(V);return}const G=k_(R),le=Dc(R.getBoundingClientRect().height,"y",G),X=He(R),K=ct(R),ee=K.getComputedStyle(R),ie=parseFloat(ee.marginTop),H=parseFloat(ee.marginBottom),Z=R_(K.getComputedStyle(l.context.popupRef.current)),J=Math.min(X.documentElement.clientHeight-ie-H,Z),se=V.scrollTop,we=Ip(V);let ae=null;const be=Se=>{R.style.height=`${Se}px`},ce=W?we-se:se,Ee=Math.min(le+ce,J);if(ce<=Mi){const Se=Ic(ce,0,J-le);Se>0&&be(le+Se),V.scrollTop=W?we:0,J-(le+Se)<=Mi&&(N.current=!0),l.context.handleScrollArrowVisibility(V);return}if(J-Ee>Mi)ae=W?1/0:0;else if(Q&&se<we){const Se=le+ce-J;ae=se-(ce-Se)}const je=Math.ceil(Ee);if(je!==0&&be(je),ae!=null){const Se=Ic(ae,0,Ip(V));Math.abs(V.scrollTop-Se)>Mi&&(V.scrollTop=Se)}je>=J-Mi&&(N.current=!0),l.context.handleScrollArrowVisibility(V)});O.useImperativeHandle(l.context.scrollHandlerRef,()=>L,[L]),$d({open:j,ref:l.context.popupRef,onComplete(){j&&l.context.onOpenChangeComplete(!0)}});const M={open:j,transitionStatus:T,side:h,align:v};fe(()=>{!R||!l.context.popupRef.current||Object.keys(B.current).length||(B.current={top:R.style.top||"0",left:R.style.left||"0",right:R.style.right,height:R.style.height,bottom:R.style.bottom,minHeight:R.style.minHeight,maxHeight:R.style.maxHeight,marginTop:R.style.marginTop,marginBottom:R.style.marginBottom})},[l,R]),fe(()=>{j||y||(I.current=!1,N.current=!1,Jm(R,B.current))},[j,y,R]),fe(()=>{var Q,G;const V=l.context.popupRef.current;if(!j||!_||!R||!V||y&&!x||l.state.transitionStatus==="ending")return;if(I.current=!0,V.style.removeProperty(__),!y){k.request(()=>l.context.handleScrollArrowVisibility($||V));return}const W=zxe(V);try{let le=l.context.selectedItemTextRef.current;le!=null&&le.isConnected||(le=!l.select("hasSelectedValue")&&((Q=l.context.firstItemTextRef.current)!=null&&Q.isConnected)?l.context.firstItemTextRef.current:null);const X=l.context.valueRef.current,K=ct(R),ee=K.getComputedStyle(R),ie=K.getComputedStyle(V),H=He(_),Z=k_(_),J=Dp(_.getBoundingClientRect(),Z),se=Dp(R.getBoundingClientRect(),Z),we=J.height,ae=$||V,be=ae.scrollHeight,ce=parseFloat(ie.borderBottomWidth),Ee=parseFloat(ee.marginTop)||10,je=parseFloat(ee.marginBottom)||10,Se=parseFloat(ee.minHeight)||100,ze=R_(ie),te=5,pe=5,oe=20,Y=H.documentElement.clientHeight-Ee-je,ge=H.documentElement.clientWidth,Ce=Y-J.bottom+we;let Fe,nn=b==="rtl"?J.right-se.width:J.left,Tn=0;if(le&&X){const qt=Dp(X.getBoundingClientRect(),Z);Fe=Dp(le.getBoundingClientRect(),Z),nn=se.left+(b==="rtl"?qt.right-Fe.right:qt.left-Fe.left);const Te=qt.top-J.top+qt.height/2;Tn=Fe.top-se.top+Fe.height/2-Te}const bt=Ce+Tn+je+ce;let yn=Math.min(Y,bt);const er=Y-Ee-je,_n=bt-yn,ti=ge-pe;R.style.left=`${Ic(nn,te,ti-se.width)}px`,R.style.height=`${yn}px`,R.style.maxHeight="none",R.style.marginTop=`${Ee}px`,R.style.marginBottom=`${je}px`,V.style.height="100%";const Mr=Ip(ae),Ei=_n>=Mr-Mi;Ei&&(yn=Math.min(Y,se.height)-(_n-Mr));const mr=J.top<oe||J.bottom>Y-oe||Math.ceil(yn)+Mi<Math.min(be,Se),Ai=(((G=K.visualViewport)==null?void 0:G.scale)??1)!==1&&Oo;if(mr||Ai){Jm(R,B.current),g(!1);return}const Ir=Math.max(Se,yn);if(Ei){const qt=Math.max(0,Y-bt);R.style.top=se.height>=er?"0":`${qt}px`,R.style.height=`${yn}px`,ae.scrollTop=Ip(ae)}else R.style.bottom="0",ae.scrollTop=_n;if(Fe){const qt=se.top,Te=se.height,Ct=Fe.top+Fe.height/2,rn=Ic(Te>0?(Ct-qt)/Te*100:50,0,100);V.style.setProperty(__,`50% ${rn}%`)}(Ir===Y||yn>=ze)&&(N.current=!0),l.context.handleScrollArrowVisibility(ae),f&&l.state.selectedIndex===null&&l.state.activeIndex===null&&l.context.listRef.current[0]!=null&&l.set("activeIndex",0)}finally{W()}},[l,j,R,_,y,g,k,$,f,b,x]),O.useEffect(()=>{if(!y||!R||!j)return;const V=ct(R);function W(Q){l.context.setOpen(!1,$e(gme,Q))}return Ne(V,"resize",W)},[l,y,R,j]);const z={...$?{role:"presentation"}:{role:"listbox","aria-multiselectable":u||void 0,"aria-readonly":c||void 0,id:`${P}-list`},onKeyDown(V){m&&MO.has(V.key)&&V.stopPropagation()},onScroll(V){$||L(V.currentTarget)},...y&&{style:$?{height:"100%"}:_xe},className:!$&&y?T_.className:void 0},U=tn("div",t,{ref:[n,l.context.popupRef],state:M,stateAttributesMapping:Bxe,props:[C,z,BO(T),s]});return d.jsxs(O.Fragment,{children:[!w&&T_.getElement(S),d.jsx(yL,{context:p,modal:!1,disabled:!A,openInteractionType:E,returnFocus:a,restoreFocus:!0,children:U})]})});function R_(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function Ip(e){return lF(e.scrollHeight,e.clientHeight)}function k_(e){return OL.getScale(e)}function Dc(e,t,n){return e/n[t]}function Dp(e,t){return ud({x:Dc(e.x,"x",t),y:Dc(e.y,"y",t),width:Dc(e.width,"x",t),height:Dc(e.height,"y",t)})}const N_=[["transform","none"],["scale","1"],["translate","0 0"]];function zxe(e){const{style:t}=e,n={};for(const[r,i]of N_)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of N_){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}function mF(e={}){const{guess:t,label:n,metadata:r,textRef:i,index:o}=e,{register:a,unregister:s,subscribeMapChange:l,nextIndexRef:u}=dxe(),c=O.useRef(-1),[f,p]=O.useState(o==null&&t?()=>{if(c.current===-1){const x=u.current;u.current+=1,c.current=x}return c.current}:-1),h=o??f,v=O.useRef(null),y=O.useCallback(x=>{const g=v.current;g&&s(g),v.current=x,x&&a(x,{metadata:r??null,index:o??null,label:n,textRef:i})},[o,a,s,r,n,i]);return fe(()=>{if(o==null)return l(x=>{var m;const g=v.current?(m=x.get(v.current))==null?void 0:m.index:null;g!=null&&p(g)})},[o,l]),{ref:y,index:h}}const gF=O.createContext(void 0);function Hxe(){const e=O.useContext(gF);if(!e)throw new Error(gn(57));return e}const Vxe=O.memo(O.forwardRef(function(t,n){const{render:r,className:i,style:o,value:a=null,label:s,disabled:l=!1,nativeButton:u=!1,...c}=t,f=O.useRef(null),p=mF({guess:!0,label:s,textRef:f}),h=Aa(),{itemProps:v,multiple:y,disabled:x,readOnly:g}=IO(),m=x||l,b=h.useState("isActive",p.index),S=h.useState("open"),w=h.useState("isSelected",a),P=h.useState("isSelectedByFocus",p.index),j=h.useState("isItemEqualToValue"),E=p.index,A=O.useRef(null);fe(()=>{const M=h.context.valuesRef.current;return M[E]=a,()=>{delete M[E]}},[E,a,h]),fe(()=>{const M=h.state.value,z=h.state.selectedIndex;let U=z,V;y&&Array.isArray(M)?(U=Vve(E,a,h.context.valuesRef.current,M,j,z),V=U===E,E===z&&!V&&(h.context.selectedItemTextRef.current=null)):(V=M!==void 0&&Rs(a,M,j),V&&(U=E)),h.set("selectedIndex",U),V&&f.current&&(h.context.selectedItemTextRef.current=f.current)},[E,y,j,h,a]);const C=O.useRef("mouse"),T=O.useRef(!1),{getButtonProps:_,buttonRef:R}=hO({disabled:m,focusableWhenDisabled:!0,native:u,composite:!0}),$={disabled:m,selected:w,highlighted:b};function N(M){if(x||g)return;const z=h.state.value;if(y){const U=Array.isArray(z)?z:[],V=w?Wve(U,a,j):[...U,a];h.context.setValue(V,$e(Zv,M))}else h.context.setValue(a,$e(Zv,M)),h.context.setOpen(!1,$e(Zv,M))}function I(){h.context.selectionRef.current.dragY=0}const B={role:"option","aria-selected":w,tabIndex:S&&b?0:-1,onKeyDown(M){h.set("activeIndex",E),M.key===" "&&h.context.typingRef.current&&M.preventDefault()},onClick(M){const z=C.current!=="touch",U=M.nativeEvent.pointerType,V=z&&jy(M.nativeEvent)&&(U!==void 0||b),W=z&&!V&&!T.current;T.current=!1,!(m||W)&&N(M.nativeEvent)},onPointerEnter(M){C.current=M.pointerType},onPointerMove(M){if(M.pointerType==="mouse"&&M.buttons===1){const z=h.context.selectionRef.current;z.dragY+=M.movementY,z.dragY**2>=64&&(z.allowUnselectedMouseUp=!0)}},onPointerDown(M){C.current=M.pointerType,T.current=!0,I()},onMouseUp(){var U;if(I(),m||C.current==="touch"||T.current)return;const M=!h.context.selectionRef.current.allowSelectedMouseUp&&w,z=!h.context.selectionRef.current.allowUnselectedMouseUp&&!w;M||z||(T.current=!0,(U=A.current)==null||U.click(),T.current=!1)}},k=tn("div",t,{ref:[R,n,p.ref,A],state:$,props:[v,B,c,_]}),L=O.useMemo(()=>({selected:w,index:E,textRef:f,selectedByFocus:P}),[w,E,f,P]);return d.jsx(gF.Provider,{value:L,children:k})})),Wxe=O.memo(O.forwardRef(function(t,n){const{index:r,textRef:i,selectedByFocus:o}=Hxe(),a=Aa(),{render:s,className:l,style:u,...c}=t,f=O.useCallback(h=>{h&&(r===0&&(a.context.firstItemTextRef.current=h),o&&(a.context.selectedItemTextRef.current=h))},[a,r,o]);return tn("div",t,{ref:[f,n,i],props:c})})),Kxe=O.createContext(void 0);function qxe(){const e=O.useContext(Kxe);if(e===void 0)throw new Error(gn(56));return e}const Gxe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,id:a,...s}=t,{setLabelId:l}=qxe(),u=Yu(a);return fe(()=>(l(u),()=>{l(f=>f===u?void 0:f)}),[u,l]),tn("div",t,{ref:n,props:[{id:u,"aria-hidden":!0},s]})}),Aw=exe,Cw=uxe,Tw=O.forwardRef(function({className:t,children:n,...r},i){return d.jsxs(sxe,{ref:i,className:gt("inline-flex items-center justify-between gap-1.5 rounded border border-line bg-panel px-2 py-1 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",t),...r,children:[n,d.jsx(cxe,{className:"text-muted-foreground","aria-hidden":"true",children:"▾"})]})}),_w=O.forwardRef(function({className:t,children:n,side:r="bottom",align:i="start",...o},a){return d.jsx(fxe,{children:d.jsx($xe,{side:r,align:i,sideOffset:4,className:"z-50",children:d.jsx(Uxe,{ref:a,className:gt("min-w-[6rem] overflow-hidden rounded border border-line bg-popover p-1 text-popover-foreground shadow-lg font-mono",t),...o,children:n})})})}),Lc=O.forwardRef(function({className:t,children:n,...r},i){return d.jsx(Vxe,{ref:i,className:gt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1 text-xs text-foreground outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-panel data-[selected]:text-brand",t),...r,children:d.jsx(Wxe,{children:n})})});O.forwardRef(function({className:t,...n},r){return d.jsx(Gxe,{ref:r,className:gt("px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",t),...n})});const Md=O.forwardRef(function({className:t,containerClassName:n,...r},i){return d.jsx("div",{className:gt("w-full overflow-x-auto",n),children:d.jsx("table",{ref:i,className:gt("w-full border-collapse text-xs",t),...r})})}),Id=O.forwardRef(function({className:t,...n},r){return d.jsx("thead",{ref:r,className:gt("border-b border-line text-left text-[10px] uppercase tracking-wide text-muted-foreground",t),...n})}),Dd=O.forwardRef(function({className:t,...n},r){return d.jsx("tbody",{ref:r,className:gt("divide-y divide-line-soft",t),...n})}),kr=O.forwardRef(function({className:t,...n},r){return d.jsx("tr",{ref:r,className:gt("transition-colors",t),...n})}),Ge=O.forwardRef(function({className:t,...n},r){return d.jsx("th",{ref:r,className:gt("px-3 py-2 font-normal",t),...n})}),nt=O.forwardRef(function({className:t,...n},r){return d.jsx("td",{ref:r,className:gt("px-3 py-2 align-top",t),...n})}),yF=O.createContext(void 0);function vF(){const e=O.useContext(yF);if(e===void 0)throw new Error(gn(64));return e}const Xxe="data-activation-direction",UO={tabActivationDirection:e=>({[Xxe]:e})},Yxe=O.forwardRef(function(t,n){const{className:r,defaultValue:i=0,onValueChange:o,orientation:a="horizontal",render:s,value:l,style:u,...c}=t,f=t.defaultValue!==void 0,p=O.useRef([]),[h,v]=O.useState(()=>new Map),[y,x]=Pw({controlled:l,default:i,name:"Tabs",state:"value"}),g=l!==void 0,[m,b]=O.useState(()=>new Map),S=O.useRef(void 0),w=O.useCallback(X=>Rw(m,X),[m]),[P,j]=O.useState(()=>({previousValue:y,tabActivationDirection:"none"})),{previousValue:E,tabActivationDirection:A}=P;let C=A,T=!1;E!==y&&(C=$_(E,y,a,m),T=E!=null&&y!=null&&w(y)==null);const _=T?E:y,R=E!==_||A!==C;fe(()=>{R&&j({previousValue:_,tabActivationDirection:C})},[_,R,C]);const $=de((X,K)=>{const ee=$_(y,X,a,m);K.activationDirection=ee,o==null||o(X,K),!K.isCanceled&&x(X)}),N=de((X,K)=>{o==null||o(X,$e(K,void 0,void 0,{activationDirection:"none"}))}),I=de((X,K)=>(v(ee=>{const ie=new Map(ee);return ie.set(X,K),ie}),()=>{v(ee=>{if(ee.get(X)!==K)return ee;const ie=new Map(ee);return ie.delete(X),ie})})),B=O.useCallback(X=>h.get(X),[h]),k=O.useCallback(X=>{for(const K of m.values())if(X===K.value)return K.id},[m]),L=O.useMemo(()=>({getTabElementBySelectedValue:w,getTabIdByPanelValue:k,getTabPanelIdByValue:B,onValueChange:$,orientation:a,registerMountedTabPanel:I,setTabMap:b,tabActivationDirection:C,value:y}),[w,k,B,$,a,I,b,C,y]),M=O.useMemo(()=>{for(const X of m.values())if(X.value===y)return X},[m,y]),z=O.useMemo(()=>{for(const X of m.values())if(!X.disabled)return X.value},[m]),U=O.useRef(!f),V=O.useRef(i),W=O.useRef(f),Q=O.useRef(!1);fe(()=>{var H;if(g)return;function X(Z,J){x(Z),j({previousValue:Z,tabActivationDirection:"none"}),N(Z,J),U.current=!1}if(m.size===0){Q.current&&y!==null&&!((H=S.current)!=null&&H.isConnected)&&X(null,HT);return}Q.current=!0,S.current=m.keys().next().value;const K=M==null?void 0:M.disabled,ee=M==null&&y!==null;if(!K&&y===V.current&&(W.current=!1),W.current&&K&&y===V.current)return;const ie=U.current;if(K||ee){const Z=z??null;if(y===Z){U.current=!1;return}let J=HT;ie?J=VT:K&&(J=WD),X(Z,J);return}ie&&M!=null&&(N(y,VT),U.current=!1)},[z,g,N,M,x,m,y]);const le=tn("div",t,{state:{orientation:a,tabActivationDirection:C},ref:n,props:c,stateAttributesMapping:UO});return d.jsx(yF.Provider,{value:L,children:d.jsx(LO,{elementsRef:p,children:le})})});function Rw(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function $_(e,t,n,r){if(e==null||t==null)return"none";const[i,o,a]=n==="horizontal"?["left","left","right"]:["top","up","down"],s=Rw(r,e),l=Rw(r,t);if(s==null||l==null)return s!==l&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?a:o:"none";const u=s.getBoundingClientRect()[i],c=l.getBoundingClientRect()[i];return c<u?o:c>u?a:"none"}const zO="data-composite-item-active";function Qxe(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=pO(),{ref:i,index:o}=mF(e),a=n===o,s=O.useRef(null),l=Es(i,s);return{compositeProps:{tabIndex:a?0:-1,onFocus(){r(o)},onMouseMove(){const c=s.current;if(!t||!c)return;const f=c.hasAttribute("disabled")||c.ariaDisabled==="true";!a&&!f&&c.focus()}},compositeRef:l,index:o}}const xF=O.createContext(void 0);function Jxe(){const e=O.useContext(xF);if(e===void 0)throw new Error(gn(65));return e}const Zxe=O.forwardRef(function(t,n){const{className:r,disabled:i=!1,render:o,value:a,id:s,nativeButton:l=!0,style:u,...c}=t,{value:f,getTabPanelIdByValue:p,onValueChange:h,orientation:v,tabActivationDirection:y}=vF(),{activateOnFocus:x,registerTabResizeObserverElement:g,tabsListElement:m}=Jxe(),{highlightedIndex:b,onHighlightedIndexChange:S}=pO(),w=Yu(s),P=O.useMemo(()=>({disabled:i,id:w,value:a}),[i,w,a]),{compositeProps:j,compositeRef:E,index:A}=Qxe({metadata:P}),C=a===f,T=O.useRef(!1),_=O.useRef(null),R=de(Q=>{var G;(G=_.current)==null||G.call(_),_.current=Q?g(Q):null});fe(()=>{if(T.current){T.current=!1;return}if(!(C&&A>-1&&b!==A))return;const Q=m;if(Q!=null){const G=Mn(He(Q));if(G&&xe(Q,G))return}i||S(A)},[C,A,b,S,i,m]);const{getButtonProps:$,buttonRef:N}=hO({disabled:i,native:l,focusableWhenDisabled:!0}),I=p(a),B=O.useRef(!1),k=O.useRef(!1);function L(Q){h(a,$e(ha,Q.nativeEvent,void 0,{activationDirection:"none"}))}function M(Q){C||i||L(Q)}function z(Q){C||i||x&&(!B.current||k.current)&&L(Q)}function U(Q){if(C||i)return;B.current=!0,k.current=Q.button===0;const G=He(Q.currentTarget);function le(){B.current=!1,k.current=!1,G.removeEventListener("pointerup",le),G.removeEventListener("pointercancel",le)}G.addEventListener("pointerup",le),G.addEventListener("pointercancel",le)}return tn("button",t,{state:{disabled:i,active:C,orientation:v,tabActivationDirection:y},ref:[n,N,E,R],props:[j,{role:"tab","aria-controls":I,"aria-selected":C,id:w,onClick:M,onFocus:z,onPointerDown:U,[zO]:C?"":void 0,onKeyDownCapture(){T.current=!0}},c,$],stateAttributesMapping:UO})});function ebe(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:i,direction:o,highlightedIndex:a,onHighlightedIndexChange:s,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:c,disabledIndices:f,modifierKeys:p=da}=e,[h,v]=O.useState(0),y=r!=null,x=O.useRef(null),g=Es(x,l),m=O.useRef([]),b=O.useRef(!1),S=O.useRef(null),w=a??h,P=de((T,_=!1)=>{if(S.current=m.current[T]??null,(s??v)(T),_){const R=m.current[T];x_(x.current,R,o,n)}}),j=de(T=>{var N;if(T.size===0)return;if(b.current){const I=m.current,B=I.indexOf(S.current);if(B===-1){const k=I[w];!k||Pl(I,w,f)?P(tbe(I,f)):S.current=k}else B!==w&&P(B);return}b.current=!0;const _=Array.from(T.keys()),R=_.find(I=>I==null?void 0:I.hasAttribute(zO))??null,$=R?((N=T.get(R))==null?void 0:N.index)??-1:-1;if($!==-1)P($);else if(Pl(_,w,f)){const I=Ki(_,{disabledIndices:f});ef(_,I)||P(I)}x_(x.current,R,o,n)});fe(()=>{if(f==null||a!=null||!b.current)return;const T=m.current;if(Pl(T,w,f)){const _=Ki(T,{disabledIndices:f});ef(T,_)||P(_)}},[f,a,w,m,P]);const E=de((T,_,R)=>i?i(T,_,R,m):R),A=de(T=>{const _=T.key===Sw||T.key===Ow;if(!MO.has(T.key)||!u&&_||nbe(T,p)||!x.current)return;const $=o==="rtl",N=$?bw:ww,I=$?ww:bw,B=n==="vertical"?xw:N,k=n==="vertical"?vw:I,L=cn(T.nativeEvent);if(L!=null&&v_(L)&&!YL(L)){const Q=L.selectionStart,G=L.selectionEnd,le=L.value;if(Q==null||T.shiftKey||Q!==G||T.key!==k&&Q<le.length||T.key!==B&&Q>0)return}let M=w;const z=rh(m,f),U=pw(m,f);r!=null&&(M=r({disabledIndices:f,elementsRef:m,event:T,highlightedIndex:w,loopFocus:t,maxIndex:U,minIndex:z,onLoop:E,orientation:n,rtl:$}));const V=n!=="vertical"&&T.key===N||n!=="horizontal"&&T.key===xw,W=n!=="vertical"&&T.key===I||n!=="horizontal"&&T.key===vw;u&&(T.key===Sw?M=z:T.key===Ow&&(M=U)),M===w&&(V||W)&&(t&&M===U&&V?(M=z,i&&(M=i(T,w,M,m))):t&&M===z&&W?(M=U,i&&(M=i(T,w,M,m))):M=Ki(m.current,{startingIndex:M,decrement:W,disabledIndices:f})),M!==w&&!ef(m.current,M)&&(c&&T.stopPropagation(),(y||_||V||W)&&T.preventDefault(),P(M,!0),queueMicrotask(()=>{var Q;(Q=m.current[M])==null||Q.focus()}))});return{props:{ref:g,onFocus(T){const _=x.current,R=cn(T.nativeEvent);!_||R==null||!v_(R)||R.setSelectionRange(0,R.value.length)},onKeyDown:A},highlightedIndex:w,onHighlightedIndexChange:P,elementsRef:m,onMapChange:j,relayKeyboardEvent:A}}function tbe(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const i=e[r];if(!(!i||Pl(e,r,t))){if(i.hasAttribute(zO))return r;n===-1&&(n=r)}}return Math.max(n,0)}function nbe(e,t){for(const n of rve)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function rbe(e){const{render:t,className:n,style:r,refs:i=da,props:o=da,state:a=$t,stateAttributesMapping:s,highlightedIndex:l,onHighlightedIndexChange:u,orientation:c,grid:f,loopFocus:p,onLoop:h,enableHomeAndEndKeys:v,onMapChange:y,stopEventPropagation:x=!0,rootRef:g,disabledIndices:m,modifierKeys:b,highlightItemOnHover:S=!1,tag:w="div",...P}=e,j=FO(),{props:E,highlightedIndex:A,onHighlightedIndexChange:C,elementsRef:T,onMapChange:_,relayKeyboardEvent:R}=ebe({grid:f,loopFocus:p,onLoop:h,orientation:c,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:g,stopEventPropagation:x,enableHomeAndEndKeys:v,direction:j,disabledIndices:m,modifierKeys:b}),$=tn(w,e,{state:a,ref:i,props:[E,...o,P],stateAttributesMapping:s}),N=O.useMemo(()=>({highlightedIndex:A,onHighlightedIndexChange:C,highlightItemOnHover:S,relayKeyboardEvent:R}),[A,C,S,R]);return d.jsx(VD.Provider,{value:N,children:d.jsx(LO,{elementsRef:T,onMapChange:I=>{y==null||y(I),_(I)},children:$})})}const ibe=O.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:i,loopFocus:o=!0,render:a,style:s,...l}=t,{orientation:u,setTabMap:c,tabActivationDirection:f}=vF(),[p,h]=O.useState(0),[v,y]=O.useState(null),x=O.useRef(new Set),g=O.useRef(new Set),m=O.useRef(null);fe(()=>{if(typeof ResizeObserver>"u")return;const E=new ResizeObserver(()=>{x.current.forEach(A=>{A()})});return m.current=E,v&&E.observe(v),g.current.forEach(A=>{E.observe(A)}),()=>{E.disconnect(),m.current=null}},[v]);const b=de(E=>(x.current.add(E),()=>{x.current.delete(E)})),S=de(E=>{var A;return g.current.add(E),(A=m.current)==null||A.observe(E),()=>{var C;g.current.delete(E),(C=m.current)==null||C.unobserve(E)}}),w={orientation:u,tabActivationDirection:f},P={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},j=O.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:b,registerTabResizeObserverElement:S,tabsListElement:v}),[r,b,S,v]);return d.jsx(xF.Provider,{value:j,children:d.jsx(rbe,{render:a,className:i,style:s,state:w,refs:[n,y],props:[P,l],stateAttributesMapping:UO,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:o,orientation:u,onHighlightedIndexChange:h,onMapChange:c,disabledIndices:da})})}),obe=Yxe,abe=O.forwardRef(function({className:t,...n},r){return d.jsx(ibe,{ref:r,className:gt("flex flex-wrap gap-1 border-b border-line pb-2",t),...n})}),sbe=O.forwardRef(function({className:t,...n},r){return d.jsx(Zxe,{ref:r,className:gt("flex items-baseline gap-1.5 rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-panel hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[active]:bg-panel-2 data-[active]:text-foreground",t),...n})}),bF=O.createContext(void 0);function Ly(e){const t=O.useContext(bF);if(t===void 0&&!e)throw new Error(gn(72));return t}const lbe={...UL,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,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class ube extends My{constructor(n,r,i){const o=new RO;super(cbe(n,o,r,i),fbe(o),lbe);Ze(this,"setOpen",(n,r)=>{Mye(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,$e(Nd,n))}}function cbe(e,t,n,r=!1){return{...FL(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 fbe(e){return{popupRef:O.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const dbe=CO(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:o=!1,trackCursorAxis:a="none",actionsRef:s,onOpenChange:l,onOpenChangeComplete:u,handle:c,triggerId:f,defaultTriggerId:p=null,children:h}=t,v=NL((T,_)=>new ube({open:r,openProp:i,activeTriggerId:p,triggerIdProp:f},T,_));v.useControlledProp("openProp",i),v.useControlledProp("triggerIdProp",f),v.useContextCallback("onOpenChange",l),v.useContextCallback("onOpenChangeComplete",u);const y=v.useState("open"),x=!n&&y,g=v.useState("activeTriggerId"),m=v.useState("mounted"),b=v.useState("payload");v.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:o,disabled:n}),IL(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:S,transitionStatus:w}=DL(x,v),P=v.useState("isInstantPhase"),j=v.useState("instantType"),E=v.useState("lastOpenChangeReason"),A=O.useRef(null);fe(()=>{y&&n&&v.setOpen(!1,$e(WD))},[y,n,v]),fe(()=>{w==="ending"&&E===ha||w!=="ending"&&P?(j!=="delay"&&(A.current=j),v.set("instantType","delay")):A.current!==null&&(v.set("instantType",A.current),A.current=null)},[w,P,E,j,v]),fe(()=>{x&&g==null&&v.set("payload",void 0)},[v,g,x]),O.useImperativeHandle(s,()=>({unmount:S,close:()=>v.setOpen(!1,$e(KD))}),[S,v]);const C=x||m||!n&&a!=="none";return d.jsxs(bF.Provider,{value:v,children:[c&&d.jsx($L,{handle:c,store:v}),C&&d.jsx(pbe,{store:v,disabled:n,trackCursorAxis:a}),typeof h=="function"?h({payload:b}):h]})});function pbe({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),i=EO(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=hge(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),a=O.useMemo(()=>As(o.reference,i.reference),[o.reference,i.reference]);return LL(e,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??$t}),null}const wF=O.createContext(void 0);function hbe(){return O.useContext(wF)}const mbe=600,SF="data-base-ui-tooltip-trigger";function M_(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(Me(i))return i}}const t=e.target;return Me(t)?t:null}function gbe(e){let t=e;for(;t;){const n=t.closest(`[${SF}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Me(r.host)?r.host:null}return null}const ybe=bye(function(t,n){const{render:r,className:i,style:o,handle:a,payload:s,disabled:l,delay:u,closeOnClick:c=!0,closeDelay:f,id:p,...h}=t,v=Ly(!0),x=Fye(a)??v;if(!x)throw new Error(gn(82));const g=Yu(p),m=x.useState("isTriggerActive",g),b=x.useState("isOpenedByTrigger",g),S=x.useState("floatingRootContext"),w=O.useRef(null),P=f??0,{registerTrigger:j,isMountedByThisTrigger:E}=Iye(g,w,x,{payload:s,closeOnClick:c,closeDelay:P}),A=hbe(),{activeIdRef:C,delayRef:T,isInstantPhase:_,hasProvider:R}=$me(S,{open:b}),$=$O(S);x.useSyncedValue("isInstantPhase",_);const N=x.useState("disabled"),I=l??N,B=Rt(I),k=x.useState("trackCursorAxis"),L=x.useState("disableHoverablePopup"),M=O.useRef(!1),z=cr(),U=O.useRef(void 0);function V(){return R&&C.current!=null?0:u??A??mbe}function W(Z){const J=w.current;if(!J||!Z)return!1;const se=gbe(Z);return se!==null&&se!==J&&xe(J,se)}function Q(Z){const J=W(Z);return M.current=J,J&&($.openChangeTimeout.clear(),$.restTimeout.clear(),$.restTimeoutPending=!1,z.clear()),J}const G=Kye(S,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!L&&k!=="both"?eve():null,restMs:V,delay(){return f==null&&R?{close:Cs(T.current,"close")}:{close:P}},triggerElementRef:w,isActiveTrigger:m,isClosing:()=>x.select("transitionStatus")==="ending",shouldOpen(){return!M.current}}),le=Hye(S,{enabled:!I}).reference,X=Z=>{const J=M.current,se=M_(Z),we=Q(se),ae=w.current,be=ae&&se&&xe(ae,se);if(we&&x.select("open")&&x.select("lastOpenChangeReason")===Wn){x.setOpen(!1,$e(Wn,Z));return}if(J&&!we&&be&&!B.current&&!x.select("open")&&ae&&sa(U.current)){const ce=()=>{!M.current&&!B.current&&!x.select("open")&&x.setOpen(!0,$e(Wn,Z,ae))},Ee=V();Ee===0?(z.clear(),ce()):z.start(Ee,ce)}},K=x.useState("triggerProps",E);return tn("button",t,{state:{open:b},ref:[n,j,w],props:[G,le,E||k!=="none"?K:void 0,{onMouseOver(Z){X(Z.nativeEvent)},onFocus(Z){W(M_(Z.nativeEvent))&&Z.preventBaseUIHandler()},onMouseLeave(){M.current=!1,z.clear(),U.current=void 0},onPointerEnter(Z){U.current=Z.pointerType},onPointerDown(Z){U.current=Z.pointerType,x.set("closeOnClick",c),c&&!x.select("open")&&x.cancelPendingOpen(Z.nativeEvent)},onClick(Z){c&&!x.select("open")&&x.cancelPendingOpen(Z.nativeEvent)},id:g,[cw]:I?"":void 0,[SF]:I?void 0:""},h],stateAttributesMapping:UD})}),OF=O.createContext(void 0);function vbe(){const e=O.useContext(OF);if(e===void 0)throw new Error(gn(70));return e}const xbe=O.forwardRef(function(t,n){const{children:r,container:i,className:o,render:a,style:s,...l}=t,{node:u,subtree:c}=mL({container:i,ref:n,componentProps:t,elementProps:l});return!c&&!u?null:d.jsxs(O.Fragment,{children:[c,u&&po.createPortal(r,u)]})}),bbe=O.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return Ly().useState("mounted")||r?d.jsx(OF.Provider,{value:r,children:d.jsx(xbe,{ref:n,...i})}):null}),PF=O.createContext(void 0);function wbe(){const e=O.useContext(PF);if(e===void 0)throw new Error(gn(71));return e}const Sbe=O.forwardRef(function(t,n){const{render:r,className:i,anchor:o,positionMethod:a="absolute",side:s="top",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:h=5,sticky:v=!1,disableAnchorTracking:y=!1,collisionAvoidance:x=ige,style:g,...m}=t,b=Ly(),S=vbe(),w=b.useState("open"),P=b.useState("mounted"),j=b.useState("trackCursorAxis"),E=b.useState("disableHoverablePopup"),A=b.useState("floatingRootContext"),C=b.useState("instantType"),T=b.useState("transitionStatus"),_=b.useState("adaptiveOrigin"),R=dF({anchor:o,positionMethod:a,floatingRootContext:A,mounted:P,side:s,sideOffset:u,align:l,alignOffset:c,collisionBoundary:f,collisionPadding:p,sticky:v,arrowPadding:h,disableAnchorTracking:y,keepMounted:S,collisionAvoidance:x,adaptiveOrigin:_}),$=O.useMemo(()=>({open:w,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:j!=="none"?"tracking-cursor":C}),[w,R.side,R.align,R.anchorHidden,j,C]),N=hF(t,$,{styles:R.positionerStyles,transitionStatus:T,props:m,refs:[n,b.useStateSetter("positionerElement")],hidden:!P,inert:!w||j==="both"||E});return d.jsx(PF.Provider,{value:R,children:N})}),Obe=O.forwardRef(function(t,n){const{render:r,className:i,style:o,...a}=t,s=Ly(),{side:l,align:u}=wbe(),c=s.useState("open"),f=s.useState("instantType"),p=s.useState("transitionStatus"),h=s.useState("popupProps"),v=s.useState("floatingRootContext"),y=s.useState("disabled"),x=s.useState("closeDelay");$d({open:c,ref:s.context.popupRef,onComplete(){var S,w;c&&((w=(S=s.context).onOpenChangeComplete)==null||w.call(S,!0))}}),Vye(v,{enabled:!y,closeDelay:x});const g=s.useStateSetter("popupElement");return tn("div",t,{state:{open:c,side:l,align:u,instant:f,transitionStatus:p},ref:[n,s.context.popupRef,g],props:[_O,h,BO(p),a],stateAttributesMapping:zD})}),Pbe=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,o=O.useMemo(()=>({open:n,close:r}),[n,r]);return d.jsx(wF.Provider,{value:n,children:d.jsx(Nme,{delay:o,timeoutMs:i,children:t.children})})},jbe=Pbe,HO=dbe,VO=ybe,WO=O.forwardRef(function({className:t,side:n="top",sideOffset:r=6,...i},o){return d.jsx(bbe,{children:d.jsx(Sbe,{side:n,sideOffset:r,className:"z-50",children:d.jsx(Obe,{ref:o,className:gt("max-w-xs rounded border border-line bg-popover px-2 py-1 text-[11px] leading-snug text-popover-foreground shadow-lg font-mono",t),...i})})})}),Ebe=new Set(["get","set","delete","clear"]);function Abe(e){if(typeof e!="object"||e===null||!("operation"in e)||!("hit"in e)||!("key"in e))return!1;const{operation:t,hit:n,key:r}=e;return typeof t!="string"||!Ebe.has(t)||n!==null&&typeof n!="boolean"?!1:typeof r=="string"}function Ec(e,t){return{label:e,variant:t,className:GS({variant:t})}}function Cbe(e){if(!Abe(e))return null;const t=typeof e.tier=="string"?` ${e.tier.toUpperCase()}`:"";if(e.operation==="set")return Ec(`SET${t}`,"muted");if(e.operation==="delete")return Ec("DEL","muted");if(e.operation==="clear")return Ec("CLEAR","muted");if(e.hit===!0){const n=e.stale===!0;return Ec(`${n?"HIT·STALE":"HIT"}${t}`,n?"warn":"good")}return e.hit===!1?Ec(`MISS${t}`,"warn"):null}function jF({content:e}){const t=Cbe(e);return t===null?null:d.jsx(XS,{variant:t.variant,children:t.label})}function Tbe(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.component!="string")return null;const n=typeof t.props=="object"&&t.props!==null?t.props:{},r=typeof n.deferred=="object"&&n.deferred!==null?n.deferred:{};return{isPartial:t.isPartial===!0,versionMismatch:t.versionMismatch===!0,pageBytes:typeof t.pageBytes=="number"?t.pageBytes:0,deferred:r}}function Lp(e,t){return{label:e,variant:t,className:GS({variant:t})}}function EF(e){if(!Number.isFinite(e)||e<=0)return"0 B";if(e<1024)return`${e} B`;const t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}function _be(e){const t=Tbe(e);if(t===null)return[];const n=[];return t.versionMismatch&&n.push(Lp("409","bad")),t.isPartial&&n.push(Lp("partial","warn")),Object.keys(t.deferred).length>0&&n.push(Lp("deferred","brand")),n.push(Lp(EF(t.pageBytes),"muted")),n}function AF({content:e}){const t=_be(e);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center gap-1",children:t.map(n=>d.jsx(XS,{variant:n.variant,children:n.label},n.label))})}const Eu="user:";function CF(e){for(const t of e)if(t.startsWith(Eu)&&t.length>Eu.length)return t;return null}function KO(e){return e.slice(Eu.length)}function TF(e){return`#/entries?tag=${encodeURIComponent(e)}`}const Rbe=Eu;function kbe(e){return e.startsWith(Eu)&&e.length>Eu.length}function Zm(e){const t=e.content;if(typeof t=="object"&&t!==null){const n=t;if(typeof n.uri=="string")return typeof n.method=="string"?`${n.method} ${n.uri}`:n.uri;if(typeof n.sql=="string")return n.sql;if(typeof n.queue=="string"&&typeof n.name=="string")return`${n.queue}:${n.name}`;if(e.type==="dump")return typeof n.label=="string"&&n.label.length>0?n.label:$be(n.value);if(e.type==="event"&&typeof n.name=="string")return n.name;if(e.type==="model"&&typeof n.action=="string"){const r=typeof n.entity=="string"?n.entity:"",i=n.id===null||n.id===void 0?"":`#${String(n.id)}`;return`${n.action} ${r}${i}`}if(e.type==="redis"&&typeof n.command=="string")return`${n.command} ${Nbe(n.args)}`.trim();if(e.type==="inertia"&&typeof n.component=="string"){const r=typeof n.method=="string"?n.method:"",i=n.isPartial===!0?" (partial)":"";return`${r} → ${n.component}${i}`.trim()}if(e.type==="log"&&typeof n.message=="string")return`[${typeof n.level=="string"?n.level:"log"}] ${n.message}`;if(typeof n.message=="string")return n.message;if(typeof n.url=="string")return typeof n.method=="string"?`${n.method} ${n.url}`:n.url}return e.type}function Nbe(e){if(!Array.isArray(e)||e.length===0)return"";const t=e.map(n=>typeof n=="string"?n:String(n)).join(" ");return t.length>60?`${t.slice(0,60)}…`:t}function $be(e){if(typeof e=="string")return e;let t;try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>80?`${t.slice(0,80)}…`:t}function _F({entries:e,onSelect:t}){return d.jsxs(Md,{className:"text-left",children:[d.jsx(Id,{children:d.jsxs(kr,{children:[d.jsx(Ge,{className:"px-0 py-2",children:"Time"}),d.jsx(Ge,{className:"px-0",children:"Type"}),d.jsx(Ge,{className:"px-0",children:"Summary"}),d.jsx(Ge,{className:"px-0",children:"Duration"}),d.jsx(Ge,{className:"px-0",children:"Tags"})]})}),d.jsx(Dd,{children:e.map(n=>{const r=CF(n.tags),i=n.tags.filter(o=>o!==r);return d.jsxs(kr,{onClick:()=>t==null?void 0:t(n.id),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(t==null||t(n.id))},className:"cursor-pointer hover:bg-panel",children:[d.jsx(nt,{className:"px-0 py-1.5 align-middle text-muted-foreground",children:new Date(n.createdAt).toLocaleTimeString()}),d.jsx(nt,{className:"px-0 py-1.5 align-middle text-brand",children:n.type}),d.jsx(nt,{className:"max-w-md truncate px-0 py-1.5 align-middle text-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.type==="cache"?d.jsx(jF,{content:n.content}):null,n.type==="inertia"?d.jsx(AF,{content:n.content}):null,d.jsx("span",{className:"truncate",children:Zm(n)})]})}),d.jsx(nt,{className:"px-0 py-1.5 align-middle text-muted-foreground",children:n.durationMs!=null?`${n.durationMs}ms`:"—"}),d.jsx(nt,{className:"px-0 py-1.5 align-middle text-muted-foreground",children:d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.traceId!==null&&d.jsxs("a",{href:`#/traces/${n.traceId}`,title:`View trace ${n.traceId}`,onClick:o=>o.stopPropagation(),className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-brand hover:bg-panel-2",children:["trace:",n.traceId.slice(0,6)]}),r!==null&&d.jsx("a",{href:TF(r),title:`View all activity for user ${KO(r)}`,onClick:o=>o.stopPropagation(),className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-good hover:bg-panel-2",children:r}),i.length>0&&d.jsx("span",{children:i.join(" ")})]})})]},n.id)})})]})}function Mbe({batch:e,currentId:t,onSelect:n}){return d.jsx("ol",{className:"space-y-1",children:[...e].sort((r,i)=>r.sequence-i.sequence).map(r=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n(r.id),className:`flex w-full justify-between gap-4 px-2 py-1 text-left text-xs ${r.id===t?"bg-panel-2 text-brand":"text-muted-foreground hover:bg-panel"}`,children:[d.jsxs("span",{children:[d.jsx("span",{className:"text-brand",children:r.type})," ",Zm(r)]}),d.jsx("span",{className:"text-muted-foreground",children:r.durationMs!=null?`${r.durationMs}ms`:""})]})},r.id))})}const Ibe={request:"bg-sky-500",query:"bg-amber-500",http_client:"bg-violet-500",job:"bg-emerald-500",cache:"bg-teal-500",exception:"bg-rose-500",event:"bg-indigo-500",log:"bg-zinc-500",mail:"bg-pink-500",redis:"bg-red-500"};function Dbe(e){return Ibe[e]??"bg-zinc-600"}function sh(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function Lbe(e){const t=[],n=r=>{for(const i of r)t.push(i),i.children.length>0&&n(i.children)};return n(e),t}function Fbe({span:e,totalDurationMs:t,onSelect:n}){const r=t>0?t:1,i=Math.min(100,e.offsetMs/r*100),o=Math.max(.5,Math.min(100-i,e.durationMs/r*100));return d.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n(e.id),"data-testid":"waterfall-row",className:"flex w-full items-center gap-2 rounded px-1 py-0.5 text-left text-[11px] hover:bg-panel-2",children:[d.jsxs("span",{className:"min-w-0 flex-shrink-0 truncate font-mono text-foreground",style:{width:"40%",paddingLeft:`${e.depth*12}px`},title:e.label,children:[d.jsx("span",{className:"mr-1 text-muted-foreground",children:e.type}),e.label]}),d.jsx("span",{className:"relative h-3 flex-1 rounded bg-panel",children:d.jsx("span",{className:`absolute top-0 h-3 rounded ${Dbe(e.type)}`,style:{left:`${i}%`,width:`${o}%`},title:`${sh(e.offsetMs)} +${sh(e.durationMs)}`})}),d.jsx("span",{className:"w-16 flex-shrink-0 text-right tabular-nums text-muted-foreground",children:sh(e.durationMs)})]})}function Bbe({waterfall:e,onSelect:t}){const n=Lbe(e.spans);return n.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No spans in this trace"}):d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{className:"mb-1 flex items-center justify-between text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx("span",{children:"Span"}),d.jsxs("span",{children:["Total ",sh(e.totalDurationMs)]})]}),n.map(r=>d.jsx(Fbe,{span:r,totalDurationMs:e.totalDurationMs,onSelect:t},r.id))]})}function Ube(e,t=.002){const n=e.totalMs>0?e.totalMs:1,r=[],i=(o,a,s,l,u)=>{if(l<t)return;r.push({key:u,node:o,depth:a,x:s,width:l});const c=[...o.children].sort((p,h)=>h.totalMs-p.totalMs);let f=s;for(let p=0;p<c.length;p++){const h=c[p];if(h===void 0)continue;const v=h.totalMs/n*1;i(h,a+1,f,v,`${u}.${p}`),f+=v}};return i(e,0,0,1,"0"),r}function zbe(e){return e.reduce((t,n)=>Math.max(t,n.depth),0)+1}function Hbe(e){let t=0;for(let o=0;o<e.length;o++)t=t*31+e.charCodeAt(o)|0;const n=Math.abs(t)%46,r=55+Math.abs(t>>8)%25,i=45+Math.abs(t>>16)%12;return`hsl(${n}, ${r}%, ${i}%)`}function fd(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}const ux=18;function Vbe({tree:e}){const[t,n]=O.useState("0"),r=O.useMemo(()=>Ube(e),[e]),i=zbe(r),o=r.find(f=>f.key===t)??r[0],a=(o==null?void 0:o.x)??0,s=(o==null?void 0:o.width)??1,l=(o==null?void 0:o.depth)??0;if(e.totalMs<=0||r.length===0)return d.jsx("div",{className:"flex h-24 items-center justify-center rounded-lg border border-line bg-panel/40 text-xs text-muted-foreground",children:"No samples — the capture was empty."});const u=r.filter(f=>f.key===t||f.key.startsWith(`${t}.`)),c=i-l;return d.jsxs("div",{children:[t!=="0"&&d.jsx("button",{type:"button",onClick:()=>n("0"),className:"mb-2 rounded border border-line px-2 py-0.5 text-[10px] text-foreground hover:bg-panel-2",children:"← Reset zoom"}),d.jsx("div",{"data-testid":"flamegraph",className:"relative w-full overflow-hidden rounded-lg border border-line bg-background",style:{height:c*ux+2},children:u.map(f=>{const p=(f.x-a)/s*100,h=f.width/s*100,v=(f.depth-l)*ux,y=(f.node.totalMs/e.totalMs*100).toFixed(1);return d.jsx("button",{type:"button",onClick:()=>n(f.key),title:`${f.node.name}${f.node.file?` — ${f.node.file}`:""}
155
155
  total ${fd(f.node.totalMs)} (${y}%) · self ${fd(f.node.selfMs)}`,className:"absolute flex items-center overflow-hidden border border-line-soft/60 px-1 text-left text-[10px] leading-none text-black/80 hover:brightness-110",style:{left:`${p}%`,width:`${h}%`,top:v,height:ux-1,background:f.node.name==="(root)"?"var(--line)":Hbe(f.node.name)},children:d.jsx("span",{className:"truncate",style:f.node.name==="(root)"?{color:"var(--text)"}:{},children:f.node.name})},f.key)})})]})}function RF(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}async function Wbe(e){var r;const t=RF(e),n=(r=globalThis.navigator)==null?void 0:r.clipboard;if(!(n!=null&&n.writeText))return!1;try{return await n.writeText(t),!0}catch{return!1}}function qO(e,t){const n=RF(t),r=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i)}const I_="rounded border border-line bg-panel px-2.5 py-1 text-[11px] text-foreground transition-colors hover:border-line hover:bg-panel-2 hover:text-foreground";function Kbe({value:e,filename:t}){const[n,r]=O.useState(!1);async function i(){await Wbe(e)&&(r(!0),setTimeout(()=>r(!1),1500))}return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:i,className:I_,children:n?"Copied":"Copy JSON"}),d.jsx("button",{type:"button",onClick:()=>qO(t,e),className:I_,children:"Download JSON"})]})}function qbe({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.component=="string"?t.component:"",r=typeof t.method=="string"?t.method:"",i=typeof t.url=="string"?t.url:"",o=typeof t.statusCode=="number"?t.statusCode:null,a=t.isPartial===!0,s=t.versionMismatch===!0,l=typeof t.assetVersion=="string"?t.assetVersion:null,u=typeof t.clientVersion=="string"?t.clientVersion:null,c=t.encryptHistory===!0,f=t.clearHistory===!0,p=typeof t.pageBytes=="number"?t.pageBytes:0,h=t.ssr===!0,v=Gbe(t.partial),y=Xbe(t.props),x=Ybe([...v.except,...y.excludedKeys]),g=[{label:"Shared",keys:y.sharedKeys,accent:"text-sky-300"},{label:"Final",keys:y.finalKeys,accent:"text-foreground"},{label:"Optional",keys:y.optionalKeys,accent:"text-indigo-300"},{label:"Once",keys:y.onceKeys,accent:"text-fuchsia-300"},{label:"Merge",keys:y.merge,accent:"text-teal-300",annotations:y.matchPropsOn},{label:"Deep-merge",keys:y.deepMerge,accent:"text-teal-300",annotations:y.matchPropsOn},{label:"Prepend",keys:y.prepend,accent:"text-teal-300",annotations:y.matchPropsOn},{label:"Rescued",keys:y.rescued,accent:"text-bad"}];return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-2 flex flex-wrap items-center gap-2 font-mono text-sm text-cyan-400",children:[r?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] uppercase",children:r}):null,i?d.jsx("span",{className:"text-muted-foreground",children:i}):null,d.jsx("span",{className:"text-muted-foreground",children:"→"}),d.jsx("span",{className:"text-foreground",children:n}),o!==null?d.jsx("span",{className:`rounded bg-panel px-1.5 py-0.5 text-[10px] ${o===409?"text-bad":"text-muted-foreground"}`,children:o}):null,a?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-warn",children:"partial"}):null,l?d.jsxs("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["asset ",l]}):null]}),s?d.jsxs("div",{className:"mb-4 rounded border border-bad tint-bad p-3 text-xs text-bad",children:["Version mismatch: client ",d.jsx("code",{className:"font-mono",children:u??"unknown"})," ≠ server ",d.jsx("code",{className:"font-mono",children:l??"unknown"})," → 409 forced full reload."]}):null,a?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Partial reload"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx(D_,{label:"Kept",keys:v.only,accent:"text-brand"}),d.jsx(D_,{label:"Excluded",keys:x,accent:"text-bad"})]}),v.reset.length>0||v.resetOnce.length>0||v.exceptOnce.length>0?d.jsxs("div",{className:"mt-2 flex flex-wrap gap-3",children:[d.jsx(Fp,{label:"reset",keys:v.reset,accent:"text-warn"}),d.jsx(Fp,{label:"reset-once",keys:v.resetOnce,accent:"text-warn"}),d.jsx(Fp,{label:"except-once",keys:v.exceptOnce,accent:"text-warn"})]}):null]}):null,d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Props"}),d.jsx("div",{className:"flex flex-col gap-1.5",children:g.map(m=>O.createElement(Fp,{...m,key:m.label}))})]}),Object.keys(y.deferred).length>0?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Deferred"}),d.jsx("div",{className:"flex flex-col gap-1.5",children:Object.entries(y.deferred).map(([m,b])=>d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsxs("span",{className:"font-mono text-[11px] text-violet-300",children:[m,":"]}),b.map(S=>d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:S},S))]},m))})]}):null,Object.keys(y.once).length>0?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Once cache"}),d.jsx("div",{className:"flex flex-col gap-1.5",children:Object.entries(y.once).map(([m,b])=>d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-fuchsia-300",children:m}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["→ ",b.prop]}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:b.expiresAt==null?"no expiry":`expires ${b.expiresAt}`})]},m))})]}):null,Object.keys(y.scroll).length>0?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Scroll"}),d.jsx("div",{className:"flex flex-col gap-1.5",children:Object.entries(y.scroll).map(([m,b])=>d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] text-teal-300",children:m}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["page «",b.pageName,"»"]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[cx(b.previousPage)," ← ",cx(b.currentPage)," →"," ",cx(b.nextPage)]}),b.reset?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-warn",children:"reset"}):null]},m))})]}):null,d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Resolved props"}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.resolvedProps)})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx(L_,{label:"encryptHistory",on:c}),d.jsx(L_,{label:"clearHistory",on:f}),d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-muted-foreground",children:EF(p)}),d.jsxs("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["SSR: ",h?"yes":"no"]})]})]})}function Gbe(e){const t=typeof e=="object"&&e!==null?e:{};return{only:Vn(t.only),except:Vn(t.except),reset:Vn(t.reset),resetOnce:Vn(t.resetOnce),exceptOnce:Vn(t.exceptOnce)}}function Xbe(e){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.deferred=="object"&&t.deferred!==null?t.deferred:{},r={};if(typeof t.matchPropsOn=="object"&&t.matchPropsOn!==null)for(const[a,s]of Object.entries(t.matchPropsOn))r[a]=Array.isArray(s)?s.join(", "):String(s);const i=typeof t.once=="object"&&t.once!==null?t.once:{},o=typeof t.scroll=="object"&&t.scroll!==null?t.scroll:{};return{sharedKeys:Vn(t.sharedKeys),finalKeys:Vn(t.finalKeys),deferred:n,merge:Vn(t.merge),deepMerge:Vn(t.deepMerge),prepend:Vn(t.prepend),matchPropsOn:r,optionalKeys:Vn(t.optionalKeys),onceKeys:Vn(t.onceKeys),once:i,scroll:o,rescued:Vn(t.rescued),excludedKeys:Vn(t.excludedKeys)}}function Vn(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function cx(e){return e==null?"∅":String(e)}function Ybe(e){return[...new Set(e)]}function Fp({label:e,keys:t,accent:n,annotations:r}){return t.length===0?null:d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx("span",{className:"w-20 shrink-0 text-[11px] text-muted-foreground",children:e}),t.map(i=>{const o=r==null?void 0:r[i];return d.jsxs("span",{className:`rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] ${n}`,children:[i,o?d.jsxs("span",{className:"text-muted-foreground",children:[" · ",o]}):null]},i)})]})}function D_({label:e,keys:t,accent:n}){return d.jsxs("div",{className:"rounded bg-panel p-2",children:[d.jsx("div",{className:"mb-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),t.length>0?d.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(r=>d.jsx("span",{className:`font-mono text-[10px] ${n}`,children:r},r))}):d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"—"})]})}function L_({label:e,on:t}){return d.jsxs("span",{className:`rounded bg-panel px-1.5 py-0.5 text-[10px] ${t?"text-brand":"text-muted-foreground"}`,children:[e,": ",t?"on":"off"]})}const Qbe=50;function Jbe({batch:e,requestId:t,onSelect:n}){const r=[...e].sort((s,l)=>s.sequence-l.sequence),i=r.reduce((s,l)=>l.durationMs!=null&&l.durationMs>s?l.durationMs:s,0),o=r.slice(0,Qbe),a=r.length-o.length;return d.jsxs("div",{children:[d.jsx("ol",{className:"space-y-1",children:o.map(s=>d.jsx("li",{children:d.jsx(Zbe,{entry:s,maxDuration:i,isRequest:s.id===t,onSelect:n})},s.id))}),a>0?d.jsxs("p",{className:"mt-1 px-2 text-[10px] text-muted-foreground",children:["+",a," more"]}):null]})}function Zbe({entry:e,maxDuration:t,isRequest:n,onSelect:r}){const i=t>0&&e.durationMs!=null?e.durationMs/t:0,o=Math.max(0,Math.min(100,i*100));return d.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),r==null||r(e.id)},className:`flex w-full items-center gap-2 rounded px-2 py-1 text-left text-xs ${n?"bg-panel-2 text-brand":"text-muted-foreground hover:bg-panel"}`,children:[d.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${KS(e.type)}`,"aria-hidden":!0}),d.jsx("span",{className:"w-40 shrink-0 truncate",title:Zm(e),children:Zm(e)}),d.jsx("span",{className:"h-2 flex-1 overflow-hidden rounded bg-panel",children:d.jsx("span",{className:"block h-full rounded bg-brand",style:{width:`${o}%`},"aria-hidden":!0})}),d.jsx("span",{className:"w-12 shrink-0 text-right tabular-nums text-muted-foreground",children:e.durationMs!=null?`${e.durationMs}ms`:"—"})]})}function e0e(e,t,n){return e?e.replaceAll("{traceId}",t).replaceAll("{spanId}",n):null}function t0e({entry:e,onSelect:t}){var o,a;const{data:n}=Is(),r=e.type==="request"&&e.batch.length>1,i=CF(e.tags);return d.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[d.jsxs("section",{className:"col-span-2",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("h2",{className:"flex items-center gap-2 text-sm text-brand",children:[e.type,e.type==="cache"?d.jsx(jF,{content:e.content}):null,e.type==="inertia"?d.jsx(AF,{content:e.content}):null]}),d.jsx(Kbe,{value:e,filename:`telescope-entry-${e.id}.json`})]}),r?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Timeline"}),d.jsx(Jbe,{batch:e.batch,requestId:e.id,onSelect:t})]}):null,e.type==="dump"?d.jsx(r0e,{content:e.content}):e.type==="event"?d.jsx(o0e,{content:e.content}):e.type==="log"?d.jsx(p0e,{content:e.content}):e.type==="model"?d.jsx(s0e,{content:e.content}):e.type==="redis"?d.jsx(l0e,{content:e.content}):e.type==="inertia"?d.jsx(qbe,{content:e.content}):e.type==="client_exception"?d.jsxs(d.Fragment,{children:[d.jsx(u0e,{content:e.content}),d.jsx(B_,{entryId:e.id,aiEnabled:((o=n==null?void 0:n.ai)==null?void 0:o.enabled)??!1})]}):e.type==="exception"?d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:JSON.stringify(e.content,null,2)}),d.jsx(B_,{entryId:e.id,aiEnabled:((a=n==null?void 0:n.ai)==null?void 0:a.enabled)??!1})]}):e.type==="request"?d.jsx(f0e,{content:e.content}):e.type==="query"?d.jsx(d0e,{entryId:e.id,content:e.content,explainEnabled:(n==null?void 0:n.explainEnabled)??!1}):d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:JSON.stringify(e.content,null,2)})]}),d.jsxs("aside",{children:[i!==null?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"User"}),d.jsx("div",{className:"font-mono text-[11px] text-foreground",children:KO(i)}),d.jsx("a",{href:TF(i),className:"mt-1 inline-block text-[11px] text-brand hover:underline",children:"View all activity for this user"})]}):null,e.traceId?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Trace"}),d.jsx(h0e,{traceId:e.traceId,spanId:e.spanId,traceLink:(n==null?void 0:n.traceLink)??null})]}):null,d.jsx(n0e,{entry:e}),d.jsxs("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:["Batch (",e.batch.length,")"]}),d.jsx(Mbe,{batch:e.batch,currentId:e.id,onSelect:t})]})]})}function n0e({entry:e}){const t=[];if(e.familyHash&&t.push({label:`All ${e.type} like this`,href:`#/entries/${encodeURIComponent(e.type)}?familyHash=${encodeURIComponent(e.familyHash)}`}),e.type!=="request"){const n=e.batch.find(r=>r.type==="request"&&r.id!==e.id);n&&t.push({label:"Originating request",href:`#/entries/view/${n.id}`})}return e.type==="job"&&t.push({label:"Open queue console",href:"#/queues"}),t.length===0?null:d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Related"}),d.jsx("div",{className:"flex flex-col gap-1",children:t.map(n=>d.jsxs("a",{href:n.href,className:"text-[11px] text-brand hover:underline",children:[n.label," →"]},`${n.href}:${n.label}`))})]})}function Zr(e){try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function r0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.label=="string"?t.label:null;return d.jsxs("div",{children:[n?d.jsx("h3",{className:"mb-2 font-mono text-sm text-fuchsia-400",children:n}):null,d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.value)})]})}function i0e(e){switch(e){case"error":return"text-bad";case"warn":return"text-warn";case"debug":case"verbose":return"text-muted-foreground";default:return"text-foreground"}}function o0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.name=="string"?t.name:String(t.name??""),r=typeof t.listenerCount=="number"?t.listenerCount:null;return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-2 flex items-center gap-2 font-mono text-sm text-indigo-400",children:[n,r!==null?d.jsxs("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[r," listener",r===1?"":"s"]}):null]}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.payload)})]})}function a0e(e){switch(e){case"create":return"text-brand";case"update":return"text-warn";case"delete":return"text-bad";default:return"text-foreground"}}function s0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.action=="string"?t.action:"update",r=typeof t.entity=="string"?t.entity:String(t.entity??""),i=t.id===null||t.id===void 0?null:String(t.id);return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-2 flex items-center gap-2 font-mono text-sm text-lime-400",children:[d.jsx("span",{className:`rounded bg-panel px-1.5 py-0.5 text-[10px] uppercase ${a0e(n)}`,children:n}),d.jsx("span",{children:r}),i!==null?d.jsxs("span",{className:"text-muted-foreground",children:["#",i]}):null]}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.changes)})]})}function l0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.command=="string"?t.command:String(t.command??""),r=typeof t.durationMs=="number"?t.durationMs:null;return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-2 flex items-center gap-2 font-mono text-sm text-bad",children:[n,r!==null?d.jsxs("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[r," ms"]}):null]}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.args)})]})}function F_({label:e,value:t}){return d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:e}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs leading-relaxed text-foreground",children:t})]})}function u0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.name=="string"?t.name:null,r=typeof t.message=="string"?t.message:String(t.message??""),i=typeof t.url=="string"?t.url:null,o=typeof t.userAgent=="string"?t.userAgent:null,a=typeof t.release=="string"?t.release:null,s=typeof t.stack=="string"?t.stack:null,l=typeof t.componentStack=="string"?t.componentStack:null;return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-3 flex flex-wrap items-center gap-2 font-mono text-sm text-orange-400",children:[n?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] uppercase",children:n}):null,d.jsx("span",{className:"text-foreground",children:r}),a?d.jsx("span",{className:"text-[10px] text-muted-foreground",children:a}):null]}),i?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"URL"}),d.jsx("div",{className:"break-all font-mono text-xs text-foreground",children:i})]}):null,o?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"User agent"}),d.jsx("div",{className:"break-all font-mono text-[11px] text-muted-foreground",children:o})]}):null,s?d.jsx(F_,{label:"Stack",value:s}):null,l?d.jsx(F_,{label:"Component stack",value:l}):null,kF(t.extra)?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Extra"}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.extra)})]}):null]})}function kF(e){return e==null?!1:Array.isArray(e)?e.length>0:typeof e=="object"?Object.keys(e).length>0:!0}function c0e({headers:e}){const t=Object.entries(e);return d.jsxs("details",{className:"mb-4",children:[d.jsxs("summary",{className:"cursor-pointer text-xs uppercase tracking-wide text-muted-foreground",children:["Headers (",t.length,")"]}),d.jsx("dl",{className:"mt-2 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 rounded bg-panel p-3 text-xs",children:t.map(([n,r])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"font-mono text-muted-foreground",children:n}),d.jsx("dd",{className:"break-all font-mono text-foreground",children:typeof r=="string"?r:Zr(r)})]},n))})]})}function f0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.headers=="object"&&t.headers!==null?t.headers:{},r=typeof t.method=="string"?t.method:String(t.method??""),i=typeof t.uri=="string"?t.uri:String(t.uri??""),o=typeof t.statusCode=="number"?t.statusCode:null,a=typeof t.ip=="string"?t.ip:null,s="user"in t&&t.user!==null&&t.user!==void 0;return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-3 flex items-center gap-2 font-mono text-sm text-brand",children:[d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] uppercase",children:r}),d.jsx("span",{className:"text-foreground",children:i}),o!==null?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-muted-foreground",children:o}):null,a?d.jsx("span",{className:"text-[10px] text-muted-foreground",children:a}):null]}),d.jsx(c0e,{headers:n}),d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Payload"}),kF(t.payload)?d.jsx("pre",{className:"mb-4 overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.payload)}):d.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:"No payload"}),d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"User"}),s?d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(t.user)}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"anonymous"})]})}function d0e({entryId:e,content:t,explainEnabled:n}){const r=typeof t=="object"&&t!==null?t:{},i=typeof r.sql=="string"?r.sql:String(r.sql??""),o=r.slow===!0,a=E5(),s=a.data;async function l(){try{await a.mutateAsync(e)}catch{}}return d.jsxs("div",{children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("h3",{className:"flex items-center gap-2 font-mono text-sm text-sky-400",children:["query",o?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] text-warn",children:"slow"}):null]}),n?d.jsx("button",{type:"button",onClick:l,disabled:a.isPending,className:"rounded border border-line px-2 py-1 text-[11px] text-foreground hover:border-brand hover:text-brand disabled:cursor-not-allowed disabled:opacity-50",children:a.isPending?"Explaining…":"Explain"}):null]}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:i}),Array.isArray(r.bindings)&&r.bindings.length>0?d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"mt-3 mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Bindings"}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(r.bindings)})]}):null,a.isPending?d.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Running EXPLAIN…"}):s===void 0?null:s.ok?d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"mt-3 mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Query plan"}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:Zr(s.plan)})]}):d.jsx("p",{className:"mt-3 rounded bg-panel p-3 text-xs text-bad",children:s.message})]})}function p0e({content:e}){const t=typeof e=="object"&&e!==null?e:{},n=typeof t.level=="string"?t.level:"log",r=typeof t.message=="string"?t.message:String(t.message??""),i=typeof t.context=="string"?t.context:null;return d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm",children:[d.jsx("span",{className:`rounded bg-panel px-1.5 py-0.5 font-mono text-[10px] uppercase ${i0e(n)}`,children:n}),i?d.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:i}):null]}),d.jsx("pre",{className:"overflow-auto rounded bg-panel p-3 text-xs text-foreground",children:r})]})}function h0e({traceId:e,spanId:t,traceLink:n}){const r=e0e(n,e,t??"");return d.jsxs("div",{children:[r?d.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:"font-mono text-[11px] text-brand hover:underline",children:e}):d.jsx("div",{className:"font-mono text-[11px] text-foreground",children:e}),t?d.jsx("div",{className:"font-mono text-[10px] text-muted-foreground",children:t}):null,d.jsx("a",{href:`#/traces/${e}`,className:"mt-1 inline-block text-[11px] text-brand hover:underline",children:"View all in this trace"})]})}function B_({entryId:e,aiEnabled:t}){const n=A5(),r=T5(e,t),[i,o]=O.useState(null);if(!t)return null;async function a(p){try{const h=await n.mutateAsync({entryId:e,force:p});o(h)}catch{o({ok:!1,message:"Diagnosis request failed."})}}const s=r.data??null,l=i,u=l!==null?l.ok===!0&&l.cached:s!==null,c=l!==null?l.ok===!0:s!==null,f=l===null&&r.isLoading;return d.jsxs("div",{className:"mt-4 rounded border border-line p-3",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[d.jsxs("h3",{className:"flex items-center gap-2 text-xs uppercase tracking-wide text-muted-foreground",children:["AI diagnosis",u?d.jsx("span",{className:"rounded bg-panel px-1.5 py-0.5 text-[10px] normal-case text-warn",children:"cached"}):null]}),d.jsx("div",{className:"flex items-center gap-2",children:f?null:c?d.jsx("button",{type:"button",onClick:()=>a(!0),disabled:n.isPending,className:"rounded border border-line px-2 py-1 text-[11px] text-foreground hover:border-brand hover:text-brand disabled:cursor-not-allowed disabled:opacity-50",children:n.isPending?"Re-running…":"Re-run"}):d.jsx("button",{type:"button",onClick:()=>a(!1),disabled:n.isPending,className:"rounded border border-line px-2 py-1 text-[11px] text-brand hover:border-brand disabled:cursor-not-allowed disabled:opacity-50",children:n.isPending?"Diagnosing…":"Diagnose with AI"})})]}),n.isPending?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Asking the model…"}):f?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Checking for an existing diagnosis…"}):l!==null?l.ok?d.jsx(U_,{source:l.markdown}):d.jsx("p",{className:"rounded bg-panel p-3 text-xs text-bad",children:l.message}):s!==null?d.jsx(U_,{source:s.markdown}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Get an AI-generated probable cause, where to look, and a suggested fix."})]})}function m0e(e){const t=[];let n=[],r=[],i=0;const o=()=>`block-${i++}`;function a(){n.length!==0&&(t.push({id:o(),kind:"paragraph",text:n.join(`
156
156
  `)}),n=[])}function s(){r.length!==0&&(t.push({id:o(),kind:"bullets",items:r}),r=[])}for(const l of e.split(`
157
157
  `)){const u=l.trimEnd();/^#{1,6}\s+/.test(u)?(a(),s(),t.push({id:o(),kind:"heading",text:u.replace(/^#{1,6}\s+/,"")})):/^[-*]\s+/.test(u)?(a(),r.push({id:o(),text:u.replace(/^[-*]\s+/,"")})):u.trim()===""?(a(),s()):(s(),n.push(u))}return a(),s(),t}function U_({source:e}){const t=m0e(e);return d.jsx("div",{className:"rounded bg-panel p-3",children:t.map(n=>n.kind==="heading"?d.jsx("h4",{className:"mt-3 mb-1 text-xs font-semibold text-brand",children:n.text},n.id):n.kind==="bullets"?d.jsx("ul",{className:"ml-4 list-disc text-xs leading-relaxed text-foreground",children:n.items.map(r=>d.jsx("li",{children:r.text},r.id))},n.id):d.jsx("p",{className:"whitespace-pre-wrap text-xs leading-relaxed text-foreground",children:n.text},n.id))})}const g0e=["id","type","createdAt","durationMs","tags","familyHash","traceId","content"];function z_(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function y0e(e){if(e==null)return"";try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function v0e(e){return[e.id,e.type,e.createdAt,e.durationMs===null?"":String(e.durationMs),e.tags.join("; "),e.familyHash??"",e.traceId??"",y0e(e.content)]}function x0e(e){const t=[g0e.map(z_).join(",")];for(const n of e)t.push(v0e(n).map(z_).join(","));return t.join(`\r
158
158
  `)}function b0e(e,t){const n=new Blob([t],{type:"text/csv"}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}const kw=1e3,Nw=60*kw,$w=60*Nw,H_=24*$w;function rf(e){return e>=H_?`${Math.round(e/H_)}d`:e>=$w?`${Math.round(e/$w)}h`:e>=Nw?`${Math.round(e/Nw)}m`:e>=kw?`${Math.round(e/kw)}s`:`${e}ms`}function w0e(e){for(const[t,n]of Object.entries(e))if(n<1)return`${t} sampled @ ${Math.round(n*100)}%`;return null}function S0e(){const{data:e}=Is();if(!e)return null;const t=w0e(e.sampling??{});return d.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",title:t??void 0,children:[d.jsx("span",{className:"uppercase tracking-wide text-muted-foreground",children:"retention:"}),e.retention?d.jsx("span",{className:"text-muted-foreground",children:rf(e.retention.afterMs)}):d.jsx("span",{className:"text-muted-foreground",children:"none"}),t?d.jsx("span",{"aria-label":t,className:"cursor-help rounded-full border border-line px-1 text-[9px] text-muted-foreground",children:"?"}):null]})}const NF={request:"#34d399",query:"#38bdf8",job:"#a78bfa",exception:"#f87171",http_client:"#fbbf24",mail:"#f472b6"},V_=["#71717a","#a1a1aa","#22d3ee","#c084fc","#fb923c","#4ade80"],W_=["#34d399","#fbbf24","#f87171","#38bdf8","#a78bfa"],$F="var(--accent)";function O0e(e,t=0){const n=V_[t%V_.length];return NF[e]??n??"#71717a"}function fx(e,t,n){if(n)return n;const r=W_[t%W_.length];return NF[e]??r??"#71717a"}function Ju(e,t,n){const r={};return e.forEach((i,o)=>{r[i]={label:(n==null?void 0:n(i))??i,color:t(i,o)}}),r}function Ld(e){return{label:e.label,...e.series!==void 0?{series:e.series}:{},...e.id!==void 0?{id:e.id}:{},...e.value!==void 0?{value:e.value}:{}}}function P0e(e){return typeof e=="object"&&e!==null}function MF(e){if(!P0e(e))return;const t=e.activeLabel;return typeof t=="string"&&t.length>0?t:typeof t=="number"?String(t):void 0}function la({title:e,right:t,height:n=220,children:r}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("header",{className:"mb-3 flex items-center justify-between",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),t]}),d.jsx("div",{style:{height:n},children:r})]})}function Fd({height:e}){return d.jsx("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",style:e===void 0?void 0:{height:e},children:"No data in window."})}const j0e=24;function Us({title:e,data:t,right:n,color:r=$F,valueLabel:i="value",height:o=220,brush:a,valueFormatter:s,onSelect:l}){const u=O.useId(),c=o-64,f=O.useMemo(()=>Ju(["value"],()=>r,()=>i),[r,i]),p=a??t.length>=j0e,h=l?{onClick:v=>{const y=MF(v);if(y===void 0)return;const x=t.find(g=>g.label===y);l(Ld({label:y,series:"value",value:x==null?void 0:x.value}))},className:"cursor-pointer"}:{};return d.jsx(la,{title:e,right:n,height:c,children:t.length===0?d.jsx(Fd,{height:c}):d.jsx(js,{config:f,children:d.jsxs(OD,{data:t,margin:{top:4,right:8,bottom:0,left:-16},...h,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:u,x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:Yi("value"),stopOpacity:.35}),d.jsx("stop",{offset:"100%",stopColor:Yi("value"),stopOpacity:0})]})}),d.jsx(Rd,{vertical:!1}),d.jsx(so,{dataKey:"label",tickLine:!1,minTickGap:24}),d.jsx(lo,{tickLine:!1,width:40,allowDecimals:!1}),d.jsx(bu,{cursor:{stroke:"var(--line)"},content:d.jsx(wu,{...s?{valueFormatter:v=>s(v)}:{}})}),d.jsx(wo,{type:"monotone",dataKey:"value",name:i,stroke:Yi("value"),strokeWidth:2,fill:`url(#${u})`,isAnimationActive:!1,dot:!1,activeDot:{r:3}}),p&&d.jsx(fa,{...ED,dataKey:"label"})]})})})}const E0e=24;function GO({title:e,data:t,series:n,right:r,height:i=240,brush:o,onSelect:a}){const s=i-64,l=O.useMemo(()=>Ju(n,O0e),[n]),{hidden:u,toggle:c,isHidden:f}=Ehe(),p=o??t.length>=E0e,h=a?{onClick:v=>{const y=MF(v);y!==void 0&&a(Ld({label:y}))},className:"cursor-pointer"}:{};return d.jsx(la,{title:e,right:r,height:s,children:t.length===0||n.length===0?d.jsx(Fd,{height:s}):d.jsx(js,{config:l,children:d.jsxs(OD,{data:t,margin:{top:4,right:8,bottom:0,left:-16},...h,children:[d.jsx(Rd,{vertical:!1}),d.jsx(so,{dataKey:"label",tickLine:!1,minTickGap:24}),d.jsx(lo,{tickLine:!1,width:40,allowDecimals:!1}),d.jsx(bu,{cursor:{stroke:"var(--line)"},content:d.jsx(wu,{})}),d.jsx(rw,{content:d.jsx(ow,{hidden:u,onToggle:c})}),n.map(v=>d.jsx(wo,{type:"monotone",dataKey:v,name:v,stackId:"1",stroke:Yi(v),strokeWidth:1.5,fill:Yi(v),fillOpacity:.25,hide:f(v),isAnimationActive:!1},v)),p&&d.jsx(fa,{...ED,dataKey:"label"})]})})})}function A0e(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function ds({title:e,data:t,right:n,color:r=$F,valueLabel:i="value",height:o=220,horizontal:a=!1,truncateLabel:s,valueFormatter:l,onSelect:u,onBarClick:c}){const f=o-64,p=O.useMemo(()=>Ju(["value"],()=>r,()=>i),[r,i]);function h(g,m){const b=t[m];b&&(c==null||c(b),u==null||u(Ld({label:b.label,id:b.id,value:b.value})))}const v=s!==void 0?{tickFormatter:g=>A0e(g,s)}:{},x=u!==void 0||c!==void 0?{onClick:h,cursor:"pointer"}:{};return d.jsx(la,{title:e,right:n,height:f,children:t.length===0?d.jsx(Fd,{height:f}):d.jsx(js,{config:p,children:d.jsxs(iO,{data:t,layout:a?"vertical":"horizontal",margin:{top:4,right:8,bottom:0,left:a?8:-16},children:[d.jsx(Rd,{horizontal:!a,vertical:a}),a?d.jsx(so,{type:"number",tickLine:!1,allowDecimals:!1}):d.jsx(so,{dataKey:"label",tickLine:!1,interval:0,...v}),a?d.jsx(lo,{type:"category",dataKey:"label",tickLine:!1,width:160,interval:0,...v}):d.jsx(lo,{tickLine:!1,width:40,allowDecimals:!1}),d.jsx(bu,{cursor:{fill:"color-mix(in srgb, var(--text) 5%, transparent)"},content:d.jsx(wu,{...l?{valueFormatter:g=>l(g)}:{}})}),d.jsx(bo,{dataKey:"value",name:i,fill:Yi("value"),radius:a?[0,3,3,0]:[3,3,0,0],isAnimationActive:!1,...x,children:t.map(g=>d.jsx(Hu,{fill:g.color??Yi("value")},g.id??g.label))})]})})})}const IF=["waiting","active","delayed","failed","completed","paused"],DF={waiting:"text-foreground",active:"text-brand",delayed:"text-warn",failed:"text-bad",completed:"text-good",paused:"text-muted-foreground"};function zs(e){if(e==null)return"—";const t=Date.now()-e;if(t<0)return"just now";const n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}const C0e="1h";function T0e(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Bd(e){return((e==null?void 0:e.buckets)??[]).map(t=>({label:T0e(t.t),value:t.total}))}function En({label:e,value:t,accent:n="text-foreground"}){return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40 px-4 py-3",children:[d.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),d.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${n}`,children:t})]})}function Ud({children:e}){return d.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:e})}function XO({children:e}){return d.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:e})}function _0e(e){return e.map(t=>({label:t.label!==""?t.label:t.familyHash.slice(0,12),value:t.p99,id:t.familyHash}))}function R0e(e){return[{label:"2xx",value:e["2xx"],color:"var(--good)"},{label:"3xx",value:e["3xx"],color:"#38bdf8"},{label:"4xx",value:e["4xx"],color:"var(--warn)"},{label:"5xx",value:e["5xx"],color:"var(--bad)"},{label:"other",value:e.other,color:"var(--muted)"}]}function k0e(e){return e.topKeys.map(t=>({label:t.key,value:t.count}))}function N0e({stats:e}){const t=e.latency,n=Oi();return d.jsxs(d.Fragment,{children:[d.jsxs(Ud,{children:[d.jsx(En,{label:"Total",value:e.total.toLocaleString()}),d.jsx(En,{label:"p50 ms",value:t?t.p50.toLocaleString():"—"}),d.jsx(En,{label:"p99 ms",value:t?t.p99.toLocaleString():"—",accent:"text-sky-400"}),d.jsx(En,{label:"Slow",value:t?t.slow.toLocaleString():"—",accent:t&&t.slow>0?"text-warn":"text-foreground"})]}),d.jsxs(XO,{children:[e.families?d.jsx(ds,{title:"Slowest query shapes (p99)",valueLabel:"p99 ms",data:_0e(e.families),horizontal:!0,truncateLabel:40,onBarClick:r=>{r.id!==void 0&&n(`/entries/query?familyHash=${encodeURIComponent(r.id)}`)}}):null,d.jsx(Us,{title:"Queries over time",valueLabel:"queries",data:Bd(e.overTime)})]})]})}function $0e(e){return Object.entries(e).map(([t,n])=>({label:t,value:n.hits})).sort((t,n)=>t.label.localeCompare(n.label))}function M0e({stats:e}){const t=e.cache,n=(t==null?void 0:t.byTier)??{},r=Object.keys(n),i=(t==null?void 0:t.staleHits)??0,o=(t==null?void 0:t.deletes)??0;return d.jsxs(d.Fragment,{children:[d.jsxs(Ud,{children:[d.jsx(En,{label:"Hit ratio",value:t?`${Math.round(t.hitRatio*100)}%`:"—",accent:"text-brand"}),d.jsx(En,{label:"Hits",value:t?t.hits.toLocaleString():"—"}),d.jsx(En,{label:"Misses",value:t?t.misses.toLocaleString():"—"}),d.jsx(En,{label:"Sets",value:t?t.sets.toLocaleString():"—"}),o>0?d.jsx(En,{label:"Deletes",value:o.toLocaleString()}):null,i>0?d.jsx(En,{label:"Stale hits",value:i.toLocaleString(),accent:"text-warn"}):null]}),d.jsxs(XO,{children:[t?d.jsx(ds,{title:"Hits vs misses",valueLabel:"count",data:[{label:"hits",value:t.hits,color:"var(--good)"},{label:"misses",value:t.misses,color:"var(--bad)"}]}):null,r.length>0?d.jsx(ds,{title:"Hits by tier",valueLabel:"hits",data:$0e(n)}):null,d.jsx(Us,{title:"Cache over time",valueLabel:"ops",data:Bd(e.overTime)})]}),t?d.jsx(ds,{title:"Top keys",valueLabel:"count",data:k0e(t)}):null]})}function I0e({stats:e}){const t=e.latency,n=e.status,r=n?n["4xx"]+n["5xx"]:0,i=e.total>0?Math.round(r/e.total*100):0;return d.jsxs(d.Fragment,{children:[d.jsxs(Ud,{children:[d.jsx(En,{label:"Total",value:e.total.toLocaleString()}),d.jsx(En,{label:"p99 ms",value:t?t.p99.toLocaleString():"—",accent:"text-sky-400"}),d.jsx(En,{label:"Error %",value:`${i}%`,accent:r>0?"text-bad":"text-foreground"})]}),d.jsxs(XO,{children:[n?d.jsx(ds,{title:"Status codes",valueLabel:"count",data:R0e(n)}):null,d.jsx(Us,{title:"Throughput",valueLabel:"requests",data:Bd(e.overTime)})]})]})}function D0e({values:e}){if(e.length===0)return null;const t=Math.max(1,...e);return d.jsx("div",{className:"flex h-6 items-end gap-px","aria-hidden":"true",children:e.map((n,r)=>d.jsx("div",{className:"w-1 rounded-sm bg-warn",style:{height:`${Math.max(2,Math.round(n/t*100))}%`}},r))})}function L0e({group:e}){const t=new Date(e.lastAt).getTime();return d.jsxs(d$,{to:`/entries/exception?familyHash=${encodeURIComponent(e.key)}`,className:"flex items-center gap-3 rounded-lg border border-line bg-panel/40 px-4 py-3 transition hover:border-line hover:bg-panel/70",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"truncate font-mono text-sm font-semibold text-bad",children:e.class}),d.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e.message})]}),d.jsx(D0e,{values:e.overTime}),d.jsxs("div",{className:"shrink-0 text-right",children:[d.jsx("p",{className:"text-sm font-semibold tabular-nums text-foreground",children:e.count.toLocaleString()}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:zs(Number.isNaN(t)?null:t)})]})]})}function F0e({stats:e}){const t=e.exceptions??[];return d.jsxs(d.Fragment,{children:[d.jsxs(Ud,{children:[d.jsx(En,{label:"Total",value:e.total.toLocaleString()}),d.jsx(En,{label:"Groups",value:t.length.toLocaleString(),accent:t.length>0?"text-warn":"text-foreground"})]}),t.length>0?d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Exception groups"}),t.map(n=>d.jsx(L0e,{group:n},n.key))]}):null,d.jsx(Us,{title:"Exceptions over time",valueLabel:"exceptions",data:Bd(e.overTime)})]})}function B0e({stats:e}){return d.jsxs(d.Fragment,{children:[d.jsx(Ud,{children:d.jsx(En,{label:"Total",value:e.total.toLocaleString()})}),d.jsx(Us,{title:"Over time",valueLabel:"entries",data:Bd(e.overTime)})]})}function U0e({stats:e}){return e.type==="query"?d.jsx(N0e,{stats:e}):e.type==="cache"?d.jsx(M0e,{stats:e}):e.type==="request"?d.jsx(I0e,{stats:e}):e.type==="exception"?d.jsx(F0e,{stats:e}):d.jsx(B0e,{stats:e})}function z0e({type:e}){const{data:t}=I5(e,C0e);return t?d.jsxs("div",{className:"mb-4 space-y-4",children:[d.jsx(U0e,{stats:t}),t.truncated?d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"sampled (window capped)"}):null]}):d.jsx("div",{className:"mb-4 h-24 animate-pulse rounded-lg border border-line bg-panel/20"})}const H0e=["15m","1h","6h","24h"];function zd({value:e,onChange:t}){return d.jsxs(Aw,{value:e,onValueChange:n=>{typeof n=="string"&&t(n)},children:[d.jsx(Tw,{"aria-label":"Time window",children:d.jsx(Cw,{})}),d.jsx(_w,{align:"end",children:H0e.map(n=>d.jsx(Lc,{value:n,children:n},n))})]})}const V0e=200,W0e=48;function K0e(e,t){const[n,r]=O.useState(e);return O.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function K_({onSelect:e,prefix:t="",placeholder:n="Filter by tag…",ariaLabel:r="Filter by tag"}){var E;const[i,o]=O.useState(""),[a,s]=O.useState(!1),[l,u]=O.useState(0),c=O.useRef(null),f=O.useId(),p=i.trim(),h=`${t}${p}`,v=K0e(p,V0e),y=M5(t,v),x=((E=y.data)==null?void 0:E.pages.flat())??[],g=a&&x.length>0,m=O.useRef(null);function b(){const A=m.current;!A||!y.hasNextPage||y.isFetchingNextPage||A.scrollTop+A.clientHeight>=A.scrollHeight-W0e&&y.fetchNextPage()}function S(A){return t!==""&&A.startsWith(t)?A.slice(t.length):A}O.useEffect(()=>{u(A=>A>=x.length?0:A)},[x.length]),O.useEffect(()=>{function A(C){var _;const T=C.target;T instanceof Node&&!((_=c.current)!=null&&_.contains(T))&&s(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);function w(A){e(A),o(S(A)),s(!1)}function P(A){if(A.key==="Escape"){s(!1);return}if(!g){A.key==="Enter"&&p!==""&&w(h);return}if(A.key==="ArrowDown")A.preventDefault(),u(C=>(C+1)%x.length);else if(A.key==="ArrowUp")A.preventDefault(),u(C=>(C-1+x.length)%x.length);else if(A.key==="Enter"){A.preventDefault();const C=x[l];C?w(C.tag):p!==""&&w(h)}}const j=g?`${f}-option-${l}`:void 0;return d.jsxs("div",{ref:c,className:"relative",children:[d.jsx(_s,{type:"text",value:i,onChange:A=>{o(A.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:P,placeholder:n,"aria-label":r,role:"combobox","aria-expanded":g,"aria-controls":f,"aria-autocomplete":"list",...j?{"aria-activedescendant":j}:{}}),g?d.jsxs("div",{id:f,role:"listbox","aria-label":"Tag suggestions",tabIndex:-1,ref:m,onScroll:b,className:"absolute left-0 top-full z-10 mt-1 max-h-64 w-48 overflow-auto rounded border border-line bg-popover py-1 shadow-lg",children:[x.map((A,C)=>d.jsxs("div",{id:`${f}-option-${C}`,role:"option",tabIndex:-1,"aria-selected":C===l,onMouseDown:T=>{T.preventDefault(),w(A.tag)},onMouseEnter:()=>u(C),className:`flex cursor-pointer items-center justify-between gap-3 px-2 py-1 text-xs ${C===l?"bg-panel-2 text-foreground":"text-foreground"}`,children:[d.jsx("span",{className:"truncate",children:S(A.tag)}),d.jsx("span",{className:"shrink-0 text-muted-foreground",children:A.count})]},A.tag)),y.isFetchingNextPage?d.jsx("p",{className:"px-2 py-1 text-[10px] text-muted-foreground",children:"loading more…"}):null]}):null]})}function Gs({title:e,children:t}){return d.jsxs("section",{className:"mb-6",children:[d.jsx("h3",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:e}),t]})}function q0e({report:e,onSelectEntry:t,onSelectFamily:n,onSelectRoute:r,onSelectOutgoing:i}){return d.jsxs("div",{className:"text-xs",children:[e.truncated&&d.jsxs("p",{className:"mb-4 text-warn",children:["Scan truncated at ",e.scanned," entries — widen the window with care."]}),d.jsx(Gs,{title:"Entries by type",children:d.jsxs("div",{className:"flex flex-wrap gap-3",children:[Object.entries(e.counts).map(([o,a])=>d.jsxs("span",{className:"rounded bg-panel px-2 py-1",children:[d.jsx("span",{className:"text-brand",children:o})," ",d.jsx("span",{className:"text-foreground",children:a})]},o)),Object.keys(e.counts).length===0&&d.jsx("span",{className:"text-muted-foreground",children:"No entries in window."})]})}),d.jsx(Gs,{title:"Slowest",children:d.jsx("table",{className:"w-full text-left",children:d.jsxs("tbody",{children:[e.slowest.map(o=>d.jsxs("tr",{tabIndex:0,onClick:()=>t==null?void 0:t(o.id),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(t==null||t(o.id))},className:"cursor-pointer border-t border-line-soft hover:bg-panel",children:[d.jsx("td",{className:"py-1 text-brand",children:o.type}),d.jsx("td",{className:"max-w-md truncate text-foreground",children:o.label}),d.jsxs("td",{className:"text-right text-muted-foreground",children:[o.durationMs,"ms"]})]},o.id)),e.slowest.length===0&&d.jsx("tr",{children:d.jsx("td",{className:"py-1 text-muted-foreground",children:"—"})})]})})}),d.jsx(Gs,{title:"Top exceptions",children:d.jsx("table",{className:"w-full text-left",children:d.jsxs("tbody",{children:[e.topExceptions.map(o=>d.jsxs("tr",{className:"border-t border-line-soft",children:[d.jsx("td",{className:"py-1 text-bad",children:o.class}),d.jsx("td",{className:"max-w-md truncate text-foreground",children:o.message}),d.jsxs("td",{className:"text-right text-muted-foreground",children:["×",o.count]})]},o.familyHash)),e.topExceptions.length===0&&d.jsx("tr",{children:d.jsx("td",{className:"py-1 text-muted-foreground",children:"No exceptions 🎉"})})]})})}),d.jsx(Gs,{title:"N+1 query hotspots",children:d.jsx("table",{className:"w-full text-left",children:d.jsxs("tbody",{children:[e.nPlusOne.map(o=>d.jsxs("tr",{tabIndex:0,onClick:()=>n==null?void 0:n(o.familyHash),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(n==null||n(o.familyHash))},className:"cursor-pointer border-t border-line-soft hover:bg-panel",children:[d.jsxs("td",{className:"whitespace-nowrap py-1 text-warn",children:["×",o.perRequest,d.jsx("span",{className:"text-muted-foreground",children:" per request"})]}),d.jsx("td",{className:"max-w-md truncate text-foreground",children:o.sql}),d.jsxs("td",{className:"whitespace-nowrap text-right text-muted-foreground",children:[o.requests," requests · ",o.total," total"]})]},o.familyHash)),e.nPlusOne.length===0&&d.jsx("tr",{children:d.jsx("td",{className:"py-1 text-muted-foreground",children:"None detected"})})]})})}),d.jsx(Gs,{title:"Slow request hotspots",children:d.jsx("table",{className:"w-full text-left",children:d.jsxs("tbody",{children:[e.slowRoutes.map(o=>d.jsxs("tr",{tabIndex:0,onClick:()=>r==null?void 0:r(o.route),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(r==null||r(o.route))},className:"cursor-pointer border-t border-line-soft hover:bg-panel",children:[d.jsx("td",{className:"max-w-md truncate py-1 font-mono text-foreground",children:o.route}),d.jsxs("td",{className:"whitespace-nowrap text-right text-warn",children:[o.p99,"ms",d.jsx("span",{className:"text-muted-foreground",children:" p99"})]}),d.jsxs("td",{className:"whitespace-nowrap text-right text-muted-foreground",children:["×",o.count]})]},o.route)),e.slowRoutes.length===0&&d.jsx("tr",{children:d.jsx("td",{className:"py-1 text-muted-foreground",children:"No routes over the slow threshold"})})]})})}),d.jsx(Gs,{title:"Slow outgoing HTTP",children:d.jsx("table",{className:"w-full text-left",children:d.jsxs("tbody",{children:[e.slowOutgoing.map(o=>d.jsxs("tr",{tabIndex:0,onClick:()=>i==null?void 0:i(o.route),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(i==null||i(o.route))},className:"cursor-pointer border-t border-line-soft hover:bg-panel",children:[d.jsx("td",{className:"max-w-md truncate py-1 font-mono text-foreground",children:o.route}),d.jsxs("td",{className:"whitespace-nowrap text-right text-warn",children:[o.p99,"ms",d.jsx("span",{className:"text-muted-foreground",children:" p99"})]}),d.jsxs("td",{className:"whitespace-nowrap text-right text-muted-foreground",children:["×",o.count]})]},o.route)),e.slowOutgoing.length===0&&d.jsx("tr",{children:d.jsx("td",{className:"py-1 text-muted-foreground",children:"No outgoing calls over the slow threshold"})})]})})})]})}function q_(e){return e?`${Math.round(e.p95)}ms`:"—"}function G0e({report:e,sparkline:t}){return d.jsxs("table",{className:"w-full text-left text-xs",children:[d.jsx("thead",{className:"text-muted-foreground",children:d.jsxs("tr",{children:[d.jsx("th",{className:"py-2 font-normal",children:"Queue"}),d.jsx("th",{className:"font-normal",children:"Total"}),d.jsx("th",{className:"font-normal",children:"Failed"}),d.jsx("th",{className:"font-normal",children:"Fail %"}),d.jsx("th",{className:"font-normal",children:"Per min"}),d.jsx("th",{className:"font-normal",children:"Runtime p95"}),d.jsx("th",{className:"font-normal",children:"Wait p95"}),t&&d.jsx("th",{className:"font-normal",children:"Trend"})]})}),d.jsxs("tbody",{children:[e.queues.map(n=>d.jsxs("tr",{className:"border-t border-line-soft",children:[d.jsx("td",{className:"py-1.5 text-brand",children:n.queue}),d.jsx("td",{className:"text-foreground",children:n.total}),d.jsx("td",{className:"text-foreground",children:n.failed}),d.jsxs("td",{className:n.failureRate>0?"text-bad":"text-muted-foreground",children:[(n.failureRate*100).toFixed(1),"%"]}),d.jsx("td",{className:"text-muted-foreground",children:n.throughputPerMinute.toFixed(1)}),d.jsx("td",{className:"text-muted-foreground",children:q_(n.runtimeMs)}),d.jsx("td",{className:"text-muted-foreground",children:q_(n.waitMs)}),t&&d.jsx("td",{className:"text-muted-foreground",children:t(n.queue)})]},n.queue)),e.queues.length===0&&d.jsx("tr",{children:d.jsx("td",{className:"py-2 text-muted-foreground",colSpan:t?8:7,children:"No queue activity in window."})})]})]})}function X0e(e,t,n){if(e.length===0)return"";const r=Math.max(...e,1),i=e.length>1?t/(e.length-1):0;return e.map((o,a)=>{const s=a*i,l=n-o/r*n;return`${s.toFixed(1)},${l.toFixed(1)}`}).join(" ")}function lh({values:e,width:t=160,height:n=36}){const r=X0e(e,t,n),i=r?`0,${n} ${r} ${t},${n}`:"";return d.jsxs("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"none",role:"img","aria-label":"throughput",children:[i&&d.jsx("polygon",{points:i,className:"fill-accent opacity-10"}),r&&d.jsx("polyline",{points:r,className:"fill-none stroke-accent",strokeWidth:1.5})]})}const G_={request:"fill-emerald-400",query:"fill-sky-400",job:"fill-violet-400",exception:"fill-red-400",http_client:"fill-amber-400",mail:"fill-pink-400"};function YO(e){const t=new Set;for(const i of e)for(const o of Object.keys(i.byType))t.add(o);const n=Object.keys(G_).filter(i=>t.has(i)),r=[...t].filter(i=>!(i in G_)).sort();return[...n,...r]}function Y0e({queue:e,window:t}){const{data:n}=WS({window:t,tag:`queue:${e}`,buckets:24});return d.jsx(lh,{values:((n==null?void 0:n.buckets)??[]).map(r=>r.total),width:120,height:20})}function Q0e({state:e,value:t}){const n=e==="failed"&&t>0;return d.jsxs("span",{className:`flex items-baseline gap-1 rounded px-1.5 py-0.5 ${n?"tint-bad":"bg-panel-2/60"}`,title:`${t} ${e}`,children:[d.jsx("span",{className:"text-[9px] uppercase tracking-wide text-muted-foreground",children:e.slice(0,4)}),d.jsx("span",{className:`tabular-nums ${t>0?DF[e]:"text-muted-foreground"}`,children:t})]})}function J0e({summary:e,active:t,onSelect:n}){return d.jsxs("button",{type:"button",onClick:()=>n(e.driver,e.queue),className:`w-full rounded-lg border px-3 py-2.5 text-left transition-colors ${t?"border-brand bg-panel-2":"border-line bg-panel/40 hover:border-line hover:bg-panel"}`,children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:e.queue}),e.isPaused&&d.jsx("span",{className:"shrink-0 rounded bg-violet-500/15 px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-violet-300",children:"paused"})]}),d.jsx("div",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.driver}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-1 text-[10px]",children:IF.map(r=>d.jsx(Q0e,{state:r,value:e.counts[r]},r))})]})}function Z0e({selected:e,onSelect:t}){const{data:n,isLoading:r,isError:i}=v$();if(r)return d.jsx("p",{className:"px-1 py-2 text-xs text-muted-foreground",children:"Loading queues…"});if(i)return d.jsx("p",{className:"px-1 py-2 text-xs text-bad",children:"Failed to load queues."});const o=(n==null?void 0:n.queues)??[];return o.length===0?d.jsx("div",{className:"rounded-lg border border-dashed border-line px-3 py-6 text-center text-xs text-muted-foreground",children:"No live queues detected."}):d.jsx("div",{className:"space-y-2",children:o.map(a=>d.jsx(J0e,{summary:a,active:(e==null?void 0:e.driver)===a.driver&&(e==null?void 0:e.queue)===a.queue,onSelect:t},`${a.driver}:${a.queue}`))})}function ewe({counts:e,state:t,onState:n}){return d.jsx(obe,{value:t,onValueChange:r=>{typeof r=="string"&&n(r)},children:d.jsx(abe,{children:IF.map(r=>{const i=r===t,o=(e==null?void 0:e[r])??0;return d.jsxs(sbe,{value:r,children:[d.jsx("span",{className:"capitalize",children:r}),d.jsx("span",{className:`tabular-nums text-[11px] ${i?DF[r]:"text-muted-foreground"}`,children:o})]},r)})})})}const X_=25;function twe(e){return e.maxAttempts!=null?`${e.attemptsMade}/${e.maxAttempts}`:`${e.attemptsMade}`}function nwe({job:e,onOpen:t}){return d.jsxs("tr",{onClick:()=>t(e.id),onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&t(e.id)},className:"cursor-pointer border-t border-line-soft align-top hover:bg-panel",children:[d.jsx("td",{className:"py-1.5 pr-2 font-mono text-[11px] text-muted-foreground",children:e.id}),d.jsx("td",{className:"pr-2 text-emerald-400",children:e.name||"—"}),d.jsx("td",{className:"pr-2 tabular-nums text-muted-foreground",children:twe(e)}),d.jsx("td",{className:"pr-2 whitespace-nowrap text-muted-foreground",children:zs(e.timestamp)}),d.jsx("td",{className:"max-w-xs truncate pr-2 text-muted-foreground",children:e.failedReason?d.jsx("span",{className:"text-bad",children:e.failedReason}):d.jsx("span",{className:"text-muted-foreground",children:"open to inspect payload →"})})]})}function rwe(e,t){const n=new Map;for(const r of e)n.set(r.id,r);for(const r of t)n.set(r.id,r);return[...n.values()]}function iwe({driver:e,queue:t,state:n,onOpen:r}){const[i,o]=O.useState(void 0),[a,s]=O.useState([]),l=`${e}\0${t}\0${n}`,u=O.useRef(l);u.current!==l&&(u.current=l,i!==void 0&&o(void 0),a.length>0&&s([]));const{data:c,isLoading:f,isError:p}=b5(e,t,n,i!==void 0?{cursor:i,limit:X_}:{limit:X_}),h=(c==null?void 0:c.nextCursor)??null,v=c==null?void 0:c.jobs;return O.useEffect(()=>{v&&s(i===void 0?y=>owe(y,v):y=>rwe(y,v))},[v,i]),f&&a.length===0?d.jsx("p",{className:"px-1 py-3 text-xs text-muted-foreground",children:"Loading jobs…"}):p&&a.length===0?d.jsx("p",{className:"px-1 py-3 text-xs text-bad",children:"Failed to load jobs."}):a.length===0?d.jsxs("div",{className:"rounded-lg border border-dashed border-line px-3 py-8 text-center text-xs text-muted-foreground",children:["No ",d.jsx("span",{className:"text-muted-foreground",children:n})," jobs."]}):d.jsxs("div",{className:"space-y-3",children:[d.jsxs("table",{className:"w-full text-left text-xs",children:[d.jsx("thead",{className:"text-muted-foreground",children:d.jsxs("tr",{children:[d.jsx("th",{className:"py-1.5 pr-2 font-normal",children:"ID"}),d.jsx("th",{className:"pr-2 font-normal",children:"Name"}),d.jsx("th",{className:"pr-2 font-normal",children:"Attempts"}),d.jsx("th",{className:"pr-2 font-normal",children:"Age"}),d.jsx("th",{className:"pr-2 font-normal",children:"Reason / Payload"})]})}),d.jsx("tbody",{children:a.map(y=>d.jsx(nwe,{job:y,onOpen:r},y.id))})]}),h!=null&&d.jsx("button",{type:"button",onClick:()=>o(h),className:"w-full rounded-md border border-line py-1.5 text-[11px] text-muted-foreground transition-colors hover:border-line hover:text-foreground",children:"Load more"})]})}function owe(e,t){const n=new Set(t.map(i=>i.id)),r=e.filter(i=>!n.has(i.id));return[...t,...r]}function Fy(e,t,n){return e!=null&&e.mutationsEnabled?(e.actionsByDriver[t]??[]).includes(n):!1}function awe(e,t){switch(e){case"promote":return t==="delayed";case"retry":return t==="failed"||t==="completed";case"remove":return!0;default:return!1}}function QO(e){return e instanceof Error&&/\b403\b/.test(e.message)}const swe={retry:"good",promote:"warn",remove:"bad"};function lwe({driver:e,queue:t,id:n,action:r,onDone:i}){const o=S5(),[a,s]=O.useState(!1),l=o.isPending,u=QO(o.error);async function c(){s(!1);try{await o.mutateAsync({driver:e,queue:t,id:n,action:r}),i==null||i()}catch{}}return r==="remove"&&a?d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Xe,{variant:"bad",disabled:l,onClick:c,children:l?"Removing…":"Confirm remove"}),d.jsx(Xe,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]}):d.jsxs("span",{className:"inline-flex flex-col",children:[d.jsx(Xe,{variant:swe[r],disabled:l,onClick:r==="remove"?()=>s(!0):c,className:"capitalize",children:l?`${r}…`:r}),u&&d.jsx("span",{className:"mt-0.5 text-[10px] text-bad",children:"Not authorized"})]})}function uwe({capabilities:e,driver:t,queue:n,id:r,state:i,onDone:o}){const a=["retry","promote","remove"].filter(s=>Fy(e,t,s)&&awe(s,i));return a.length===0?null:d.jsx("div",{className:"flex flex-wrap items-start gap-1.5",children:a.map(s=>d.jsx(lwe,{driver:t,queue:n,id:r,action:s,onDone:o},s))})}function cwe({capabilities:e,driver:t,queue:n}){const r=x$();if(!Fy(e,t,"retry-all"))return null;const i=QO(r.error);async function o(){try{await r.mutateAsync({driver:t,queue:n,action:"retry-all",state:"failed"})}catch{}}return d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(Xe,{variant:"good",disabled:r.isPending,onClick:o,children:r.isPending?"Retrying all…":"Retry all failed"}),i&&d.jsx("span",{className:"text-[10px] text-bad",children:"Not authorized"})]})}function fwe({capabilities:e,driver:t,queue:n}){const r=x$(),[i,o]=O.useState(!1);if(!Fy(e,t,"redrive"))return null;const a=QO(r.error);async function s(){o(!1);try{await r.mutateAsync({driver:t,queue:n,action:"redrive"})}catch{}}return i?d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Xe,{variant:"warn",disabled:r.isPending,onClick:s,children:r.isPending?"Redriving…":"Confirm redrive"}),d.jsx(Xe,{variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]}):d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(Xe,{variant:"warn",disabled:r.isPending,onClick:()=>o(!0),children:"Redrive DLQ"}),a&&d.jsx("span",{className:"text-[10px] text-bad",children:"Not authorized"})]})}function dwe(e){if(e===void 0)return"—";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function dx({label:e,value:t}){return d.jsxs("section",{children:[d.jsx("h4",{className:"mb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),d.jsx("pre",{className:"overflow-auto rounded bg-background p-2.5 text-[11px] leading-relaxed text-foreground ring-1 ring-line",children:dwe(t)})]})}function Ac({label:e,value:t}){return d.jsxs("div",{className:"flex items-baseline justify-between gap-3 border-t border-line-soft py-1 first:border-0",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),d.jsx("span",{className:"tabular-nums text-foreground",children:t})]})}function px(e){return e==null?"—":`${new Date(e).toLocaleString()} (${zs(e)})`}function pwe({detail:e,capabilities:t,driver:n,queue:r,state:i,onClose:o}){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("header",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium text-brand",children:e.name||"job"}),d.jsx(XS,{className:"capitalize",children:e.state})]}),d.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:e.id})]}),d.jsx(uwe,{capabilities:t,driver:n,queue:r,id:e.id,state:i,onDone:o}),d.jsxs("div",{className:"rounded-lg border border-line bg-panel px-3 py-2 text-xs",children:[d.jsx(Ac,{label:"Attempts",value:e.maxAttempts!=null?`${e.attemptsMade}/${e.maxAttempts}`:`${e.attemptsMade}`}),d.jsx(Ac,{label:"Progress",value:e.progress!=null?`${e.progress}`:"—"}),d.jsx(Ac,{label:"Created",value:px(e.timestamp)}),d.jsx(Ac,{label:"Processed",value:px(e.processedOn)}),d.jsx(Ac,{label:"Finished",value:px(e.finishedOn)})]}),e.failedReason&&d.jsxs("section",{children:[d.jsx("h4",{className:"mb-1 text-[10px] uppercase tracking-wide text-bad",children:"Failed reason"}),d.jsx("p",{className:"tint-bad rounded border px-2.5 py-2 text-[11px]",children:e.failedReason})]}),d.jsx(dx,{label:"Payload (data)",value:e.data}),d.jsx(dx,{label:"Options (opts)",value:e.opts}),e.returnValue!==void 0&&e.returnValue!==null&&d.jsx(dx,{label:"Return value",value:e.returnValue}),e.stacktrace&&e.stacktrace.length>0&&d.jsxs("section",{children:[d.jsx("h4",{className:"mb-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Stacktrace"}),d.jsx("pre",{className:"overflow-auto rounded bg-background p-2.5 text-[11px] leading-relaxed text-bad ring-1 ring-line",children:e.stacktrace.join(`
159
- `)})]})]})}function hwe({driver:e,queue:t,jobId:n,state:r,capabilities:i,onClose:o}){const{data:a,isLoading:s,isError:l}=w5(e,t,n);return d.jsx(GL,{open:!0,onOpenChange:u=>{u||o()},children:d.jsxs(XL,{placement:"right",className:"flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2.5",children:[d.jsx(Cve,{className:"text-xs font-normal uppercase tracking-wide text-muted-foreground",children:"Job detail"}),d.jsx(Xe,{variant:"ghost",size:"xs","aria-label":"Close job detail",onClick:o,children:"✕"})]}),d.jsx("div",{className:"flex-1 overflow-auto p-4",children:s?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading job…"}):l?d.jsx("p",{className:"text-xs text-bad",children:"Failed to load job."}):a?d.jsx(pwe,{detail:a,capabilities:i,driver:e,queue:t,state:r,onClose:o}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Job not found (it may have been removed)."})})]})})}function mwe(e){return e instanceof Error&&/\b403\b/.test(e.message)}function gwe(e){const t=e.trim();if(t==="")return{ok:!1,message:"Payload is required."};try{return{ok:!0,value:JSON.parse(t)}}catch{return{ok:!1,message:"Payload must be valid JSON."}}}function ywe({capabilities:e,driver:t,queue:n}){const r=O5(),[i,o]=O.useState(""),[a,s]=O.useState(""),[l,u]=O.useState(null),[c,f]=O.useState(void 0);if(!Fy(e,t,"enqueue"))return null;const p=mwe(r.error);async function h(v){v.preventDefault(),f(void 0);const y=gwe(a);if(!y.ok){u(y.message);return}u(null);try{const x=await r.mutateAsync({driver:t,queue:n,...i.trim()!==""?{name:i.trim()}:{},payload:y.value});f(x.id),s("")}catch{}}return d.jsxs("form",{onSubmit:h,className:"space-y-2 rounded-lg border border-line p-3",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Send message"}),d.jsx("input",{type:"text",value:i,onChange:v=>o(v.target.value),placeholder:"Job name (optional)","aria-label":"Job name",className:"w-full rounded border border-line bg-background px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground"}),d.jsx("textarea",{value:a,onChange:v=>s(v.target.value),placeholder:'{"to": "a@b.c"}',"aria-label":"Payload (JSON)",rows:4,className:"w-full rounded border border-line bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground"}),l&&d.jsx("p",{className:"text-[10px] text-bad",children:l}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xe,{type:"submit",variant:"good",disabled:r.isPending,children:r.isPending?"Sending…":"Send message"}),p&&d.jsx("span",{className:"text-[10px] text-bad",children:"Not authorized"}),c!==void 0&&!p&&d.jsx("span",{className:"text-[10px] text-good",children:c?`Enqueued job ${c}`:"Message enqueued"})]})]})}const JO=O.createContext(null);function vwe(e){return e instanceof Error&&/ 401$/.test(e.message)}function xwe({children:e}){const t=Ue(),n=ho(),[r,i]=O.useState("loading"),[o,a]=O.useState([]),s=O.useRef(!1),l=O.useMemo(()=>{async function u(){const f=await t.auth.me();if(f.status==="authenticated"){s.current=!0,i("app");return}if(f.status==="unauthenticated"){s.current=!0,a(f.modes),i("screen");return}s.current=!1,i("disabled")}async function c(){await t.auth.logout(),await u()}return{phase:r,modes:o,refresh:u,logout:c}},[t,r,o]);return O.useEffect(()=>{let u=!1;return t.auth.me().then(c=>{u||(c.status==="authenticated"?(s.current=!0,i("app")):c.status==="unauthenticated"?(s.current=!0,a(c.modes),i("screen")):(s.current=!1,i("disabled")))}),()=>{u=!0}},[t]),O.useEffect(()=>n.getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.state.status==="error"&&s.current&&vwe(c.query.state.error)&&l.refresh()}),[n,l]),d.jsx(JO.Provider,{value:l,children:e})}function ZO(){const e=O.useContext(JO);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function bwe(){return O.useContext(JO)}function wwe({children:e}){return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4 font-mono text-sm text-foreground",children:d.jsxs("div",{className:"w-full max-w-sm rounded-lg border border-line bg-panel p-8 shadow-2xl",children:[d.jsx("div",{className:"mb-6 text-center text-lg font-semibold text-brand",children:"Telescope"}),e]})})}function Swe(){const e=Ue(),{refresh:t}=ZO(),[n,r]=O.useState(""),[i,o]=O.useState(""),a=O.useId(),s=O.useId(),[l,u]=O.useState(null),[c,f]=O.useState(!1);async function p(h){h.preventDefault(),f(!0),u(null);try{const v=await e.auth.login(n,i);if(v.ok){await t();return}u(v.message)}finally{f(!1)}}return d.jsxs("form",{onSubmit:p,className:"flex flex-col gap-4",children:[d.jsxs("label",{className:"flex flex-col gap-1.5",htmlFor:a,children:[d.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Username"}),d.jsx(_s,{id:a,type:"text",name:"username",autoComplete:"username",value:n,onChange:h=>r(h.target.value),className:"px-3 py-2 text-sm"})]}),d.jsxs("label",{className:"flex flex-col gap-1.5",htmlFor:s,children:[d.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Password"}),d.jsx(_s,{id:s,type:"password",name:"password",autoComplete:"current-password",value:i,onChange:h=>o(h.target.value),className:"px-3 py-2 text-sm"})]}),l!==null?d.jsx("p",{role:"alert",className:"text-xs text-bad",children:l}):null,d.jsx(Xe,{type:"submit",variant:"brand",size:"md",disabled:c,className:"mt-2 uppercase tracking-wide",children:c?"Signing in…":"Sign in"})]})}function Owe(){const{refresh:e}=ZO(),[t,n]=O.useState(!1);async function r(){n(!0);try{await e()}finally{n(!1)}}return d.jsxs("div",{className:"flex flex-col gap-4 text-center",children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:"Open Telescope from your application"}),d.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Your session is minted by the host app. Use its “Open Telescope” action to sign in, then come back here."}),d.jsx("button",{type:"button",onClick:r,disabled:t,className:"mt-2 rounded border border-line px-3 py-2 text-xs font-medium uppercase tracking-wide text-foreground transition-colors hover:bg-panel-2 disabled:cursor-not-allowed disabled:opacity-50",children:t?"Checking…":"Retry"})]})}function Pwe({modes:e}){const t=e.includes("login");return d.jsx(wwe,{children:t?d.jsx(Swe,{}):d.jsx(Owe,{})})}const jwe=[{id:"page-overview",label:"Overview",to:"/"},{id:"page-entries",label:"Entries",to:"/entries"},{id:"page-pulse",label:"Pulse",to:"/pulse"},{id:"page-queues",label:"Queues",to:"/queues"},{id:"page-metrics",label:"Queue Metrics",to:"/queues/metrics"},{id:"page-schedules",label:"Schedules",to:"/schedules"},{id:"page-traces",label:"Traces",to:"/traces"}],Ewe=[...jwe,...Gl.map(e=>({id:`entry-${e.id}`,label:e.label,to:`/entries/${e.id}`}))];function Awe(e,t){const n=t.trim().toLowerCase();return n?e.filter(r=>r.label.toLowerCase().includes(n)):e}function Cwe(){const[e,t]=O.useState(!1);return O.useEffect(()=>{function n(r){(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),t(i=>!i))}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{open:e,setOpen:t}}function Twe({open:e,onClose:t}){const n=Oi(),r=O.useRef(null),[i,o]=O.useState(""),[a,s]=O.useState(0),l=O.useId(),u=O.useMemo(()=>Awe(Ewe,i),[i]);O.useEffect(()=>{var h;e&&(o(""),s(0),(h=r.current)==null||h.focus())},[e]),O.useEffect(()=>{s(h=>u.length===0?0:Math.min(h,u.length-1))},[u.length]);const c=O.useCallback(h=>{h&&(n(h.to),t())},[n,t]);function f(h){u.length!==0&&(h.key==="ArrowDown"?(h.preventDefault(),s(v=>(v+1)%u.length)):h.key==="ArrowUp"?(h.preventDefault(),s(v=>(v-1+u.length)%u.length)):h.key==="Enter"&&(h.preventDefault(),c(u[a])))}const p=u[a]?`${l}-${u[a].id}`:void 0;return d.jsx(GL,{open:e,onOpenChange:h=>{h||t()},children:d.jsxs(XL,{placement:"top","aria-label":"Command palette",className:"overflow-hidden",initialFocus:r,onKeyDown:f,children:[d.jsx("input",{ref:r,type:"text",value:i,onChange:h=>o(h.target.value),placeholder:"Jump to…","aria-label":"Search actions","aria-controls":l,"aria-activedescendant":p,className:"w-full border-b border-line bg-transparent px-4 py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"}),d.jsx("ul",{id:l,role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:u.length===0?d.jsx("li",{className:"px-4 py-3 text-xs text-muted-foreground",children:"No matching actions"}):u.map((h,v)=>d.jsx("li",{id:`${l}-${h.id}`,role:"option","aria-selected":v===a,onMouseEnter:()=>s(v),onMouseDown:y=>{y.preventDefault(),c(h)},className:`cursor-pointer px-4 py-2 text-sm ${v===a?"bg-panel-2 text-brand":"text-foreground"}`,children:h.label},h.id))})]})})}const LF="telescope-theme",hx="dark",FF=O.createContext(null);function Y_(){if(typeof window>"u"||!window.localStorage)return hx;try{const e=window.localStorage.getItem(LF);return e==="light"||e==="dark"?e:hx}catch{return hx}}function _we(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(LF,e)}catch{}}function Rwe({children:e}){const[t,n]=O.useState(Y_),r=O.useCallback(()=>{n(o=>{const a=o==="dark"?"light":"dark";return _we(a),a})},[]);O.useEffect(()=>{n(Y_())},[]),O.useEffect(()=>{if(typeof document>"u")return;const o=document.documentElement;return o.classList.toggle("light",t==="light"),o.classList.toggle("dark",t==="dark"),()=>{o.classList.remove("light","dark")}},[t]);const i=O.useMemo(()=>({theme:t,toggleTheme:r}),[t,r]);return d.jsx(FF.Provider,{value:i,children:d.jsx("div",{className:t,"data-theme":t,"data-testid":"telescope-root",children:e})})}function kwe(){const e=O.useContext(FF);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const Nwe=[{to:"/",label:"Overview",end:!0},{to:"/entries",label:"Entries",end:!0},{to:"/traces",label:"Traces",end:!0},{to:"/pulse",label:"Pulse",end:!1},{to:"/queues",label:"Queues",end:!1},{to:"/schedules",label:"Schedules",end:!1},{to:"/prunes",label:"Prunes",end:!1},{to:"/exports",label:"Exports",end:!1},{to:"/profiles",label:"Profiles",end:!1}];function $we(e,t,n){return e.filter(r=>!(r.to==="/traces"&&t===!1||r.to==="/profiles"&&n!==!0))}function Q_({isActive:e}){return`block rounded px-3 py-1.5 text-xs uppercase tracking-wide ${e?"bg-panel-2 text-brand":"text-muted-foreground hover:bg-panel hover:text-foreground"}`}function Mwe({isActive:e}){return`flex items-center gap-2 rounded px-3 py-1.5 text-xs ${e?"bg-panel-2 text-foreground":"text-muted-foreground hover:bg-panel hover:text-foreground"}`}function Iwe(){const{paused:e,setPaused:t}=m$();return d.jsxs(HO,{children:[d.jsx(VO,{render:d.jsxs(Xe,{variant:e?"warn":"good",onClick:()=>t(!e),"aria-pressed":e,className:"uppercase tracking-wide",children:[d.jsx("span",{"aria-hidden":"true",children:e?"⏸":"●"}),e?"Paused":"Live"]})}),d.jsx(WO,{children:e?"Resume live tail":"Pause live tail"})]})}function Dwe(){const{theme:e,toggleTheme:t}=kwe(),n=e==="dark";return d.jsxs(HO,{children:[d.jsx(VO,{render:d.jsxs(Xe,{onClick:t,"aria-pressed":!n,children:[d.jsx("span",{"aria-hidden":"true",children:n?"☾":"☀"}),n?"Dark":"Light"]})}),d.jsx(WO,{children:n?"Switch to light theme":"Switch to dark theme"})]})}function Lwe({onClick:e}){return d.jsxs(HO,{children:[d.jsx(VO,{render:d.jsx(Xe,{onClick:e,"aria-label":"Open command palette","aria-keyshortcuts":"Meta+K Control+K",className:"text-muted-foreground hover:text-foreground",children:d.jsx("span",{"aria-hidden":"true",children:"⌘K"})})}),d.jsx(WO,{children:"Open command palette (⌘K)"})]})}function Fwe(){const e=bwe(),[t,n]=O.useState(!1);if(e===null||e.phase!=="app")return null;async function r(){if(e!==null){n(!0);try{await e.logout()}finally{n(!1)}}}return d.jsxs(Xe,{onClick:r,disabled:t,title:"Sign out",children:[d.jsx("span",{"aria-hidden":"true",children:"⎋"}),"Sign out"]})}function Bwe({children:e}){var a,s,l,u,c,f;const{open:t,setOpen:n}=Cwe(),r=Is(),i=Q5(Y5((a=r.data)==null?void 0:a.entryTypes),(s=r.data)==null?void 0:s.watchers),o=$we(Nwe,(l=r.data)==null?void 0:l.tracesEnabled,(c=(u=r.data)==null?void 0:u.profiling)==null?void 0:c.enabled);return d.jsxs("div",{className:"flex min-h-screen bg-background font-mono text-sm text-foreground",children:[d.jsx(Twe,{open:t,onClose:()=>n(!1)}),d.jsxs("aside",{className:"flex w-56 shrink-0 flex-col gap-6 border-r border-line px-3 py-4",children:[d.jsx("span",{className:"px-3 text-base font-semibold text-brand",children:"Telescope"}),d.jsxs("nav",{className:"flex flex-col gap-1",children:[o.map(p=>d.jsx(eh,{to:p.to,end:p.end,className:Q_,children:p.label},p.to)),(((f=r.data)==null?void 0:f.dashboards)??[]).map(p=>d.jsx(eh,{to:`/ext/${p.id}`,className:Q_,children:p.label},p.id))]}),d.jsxs("nav",{className:"flex flex-col gap-1",children:[d.jsx("span",{className:"px-3 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Watchers"}),i.map(p=>d.jsxs(eh,{to:`/entries/${p.id}`,className:Mwe,children:[d.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${p.dot}`,"aria-hidden":"true"}),p.label]},p.id))]})]}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[d.jsx("header",{className:"flex items-center justify-end gap-4 border-b border-line px-4 py-2",children:d.jsxs(jbe,{delay:200,children:[d.jsx(S0e,{}),d.jsx(Lwe,{onClick:()=>n(!0)}),d.jsx(Dwe,{}),d.jsx(Iwe,{}),d.jsx(Fwe,{})]})}),d.jsx("main",{className:"min-w-0 flex-1",children:e})]})]})}function Uwe(e,t){if(e===void 0||!t)return null;const n=t.direction==="up-bad";return(n?e>=t.bad:e<=t.bad)?"bad":(n?e>=t.warn:e<=t.warn)?"warn":"ok"}const zwe={ok:"var(--good)",warn:"var(--warn)",bad:"var(--bad)"};function Hwe({points:e}){if(e.length<2)return null;const t=Math.max(...e),n=Math.min(...e),r=t-n||1,i=e.map((o,a)=>{const s=a/(e.length-1)*100,l=20-(o-n)/r*18-1;return`${a===0?"M":"L"}${s.toFixed(1)},${l.toFixed(1)}`}).join(" ");return d.jsxs("svg",{className:"mt-2",width:"100%",height:"22",viewBox:"0 0 100 22",preserveAspectRatio:"none",children:[d.jsx("title",{children:"Trend sparkline"}),d.jsx("path",{d:i,fill:"none",stroke:"var(--muted)",strokeWidth:"1.5"})]})}function Ot({label:e,value:t,delta:n,deltaLabel:r,spark:i,thresholds:o,currentValue:a,accent:s="text-foreground",hint:l}){const u=Uwe(a,o),c=n===void 0||!o?null:o.direction==="up-bad"?n<0:n>0,f=c===null?"#a1a1aa":c?"var(--good)":"var(--bad)",p=n===void 0?"":n>0?"▲":n<0?"▼":"◆";return d.jsxs("div",{"data-health":u??void 0,className:"rounded-lg border border-line bg-panel/40 px-4 py-3 overflow-hidden",children:[u&&d.jsx("div",{style:{height:3,background:zwe[u],margin:"-12px -16px 9px"}}),d.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),d.jsxs("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${s} flex items-baseline gap-2`,children:[t,n!==void 0&&d.jsxs("span",{className:"text-xs font-semibold",style:{color:f},children:[p," ",r??Math.abs(n)]})]}),i&&d.jsx(Hwe,{points:i}),l&&d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:l})]})}function Vwe(e){const t=Math.max(0,Math.floor(e)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m`:`${i}m ${t%60}s`}function Wwe({stats:e}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Server"}),e?d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[d.jsx(Ot,{label:"Uptime",value:Vwe(e.uptimeSec),accent:"text-brand"}),d.jsx(Ot,{label:"RSS",value:`${e.memory.rssMb} MB`,hint:`heap ${e.memory.heapUsedMb}/${e.memory.heapTotalMb} MB`}),d.jsx(Ot,{label:"Heap used",value:`${e.memory.heapUsedMb} MB`,accent:"text-sky-400"}),d.jsx(Ot,{label:"CPU",value:`${Math.round(e.cpu.userMs)} ms`,accent:"text-violet-400",hint:`sys ${Math.round(e.cpu.systemMs)} ms`}),d.jsx(Ot,{label:"Event loop",value:e.eventLoopDelayMs===null?"n/a":`${e.eventLoopDelayMs} ms`,accent:e.eventLoopDelayMs!==null&&e.eventLoopDelayMs>100?"text-bad":"text-foreground",hint:`instance ${e.instanceId}`})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading…"})]})}function Kwe(e){return`${(Math.max(0,e)/1e3).toFixed(1)} µs`}function J_(e){return e===null?"n/a":`${e.toFixed(1)} ms`}function qwe({health:e}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Telescope health"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Captures run off the response path — your requests don't wait on Telescope."})]}),e?d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[d.jsx(Ot,{label:"Capture cost",value:`${Kwe(e.captureCostNanos)}/capture`,accent:"text-brand",hint:"micro-benchmark"}),d.jsx(Ot,{label:"Buffer",value:`${e.bufferUsed} / ${e.bufferSize}`,accent:"text-sky-400",hint:`high-water ${e.bufferHighWater}`}),d.jsx(Ot,{label:"Last flush",value:J_(e.lastFlushMs),hint:`max ${J_(e.maxFlushMs)}`}),d.jsx(Ot,{label:"Flushes",value:e.flushes.toLocaleString(),accent:"text-violet-400",hint:`${e.flushedEntries.toLocaleString()} entries`}),d.jsx(Ot,{label:"Dropped",value:e.droppedCount.toLocaleString(),accent:e.droppedCount>0?"text-bad":"text-good",hint:e.droppedCount>0?`overflow ${e.overflowDropped} · store ${e.storeFailedDropped}`:"keeping up"}),d.jsx(Ot,{label:"Truncated",value:e.truncatedCount.toLocaleString(),accent:e.truncatedCount>0?"text-warn":"text-good",hint:e.truncatedCount>0?"fat content — tune redact/sampling":"within bounds"})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading…"})]})}function Gwe({retention:e,pruneEnabled:t}){const n=b$(),r=e==null?void 0:e.retention;async function i(){if(globalThis.confirm("Prune now deletes entries older than the retention window. Continue?"))try{const o=await n.mutateAsync();globalThis.alert(`Pruned ${o.pruned} ${o.pruned===1?"entry":"entries"}.`)}catch{globalThis.alert("Prune failed.")}}return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Retention"}),t?d.jsx("button",{type:"button",onClick:i,disabled:n.isPending,className:"rounded border border-line px-2 py-1 text-[11px] text-foreground hover:border-brand hover:text-brand disabled:cursor-not-allowed disabled:opacity-50",children:n.isPending?"Pruning…":"Prune now"}):null]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[d.jsx(Ot,{label:"Window",value:r?rf(r.afterMs):"none",accent:r?"text-brand":"text-muted-foreground",hint:(r==null?void 0:r.keepLast)!=null?`keep last ${r.keepLast}`:"unbounded"}),d.jsx(Ot,{label:"Entries",value:(e==null?void 0:e.entryCount)!=null?e.entryCount.toLocaleString():"n/a"}),d.jsx(Ot,{label:"Oldest",value:(e==null?void 0:e.oldestCreatedAt)!=null?"tracked":"n/a"})]})]})}function BF(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Xwe(e){return((e==null?void 0:e.buckets)??[]).map(t=>({label:BF(t.t),value:t.total}))}function UF(e){const t=YO((e==null?void 0:e.buckets)??[]);return((e==null?void 0:e.buckets)??[]).map(n=>{const r={label:BF(n.t)};for(const i of t)r[i]=n.byType[i]??0;return r})}function Ywe(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Qwe(e){const t=e.request??0;return t===0?null:(e.exception??0)/t}const Jwe=.05;function Zwe(e){return e===null?"n/a":`${(e*100).toFixed(1)}%`}function eSe(e){return(e==null?void 0:e.slowRoutes.length)??0}const Mw=100;function tSe(e){return((e==null?void 0:e.queues)??[]).filter(t=>{const n=Math.max(0,t.total-t.completed-t.failed);return t.failed>0||n>=Mw})}function nSe({pulse:e,queues:t}){const n=(e==null?void 0:e.counts)??{},r=Ywe(n),i=n.request??0,o=n.exception??0,a=Qwe(n),s=((t==null?void 0:t.queues)??[]).reduce((u,c)=>u+c.failed,0),l=eSe(e);return d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Ot,{label:"Requests",value:i.toLocaleString(),accent:"text-brand",hint:`${r.toLocaleString()} entries total`}),d.jsx(Ot,{label:"Error rate",value:Zwe(a),accent:a!==null&&a>Jwe?"text-bad":"text-foreground",hint:`${o.toLocaleString()} exceptions`}),d.jsx(Ot,{label:"Failed jobs",value:s.toLocaleString(),accent:s>0?"text-bad":"text-foreground",hint:"across queues"}),d.jsx(Ot,{label:"Slow routes",value:l.toLocaleString(),accent:l>0?"text-warn":"text-foreground",hint:"routes over the slow p99 threshold"})]})}function Z_({title:e,emptyLabel:t,children:n}){const r=Array.isArray(n)?n.length>0:!!n;return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),r?d.jsx("ul",{className:"space-y-1 text-xs",children:n}):d.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}function rSe({hotspots:e,onSelectFamily:t}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"N+1 query hotspots"}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(n=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>t(n.familyHash),className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsxs("span",{className:"min-w-0 truncate",children:[d.jsxs("span",{className:"whitespace-nowrap text-warn",children:["×",n.perRequest]})," ",d.jsx("span",{className:"text-muted-foreground",children:n.sql})]}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[n.requests," req · ",n.total," total",n.totalDurationMs>0?` · ${Math.round(n.totalDurationMs)}ms`:""]})]})},n.familyHash))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"None detected"})]})}function iSe({queues:e,onOpenQueues:t}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Queues needing attention"}),d.jsx("button",{type:"button",onClick:t,className:"text-[11px] text-muted-foreground hover:text-brand",children:"All queues →"})]}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(n=>{const r=Math.max(0,n.total-n.completed-n.failed);return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsx("span",{className:"min-w-0 truncate text-foreground",children:n.queue}),d.jsxs("span",{className:"shrink-0 tabular-nums",children:[n.failed>0?d.jsxs("span",{className:"text-bad",children:[n.failed," failed"]}):null,n.failed>0&&r>=Mw?d.jsx("span",{className:"text-muted-foreground",children:" · "}):null,r>=Mw?d.jsxs("span",{className:"text-warn",children:[r.toLocaleString()," pending"]}):null]})]})},n.queue)})}):d.jsx("p",{className:"text-xs text-good",children:"All queues healthy"})]})}function oSe({hotspots:e}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Slowest jobs"}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(t=>d.jsxs("li",{className:"flex items-center justify-between gap-3 border-t border-line-soft pt-1 first:border-0 first:pt-0",children:[d.jsx("span",{className:"min-w-0 truncate text-foreground",children:t.route}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[d.jsxs("span",{className:"text-warn",children:[Math.round(t.p99),"ms"]})," p99 · ",t.count,"×"]})]},t.route))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"No jobs in window."})]})}function aSe({users:e,onSelectUser:t}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Load by user"}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(n=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>t(n.user),className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsx("span",{className:"min-w-0 truncate text-foreground",children:n.user}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[n.count," req · ",Math.round(n.totalDurationMs),"ms"]})]})},n.user))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"No identified users in window."})]})}function sSe({history:e}){const t=(e==null?void 0:e.samples)??[],n=t.map(a=>a.cpuPercent),r=t.map(a=>a.rssMb),i=t.map(a=>a.heapUsedMb),o=t[t.length-1];return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Resource history"}),t.length>1?d.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 text-[11px] text-muted-foreground",children:["CPU ",o?`${o.cpuPercent}%`:""]}),d.jsx(lh,{values:n})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 text-[11px] text-muted-foreground",children:["RSS ",o?`${o.rssMb}MB`:""]}),d.jsx(lh,{values:r})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 text-[11px] text-muted-foreground",children:["Heap ",o?`${o.heapUsedMb}MB`:""]}),d.jsx(lh,{values:i})]})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Collecting samples…"})]})}function lSe(){var y,x,g,m,b,S,w;const[e,t]=O.useState("1h"),n=Oi(),r=S$(e),i=O$(e),o=WS({window:e,buckets:60}),a=R5(),s=k5(),l=$5(),u=P5(),c=Is(),f=Xwe(o.data),p=UF(o.data),h=YO(((y=o.data)==null?void 0:y.buckets)??[]),v=tSe(i.data);return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Overview"}),d.jsx(zd,{value:e,onChange:t})]}),d.jsx(nSe,{pulse:r.data,queues:i.data}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(Z_,{title:"Recent failures",emptyLabel:"No exceptions 🎉",children:(((x=r.data)==null?void 0:x.topExceptions)??[]).map(P=>d.jsxs("li",{className:"flex items-center justify-between gap-3 border-t border-line-soft pt-1 first:border-0 first:pt-0",children:[d.jsxs("span",{className:"min-w-0",children:[d.jsx("span",{className:"text-bad",children:P.class})," ",d.jsx("span",{className:"text-muted-foreground",children:P.message})]}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:["×",P.count]})]},P.familyHash))}),d.jsx(rSe,{hotspots:((g=r.data)==null?void 0:g.nPlusOne)??[],onSelectFamily:P=>n(`/entries/query?familyHash=${encodeURIComponent(P)}`)})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(Z_,{title:"Slowest",emptyLabel:"Nothing slow in window.",children:(((m=r.data)==null?void 0:m.slowest)??[]).map(P=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>n(`/entries/view/${P.id}`),className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsxs("span",{className:"min-w-0 truncate",children:[d.jsx("span",{className:"text-brand",children:P.type})," ",d.jsx("span",{className:"text-muted-foreground",children:P.label})]}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[P.durationMs,"ms"]})]})},P.id))}),d.jsx(iSe,{queues:v,onOpenQueues:()=>n("/queues")})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(oSe,{hotspots:((b=r.data)==null?void 0:b.slowJobs)??[]}),d.jsx(aSe,{users:((S=r.data)==null?void 0:S.loadByUser)??[],onSelectUser:P=>n(`/entries?tag=${encodeURIComponent(`user:${P}`)}`)})]}),d.jsx(sSe,{history:s.data}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(Us,{title:"Throughput",valueLabel:"entries",data:f}),d.jsx(GO,{title:"By type",series:h,data:p})]}),d.jsx(Wwe,{stats:a.data}),d.jsx(qwe,{health:l.data}),d.jsx(Gwe,{retention:u.data,pruneEnabled:((w=c.data)==null?void 0:w.pruneEnabled)??!1})]})}function uSe(){const{data:e}=v$(),t=(e==null?void 0:e.queues)??[],n=e==null?void 0:e.capabilities,[r,i]=O.useState(void 0),[o,a]=O.useState("waiting"),[s,l]=O.useState(null);O.useEffect(()=>{if(r||t.length===0)return;const f=t[0];f&&i({driver:f.driver,queue:f.queue})},[t,r]);const u=t.find(f=>f.driver===(r==null?void 0:r.driver)&&f.queue===(r==null?void 0:r.queue));function c(f,p){i({driver:f,queue:p}),l(null)}return d.jsxs("div",{className:"grid grid-cols-1 gap-4 p-4 lg:grid-cols-[280px_minmax(0,1fr)]",children:[d.jsxs("aside",{className:"space-y-2",children:[d.jsx("h3",{className:"px-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Live queues"}),d.jsx(Z0e,{...r?{selected:r}:{},onSelect:c})]}),d.jsx("section",{className:"min-w-0 space-y-3",children:r?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("h2",{className:"truncate text-sm text-brand",children:[r.queue,d.jsx("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-muted-foreground",children:r.driver})]}),o==="failed"&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(cwe,{capabilities:n,driver:r.driver,queue:r.queue}),d.jsx(fwe,{capabilities:n,driver:r.driver,queue:r.queue})]})]}),d.jsx(ewe,{counts:u==null?void 0:u.counts,state:o,onState:a}),d.jsx(iwe,{driver:r.driver,queue:r.queue,state:o,onOpen:l}),d.jsx(ywe,{capabilities:n,driver:r.driver,queue:r.queue})]}):d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-12 text-center text-xs text-muted-foreground",children:"Select a queue to inspect its jobs."})}),r&&s&&d.jsx(hwe,{driver:r.driver,queue:r.queue,jobId:s,state:o,capabilities:n,onClose:()=>l(null)})]})}function cSe(e,t){return t.trim()!==""?`No entries match tag '${t.trim()}'`:e?`No ${jg(e)} entries`:"No entries"}function eR(){const{type:e}=Sg(),t=Oi(),[n]=Vz(),[r,i]=O.useState(()=>n.get("tag")??""),[o,a]=O.useState(""),[s,l]=O.useState(""),[u,c]=O.useState(0),[f,p]=O.useState(0);function h(N){i(N),p(I=>I+1)}function v(N){i(N),c(I=>I+1)}const y=e&&G5(e)?e:void 0,x=r.trim(),g=kbe(x)?x:"",m=g===""?x:"",b=s.trim(),S=n.get("familyHash")??"",w=S!=="",P=b!=="",j=y!==void 0||x!==""||w||P,{data:E,isLoading:A}=w$({...y?P$(y):{},...x!==""?{tag:x}:{},...w?{familyHash:S}:{},...P?{search:b}:{}}),C=(E==null?void 0:E.data)??[];function T(){l(o)}function _(){a(""),l("")}function R(){i(""),_(),t("/entries")}function $(){t(y?`/entries/${y}`:"/entries")}return d.jsxs("div",{className:"p-4",children:[y?d.jsx(z0e,{type:y}):null,d.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3 border-b border-line pb-3",children:[y?d.jsxs(Xe,{variant:"ghost",onClick:()=>t("/entries"),className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{className:`h-2 w-2 rounded-full ${KS(y)}`,"aria-hidden":"true"}),jg(y),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):d.jsx("span",{className:"rounded bg-panel px-2 py-1 text-xs text-muted-foreground",children:"All types"}),d.jsx(K_,{onSelect:h},`tag-${u}`),d.jsx(K_,{prefix:Rbe,placeholder:"Filter by user…",ariaLabel:"Filter by user",onSelect:v},`user-${f}`),m!==""?d.jsxs(Xe,{variant:"ghost",onClick:()=>i(""),className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{children:`tag:${m}`}),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,g!==""?d.jsxs(Xe,{variant:"ghost",onClick:()=>i(""),className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{children:`User: ${KO(g)}`}),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,d.jsx(_s,{type:"text",value:o,onChange:N=>a(N.target.value),onKeyDown:N=>{N.key==="Enter"&&T()},onBlur:T,placeholder:"Search content…","aria-label":"Search content"}),P?d.jsxs(Xe,{variant:"ghost",onClick:_,className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{children:`search:"${b}"`}),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,w?d.jsxs(Xe,{variant:"ghost",onClick:$,className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"family:"}),S.slice(0,12),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,j?d.jsx(Xe,{variant:"ghost",onClick:R,children:"Clear filters"}):null]}),A?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):C.length===0?d.jsx("p",{className:"text-muted-foreground",children:cSe(y,r)}):d.jsx(_F,{entries:C,onSelect:N=>t(`/entries/view/${N}`)})]})}function fSe(){const{id:e=""}=Sg(),t=Oi(),{data:n,isLoading:r}=_5(e);return d.jsxs("div",{className:"p-4",children:[d.jsx("button",{type:"button",onClick:()=>t("/entries"),className:"mb-4 text-xs text-muted-foreground hover:text-foreground",children:"← entries"}),r||!n?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):d.jsx(t0e,{entry:n,onSelect:i=>t(`/entries/view/${i}`)})]})}const dSe={json:"JSON",csv:"CSV"},pSe={all:"all",...Object.fromEntries(Gl.map(e=>[e.id,e.label]))},hSe=200,tR=1e3,nR=1e4,rR={"15m":15*6e4,"1h":60*6e4,"6h":6*60*6e4,"24h":24*60*6e4};function mSe(e){return e==="all"?{}:P$(e)}async function gSe(e,t,n,r,i){const o=[];let a;for(;o.length<n;){const s=Math.min(hSe,n-o.length),l=await e.entries({...t,limit:s,...a!==void 0?{cursor:a}:{}});let u=!1;for(const c of l.data){if(new Date(c.createdAt).getTime()<r){u=!0;break}if(o.push(c),o.length>=n)break}if(i(o.length),u||l.nextCursor===null)break;a=l.nextCursor}return o}function ySe({records:e}){return e.length===0?null:d.jsx("div",{className:"rounded-lg border border-line",children:d.jsxs(Md,{className:"min-w-[640px] text-left",children:[d.jsx(Id,{children:d.jsxs(kr,{children:[d.jsx(Ge,{children:"Filename"}),d.jsx(Ge,{children:"Type"}),d.jsx(Ge,{children:"Rows"}),d.jsx(Ge,{children:"Format"}),d.jsx(Ge,{children:"Time"})]})}),d.jsx(Dd,{children:e.map(t=>d.jsxs(kr,{className:"hover:bg-panel",children:[d.jsx(nt,{className:"font-mono text-foreground",children:t.filename}),d.jsx(nt,{className:"text-muted-foreground",children:t.type}),d.jsx(nt,{className:"tabular-nums text-foreground",children:t.rows.toLocaleString()}),d.jsx(nt,{className:"uppercase text-muted-foreground",children:t.format}),d.jsx(nt,{className:"text-muted-foreground",children:new Date(t.at).toLocaleTimeString()})]},`${t.filename}:${t.at}`))})]})})}function vSe(){const e=Ue(),t=O.useId(),n=O.useId(),[r,i]=O.useState("all"),[o,a]=O.useState("1h"),[s,l]=O.useState(""),[u,c]=O.useState(tR),[f,p]=O.useState("json"),[h,v]=O.useState(!1),[y,x]=O.useState(null),[g,m]=O.useState(null),[b,S]=O.useState([]);async function w(){v(!0),m(null),x(0);const P=Math.min(Math.max(1,u),nR),j=Date.now()-(rR[o]??rR["1h"]),E={...mSe(r),...s.trim()!==""?{search:s.trim()}:{}};try{const A=await gSe(e,E,P,j,x),C=new Date().toISOString().replace(/[:.]/g,"-"),T=`telescope-export-${r}-${C}.${f}`;f==="csv"?b0e(T,x0e(A)):qO(T,A),S(_=>[{filename:T,type:r,rows:A.length,format:f,at:Date.now()},..._])}catch{m("Export failed while gathering entries.")}finally{v(!1)}}return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"px-1",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Export workbench"}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Page captured entries into a downloadable JSON or CSV file. Gathering runs in your browser against the live store, newest-first within the selected window."})]}),d.jsxs("div",{className:"flex flex-wrap items-end gap-3 rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:["Type",d.jsxs(Aw,{items:pSe,value:r,onValueChange:P=>{typeof P=="string"&&i(P)},children:[d.jsx(Tw,{"aria-label":"Entry type",children:d.jsx(Cw,{})}),d.jsxs(_w,{children:[d.jsx(Lc,{value:"all",children:"all"}),Gl.map(P=>d.jsx(Lc,{value:P.id,children:P.label},P.id))]})]})]}),d.jsxs("div",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:["Window",d.jsx(zd,{value:o,onChange:a})]}),d.jsxs("label",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",htmlFor:t,children:["Search",d.jsx(_s,{id:t,type:"text",value:s,onChange:P=>l(P.target.value),placeholder:"content filter"})]}),d.jsxs("label",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",htmlFor:n,children:["Limit",d.jsx(_s,{id:n,type:"number",min:1,max:nR,value:u,onChange:P=>c(Number(P.target.value)||tR),className:"w-24 tabular-nums"})]}),d.jsxs("div",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:["Format",d.jsxs(Aw,{items:dSe,value:f,onValueChange:P=>p(P==="csv"?"csv":"json"),children:[d.jsx(Tw,{"aria-label":"Export format",children:d.jsx(Cw,{})}),d.jsxs(_w,{children:[d.jsx(Lc,{value:"json",children:"JSON"}),d.jsx(Lc,{value:"csv",children:"CSV"})]})]})]}),d.jsx(Xe,{onClick:w,disabled:h,size:"md",children:h?"Exporting…":"Export"}),h&&y!==null&&d.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:["gathered ",y.toLocaleString(),"…"]})]}),g&&d.jsx("p",{className:"px-1 text-xs text-bad",children:g}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"px-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Recent exports (this session)"}),b.length===0?d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-10 text-center text-xs text-muted-foreground",children:"No exports yet. Pick a type, window, and format, then export."}):d.jsx(ySe,{records:b})]})]})}function xSe({title:e,segments:t,style:n="donut",height:r=220,onSelect:i}){const o=r-64,a=O.useMemo(()=>Ju(t.map(c=>c.label),(c,f)=>{var p;return fx(c,f,(p=t[f])==null?void 0:p.color)}),[t]);function s(c){const f=t[c];f&&i&&i(Ld({label:f.label,value:f.value}))}const l=i?{onClick:(c,f)=>s(f),cursor:"pointer"}:{};if(t.length===0)return d.jsx(la,{title:e,height:o,children:d.jsx(Fd,{height:o})});if(n==="bar"){const c=[{name:"breakdown",...Object.fromEntries(t.map(f=>[f.label,f.value]))}];return d.jsx(la,{title:e,height:o,children:d.jsx(js,{config:a,children:d.jsxs(iO,{data:c,layout:"vertical",children:[d.jsx(bu,{content:d.jsx(wu,{hideLabel:!0})}),d.jsx(rw,{content:d.jsx(ow,{})}),t.map((f,p)=>d.jsx(bo,{dataKey:f.label,stackId:"a",fill:fx(f.label,p,f.color),isAnimationActive:!1,...i?{onClick:()=>s(p),cursor:"pointer"}:{}},f.label))]})})})}const u=t.map((c,f)=>({name:c.label,value:c.value,color:fx(c.label,f,c.color)}));return d.jsx(la,{title:e,height:o,children:d.jsx(js,{config:a,children:d.jsxs(vhe,{children:[d.jsx(bu,{content:d.jsx(wu,{hideLabel:!0})}),d.jsx(rw,{content:d.jsx(ow,{})}),d.jsx(xo,{data:u,dataKey:"value",nameKey:"name",innerRadius:"55%",outerRadius:"80%",isAnimationActive:!1,...l,children:u.map(c=>d.jsx(Hu,{fill:c.color},c.name))})]})})})}function bSe(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}const wSe={p50:"tint-good",p95:"tint-warn",p99:"tint-bad"};function SSe({title:e,buckets:t,p50:n,p95:r,p99:i,height:o=220,onSelect:a}){const s=[];n!==void 0&&s.push([n,"p50"]),r!==void 0&&s.push([r,"p95"]),i!==void 0&&s.push([i,"p99"]);const l=o-64,u=O.useMemo(()=>Ju(["count"],()=>"var(--live)"),[]),c=a?{onClick:(f,p)=>{const h=t[p];h&&a(Ld({label:h.label,value:h.count}))},cursor:"pointer"}:{};return d.jsx(la,{title:e,height:l,children:d.jsxs("div",{className:"flex h-full flex-col",children:[s.length>0&&d.jsx("div",{className:"mb-1.5 flex flex-wrap gap-2",children:s.map(([f,p])=>d.jsxs("span",{className:`rounded border px-1.5 text-[10px] tabular-nums ${wSe[p]}`,children:[p,": ",bSe(f)]},p))}),d.jsx("div",{className:"min-h-0 flex-1",children:t.length===0?d.jsx(Fd,{}):d.jsx(js,{config:u,children:d.jsxs(iO,{data:t,margin:{top:4,right:8,bottom:0,left:-16},children:[d.jsx(Rd,{vertical:!1}),d.jsx(so,{dataKey:"label",tickLine:!1}),d.jsx(lo,{tickLine:!1,allowDecimals:!1,width:40}),d.jsx(bu,{cursor:{fill:"color-mix(in srgb, var(--text) 5%, transparent)"},content:d.jsx(wu,{})}),d.jsx(bo,{dataKey:"count",name:"count",fill:Yi("count"),radius:[3,3,0,0],isAnimationActive:!1,...c})]})})})]})})}function OSe({title:e,value:t,min:n=0,max:r=1,label:i,color:o="var(--good)",height:a=220}){const s=r-n,l=s===0?0:Math.max(0,Math.min(1,(t-n)/s)),u=i??`${Math.round(l*100)}%`,c=a-64,f=O.useMemo(()=>Ju(["value"],()=>o,()=>e),[o,e]),p=[{value:l*100}];return d.jsx(la,{title:e,height:c,children:d.jsxs("div",{className:"relative h-full",children:[d.jsx(js,{config:f,children:d.jsxs(xhe,{innerRadius:"60%",outerRadius:"100%",data:p,startAngle:180,endAngle:0,barSize:16,children:[d.jsx(qu,{type:"number",domain:[0,100],tick:!1,axisLine:!1}),d.jsx(_d,{dataKey:"value",fill:Yi("value"),background:!0,cornerRadius:4,isAnimationActive:!1})]})}),d.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center pt-[40%]",children:d.jsx("span",{className:"text-xl font-semibold tabular-nums text-foreground",children:u})})]})})}function PSe({columns:e}){const[t,n]=O.useState(!1),r=O.useRef(null),i=e.filter(a=>a.getCanHide());if(O.useEffect(()=>{if(!t)return;function a(l){var u;l.target instanceof Node&&((u=r.current)!=null&&u.contains(l.target))||n(!1)}function s(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",s)}},[t]),i.length===0)return null;const o=i.filter(a=>!a.getIsVisible()).length;return d.jsxs("div",{className:"relative",ref:r,children:[d.jsxs(Xe,{variant:"ghost",size:"xs","aria-haspopup":"menu","aria-expanded":t,onClick:()=>n(a=>!a),className:"px-1.5 text-muted-foreground",children:["Columns",o>0?` (${i.length-o}/${i.length})`:""]}),t&&d.jsx("div",{role:"menu",className:"absolute right-0 z-20 mt-1 min-w-[10rem] rounded border border-line bg-popover p-1 shadow-lg",children:i.map(a=>d.jsxs(Xe,{role:"menuitemcheckbox","aria-checked":a.getIsVisible(),variant:"ghost",size:"xs",onClick:()=>a.toggleVisibility(),className:"w-full justify-start gap-2 normal-case tracking-normal",children:[d.jsx("span",{"aria-hidden":"true",className:a.getIsVisible()?"":"opacity-30",children:a.getIsVisible()?"☑":"☐"}),typeof a.columnDef.header=="string"?a.columnDef.header:a.id]},a.id))})]})}function jSe(e){return ESe(e)||typeof e=="function"||ASe(e)}function ESe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ASe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ya(e,t){return e==null?null:jSe(e)?D.createElement(e,t):e}function CSe(e){var t,n;if("cell"in e&&e.cell){const r=e.cell,i=r.column.columnDef,o=r,a=i;return(t=o.getIsAggregated)!=null&&t.call(o)?Ya(a.aggregatedCell??i.cell,r.getContext()):(n=o.getIsPlaceholder)!=null&&n.call(o)?null:Ya(i.cell,r.getContext())}return"header"in e&&e.header?Ya(e.header.column.columnDef.header,e.header.getContext()):"footer"in e&&e.footer?Ya(e.footer.column.columnDef.footer,e.footer.getContext()):null}function TSe({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:o,checkDirty:a,shallowPropagate:s};function r(u,c,f){const p=c.depsTail;if(p!==void 0&&p.dep===u)return;const h=p!==void 0?p.nextDep:c.deps;if(h!==void 0&&h.dep===u){h.version=f,c.depsTail=h;return}const v=u.subsTail;if(v!==void 0&&v.version===f&&v.sub===c)return;const y=c.depsTail=u.subsTail={version:f,dep:u,sub:c,prevDep:p,nextDep:h,prevSub:v,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:c.deps=y,v!==void 0?v.nextSub=y:u.subs=y}function i(u,c=u.sub){const f=u.dep,p=u.prevDep,h=u.nextDep,v=u.nextSub,y=u.prevSub;return h!==void 0?h.prevDep=p:c.depsTail=p,p!==void 0?p.nextDep=h:c.deps=h,v!==void 0?v.prevSub=y:f.subsTail=y,y!==void 0?y.nextSub=v:(f.subs=v)===void 0&&n(f),h}function o(u){let c=u.nextSub,f;e:do{const p=u.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&l(u,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const v=p.subs;if(v!==void 0){const y=(u=v).nextSub;y!==void 0&&(f={value:c,prev:f},c=y);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function a(u,c){let f,p=0,h=!1;e:do{const v=u.dep,y=v.flags;if(c.flags&16)h=!0;else if((y&17)===17){if(e(v)){const x=v.subs;x.nextSub!==void 0&&s(x),h=!0}}else if((y&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=v.deps,c=v,++p;continue}if(!h){const x=u.nextDep;if(x!==void 0){u=x;continue}}for(;p--;){const x=c.subs,g=x.nextSub!==void 0;if(g?(u=f.value,f=f.prev):u=x,h){if(e(c)){g&&s(x),c=u.sub;continue}h=!1}else c.flags&=-33;c=u.sub;const m=u.nextDep;if(m!==void 0){u=m;continue e}}return h}while(!0)}function s(u){do{const c=u.sub,f=c.flags;(f&48)===32&&(c.flags=f|16,(f&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let f=c.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}function _Se(e,t,n){var o,a,s;const r=typeof e=="object",i=r?e:void 0;return{next:(o=r?e.next:e)==null?void 0:o.bind(i),error:(a=r?e.error:t)==null?void 0:a.bind(i),complete:(s=r?e.complete:n)==null?void 0:s.bind(i)}}const Iw=[];let uh=0;const{link:iR,unlink:RSe,propagate:kSe,checkDirty:zF,shallowPropagate:oR}=TSe({update(e){return e._update()},notify(e){Iw[Dw++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,eg(e))}});let Bp=0,Dw=0,si,Lw=0;function NSe(e){try{++Lw,e()}finally{--Lw||HF()}}function eg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=RSe(n,e)}function HF(){if(!(Lw>0)){for(;Bp<Dw;){const e=Iw[Bp];Iw[Bp++]=void 0,e.notify()}Bp=0,Dw=0}}function $Se(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?0:1,get(){return si!==void 0&&iR(i,si,uh),i._snapshot},subscribe(o){const a=_Se(o),s={current:!1},l=MSe(()=>{var u;i.get(),s.current?(u=a.next)==null||u.call(a,i._snapshot):s.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(o){const a=si,s=(t==null?void 0:t.compare)??Object.is;if(n)si=i,++uh,i.depsTail=void 0;else if(o===void 0)return!1;n&&(i.flags=5);try{const l=i._snapshot,u=typeof o=="function"?o(l):o===void 0&&n?r(l):o;return l===void 0||!s(l,u)?(i._snapshot=u,!0):!1}finally{si=a,n&&(i.flags&=-5),eg(i)}}};return n?(i.flags=17,i.get=function(){const o=i.flags;if(o&16||o&32&&zF(i.deps,i)){if(i._update()){const a=i.subs;a!==void 0&&oR(a)}}else o&32&&(i.flags=o&-33);return si!==void 0&&iR(i,si,uh),i._snapshot}):i.set=function(o){if(i._update(o)){const a=i.subs;a!==void 0&&(kSe(a),oR(a),HF())}},i}function MSe(e){const t=()=>{const r=si;si=n,++uh,n.depsTail=void 0,n.flags=6;try{return e()}finally{si=r,n.flags&=-5,eg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const r=this.flags;r&16||r&32&&zF(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,eg(this)}};return t(),n}function of(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=aR(e);if(n.length!==aR(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function aR(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function ISe(e,t){return e===t}function VF(e,t=r=>r,n){const r=(n==null?void 0:n.compare)??ISe,i=O.useCallback(a=>{const{unsubscribe:s}=e.subscribe(a);return s},[e]),o=O.useCallback(()=>e.get(),[e]);return _L.useSyncExternalStoreWithSelector(i,o,o,t,r)}function DSe(e){const t=VF(e.source,e.selector,{compare:of});return typeof e.children=="function"?e.children(t):e.children}function LSe(e){const t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),"set"in e&&(t.setState=e.set.bind(e)),t}function FSe(e){const{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw new Error("Feature not supported in current reactivity implementation")},unmount:()=>{throw new Error("Feature not supported in current reactivity implementation")},schedule:e.schedule??(i=>queueMicrotask(i)),batch:n,untrack:i=>i(),createReadonlyAtom:(i,o)=>{const a=(o==null?void 0:o.compare)??Object.is;let s=!1,l;const u=()=>{const f=i();return(!s||!a(l,f))&&(l=f,s=!0),l},c=t(()=>(r.get(),u()),{compare:a});return{get:u,subscribe:c.subscribe.bind(c)}},createWritableAtom:(i,o)=>t(i,{compare:o==null?void 0:o.compare}),commit:()=>{r.set(i=>i+1)}}}function BSe(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:i=>{r=i,n=!0},subscribe:i=>e.subscribe(o=>{(!n||!t(r,o))&&i(o)})}}function USe(){return FSe({createAtom:$Se,batch:NSe})}function Zu(e,t){return typeof e=="function"?e(t):e}function co(e){if(Array.isArray(e))return e.map(co);if(e&&typeof e=="object"){const t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;const n=t===null?Cn():{},r=Object.keys(e);for(let i=0;i<r.length;i++){const o=r[i];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,value:co(e[o]),writable:!0})}return n}return e}function Cn(){return Object.create(null)}function By(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eP(e,t){return n=>{var r;(((r=t.options.atoms)==null?void 0:r[e])??t.baseAtoms[e]).set(i=>Zu(n,i))}}function sR(e){if(typeof e!="object"||e===null)return!1;if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function lR(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}const zSe=3;function HSe(e,t){return WF(e,t,zSe)}function WF(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!sR(e)||!sR(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;const r=lR(e),i=lR(t);if(r.length!==i.length)return!1;const o=e,a=t;for(let s=0;s<r.length;s++){const l=r[s];if(!Object.prototype.propertyIsEnumerable.call(t,l)||!WF(o[l],a[l],n-1))return!1}return!0}function ec(e,t,n,r=HSe){const i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,o=e.options[i];o&&o(a=>{const s=Zu(n,a);return r(a,s)?a:s})}function KF(e){return e instanceof Function}function VSe(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a.length&&r(a)})};return r(e),n}const WSe=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:o})=>{let a=[],s;return u=>{i==null||i();const c=t==null?void 0:t(u);let f=!c||c.length!==(a==null?void 0:a.length);if(!f&&c){for(let p=0;p<c.length;p++)if(c[p]!==a[p]){f=!0;break}}return n==null||n(f),f&&(a=c,o==null||o(),s=e(...c??[]),r==null||r(s)),s}};function KSe(e){let t=!1;return()=>{if(!t){t=!0;return}e()}}function tP({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...o}){const a=()=>{if(!r)return;const{schedule:l,untrack:u}=i._reactivity;l(()=>u(()=>r()))};return WSe({...o,...{onAfterUpdate:()=>{a()}}})}function qF(e,t="_"){const[n,r]=e.split(t);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function Ca(e,t,n){for(const[r,{fn:i,memoDeps:o}]of Object.entries(n)){const{fnKey:a,fnName:s}=qF(r);t[a]=o?tP({memoDeps:o,fn:i,fnName:s,table:t,feature:e}):i}}function ya(e,t,n,r){for(const[i,{fn:o,memoDeps:a}]of Object.entries(r)){const{fnKey:s,fnName:l}=qF(i);if(a){const u=`_memo_${s}`;t[s]=function(...c){if(!this[u]){const f=this;this[u]=tP({memoDeps:p=>a(f,p),fn:(...p)=>o(f,...p),fnName:l,objectId:f.id,table:n,feature:e})}return this[u](...c)}}else t[s]=function(...u){return o(this,...u)}}}function fn(e,t,n,...r){var i;return((i=e[t])==null?void 0:i.call(e,...r))??n(e,...r)}function qSe(e){return e.row.getValue(e.column.id)}function GSe(e){return e.getValue()??e.table.options.renderFallbackValue}function XSe(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}const YSe={assignCellPrototype:(e,t)=>{ya("coreCellsFeature",e,t,{cell_getValue:{fn:n=>qSe(n)},cell_renderValue:{fn:n=>GSe(n)},cell_getContext:{fn:n=>XSe(n),memoDeps:n=>[n]}})}};function QSe(e){var t,n;if(!e._headerPrototype){e._headerPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignHeaderPrototype)==null||n.call(t,e._headerPrototype,e)}return e._headerPrototype}function GF(e,t,n){const r=QSe(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];const o=e._headerInstanceInitFns;for(let a=0;a<o.length;a++)o[a](i);return i}function XF(){return{start:[],end:[]}}function JSe(){return Cn()}function YF(e,t){tg(e)&&Uy(e.table,n=>{const r=Object.assign(Cn(),n),i=t??!fn(e,"getIsVisible",Jn),o=e.getLeafColumns();for(let a=0;a<o.length;a++){const s=o[a];tg(s)&&(r[s.id]=i)}return r})}function Jn(e){var r;const t=(r=e.table.atoms.columnVisibility)==null?void 0:r.get();if(!t)return!0;const n=e.columns;return n.length?n.some(i=>fn(i,"getIsVisible",Jn)):(By(t,e.id)?t[e.id]:void 0)??!0}function tg(e){return(e.columnDef.enableHiding??!0)&&(e.table.options.enableHiding??!0)}function ZSe(e){return t=>{YF(e,t.target.checked)}}function e1e(e){var u;const t=e.getAllCells(),n=[];for(let c=0;c<t.length;c++){const f=t[c];fn(f.column,"getIsVisible",Jn)&&n.push(f)}const{start:r,end:i}=((u=e.table.atoms.columnPinning)==null?void 0:u.get())??XF();if(!r.length&&!i.length)return n;const o=fn(e,"getVisibleCellsByColumnId",QF),a=[];for(let c=0;c<r.length;c++){const f=o[r[c]];f&&a.push(f)}const s=[];for(let c=0;c<i.length;c++){const f=o[i[c]];f&&s.push(f)}const l=[];for(let c=0;c<n.length;c++){const f=n[c],p=f.column.id;!r.includes(p)&&!i.includes(p)&&l.push(f)}return[...a,...l,...s]}function QF(e){const t=Cn(),n=e.getAllCells();for(let r=0;r<n.length;r++){const i=n[r];fn(i.column,"getIsVisible",Jn)&&(t[i.column.id]=i)}return t}function t1e(e){return e.getAllFlatColumns().filter(t=>fn(t,"getIsVisible",Jn))}function JF(e){return e.getAllLeafColumns().filter(t=>fn(t,"getIsVisible",Jn))}function Uy(e,t){ec(e,"columnVisibility",t)}function n1e(e,t){Uy(e,t?Cn():Object.assign(Cn(),co(e.initialState.columnVisibility??{})))}function ZF(e,t){t=t??!eB(e);const n=Cn(),r=e.getAllLeafColumns();for(let i=0;i<r.length;i++){const o=r[i];n[o.id]=t||!tg(o)}Uy(e,n)}function eB(e){return!e.getAllLeafColumns().some(t=>!fn(t,"getIsVisible",Jn))}function r1e(e){return e.getAllLeafColumns().some(t=>fn(t,"getIsVisible",Jn))}function i1e(e){return t=>{ZF(e,t.target.checked)}}function tB(e,t=1){let n=t;for(let r=0;r<e.length;r++){const i=e[r];fn(i,"getIsVisible",Jn)&&i.columns.length&&(n=Math.max(n,tB(i.columns,t+1)))}return n}function o1e(e,t){return String(t)}function a1e(e,t,n,r){let i=e??"";return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function s1e(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function nB(e,t,n,r,i,o){const a={depth:t,id:o1e(r,t),headers:[]},s=[];for(let l=0;l<e.length;l++){if(!(l in e))continue;const u=e[l],c=s[s.length-1],f=u.column.depth===a.depth;let p,h=!1;if(f&&u.column.parent?p=u.column.parent:(p=u.column,h=!0),c&&c.column===p)c.subHeaders.push(u);else{const v=GF(n,p,{id:a1e(r,t,p.id,u.id),isPlaceholder:h,placeholderId:h?String(s1e(s,p)):void 0,depth:t,index:s.length});v.subHeaders.push(u),s.push(v)}a.headers.push(u),u.headerGroup=a}for(let l=0;l<o.length;l++)o[l](a);i.push(a),t>0&&nB(s,t-1,n,r,i,o)}function rB(e){for(let t=0;t<e.length;t++){const n=e[t];if(!fn(n.column,"getIsVisible",Jn))continue;let r=0;if(n.subHeaders.length){rB(n.subHeaders);for(let i=0;i<n.subHeaders.length;i++){const o=n.subHeaders[i];fn(o.column,"getIsVisible",Jn)&&(r+=o.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let i=1,o=n.subHeaders[0];for(;o;)o.rowSpan=0,i++,o=o.subHeaders.length===1&&o.subHeaders[0].column===n.column?o.subHeaders[0]:void 0;n.rowSpan=i}else n.rowSpan=1}}function uR(e,t,n,r){var l;const i=tB(e),o=[],a=n._headerGroupInstanceInitFns,s=new Array(t.length);for(let u=0;u<t.length;u++)u in t&&(s[u]=GF(n,t[u],{depth:i,index:u}));return nB(s,i-1,n,r,o,a),o.reverse(),rB(((l=o[0])==null?void 0:l.headers)??[]),o}function l1e(e){var t,n;if(!e._columnPrototype){e._columnPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignColumnPrototype)==null||n.call(t,e._columnPrototype,e)}return e._columnPrototype}function u1e(e,t,n,r){const i={...e.getDefaultColumnDef(),...t},o=i.accessorKey,a=o===void 0?void 0:String(o),s=i.id??(a==null?void 0:a.replaceAll(".","_"))??(typeof i.header=="string"?i.header:void 0);let l;if(i.accessorFn)l=i.accessorFn;else if(o!==void 0)if(typeof o=="string"&&o.includes(".")){const p=o.split(".");l=h=>{let v=h;for(let y=0;y<p.length;y++){const x=p[y];v=v==null?void 0:v[x]}return v}}else l=p=>p[i.accessorKey];if(!s)throw new Error;const u=l1e(e),c=Object.create(u);c.accessorFn=l,c.columnDef=i,c.columns=[],c.depth=n,c.id=`${String(s)}`,c.parent=r;const f=e._columnInstanceInitFns;for(let p=0;p<f.length;p++)f[p](c);return c}function iB(e){var n;const t=(n=e.atoms.columnOrder)==null?void 0:n.get();return r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const o=new Map;for(let a=0;a<r.length;a++){const s=r[a];o.set(s.id,s)}for(let a=0;a<t.length;a++){const s=t[a],l=o.get(s);l&&(i.push(l),o.delete(s))}for(let a=0;a<r.length;a++){const s=r[a];o.has(s.id)&&i.push(s)}}return c1e(e,i)}}function c1e(e,t){var s;const n=((s=e.atoms.grouping)==null?void 0:s.get())??[],{groupedColumnMode:r}=e.options;if(!n.length||!r)return t;const i=t.filter(l=>!n.includes(l.id));if(r==="remove")return i;const o=new Map;for(let l=0;l<t.length;l++){const u=t[l];o.set(u.id,u)}const a=[];for(let l=0;l<n.length;l++){const u=o.get(n[l]);u&&a.push(u)}return[...a,...i]}function f1e(e){return[e,...e.columns.flatMap(t=>t.getFlatColumns())]}function d1e(e){if(e.columns.length){const t=e.columns.flatMap(n=>n.getLeafColumns());return fn(e.table,"getOrderColumns",iB)(t)}return[e]}function p1e(e){return{header:t=>{const n=t.header.column.columnDef;return n.accessorKey?n.accessorKey:n.accessorFn?n.id:null},cell:t=>{var n,r;return((r=(n=t.renderValue())==null?void 0:n.toString)==null?void 0:r.call(n))??null},...Object.values(e._features).reduce((t,n)=>{var r;return Object.assign(t,(r=n.getDefaultColumnDef)==null?void 0:r.call(n))},{}),...e.options.defaultColumn}}function oB(e,t,n,r=0){const i=new Array(t.length);for(let o=0;o<t.length;o++){if(!(o in t))continue;const a=t[o],s=u1e(e,a,r,n),l=a;s.columns=l.columns?oB(e,l.columns,s,r+1):[],i[o]=s}return i}function h1e(e){return oB(e,e.options.columns)}function m1e(e){return e.getAllColumns().flatMap(t=>t.getFlatColumns())}function g1e(e){const t=Cn(),n=e.getAllFlatColumns();for(let r=0;r<n.length;r++){const i=n[r];t[i.id]=i}return t}function y1e(e){const t=e.getAllColumns().flatMap(n=>n.getLeafColumns());return fn(e,"getOrderColumns",iB)(t)}function v1e(e){const t=Cn(),n=e.getAllLeafColumns();for(let r=0;r<n.length;r++){const i=n[r];t[i.id]=i}return t}function x1e(e,t){return e.getAllFlatColumnsById()[t]}const b1e={assignColumnPrototype:(e,t)=>{ya("coreColumnsFeature",e,t,{column_getFlatColumns:{fn:n=>f1e(n),memoDeps:n=>[n.table.options.columns]},column_getLeafColumns:{fn:n=>d1e(n),memoDeps:n=>{var r,i;return[(r=n.table.atoms.columnOrder)==null?void 0:r.get(),(i=n.table.atoms.grouping)==null?void 0:i.get(),n.table.options.columns,n.table.options.groupedColumnMode]}}})},constructTableAPIs:e=>{Ca("coreColumnsFeature",e,{table_getDefaultColumnDef:{fn:()=>p1e(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>h1e(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>m1e(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>g1e(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>y1e(e),memoDeps:()=>{var t,n;return[(t=e.atoms.columnOrder)==null?void 0:t.get(),(n=e.atoms.grouping)==null?void 0:n.get(),e.options.columns,e.options.groupedColumnMode]}},table_getAllLeafColumnsById:{fn:()=>v1e(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>x1e(e,t)}})}};function aB(e,t){for(let n=0;n<e.subHeaders.length;n++)aB(e.subHeaders[n],t);t.push(e)}function w1e(e){const t=[];return aB(e,t),t}function S1e(e){return{column:e.column,header:e,table:e.column.table}}function O1e(e){var u;const{start:t,end:n}=((u=e.atoms.columnPinning)==null?void 0:u.get())??XF(),r=e.getAllColumns(),i=fn(e,"getVisibleLeafColumns",JF);if(!t.length&&!n.length)return uR(r,i,e);const o=e.getAllLeafColumnsById(),a=[];for(let c=0;c<t.length;c++){const f=o[t[c]];f&&fn(f,"getIsVisible",Jn)&&a.push(f)}const s=[];for(let c=0;c<n.length;c++){const f=o[n[c]];f&&fn(f,"getIsVisible",Jn)&&s.push(f)}const l=i.filter(c=>!t.includes(c.id)&&!n.includes(c.id));return uR(r,[...a,...l,...s],e)}function P1e(e){return[...e.getHeaderGroups()].reverse()}function j1e(e){const t=e.getHeaderGroups(),n=[];for(let r=0;r<t.length;r++){const i=t[r].headers;for(let o=0;o<i.length;o++)n.push(i[o])}return n}function E1e(e){var r;const t=((r=e.getHeaderGroups()[0])==null?void 0:r.headers)??[],n=[];for(let i=0;i<t.length;i++){const o=t[i].getLeafHeaders();for(let a=0;a<o.length;a++)n.push(o[a])}return n}const A1e={assignHeaderPrototype:(e,t)=>{ya("coreHeadersFeature",e,t,{header_getLeafHeaders:{fn:n=>w1e(n),memoDeps:n=>[n.column.table.options.columns]},header_getContext:{fn:n=>S1e(n),memoDeps:n=>[n.column.table.options.columns]}})},constructTableAPIs:e=>{Ca("coreHeadersFeature",e,{table_getHeaderGroups:{fn:()=>O1e(e),memoDeps:()=>{var t,n,r,i;return[e.options.columns,(t=e.atoms.columnOrder)==null?void 0:t.get(),(n=e.atoms.grouping)==null?void 0:n.get(),(r=e.atoms.columnPinning)==null?void 0:r.get(),(i=e.atoms.columnVisibility)==null?void 0:i.get(),e.options.groupedColumnMode]}},table_getFooterGroups:{fn:()=>P1e(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>j1e(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>E1e(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function C1e(e){var t,n;if(!e._rowPrototype){e._rowPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignRowPrototype)==null||n.call(t,e._rowPrototype,e)}return e._rowPrototype}const T1e=(e,t,n,r,i,o,a)=>{const s=C1e(e),l=Object.create(s);l._displayIndexCache=-1,l._uniqueValuesCache=Cn(),l._valuesCache=Cn(),l.depth=i,l.id=t,l.index=r,l.original=n,l.parentId=a,l.subRows=[];const u=e._rowInstanceInitFns;for(let c=0;c<u.length;c++)u[c](l);return l},_1e=/([0-9]+)/gm;function tc(e){const t=Object.assign((n,r,i)=>{let o=n.getValue(i),a=r.getValue(i);const s=t.resolveDataValue;return s&&(o=s(o),a=s(a)),t.sort(o,a,n,r,i)},e);return t}tc({resolveDataValue:e=>zy(e).toLowerCase(),sort:(e,t)=>lB(e,t)});tc({resolveDataValue:e=>zy(e),sort:(e,t)=>lB(e,t)});tc({resolveDataValue:e=>zy(e).toLowerCase(),sort:(e,t)=>nP(e,t)});tc({resolveDataValue:e=>zy(e),sort:(e,t)=>nP(e,t)});tc({resolveDataValue:e=>R1e(e),sort:(e,t)=>e>t?1:e<t?-1:0});const sB=tc({sort:(e,t)=>nP(e,t)});function nP(e,t){return e===t?0:e>t?1:-1}function R1e(e){return e instanceof Date?e.getTime():e}function zy(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function lB(e,t){let n=0,r=0;const i=e.length,o=t.length;for(;n<i&&r<o;){const a=ng(e.charCodeAt(n)),s=ng(t.charCodeAt(r)),l=Fw(e,n,a),u=Fw(t,r,s);if(!a&&!s){const f=k1e(e,n,l,t,r,u);if(f)return f;n=l,r=u;continue}if(a!==s)return a?1:-1;const c=N1e(e,n,l,t,r,u);if(c)return c;n=l,r=u}return fR(e,n)-fR(t,r)}function ng(e){return e>=48&&e<=57}function Fw(e,t,n){let r=t+1;for(;r<e.length&&ng(e.charCodeAt(r))===n;)r++;return r}function k1e(e,t,n,r,i,o){const a=n-t,s=o-i,l=a<s?a:s;for(let u=0;u<l;u++){const c=e.charCodeAt(t+u),f=r.charCodeAt(i+u);if(c>f)return 1;if(f>c)return-1}return a>s?1:s>a?-1:0}function N1e(e,t,n,r,i,o){let a=t;for(;a<n&&e.charCodeAt(a)===48;)a++;let s=i;for(;s<o&&r.charCodeAt(s)===48;)s++;const l=n-a,u=o-s;if(l===0&&u===0)return 0;if(l<=15&&u<=15){const p=cR(e,a,n),h=cR(r,s,o);return p>h?1:h>p?-1:0}const c=parseInt(e.slice(t,n),10),f=parseInt(r.slice(i,o),10);return c>f?1:f>c?-1:0}function cR(e,t,n){let r=0;for(let i=t;i<n;i++)r=r*10+e.charCodeAt(i)-48;return r}function fR(e,t){let n=0,r=t;for(;r<e.length;)n++,r=Fw(e,r,ng(e.charCodeAt(r)));return n}function $1e(){return[]}function M1e(e,t){ec(e,"cellSelection",co(e.initialState.cellSelection)??$1e())}function I1e(e){e.atoms.cellSelection&&(e.options.autoResetAll??e.options.autoResetCellSelection??!0)&&e._reactivity.schedule(()=>M1e(e))}function D1e(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>L1e(e))}function L1e(e,t){const n=e.initialState.expanded;ec(e,"expanded",n===!0?!0:Object.assign(Cn(),co(n??{})))}const Bw=0;function F1e(e){var t,n;if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((((n=(t=e.atoms.pagination)==null?void 0:t.get())==null?void 0:n.pageIndex)??Bw)===Bw)return;z1e(e)}}function B1e(e,t){ec(e,"pagination",t)}function U1e(e,t){B1e(e,n=>{let r=Zu(t,n.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})}function z1e(e,t){U1e(e,Bw)}function H1e(){return[]}function Hy(e,t){ec(e,"sorting",t)}function uB(e,t){Hy(e,t?[]:co(e.initialState.sorting??[]))}function V1e(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&uB(e)}function cB(e){const t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10);let r,i=!1;for(let o=0;o<n.length;o++){const a=n[o].getValue(e.id);if(Object.prototype.toString.call(a)==="[object Date]"){r="datetime";break}if(typeof a=="string"&&(i=!0,a.split(_1e).length>1)){r="alphanumeric";break}}if(!r&&i&&(r="text"),r){let o=t==null?void 0:t[r];if(o||r==="alphanumeric"&&(o=t==null?void 0:t.text),o)return o}return sB}function fB(e){const t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){const r=t[n].getValue(e.id);if(r!=null)return typeof r=="string"?"asc":"desc"}return"desc"}function W1e(e){const t=e.table._rowModelFns.sortFns;return KF(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn==="auto"?cB(e):(t==null?void 0:t[e.columnDef.sortFn])??sB}function dB(e,t,n){const r=hB(e,n&&rg(e)),i=typeof t<"u";Hy(e.table,o=>{const a=o.findIndex(p=>p.id===e.id),s=a===-1?void 0:o[a];let l=[],u;const c=i?t:r==="desc",f=!!(o.length&&rg(e)&&n);return f?s?u="toggle":u="add":s?u="toggle":u="replace",u==="toggle"&&(i||r||(u="remove")),u==="add"?(l=[...o,{id:e.id,desc:c}],l.splice(0,l.length-(e.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?l=f?o.map(p=>p.id===e.id?{...p,desc:c}:p):[{id:e.id,desc:c}]:u==="remove"?l=f?o.filter(p=>p.id!==e.id):[]:l=[{id:e.id,desc:c}],l})}function pB(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??fB(e)==="desc"?"desc":"asc"}function hB(e,t){const n=pB(e),r=gB(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r==="desc"?"asc":"desc":n}function mB(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function rg(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function gB(e){var n,r;const t=(r=(n=e.table.atoms.sorting)==null?void 0:n.get())==null?void 0:r.find(i=>i.id===e.id);return t?t.desc?"desc":"asc":!1}function K1e(e){var t,n;return((n=(t=e.table.atoms.sorting)==null?void 0:t.get())==null?void 0:n.findIndex(r=>r.id===e.id))??-1}function q1e(e){Hy(e.table,t=>t.length?t.filter(n=>n.id!==e.id):[])}function G1e(e){const t=mB(e);return n=>{var r,i;t&&dB(e,void 0,rg(e)?(i=(r=e.table.options).isMultiSortEvent)==null?void 0:i.call(r,n):!1)}}function X1e(){return e=>tP({feature:"coreRowModelsFeature",table:e,fnName:"table.getCoreRowModel",memoDeps:()=>[e.options.data],fn:()=>Y1e(e,e.options.data),onAfterUpdate:KSe(()=>{D1e(e),F1e(e),V1e(e),I1e(e)})})}function yB(e,t,n,r=0,i){var a;const o=[];for(let s=0;s<n.length;s++){const l=n[s],u=T1e(e,e.getRowId(l,s,i),l,s,r,void 0,i==null?void 0:i.id);t.flatRows.push(u),t.rowsById[u.id]=u,o.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(l,s),(a=u.originalSubRows)!=null&&a.length&&(u.subRows=yB(e,t,u.originalSubRows,r+1,u)))}return o}function Y1e(e,t){const n={rows:[],flatRows:[],rowsById:Cn()};return n.rows=yB(e,n,t),n}function Q1e(e){var t,n;return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=((n=(t=e.options.features).coreRowModel)==null?void 0:n.call(t,e))??X1e()(e)),e._rowModels.coreRowModel()}function J1e(e){return e.getCoreRowModel()}function Z1e(e){var t,n;return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=(n=(t=e.options.features).filteredRowModel)==null?void 0:n.call(t,e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function eOe(e){return e.getFilteredRowModel()}function tOe(e){var t,n;return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=(n=(t=e.options.features).groupedRowModel)==null?void 0:n.call(t,e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function nOe(e){return e.getGroupedRowModel()}function rOe(e){var t,n;return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=(n=(t=e.options.features).sortedRowModel)==null?void 0:n.call(t,e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function iOe(e){return e.getSortedRowModel()}function oOe(e){var t,n;return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=(n=(t=e.options.features).expandedRowModel)==null?void 0:n.call(t,e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function aOe(e){return e.getExpandedRowModel()}function sOe(e){var t,n;return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=(n=(t=e.options.features).paginatedRowModel)==null?void 0:n.call(t,e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function lOe(e){return e.getPaginatedRowModel()}const uOe={constructTableAPIs:e=>{Ca("coreRowModelsFeature",e,{table_getCoreRowModel:{fn:()=>Q1e(e)},table_getPreFilteredRowModel:{fn:()=>J1e(e)},table_getFilteredRowModel:{fn:()=>Z1e(e)},table_getPreGroupedRowModel:{fn:()=>eOe(e)},table_getGroupedRowModel:{fn:()=>tOe(e)},table_getPreSortedRowModel:{fn:()=>nOe(e)},table_getSortedRowModel:{fn:()=>rOe(e)},table_getPreExpandedRowModel:{fn:()=>iOe(e)},table_getExpandedRowModel:{fn:()=>oOe(e)},table_getPrePaginatedRowModel:{fn:()=>aOe(e)},table_getPaginatedRowModel:{fn:()=>sOe(e)},table_getRowModel:{fn:()=>lOe(e)}})}};function cOe(e){var t,n;if(!e._cellPrototype){e._cellPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignCellPrototype)==null||n.call(t,e._cellPrototype,e)}return e._cellPrototype}function fOe(e,t,n){const r=cOe(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;const o=n._cellInstanceInitFns;for(let a=0;a<o.length;a++)o[a](i);return i}function dOe(e){const t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function pOe(e){const t=e.getPrePaginatedRowModel().rows;if(e.options.paginateExpandedRows===!1){const n=[],r=i=>{var o;i._displayIndexCache=n.length,n.push(i),i.subRows.length&&((o=i.getIsExpanded)!=null&&o.call(i))&&i.subRows.forEach(r)};return t.forEach(r),n}for(let n=0;n<t.length;n++)t[n]._displayIndexCache=n;return t}function hOe(e,t){if(By(e._valuesCache,t))return e._valuesCache[t];const n=e.table.getColumn(t);if(n!=null&&n.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function mOe(e,t){if(By(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];const n=e.table.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function gOe(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function yOe(e){return VSe(e.subRows,t=>t.subRows)}function vOe(e){const t=e.getCoreRowModel().flatRows;let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,t[r].depth);return n}function xOe(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function bOe(e){const t=[];let n=e;for(;;){const r=n.getParentRow();if(!r)break;t.push(r),n=r}return t.reverse()}function wOe(e){const t=e.table.getAllLeafColumns();let n=e._cellsCache;n||(n=e._cellsCache=new WeakMap);const r=new Array(t.length);for(let i=0;i<t.length;i++){const o=t[i];let a=n.get(o);a||(a=fOe(o,e,e.table),n.set(o,a)),r[i]=a}return r}function SOe(e){const t=Cn(),n=e.getAllCells();for(let r=0;r<n.length;r++){const i=n[r];t[i.column.id]=i}return t}function OOe(e,t,n,r){var i,o;return((o=(i=t.options).getRowId)==null?void 0:o.call(i,e,n,r))??(r?`${r.id}.${n}`:String(n))}function POe(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw new Error;return r}const jOe={assignRowPrototype:(e,t)=>{ya("coreRowsFeature",e,t,{row_getDisplayIndex:{fn:n=>dOe(n)},row_getAllCellsByColumnId:{fn:n=>SOe(n),memoDeps:n=>[n.getAllCells()]},row_getAllCells:{fn:n=>wOe(n),memoDeps:n=>[n.table.getAllLeafColumns()]},row_getLeafRows:{fn:n=>yOe(n),memoDeps:n=>[n.subRows]},row_getParentRow:{fn:n=>xOe(n)},row_getParentRows:{fn:n=>bOe(n)},row_getUniqueValues:{fn:(n,r)=>mOe(n,r)},row_getValue:{fn:(n,r)=>hOe(n,r)},row_renderValue:{fn:(n,r)=>gOe(n,r)}})},constructTableAPIs:e=>{Ca("coreRowsFeature",e,{table_getRowsInDisplayOrder:{fn:()=>pOe(e),memoDeps:()=>{var t;return[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?(t=e.atoms.expanded)==null?void 0:t.get():void 0]}},table_getRowId:{fn:(t,n,r)=>OOe(t,e,n,r)},table_getRow:{fn:(t,n)=>POe(e,t,n)},table_getMaxSubRowDepth:{fn:()=>vOe(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function vB(e,t,n=(r,i)=>r===i){const r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(const i in r){const o=e.baseAtoms[i];if(!o)continue;const a=r[i],s=a===void 0?e.initialState[i]:a;n(e._reactivity.untrack(()=>o.get()),s)||o.set(()=>s)}})}function xB(e,t,n=(r,i)=>r===i){e._reactivity.batch(()=>{var r,i;vB(e,t,n),(i=(r=e._reactivity).commit)==null||i.call(r)})}function EOe(e){var r,i;const t=co(e.initialState);e._reactivity.batch(()=>{const o=Object.keys(t);for(let a=0;a<o.length;a++){const s=o[a];e.baseAtoms[s].set(t[s])}});const n=Object.values(e._features);for(let o=0;o<n.length;o++)(i=(r=n[o]).resetTableInstanceData)==null||i.call(r,e)}function AOe(e,t){const{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};const o=e.options.mergeOptions(e.options,t),a={...Object.getOwnPropertyDescriptors(o)};return Object.defineProperties(Object.create(Object.getPrototypeOf(o)),{...a,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function bB(e,t,n){const r=AOe(e,Zu(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,(n==null?void 0:n.syncExternalState)!==!1&&xB(e,r.state??null)}const COe={constructTableAPIs:e=>{Ca("coreTablesFeature",e,{table_reset:{fn:()=>EOe(e)},table_setOptions:{fn:t=>bB(e,t)}})}},TOe={coreCellsFeature:YSe,coreColumnsFeature:b1e,coreHeadersFeature:A1e,coreRowModelsFeature:uOe,coreRowsFeature:jOe,coreTablesFeature:COe};function _Oe(e,t={}){return Object.values(e).forEach(n=>{var r;t=((r=n.getInitialState)==null?void 0:r.call(n,t))??t}),co(t)}function ROe(e){var P,j;const t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:o,facetedMinMaxValues:a,facetedRowModel:s,facetedUniqueValues:l,filterFns:u,filterMeta:c,filteredRowModel:f,groupedRowModel:p,paginatedRowModel:h,sortFns:v,sortedRowModel:y,tableMeta:x,...g}=e.features,m={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...TOe,...g},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:u,sortFns:v},_rowModels:{},atoms:{},baseAtoms:{}},b=Object.values(m._features),S={...b.reduce((E,A)=>{var C;return Object.assign(E,(C=A.getDefaultTableOptions)==null?void 0:C.call(A,m))},{}),...e};if(t.wrapExternalAtoms&&S.atoms)for(const[E,A]of Object.entries(S.atoms)){const C=A,T=t.createWritableAtom(C.get(),{debugName:`externalAtom/${E}`});S.atoms[E]=T;let _=!1;const R=C.subscribe(N=>{_||T.set(N)}),$=T.subscribe(N=>{_=!0,C.set(N),_=!1});t.addSubscription(R),t.addSubscription($)}t.createOptionsStore?(m.optionsStore=t.createWritableAtom(S,{debugName:"table/optionsStore"}),Object.defineProperty(m,"options",{configurable:!0,enumerable:!0,get(){return m.optionsStore.get()},set(E){m.optionsStore.set(()=>E)}})):m.options=S,m.initialState=_Oe(m._features,m.options.initialState);const w=Object.keys(m.initialState);for(let E=0;E<w.length;E++){const A=w[E];m.baseAtoms[A]=t.createWritableAtom(m.initialState[A],{debugName:`table/baseAtoms/${A}`}),m.atoms[A]=t.createReadonlyAtom(()=>{var $;const C=m.options,T=($=C.atoms)==null?void 0:$[A],_=T?T.get():m.baseAtoms[A].get();if(T)return _;const R=C.state;if(R&&By(R,A)){const N=R[A];return N===void 0?m.initialState[A]:N}return _},{debugName:`table/atoms/${A}`})}vB(m),m.store=LSe(t.createReadonlyAtom(()=>{const E={};for(let A=0;A<w.length;A++){const C=w[A];E[C]=m.atoms[C].get()}return E},{compare:of,debugName:"table/store"}));for(let E=0;E<b.length;E++){const A=b[E];(P=A.initTableInstanceData)==null||P.call(A,m),A.initCellInstanceData&&m._cellInstanceInitFns.push(A.initCellInstanceData.bind(A)),A.initColumnInstanceData&&m._columnInstanceInitFns.push(A.initColumnInstanceData.bind(A)),A.initHeaderGroupInstanceData&&m._headerGroupInstanceInitFns.push(A.initHeaderGroupInstanceData.bind(A)),A.initHeaderInstanceData&&m._headerInstanceInitFns.push(A.initHeaderInstanceData.bind(A)),A.initRowInstanceData&&m._rowInstanceInitFns.push(A.initRowInstanceData.bind(A)),(j=A.constructTableAPIs)==null||j.call(A,m)}return m}function kOe(){return[]}function wB(e){const t=e.table._rowModelFns.filterFns,n=e.table.getCoreRowModel().flatRows;let r;for(let a=0;a<n.length;a++){const s=n[a].getValue(e.id);if(s!=null){r=s;break}}let i;return typeof r=="string"?i="includesString":typeof r=="number"?i="inNumberRange":typeof r=="boolean"?i="equals":Array.isArray(r)?i="arrIncludes":Object.prototype.toString.call(r)==="[object Date]"?i="inDateRange":r!==null&&typeof r=="object"?i="equals":i="weakEquals",t==null?void 0:t[i]}function rP(e){let t=null;const n=e.table._rowModelFns.filterFns;return t=KF(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?wB(e):n==null?void 0:n[e.columnDef.filterFn],t??void 0}function NOe(e){return(e.columnDef.enableColumnFilter??!0)&&(e.table.options.enableColumnFilters??!0)&&(e.table.options.enableFilters??!0)&&!!e.accessorFn}function $Oe(e){return SB(e)>-1}function MOe(e){var t,n,r;return(r=(n=(t=e.table.atoms.columnFilters)==null?void 0:t.get())==null?void 0:n.find(i=>i.id===e.id))==null?void 0:r.value}function SB(e){var t,n;return((n=(t=e.table.atoms.columnFilters)==null?void 0:t.get())==null?void 0:n.findIndex(r=>r.id===e.id))??-1}function IOe(e,t){iP(e.table,n=>{const r=rP(e),i=n.find(s=>s.id===e.id),o=Zu(t,i?i.value:void 0);if(OB(r,o,e))return n.filter(s=>s.id!==e.id);const a={id:e.id,value:o};return i?n.map(s=>s.id===e.id?a:s):n.length?[...n,a]:[a]})}function iP(e,t){const n=e.getAllLeafColumnsById();ec(e,"columnFilters",i=>Zu(t,i).filter(o=>{const a=n[o.id];return!(a&&OB(rP(a),o.value,a))}))}function DOe(e,t){iP(e,t?[]:co(e.initialState.columnFilters??[]))}function OB(e,t,n){return typeof t>"u"?!0:e!=null&&e.autoRemove?!!e.autoRemove(t,n):typeof t=="string"&&!t}const LOe={getInitialState:e=>({columnFilters:kOe(),...e}),getDefaultColumnDef:()=>({filterFn:"auto"}),getDefaultTableOptions:e=>({onColumnFiltersChange:eP("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),assignColumnPrototype:(e,t)=>{ya("columnFilteringFeature",e,t,{column_getAutoFilterFn:{fn:n=>wB(n)},column_getFilterFn:{fn:n=>rP(n)},column_getCanFilter:{fn:n=>NOe(n)},column_getIsFiltered:{fn:n=>$Oe(n)},column_getFilterValue:{fn:n=>MOe(n)},column_getFilterIndex:{fn:n=>SB(n)},column_setFilterValue:{fn:(n,r)=>IOe(n,r)}})},initRowInstanceData:e=>{e.columnFilters=Cn(),e.columnFiltersMeta=Cn()},constructTableAPIs:e=>{Ca("columnFilteringFeature",e,{table_setColumnFilters:{fn:t=>iP(e,t)},table_resetColumnFilters:{fn:t=>DOe(e,t)}})}},FOe={getInitialState:e=>({columnVisibility:JSe(),...e}),getDefaultTableOptions:e=>({onColumnVisibilityChange:eP("columnVisibility",e)}),assignColumnPrototype:(e,t)=>{ya("columnVisibilityFeature",e,t,{column_getIsVisible:{fn:n=>Jn(n),memoDeps:n=>{var r;return[t.options.columns,(r=t.atoms.columnVisibility)==null?void 0:r.get(),n.columns]}},column_getCanHide:{fn:n=>tg(n)},column_getToggleVisibilityHandler:{fn:n=>ZSe(n)},column_toggleVisibility:{fn:(n,r)=>YF(n,r)}})},assignRowPrototype:(e,t)=>{ya("columnVisibilityFeature",e,t,{row_getVisibleCells:{fn:n=>e1e(n),memoDeps:n=>{var r,i;return[n.getAllCells(),(r=t.atoms.columnPinning)==null?void 0:r.get(),(i=t.atoms.columnVisibility)==null?void 0:i.get()]}},row_getVisibleCellsByColumnId:{fn:n=>QF(n),memoDeps:n=>{var r;return[n.getAllCells(),(r=t.atoms.columnVisibility)==null?void 0:r.get()]}}})},constructTableAPIs:e=>{Ca("columnVisibilityFeature",e,{table_getVisibleFlatColumns:{fn:()=>t1e(e),memoDeps:()=>{var t,n,r;return[(t=e.atoms.columnVisibility)==null?void 0:t.get(),(n=e.atoms.columnOrder)==null?void 0:n.get(),(r=e.atoms.grouping)==null?void 0:r.get(),e.options.columns,e.options.groupedColumnMode]}},table_getVisibleLeafColumns:{fn:()=>JF(e),memoDeps:()=>{var t,n,r;return[(t=e.atoms.columnVisibility)==null?void 0:t.get(),(n=e.atoms.columnOrder)==null?void 0:n.get(),(r=e.atoms.grouping)==null?void 0:r.get(),e.options.columns,e.options.groupedColumnMode]}},table_setColumnVisibility:{fn:t=>Uy(e,t)},table_resetColumnVisibility:{fn:t=>n1e(e,t)},table_toggleAllColumnsVisible:{fn:t=>ZF(e,t)},table_getIsAllColumnsVisible:{fn:()=>eB(e)},table_getIsSomeColumnsVisible:{fn:()=>r1e(e)},table_getToggleAllColumnsVisibilityHandler:{fn:()=>i1e(e)}})}},BOe={getInitialState(e){return{sorting:H1e(),...e}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:eP("sorting",e),isMultiSortEvent:t=>t.shiftKey}},assignColumnPrototype(e,t){ya("rowSortingFeature",e,t,{column_getAutoSortFn:{fn:n=>cB(n)},column_getAutoSortDir:{fn:n=>fB(n)},column_getSortFn:{fn:n=>W1e(n)},column_toggleSorting:{fn:(n,r,i)=>dB(n,r,i)},column_getFirstSortDir:{fn:n=>pB(n)},column_getNextSortingOrder:{fn:(n,r)=>hB(n,r)},column_getCanSort:{fn:n=>mB(n)},column_getCanMultiSort:{fn:n=>rg(n)},column_getIsSorted:{fn:n=>gB(n)},column_getSortIndex:{fn:n=>K1e(n)},column_clearSorting:{fn:n=>q1e(n)},column_getToggleSortingHandler:{fn:n=>G1e(n)}})},constructTableAPIs(e){Ca("rowSortingFeature",e,{table_setSorting:{fn:t=>Hy(e,t)},table_resetSorting:{fn:t=>uB(e,t)}})}},UOe=typeof window>"u"?O.useEffect:O.useLayoutEffect;function zOe(e,t){const[{table:n,rootSource:r}]=O.useState(()=>{const l=ROe({...e,features:{coreReactivityFeature:USe(),...e.features}});return l.Subscribe=u=>DSe({...u,source:u.source??l.store}),l.FlexRender=CSe,{table:l,rootSource:BSe(l.store,of)}}),i=n;bB(i,l=>({...l,...e}),{syncExternalState:!1});const o=i.options.state,a=r.get(),s=VF(r,t,{compare:of});return UOe(()=>{r.markCommitted(a),xB(i,o??null,of)}),O.useMemo(()=>({...n,options:e,state:s}),[n,e,s])}const HOe={rowSortingFeature:BOe,columnFilteringFeature:LOe,columnVisibilityFeature:FOe};function VOe({direction:e}){return e==="asc"?d.jsx("span",{"aria-hidden":"true",children:"↑"}):e==="desc"?d.jsx("span",{"aria-hidden":"true",children:"↓"}):d.jsx("span",{"aria-hidden":"true",className:"opacity-30",children:"↕"})}function WOe({header:e,className:t}){const n=e.column.getIsSorted(),r=Ya(e.column.columnDef.header,e.getContext());return d.jsx(Ge,{className:`whitespace-nowrap p-0 ${t}`,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:d.jsxs(Xe,{variant:"ghost",size:"xs",onClick:e.column.getToggleSortingHandler(),className:"w-full justify-start gap-1 px-3 py-2 font-normal",children:[r,d.jsx(VOe,{direction:n})]})})}function KOe({header:e}){const t=e.column.getFilterValue(),n=typeof t=="string"?t:"",[r,i]=O.useState(n);O.useEffect(()=>i(n),[n]);const o=()=>{r!==n&&e.column.setFilterValue(r)};return d.jsx(_s,{value:r,"aria-label":`Filter by ${e.column.id}`,placeholder:"Filter…",className:"w-full py-0.5",onChange:a=>i(a.target.value),onBlur:o,onKeyDown:a=>{a.key==="Enter"&&o(),a.key==="Escape"&&i(n)}})}function qOe({table:e,sticky:t,menu:n}){var s;const r=((s=e.getHeaderGroups().at(-1))==null?void 0:s.headers)??[],i=r.some(l=>l.column.getCanFilter()),o=t?"sticky top-0 z-10 bg-panel":"",a=t?"sticky top-8 z-10 bg-panel":"";return d.jsxs(Id,{children:[d.jsxs(kr,{children:[r.map(l=>l.column.getCanSort()?d.jsx(WOe,{header:l,className:o},l.id):d.jsx(Ge,{className:`whitespace-nowrap ${o}`,children:Ya(l.column.columnDef.header,l.getContext())},l.id)),n?d.jsx(Ge,{className:`w-px whitespace-nowrap text-right ${o}`,children:n}):null]}),i&&d.jsxs(kr,{children:[r.map(l=>d.jsx(Ge,{className:`py-1 ${a}`,children:l.column.getCanFilter()?d.jsx(KOe,{header:l}):null},l.id)),n?d.jsx(Ge,{className:a}):null]})]})}function GOe(e,t){const n=e.replace(/\{(\w+)\}/g,(r,i)=>String(t[i]??""));return/^\s*(javascript|data|vbscript):/i.test(n)?"#":n}function XOe({spec:e,row:t}){const n=String(t[e.key]??"");return e.link?d.jsx("a",{className:"text-sky-400 hover:underline",href:GOe(e.link.href,t),...e.link.external?{target:"_blank",rel:"noreferrer"}:{},children:n}):d.jsx(d.Fragment,{children:n})}function YOe(e){return e.map(t=>({id:t.key,accessorFn:n=>n[t.key],header:t.label,enableSorting:t.sortable===!0,enableColumnFilter:t.filterable===!0,enableHiding:t.hideable===!0,cell:({row:n})=>d.jsx(XOe,{spec:t,row:n.original})}))}const QOe="max-h-[28rem]";function JOe(e,t,n){return`${t.map(r=>String(e[r.key]??"")).join("|")}#${n}`}function ZOe({columns:e,rows:t,sort:n,onSortChange:r,filters:i,onFiltersChange:o,scrolls:a}){const[s,l]=O.useState({}),u=O.useMemo(()=>YOe(e),[e]),c=n?[{id:n.key,desc:n.dir==="desc"}]:[],f=Object.entries(i??{}).map(([x,g])=>({id:x,value:g})),p=zOe({features:HOe,columns:u,data:t,state:{sorting:c,columnFilters:f,columnVisibility:s},onColumnVisibilityChange:l,onSortingChange:x=>{const m=(typeof x=="function"?x(c):x)[0];r==null||r(m?{key:m.id,dir:m.desc?"desc":"asc"}:void 0)},onColumnFiltersChange:x=>{const g=typeof x=="function"?x(f):x,m={};for(const b of g)typeof b.value=="string"&&b.value!==""&&(m[b.id]=b.value);o==null||o(m)},manualSorting:!0,manualFiltering:!0,getRowId:(x,g)=>JOe(x,e,g)}),h=p.getAllLeafColumns(),v=h.some(x=>x.getCanHide()),y=p.getVisibleLeafColumns().length+(v?1:0);return d.jsxs(Md,{containerClassName:a?QOe:"",children:[d.jsx(qOe,{table:p,sticky:a===!0,...v?{menu:d.jsx(PSe,{columns:h})}:{}}),d.jsxs(Dd,{children:[t.length===0?d.jsx(kr,{children:d.jsx(nt,{colSpan:y,className:"py-6 text-center text-muted-foreground",children:"No data in this window."})}):null,p.getRowModel().rows.map(x=>d.jsxs(kr,{children:[x.getVisibleCells().map(g=>d.jsx(nt,{className:"whitespace-nowrap text-foreground",children:Ya(g.column.columnDef.cell,g.getContext())},g.id)),v?d.jsx(nt,{}):null]},x.id))]})]})}function ePe(e,t){return t==="percent"?`${Math.round(e*100)}%`:t==="duration"?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:t==="rate"?`${new Intl.NumberFormat().format(Math.round(e))}/hr`:new Intl.NumberFormat().format(e)}function PB(e){if(typeof e!="object"||e===null||!("rows"in e))return[];const t=e.rows;return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null):[]}function mx(e,t){if(typeof e!="object"||e===null||!(t in e))return;const n=Reflect.get(e,t);return typeof n=="number"&&Number.isFinite(n)?n:void 0}function tPe(e){const t=PB(e);return{rows:t,total:mx(e,"total")??t.length,page:mx(e,"page")??1,limit:mx(e,"limit")??0}}function nPe({title:e}){return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsx("p",{className:"border-b border-line px-4 py-2 text-xs font-medium text-foreground",children:e}),d.jsx("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:"No data in this window."})]})}function rPe({page:e,totalPages:t,onPageChange:n}){return d.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[d.jsx(Xe,{variant:"outline",size:"xs",disabled:e<=1,onClick:()=>n==null?void 0:n(e-1),className:"px-1.5 text-muted-foreground",children:"Prev"}),d.jsxs("span",{children:["Page ",e," of ",t]}),d.jsx(Xe,{variant:"outline",size:"xs",disabled:e>=t,onClick:()=>n==null?void 0:n(e+1),className:"px-1.5 text-muted-foreground",children:"Next"})]})}function iPe({panel:e,data:t,onPageChange:n,requestedPage:r,sort:i,onSortChange:o,filters:a,onFiltersChange:s,onSelect:l}){const u=l?{onSelect:l}:{};switch(e.kind){case"stat":{const c=t??{};return d.jsx(Ot,{label:e.title,value:ePe(c.value??0,e.format),...c.value!==void 0?{currentValue:c.value}:{},...c.delta!==void 0?{delta:c.delta}:{},...c.deltaLabel?{deltaLabel:c.deltaLabel}:{},...e.spark&&c.spark?{spark:c.spark}:{},...e.thresholds?{thresholds:e.thresholds}:{},...e.accent?{accent:e.accent}:{}})}case"distribution":{const c=t??{};return d.jsx(SSe,{title:e.title,buckets:c.buckets??[],...c.p50!==void 0?{p50:c.p50}:{},...c.p95!==void 0?{p95:c.p95}:{},...c.p99!==void 0?{p99:c.p99}:{},...u})}case"gauge":{const c=t??{};return d.jsx(OSe,{title:e.title,value:c.value??0,...e.min!==void 0?{min:e.min}:{},...e.max!==void 0?{max:e.max}:{}})}case"breakdown":{const c=t??{};return d.jsx(xSe,{title:e.title,segments:c.segments??[],...e.style?{style:e.style}:{},...u})}case"timeseries":{const c=(t==null?void 0:t.rows)??[],f=e.series[0];return e.style==="stacked"?d.jsx(GO,{title:e.title,data:c,series:e.series,...u}):d.jsx(Us,{title:e.title,data:c.map(p=>({label:p.label,value:f?Number(p[f]??0):0})),...u})}case"topN":{const c=(t==null?void 0:t.items)??[],f=e.limit?c.slice(0,e.limit):c;return f.length===0?d.jsx(nPe,{title:e.title}):d.jsx(ds,{title:e.title,data:f,horizontal:!0,truncateLabel:32,...u})}case"table":{const c=d.jsx(ZOe,{columns:e.columns,rows:PB(t),scrolls:e.paged===!0,sort:i,...o?{onSortChange:o}:{},filters:a,...s?{onFiltersChange:s}:{}});if(e.paged){const{rows:f,total:p,page:h,limit:v}=tPe(t),y=Math.max(1,Math.ceil(p/(v||f.length||1)));return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2",children:[d.jsx("p",{className:"text-xs font-medium text-foreground",children:e.title}),d.jsx(rPe,{page:r??h,totalPages:y,...n?{onPageChange:n}:{}})]}),c]})}return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsx("p",{className:"border-b border-line px-4 py-2 text-xs font-medium text-foreground",children:e.title}),c]})}default:return null}}const oPe="sort",aPe="dir",sPe="filter.";function lPe(e,t){const n=Object.entries(t.filters??{}).filter(([,i])=>i!=="");if(!t.paging&&!t.sort&&n.length===0)return e;const r={...e};t.paging&&(r.page=t.paging.page,r.limit=t.paging.limit),t.sort&&(r[oPe]=t.sort.key,r[aPe]=t.sort.dir);for(const[i,o]of n)r[`${sPe}${i}`]=o;return r}const uPe={1:"",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-2 lg:grid-cols-4"},cPe=50;function fPe(e){return"drilldown"in e?e.drilldown:void 0}function dPe({status:e}){const t=e==="live";return d.jsxs("span",{"data-telescope-status":e,className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t?"tint-good":"tint-warn"}`,children:[d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${t?"animate-pulse bg-good":"bg-warn"}`}),t?"live":e]})}function pPe({ext:e,panel:t,focus:n,onSelect:r}){const i=t.kind==="table"&&t.paged===!0,[o,a]=O.useState(1),[s,l]=O.useState(void 0),[u,c]=O.useState({}),f=n?{[n.param]:n.value}:void 0,p=f?{...t.data.query,...f}:t.data.query,h=lPe(p,{...i?{paging:{page:o,limit:cPe}}:{},...s?{sort:s}:{},filters:u}),v=N5(e,t.data.provider,h);return v.isError?d.jsxs("div",{className:"tint-bad rounded-lg border px-4 py-3 text-sm",children:['Failed to load "',t.title,'".']}):d.jsx(iPe,{panel:t,data:v.data,...i?{onPageChange:a,requestedPage:o}:{},sort:s,onSortChange:y=>{a(1),l(y)},filters:u,onFiltersChange:y=>{a(1),c(y)},...r?{onSelect:r}:{}})}function hPe(){var u,c;const{dashboardId:e}=Sg(),t=Is(),{status:n}=K5(),[r,i]=O.useState(null),o=(c=(u=t.data)==null?void 0:u.dashboards)==null?void 0:c.find(f=>f.id===e);if(!o)return d.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Dashboard not found."});const a=(e==null?void 0:e.split(".")[0])??"",s=o.sections??[{panels:o.panels,cols:2}];function l(f,p){const h=p.id??p.label,v=p.series?`${p.series} · ${p.label}`:p.label;i(y=>(y==null?void 0:y.param)===f&&y.value===h?null:{param:f,value:h,label:v})}return d.jsxs("div",{className:"p-4",children:[d.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[d.jsx("h2",{className:"text-sm font-semibold text-foreground",children:o.label}),d.jsx(dPe,{status:n}),r&&d.jsxs("span",{className:"tint-brand inline-flex items-center gap-1 rounded border py-0.5 pl-1.5 text-[10px]",children:[r.param,": ",r.label,d.jsx(Xe,{variant:"ghost",size:"xs",className:"px-1 text-inherit",onClick:()=>i(null),children:"Clear"})]})]}),s.map((f,p)=>d.jsxs("section",{className:"mb-6",children:[f.title&&d.jsx("p",{className:"mb-2 text-[10px] uppercase tracking-wide text-muted-foreground",children:f.title}),d.jsx("div",{className:`grid grid-cols-1 gap-3 ${uPe[f.cols??2]}`,children:f.panels.map(h=>{const v=fPe(h);return d.jsx(pPe,{ext:a,panel:h,focus:r,...v?{onSelect:y=>l(v.param,y)}:{}},`${h.kind}-${h.title}`)})})]},f.title??`s${p}`))]})}function mPe({profile:e,selected:t,onSelect:n}){return d.jsxs("button",{type:"button",onClick:n,className:`flex w-full flex-col gap-0.5 border-b border-line-soft px-3 py-2 text-left hover:bg-panel ${t?"bg-panel":""}`,children:[d.jsx("span",{className:"truncate font-mono text-xs text-foreground",title:e.familyHash??e.id,children:e.familyHash??"(unlabelled)"}),d.jsxs("span",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[d.jsx("span",{children:e.durationMs!==null?fd(e.durationMs):"—"}),e.tags.includes("manual")&&d.jsx("span",{className:"text-warn",children:"manual"}),e.tags.includes("sampled")&&d.jsx("span",{className:"text-sky-400",children:"sampled"}),d.jsx("span",{className:"ml-auto",children:zs(new Date(e.createdAt).getTime())})]})]})}function gPe({hot:e}){return e.length===0?d.jsx("p",{className:"text-xs text-muted-foreground",children:"No hot frames."}):d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx("span",{className:"flex-1",children:"Function"}),d.jsx("span",{className:"w-16 text-right",children:"Self"}),d.jsx("span",{className:"w-12 text-right",children:"%"})]}),e.map(t=>d.jsxs("div",{className:"flex items-center gap-2 border-b border-line-soft px-3 py-1 text-[11px] last:border-0",children:[d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",title:`${t.name} ${t.file}`,children:[t.name,t.file&&d.jsx("span",{className:"ml-1 text-muted-foreground",children:t.file})]}),d.jsx("span",{className:"w-16 text-right tabular-nums text-foreground",children:fd(t.selfMs)}),d.jsx("span",{className:"w-12 text-right tabular-nums text-warn",children:t.selfPct.toFixed(1)})]},`${t.name}:${t.file}`))]})}function yPe({id:e}){const{data:t,isLoading:n}=V5(e);if(n)return d.jsx("p",{className:"text-muted-foreground",children:"Loading profile…"});if(!t)return d.jsx("p",{className:"text-muted-foreground",children:"Profile not found."});const r=t.content;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-1",children:[d.jsx("h3",{className:"font-mono text-sm text-foreground",children:r.label??"(unlabelled)"}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[fd(r.durationMs)," · ",r.sampleCount," samples · ",r.reason]})]}),d.jsx(Vbe,{tree:r.tree}),d.jsx(gPe,{hot:r.hot})]})}function vPe({pendingManual:e}){const[t,n]=O.useState(1),[r,i]=O.useState(""),o=W5();return d.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-line bg-panel/40 px-3 py-2",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Capture next"}),d.jsx("input",{type:"number",min:1,value:t,onChange:a=>n(Math.max(1,Number(a.target.value))),className:"w-14 rounded border border-line bg-background px-1 py-0.5 text-xs text-foreground"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"request(s) matching"}),d.jsx("input",{type:"text",placeholder:"any route (e.g. GET /users/:id)",value:r,onChange:a=>i(a.target.value),className:"w-56 rounded border border-line bg-background px-1 py-0.5 text-xs text-foreground"}),d.jsx("button",{type:"button",disabled:o.isPending,onClick:()=>o.mutate({count:t,...r?{label:r}:{}}),className:"rounded bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50",children:o.isPending?"Arming…":"Arm capture"}),e>0&&d.jsxs("span",{className:"text-[10px] text-warn",children:[e," pending"]}),o.isError&&d.jsx("span",{className:"text-[10px] text-bad",children:o.error instanceof Error?o.error.message:"Failed to arm (mutations disabled?)"})]})}function xPe(){var u,c,f,p,h;const e=Is(),t=z5(),{data:n,isLoading:r}=H5(100),i=(n==null?void 0:n.data)??[],[o,a]=O.useState(null),s=((c=(u=e.data)==null?void 0:u.profiling)==null?void 0:c.enabled)??((f=t.data)==null?void 0:f.enabled)??!1,l=o??((p=i[0])==null?void 0:p.id)??null;return s?d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("h2",{className:"text-sm text-brand",children:"CPU Profiles"}),t.data&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["sampling ",(t.data.sampleRate*100).toFixed(0),"% · ",t.data.active," active"]})]}),d.jsx(vPe,{pendingManual:((h=t.data)==null?void 0:h.pendingManual)??0}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("div",{className:"w-64 shrink-0 rounded-lg border border-line",children:r?d.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"Loading…"}):i.length===0?d.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"No profiles captured yet."}):i.map(v=>d.jsx(mPe,{profile:v,selected:v.id===l,onSelect:()=>a(v.id)},v.id))}),d.jsx("div",{className:"min-w-0 flex-1",children:l?d.jsx(yPe,{id:l}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Select a profile to view its flamegraph."})})]})]}):d.jsxs("div",{className:"space-y-3 p-4",children:[d.jsx("h2",{className:"text-sm text-brand",children:"CPU Profiles"}),d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40 p-6 text-xs text-muted-foreground",children:[d.jsx("p",{className:"mb-2 text-foreground",children:"CPU profiling is disabled."}),d.jsxs("p",{children:["Enable it with"," ",d.jsxs("code",{className:"rounded bg-panel-2 px-1 text-brand",children:["profiling: ","{"," enabled: true ","}"]})," ","in ",d.jsx("code",{className:"rounded bg-panel-2 px-1",children:"TelescopeModule.forRoot"}),". Profiling is opt-in because it carries real CPU overhead; when off there is zero cost on the request path."]})]})]})}const bPe={scheduled:"text-sky-300 bg-sky-500/10",manual:"text-warn tint-warn"};function wPe({trigger:e}){return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${bPe[e]}`,children:e})}function SPe({type:e,count:t}){return d.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-panel-2/80 px-1.5 py-0.5 text-[10px] text-foreground",children:[d.jsx("span",{className:"text-muted-foreground",children:jg(e)}),d.jsx("span",{className:"tabular-nums text-foreground",children:t})]})}function OPe(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function PPe(e,t){if(e===null)return"—";const n=new Date(e).getTime()-t;if(Number.isNaN(n))return"—";if(n<=0)return"now";const r=Math.round(n/1e3);return r<60?`~${r}s`:`~${Math.floor(r/60)}m ${r%60}s`}function jPe(){const[e,t]=O.useState(()=>Date.now());return O.useEffect(()=>{const n=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(n)},[]),e}function EPe({config:e,nextRunAt:t,nowMs:n}){const r=Object.entries(e.perType??{});return d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Ot,{label:"Window",value:rf(e.afterMs),accent:"text-brand"}),d.jsx(Ot,{label:"Interval",value:rf(e.intervalMs)}),d.jsx(Ot,{label:"Keep last",value:e.keepLast!=null?e.keepLast.toLocaleString():"unbounded"}),d.jsx(Ot,{label:"Next prune",value:PPe(t,n),accent:"text-sky-300",...r.length>0?{hint:`${r.length} per-type override(s)`}:{}}),r.length>0&&d.jsxs("div",{className:"col-span-2 rounded-lg border border-line bg-panel/40 p-3 sm:col-span-4",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Per-type overrides"}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.map(([i,o])=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-panel-2/80 px-1.5 py-0.5 text-[10px] text-foreground",children:[d.jsx("span",{className:"text-muted-foreground",children:jg(i)}),d.jsx("span",{className:"tabular-nums text-foreground",children:rf(o)})]},i))})]})]})}function APe({run:e}){const t=Object.entries(e.deletedByType);return d.jsxs(kr,{className:"border-t border-line/60 align-top hover:bg-panel/40",children:[d.jsx(nt,{className:"text-xs text-muted-foreground",children:zs(new Date(e.at).getTime())}),d.jsx(nt,{children:d.jsx(wPe,{trigger:e.trigger})}),d.jsx(nt,{className:"text-xs tabular-nums text-muted-foreground",children:OPe(e.durationMs)}),d.jsx(nt,{className:"text-xs tabular-nums text-foreground",children:e.deletedTotal.toLocaleString()}),d.jsx(nt,{children:t.length>0?d.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(([n,r])=>d.jsx(SPe,{type:n,count:r},n))}):d.jsx("span",{className:"text-muted-foreground",children:"—"})}),d.jsx(nt,{className:"text-xs tabular-nums text-muted-foreground",children:e.archivedTotal!=null?e.archivedTotal.toLocaleString():"—"}),d.jsx(nt,{className:"text-xs text-bad",children:e.error??""})]})}function CPe(){var c;const{data:e,isLoading:t,isError:n}=j5(),r=Is(),i=b$(),o=jPe(),a=((c=r.data)==null?void 0:c.pruneEnabled)??!1,s=(e==null?void 0:e.runs)??[],l=(e==null?void 0:e.config)??null;async function u(){if(globalThis.confirm("Prune now deletes entries older than the retention window. Continue?"))try{const f=await i.mutateAsync();globalThis.alert(`Pruned ${f.pruned} ${f.pruned===1?"entry":"entries"}.`)}catch{globalThis.alert("Prune failed.")}}return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between px-1",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Prune activity"}),d.jsx(Xe,{onClick:u,disabled:!a||i.isPending,title:a?"Run a prune cycle now":"Mutations are disabled (configure authorizeAction to enable on-demand pruning).",children:i.isPending?"Pruning…":"Prune now"})]}),l?d.jsx(EPe,{config:l,nextRunAt:(e==null?void 0:e.nextRunAt)??null,nowMs:o}):d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-6 text-center text-xs text-muted-foreground",children:"No retention window is configured. Set a `prune` option to enable automatic pruning."}),t&&d.jsx("p",{className:"px-1 py-2 text-xs text-muted-foreground",children:"Loading prune runs…"}),n&&d.jsx("p",{className:"px-1 py-2 text-xs text-bad",children:"Failed to load prune runs."}),!t&&!n&&s.length===0&&d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-12 text-center text-xs text-muted-foreground",children:"No prune runs recorded yet on this pod."}),s.length>0&&d.jsx("div",{className:"rounded-lg border border-line",children:d.jsxs(Md,{className:"min-w-[760px] text-left text-sm",children:[d.jsx(Id,{children:d.jsxs(kr,{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx(Ge,{children:"Time"}),d.jsx(Ge,{children:"Trigger"}),d.jsx(Ge,{children:"Duration"}),d.jsx(Ge,{children:"Deleted"}),d.jsx(Ge,{children:"By type"}),d.jsx(Ge,{children:"Archived"}),d.jsx(Ge,{children:"Error"})]})}),d.jsx(Dd,{children:s.map((f,p)=>d.jsx(APe,{run:f},`${f.at}:${p}`))})]})})]})}function TPe(){var s;const[e,t]=O.useState("1h"),n=Oi(),{data:r,isLoading:i}=S$(e),o=WS({window:e,buckets:60}),a=YO(((s=o.data)==null?void 0:s.buckets)??[]);return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Pulse"}),d.jsx(zd,{value:e,onChange:t})]}),d.jsx(GO,{title:"Throughput by type",series:a,data:UF(o.data)}),i||!r?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):d.jsx(q0e,{report:r,onSelectEntry:l=>n(`/entries/view/${l}`),onSelectFamily:l=>n(`/entries/query?familyHash=${encodeURIComponent(l)}`),onSelectRoute:l=>n(`/entries/request?familyHash=${encodeURIComponent(l)}`),onSelectOutgoing:l=>n(`/entries/http_client?familyHash=${encodeURIComponent(l)}`)})]})}const _Pe="var(--bad)",RPe="var(--good)";function kPe(e){return((e==null?void 0:e.queues)??[]).map(t=>({label:t.queue,value:Number((t.failureRate*100).toFixed(1)),color:t.failureRate>0?_Pe:RPe}))}function NPe(){const[e,t]=O.useState("1h"),{data:n,isLoading:r}=O$(e);return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Queue metrics"}),d.jsx(zd,{value:e,onChange:t})]}),d.jsx(ds,{title:"Failure rate by queue",valueLabel:"fail %",data:kPe(n)}),r||!n?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):d.jsx(G0e,{report:n,sparkline:i=>d.jsx(Y0e,{queue:i,window:e})})]})}const $Pe=[{to:"/queues",label:"Manage",end:!0},{to:"/queues/metrics",label:"Metrics",end:!1}];function MPe(){return d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"flex gap-1 border-b border-line px-4 pt-3",children:$Pe.map(e=>d.jsx(eh,{to:e.to,end:e.end,className:({isActive:t})=>`rounded-t-md px-3 py-1.5 text-xs transition-colors ${t?"bg-panel text-brand":"text-muted-foreground hover:text-foreground"}`,children:e.label},e.to))}),d.jsx(Cz,{})]})}const IPe={cron:"tint-brand",interval:"tint-muted",timeout:"text-warn tint-warn"};function DPe({kind:e}){return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${IPe[e]}`,children:e})}function LPe({running:e}){return e==null?d.jsx("span",{className:"rounded bg-panel-2 px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"unknown"}):d.jsxs("span",{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${e?"tint-good":"tint-bad"}`,children:[d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${e?"bg-good":"bg-bad"}`}),e?"active":"stopped"]})}function FPe({status:e}){if(e===null)return d.jsx("span",{className:"text-muted-foreground",children:"—"});const t=e==="completed"?"tint-good":"tint-bad";return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${t}`,children:e})}function BPe(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function UPe(e){if(e===null)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString()}function zPe({task:e}){return d.jsxs(kr,{className:"border-t border-line/60 hover:bg-panel/40",children:[d.jsx(nt,{className:"font-medium text-foreground",children:e.name}),d.jsx(nt,{children:d.jsx(DPe,{kind:e.kind})}),d.jsx(nt,{children:d.jsx(LPe,{running:e.running})}),d.jsx(nt,{className:"font-mono text-xs text-muted-foreground",children:e.schedule}),d.jsx(nt,{className:"text-xs text-muted-foreground",children:UPe(e.nextRunAt)}),d.jsx(nt,{className:"text-xs text-muted-foreground",children:zs(HPe(e.lastRunAt))}),d.jsx(nt,{className:"text-xs tabular-nums text-muted-foreground",children:BPe(e.lastDurationMs)}),d.jsx(nt,{children:d.jsx(FPe,{status:e.lastStatus})})]})}function HPe(e){if(e===null)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function VPe(){const{data:e,isLoading:t,isError:n}=x5(),r=(e==null?void 0:e.tasks)??[],i=r.filter(a=>a.running===!0).length,o=r.filter(a=>a.running===!1).length;return d.jsxs("div",{className:"space-y-3 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between px-1",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Scheduled tasks"}),r.length>0&&d.jsxs("div",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wide",children:[d.jsxs("span",{className:"text-good",children:[i," active"]}),o>0&&d.jsxs("span",{className:"text-bad",children:[o," stopped"]}),d.jsxs("span",{className:"text-muted-foreground",children:[r.length," total"]})]})]}),t&&d.jsx("p",{className:"px-1 py-2 text-xs text-muted-foreground",children:"Loading schedules…"}),n&&d.jsx("p",{className:"px-1 py-2 text-xs text-bad",children:"Failed to load schedules."}),!t&&!n&&r.length===0&&d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-12 text-center text-xs text-muted-foreground",children:"No scheduled tasks detected. Register a ScheduleManager (the @nestjs/schedule watcher) to populate this console."}),r.length>0&&d.jsx("div",{className:"rounded-lg border border-line",children:d.jsxs(Md,{className:"min-w-[760px] text-left text-sm",children:[d.jsx(Id,{children:d.jsxs(kr,{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx(Ge,{children:"Name"}),d.jsx(Ge,{children:"Kind"}),d.jsx(Ge,{children:"Active"}),d.jsx(Ge,{children:"Schedule"}),d.jsx(Ge,{children:"Next run"}),d.jsx(Ge,{children:"Last run"}),d.jsx(Ge,{children:"Duration"}),d.jsx(Ge,{children:"Status"})]})}),d.jsx(Dd,{children:r.map(a=>d.jsx(zPe,{task:a},`${a.kind}:${a.name}`))})]})})]})}function WPe(){const{traceId:e=""}=Sg(),t=Oi(),[n,r]=O.useState("waterfall"),{data:i,isLoading:o}=w$({traceId:e}),a=(i==null?void 0:i.data)??[],{data:s,isLoading:l}=L5(e);return d.jsxs("div",{className:"p-4",children:[d.jsx("button",{type:"button",onClick:()=>t("/entries"),className:"mb-4 text-xs text-muted-foreground hover:text-foreground",children:"← entries"}),d.jsxs("div",{className:"mb-4 flex flex-wrap items-baseline gap-3 border-b border-line pb-3",children:[d.jsx("h2",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Trace"}),d.jsx("span",{className:"max-w-md truncate font-mono text-xs text-foreground",title:e,children:e}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[a.length," ",a.length===1?"entry":"entries"]}),d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[d.jsxs("div",{className:"flex overflow-hidden rounded border border-line text-[11px]",children:[d.jsx("button",{type:"button",onClick:()=>r("waterfall"),className:`px-2.5 py-1 transition-colors ${n==="waterfall"?"bg-panel-2 text-foreground":"bg-panel text-muted-foreground hover:text-foreground"}`,children:"Waterfall"}),d.jsx("button",{type:"button",onClick:()=>r("entries"),className:`border-l border-line px-2.5 py-1 transition-colors ${n==="entries"?"bg-panel-2 text-foreground":"bg-panel text-muted-foreground hover:text-foreground"}`,children:"Entries"})]}),a.length>0?d.jsx("button",{type:"button",onClick:()=>qO(`telescope-trace-${e}.json`,a),className:"rounded border border-line bg-panel px-2.5 py-1 text-[11px] text-foreground transition-colors hover:border-line hover:bg-panel-2 hover:text-foreground",children:"Download JSON"}):null]})]}),n==="waterfall"?l?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):s===void 0||s.spans.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No spans in this trace"}):d.jsx(Bbe,{waterfall:s,onSelect:u=>t(`/entries/view/${u}`)}):o?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):a.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No entries in this trace"}):d.jsx(_F,{entries:a,onSelect:u=>t(`/entries/view/${u}`)})]})}function KPe(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function qPe({trace:e}){const t=Oi(),n=e.rootLabel??e.traceId;return d.jsxs("button",{type:"button",onClick:()=>t(`/traces/${e.traceId}`),className:"flex w-full items-center gap-3 border-b border-line-soft px-3 py-2 text-left hover:bg-panel",children:[d.jsx("span",{className:"flex shrink-0 items-center gap-1","aria-hidden":"true",children:e.types.map(r=>d.jsx("span",{className:`h-2 w-2 rounded-full ${KS(r)}`,title:r},r))}),d.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",title:n,children:n}),d.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[e.entryCount," ",e.entryCount===1?"entry":"entries"]}),d.jsx("span",{className:"w-16 shrink-0 text-right text-xs text-muted-foreground",children:KPe(e.totalDurationMs)}),d.jsx("span",{className:"w-16 shrink-0 text-right text-xs text-muted-foreground",children:zs(new Date(e.lastAt).getTime())})]})}function GPe(){const[e,t]=O.useState("1h"),{data:n,isLoading:r}=D5(e),i=(n==null?void 0:n.traces)??[];return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Traces"}),d.jsx(zd,{value:e,onChange:t})]}),r?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):i.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No traces in this window"}):d.jsx("div",{className:"border border-line",children:i.map(o=>d.jsx(qPe,{trace:o},o.traceId))})]})}const XPe=new CU;function YPe(){return d.jsx(Fz,{children:d.jsx(Bwe,{children:d.jsxs(_z,{children:[d.jsx(bn,{path:"/",element:d.jsx(lSe,{})}),d.jsx(bn,{path:"/entries",element:d.jsx(eR,{})}),d.jsx(bn,{path:"/entries/view/:id",element:d.jsx(fSe,{})}),d.jsx(bn,{path:"/entries/:type",element:d.jsx(eR,{})}),d.jsx(bn,{path:"/traces",element:d.jsx(GPe,{})}),d.jsx(bn,{path:"/traces/:traceId",element:d.jsx(WPe,{})}),d.jsx(bn,{path:"/pulse",element:d.jsx(TPe,{})}),d.jsxs(bn,{path:"/queues",element:d.jsx(MPe,{}),children:[d.jsx(bn,{index:!0,element:d.jsx(uSe,{})}),d.jsx(bn,{path:"metrics",element:d.jsx(NPe,{})})]}),d.jsx(bn,{path:"/schedules",element:d.jsx(VPe,{})}),d.jsx(bn,{path:"/prunes",element:d.jsx(CPe,{})}),d.jsx(bn,{path:"/exports",element:d.jsx(vSe,{})}),d.jsx(bn,{path:"/profiles",element:d.jsx(xPe,{})}),d.jsx(bn,{path:"/ext/:dashboardId",element:d.jsx(hPe,{})})]})})})}function QPe(){const{phase:e,modes:t}=ZO();return e==="loading"?d.jsx("div",{className:"min-h-screen bg-background","data-testid":"auth-loading"}):e==="screen"?d.jsx(Pwe,{modes:t}):d.jsx(YPe,{})}function JPe(){return d.jsx(Rwe,{children:d.jsx(Xz,{children:d.jsx(tU,{client:XPe,children:d.jsx(xwe,{children:d.jsx(QPe,{})})})})})}const dR=document.getElementById("root");dR&&LN(dR).render(d.jsx(O.StrictMode,{children:d.jsx(JPe,{})}));
159
+ `)})]})]})}function hwe({driver:e,queue:t,jobId:n,state:r,capabilities:i,onClose:o}){const{data:a,isLoading:s,isError:l}=w5(e,t,n);return d.jsx(GL,{open:!0,onOpenChange:u=>{u||o()},children:d.jsxs(XL,{placement:"right",className:"flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2.5",children:[d.jsx(Cve,{className:"text-xs font-normal uppercase tracking-wide text-muted-foreground",children:"Job detail"}),d.jsx(Xe,{variant:"ghost",size:"xs","aria-label":"Close job detail",onClick:o,children:"✕"})]}),d.jsx("div",{className:"flex-1 overflow-auto p-4",children:s?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading job…"}):l?d.jsx("p",{className:"text-xs text-bad",children:"Failed to load job."}):a?d.jsx(pwe,{detail:a,capabilities:i,driver:e,queue:t,state:r,onClose:o}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Job not found (it may have been removed)."})})]})})}function mwe(e){return e instanceof Error&&/\b403\b/.test(e.message)}function gwe(e){const t=e.trim();if(t==="")return{ok:!1,message:"Payload is required."};try{return{ok:!0,value:JSON.parse(t)}}catch{return{ok:!1,message:"Payload must be valid JSON."}}}function ywe({capabilities:e,driver:t,queue:n}){const r=O5(),[i,o]=O.useState(""),[a,s]=O.useState(""),[l,u]=O.useState(null),[c,f]=O.useState(void 0);if(!Fy(e,t,"enqueue"))return null;const p=mwe(r.error);async function h(v){v.preventDefault(),f(void 0);const y=gwe(a);if(!y.ok){u(y.message);return}u(null);try{const x=await r.mutateAsync({driver:t,queue:n,...i.trim()!==""?{name:i.trim()}:{},payload:y.value});f(x.id),s("")}catch{}}return d.jsxs("form",{onSubmit:h,className:"space-y-2 rounded-lg border border-line p-3",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Send message"}),d.jsx("input",{type:"text",value:i,onChange:v=>o(v.target.value),placeholder:"Job name (optional)","aria-label":"Job name",className:"w-full rounded border border-line bg-background px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground"}),d.jsx("textarea",{value:a,onChange:v=>s(v.target.value),placeholder:'{"to": "a@b.c"}',"aria-label":"Payload (JSON)",rows:4,className:"w-full rounded border border-line bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground"}),l&&d.jsx("p",{className:"text-[10px] text-bad",children:l}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xe,{type:"submit",variant:"good",disabled:r.isPending,children:r.isPending?"Sending…":"Send message"}),p&&d.jsx("span",{className:"text-[10px] text-bad",children:"Not authorized"}),c!==void 0&&!p&&d.jsx("span",{className:"text-[10px] text-good",children:c?`Enqueued job ${c}`:"Message enqueued"})]})]})}const JO=O.createContext(null);function vwe(e){return e instanceof Error&&/ 401$/.test(e.message)}function xwe({children:e}){const t=Ue(),n=ho(),[r,i]=O.useState("loading"),[o,a]=O.useState([]),s=O.useRef(!1),l=O.useMemo(()=>{async function u(){const f=await t.auth.me();if(f.status==="authenticated"){s.current=!0,i("app");return}if(f.status==="unauthenticated"){s.current=!0,a(f.modes),i("screen");return}s.current=!1,i("disabled")}async function c(){await t.auth.logout(),await u()}return{phase:r,modes:o,refresh:u,logout:c}},[t,r,o]);return O.useEffect(()=>{let u=!1;return t.auth.me().then(c=>{u||(c.status==="authenticated"?(s.current=!0,i("app")):c.status==="unauthenticated"?(s.current=!0,a(c.modes),i("screen")):(s.current=!1,i("disabled")))}),()=>{u=!0}},[t]),O.useEffect(()=>n.getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.state.status==="error"&&s.current&&vwe(c.query.state.error)&&l.refresh()}),[n,l]),d.jsx(JO.Provider,{value:l,children:e})}function ZO(){const e=O.useContext(JO);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function bwe(){return O.useContext(JO)}function wwe({children:e}){return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4 font-mono text-sm text-foreground",children:d.jsxs("div",{className:"w-full max-w-sm rounded-lg border border-line bg-panel p-8 shadow-2xl",children:[d.jsx("div",{className:"mb-6 text-center text-lg font-semibold text-brand",children:"Telescope"}),e]})})}function Swe(){const e=Ue(),{refresh:t}=ZO(),[n,r]=O.useState(""),[i,o]=O.useState(""),a=O.useId(),s=O.useId(),[l,u]=O.useState(null),[c,f]=O.useState(!1);async function p(h){h.preventDefault(),f(!0),u(null);try{const v=await e.auth.login(n,i);if(v.ok){await t();return}u(v.message)}finally{f(!1)}}return d.jsxs("form",{onSubmit:p,className:"flex flex-col gap-4",children:[d.jsxs("label",{className:"flex flex-col gap-1.5",htmlFor:a,children:[d.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Username"}),d.jsx(_s,{id:a,type:"text",name:"username",autoComplete:"username",value:n,onChange:h=>r(h.target.value),className:"px-3 py-2 text-sm"})]}),d.jsxs("label",{className:"flex flex-col gap-1.5",htmlFor:s,children:[d.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Password"}),d.jsx(_s,{id:s,type:"password",name:"password",autoComplete:"current-password",value:i,onChange:h=>o(h.target.value),className:"px-3 py-2 text-sm"})]}),l!==null?d.jsx("p",{role:"alert",className:"text-xs text-bad",children:l}):null,d.jsx(Xe,{type:"submit",variant:"brand",size:"md",disabled:c,className:"mt-2 uppercase tracking-wide",children:c?"Signing in…":"Sign in"})]})}function Owe(){const{refresh:e}=ZO(),[t,n]=O.useState(!1);async function r(){n(!0);try{await e()}finally{n(!1)}}return d.jsxs("div",{className:"flex flex-col gap-4 text-center",children:[d.jsx("p",{className:"text-sm font-medium text-foreground",children:"Open Telescope from your application"}),d.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Your session is minted by the host app. Use its “Open Telescope” action to sign in, then come back here."}),d.jsx("button",{type:"button",onClick:r,disabled:t,className:"mt-2 rounded border border-line px-3 py-2 text-xs font-medium uppercase tracking-wide text-foreground transition-colors hover:bg-panel-2 disabled:cursor-not-allowed disabled:opacity-50",children:t?"Checking…":"Retry"})]})}function Pwe({modes:e}){const t=e.includes("login");return d.jsx(wwe,{children:t?d.jsx(Swe,{}):d.jsx(Owe,{})})}const jwe=[{id:"page-overview",label:"Overview",to:"/"},{id:"page-entries",label:"Entries",to:"/entries"},{id:"page-pulse",label:"Pulse",to:"/pulse"},{id:"page-queues",label:"Queues",to:"/queues"},{id:"page-metrics",label:"Queue Metrics",to:"/queues/metrics"},{id:"page-schedules",label:"Schedules",to:"/schedules"},{id:"page-traces",label:"Traces",to:"/traces"}],Ewe=[...jwe,...Gl.map(e=>({id:`entry-${e.id}`,label:e.label,to:`/entries/${e.id}`}))];function Awe(e,t){const n=t.trim().toLowerCase();return n?e.filter(r=>r.label.toLowerCase().includes(n)):e}function Cwe(){const[e,t]=O.useState(!1);return O.useEffect(()=>{function n(r){(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),t(i=>!i))}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),{open:e,setOpen:t}}function Twe({open:e,onClose:t}){const n=Oi(),r=O.useRef(null),[i,o]=O.useState(""),[a,s]=O.useState(0),l=O.useId(),u=O.useMemo(()=>Awe(Ewe,i),[i]);O.useEffect(()=>{var h;e&&(o(""),s(0),(h=r.current)==null||h.focus())},[e]),O.useEffect(()=>{s(h=>u.length===0?0:Math.min(h,u.length-1))},[u.length]);const c=O.useCallback(h=>{h&&(n(h.to),t())},[n,t]);function f(h){u.length!==0&&(h.key==="ArrowDown"?(h.preventDefault(),s(v=>(v+1)%u.length)):h.key==="ArrowUp"?(h.preventDefault(),s(v=>(v-1+u.length)%u.length)):h.key==="Enter"&&(h.preventDefault(),c(u[a])))}const p=u[a]?`${l}-${u[a].id}`:void 0;return d.jsx(GL,{open:e,onOpenChange:h=>{h||t()},children:d.jsxs(XL,{placement:"top","aria-label":"Command palette",className:"overflow-hidden",initialFocus:r,onKeyDown:f,children:[d.jsx("input",{ref:r,type:"text",value:i,onChange:h=>o(h.target.value),placeholder:"Jump to…","aria-label":"Search actions","aria-controls":l,"aria-activedescendant":p,className:"w-full border-b border-line bg-transparent px-4 py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"}),d.jsx("ul",{id:l,role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:u.length===0?d.jsx("li",{className:"px-4 py-3 text-xs text-muted-foreground",children:"No matching actions"}):u.map((h,v)=>d.jsx("li",{id:`${l}-${h.id}`,role:"option","aria-selected":v===a,onMouseEnter:()=>s(v),onMouseDown:y=>{y.preventDefault(),c(h)},className:`cursor-pointer px-4 py-2 text-sm ${v===a?"bg-panel-2 text-brand":"text-foreground"}`,children:h.label},h.id))})]})})}const LF="telescope-theme",hx="dark",FF=O.createContext(null);function Y_(){if(typeof window>"u"||!window.localStorage)return hx;try{const e=window.localStorage.getItem(LF);return e==="light"||e==="dark"?e:hx}catch{return hx}}function _we(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(LF,e)}catch{}}function Rwe({children:e}){const[t,n]=O.useState(Y_),r=O.useCallback(()=>{n(o=>{const a=o==="dark"?"light":"dark";return _we(a),a})},[]);O.useEffect(()=>{n(Y_())},[]),O.useEffect(()=>{if(typeof document>"u")return;const o=document.documentElement;return o.classList.toggle("light",t==="light"),o.classList.toggle("dark",t==="dark"),()=>{o.classList.remove("light","dark")}},[t]);const i=O.useMemo(()=>({theme:t,toggleTheme:r}),[t,r]);return d.jsx(FF.Provider,{value:i,children:d.jsx("div",{className:t,"data-theme":t,"data-testid":"telescope-root",children:e})})}function kwe(){const e=O.useContext(FF);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const Nwe=[{to:"/",label:"Overview",end:!0},{to:"/entries",label:"Entries",end:!0},{to:"/traces",label:"Traces",end:!0},{to:"/pulse",label:"Pulse",end:!1},{to:"/queues",label:"Queues",end:!1},{to:"/schedules",label:"Schedules",end:!1},{to:"/prunes",label:"Prunes",end:!1},{to:"/exports",label:"Exports",end:!1},{to:"/profiles",label:"Profiles",end:!1}];function $we(e,t,n){return e.filter(r=>!(r.to==="/traces"&&t===!1||r.to==="/profiles"&&n!==!0))}function Q_({isActive:e}){return`block rounded px-3 py-1.5 text-xs uppercase tracking-wide ${e?"bg-panel-2 text-brand":"text-muted-foreground hover:bg-panel hover:text-foreground"}`}function Mwe({isActive:e}){return`flex items-center gap-2 rounded px-3 py-1.5 text-xs ${e?"bg-panel-2 text-foreground":"text-muted-foreground hover:bg-panel hover:text-foreground"}`}function Iwe(){const{paused:e,setPaused:t}=m$();return d.jsxs(HO,{children:[d.jsx(VO,{render:d.jsxs(Xe,{variant:e?"warn":"good",onClick:()=>t(!e),"aria-pressed":e,className:"uppercase tracking-wide",children:[d.jsx("span",{"aria-hidden":"true",children:e?"⏸":"●"}),e?"Paused":"Live"]})}),d.jsx(WO,{children:e?"Resume live tail":"Pause live tail"})]})}function Dwe(){const{theme:e,toggleTheme:t}=kwe(),n=e==="dark";return d.jsxs(HO,{children:[d.jsx(VO,{render:d.jsxs(Xe,{onClick:t,"aria-pressed":!n,children:[d.jsx("span",{"aria-hidden":"true",children:n?"☾":"☀"}),n?"Dark":"Light"]})}),d.jsx(WO,{children:n?"Switch to light theme":"Switch to dark theme"})]})}function Lwe({onClick:e}){return d.jsxs(HO,{children:[d.jsx(VO,{render:d.jsx(Xe,{onClick:e,"aria-label":"Open command palette","aria-keyshortcuts":"Meta+K Control+K",className:"text-muted-foreground hover:text-foreground",children:d.jsx("span",{"aria-hidden":"true",children:"⌘K"})})}),d.jsx(WO,{children:"Open command palette (⌘K)"})]})}function Fwe(){const e=bwe(),[t,n]=O.useState(!1);if(e===null||e.phase!=="app")return null;async function r(){if(e!==null){n(!0);try{await e.logout()}finally{n(!1)}}}return d.jsxs(Xe,{onClick:r,disabled:t,title:"Sign out",children:[d.jsx("span",{"aria-hidden":"true",children:"⎋"}),"Sign out"]})}function Bwe({children:e}){var a,s,l,u,c,f;const{open:t,setOpen:n}=Cwe(),r=Is(),i=Q5(Y5((a=r.data)==null?void 0:a.entryTypes),(s=r.data)==null?void 0:s.watchers),o=$we(Nwe,(l=r.data)==null?void 0:l.tracesEnabled,(c=(u=r.data)==null?void 0:u.profiling)==null?void 0:c.enabled);return d.jsxs("div",{className:"flex min-h-screen bg-background font-mono text-sm text-foreground",children:[d.jsx(Twe,{open:t,onClose:()=>n(!1)}),d.jsxs("aside",{className:"flex w-56 shrink-0 flex-col gap-6 border-r border-line px-3 py-4",children:[d.jsx("span",{className:"px-3 text-base font-semibold text-brand",children:"Telescope"}),d.jsxs("nav",{className:"flex flex-col gap-1",children:[o.map(p=>d.jsx(eh,{to:p.to,end:p.end,className:Q_,children:p.label},p.to)),(((f=r.data)==null?void 0:f.dashboards)??[]).map(p=>d.jsx(eh,{to:`/ext/${p.id}`,className:Q_,children:p.label},p.id))]}),d.jsxs("nav",{className:"flex flex-col gap-1",children:[d.jsx("span",{className:"px-3 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Watchers"}),i.map(p=>d.jsxs(eh,{to:`/entries/${p.id}`,className:Mwe,children:[d.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${p.dot}`,"aria-hidden":"true"}),p.label]},p.id))]})]}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[d.jsx("header",{className:"flex items-center justify-end gap-4 border-b border-line px-4 py-2",children:d.jsxs(jbe,{delay:200,children:[d.jsx(S0e,{}),d.jsx(Lwe,{onClick:()=>n(!0)}),d.jsx(Dwe,{}),d.jsx(Iwe,{}),d.jsx(Fwe,{})]})}),d.jsx("main",{className:"min-w-0 flex-1",children:e})]})]})}function Uwe(e,t){if(e===void 0||!t)return null;const n=t.direction==="up-bad";return(n?e>=t.bad:e<=t.bad)?"bad":(n?e>=t.warn:e<=t.warn)?"warn":"ok"}const zwe={ok:"var(--good)",warn:"var(--warn)",bad:"var(--bad)"};function Hwe({points:e}){if(e.length<2)return null;const t=Math.max(...e),n=Math.min(...e),r=t-n||1,i=e.map((o,a)=>{const s=a/(e.length-1)*100,l=20-(o-n)/r*18-1;return`${a===0?"M":"L"}${s.toFixed(1)},${l.toFixed(1)}`}).join(" ");return d.jsxs("svg",{className:"mt-2",width:"100%",height:"22",viewBox:"0 0 100 22",preserveAspectRatio:"none",children:[d.jsx("title",{children:"Trend sparkline"}),d.jsx("path",{d:i,fill:"none",stroke:"var(--muted)",strokeWidth:"1.5"})]})}function Pt({label:e,value:t,delta:n,deltaLabel:r,spark:i,thresholds:o,currentValue:a,accent:s="text-foreground",hint:l}){const u=Uwe(a,o),c=n===void 0||!o?null:o.direction==="up-bad"?n<0:n>0,f=c===null?"#a1a1aa":c?"var(--good)":"var(--bad)",p=n===void 0?"":n>0?"▲":n<0?"▼":"◆";return d.jsxs("div",{"data-health":u??void 0,className:"rounded-lg border border-line bg-panel/40 px-4 py-3 overflow-hidden",children:[u&&d.jsx("div",{style:{height:3,background:zwe[u],margin:"-12px -16px 9px"}}),d.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),d.jsxs("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${s} flex items-baseline gap-2`,children:[t,n!==void 0&&d.jsxs("span",{className:"text-xs font-semibold",style:{color:f},children:[p," ",r??Math.abs(n)]})]}),i&&d.jsx(Hwe,{points:i}),l&&d.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:l})]})}function Vwe(e){const t=Math.max(0,Math.floor(e)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m`:`${i}m ${t%60}s`}function Wwe({stats:e}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Server"}),e?d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[d.jsx(Pt,{label:"Uptime",value:Vwe(e.uptimeSec),accent:"text-brand"}),d.jsx(Pt,{label:"RSS",value:`${e.memory.rssMb} MB`,hint:`heap ${e.memory.heapUsedMb}/${e.memory.heapTotalMb} MB`}),d.jsx(Pt,{label:"Heap used",value:`${e.memory.heapUsedMb} MB`,accent:"text-sky-400"}),d.jsx(Pt,{label:"CPU",value:`${Math.round(e.cpu.userMs)} ms`,accent:"text-violet-400",hint:`sys ${Math.round(e.cpu.systemMs)} ms`}),d.jsx(Pt,{label:"Event loop",value:e.eventLoopDelayMs===null?"n/a":`${e.eventLoopDelayMs} ms`,accent:e.eventLoopDelayMs!==null&&e.eventLoopDelayMs>100?"text-bad":"text-foreground",hint:`instance ${e.instanceId}`})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading…"})]})}function Kwe(e){return`${(Math.max(0,e)/1e3).toFixed(1)} µs`}function J_(e){return e===null?"n/a":`${e.toFixed(1)} ms`}function qwe({health:e}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Telescope health"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Captures run off the response path — your requests don't wait on Telescope."})]}),e?d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[d.jsx(Pt,{label:"Capture cost",value:`${Kwe(e.captureCostNanos)}/capture`,accent:"text-brand",hint:"micro-benchmark"}),d.jsx(Pt,{label:"Buffer",value:`${e.bufferUsed} / ${e.bufferSize}`,accent:"text-sky-400",hint:`high-water ${e.bufferHighWater}`}),d.jsx(Pt,{label:"Last flush",value:J_(e.lastFlushMs),hint:`max ${J_(e.maxFlushMs)}`}),d.jsx(Pt,{label:"Flushes",value:e.flushes.toLocaleString(),accent:"text-violet-400",hint:`${e.flushedEntries.toLocaleString()} entries`}),d.jsx(Pt,{label:"Dropped",value:e.droppedCount.toLocaleString(),accent:e.droppedCount>0?"text-bad":"text-good",hint:e.droppedCount>0?`overflow ${e.overflowDropped} · store ${e.storeFailedDropped}`:"keeping up"}),d.jsx(Pt,{label:"Truncated",value:e.truncatedCount.toLocaleString(),accent:e.truncatedCount>0?"text-warn":"text-good",hint:e.truncatedCount>0?"fat content — tune redact/sampling":"within bounds"})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading…"})]})}function Gwe({retention:e,pruneEnabled:t}){const n=b$(),r=e==null?void 0:e.retention;async function i(){if(globalThis.confirm("Prune now deletes entries older than the retention window. Continue?"))try{const o=await n.mutateAsync();globalThis.alert(`Pruned ${o.pruned} ${o.pruned===1?"entry":"entries"}.`)}catch{globalThis.alert("Prune failed.")}}return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Retention"}),t?d.jsx("button",{type:"button",onClick:i,disabled:n.isPending,className:"rounded border border-line px-2 py-1 text-[11px] text-foreground hover:border-brand hover:text-brand disabled:cursor-not-allowed disabled:opacity-50",children:n.isPending?"Pruning…":"Prune now"}):null]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[d.jsx(Pt,{label:"Window",value:r?rf(r.afterMs):"none",accent:r?"text-brand":"text-muted-foreground",hint:(r==null?void 0:r.keepLast)!=null?`keep last ${r.keepLast}`:"unbounded"}),d.jsx(Pt,{label:"Entries",value:(e==null?void 0:e.entryCount)!=null?e.entryCount.toLocaleString():"n/a"}),d.jsx(Pt,{label:"Oldest",value:(e==null?void 0:e.oldestCreatedAt)!=null?"tracked":"n/a"})]})]})}function BF(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Xwe(e){return((e==null?void 0:e.buckets)??[]).map(t=>({label:BF(t.t),value:t.total}))}function UF(e){const t=YO((e==null?void 0:e.buckets)??[]);return((e==null?void 0:e.buckets)??[]).map(n=>{const r={label:BF(n.t)};for(const i of t)r[i]=n.byType[i]??0;return r})}function Ywe(e){return Object.values(e).reduce((t,n)=>t+n,0)}function Qwe(e){const t=e.request??0;return t===0?null:(e.exception??0)/t}const Jwe=.05;function Zwe(e){return e===null?"n/a":`${(e*100).toFixed(1)}%`}function eSe(e){return(e==null?void 0:e.slowRoutes.length)??0}const Mw=100;function tSe(e){return((e==null?void 0:e.queues)??[]).filter(t=>{const n=Math.max(0,t.total-t.completed-t.failed);return t.failed>0||n>=Mw})}function nSe({pulse:e,queues:t}){const n=(e==null?void 0:e.counts)??{},r=Ywe(n),i=n.request??0,o=n.exception??0,a=Qwe(n),s=((t==null?void 0:t.queues)??[]).reduce((u,c)=>u+c.failed,0),l=eSe(e);return d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Pt,{label:"Requests",value:i.toLocaleString(),accent:"text-brand",hint:`${r.toLocaleString()} entries total`}),d.jsx(Pt,{label:"Error rate",value:Zwe(a),accent:a!==null&&a>Jwe?"text-bad":"text-foreground",hint:`${o.toLocaleString()} exceptions`}),d.jsx(Pt,{label:"Failed jobs",value:s.toLocaleString(),accent:s>0?"text-bad":"text-foreground",hint:"across queues"}),d.jsx(Pt,{label:"Slow routes",value:l.toLocaleString(),accent:l>0?"text-warn":"text-foreground",hint:"routes over the slow p99 threshold"})]})}function Z_({title:e,emptyLabel:t,children:n}){const r=Array.isArray(n)?n.length>0:!!n;return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),r?d.jsx("ul",{className:"space-y-1 text-xs",children:n}):d.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}function rSe({hotspots:e,onSelectFamily:t}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"N+1 query hotspots"}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(n=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>t(n.familyHash),className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsxs("span",{className:"min-w-0 truncate",children:[d.jsxs("span",{className:"whitespace-nowrap text-warn",children:["×",n.perRequest]})," ",d.jsx("span",{className:"text-muted-foreground",children:n.sql})]}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[n.requests," req · ",n.total," total",n.totalDurationMs>0?` · ${Math.round(n.totalDurationMs)}ms`:""]})]})},n.familyHash))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"None detected"})]})}function iSe({queues:e,onOpenQueues:t}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3",children:[d.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Queues needing attention"}),d.jsx("button",{type:"button",onClick:t,className:"text-[11px] text-muted-foreground hover:text-brand",children:"All queues →"})]}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(n=>{const r=Math.max(0,n.total-n.completed-n.failed);return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsx("span",{className:"min-w-0 truncate text-foreground",children:n.queue}),d.jsxs("span",{className:"shrink-0 tabular-nums",children:[n.failed>0?d.jsxs("span",{className:"text-bad",children:[n.failed," failed"]}):null,n.failed>0&&r>=Mw?d.jsx("span",{className:"text-muted-foreground",children:" · "}):null,r>=Mw?d.jsxs("span",{className:"text-warn",children:[r.toLocaleString()," pending"]}):null]})]})},n.queue)})}):d.jsx("p",{className:"text-xs text-good",children:"All queues healthy"})]})}function oSe({hotspots:e}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Slowest jobs"}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(t=>d.jsxs("li",{className:"flex items-center justify-between gap-3 border-t border-line-soft pt-1 first:border-0 first:pt-0",children:[d.jsx("span",{className:"min-w-0 truncate text-foreground",children:t.route}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[d.jsxs("span",{className:"text-warn",children:[Math.round(t.p99),"ms"]})," p99 · ",t.count,"×"]})]},t.route))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"No jobs in window."})]})}function aSe({users:e,onSelectUser:t}){return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Load by user"}),e.length>0?d.jsx("ul",{className:"space-y-1 text-xs",children:e.map(n=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>t(n.user),className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsx("span",{className:"min-w-0 truncate text-foreground",children:n.user}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[n.count," req · ",Math.round(n.totalDurationMs),"ms"]})]})},n.user))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"No identified users in window."})]})}function sSe({history:e}){const t=(e==null?void 0:e.samples)??[],n=t.map(a=>a.cpuPercent),r=t.map(a=>a.rssMb),i=t.map(a=>a.heapUsedMb),o=t[t.length-1];return d.jsxs("section",{className:"rounded-lg border border-line bg-panel/40 p-4",children:[d.jsx("h3",{className:"mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Resource history"}),t.length>1?d.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 text-[11px] text-muted-foreground",children:["CPU ",o?`${o.cpuPercent}%`:""]}),d.jsx(lh,{values:n})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 text-[11px] text-muted-foreground",children:["RSS ",o?`${o.rssMb}MB`:""]}),d.jsx(lh,{values:r})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 text-[11px] text-muted-foreground",children:["Heap ",o?`${o.heapUsedMb}MB`:""]}),d.jsx(lh,{values:i})]})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Collecting samples…"})]})}function lSe(){var y,x,g,m,b,S,w;const[e,t]=O.useState("1h"),n=Oi(),r=S$(e),i=O$(e),o=WS({window:e,buckets:60}),a=R5(),s=k5(),l=$5(),u=P5(),c=Is(),f=Xwe(o.data),p=UF(o.data),h=YO(((y=o.data)==null?void 0:y.buckets)??[]),v=tSe(i.data);return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Overview"}),d.jsx(zd,{value:e,onChange:t})]}),d.jsx(nSe,{pulse:r.data,queues:i.data}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(Z_,{title:"Recent failures",emptyLabel:"No exceptions 🎉",children:(((x=r.data)==null?void 0:x.topExceptions)??[]).map(P=>d.jsxs("li",{className:"flex items-center justify-between gap-3 border-t border-line-soft pt-1 first:border-0 first:pt-0",children:[d.jsxs("span",{className:"min-w-0",children:[d.jsx("span",{className:"text-bad",children:P.class})," ",d.jsx("span",{className:"text-muted-foreground",children:P.message})]}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:["×",P.count]})]},P.familyHash))}),d.jsx(rSe,{hotspots:((g=r.data)==null?void 0:g.nPlusOne)??[],onSelectFamily:P=>n(`/entries/query?familyHash=${encodeURIComponent(P)}`)})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(Z_,{title:"Slowest",emptyLabel:"Nothing slow in window.",children:(((m=r.data)==null?void 0:m.slowest)??[]).map(P=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>n(`/entries/view/${P.id}`),className:"flex w-full items-center justify-between gap-3 border-t border-line-soft pt-1 text-left hover:text-foreground first:border-0 first:pt-0",children:[d.jsxs("span",{className:"min-w-0 truncate",children:[d.jsx("span",{className:"text-brand",children:P.type})," ",d.jsx("span",{className:"text-muted-foreground",children:P.label})]}),d.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[P.durationMs,"ms"]})]})},P.id))}),d.jsx(iSe,{queues:v,onOpenQueues:()=>n("/queues")})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(oSe,{hotspots:((b=r.data)==null?void 0:b.slowJobs)??[]}),d.jsx(aSe,{users:((S=r.data)==null?void 0:S.loadByUser)??[],onSelectUser:P=>n(`/entries?tag=${encodeURIComponent(`user:${P}`)}`)})]}),d.jsx(sSe,{history:s.data}),d.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[d.jsx(Us,{title:"Throughput",valueLabel:"entries",data:f}),d.jsx(GO,{title:"By type",series:h,data:p})]}),d.jsx(Wwe,{stats:a.data}),d.jsx(qwe,{health:l.data}),d.jsx(Gwe,{retention:u.data,pruneEnabled:((w=c.data)==null?void 0:w.pruneEnabled)??!1})]})}function uSe(){const{data:e}=v$(),t=(e==null?void 0:e.queues)??[],n=e==null?void 0:e.capabilities,[r,i]=O.useState(void 0),[o,a]=O.useState("waiting"),[s,l]=O.useState(null);O.useEffect(()=>{if(r||t.length===0)return;const f=t[0];f&&i({driver:f.driver,queue:f.queue})},[t,r]);const u=t.find(f=>f.driver===(r==null?void 0:r.driver)&&f.queue===(r==null?void 0:r.queue));function c(f,p){i({driver:f,queue:p}),l(null)}return d.jsxs("div",{className:"grid grid-cols-1 gap-4 p-4 lg:grid-cols-[280px_minmax(0,1fr)]",children:[d.jsxs("aside",{className:"space-y-2",children:[d.jsx("h3",{className:"px-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Live queues"}),d.jsx(Z0e,{...r?{selected:r}:{},onSelect:c})]}),d.jsx("section",{className:"min-w-0 space-y-3",children:r?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("h2",{className:"truncate text-sm text-brand",children:[r.queue,d.jsx("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-muted-foreground",children:r.driver})]}),o==="failed"&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(cwe,{capabilities:n,driver:r.driver,queue:r.queue}),d.jsx(fwe,{capabilities:n,driver:r.driver,queue:r.queue})]})]}),d.jsx(ewe,{counts:u==null?void 0:u.counts,state:o,onState:a}),d.jsx(iwe,{driver:r.driver,queue:r.queue,state:o,onOpen:l}),d.jsx(ywe,{capabilities:n,driver:r.driver,queue:r.queue})]}):d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-12 text-center text-xs text-muted-foreground",children:"Select a queue to inspect its jobs."})}),r&&s&&d.jsx(hwe,{driver:r.driver,queue:r.queue,jobId:s,state:o,capabilities:n,onClose:()=>l(null)})]})}function cSe(e,t){return t.trim()!==""?`No entries match tag '${t.trim()}'`:e?`No ${jg(e)} entries`:"No entries"}function eR(){const{type:e}=Sg(),t=Oi(),[n]=Vz(),[r,i]=O.useState(()=>n.get("tag")??""),[o,a]=O.useState(""),[s,l]=O.useState(""),[u,c]=O.useState(0),[f,p]=O.useState(0);function h(N){i(N),p(I=>I+1)}function v(N){i(N),c(I=>I+1)}const y=e&&G5(e)?e:void 0,x=r.trim(),g=kbe(x)?x:"",m=g===""?x:"",b=s.trim(),S=n.get("familyHash")??"",w=S!=="",P=b!=="",j=y!==void 0||x!==""||w||P,{data:E,isLoading:A}=w$({...y?P$(y):{},...x!==""?{tag:x}:{},...w?{familyHash:S}:{},...P?{search:b}:{}}),C=(E==null?void 0:E.data)??[];function T(){l(o)}function _(){a(""),l("")}function R(){i(""),_(),t("/entries")}function $(){t(y?`/entries/${y}`:"/entries")}return d.jsxs("div",{className:"p-4",children:[y?d.jsx(z0e,{type:y}):null,d.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3 border-b border-line pb-3",children:[y?d.jsxs(Xe,{variant:"ghost",onClick:()=>t("/entries"),className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{className:`h-2 w-2 rounded-full ${KS(y)}`,"aria-hidden":"true"}),jg(y),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):d.jsx("span",{className:"rounded bg-panel px-2 py-1 text-xs text-muted-foreground",children:"All types"}),d.jsx(K_,{onSelect:h},`tag-${u}`),d.jsx(K_,{prefix:Rbe,placeholder:"Filter by user…",ariaLabel:"Filter by user",onSelect:v},`user-${f}`),m!==""?d.jsxs(Xe,{variant:"ghost",onClick:()=>i(""),className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{children:`tag:${m}`}),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,g!==""?d.jsxs(Xe,{variant:"ghost",onClick:()=>i(""),className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{children:`User: ${KO(g)}`}),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,d.jsx(_s,{type:"text",value:o,onChange:N=>a(N.target.value),onKeyDown:N=>{N.key==="Enter"&&T()},onBlur:T,placeholder:"Search content…","aria-label":"Search content"}),P?d.jsxs(Xe,{variant:"ghost",onClick:_,className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{children:`search:"${b}"`}),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,w?d.jsxs(Xe,{variant:"ghost",onClick:$,className:"bg-panel text-foreground hover:bg-panel-2",children:[d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"family:"}),S.slice(0,12),d.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"×"})]}):null,j?d.jsx(Xe,{variant:"ghost",onClick:R,children:"Clear filters"}):null]}),E!=null&&E.partial?d.jsx("output",{className:"tint-warn mb-4 block rounded-lg border px-4 py-3 text-sm",children:"Older entries are unavailable right now — the store could only read part of its data, so this list may be missing them."}):null,A?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):C.length===0?d.jsx("p",{className:"text-muted-foreground",children:cSe(y,r)}):d.jsx(_F,{entries:C,onSelect:N=>t(`/entries/view/${N}`)})]})}function fSe(){const{id:e=""}=Sg(),t=Oi(),{data:n,isLoading:r}=_5(e);return d.jsxs("div",{className:"p-4",children:[d.jsx("button",{type:"button",onClick:()=>t("/entries"),className:"mb-4 text-xs text-muted-foreground hover:text-foreground",children:"← entries"}),r||!n?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):d.jsx(t0e,{entry:n,onSelect:i=>t(`/entries/view/${i}`)})]})}const dSe={json:"JSON",csv:"CSV"},pSe={all:"all",...Object.fromEntries(Gl.map(e=>[e.id,e.label]))},hSe=200,tR=1e3,nR=1e4,rR={"15m":15*6e4,"1h":60*6e4,"6h":6*60*6e4,"24h":24*60*6e4};function mSe(e){return e==="all"?{}:P$(e)}async function gSe(e,t,n,r,i){const o=[];let a;for(;o.length<n;){const s=Math.min(hSe,n-o.length),l=await e.entries({...t,limit:s,...a!==void 0?{cursor:a}:{}});let u=!1;for(const c of l.data){if(new Date(c.createdAt).getTime()<r){u=!0;break}if(o.push(c),o.length>=n)break}if(i(o.length),u||l.nextCursor===null)break;a=l.nextCursor}return o}function ySe({records:e}){return e.length===0?null:d.jsx("div",{className:"rounded-lg border border-line",children:d.jsxs(Md,{className:"min-w-[640px] text-left",children:[d.jsx(Id,{children:d.jsxs(kr,{children:[d.jsx(Ge,{children:"Filename"}),d.jsx(Ge,{children:"Type"}),d.jsx(Ge,{children:"Rows"}),d.jsx(Ge,{children:"Format"}),d.jsx(Ge,{children:"Time"})]})}),d.jsx(Dd,{children:e.map(t=>d.jsxs(kr,{className:"hover:bg-panel",children:[d.jsx(nt,{className:"font-mono text-foreground",children:t.filename}),d.jsx(nt,{className:"text-muted-foreground",children:t.type}),d.jsx(nt,{className:"tabular-nums text-foreground",children:t.rows.toLocaleString()}),d.jsx(nt,{className:"uppercase text-muted-foreground",children:t.format}),d.jsx(nt,{className:"text-muted-foreground",children:new Date(t.at).toLocaleTimeString()})]},`${t.filename}:${t.at}`))})]})})}function vSe(){const e=Ue(),t=O.useId(),n=O.useId(),[r,i]=O.useState("all"),[o,a]=O.useState("1h"),[s,l]=O.useState(""),[u,c]=O.useState(tR),[f,p]=O.useState("json"),[h,v]=O.useState(!1),[y,x]=O.useState(null),[g,m]=O.useState(null),[b,S]=O.useState([]);async function w(){v(!0),m(null),x(0);const P=Math.min(Math.max(1,u),nR),j=Date.now()-(rR[o]??rR["1h"]),E={...mSe(r),...s.trim()!==""?{search:s.trim()}:{}};try{const A=await gSe(e,E,P,j,x),C=new Date().toISOString().replace(/[:.]/g,"-"),T=`telescope-export-${r}-${C}.${f}`;f==="csv"?b0e(T,x0e(A)):qO(T,A),S(_=>[{filename:T,type:r,rows:A.length,format:f,at:Date.now()},..._])}catch{m("Export failed while gathering entries.")}finally{v(!1)}}return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"px-1",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Export workbench"}),d.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Page captured entries into a downloadable JSON or CSV file. Gathering runs in your browser against the live store, newest-first within the selected window."})]}),d.jsxs("div",{className:"flex flex-wrap items-end gap-3 rounded-lg border border-line bg-panel/40 p-4",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:["Type",d.jsxs(Aw,{items:pSe,value:r,onValueChange:P=>{typeof P=="string"&&i(P)},children:[d.jsx(Tw,{"aria-label":"Entry type",children:d.jsx(Cw,{})}),d.jsxs(_w,{children:[d.jsx(Lc,{value:"all",children:"all"}),Gl.map(P=>d.jsx(Lc,{value:P.id,children:P.label},P.id))]})]})]}),d.jsxs("div",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:["Window",d.jsx(zd,{value:o,onChange:a})]}),d.jsxs("label",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",htmlFor:t,children:["Search",d.jsx(_s,{id:t,type:"text",value:s,onChange:P=>l(P.target.value),placeholder:"content filter"})]}),d.jsxs("label",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",htmlFor:n,children:["Limit",d.jsx(_s,{id:n,type:"number",min:1,max:nR,value:u,onChange:P=>c(Number(P.target.value)||tR),className:"w-24 tabular-nums"})]}),d.jsxs("div",{className:"flex flex-col gap-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:["Format",d.jsxs(Aw,{items:dSe,value:f,onValueChange:P=>p(P==="csv"?"csv":"json"),children:[d.jsx(Tw,{"aria-label":"Export format",children:d.jsx(Cw,{})}),d.jsxs(_w,{children:[d.jsx(Lc,{value:"json",children:"JSON"}),d.jsx(Lc,{value:"csv",children:"CSV"})]})]})]}),d.jsx(Xe,{onClick:w,disabled:h,size:"md",children:h?"Exporting…":"Export"}),h&&y!==null&&d.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:["gathered ",y.toLocaleString(),"…"]})]}),g&&d.jsx("p",{className:"px-1 text-xs text-bad",children:g}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h4",{className:"px-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Recent exports (this session)"}),b.length===0?d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-10 text-center text-xs text-muted-foreground",children:"No exports yet. Pick a type, window, and format, then export."}):d.jsx(ySe,{records:b})]})]})}function xSe({title:e,segments:t,style:n="donut",height:r=220,onSelect:i}){const o=r-64,a=O.useMemo(()=>Ju(t.map(c=>c.label),(c,f)=>{var p;return fx(c,f,(p=t[f])==null?void 0:p.color)}),[t]);function s(c){const f=t[c];f&&i&&i(Ld({label:f.label,value:f.value}))}const l=i?{onClick:(c,f)=>s(f),cursor:"pointer"}:{};if(t.length===0)return d.jsx(la,{title:e,height:o,children:d.jsx(Fd,{height:o})});if(n==="bar"){const c=[{name:"breakdown",...Object.fromEntries(t.map(f=>[f.label,f.value]))}];return d.jsx(la,{title:e,height:o,children:d.jsx(js,{config:a,children:d.jsxs(iO,{data:c,layout:"vertical",children:[d.jsx(bu,{content:d.jsx(wu,{hideLabel:!0})}),d.jsx(rw,{content:d.jsx(ow,{})}),t.map((f,p)=>d.jsx(bo,{dataKey:f.label,stackId:"a",fill:fx(f.label,p,f.color),isAnimationActive:!1,...i?{onClick:()=>s(p),cursor:"pointer"}:{}},f.label))]})})})}const u=t.map((c,f)=>({name:c.label,value:c.value,color:fx(c.label,f,c.color)}));return d.jsx(la,{title:e,height:o,children:d.jsx(js,{config:a,children:d.jsxs(vhe,{children:[d.jsx(bu,{content:d.jsx(wu,{hideLabel:!0})}),d.jsx(rw,{content:d.jsx(ow,{})}),d.jsx(xo,{data:u,dataKey:"value",nameKey:"name",innerRadius:"55%",outerRadius:"80%",isAnimationActive:!1,...l,children:u.map(c=>d.jsx(Hu,{fill:c.color},c.name))})]})})})}function bSe(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}const wSe={p50:"tint-good",p95:"tint-warn",p99:"tint-bad"};function SSe({title:e,buckets:t,p50:n,p95:r,p99:i,height:o=220,onSelect:a}){const s=[];n!==void 0&&s.push([n,"p50"]),r!==void 0&&s.push([r,"p95"]),i!==void 0&&s.push([i,"p99"]);const l=o-64,u=O.useMemo(()=>Ju(["count"],()=>"var(--live)"),[]),c=a?{onClick:(f,p)=>{const h=t[p];h&&a(Ld({label:h.label,value:h.count}))},cursor:"pointer"}:{};return d.jsx(la,{title:e,height:l,children:d.jsxs("div",{className:"flex h-full flex-col",children:[s.length>0&&d.jsx("div",{className:"mb-1.5 flex flex-wrap gap-2",children:s.map(([f,p])=>d.jsxs("span",{className:`rounded border px-1.5 text-[10px] tabular-nums ${wSe[p]}`,children:[p,": ",bSe(f)]},p))}),d.jsx("div",{className:"min-h-0 flex-1",children:t.length===0?d.jsx(Fd,{}):d.jsx(js,{config:u,children:d.jsxs(iO,{data:t,margin:{top:4,right:8,bottom:0,left:-16},children:[d.jsx(Rd,{vertical:!1}),d.jsx(so,{dataKey:"label",tickLine:!1}),d.jsx(lo,{tickLine:!1,allowDecimals:!1,width:40}),d.jsx(bu,{cursor:{fill:"color-mix(in srgb, var(--text) 5%, transparent)"},content:d.jsx(wu,{})}),d.jsx(bo,{dataKey:"count",name:"count",fill:Yi("count"),radius:[3,3,0,0],isAnimationActive:!1,...c})]})})})]})})}function OSe({title:e,value:t,min:n=0,max:r=1,label:i,color:o="var(--good)",height:a=220}){const s=r-n,l=s===0?0:Math.max(0,Math.min(1,(t-n)/s)),u=i??`${Math.round(l*100)}%`,c=a-64,f=O.useMemo(()=>Ju(["value"],()=>o,()=>e),[o,e]),p=[{value:l*100}];return d.jsx(la,{title:e,height:c,children:d.jsxs("div",{className:"relative h-full",children:[d.jsx(js,{config:f,children:d.jsxs(xhe,{innerRadius:"60%",outerRadius:"100%",data:p,startAngle:180,endAngle:0,barSize:16,children:[d.jsx(qu,{type:"number",domain:[0,100],tick:!1,axisLine:!1}),d.jsx(_d,{dataKey:"value",fill:Yi("value"),background:!0,cornerRadius:4,isAnimationActive:!1})]})}),d.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center pt-[40%]",children:d.jsx("span",{className:"text-xl font-semibold tabular-nums text-foreground",children:u})})]})})}function PSe({columns:e}){const[t,n]=O.useState(!1),r=O.useRef(null),i=e.filter(a=>a.getCanHide());if(O.useEffect(()=>{if(!t)return;function a(l){var u;l.target instanceof Node&&((u=r.current)!=null&&u.contains(l.target))||n(!1)}function s(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",s)}},[t]),i.length===0)return null;const o=i.filter(a=>!a.getIsVisible()).length;return d.jsxs("div",{className:"relative",ref:r,children:[d.jsxs(Xe,{variant:"ghost",size:"xs","aria-haspopup":"menu","aria-expanded":t,onClick:()=>n(a=>!a),className:"px-1.5 text-muted-foreground",children:["Columns",o>0?` (${i.length-o}/${i.length})`:""]}),t&&d.jsx("div",{role:"menu",className:"absolute right-0 z-20 mt-1 min-w-[10rem] rounded border border-line bg-popover p-1 shadow-lg",children:i.map(a=>d.jsxs(Xe,{role:"menuitemcheckbox","aria-checked":a.getIsVisible(),variant:"ghost",size:"xs",onClick:()=>a.toggleVisibility(),className:"w-full justify-start gap-2 normal-case tracking-normal",children:[d.jsx("span",{"aria-hidden":"true",className:a.getIsVisible()?"":"opacity-30",children:a.getIsVisible()?"☑":"☐"}),typeof a.columnDef.header=="string"?a.columnDef.header:a.id]},a.id))})]})}function jSe(e){return ESe(e)||typeof e=="function"||ASe(e)}function ESe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ASe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ya(e,t){return e==null?null:jSe(e)?D.createElement(e,t):e}function CSe(e){var t,n;if("cell"in e&&e.cell){const r=e.cell,i=r.column.columnDef,o=r,a=i;return(t=o.getIsAggregated)!=null&&t.call(o)?Ya(a.aggregatedCell??i.cell,r.getContext()):(n=o.getIsPlaceholder)!=null&&n.call(o)?null:Ya(i.cell,r.getContext())}return"header"in e&&e.header?Ya(e.header.column.columnDef.header,e.header.getContext()):"footer"in e&&e.footer?Ya(e.footer.column.columnDef.footer,e.footer.getContext()):null}function TSe({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:o,checkDirty:a,shallowPropagate:s};function r(u,c,f){const p=c.depsTail;if(p!==void 0&&p.dep===u)return;const h=p!==void 0?p.nextDep:c.deps;if(h!==void 0&&h.dep===u){h.version=f,c.depsTail=h;return}const v=u.subsTail;if(v!==void 0&&v.version===f&&v.sub===c)return;const y=c.depsTail=u.subsTail={version:f,dep:u,sub:c,prevDep:p,nextDep:h,prevSub:v,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:c.deps=y,v!==void 0?v.nextSub=y:u.subs=y}function i(u,c=u.sub){const f=u.dep,p=u.prevDep,h=u.nextDep,v=u.nextSub,y=u.prevSub;return h!==void 0?h.prevDep=p:c.depsTail=p,p!==void 0?p.nextDep=h:c.deps=h,v!==void 0?v.prevSub=y:f.subsTail=y,y!==void 0?y.nextSub=v:(f.subs=v)===void 0&&n(f),h}function o(u){let c=u.nextSub,f;e:do{const p=u.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&l(u,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const v=p.subs;if(v!==void 0){const y=(u=v).nextSub;y!==void 0&&(f={value:c,prev:f},c=y);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function a(u,c){let f,p=0,h=!1;e:do{const v=u.dep,y=v.flags;if(c.flags&16)h=!0;else if((y&17)===17){if(e(v)){const x=v.subs;x.nextSub!==void 0&&s(x),h=!0}}else if((y&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=v.deps,c=v,++p;continue}if(!h){const x=u.nextDep;if(x!==void 0){u=x;continue}}for(;p--;){const x=c.subs,g=x.nextSub!==void 0;if(g?(u=f.value,f=f.prev):u=x,h){if(e(c)){g&&s(x),c=u.sub;continue}h=!1}else c.flags&=-33;c=u.sub;const m=u.nextDep;if(m!==void 0){u=m;continue e}}return h}while(!0)}function s(u){do{const c=u.sub,f=c.flags;(f&48)===32&&(c.flags=f|16,(f&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let f=c.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}function _Se(e,t,n){var o,a,s;const r=typeof e=="object",i=r?e:void 0;return{next:(o=r?e.next:e)==null?void 0:o.bind(i),error:(a=r?e.error:t)==null?void 0:a.bind(i),complete:(s=r?e.complete:n)==null?void 0:s.bind(i)}}const Iw=[];let uh=0;const{link:iR,unlink:RSe,propagate:kSe,checkDirty:zF,shallowPropagate:oR}=TSe({update(e){return e._update()},notify(e){Iw[Dw++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,eg(e))}});let Bp=0,Dw=0,si,Lw=0;function NSe(e){try{++Lw,e()}finally{--Lw||HF()}}function eg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=RSe(n,e)}function HF(){if(!(Lw>0)){for(;Bp<Dw;){const e=Iw[Bp];Iw[Bp++]=void 0,e.notify()}Bp=0,Dw=0}}function $Se(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?0:1,get(){return si!==void 0&&iR(i,si,uh),i._snapshot},subscribe(o){const a=_Se(o),s={current:!1},l=MSe(()=>{var u;i.get(),s.current?(u=a.next)==null||u.call(a,i._snapshot):s.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(o){const a=si,s=(t==null?void 0:t.compare)??Object.is;if(n)si=i,++uh,i.depsTail=void 0;else if(o===void 0)return!1;n&&(i.flags=5);try{const l=i._snapshot,u=typeof o=="function"?o(l):o===void 0&&n?r(l):o;return l===void 0||!s(l,u)?(i._snapshot=u,!0):!1}finally{si=a,n&&(i.flags&=-5),eg(i)}}};return n?(i.flags=17,i.get=function(){const o=i.flags;if(o&16||o&32&&zF(i.deps,i)){if(i._update()){const a=i.subs;a!==void 0&&oR(a)}}else o&32&&(i.flags=o&-33);return si!==void 0&&iR(i,si,uh),i._snapshot}):i.set=function(o){if(i._update(o)){const a=i.subs;a!==void 0&&(kSe(a),oR(a),HF())}},i}function MSe(e){const t=()=>{const r=si;si=n,++uh,n.depsTail=void 0,n.flags=6;try{return e()}finally{si=r,n.flags&=-5,eg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const r=this.flags;r&16||r&32&&zF(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,eg(this)}};return t(),n}function of(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=aR(e);if(n.length!==aR(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function aR(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function ISe(e,t){return e===t}function VF(e,t=r=>r,n){const r=(n==null?void 0:n.compare)??ISe,i=O.useCallback(a=>{const{unsubscribe:s}=e.subscribe(a);return s},[e]),o=O.useCallback(()=>e.get(),[e]);return _L.useSyncExternalStoreWithSelector(i,o,o,t,r)}function DSe(e){const t=VF(e.source,e.selector,{compare:of});return typeof e.children=="function"?e.children(t):e.children}function LSe(e){const t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),"set"in e&&(t.setState=e.set.bind(e)),t}function FSe(e){const{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw new Error("Feature not supported in current reactivity implementation")},unmount:()=>{throw new Error("Feature not supported in current reactivity implementation")},schedule:e.schedule??(i=>queueMicrotask(i)),batch:n,untrack:i=>i(),createReadonlyAtom:(i,o)=>{const a=(o==null?void 0:o.compare)??Object.is;let s=!1,l;const u=()=>{const f=i();return(!s||!a(l,f))&&(l=f,s=!0),l},c=t(()=>(r.get(),u()),{compare:a});return{get:u,subscribe:c.subscribe.bind(c)}},createWritableAtom:(i,o)=>t(i,{compare:o==null?void 0:o.compare}),commit:()=>{r.set(i=>i+1)}}}function BSe(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:i=>{r=i,n=!0},subscribe:i=>e.subscribe(o=>{(!n||!t(r,o))&&i(o)})}}function USe(){return FSe({createAtom:$Se,batch:NSe})}function Zu(e,t){return typeof e=="function"?e(t):e}function co(e){if(Array.isArray(e))return e.map(co);if(e&&typeof e=="object"){const t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;const n=t===null?Cn():{},r=Object.keys(e);for(let i=0;i<r.length;i++){const o=r[i];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,value:co(e[o]),writable:!0})}return n}return e}function Cn(){return Object.create(null)}function By(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eP(e,t){return n=>{var r;(((r=t.options.atoms)==null?void 0:r[e])??t.baseAtoms[e]).set(i=>Zu(n,i))}}function sR(e){if(typeof e!="object"||e===null)return!1;if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function lR(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}const zSe=3;function HSe(e,t){return WF(e,t,zSe)}function WF(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!sR(e)||!sR(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;const r=lR(e),i=lR(t);if(r.length!==i.length)return!1;const o=e,a=t;for(let s=0;s<r.length;s++){const l=r[s];if(!Object.prototype.propertyIsEnumerable.call(t,l)||!WF(o[l],a[l],n-1))return!1}return!0}function ec(e,t,n,r=HSe){const i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,o=e.options[i];o&&o(a=>{const s=Zu(n,a);return r(a,s)?a:s})}function KF(e){return e instanceof Function}function VSe(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a.length&&r(a)})};return r(e),n}const WSe=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:o})=>{let a=[],s;return u=>{i==null||i();const c=t==null?void 0:t(u);let f=!c||c.length!==(a==null?void 0:a.length);if(!f&&c){for(let p=0;p<c.length;p++)if(c[p]!==a[p]){f=!0;break}}return n==null||n(f),f&&(a=c,o==null||o(),s=e(...c??[]),r==null||r(s)),s}};function KSe(e){let t=!1;return()=>{if(!t){t=!0;return}e()}}function tP({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...o}){const a=()=>{if(!r)return;const{schedule:l,untrack:u}=i._reactivity;l(()=>u(()=>r()))};return WSe({...o,...{onAfterUpdate:()=>{a()}}})}function qF(e,t="_"){const[n,r]=e.split(t);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function Ca(e,t,n){for(const[r,{fn:i,memoDeps:o}]of Object.entries(n)){const{fnKey:a,fnName:s}=qF(r);t[a]=o?tP({memoDeps:o,fn:i,fnName:s,table:t,feature:e}):i}}function ya(e,t,n,r){for(const[i,{fn:o,memoDeps:a}]of Object.entries(r)){const{fnKey:s,fnName:l}=qF(i);if(a){const u=`_memo_${s}`;t[s]=function(...c){if(!this[u]){const f=this;this[u]=tP({memoDeps:p=>a(f,p),fn:(...p)=>o(f,...p),fnName:l,objectId:f.id,table:n,feature:e})}return this[u](...c)}}else t[s]=function(...u){return o(this,...u)}}}function fn(e,t,n,...r){var i;return((i=e[t])==null?void 0:i.call(e,...r))??n(e,...r)}function qSe(e){return e.row.getValue(e.column.id)}function GSe(e){return e.getValue()??e.table.options.renderFallbackValue}function XSe(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}const YSe={assignCellPrototype:(e,t)=>{ya("coreCellsFeature",e,t,{cell_getValue:{fn:n=>qSe(n)},cell_renderValue:{fn:n=>GSe(n)},cell_getContext:{fn:n=>XSe(n),memoDeps:n=>[n]}})}};function QSe(e){var t,n;if(!e._headerPrototype){e._headerPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignHeaderPrototype)==null||n.call(t,e._headerPrototype,e)}return e._headerPrototype}function GF(e,t,n){const r=QSe(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];const o=e._headerInstanceInitFns;for(let a=0;a<o.length;a++)o[a](i);return i}function XF(){return{start:[],end:[]}}function JSe(){return Cn()}function YF(e,t){tg(e)&&Uy(e.table,n=>{const r=Object.assign(Cn(),n),i=t??!fn(e,"getIsVisible",Jn),o=e.getLeafColumns();for(let a=0;a<o.length;a++){const s=o[a];tg(s)&&(r[s.id]=i)}return r})}function Jn(e){var r;const t=(r=e.table.atoms.columnVisibility)==null?void 0:r.get();if(!t)return!0;const n=e.columns;return n.length?n.some(i=>fn(i,"getIsVisible",Jn)):(By(t,e.id)?t[e.id]:void 0)??!0}function tg(e){return(e.columnDef.enableHiding??!0)&&(e.table.options.enableHiding??!0)}function ZSe(e){return t=>{YF(e,t.target.checked)}}function e1e(e){var u;const t=e.getAllCells(),n=[];for(let c=0;c<t.length;c++){const f=t[c];fn(f.column,"getIsVisible",Jn)&&n.push(f)}const{start:r,end:i}=((u=e.table.atoms.columnPinning)==null?void 0:u.get())??XF();if(!r.length&&!i.length)return n;const o=fn(e,"getVisibleCellsByColumnId",QF),a=[];for(let c=0;c<r.length;c++){const f=o[r[c]];f&&a.push(f)}const s=[];for(let c=0;c<i.length;c++){const f=o[i[c]];f&&s.push(f)}const l=[];for(let c=0;c<n.length;c++){const f=n[c],p=f.column.id;!r.includes(p)&&!i.includes(p)&&l.push(f)}return[...a,...l,...s]}function QF(e){const t=Cn(),n=e.getAllCells();for(let r=0;r<n.length;r++){const i=n[r];fn(i.column,"getIsVisible",Jn)&&(t[i.column.id]=i)}return t}function t1e(e){return e.getAllFlatColumns().filter(t=>fn(t,"getIsVisible",Jn))}function JF(e){return e.getAllLeafColumns().filter(t=>fn(t,"getIsVisible",Jn))}function Uy(e,t){ec(e,"columnVisibility",t)}function n1e(e,t){Uy(e,t?Cn():Object.assign(Cn(),co(e.initialState.columnVisibility??{})))}function ZF(e,t){t=t??!eB(e);const n=Cn(),r=e.getAllLeafColumns();for(let i=0;i<r.length;i++){const o=r[i];n[o.id]=t||!tg(o)}Uy(e,n)}function eB(e){return!e.getAllLeafColumns().some(t=>!fn(t,"getIsVisible",Jn))}function r1e(e){return e.getAllLeafColumns().some(t=>fn(t,"getIsVisible",Jn))}function i1e(e){return t=>{ZF(e,t.target.checked)}}function tB(e,t=1){let n=t;for(let r=0;r<e.length;r++){const i=e[r];fn(i,"getIsVisible",Jn)&&i.columns.length&&(n=Math.max(n,tB(i.columns,t+1)))}return n}function o1e(e,t){return String(t)}function a1e(e,t,n,r){let i=e??"";return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function s1e(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function nB(e,t,n,r,i,o){const a={depth:t,id:o1e(r,t),headers:[]},s=[];for(let l=0;l<e.length;l++){if(!(l in e))continue;const u=e[l],c=s[s.length-1],f=u.column.depth===a.depth;let p,h=!1;if(f&&u.column.parent?p=u.column.parent:(p=u.column,h=!0),c&&c.column===p)c.subHeaders.push(u);else{const v=GF(n,p,{id:a1e(r,t,p.id,u.id),isPlaceholder:h,placeholderId:h?String(s1e(s,p)):void 0,depth:t,index:s.length});v.subHeaders.push(u),s.push(v)}a.headers.push(u),u.headerGroup=a}for(let l=0;l<o.length;l++)o[l](a);i.push(a),t>0&&nB(s,t-1,n,r,i,o)}function rB(e){for(let t=0;t<e.length;t++){const n=e[t];if(!fn(n.column,"getIsVisible",Jn))continue;let r=0;if(n.subHeaders.length){rB(n.subHeaders);for(let i=0;i<n.subHeaders.length;i++){const o=n.subHeaders[i];fn(o.column,"getIsVisible",Jn)&&(r+=o.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let i=1,o=n.subHeaders[0];for(;o;)o.rowSpan=0,i++,o=o.subHeaders.length===1&&o.subHeaders[0].column===n.column?o.subHeaders[0]:void 0;n.rowSpan=i}else n.rowSpan=1}}function uR(e,t,n,r){var l;const i=tB(e),o=[],a=n._headerGroupInstanceInitFns,s=new Array(t.length);for(let u=0;u<t.length;u++)u in t&&(s[u]=GF(n,t[u],{depth:i,index:u}));return nB(s,i-1,n,r,o,a),o.reverse(),rB(((l=o[0])==null?void 0:l.headers)??[]),o}function l1e(e){var t,n;if(!e._columnPrototype){e._columnPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignColumnPrototype)==null||n.call(t,e._columnPrototype,e)}return e._columnPrototype}function u1e(e,t,n,r){const i={...e.getDefaultColumnDef(),...t},o=i.accessorKey,a=o===void 0?void 0:String(o),s=i.id??(a==null?void 0:a.replaceAll(".","_"))??(typeof i.header=="string"?i.header:void 0);let l;if(i.accessorFn)l=i.accessorFn;else if(o!==void 0)if(typeof o=="string"&&o.includes(".")){const p=o.split(".");l=h=>{let v=h;for(let y=0;y<p.length;y++){const x=p[y];v=v==null?void 0:v[x]}return v}}else l=p=>p[i.accessorKey];if(!s)throw new Error;const u=l1e(e),c=Object.create(u);c.accessorFn=l,c.columnDef=i,c.columns=[],c.depth=n,c.id=`${String(s)}`,c.parent=r;const f=e._columnInstanceInitFns;for(let p=0;p<f.length;p++)f[p](c);return c}function iB(e){var n;const t=(n=e.atoms.columnOrder)==null?void 0:n.get();return r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const o=new Map;for(let a=0;a<r.length;a++){const s=r[a];o.set(s.id,s)}for(let a=0;a<t.length;a++){const s=t[a],l=o.get(s);l&&(i.push(l),o.delete(s))}for(let a=0;a<r.length;a++){const s=r[a];o.has(s.id)&&i.push(s)}}return c1e(e,i)}}function c1e(e,t){var s;const n=((s=e.atoms.grouping)==null?void 0:s.get())??[],{groupedColumnMode:r}=e.options;if(!n.length||!r)return t;const i=t.filter(l=>!n.includes(l.id));if(r==="remove")return i;const o=new Map;for(let l=0;l<t.length;l++){const u=t[l];o.set(u.id,u)}const a=[];for(let l=0;l<n.length;l++){const u=o.get(n[l]);u&&a.push(u)}return[...a,...i]}function f1e(e){return[e,...e.columns.flatMap(t=>t.getFlatColumns())]}function d1e(e){if(e.columns.length){const t=e.columns.flatMap(n=>n.getLeafColumns());return fn(e.table,"getOrderColumns",iB)(t)}return[e]}function p1e(e){return{header:t=>{const n=t.header.column.columnDef;return n.accessorKey?n.accessorKey:n.accessorFn?n.id:null},cell:t=>{var n,r;return((r=(n=t.renderValue())==null?void 0:n.toString)==null?void 0:r.call(n))??null},...Object.values(e._features).reduce((t,n)=>{var r;return Object.assign(t,(r=n.getDefaultColumnDef)==null?void 0:r.call(n))},{}),...e.options.defaultColumn}}function oB(e,t,n,r=0){const i=new Array(t.length);for(let o=0;o<t.length;o++){if(!(o in t))continue;const a=t[o],s=u1e(e,a,r,n),l=a;s.columns=l.columns?oB(e,l.columns,s,r+1):[],i[o]=s}return i}function h1e(e){return oB(e,e.options.columns)}function m1e(e){return e.getAllColumns().flatMap(t=>t.getFlatColumns())}function g1e(e){const t=Cn(),n=e.getAllFlatColumns();for(let r=0;r<n.length;r++){const i=n[r];t[i.id]=i}return t}function y1e(e){const t=e.getAllColumns().flatMap(n=>n.getLeafColumns());return fn(e,"getOrderColumns",iB)(t)}function v1e(e){const t=Cn(),n=e.getAllLeafColumns();for(let r=0;r<n.length;r++){const i=n[r];t[i.id]=i}return t}function x1e(e,t){return e.getAllFlatColumnsById()[t]}const b1e={assignColumnPrototype:(e,t)=>{ya("coreColumnsFeature",e,t,{column_getFlatColumns:{fn:n=>f1e(n),memoDeps:n=>[n.table.options.columns]},column_getLeafColumns:{fn:n=>d1e(n),memoDeps:n=>{var r,i;return[(r=n.table.atoms.columnOrder)==null?void 0:r.get(),(i=n.table.atoms.grouping)==null?void 0:i.get(),n.table.options.columns,n.table.options.groupedColumnMode]}}})},constructTableAPIs:e=>{Ca("coreColumnsFeature",e,{table_getDefaultColumnDef:{fn:()=>p1e(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>h1e(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>m1e(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>g1e(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>y1e(e),memoDeps:()=>{var t,n;return[(t=e.atoms.columnOrder)==null?void 0:t.get(),(n=e.atoms.grouping)==null?void 0:n.get(),e.options.columns,e.options.groupedColumnMode]}},table_getAllLeafColumnsById:{fn:()=>v1e(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>x1e(e,t)}})}};function aB(e,t){for(let n=0;n<e.subHeaders.length;n++)aB(e.subHeaders[n],t);t.push(e)}function w1e(e){const t=[];return aB(e,t),t}function S1e(e){return{column:e.column,header:e,table:e.column.table}}function O1e(e){var u;const{start:t,end:n}=((u=e.atoms.columnPinning)==null?void 0:u.get())??XF(),r=e.getAllColumns(),i=fn(e,"getVisibleLeafColumns",JF);if(!t.length&&!n.length)return uR(r,i,e);const o=e.getAllLeafColumnsById(),a=[];for(let c=0;c<t.length;c++){const f=o[t[c]];f&&fn(f,"getIsVisible",Jn)&&a.push(f)}const s=[];for(let c=0;c<n.length;c++){const f=o[n[c]];f&&fn(f,"getIsVisible",Jn)&&s.push(f)}const l=i.filter(c=>!t.includes(c.id)&&!n.includes(c.id));return uR(r,[...a,...l,...s],e)}function P1e(e){return[...e.getHeaderGroups()].reverse()}function j1e(e){const t=e.getHeaderGroups(),n=[];for(let r=0;r<t.length;r++){const i=t[r].headers;for(let o=0;o<i.length;o++)n.push(i[o])}return n}function E1e(e){var r;const t=((r=e.getHeaderGroups()[0])==null?void 0:r.headers)??[],n=[];for(let i=0;i<t.length;i++){const o=t[i].getLeafHeaders();for(let a=0;a<o.length;a++)n.push(o[a])}return n}const A1e={assignHeaderPrototype:(e,t)=>{ya("coreHeadersFeature",e,t,{header_getLeafHeaders:{fn:n=>w1e(n),memoDeps:n=>[n.column.table.options.columns]},header_getContext:{fn:n=>S1e(n),memoDeps:n=>[n.column.table.options.columns]}})},constructTableAPIs:e=>{Ca("coreHeadersFeature",e,{table_getHeaderGroups:{fn:()=>O1e(e),memoDeps:()=>{var t,n,r,i;return[e.options.columns,(t=e.atoms.columnOrder)==null?void 0:t.get(),(n=e.atoms.grouping)==null?void 0:n.get(),(r=e.atoms.columnPinning)==null?void 0:r.get(),(i=e.atoms.columnVisibility)==null?void 0:i.get(),e.options.groupedColumnMode]}},table_getFooterGroups:{fn:()=>P1e(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>j1e(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>E1e(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function C1e(e){var t,n;if(!e._rowPrototype){e._rowPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignRowPrototype)==null||n.call(t,e._rowPrototype,e)}return e._rowPrototype}const T1e=(e,t,n,r,i,o,a)=>{const s=C1e(e),l=Object.create(s);l._displayIndexCache=-1,l._uniqueValuesCache=Cn(),l._valuesCache=Cn(),l.depth=i,l.id=t,l.index=r,l.original=n,l.parentId=a,l.subRows=[];const u=e._rowInstanceInitFns;for(let c=0;c<u.length;c++)u[c](l);return l},_1e=/([0-9]+)/gm;function tc(e){const t=Object.assign((n,r,i)=>{let o=n.getValue(i),a=r.getValue(i);const s=t.resolveDataValue;return s&&(o=s(o),a=s(a)),t.sort(o,a,n,r,i)},e);return t}tc({resolveDataValue:e=>zy(e).toLowerCase(),sort:(e,t)=>lB(e,t)});tc({resolveDataValue:e=>zy(e),sort:(e,t)=>lB(e,t)});tc({resolveDataValue:e=>zy(e).toLowerCase(),sort:(e,t)=>nP(e,t)});tc({resolveDataValue:e=>zy(e),sort:(e,t)=>nP(e,t)});tc({resolveDataValue:e=>R1e(e),sort:(e,t)=>e>t?1:e<t?-1:0});const sB=tc({sort:(e,t)=>nP(e,t)});function nP(e,t){return e===t?0:e>t?1:-1}function R1e(e){return e instanceof Date?e.getTime():e}function zy(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function lB(e,t){let n=0,r=0;const i=e.length,o=t.length;for(;n<i&&r<o;){const a=ng(e.charCodeAt(n)),s=ng(t.charCodeAt(r)),l=Fw(e,n,a),u=Fw(t,r,s);if(!a&&!s){const f=k1e(e,n,l,t,r,u);if(f)return f;n=l,r=u;continue}if(a!==s)return a?1:-1;const c=N1e(e,n,l,t,r,u);if(c)return c;n=l,r=u}return fR(e,n)-fR(t,r)}function ng(e){return e>=48&&e<=57}function Fw(e,t,n){let r=t+1;for(;r<e.length&&ng(e.charCodeAt(r))===n;)r++;return r}function k1e(e,t,n,r,i,o){const a=n-t,s=o-i,l=a<s?a:s;for(let u=0;u<l;u++){const c=e.charCodeAt(t+u),f=r.charCodeAt(i+u);if(c>f)return 1;if(f>c)return-1}return a>s?1:s>a?-1:0}function N1e(e,t,n,r,i,o){let a=t;for(;a<n&&e.charCodeAt(a)===48;)a++;let s=i;for(;s<o&&r.charCodeAt(s)===48;)s++;const l=n-a,u=o-s;if(l===0&&u===0)return 0;if(l<=15&&u<=15){const p=cR(e,a,n),h=cR(r,s,o);return p>h?1:h>p?-1:0}const c=parseInt(e.slice(t,n),10),f=parseInt(r.slice(i,o),10);return c>f?1:f>c?-1:0}function cR(e,t,n){let r=0;for(let i=t;i<n;i++)r=r*10+e.charCodeAt(i)-48;return r}function fR(e,t){let n=0,r=t;for(;r<e.length;)n++,r=Fw(e,r,ng(e.charCodeAt(r)));return n}function $1e(){return[]}function M1e(e,t){ec(e,"cellSelection",co(e.initialState.cellSelection)??$1e())}function I1e(e){e.atoms.cellSelection&&(e.options.autoResetAll??e.options.autoResetCellSelection??!0)&&e._reactivity.schedule(()=>M1e(e))}function D1e(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>L1e(e))}function L1e(e,t){const n=e.initialState.expanded;ec(e,"expanded",n===!0?!0:Object.assign(Cn(),co(n??{})))}const Bw=0;function F1e(e){var t,n;if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((((n=(t=e.atoms.pagination)==null?void 0:t.get())==null?void 0:n.pageIndex)??Bw)===Bw)return;z1e(e)}}function B1e(e,t){ec(e,"pagination",t)}function U1e(e,t){B1e(e,n=>{let r=Zu(t,n.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})}function z1e(e,t){U1e(e,Bw)}function H1e(){return[]}function Hy(e,t){ec(e,"sorting",t)}function uB(e,t){Hy(e,t?[]:co(e.initialState.sorting??[]))}function V1e(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&uB(e)}function cB(e){const t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10);let r,i=!1;for(let o=0;o<n.length;o++){const a=n[o].getValue(e.id);if(Object.prototype.toString.call(a)==="[object Date]"){r="datetime";break}if(typeof a=="string"&&(i=!0,a.split(_1e).length>1)){r="alphanumeric";break}}if(!r&&i&&(r="text"),r){let o=t==null?void 0:t[r];if(o||r==="alphanumeric"&&(o=t==null?void 0:t.text),o)return o}return sB}function fB(e){const t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){const r=t[n].getValue(e.id);if(r!=null)return typeof r=="string"?"asc":"desc"}return"desc"}function W1e(e){const t=e.table._rowModelFns.sortFns;return KF(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn==="auto"?cB(e):(t==null?void 0:t[e.columnDef.sortFn])??sB}function dB(e,t,n){const r=hB(e,n&&rg(e)),i=typeof t<"u";Hy(e.table,o=>{const a=o.findIndex(p=>p.id===e.id),s=a===-1?void 0:o[a];let l=[],u;const c=i?t:r==="desc",f=!!(o.length&&rg(e)&&n);return f?s?u="toggle":u="add":s?u="toggle":u="replace",u==="toggle"&&(i||r||(u="remove")),u==="add"?(l=[...o,{id:e.id,desc:c}],l.splice(0,l.length-(e.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?l=f?o.map(p=>p.id===e.id?{...p,desc:c}:p):[{id:e.id,desc:c}]:u==="remove"?l=f?o.filter(p=>p.id!==e.id):[]:l=[{id:e.id,desc:c}],l})}function pB(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??fB(e)==="desc"?"desc":"asc"}function hB(e,t){const n=pB(e),r=gB(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r==="desc"?"asc":"desc":n}function mB(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function rg(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function gB(e){var n,r;const t=(r=(n=e.table.atoms.sorting)==null?void 0:n.get())==null?void 0:r.find(i=>i.id===e.id);return t?t.desc?"desc":"asc":!1}function K1e(e){var t,n;return((n=(t=e.table.atoms.sorting)==null?void 0:t.get())==null?void 0:n.findIndex(r=>r.id===e.id))??-1}function q1e(e){Hy(e.table,t=>t.length?t.filter(n=>n.id!==e.id):[])}function G1e(e){const t=mB(e);return n=>{var r,i;t&&dB(e,void 0,rg(e)?(i=(r=e.table.options).isMultiSortEvent)==null?void 0:i.call(r,n):!1)}}function X1e(){return e=>tP({feature:"coreRowModelsFeature",table:e,fnName:"table.getCoreRowModel",memoDeps:()=>[e.options.data],fn:()=>Y1e(e,e.options.data),onAfterUpdate:KSe(()=>{D1e(e),F1e(e),V1e(e),I1e(e)})})}function yB(e,t,n,r=0,i){var a;const o=[];for(let s=0;s<n.length;s++){const l=n[s],u=T1e(e,e.getRowId(l,s,i),l,s,r,void 0,i==null?void 0:i.id);t.flatRows.push(u),t.rowsById[u.id]=u,o.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(l,s),(a=u.originalSubRows)!=null&&a.length&&(u.subRows=yB(e,t,u.originalSubRows,r+1,u)))}return o}function Y1e(e,t){const n={rows:[],flatRows:[],rowsById:Cn()};return n.rows=yB(e,n,t),n}function Q1e(e){var t,n;return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=((n=(t=e.options.features).coreRowModel)==null?void 0:n.call(t,e))??X1e()(e)),e._rowModels.coreRowModel()}function J1e(e){return e.getCoreRowModel()}function Z1e(e){var t,n;return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=(n=(t=e.options.features).filteredRowModel)==null?void 0:n.call(t,e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function eOe(e){return e.getFilteredRowModel()}function tOe(e){var t,n;return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=(n=(t=e.options.features).groupedRowModel)==null?void 0:n.call(t,e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function nOe(e){return e.getGroupedRowModel()}function rOe(e){var t,n;return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=(n=(t=e.options.features).sortedRowModel)==null?void 0:n.call(t,e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function iOe(e){return e.getSortedRowModel()}function oOe(e){var t,n;return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=(n=(t=e.options.features).expandedRowModel)==null?void 0:n.call(t,e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function aOe(e){return e.getExpandedRowModel()}function sOe(e){var t,n;return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=(n=(t=e.options.features).paginatedRowModel)==null?void 0:n.call(t,e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function lOe(e){return e.getPaginatedRowModel()}const uOe={constructTableAPIs:e=>{Ca("coreRowModelsFeature",e,{table_getCoreRowModel:{fn:()=>Q1e(e)},table_getPreFilteredRowModel:{fn:()=>J1e(e)},table_getFilteredRowModel:{fn:()=>Z1e(e)},table_getPreGroupedRowModel:{fn:()=>eOe(e)},table_getGroupedRowModel:{fn:()=>tOe(e)},table_getPreSortedRowModel:{fn:()=>nOe(e)},table_getSortedRowModel:{fn:()=>rOe(e)},table_getPreExpandedRowModel:{fn:()=>iOe(e)},table_getExpandedRowModel:{fn:()=>oOe(e)},table_getPrePaginatedRowModel:{fn:()=>aOe(e)},table_getPaginatedRowModel:{fn:()=>sOe(e)},table_getRowModel:{fn:()=>lOe(e)}})}};function cOe(e){var t,n;if(!e._cellPrototype){e._cellPrototype={table:e};const r=Object.values(e._features);for(let i=0;i<r.length;i++)(n=(t=r[i]).assignCellPrototype)==null||n.call(t,e._cellPrototype,e)}return e._cellPrototype}function fOe(e,t,n){const r=cOe(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;const o=n._cellInstanceInitFns;for(let a=0;a<o.length;a++)o[a](i);return i}function dOe(e){const t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function pOe(e){const t=e.getPrePaginatedRowModel().rows;if(e.options.paginateExpandedRows===!1){const n=[],r=i=>{var o;i._displayIndexCache=n.length,n.push(i),i.subRows.length&&((o=i.getIsExpanded)!=null&&o.call(i))&&i.subRows.forEach(r)};return t.forEach(r),n}for(let n=0;n<t.length;n++)t[n]._displayIndexCache=n;return t}function hOe(e,t){if(By(e._valuesCache,t))return e._valuesCache[t];const n=e.table.getColumn(t);if(n!=null&&n.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function mOe(e,t){if(By(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];const n=e.table.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function gOe(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function yOe(e){return VSe(e.subRows,t=>t.subRows)}function vOe(e){const t=e.getCoreRowModel().flatRows;let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,t[r].depth);return n}function xOe(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function bOe(e){const t=[];let n=e;for(;;){const r=n.getParentRow();if(!r)break;t.push(r),n=r}return t.reverse()}function wOe(e){const t=e.table.getAllLeafColumns();let n=e._cellsCache;n||(n=e._cellsCache=new WeakMap);const r=new Array(t.length);for(let i=0;i<t.length;i++){const o=t[i];let a=n.get(o);a||(a=fOe(o,e,e.table),n.set(o,a)),r[i]=a}return r}function SOe(e){const t=Cn(),n=e.getAllCells();for(let r=0;r<n.length;r++){const i=n[r];t[i.column.id]=i}return t}function OOe(e,t,n,r){var i,o;return((o=(i=t.options).getRowId)==null?void 0:o.call(i,e,n,r))??(r?`${r.id}.${n}`:String(n))}function POe(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw new Error;return r}const jOe={assignRowPrototype:(e,t)=>{ya("coreRowsFeature",e,t,{row_getDisplayIndex:{fn:n=>dOe(n)},row_getAllCellsByColumnId:{fn:n=>SOe(n),memoDeps:n=>[n.getAllCells()]},row_getAllCells:{fn:n=>wOe(n),memoDeps:n=>[n.table.getAllLeafColumns()]},row_getLeafRows:{fn:n=>yOe(n),memoDeps:n=>[n.subRows]},row_getParentRow:{fn:n=>xOe(n)},row_getParentRows:{fn:n=>bOe(n)},row_getUniqueValues:{fn:(n,r)=>mOe(n,r)},row_getValue:{fn:(n,r)=>hOe(n,r)},row_renderValue:{fn:(n,r)=>gOe(n,r)}})},constructTableAPIs:e=>{Ca("coreRowsFeature",e,{table_getRowsInDisplayOrder:{fn:()=>pOe(e),memoDeps:()=>{var t;return[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?(t=e.atoms.expanded)==null?void 0:t.get():void 0]}},table_getRowId:{fn:(t,n,r)=>OOe(t,e,n,r)},table_getRow:{fn:(t,n)=>POe(e,t,n)},table_getMaxSubRowDepth:{fn:()=>vOe(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function vB(e,t,n=(r,i)=>r===i){const r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(const i in r){const o=e.baseAtoms[i];if(!o)continue;const a=r[i],s=a===void 0?e.initialState[i]:a;n(e._reactivity.untrack(()=>o.get()),s)||o.set(()=>s)}})}function xB(e,t,n=(r,i)=>r===i){e._reactivity.batch(()=>{var r,i;vB(e,t,n),(i=(r=e._reactivity).commit)==null||i.call(r)})}function EOe(e){var r,i;const t=co(e.initialState);e._reactivity.batch(()=>{const o=Object.keys(t);for(let a=0;a<o.length;a++){const s=o[a];e.baseAtoms[s].set(t[s])}});const n=Object.values(e._features);for(let o=0;o<n.length;o++)(i=(r=n[o]).resetTableInstanceData)==null||i.call(r,e)}function AOe(e,t){const{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};const o=e.options.mergeOptions(e.options,t),a={...Object.getOwnPropertyDescriptors(o)};return Object.defineProperties(Object.create(Object.getPrototypeOf(o)),{...a,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function bB(e,t,n){const r=AOe(e,Zu(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,(n==null?void 0:n.syncExternalState)!==!1&&xB(e,r.state??null)}const COe={constructTableAPIs:e=>{Ca("coreTablesFeature",e,{table_reset:{fn:()=>EOe(e)},table_setOptions:{fn:t=>bB(e,t)}})}},TOe={coreCellsFeature:YSe,coreColumnsFeature:b1e,coreHeadersFeature:A1e,coreRowModelsFeature:uOe,coreRowsFeature:jOe,coreTablesFeature:COe};function _Oe(e,t={}){return Object.values(e).forEach(n=>{var r;t=((r=n.getInitialState)==null?void 0:r.call(n,t))??t}),co(t)}function ROe(e){var P,j;const t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:o,facetedMinMaxValues:a,facetedRowModel:s,facetedUniqueValues:l,filterFns:u,filterMeta:c,filteredRowModel:f,groupedRowModel:p,paginatedRowModel:h,sortFns:v,sortedRowModel:y,tableMeta:x,...g}=e.features,m={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...TOe,...g},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:u,sortFns:v},_rowModels:{},atoms:{},baseAtoms:{}},b=Object.values(m._features),S={...b.reduce((E,A)=>{var C;return Object.assign(E,(C=A.getDefaultTableOptions)==null?void 0:C.call(A,m))},{}),...e};if(t.wrapExternalAtoms&&S.atoms)for(const[E,A]of Object.entries(S.atoms)){const C=A,T=t.createWritableAtom(C.get(),{debugName:`externalAtom/${E}`});S.atoms[E]=T;let _=!1;const R=C.subscribe(N=>{_||T.set(N)}),$=T.subscribe(N=>{_=!0,C.set(N),_=!1});t.addSubscription(R),t.addSubscription($)}t.createOptionsStore?(m.optionsStore=t.createWritableAtom(S,{debugName:"table/optionsStore"}),Object.defineProperty(m,"options",{configurable:!0,enumerable:!0,get(){return m.optionsStore.get()},set(E){m.optionsStore.set(()=>E)}})):m.options=S,m.initialState=_Oe(m._features,m.options.initialState);const w=Object.keys(m.initialState);for(let E=0;E<w.length;E++){const A=w[E];m.baseAtoms[A]=t.createWritableAtom(m.initialState[A],{debugName:`table/baseAtoms/${A}`}),m.atoms[A]=t.createReadonlyAtom(()=>{var $;const C=m.options,T=($=C.atoms)==null?void 0:$[A],_=T?T.get():m.baseAtoms[A].get();if(T)return _;const R=C.state;if(R&&By(R,A)){const N=R[A];return N===void 0?m.initialState[A]:N}return _},{debugName:`table/atoms/${A}`})}vB(m),m.store=LSe(t.createReadonlyAtom(()=>{const E={};for(let A=0;A<w.length;A++){const C=w[A];E[C]=m.atoms[C].get()}return E},{compare:of,debugName:"table/store"}));for(let E=0;E<b.length;E++){const A=b[E];(P=A.initTableInstanceData)==null||P.call(A,m),A.initCellInstanceData&&m._cellInstanceInitFns.push(A.initCellInstanceData.bind(A)),A.initColumnInstanceData&&m._columnInstanceInitFns.push(A.initColumnInstanceData.bind(A)),A.initHeaderGroupInstanceData&&m._headerGroupInstanceInitFns.push(A.initHeaderGroupInstanceData.bind(A)),A.initHeaderInstanceData&&m._headerInstanceInitFns.push(A.initHeaderInstanceData.bind(A)),A.initRowInstanceData&&m._rowInstanceInitFns.push(A.initRowInstanceData.bind(A)),(j=A.constructTableAPIs)==null||j.call(A,m)}return m}function kOe(){return[]}function wB(e){const t=e.table._rowModelFns.filterFns,n=e.table.getCoreRowModel().flatRows;let r;for(let a=0;a<n.length;a++){const s=n[a].getValue(e.id);if(s!=null){r=s;break}}let i;return typeof r=="string"?i="includesString":typeof r=="number"?i="inNumberRange":typeof r=="boolean"?i="equals":Array.isArray(r)?i="arrIncludes":Object.prototype.toString.call(r)==="[object Date]"?i="inDateRange":r!==null&&typeof r=="object"?i="equals":i="weakEquals",t==null?void 0:t[i]}function rP(e){let t=null;const n=e.table._rowModelFns.filterFns;return t=KF(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?wB(e):n==null?void 0:n[e.columnDef.filterFn],t??void 0}function NOe(e){return(e.columnDef.enableColumnFilter??!0)&&(e.table.options.enableColumnFilters??!0)&&(e.table.options.enableFilters??!0)&&!!e.accessorFn}function $Oe(e){return SB(e)>-1}function MOe(e){var t,n,r;return(r=(n=(t=e.table.atoms.columnFilters)==null?void 0:t.get())==null?void 0:n.find(i=>i.id===e.id))==null?void 0:r.value}function SB(e){var t,n;return((n=(t=e.table.atoms.columnFilters)==null?void 0:t.get())==null?void 0:n.findIndex(r=>r.id===e.id))??-1}function IOe(e,t){iP(e.table,n=>{const r=rP(e),i=n.find(s=>s.id===e.id),o=Zu(t,i?i.value:void 0);if(OB(r,o,e))return n.filter(s=>s.id!==e.id);const a={id:e.id,value:o};return i?n.map(s=>s.id===e.id?a:s):n.length?[...n,a]:[a]})}function iP(e,t){const n=e.getAllLeafColumnsById();ec(e,"columnFilters",i=>Zu(t,i).filter(o=>{const a=n[o.id];return!(a&&OB(rP(a),o.value,a))}))}function DOe(e,t){iP(e,t?[]:co(e.initialState.columnFilters??[]))}function OB(e,t,n){return typeof t>"u"?!0:e!=null&&e.autoRemove?!!e.autoRemove(t,n):typeof t=="string"&&!t}const LOe={getInitialState:e=>({columnFilters:kOe(),...e}),getDefaultColumnDef:()=>({filterFn:"auto"}),getDefaultTableOptions:e=>({onColumnFiltersChange:eP("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),assignColumnPrototype:(e,t)=>{ya("columnFilteringFeature",e,t,{column_getAutoFilterFn:{fn:n=>wB(n)},column_getFilterFn:{fn:n=>rP(n)},column_getCanFilter:{fn:n=>NOe(n)},column_getIsFiltered:{fn:n=>$Oe(n)},column_getFilterValue:{fn:n=>MOe(n)},column_getFilterIndex:{fn:n=>SB(n)},column_setFilterValue:{fn:(n,r)=>IOe(n,r)}})},initRowInstanceData:e=>{e.columnFilters=Cn(),e.columnFiltersMeta=Cn()},constructTableAPIs:e=>{Ca("columnFilteringFeature",e,{table_setColumnFilters:{fn:t=>iP(e,t)},table_resetColumnFilters:{fn:t=>DOe(e,t)}})}},FOe={getInitialState:e=>({columnVisibility:JSe(),...e}),getDefaultTableOptions:e=>({onColumnVisibilityChange:eP("columnVisibility",e)}),assignColumnPrototype:(e,t)=>{ya("columnVisibilityFeature",e,t,{column_getIsVisible:{fn:n=>Jn(n),memoDeps:n=>{var r;return[t.options.columns,(r=t.atoms.columnVisibility)==null?void 0:r.get(),n.columns]}},column_getCanHide:{fn:n=>tg(n)},column_getToggleVisibilityHandler:{fn:n=>ZSe(n)},column_toggleVisibility:{fn:(n,r)=>YF(n,r)}})},assignRowPrototype:(e,t)=>{ya("columnVisibilityFeature",e,t,{row_getVisibleCells:{fn:n=>e1e(n),memoDeps:n=>{var r,i;return[n.getAllCells(),(r=t.atoms.columnPinning)==null?void 0:r.get(),(i=t.atoms.columnVisibility)==null?void 0:i.get()]}},row_getVisibleCellsByColumnId:{fn:n=>QF(n),memoDeps:n=>{var r;return[n.getAllCells(),(r=t.atoms.columnVisibility)==null?void 0:r.get()]}}})},constructTableAPIs:e=>{Ca("columnVisibilityFeature",e,{table_getVisibleFlatColumns:{fn:()=>t1e(e),memoDeps:()=>{var t,n,r;return[(t=e.atoms.columnVisibility)==null?void 0:t.get(),(n=e.atoms.columnOrder)==null?void 0:n.get(),(r=e.atoms.grouping)==null?void 0:r.get(),e.options.columns,e.options.groupedColumnMode]}},table_getVisibleLeafColumns:{fn:()=>JF(e),memoDeps:()=>{var t,n,r;return[(t=e.atoms.columnVisibility)==null?void 0:t.get(),(n=e.atoms.columnOrder)==null?void 0:n.get(),(r=e.atoms.grouping)==null?void 0:r.get(),e.options.columns,e.options.groupedColumnMode]}},table_setColumnVisibility:{fn:t=>Uy(e,t)},table_resetColumnVisibility:{fn:t=>n1e(e,t)},table_toggleAllColumnsVisible:{fn:t=>ZF(e,t)},table_getIsAllColumnsVisible:{fn:()=>eB(e)},table_getIsSomeColumnsVisible:{fn:()=>r1e(e)},table_getToggleAllColumnsVisibilityHandler:{fn:()=>i1e(e)}})}},BOe={getInitialState(e){return{sorting:H1e(),...e}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:eP("sorting",e),isMultiSortEvent:t=>t.shiftKey}},assignColumnPrototype(e,t){ya("rowSortingFeature",e,t,{column_getAutoSortFn:{fn:n=>cB(n)},column_getAutoSortDir:{fn:n=>fB(n)},column_getSortFn:{fn:n=>W1e(n)},column_toggleSorting:{fn:(n,r,i)=>dB(n,r,i)},column_getFirstSortDir:{fn:n=>pB(n)},column_getNextSortingOrder:{fn:(n,r)=>hB(n,r)},column_getCanSort:{fn:n=>mB(n)},column_getCanMultiSort:{fn:n=>rg(n)},column_getIsSorted:{fn:n=>gB(n)},column_getSortIndex:{fn:n=>K1e(n)},column_clearSorting:{fn:n=>q1e(n)},column_getToggleSortingHandler:{fn:n=>G1e(n)}})},constructTableAPIs(e){Ca("rowSortingFeature",e,{table_setSorting:{fn:t=>Hy(e,t)},table_resetSorting:{fn:t=>uB(e,t)}})}},UOe=typeof window>"u"?O.useEffect:O.useLayoutEffect;function zOe(e,t){const[{table:n,rootSource:r}]=O.useState(()=>{const l=ROe({...e,features:{coreReactivityFeature:USe(),...e.features}});return l.Subscribe=u=>DSe({...u,source:u.source??l.store}),l.FlexRender=CSe,{table:l,rootSource:BSe(l.store,of)}}),i=n;bB(i,l=>({...l,...e}),{syncExternalState:!1});const o=i.options.state,a=r.get(),s=VF(r,t,{compare:of});return UOe(()=>{r.markCommitted(a),xB(i,o??null,of)}),O.useMemo(()=>({...n,options:e,state:s}),[n,e,s])}const HOe={rowSortingFeature:BOe,columnFilteringFeature:LOe,columnVisibilityFeature:FOe};function VOe({direction:e}){return e==="asc"?d.jsx("span",{"aria-hidden":"true",children:"↑"}):e==="desc"?d.jsx("span",{"aria-hidden":"true",children:"↓"}):d.jsx("span",{"aria-hidden":"true",className:"opacity-30",children:"↕"})}function WOe({header:e,className:t}){const n=e.column.getIsSorted(),r=Ya(e.column.columnDef.header,e.getContext());return d.jsx(Ge,{className:`whitespace-nowrap p-0 ${t}`,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:d.jsxs(Xe,{variant:"ghost",size:"xs",onClick:e.column.getToggleSortingHandler(),className:"w-full justify-start gap-1 px-3 py-2 font-normal",children:[r,d.jsx(VOe,{direction:n})]})})}function KOe({header:e}){const t=e.column.getFilterValue(),n=typeof t=="string"?t:"",[r,i]=O.useState(n);O.useEffect(()=>i(n),[n]);const o=()=>{r!==n&&e.column.setFilterValue(r)};return d.jsx(_s,{value:r,"aria-label":`Filter by ${e.column.id}`,placeholder:"Filter…",className:"w-full py-0.5",onChange:a=>i(a.target.value),onBlur:o,onKeyDown:a=>{a.key==="Enter"&&o(),a.key==="Escape"&&i(n)}})}function qOe({table:e,sticky:t,menu:n}){var s;const r=((s=e.getHeaderGroups().at(-1))==null?void 0:s.headers)??[],i=r.some(l=>l.column.getCanFilter()),o=t?"sticky top-0 z-10 bg-panel":"",a=t?"sticky top-8 z-10 bg-panel":"";return d.jsxs(Id,{children:[d.jsxs(kr,{children:[r.map(l=>l.column.getCanSort()?d.jsx(WOe,{header:l,className:o},l.id):d.jsx(Ge,{className:`whitespace-nowrap ${o}`,children:Ya(l.column.columnDef.header,l.getContext())},l.id)),n?d.jsx(Ge,{className:`w-px whitespace-nowrap text-right ${o}`,children:n}):null]}),i&&d.jsxs(kr,{children:[r.map(l=>d.jsx(Ge,{className:`py-1 ${a}`,children:l.column.getCanFilter()?d.jsx(KOe,{header:l}):null},l.id)),n?d.jsx(Ge,{className:a}):null]})]})}function GOe(e,t){const n=e.replace(/\{(\w+)\}/g,(r,i)=>String(t[i]??""));return/^\s*(javascript|data|vbscript):/i.test(n)?"#":n}function XOe({spec:e,row:t}){const n=String(t[e.key]??"");return e.link?d.jsx("a",{className:"text-sky-400 hover:underline",href:GOe(e.link.href,t),...e.link.external?{target:"_blank",rel:"noreferrer"}:{},children:n}):d.jsx(d.Fragment,{children:n})}function YOe(e){return e.map(t=>({id:t.key,accessorFn:n=>n[t.key],header:t.label,enableSorting:t.sortable===!0,enableColumnFilter:t.filterable===!0,enableHiding:t.hideable===!0,cell:({row:n})=>d.jsx(XOe,{spec:t,row:n.original})}))}const QOe="max-h-[28rem]";function JOe(e,t,n){return`${t.map(r=>String(e[r.key]??"")).join("|")}#${n}`}function ZOe({columns:e,rows:t,sort:n,onSortChange:r,filters:i,onFiltersChange:o,scrolls:a}){const[s,l]=O.useState({}),u=O.useMemo(()=>YOe(e),[e]),c=n?[{id:n.key,desc:n.dir==="desc"}]:[],f=Object.entries(i??{}).map(([x,g])=>({id:x,value:g})),p=zOe({features:HOe,columns:u,data:t,state:{sorting:c,columnFilters:f,columnVisibility:s},onColumnVisibilityChange:l,onSortingChange:x=>{const m=(typeof x=="function"?x(c):x)[0];r==null||r(m?{key:m.id,dir:m.desc?"desc":"asc"}:void 0)},onColumnFiltersChange:x=>{const g=typeof x=="function"?x(f):x,m={};for(const b of g)typeof b.value=="string"&&b.value!==""&&(m[b.id]=b.value);o==null||o(m)},manualSorting:!0,manualFiltering:!0,getRowId:(x,g)=>JOe(x,e,g)}),h=p.getAllLeafColumns(),v=h.some(x=>x.getCanHide()),y=p.getVisibleLeafColumns().length+(v?1:0);return d.jsxs(Md,{containerClassName:a?QOe:"",children:[d.jsx(qOe,{table:p,sticky:a===!0,...v?{menu:d.jsx(PSe,{columns:h})}:{}}),d.jsxs(Dd,{children:[t.length===0?d.jsx(kr,{children:d.jsx(nt,{colSpan:y,className:"py-6 text-center text-muted-foreground",children:"No data in this window."})}):null,p.getRowModel().rows.map(x=>d.jsxs(kr,{children:[x.getVisibleCells().map(g=>d.jsx(nt,{className:"whitespace-nowrap text-foreground",children:Ya(g.column.columnDef.cell,g.getContext())},g.id)),v?d.jsx(nt,{}):null]},x.id))]})]})}function ePe(e,t){return t==="percent"?`${Math.round(e*100)}%`:t==="duration"?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:t==="rate"?`${new Intl.NumberFormat().format(Math.round(e))}/hr`:new Intl.NumberFormat().format(e)}function PB(e){if(typeof e!="object"||e===null||!("rows"in e))return[];const t=e.rows;return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null):[]}function mx(e,t){if(typeof e!="object"||e===null||!(t in e))return;const n=Reflect.get(e,t);return typeof n=="number"&&Number.isFinite(n)?n:void 0}function tPe(e){const t=PB(e);return{rows:t,total:mx(e,"total")??t.length,page:mx(e,"page")??1,limit:mx(e,"limit")??0}}function nPe({title:e}){return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsx("p",{className:"border-b border-line px-4 py-2 text-xs font-medium text-foreground",children:e}),d.jsx("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:"No data in this window."})]})}function rPe({page:e,totalPages:t,onPageChange:n}){return d.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[d.jsx(Xe,{variant:"outline",size:"xs",disabled:e<=1,onClick:()=>n==null?void 0:n(e-1),className:"px-1.5 text-muted-foreground",children:"Prev"}),d.jsxs("span",{children:["Page ",e," of ",t]}),d.jsx(Xe,{variant:"outline",size:"xs",disabled:e>=t,onClick:()=>n==null?void 0:n(e+1),className:"px-1.5 text-muted-foreground",children:"Next"})]})}function iPe({panel:e,data:t,onPageChange:n,requestedPage:r,sort:i,onSortChange:o,filters:a,onFiltersChange:s,onSelect:l}){const u=l?{onSelect:l}:{};switch(e.kind){case"stat":{const c=t??{};return d.jsx(Pt,{label:e.title,value:ePe(c.value??0,e.format),...c.value!==void 0?{currentValue:c.value}:{},...c.delta!==void 0?{delta:c.delta}:{},...c.deltaLabel?{deltaLabel:c.deltaLabel}:{},...e.spark&&c.spark?{spark:c.spark}:{},...e.thresholds?{thresholds:e.thresholds}:{},...e.accent?{accent:e.accent}:{}})}case"distribution":{const c=t??{};return d.jsx(SSe,{title:e.title,buckets:c.buckets??[],...c.p50!==void 0?{p50:c.p50}:{},...c.p95!==void 0?{p95:c.p95}:{},...c.p99!==void 0?{p99:c.p99}:{},...u})}case"gauge":{const c=t??{};return d.jsx(OSe,{title:e.title,value:c.value??0,...e.min!==void 0?{min:e.min}:{},...e.max!==void 0?{max:e.max}:{}})}case"breakdown":{const c=t??{};return d.jsx(xSe,{title:e.title,segments:c.segments??[],...e.style?{style:e.style}:{},...u})}case"timeseries":{const c=(t==null?void 0:t.rows)??[],f=e.series[0];return e.style==="stacked"?d.jsx(GO,{title:e.title,data:c,series:e.series,...u}):d.jsx(Us,{title:e.title,data:c.map(p=>({label:p.label,value:f?Number(p[f]??0):0})),...u})}case"topN":{const c=(t==null?void 0:t.items)??[],f=e.limit?c.slice(0,e.limit):c;return f.length===0?d.jsx(nPe,{title:e.title}):d.jsx(ds,{title:e.title,data:f,horizontal:!0,truncateLabel:32,...u})}case"table":{const c=d.jsx(ZOe,{columns:e.columns,rows:PB(t),scrolls:e.paged===!0,sort:i,...o?{onSortChange:o}:{},filters:a,...s?{onFiltersChange:s}:{}});if(e.paged){const{rows:f,total:p,page:h,limit:v}=tPe(t),y=Math.max(1,Math.ceil(p/(v||f.length||1)));return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2",children:[d.jsx("p",{className:"text-xs font-medium text-foreground",children:e.title}),d.jsx(rPe,{page:r??h,totalPages:y,...n?{onPageChange:n}:{}})]}),c]})}return d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsx("p",{className:"border-b border-line px-4 py-2 text-xs font-medium text-foreground",children:e.title}),c]})}default:return null}}const oPe="sort",aPe="dir",sPe="filter.";function lPe(e,t){const n=Object.entries(t.filters??{}).filter(([,i])=>i!=="");if(!t.paging&&!t.sort&&n.length===0)return e;const r={...e};t.paging&&(r.page=t.paging.page,r.limit=t.paging.limit),t.sort&&(r[oPe]=t.sort.key,r[aPe]=t.sort.dir);for(const[i,o]of n)r[`${sPe}${i}`]=o;return r}const uPe={1:"",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-2 lg:grid-cols-4"},cPe=50;function fPe(e){return"drilldown"in e?e.drilldown:void 0}function dPe({status:e}){const t=e==="live";return d.jsxs("span",{"data-telescope-status":e,className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t?"tint-good":"tint-warn"}`,children:[d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${t?"animate-pulse bg-good":"bg-warn"}`}),t?"live":e]})}function pPe({ext:e,panel:t,focus:n,onSelect:r}){const i=t.kind==="table"&&t.paged===!0,[o,a]=O.useState(1),[s,l]=O.useState(void 0),[u,c]=O.useState({}),f=n?{[n.param]:n.value}:void 0,p=f?{...t.data.query,...f}:t.data.query,h=lPe(p,{...i?{paging:{page:o,limit:cPe}}:{},...s?{sort:s}:{},filters:u}),v=N5(e,t.data.provider,h);return v.isError?d.jsxs("div",{className:"tint-bad rounded-lg border px-4 py-3 text-sm",children:['Failed to load "',t.title,'".']}):d.jsx(iPe,{panel:t,data:v.data,...i?{onPageChange:a,requestedPage:o}:{},sort:s,onSortChange:y=>{a(1),l(y)},filters:u,onFiltersChange:y=>{a(1),c(y)},...r?{onSelect:r}:{}})}function hPe(){var u,c;const{dashboardId:e}=Sg(),t=Is(),{status:n}=K5(),[r,i]=O.useState(null),o=(c=(u=t.data)==null?void 0:u.dashboards)==null?void 0:c.find(f=>f.id===e);if(!o)return d.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Dashboard not found."});const a=(e==null?void 0:e.split(".")[0])??"",s=o.sections??[{panels:o.panels,cols:2}];function l(f,p){const h=p.id??p.label,v=p.series?`${p.series} · ${p.label}`:p.label;i(y=>(y==null?void 0:y.param)===f&&y.value===h?null:{param:f,value:h,label:v})}return d.jsxs("div",{className:"p-4",children:[d.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[d.jsx("h2",{className:"text-sm font-semibold text-foreground",children:o.label}),d.jsx(dPe,{status:n}),r&&d.jsxs("span",{className:"tint-brand inline-flex items-center gap-1 rounded border py-0.5 pl-1.5 text-[10px]",children:[r.param,": ",r.label,d.jsx(Xe,{variant:"ghost",size:"xs",className:"px-1 text-inherit",onClick:()=>i(null),children:"Clear"})]})]}),s.map((f,p)=>d.jsxs("section",{className:"mb-6",children:[f.title&&d.jsx("p",{className:"mb-2 text-[10px] uppercase tracking-wide text-muted-foreground",children:f.title}),d.jsx("div",{className:`grid grid-cols-1 gap-3 ${uPe[f.cols??2]}`,children:f.panels.map(h=>{const v=fPe(h);return d.jsx(pPe,{ext:a,panel:h,focus:r,...v?{onSelect:y=>l(v.param,y)}:{}},`${h.kind}-${h.title}`)})})]},f.title??`s${p}`))]})}function mPe({profile:e,selected:t,onSelect:n}){return d.jsxs("button",{type:"button",onClick:n,className:`flex w-full flex-col gap-0.5 border-b border-line-soft px-3 py-2 text-left hover:bg-panel ${t?"bg-panel":""}`,children:[d.jsx("span",{className:"truncate font-mono text-xs text-foreground",title:e.familyHash??e.id,children:e.familyHash??"(unlabelled)"}),d.jsxs("span",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[d.jsx("span",{children:e.durationMs!==null?fd(e.durationMs):"—"}),e.tags.includes("manual")&&d.jsx("span",{className:"text-warn",children:"manual"}),e.tags.includes("sampled")&&d.jsx("span",{className:"text-sky-400",children:"sampled"}),d.jsx("span",{className:"ml-auto",children:zs(new Date(e.createdAt).getTime())})]})]})}function gPe({hot:e}){return e.length===0?d.jsx("p",{className:"text-xs text-muted-foreground",children:"No hot frames."}):d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx("span",{className:"flex-1",children:"Function"}),d.jsx("span",{className:"w-16 text-right",children:"Self"}),d.jsx("span",{className:"w-12 text-right",children:"%"})]}),e.map(t=>d.jsxs("div",{className:"flex items-center gap-2 border-b border-line-soft px-3 py-1 text-[11px] last:border-0",children:[d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",title:`${t.name} ${t.file}`,children:[t.name,t.file&&d.jsx("span",{className:"ml-1 text-muted-foreground",children:t.file})]}),d.jsx("span",{className:"w-16 text-right tabular-nums text-foreground",children:fd(t.selfMs)}),d.jsx("span",{className:"w-12 text-right tabular-nums text-warn",children:t.selfPct.toFixed(1)})]},`${t.name}:${t.file}`))]})}function yPe({id:e}){const{data:t,isLoading:n}=V5(e);if(n)return d.jsx("p",{className:"text-muted-foreground",children:"Loading profile…"});if(!t)return d.jsx("p",{className:"text-muted-foreground",children:"Profile not found."});const r=t.content;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-1",children:[d.jsx("h3",{className:"font-mono text-sm text-foreground",children:r.label??"(unlabelled)"}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[fd(r.durationMs)," · ",r.sampleCount," samples · ",r.reason]})]}),d.jsx(Vbe,{tree:r.tree}),d.jsx(gPe,{hot:r.hot})]})}function vPe({pendingManual:e}){const[t,n]=O.useState(1),[r,i]=O.useState(""),o=W5();return d.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-line bg-panel/40 px-3 py-2",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Capture next"}),d.jsx("input",{type:"number",min:1,value:t,onChange:a=>n(Math.max(1,Number(a.target.value))),className:"w-14 rounded border border-line bg-background px-1 py-0.5 text-xs text-foreground"}),d.jsx("span",{className:"text-[10px] text-muted-foreground",children:"request(s) matching"}),d.jsx("input",{type:"text",placeholder:"any route (e.g. GET /users/:id)",value:r,onChange:a=>i(a.target.value),className:"w-56 rounded border border-line bg-background px-1 py-0.5 text-xs text-foreground"}),d.jsx("button",{type:"button",disabled:o.isPending,onClick:()=>o.mutate({count:t,...r?{label:r}:{}}),className:"rounded bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50",children:o.isPending?"Arming…":"Arm capture"}),e>0&&d.jsxs("span",{className:"text-[10px] text-warn",children:[e," pending"]}),o.isError&&d.jsx("span",{className:"text-[10px] text-bad",children:o.error instanceof Error?o.error.message:"Failed to arm (mutations disabled?)"})]})}function xPe(){var u,c,f,p,h;const e=Is(),t=z5(),{data:n,isLoading:r}=H5(100),i=(n==null?void 0:n.data)??[],[o,a]=O.useState(null),s=((c=(u=e.data)==null?void 0:u.profiling)==null?void 0:c.enabled)??((f=t.data)==null?void 0:f.enabled)??!1,l=o??((p=i[0])==null?void 0:p.id)??null;return s?d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("h2",{className:"text-sm text-brand",children:"CPU Profiles"}),t.data&&d.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["sampling ",(t.data.sampleRate*100).toFixed(0),"% · ",t.data.active," active"]})]}),d.jsx(vPe,{pendingManual:((h=t.data)==null?void 0:h.pendingManual)??0}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("div",{className:"w-64 shrink-0 rounded-lg border border-line",children:r?d.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"Loading…"}):i.length===0?d.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"No profiles captured yet."}):i.map(v=>d.jsx(mPe,{profile:v,selected:v.id===l,onSelect:()=>a(v.id)},v.id))}),d.jsx("div",{className:"min-w-0 flex-1",children:l?d.jsx(yPe,{id:l}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Select a profile to view its flamegraph."})})]})]}):d.jsxs("div",{className:"space-y-3 p-4",children:[d.jsx("h2",{className:"text-sm text-brand",children:"CPU Profiles"}),d.jsxs("div",{className:"rounded-lg border border-line bg-panel/40 p-6 text-xs text-muted-foreground",children:[d.jsx("p",{className:"mb-2 text-foreground",children:"CPU profiling is disabled."}),d.jsxs("p",{children:["Enable it with"," ",d.jsxs("code",{className:"rounded bg-panel-2 px-1 text-brand",children:["profiling: ","{"," enabled: true ","}"]})," ","in ",d.jsx("code",{className:"rounded bg-panel-2 px-1",children:"TelescopeModule.forRoot"}),". Profiling is opt-in because it carries real CPU overhead; when off there is zero cost on the request path."]})]})]})}const bPe={scheduled:"text-sky-300 bg-sky-500/10",manual:"text-warn tint-warn"};function wPe({trigger:e}){return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${bPe[e]}`,children:e})}function SPe({type:e,count:t}){return d.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-panel-2/80 px-1.5 py-0.5 text-[10px] text-foreground",children:[d.jsx("span",{className:"text-muted-foreground",children:jg(e)}),d.jsx("span",{className:"tabular-nums text-foreground",children:t})]})}function OPe(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function PPe(e,t){if(e===null)return"—";const n=new Date(e).getTime()-t;if(Number.isNaN(n))return"—";if(n<=0)return"now";const r=Math.round(n/1e3);return r<60?`~${r}s`:`~${Math.floor(r/60)}m ${r%60}s`}function jPe(){const[e,t]=O.useState(()=>Date.now());return O.useEffect(()=>{const n=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(n)},[]),e}function EPe({config:e,nextRunAt:t,nowMs:n}){const r=Object.entries(e.perType??{});return d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Pt,{label:"Window",value:rf(e.afterMs),accent:"text-brand"}),d.jsx(Pt,{label:"Interval",value:rf(e.intervalMs)}),d.jsx(Pt,{label:"Keep last",value:e.keepLast!=null?e.keepLast.toLocaleString():"unbounded"}),d.jsx(Pt,{label:"Next prune",value:PPe(t,n),accent:"text-sky-300",...r.length>0?{hint:`${r.length} per-type override(s)`}:{}}),r.length>0&&d.jsxs("div",{className:"col-span-2 rounded-lg border border-line bg-panel/40 p-3 sm:col-span-4",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Per-type overrides"}),d.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.map(([i,o])=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-panel-2/80 px-1.5 py-0.5 text-[10px] text-foreground",children:[d.jsx("span",{className:"text-muted-foreground",children:jg(i)}),d.jsx("span",{className:"tabular-nums text-foreground",children:rf(o)})]},i))})]})]})}function APe({run:e}){const t=Object.entries(e.deletedByType);return d.jsxs(kr,{className:"border-t border-line/60 align-top hover:bg-panel/40",children:[d.jsx(nt,{className:"text-xs text-muted-foreground",children:zs(new Date(e.at).getTime())}),d.jsx(nt,{children:d.jsx(wPe,{trigger:e.trigger})}),d.jsx(nt,{className:"text-xs tabular-nums text-muted-foreground",children:OPe(e.durationMs)}),d.jsx(nt,{className:"text-xs tabular-nums text-foreground",children:e.deletedTotal.toLocaleString()}),d.jsx(nt,{children:t.length>0?d.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(([n,r])=>d.jsx(SPe,{type:n,count:r},n))}):d.jsx("span",{className:"text-muted-foreground",children:"—"})}),d.jsx(nt,{className:"text-xs tabular-nums text-muted-foreground",children:e.archivedTotal!=null?e.archivedTotal.toLocaleString():"—"}),d.jsx(nt,{className:"text-xs text-bad",children:e.error??""})]})}function CPe(){var c;const{data:e,isLoading:t,isError:n}=j5(),r=Is(),i=b$(),o=jPe(),a=((c=r.data)==null?void 0:c.pruneEnabled)??!1,s=(e==null?void 0:e.runs)??[],l=(e==null?void 0:e.config)??null;async function u(){if(globalThis.confirm("Prune now deletes entries older than the retention window. Continue?"))try{const f=await i.mutateAsync();globalThis.alert(`Pruned ${f.pruned} ${f.pruned===1?"entry":"entries"}.`)}catch{globalThis.alert("Prune failed.")}}return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between px-1",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Prune activity"}),d.jsx(Xe,{onClick:u,disabled:!a||i.isPending,title:a?"Run a prune cycle now":"Mutations are disabled (configure authorizeAction to enable on-demand pruning).",children:i.isPending?"Pruning…":"Prune now"})]}),l?d.jsx(EPe,{config:l,nextRunAt:(e==null?void 0:e.nextRunAt)??null,nowMs:o}):d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-6 text-center text-xs text-muted-foreground",children:"No retention window is configured. Set a `prune` option to enable automatic pruning."}),t&&d.jsx("p",{className:"px-1 py-2 text-xs text-muted-foreground",children:"Loading prune runs…"}),n&&d.jsx("p",{className:"px-1 py-2 text-xs text-bad",children:"Failed to load prune runs."}),!t&&!n&&s.length===0&&d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-12 text-center text-xs text-muted-foreground",children:"No prune runs recorded yet on this pod."}),s.length>0&&d.jsx("div",{className:"rounded-lg border border-line",children:d.jsxs(Md,{className:"min-w-[760px] text-left text-sm",children:[d.jsx(Id,{children:d.jsxs(kr,{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx(Ge,{children:"Time"}),d.jsx(Ge,{children:"Trigger"}),d.jsx(Ge,{children:"Duration"}),d.jsx(Ge,{children:"Deleted"}),d.jsx(Ge,{children:"By type"}),d.jsx(Ge,{children:"Archived"}),d.jsx(Ge,{children:"Error"})]})}),d.jsx(Dd,{children:s.map((f,p)=>d.jsx(APe,{run:f},`${f.at}:${p}`))})]})})]})}function TPe(){var s;const[e,t]=O.useState("1h"),n=Oi(),{data:r,isLoading:i}=S$(e),o=WS({window:e,buckets:60}),a=YO(((s=o.data)==null?void 0:s.buckets)??[]);return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Pulse"}),d.jsx(zd,{value:e,onChange:t})]}),d.jsx(GO,{title:"Throughput by type",series:a,data:UF(o.data)}),i||!r?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):d.jsx(q0e,{report:r,onSelectEntry:l=>n(`/entries/view/${l}`),onSelectFamily:l=>n(`/entries/query?familyHash=${encodeURIComponent(l)}`),onSelectRoute:l=>n(`/entries/request?familyHash=${encodeURIComponent(l)}`),onSelectOutgoing:l=>n(`/entries/http_client?familyHash=${encodeURIComponent(l)}`)})]})}const _Pe="var(--bad)",RPe="var(--good)";function kPe(e){return((e==null?void 0:e.queues)??[]).map(t=>({label:t.queue,value:Number((t.failureRate*100).toFixed(1)),color:t.failureRate>0?_Pe:RPe}))}function NPe(){const[e,t]=O.useState("1h"),{data:n,isLoading:r}=O$(e);return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Queue metrics"}),d.jsx(zd,{value:e,onChange:t})]}),d.jsx(ds,{title:"Failure rate by queue",valueLabel:"fail %",data:kPe(n)}),r||!n?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):d.jsx(G0e,{report:n,sparkline:i=>d.jsx(Y0e,{queue:i,window:e})})]})}const $Pe=[{to:"/queues",label:"Manage",end:!0},{to:"/queues/metrics",label:"Metrics",end:!1}];function MPe(){return d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"flex gap-1 border-b border-line px-4 pt-3",children:$Pe.map(e=>d.jsx(eh,{to:e.to,end:e.end,className:({isActive:t})=>`rounded-t-md px-3 py-1.5 text-xs transition-colors ${t?"bg-panel text-brand":"text-muted-foreground hover:text-foreground"}`,children:e.label},e.to))}),d.jsx(Cz,{})]})}const IPe={cron:"tint-brand",interval:"tint-muted",timeout:"text-warn tint-warn"};function DPe({kind:e}){return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${IPe[e]}`,children:e})}function LPe({running:e}){return e==null?d.jsx("span",{className:"rounded bg-panel-2 px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"unknown"}):d.jsxs("span",{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${e?"tint-good":"tint-bad"}`,children:[d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${e?"bg-good":"bg-bad"}`}),e?"active":"stopped"]})}function FPe({status:e}){if(e===null)return d.jsx("span",{className:"text-muted-foreground",children:"—"});const t=e==="completed"?"tint-good":"tint-bad";return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wide ${t}`,children:e})}function BPe(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function UPe(e){if(e===null)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString()}function zPe({task:e}){return d.jsxs(kr,{className:"border-t border-line/60 hover:bg-panel/40",children:[d.jsx(nt,{className:"font-medium text-foreground",children:e.name}),d.jsx(nt,{children:d.jsx(DPe,{kind:e.kind})}),d.jsx(nt,{children:d.jsx(LPe,{running:e.running})}),d.jsx(nt,{className:"font-mono text-xs text-muted-foreground",children:e.schedule}),d.jsx(nt,{className:"text-xs text-muted-foreground",children:UPe(e.nextRunAt)}),d.jsx(nt,{className:"text-xs text-muted-foreground",children:zs(HPe(e.lastRunAt))}),d.jsx(nt,{className:"text-xs tabular-nums text-muted-foreground",children:BPe(e.lastDurationMs)}),d.jsx(nt,{children:d.jsx(FPe,{status:e.lastStatus})})]})}function HPe(e){if(e===null)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function VPe(){const{data:e,isLoading:t,isError:n}=x5(),r=(e==null?void 0:e.tasks)??[],i=r.filter(a=>a.running===!0).length,o=r.filter(a=>a.running===!1).length;return d.jsxs("div",{className:"space-y-3 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between px-1",children:[d.jsx("h3",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Scheduled tasks"}),r.length>0&&d.jsxs("div",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wide",children:[d.jsxs("span",{className:"text-good",children:[i," active"]}),o>0&&d.jsxs("span",{className:"text-bad",children:[o," stopped"]}),d.jsxs("span",{className:"text-muted-foreground",children:[r.length," total"]})]})]}),t&&d.jsx("p",{className:"px-1 py-2 text-xs text-muted-foreground",children:"Loading schedules…"}),n&&d.jsx("p",{className:"px-1 py-2 text-xs text-bad",children:"Failed to load schedules."}),!t&&!n&&r.length===0&&d.jsx("div",{className:"rounded-lg border border-dashed border-line px-4 py-12 text-center text-xs text-muted-foreground",children:"No scheduled tasks detected. Register a ScheduleManager (the @nestjs/schedule watcher) to populate this console."}),r.length>0&&d.jsx("div",{className:"rounded-lg border border-line",children:d.jsxs(Md,{className:"min-w-[760px] text-left text-sm",children:[d.jsx(Id,{children:d.jsxs(kr,{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:[d.jsx(Ge,{children:"Name"}),d.jsx(Ge,{children:"Kind"}),d.jsx(Ge,{children:"Active"}),d.jsx(Ge,{children:"Schedule"}),d.jsx(Ge,{children:"Next run"}),d.jsx(Ge,{children:"Last run"}),d.jsx(Ge,{children:"Duration"}),d.jsx(Ge,{children:"Status"})]})}),d.jsx(Dd,{children:r.map(a=>d.jsx(zPe,{task:a},`${a.kind}:${a.name}`))})]})})]})}function WPe(){const{traceId:e=""}=Sg(),t=Oi(),[n,r]=O.useState("waterfall"),{data:i,isLoading:o}=w$({traceId:e}),a=(i==null?void 0:i.data)??[],{data:s,isLoading:l}=L5(e);return d.jsxs("div",{className:"p-4",children:[d.jsx("button",{type:"button",onClick:()=>t("/entries"),className:"mb-4 text-xs text-muted-foreground hover:text-foreground",children:"← entries"}),d.jsxs("div",{className:"mb-4 flex flex-wrap items-baseline gap-3 border-b border-line pb-3",children:[d.jsx("h2",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Trace"}),d.jsx("span",{className:"max-w-md truncate font-mono text-xs text-foreground",title:e,children:e}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[a.length," ",a.length===1?"entry":"entries"]}),d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[d.jsxs("div",{className:"flex overflow-hidden rounded border border-line text-[11px]",children:[d.jsx("button",{type:"button",onClick:()=>r("waterfall"),className:`px-2.5 py-1 transition-colors ${n==="waterfall"?"bg-panel-2 text-foreground":"bg-panel text-muted-foreground hover:text-foreground"}`,children:"Waterfall"}),d.jsx("button",{type:"button",onClick:()=>r("entries"),className:`border-l border-line px-2.5 py-1 transition-colors ${n==="entries"?"bg-panel-2 text-foreground":"bg-panel text-muted-foreground hover:text-foreground"}`,children:"Entries"})]}),a.length>0?d.jsx("button",{type:"button",onClick:()=>qO(`telescope-trace-${e}.json`,a),className:"rounded border border-line bg-panel px-2.5 py-1 text-[11px] text-foreground transition-colors hover:border-line hover:bg-panel-2 hover:text-foreground",children:"Download JSON"}):null]})]}),n==="waterfall"?l?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):s===void 0||s.spans.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No spans in this trace"}):d.jsx(Bbe,{waterfall:s,onSelect:u=>t(`/entries/view/${u}`)}):o?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):a.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No entries in this trace"}):d.jsx(_F,{entries:a,onSelect:u=>t(`/entries/view/${u}`)})]})}function KPe(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function qPe({trace:e}){const t=Oi(),n=e.rootLabel??e.traceId;return d.jsxs("button",{type:"button",onClick:()=>t(`/traces/${e.traceId}`),className:"flex w-full items-center gap-3 border-b border-line-soft px-3 py-2 text-left hover:bg-panel",children:[d.jsx("span",{className:"flex shrink-0 items-center gap-1","aria-hidden":"true",children:e.types.map(r=>d.jsx("span",{className:`h-2 w-2 rounded-full ${KS(r)}`,title:r},r))}),d.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",title:n,children:n}),d.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[e.entryCount," ",e.entryCount===1?"entry":"entries"]}),d.jsx("span",{className:"w-16 shrink-0 text-right text-xs text-muted-foreground",children:KPe(e.totalDurationMs)}),d.jsx("span",{className:"w-16 shrink-0 text-right text-xs text-muted-foreground",children:zs(new Date(e.lastAt).getTime())})]})}function GPe(){const[e,t]=O.useState("1h"),{data:n,isLoading:r}=D5(e),i=(n==null?void 0:n.traces)??[];return d.jsxs("div",{className:"space-y-4 p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm text-brand",children:"Traces"}),d.jsx(zd,{value:e,onChange:t})]}),r?d.jsx("p",{className:"text-muted-foreground",children:"Loading…"}):i.length===0?d.jsx("p",{className:"text-muted-foreground",children:"No traces in this window"}):d.jsx("div",{className:"border border-line",children:i.map(o=>d.jsx(qPe,{trace:o},o.traceId))})]})}const XPe=new CU;function YPe(){return d.jsx(Fz,{children:d.jsx(Bwe,{children:d.jsxs(_z,{children:[d.jsx(bn,{path:"/",element:d.jsx(lSe,{})}),d.jsx(bn,{path:"/entries",element:d.jsx(eR,{})}),d.jsx(bn,{path:"/entries/view/:id",element:d.jsx(fSe,{})}),d.jsx(bn,{path:"/entries/:type",element:d.jsx(eR,{})}),d.jsx(bn,{path:"/traces",element:d.jsx(GPe,{})}),d.jsx(bn,{path:"/traces/:traceId",element:d.jsx(WPe,{})}),d.jsx(bn,{path:"/pulse",element:d.jsx(TPe,{})}),d.jsxs(bn,{path:"/queues",element:d.jsx(MPe,{}),children:[d.jsx(bn,{index:!0,element:d.jsx(uSe,{})}),d.jsx(bn,{path:"metrics",element:d.jsx(NPe,{})})]}),d.jsx(bn,{path:"/schedules",element:d.jsx(VPe,{})}),d.jsx(bn,{path:"/prunes",element:d.jsx(CPe,{})}),d.jsx(bn,{path:"/exports",element:d.jsx(vSe,{})}),d.jsx(bn,{path:"/profiles",element:d.jsx(xPe,{})}),d.jsx(bn,{path:"/ext/:dashboardId",element:d.jsx(hPe,{})})]})})})}function QPe(){const{phase:e,modes:t}=ZO();return e==="loading"?d.jsx("div",{className:"min-h-screen bg-background","data-testid":"auth-loading"}):e==="screen"?d.jsx(Pwe,{modes:t}):d.jsx(YPe,{})}function JPe(){return d.jsx(Rwe,{children:d.jsx(Xz,{children:d.jsx(tU,{client:XPe,children:d.jsx(xwe,{children:d.jsx(QPe,{})})})})})}const dR=document.getElementById("root");dR&&LN(dR).render(d.jsx(O.StrictMode,{children:d.jsx(JPe,{})}));